-
Notifications
You must be signed in to change notification settings - Fork 74
/
ser2net.yaml.5
1375 lines (1209 loc) · 43.4 KB
/
ser2net.yaml.5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.TH ser2net.yaml 5 06/02/01 "Serial to network proxy configuration file"
.SH NAME
/etc/ser2net/ser2net.yaml \- Serial to network proxy configuration file
.SH DESCRIPTION
ser2net used to be a program for connection network connections to
serial ports. It's now a program for connecting accepter gensio to
connecting gensios. See gensio(5) for details on gensios.
ser2net is configured with YAML, which is flexible and easy to use.
Look at yaml documentation on the internet for how that works.
However, there are two types of YAML files that ser2net can use:
version 1 and version 2. Version 1 YAML files have more capability
than version 2 files, but they are non-standard YAML, a standard YAML
parser cannot read them. ser2net will autodetect the version based
upon what it finds.
In version 2, you can have multiple documents in a file and ser2net
will read all of them. YAML separates documents in a file with a
single "---" by itself at the beginning of a line. Though you can
only have one set of defaults, defines, connections, etc. in a
document, you can have multiple documents in a file to allow more than
one. You might, for instance, group all the connections with a
certain set of defaults into its own document.
.SH DEFINE SPECIFICATION
YAML has the ability to create aliases that can be used elsewhere in
the configuration file. These can be used for tying things together
between parts of the file, or (as an extension to YAML) for string
substitution.
You define an alias in version 1 with the following:
.IP
define: &aliasname alias text
.PP
This will create an alias with the given name. Then you can use it
elsewhere like:
.IP
banner: *aliasname
.PP
and the banner will be "alias text". Unlike standard YAML, you can
also use this inside strings using
.IP
*(aliasname)
.PP
so if you have
.IP
banner: My banner *(aliasname) is here
.PP
The banner will be "My banner alias text is here". See the YAML
documentation for how spaces are handled, but as a note, use quotes if
you are not sure, like:
.IP
define: &aliasname "alias text"
.br
banner: "My banner *(aliasname) is here"
.PP
If you for some reason need "*(" in your text, use "*(*" for that.
For version 2 YAML files, the definition is:
.IP
defines:
.br
aliasname: alias text
.br
aliasname2: alias text 2
.PP
where you can list as many aliases as you like. In version 2, you
always refer to an alias with "=" instead of "*", like:
.IP
.br
banner: "My banner =(aliasname) is here"
.PP
and if you for some reason need "=(" in your text, use "=(=" for that.
In version 2, per standard YAML, you can only have one defines
section, so they must all be together.
.SH INCLUDING OTHER FILES
A YAML file may include another file at the main level, with:
.IP
include: <filename>
.PP
This filename can include globs, and all referenced files are
included. These must be full yaml files, but are included in context
at this point, with all the defines, connection names, etc. This can
let you have individual connections in individual files to ease
management.
In version 2, You can only have one include in each document for legal
YAML, so if you need multiple includes you will have to have multiple
documents.
.SH USING EXTERNAL FILES
You may want to store passwords and such in external files for better
security. For version 1, putting "*{filename}" in a YAML scalar will
put the file's contents into the scalar at that point. If you need a
"*{" in the string for some reason, use "*{*".
For version 2, use "={filename}" instead. And "={=" to include a "={"
in a file.
.SH CONNECTION SPECIFICATION
A connection is a structure that describes how to connect an accepting
gensio to a connecting gensio.
An connection specification in version 1 starts with:
.RS
connection: &<alias>
.RS
<definition>
.RE
.RE
In version 2, it's specified as:
.RS
connections:
.RS
<alias>:
.RS
<definition>
.RE
.RE
.RE
In version 2, all the connections must occur together in one place.
The <definition> of a connection is the same for version 1 and version
2:
.RS
accepter: <accepter>
.br
timeout: <number>
.br
enable: on|off
.br
connector: <connector>
.br
options:
.RS
<option name>: <option value>
.br
<option name>: <option value>...
.RE
.RE
An <accepter> is an accepting gensio specification. When ser2net
receives a connection on the accepter, it attempts to make a connection
to the <connector> gensio. The alias is required, it sets the name
that is used for the connection in the admin interface and for
referencing from rotators.
If the connection receive no activity in <timeout> seconds, ser2net
will close the connection. Setting <timeout> to zero disables the
timeout. The timeout field is optional and defaults to zero.
The connection may be enabled or disabled with the enable. The enable
field is optional and defaults to on. This is useful for temporarily
disabling port by setting enable to off and sending a SIGHUP. If
there are users connected and you disable a port and send a SIGHUP,
the users will be kicked off.
An option is a configuration setting that doesn't have anything to do
with specific gensios, they are controls for ser2net in general. The
option section is optional.
See gensio(5) for a lot of information about the specific gensios
available.
To allow a TCP connection to a serial port and ignore modem control,
you can do:
.RS
connection: &toS0tcp
.RS
accepter: tcp,1234
.br
connector: serialdev,/dev/ttyS0,local
.RE
.RE
.PP
Both accepting and connecting gensios stack, so if you want to add
telnet with RFC2217 support, you can do:
.RS
connection: &toS0telnet
.RS
accepter: telnet(rfc2217),tcp,1234
.br
connector: serialdev,/dev/ttyS0,local
.RE
.RE
If you want to accept a telnet over SCTP connection only on IPv6
localhost and connect to a telnet connection with SSL over tcp, you
can do:
.RS
connection: &tomyhost
.RS
accepter: telnet,sctp,::1,1234
.br
connector: telnet,ssl,tcp,myhost.domain.org,1234
.RE
.RE
RFC2217 support only make sense with a serial-capable device as the
connector. Also note that IPv6 is fully supported. Accepters will
generally default to being both IPv4 and IPv6 unless otherwise
specified. See gensio(5) for details.
And yes, SCTP is supported and is highly recommended if you can use
it. Multi-homing alone is worth it.
You could create a secure login with telnet RFC2217 support that then
connects to an IPMI sol connection. Notice how splitting the connector
line is done with YAML.
.RS
connection: &authsol
.RS
.br
accepter: telnet(rfc2217),mux,certauth,ssl,sctp,1234
.br
connector: ipmisol,lan -U ipmiusr -P test -p 9001
.br
.RS
.RS
ipmiserver.domain.org,9600
.RE
.RE
.br
options:
.RS
banner: My banner
.RE
.RE
.RE
These are some examples. For SSL and certauth, I have ignored the
authentication configuration, more on that later. Using
authentication is strongly recommended, it's easy now with gtlssh and
if you need to use it from a program, it's easy with gensio. There is
even python support. Adding support for other scripting languages
shouldn't be too hard.
.SS "SPECIAL STRING HANDLING"
Some string values, like banners, have special formatting for
inserting various values. These are all prepended with '\e'. This
takes the standard "C" \ex characters.
.RS 2
\ea - bell
.br
\eb - backspace
.br
\ef - form feed
.br
\en - newline
.br
\er - carriage return
.br
\et - tab
.br
\ev - vertical tab
.br
\e\e - \e
.br
\e? - ?
.br
\e' - '
.br
\e" - "
.br
\ennn - octal value for nnn
.br
\exXX - hex value for XX
.br
\ed - The connector string (/dev/ttyS0, etc.)
.br
\eo - The name of the connection.
.br
\ep - Network port number
.br
\eB - The serial port parameters (eg 9600N81) if applicable
.br
\eY -> year
.br
\ey -> day of the year (days since Jan 1)
.br
\eM -> month (Jan, Feb, Mar, etc.)
.br
\em -> month (as a number)
.br
\eA -> day of the week (Mon, Tue, etc.)
.br
\eD -> day of the month
.br
\ee -> epoc (seconds since Jan 1, 1970)
.br
\eU -> microseconds in the current second
.br
\ep -> local port number
.br
\eI -> remote IP address (in dot format)
.br
\eH -> hour (24-hour time)
.br
\eh -> hour (12-hour time)
.br
\ei -> minute
.br
\eS -> second
.br
\eq -> am/pm
.br
\eP -> AM/PM
.RE
These sequences may be used to make the filename unique per open and
identify which port/device the filename was for. Note that in
filenames when using \ed or \eo, everything up to and including last /
in the device name is removed, because you can't have a / in a
filename. So in a filename /dev/ttyS0 would become just ttyS0.
Note that in banners and other strings going out (not filenames) you
.B must
use \er\en to send a new line; this is raw handling and \en will only go
down one line, it will not return to the beginning of the line.
.SS "CONNECTION SPECIFICATION OPTIONS"
.I kickolduser: true|false
sets the port so that the previous user will be kicked off if a new user
comes in. Useful if you forget to log off from someplace else a lot.
.I banner: <banner string>
displays the given banner when a client connects. It uses string
handling as described in "SPECIAL STRING HANDLING" above.
.I signature: <signature string>
sends RFC2217 signature on clients request. This may be an empty
string.
.I openstr: <openstr name string>
Send the given string to the device on first open. This may be an
empty string. It uses string handling as described in "SPECIAL STRING
HANDLING" above.
.I closestr: <closestr name>
Send the given string to the device on final close. This may be an
empty string. It uses string handling as described in "SPECIAL STRING
HANDLING" above.
.I closeon: <closeon string>
If the given string is seen coming from the connector side of the
connection, close the connection. The comparison here is, for
simplicity, simplistic. Complex expressions with repetitive things
may not compare correctly. For instance, if your closeon strings is
"ababc" and your input strings is "abababc", the comparison will fail
because the comparison algorithm will see "ababa" and will fail on the
final "a" and start over at "abc", which won't match. This shouldn't
cause a problem most cases, but if it does, contact the authors and it
can be improved.
.I accepter-retry-time: <time in seconds>
If the accepter does not come up at startup, wait this many seconds
and retry it.
.I connector-retry-time: <time in seconds>
On a connect-back port, if the connector does not come up or goes
down. wait this many seconds and retry it.
.I trace-read: <filename>
When the acceptor is opened, open the given file and store all data
read from the physical device (and thus written to the client's
network/acceptor port) in the file. If the file already exists, it is
appended. The file is closed when the port is closed. The filename
uses string handling as described in "SPECIAL STRING HANDLING" above.
.I trace-write: <filename>
Like tr, but traces data written to the connecting gensio.
.I trace-both: <filename>
trace both read and written data to the same file. Note that this is
independent of tr and tw, so you may be tracing read, write, and both
to different files.
.I trace-hexdump: true|false
turns on/off hexdump output to all trace files. Each line in the
trace file will be 8 (or less) bytes in canonical hex+ASCII format. This is
useful for debugging a binary protocol.
.I trace-timestamp: true|false
adds/removes a timestamp to all of the trace files. A timestamp
is prepended to each line if hexdump is active for the trace file. A
timestamped line is also recorded in the trace file when a remote client
connects or disconnects from the port.
.I [trace-read-|trace-write-|trace-both-]hexdump: true|false
turns on/off hexdump output for only one trace file.
May be combined with hexdump. Order is important.
.I [trace-read-|trace-write-|trace-both-]timestamp: true|false
adds/removes a timestamp to only one the trace files
May be combined with [-]timestamp. Order is important.
.I telnet-brk-on-sync: true|false
causes a telnet sync operation to send a break. By default data is
flushed until the data mark, but no break is sent.
.I chardelay: true|false
enables the small wait after each character received on the
connecting gensio before sending data on the accepted gensio.
Normally ser2net will wait the time it takes to receive 2 serial port
characters, or at least 1000us, before sending. This allows more
efficient use of network resources when receiving large amounts of
data, but gives reasonable interactivity. Default is true.
Note that this feature is designed to balance network efficiency and
interactivity. It is not designed to give guarantees of minimum chunk
of data size, as task scheduling and network stacks can modify these
things, too.
.I chardelay-scale: <number>
sets the time, measured in tenths of serial port characters, to wait
after receiving from nothing from the connection before sending to the
accepted gensio. So setting this to 25 will cause ser2net to wait the
amount of time it takes to receive 2.5 serial port characters after
receiving the last character before sending the data on to the TCP
port. The default value is 20, max is 1000. This is ignored for
non-serial gensios.
.I chardelay-min: <number>
is the same as chardelay-scale, but in microseconds. The larger of
chardelay-scale and chardelay-min is used. The default value is 1000,
max is 100000.
.I chardelay-max: <number>
sets the maximum delay that ser2net will wait, in microseconds, after
receiving a character, before sending the data. The default value is
20000, max is 1000000. This keeps the connection working smoothly at
slow speeds.
.I sendon: <sendon string>
If the given string is seen coming from the connector side of the
connection, sends buffered data up to and including the
string. Disabled by default. As an example, this can be set to \er\en
with appropriate chardelay settings to send one line at a time. It
uses string handling as described in "SPECIAL STRING HANDLING" above.
See the notes on the closeon string for important information on how
the comparison is done.
.I dev-to-net-bufsize: <number>
sets the size of the buffer reading from the connecting gensio and writing
to the accepted gensio.
.I net-to-dev-bufsize: <number>
sets the size of the buffer reading from the accepted gensio and
writing to the connecting gensio.
.I led-tx: <led-alias>
use the previously defined led to indicate serial tx traffic on this
port. For version 2 this should be a YAML alias, like *led2. For
version 2 just use the name, like led2.
.I led-rx: <led-alias>
use the previously defined led to indicate serial rx traffic on this
port. For version 2 this should be a YAML alias, like *led2. For
version 2 just use the name, like led2.
.I max-connections: <number>
set the maximum number of connections that can be made on this particular
TCP port. If you make more than one connection to the same port, each
ports output goes to the device, and the device output goes to all ports
simultaneously. See "MULTIPLE CONNECTIONS" below for details. The default
is 1.
.I remaddr: <addr>[;<addr>[;...]]
specifies the allowed remote connections, where the addr is a standard
address, generally in the form <ip address>,<port>. Multiple
addresses can be separated by semicolons, and you can specify remaddr
more than once.
If you set the port for an address to zero, ser2net will accept a
connection from any port from the given network host.
.I no-con-to-acc: true|false
If true, do not transfer any data from the connector to the accepter.
Throw any data received from the connecter away.
.I no-acc-to-con: true|false
If true, do not transfer any data from the accepter to the connecter.
Throw any data received from the accepter away.
.I connback: <connector>[;<connector>[;...]]
specifies reverse connections that will be made when data comes in on
the device. When data comes in on the device side (the connection's
main connector) ser2net will connect to each connback specified. No
connection is made until data comes in, and normal connection timeouts
apply.
Note that this will use one of the connection's connections all the
time. You may need to increase max-connections if you need more than
one or want to accept incoming connections, too.
Connect back addresses must match the format of the accepter address.
So, for instance, if your accepter is "telnet,tcp,1234" your connect
back address must be something like "telnet,tcp,hostname,1123".
The port will send no data to any connect back unless all the connect
backs are connected.
A connect back port can also have connections made to it if you set
the number of connections larger than the number of connect backs
specified. However, those connections will receive no data from the
port uness all connect backs have been established.
.I connback-timeout: <time in seconds>
specifies a separate timeout for connect back ports. Normally it uses
the main timeout, this lets you have a different one. Setting it to
zero, like the main timeout, disables the timeout.
.I authdir: <directory string>
specified the authentication directory to use for this connection.
.I pamauth: <service name>
Enables PAM authentication and sets the PAM service name.
.I allowed-users: <space separated list of names>
The users that are allowed to use this connections. This has no
meaning if authentication is not enabled on the connections. If this
is not set or defaulted, all users are allowed. If this is set to an
empty set of users, then no users are allowed. This may be specified
more than once, each one adds more users.
.I mdns: true|false
Enables/disables mdns support for the connection. If you set this and
mdns is available, ser2net will create a service on mdns for the port.
.I mdns-interface: <num>
Sets the specific network interface to advertise the device. Defaults
to -1, which means all network interfaces.
.I mdns-nettype: unspec|ipv4|ipv6
Sets which network type to provide for the device advertisement.
Defaults to unspec, which means do ipv4 and ipv6.
.I mdns-name: <string>
Sets the name in the mDNS advertisement. Defaults to the connection name.
.I mdns-type: <string>
Sets the type in the mDNS advertisement. Defaults to "_iostream._xxx"
where xxx is either tcp, udp # # or sctp base on the gensio type.
.I mdns-domain: <string>
Sets the name in the mDNS advertisement. Defaults to the system
setting. Don't set this unless you really know what you are doing.
.I mdns-host: <string>
Sets the host in the mDNS advertisement. Defaults to the system
setting. Don't set this unless you really know what you are doing.
.I mdns-txt: <string>
Adds a text string to the mDNS advertisement. The string should be in
the form "name=value". You can put anything you want in the strings.
Two default strings are added by ser2net: "provider=ser2net" and
"gensiostack=..." where the stack of gensios is added, like
"telnet(rfc2217),tcp)". The idea of gensiostack is you can just tack
on the address to the end an make a connection using str_to_gensio().
.I mdns-sysattrs: true|false
On Linux adds system attributes from sysfs for USB serial ports to the
mDNS txt fields. If the serial port is USB, it adds
"devicetype=serialusb" and the following attributes from sysfs:
bInterfaceNumber, interface, idProduct, idVendor, serial,
manufacturer, product. If they are not present in sysfs, they are not
added. If the serial port is not USB, then "devicetype=serial" is
added.
Note: Be *very* careful when using a gensiostack with str_to_gensio().
Just blindly calling str_to_gensio() with it could result in
significant security issues, as it can pass pty, stdio, trace,
etc. gensios in it. You must either validate that the stack is a safe
set or just use it for information. You have been warned. Be careful.
.SH "ROTATOR"
A rotator allows a single network connection to connect to one of a
number of connections.
A version 1 rotator specification starts with:
.RS
rotator: &<alias>
.RS
<definition>
.RE
.RE
A version 2 rotator specification starts with:
.RS
rotators:
.RS
<alias>:
.RS
<definition>
.RE
.RE
.RE
Just like connections, in version 2 you have to put all the rotators
together.
The definition of a rotator is almost the same between version 1 and
version 2:
.RS
accepter: <accepter>
.br
connections: [
.RS
<connection alias>,
.br
<connection alias>....
.RE
]
.br
options:
.RS
<option name>: <option val>
.br
<option name>: <option val>...
.RE
.RE
A rotator has four possible options, "authdir", "pamauth", "allowed-users", and
"accepter-retry-time", both same as connections.
For version 1, you should use YAML aliases for the connections. For
version 2, just use the alias names.
Connections to the accepter will go through the set of connections and
find the first unused one and use that. The next connection will
start after the last connection used. Note that disabled connections
are still accessible through rotators.
Note that the security of the connection is
.B NOT
used, only the security of the rotator.
.SH "SER2NET DEFAULTS"
To set a default in version 1, do:
.RS
default:
.RS
.br
name: <default name>
.br
value: <default value>
.br
class: <default class>
.RE
.RE
In version 2, like other things, the defaults are all in one place in
a document, like:
.RS
defaults:
.RS
<name>:
.RS
value: <default value>
.br
class: <default class>
.RE
<name2>:
.RS
value: <default value>
.br
class: <default class>
.RE
.RE
.RE
The class is optional, if it is not there it sets the base default for
all classes that is used unelss overridden for a specific class. If
the class is there, it sets the default for a specific gensio class.
There is also a ser2net class that is for ser2net specific options.
The class is useful if you want different values for different gensio
types. For instance, if you wanted all serial ports to run at 9600
baud and all IPMI SOL connections to run at 115200 baud, you could do:
.RS
default:
.RS
name: speed
.br
value: 9600
.br
class: serialdev
.RE
default:
.RS
name: speed
.br
value: 115200
.br
class: ipmisol
.RE
.RE
The value is also optional, if it is not present a string value is set
to NULL and an integer value is set to 0.
The order in the file is important, you must set a default before it
is used, and you can change the value of the default. It will affect
all uses following the setting.
To delete a default value for class (so it will use the base default),
for version 1 do:
.RS
delete_default:
.RS
name: <default name>,
.br
class: <default class>
.RE
.RE
For version 2, do:
.RS
delete_defaults:
.RS
<default name>: [ <class1>, <class2>, ... ]
.br
<default name2>: [ <class1>, <class2>, ... ]
.RE
.RE
and it will delete the defaults for the classes in the list after it.
You must supply the class, you cannot delete base defaults.
The following default values are specific to ser2net, given with their
default values:
.TP
.B telnet-brk-on-sync: false
If a telnet sync is received, send a break on the connected gensio (if
applicable). By default data is flushed until the data mark, but no
break is sent.
.TP
.B kickolduser: false
If a new user comes in on a connection that already has a user, kick
off the previous user.
.TP
.B chardelay: true
Enable asmall wait after each character received on the serial
port before sending data on the TCP port. Normally ser2net will wait
the time it takes to receive 2 serial port characters, or at least
1000us, before sending on the TCP port. This allows more efficient
use of network resources when receiving large amounts of data, but
gives reasonable interactivity.
.TP
.B chardelay-scale: 20
sets the number of serial port characters, in tenths of a character,
to wait after receiving from the serial port and sending to the TCP
port. So setting this to 25 will cause ser2net to wait the amount
of time it takes to receive 2.5 serial port characters before sending
the data on to the TCP port. This can range from 1-1000.
.TP
.B chardelay-min: 1000
sets the minimum delay that ser2net will wait, in microseconds. If
the calculation for chardelay-scale results in a value smaller than
this number, this number will be used instead. The default value
is 1000. This can range from 1-100000.
.TP
.B net-to-dev-bufsize: 64
sets the size of the buffer reading from the network port and writing to the
serial device.
.TP
.B dev-to-net-bufsize: 64
sets the size of the buffer reading from the serial device and writing
to the network port.
.TP
.B max-connections: 1
set the maximum number of connections that can be made on this
particular TCP port. If you make more than one connection to the same
port, each ports output goes to the device, and the device output goes
to all ports simultaneously. See "MULTIPLE CONNECTIONS" below.
for details.
.TP
.B remaddr: [!]<addr>[;[!]<addr>[;...]]
specifies the allowed remote connections, where the addr is a standard
address in the form (see "network port" above). Multiple addresses
can be separated by semicolons, and you can specify remaddr more than
once. If you set the port for an address to zero, ser2net will accept
a connection from any port from the given network host. If a "!" is
given at the beginning of the address, the address is a "connect back"
address. If a connect back address is specified, one of the network
connections (see max-connections) is reserved for that address. If
data comes in on the device, ser2net will attempt to connect to the
address. This works on TCP and UDP.
.TP
.B authdir: /usr/share/ser2net/auth
The authentication directory for ser2net. The AUTHENTICATION for more
details.
.TP
.B authdir-admin: /etc/ser2net/auth
The authentication directory for ser2net for admin connections. The
"ADMIN_CONNECTIONS" for more details.
.TP
.B pamauth: <NULL>
The PAM service name for ser2net PAM authentication (<NULL> for disabled).
.TP
.B pamauth-admin: <NULL>
The PAM service name for ser2net admin connection PAM authentication (<NULL>
for disabled). See "ADMIN_CONNECTIONS" for more details.
.TP
.B mdns-interface: -1
The default mDNS interface.
.TP
.B mdns-type: <NULL>
The default mDNS type.
.TP
.B mdns-domain: <NULL>
The default mDNS domain.
.TP
.B mdns-host: <NULL>
The default mDNS host.
.SH ADMIN CONNECTIONS
There is an admin accepter that you can define for ser2net, it lets you
log in, look at status, and change some things. See "ADMIN INTERFACE"
in ser2net(8) for detail on how to use it. The format is:
.RS
admin: [&<name>]
.RS
accepter: <accepter>
.br
options:
.RS
<option name>: <option value>
.br
<option name>: <option value>...
.RE
.RE
.RE
The following authentications options available are "authdir-admin",
which sets the authentication directory for the admin port and
"pamauth-admin" which sets the PAM service name and enables PAM
authentication. Both are different than "authdir" resp. "pamauth" for
connections, though you can set it to the same value.
In addition, the same mdns option are available for admin ports as are
available for connections. And you can set an optional alias that
will also set the mdna name.
Like connections, default mdns options work for "mdns-interface",
"mdna-type", "mdns-domain", and "mdns-host". Unlike connections, the
"mdns" boolean does not come from the default, you must specify it as
an admin option to turn on mdns for the admin port. This is to allow
it to be specified separately and maintain backwards compatibility.
.SH LEDS
.B ser2net
can flash LEDs during serial activity. To create an LED in version 1, do:
.RS
led: &<alias>
.RS
driver: sysfs
.br
options:
.RS
<option name>: <option value>
.br
<option name>: <option value>
.RE
.RE
.RE
In version 2, use:
.RS
leds:
.RS
<alias>:
.RS
driver: sysfs
.br
options:
.RS
<option name>: <option value>
.br
<option name>: <option value>
.RE
.RE
<alias>:
.RS
driver: sysfs
.br
options:
.RS
<option name>: <option value>
.br
<option name>: <option value>
.RE
.RE
.RE
.RE
.RE
The only supported driver is sysfs. Supported options are:
.I device: <sysfs device name>
gives the name of the LED in /sys/class/led. These generally have ":"
in them, so you will need to put the name in quotes. This is required.
.I duration: <time in ms>
The time in milliseconds to flash the LED. Defaults to 10.
.I state: <number>
The value to set the LED to to enable it. Defaults to 1, but may need
to be a different value.
You reference the LED by alias in the connection options section, see
that for details. Make sure you have "modprobe ledtrig-transient"
done or the triggers will not work, they require the transient trigger.
You also probably need root access to access LED settings.
.SH FILENAME, BANNER, AND STRING FORMATTING
NOTE: yaml has it's own quoting mechanism, see below for more details.
Filenames, banners, open/close strings, closeon strings, and sendon
strings may contain normal "C" escape sequences and a large number of
other escape sequences, too:
.RS 2
\ea - bell
.br
\eb - backspace
.br
\ef - form feed
.br
\en - newline
.br
\er - carriage return
.br
\et - tab
.br
\ev - vertical tab
.br
\e\e - \e
.br
\e? - ?
.br
\e' - '
.br
\e" - "
.br
\ennn - octal value for nnn
.br
\exXX - hex value for XX
.br
\ed - The connecting gensio string (serialdev,/dev/ttyS0, etc.)
.br
\eo - The device as specified on the config line (before DEVICE substitution)
.br
\eN - The port name
.br
\ep - The accepter string
.br
\eB - The serial port parameters (eg 9600N81)
.br
\eY -> year
.br
\ey -> day of the year (days since Jan 1)
.br
\eM -> month (Jan, Feb, Mar, etc.)
.br
\em -> month (as a number)
.br
\eA -> day of the week (Mon, Tue, etc.)
.br
\eD -> day of the month
.br
\ee -> epoc (seconds since Jan 1, 1970)
.br
\eU -> microseconds in the current second
.br
\ep -> local port number
.br
\eI -> remote address of the accepter gensio
.br
\eH -> hour (24-hour time)
.br
\eh -> hour (12-hour time)
.br
\ei -> minute
.br
\eS -> second