-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCONFIG.C
1537 lines (1413 loc) · 39.7 KB
/
CONFIG.C
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
/* A collection of stuff heavily dependent on the configuration info
* in config.h. The idea is that configuration-dependent tables should
* be located here to avoid having to pepper lots of .c files with #ifdefs,
* requiring them to include config.h and be recompiled each time config.h
* is modified.
*
* Copyright 1991 Phil Karn, KA9Q
*/
/* Mods by PA0GRI */
#include <stdio.h>
#ifdef MSDOS
#include <dos.h>
#include <conio.h>
#endif
#include "global.h"
#include "config.h"
#include "mbuf.h"
#include "timer.h"
#include "proc.h"
#include "iface.h"
#include "ip.h"
#include "tcp.h"
#include "udp.h"
#ifdef ARCNET
#include "arcnet.h"
#endif
#include "lapb.h"
#include "ax25.h"
#include "enet.h"
#include "kiss.h"
#include "netrom.h"
#include "nr4.h"
#include "pktdrvr.h"
#include "ppp.h"
#include "slip.h"
#include "arp.h"
#include "icmp.h"
#include "hardware.h" /***/
#include "smtp.h"
#include "usock.h"
#include "cmdparse.h"
#include "commands.h"
#include "mailbox.h"
#include "mailcli.h"
#include "ax25mail.h"
#include "nr4mail.h"
#include "tipmail.h"
#include "bootp.h"
#include "daemon.h"
#include "slhc.h"
#include "rspf.h"
#include "main.h"
#if defined(UNIX) && defined(STATUSWIN)
#include "sessmgr.h"
#endif
static int docls __ARGS((int argc,char *argv[],void *p));
static int dostart __ARGS((int argc,char *argv[],void *p));
static int dostop __ARGS((int argc,char *argv[],void *p));
static void network __ARGS((int,void *,void *));
#ifdef APPLETALK
/* The appletalk.c source is missing... */
extern int at_attach();
extern int at_forus();
extern void at_dump();
#endif
#ifdef NNTPS
extern int donntpcli __ARGS((int argc,char *argv[],void *p));
extern int nntp0 __ARGS((int argc,char *argv[],void *p));
extern int nntp1 __ARGS((int argc,char *argv[],void *p));
#endif
#ifdef CONVERS
int conv0 __ARGS((int argc,char *argv[],void *p));
int conv1 __ARGS((int argc,char *argv[],void *p));
#endif
#ifdef RSYSOPSERVER
int rsysop0 __ARGS((int argc,char *argv[],void *p));
int rsysop1 __ARGS((int argc,char *argv[],void *p));
#endif
#ifdef TRACESERVER
int trace0 __ARGS((int argc,char *argv[],void *p));
int trace1 __ARGS((int argc,char *argv[],void *p));
#endif
#ifdef TERMSERVER
int term0 __ARGS((int argc,char *argv[],void *p));
int term1 __ARGS((int argc,char *argv[],void *p));
#endif
#ifdef AX25
static void axip __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
char *dest,struct mbuf *bp,int mcast));
static void axarp __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
char *dest,struct mbuf *bp,int mcast));
#ifdef RARP
static void axrarp __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
char *dest,struct mbuf *bp,int mcast));
#endif
#ifdef NETROM
static void axnr __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
char *dest,struct mbuf *bp,int mcast));
#endif
#endif
struct mbuf *Hopper;
unsigned Nsessions = NSESSIONS;
#ifndef UNIX
/* Free memory threshold, below which things start to happen to conserve
* memory, like garbage collection, source quenching and refusing connects
*/
int32 Memthresh = MTHRESH;
int Nibufs = NIBUFS; /* Number of interrupt buffers */
unsigned Ibufsize = IBUFSIZE; /* Size of each interrupt buffer */
#endif
/* Transport protocols atop IP */
struct iplink Iplink[] = {
TCP_PTCL, tcp_input,
UDP_PTCL, udp_input,
ICMP_PTCL, icmp_input,
#ifdef ENCAP
IP_PTCL, ipip_recv,
IP_PTCL_OLD, ipip_recv,
#endif
#ifdef AXIP
AX25_PTCL, axip_input,
#endif
#ifdef RSPF
RSPF_PTCL, rspf_input,
#endif /* RSPF */
0, 0
};
/* Transport protocols atop ICMP */
struct icmplink Icmplink[] = {
TCP_PTCL, tcp_icmp,
0, 0
};
/* ARP protocol linkages */
struct arp_type Arp_type[NHWTYPES] = {
#ifdef NETROM
AXALEN, 0, 0, 0, 0, NULLCHAR, pax25, setcall, /* ARP_NETROM */
#else
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL,
#endif
#ifdef ETHER
EADDR_LEN,IP_TYPE,ARP_TYPE,REVARP_TYPE,1,Ether_bdcst,pether,gether, /* ARP_ETHER */
#else
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL,
#endif
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_EETHER */
#ifdef AX25
AXALEN, PID_IP, PID_ARP, PID_RARP, 10, Ax25multi[0], pax25, setcall,
#else
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_AX25 */
#endif
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_PRONET */
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_CHAOS */
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_IEEE802 */
#ifdef ARCNET
AADDR_LEN, ARC_IP, ARC_ARP, 0, 1, ARC_bdcst, parc, garc, /* ARP_ARCNET */
#else
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL,
#endif
0, 0, 0, 0, 0, NULLCHAR,NULL,NULL, /* ARP_APPLETALK */
};
#ifdef AX25
/* Linkage to network protocols atop ax25 */
struct axlink Axlink[] = {
PID_IP, axip,
PID_ARP, axarp,
#ifdef RARP
PID_RARP, axrarp,
#endif
#ifdef NETROM
PID_NETROM, axnr,
#endif
PID_NO_L3, axnl3,
0, NULL,
};
#endif
#ifdef MAILCLIENT
struct daemon Mailreaders[] = {
#ifdef POP2CLIENT
"POP2", 2048, pop2_job,
#endif
#ifdef POP3CLIENT
"POP3", 2048, pop3_job,
#endif
NULLCHAR
};
#endif
#ifdef notdef
#ifndef BOOTP
int WantBootp = 0;
int
bootp_validPacket(ip,bpp)
struct ip *ip;
struct mbuf **bpp;
{
return 0;
}
#endif
#endif
#ifdef MAILBOX
void (*Listusers) __ARGS((int s)) = listusers;
#else
void (*Listusers) __ARGS((int s)) = NULL;
#endif
#if defined(ETHER) || defined(UNIX)
#define NWSTACK 2048
#else
#define NWSTACK 1024
#endif
/* daemons to be run at startup time */
struct daemon Daemons[] = {
"killer", 1024, killer,
#ifdef UNIX
"timer", 2048, timerproc,
#ifdef STATUSWIN
"statuswin", 1024, StatusRefresh,
#endif
#else
"timer", 1024, timerproc,
#endif
"network", NWSTACK,network,
"keyboard", 512, keyboard,
#ifndef UNIX
#ifdef CONVERS
"gcollect", 512, gcollect,
#else
"gcollect", 256, gcollect,
#endif
#endif
NULLCHAR, 0, NULLVFP((int, void *, void *))
};
struct iftype Iftypes[] = {
/* This entry must be first, since Loopback refers to it */
"None", NULL, NULL, NULL,
NULL, CL_NONE, 0,
#ifdef AX25
"AX25", ax_send, ax_output, pax25,
setcall, CL_AX25, AXALEN,
#endif
#ifdef SLIP
"SLIP", slip_send, NULL, NULL,
NULL, CL_NONE, 0,
#endif
#ifdef ETHER
/* Note: NULL is specified for the scan function even though
* gether() exists because the packet drivers don't support
* address setting.
*/
"Ethernet", enet_send, enet_output, pether,
NULL, CL_ETHERNET, EADDR_LEN,
#endif
#ifdef NETROM
"NETROM", nr_send, NULL, pax25,
setcall, CL_NETROM, AXALEN,
#endif
#ifdef SLFP
"SLFP", pk_send, NULL, NULL,
NULL, CL_NONE, 0,
#endif
#ifdef PPP
"PPP", ppp_send, ppp_output, NULL,
NULL, CL_PPP, 0,
#endif
NULLCHAR
};
/* Command lookup and branch tables */
struct cmds DFAR Cmds[] = {
/* The "go" command must be first */
"", go, 0, 0, NULLCHAR,
#ifndef AMIGA
#ifdef SHELL
"!", doshell, 0, 0, NULLCHAR,
#endif
#endif
#ifdef FTPSESSION
"abort", doabort, 0, 0, NULLCHAR,
#endif
#ifdef AMIGA
"amiga", doamiga, 0, 0, NULLCHAR,
#endif
#if defined(MAC) && defined(APPLETALK)
"applestat", doatstat, 0, 0, NULLCHAR,
#endif
#if defined(AX25) || defined(ETHER) || defined(APPLETALK)
"arp", doarp, 0, 0, NULLCHAR,
#endif
#ifdef ASY
"asystat", doasystat, 0, 0, NULLCHAR,
#ifdef UNIX
"asyconfig", doasyconfig, 0, 2, "asyconfig <iface> <parameter>",
#endif
#endif
#ifdef ATCMD
"at", doat, 0, 0, NULLCHAR,
#endif
"attach", doattach, 0, 2,
"attach <hardware> <hw specific options>",
#ifdef TTYLINKSERVER
"attended", doattended, 0, 0, NULLCHAR,
#endif
#ifdef AX25
#ifdef AUTOROUTE
"autoroute",doax25autoroute, 0, 0, NULLCHAR,
#endif /* AUTOROUTE */
"ax25", doax25, 0, 0, NULLCHAR,
#endif /* AX25 */
#ifdef AXUISESSION
"axui", doaxui, 1024, 2,
"axui <interface> [<callsign>]",
#endif
#ifdef BBSSESSION
"bbs", dotelnet, 1024, 0, NULLCHAR,
#endif
#ifdef BOOTPCLIENT
"bootp", dobootp, 0, 0, NULLCHAR,
#endif
#ifdef BOOTPSERVER
"bootpd", bootpdcmd, 0, 0, NULLCHAR,
#endif
#ifdef BPQ
"bpq", dobpq, 0, 0, NULLCHAR,
#endif
#ifdef RLINE
"bulletin", dombrline, 0, 0, NULLCHAR,
#endif
/* This one is out of alpabetical order to allow abbreviation to "c" */
#ifdef AX25SESSION
"connect", doconnect, 1024, 3, "connect <interface> <callsign>",
#endif
#if defined(CALLCLI) /* redundant: || defined SAMCALLB || defined QRZCALLB */
"callbook", docallbook, 1024, 2, "callbook CALLSIGN",
#endif
#if defined(CALLSERVER) || defined(CALLCLI) /* redundant: || defined SAMCALLB || defined QRZCALLB */
"callserver2", docallserver, 0, 0, NULLCHAR,
#endif
#if !defined(AMIGA)
#ifdef DOSCMD
"cd", docd, 0, 0, NULLCHAR,
#endif
#if defined(CALLSERVER) || defined(BUCKTSR)
"cdrom", docdrom, 0, 0, NULLCHAR,
#endif
#endif
"close", doclose, 0, 0, NULLCHAR,
/* "cls", (int (*) ()) clrscr, 0, 0, NULLCHAR, (err in scripts) */
"cls", docls, 0, 0, NULLCHAR,
#ifdef ASY
"comm", doasycomm, 0, 3,"comm <interface> <text-string>",
#endif
#ifdef CONVERS
"convers", doconvers, 0, 0, NULLCHAR,
#endif
#ifdef DOSCMD
"copy", docopy, 0, 3,"copy <file> <newfile>",
#endif
/* This one is out of alpabetical order to allow abbreviation to "d" */
#ifdef SESSIONS
"disconnect", doclose, 0, 0, NULLCHAR,
#endif
#ifndef AMIGA
#ifdef DIRSESSION
"dir", dodir, 0, 0, NULLCHAR, /* note sequence */
#endif
#endif
#ifdef DOSCMD
"delete", dodelete, 0, 2, "delete <file>",
#endif
"detach", dodetach, 0, 2, "detach <interface>",
#ifdef DIALER
"dialer", dodialer, 512, 2,
"dialer <iface> [<file> [<seconds> [<pings> [<hostid>]]]]",
#endif
"domain", dodomain, 0, 0, NULLCHAR,
#ifdef DRSI
"drsistat", dodrstat, 0, 0, NULLCHAR,
#endif
#ifdef ALLCMD
"dump", domdump, 0, 0, NULLCHAR,
#endif
#ifdef EDITOR
"editor", editor, 512, 2, "editor <file>",
#endif
#ifdef MAILERROR
"errors", doerror, 0, 0, NULLCHAR,
#endif
#ifdef EAGLE
"eaglestat", doegstat, 0, 0, NULLCHAR,
#endif
"echo", doecho, 0, 0, NULLCHAR,
/* #if defined(MD5AUTHENTICATE) && defined(LZW) && defined(TTYLINKSESSION)
* "elzwlink", dotelnet, 1024, 4, "elzwlink <address> [port] loginid passwd",
* #endif
*/
"eol", doeol, 0, 0, NULLCHAR,
#if (!defined(MSDOS) || defined(ESCAPE))
"escape", doescape, 0, 0, NULLCHAR,
#endif
#if defined(MD5AUTHENTICATE) && defined(TELNETSESSION)
"etelnet", dotelnet, 1024, 4, "etelnet <address> [port] loginid passwd",
#endif
#ifdef PC_EC
"etherstat", doetherstat, 0, 0, NULLCHAR,
#endif
#if defined(MD5AUTHENTICATE) && defined(TTYLINKSESSION)
"ettylink", dotelnet, 1024, 4, "ettylink <address> [port] loginid passwd",
#endif
"exit", doexit, 0, 0, NULLCHAR,
#ifdef EXPIRY
"expire", doexpire, 0, 0, NULLCHAR,
#endif
#ifdef FINGERSESSION
"finger", dofinger, 1024, 2, "finger name@host",
#endif
#if defined(MSDOS) && defined(ALLCMD)
"fkey", dofkey, 0, 0, NULLCHAR,
#endif
#ifdef FTPSESSION
"ftp", doftp, 2048, 2, "ftp <address>",
"ftype", doftype, 0, 0, NULLCHAR,
#ifdef LZW
"ftpclzw", doftpclzw, 0, 0, NULLCHAR,
"ftpslzw", doftpslzw, 0, 0, NULLCHAR,
#endif
#endif
#ifdef FTPSERVER
"ftpmaxservers", doftpmaxsrv, 0, 0, NULLCHAR,
"ftptdisc", doftptdisc, 0, 0, NULLCHAR,
#endif
#ifdef TCPGATE
"gate", dogate, 0, 0, NULLCHAR,
#endif
#ifdef HAPN
"hapnstat", dohapnstat, 0, 0, NULLCHAR,
#endif
"help", dohelp, 0, 0, NULLCHAR,
"history", dohistory, 0, 0, NULLCHAR,
#ifdef HOPCHECKSESSION
"hop", dohop, 0, 0, NULLCHAR,
#endif
"hostname", dohostname, 0, 0, NULLCHAR,
#ifdef HS
"hs", dohs, 0, 0, NULLCHAR,
#endif
#ifdef HTTP
"http", dohttp, 0, 0, NULLCHAR,
#endif
"icmp", doicmp, 0, 0, NULLCHAR,
"ifconfig", doifconfig, 0, 0, NULLCHAR,
#ifdef ALLCMD
"info", doinfo, 0, 0, NULLCHAR,
#endif
"index", doindex, 2048, 2, "index <mailbox>",
"ip", doip, 0, 0, NULLCHAR,
#ifdef MSDOS
"isat", doisat, 0, 0, NULLCHAR,
#endif
"kick", dokick, 0, 0, NULLCHAR,
#ifdef LOCK
"lock", dolock, 0, 0, NULLCHAR,
#endif
"log", dolog, 0, 0, NULLCHAR,
#ifdef LOOKSESSION
"look", dolook, 1024, 2, "look <user|sock#>",
#endif
#ifdef LZW
"lzw", dolzw, 0, 2, "lzw <mode|bits|trace>",
#ifdef TTYLINKSESSION
"lzwlink", dotelnet, 1024, 2, "lzwlink <address> [port]",
#endif
#endif
#if defined(ALLCMD) && !defined(UNIX)
"mail", dobmail, 0, 0, NULLCHAR,
#endif
#ifdef MAILMSG
"mailmsg", domailmsg, 0, 3, "mailmsg <to> [<subj>] <msg|/pathname>",
#endif
#ifdef MAILBOX
"mbox", dombox, 0, 0, NULLCHAR,
#endif
#ifndef UNIX
"memory", domem, 0, 0, NULLCHAR,
#endif
#ifdef DOSCMD
"mkdir", domkd, 0, 2, "mkdir <directory>",
#endif
#ifdef AX25
"mode", domode, 0, 2, "mode <interface>",
#endif
#ifdef MORESESSION
"more", domore, 0, 2, "more <file> [searchstring]",
#endif
#ifdef ALLCMD
"motd", domotd, 0, 0, NULLCHAR,
#endif
#ifdef MSDOS
#ifdef MULTITASK
"multitask", dobackg, 0, 0, NULLCHAR,
#endif
#endif
#ifdef NETROM
"netrom", donetrom, 0, 0, NULLCHAR,
#endif /* NETROM */
#if defined(NNTP) || defined(NNTPS)
"nntp", donntp, 0, 0, NULLCHAR,
#endif
#ifdef NRS
"nrstat", donrstat, 0, 0, NULLCHAR,
#endif
#ifdef EXPIRY
"oldbid", dooldbids, 0, 0, NULLCHAR,
#endif
"param", doparam, 0, 2, "param <interface>",
"pause", dopause, 0, 0, NULLCHAR,
#ifdef PINGSESSION
"ping", doping, 512, 2,
"ping <hostid> [<length> [<interval> [incflag]]]",
#endif
#ifdef PI
"pistatus", dopistat, 0, 0, NULLCHAR,
#endif
#ifdef PACKET
"pkstat", dopkstat, 0, 0, NULLCHAR,
#endif
#ifdef MAILCLIENT
"popmail", domsread, 0, 0, NULLCHAR,
#endif
#ifdef PPP
"ppp", doppp_commands, 0, 0, NULLCHAR,
#endif
"prompt", doprompt, 0, 0, NULLCHAR,
"ps", ps, 0, 0, NULLCHAR,
#if !defined(AMIGA)
#ifdef DOSCMD
"pwd", docd, 0, 0, NULLCHAR,
#endif
#endif
#if (defined(AX25) || defined(ETHER))
#ifdef RARP
"rarp", dorarp, 0, 0, NULLCHAR,
#endif /* RARP */
#endif
#ifdef RDATECLI
"rdate", dordate, 0, 0, NULLCHAR,
#endif
#ifdef ALLCMD
"record", dorecord, 0, 0, NULLCHAR,
#endif
"remark", doremark, 0, 0, NULLCHAR,
#if defined(REMOTESERVER) || defined(REMOTECLI)
"remote", doremote, 0, 3, "remote"
#ifdef REMOTESERVER
" -s syskey"
#if defined(ENCAP) && defined(UDP_DYNIPROUTE)
" | -g gwkey"
#endif
#endif /* REMOTESERVER */
#ifdef REMOTECLI
#ifdef REMOTESERVER
" |"
#endif
" [-p port] [-k key] [-a kickaddr]"
#if defined(ENCAP) && defined(UDP_DYNIPROUTE)
" [-r addr/#bits]"
#endif
" <hostname> exit|reset|kick"
#if defined(ENCAP) && defined(UDP_DYNIPROUTE)
"|add|drop"
#endif
#endif /* REMOTECLI */
,
#endif /* REMOTESERVER || REMOTECLI */
#ifdef DOSCMD
"rename", dorename, 0, 3, "rename <oldfile> <newfile>",
#endif
#ifdef REPEATSESSION
"repeat", dorepeat, 512, 3, "repeat <interval> <command> [args...]",
#endif
"reset", doreset, 0, 0, NULLCHAR,
"rewrite", dorewrite, 0, 2, "rewrite <address>",
#ifdef RIP
"rip", dorip, 0, 0, NULLCHAR,
#endif
#ifdef RLOGINSESSION
"rlogin", dorlogin, 2048, 2, "rlogin <address>",
#endif
#ifdef DOSCMD
"rmdir", dormd, 0, 2, "rmdir <directory>",
#endif
"route", doroute, 0, 0, NULLCHAR,
#ifdef RSPF
"rspf", dorspf, 0, 0, NULLCHAR,
#endif /* RSPF */
#ifdef SESSIONS
"session", dosession, 0, 0, NULLCHAR,
#endif
#ifdef UNIX
"sessmgr", dosessmgr, 0, 0, NULLCHAR,
#endif
#ifdef SCC
"sccstat", dosccstat, 0, 0, NULLCHAR,
#endif
#if !defined(AMIGA)
#ifdef SHELL
"shell", doshell, 0, 0, NULLCHAR,
#endif
#endif
"skick", dokicksocket,0,2, "skick <socket#>",
"smtp", dosmtp, 0, 0, NULLCHAR,
"socket", dosock, 0, 0, NULLCHAR,
"source", dosource, 0, 2, "source <filename>",
#ifdef SERVERS
"start", dostart, 0, 2, "start <servername>",
"stop", dostop, 0, 2, "stop <servername>",
#endif
"status", dostatus, 0, 0, NULLCHAR,
#if defined(AX25SESSION) && defined(SPLITSCREEN)
"split", doconnect, 1024, 3, "split <interface> <callsign>",
#endif
"tcp", dotcp, 0, 0, NULLCHAR,
#ifdef ALLCMD
"tail", dotail, 0, 2, "tail <filename>",
"taillog", dotaillog, 0, 0, NULLCHAR,
#endif
#ifdef TELNETSESSION
"telnet", dotelnet, 1024, 2, "telnet <address> [port]",
#endif
#ifdef TERMSERVER
"term", doterm, 0, 0, NULLCHAR,
#endif
#ifdef TTYLINKSESSION
"ttylink", dotelnet, 1024, 2, "ttylink <address> [port]",
#endif
#ifdef MAILBOX
"third-party", dothirdparty, 0, 0, NULLCHAR,
#endif
#ifdef TIPSESSION
"tip", dotip, 256, 2, "tip <iface (async only!)>",
#endif
#ifdef PACKETWIN
"tsync_stat", do_tsync_stat, 0, 0, NULLCHAR,
"tsydump", do_tsync_dump, 0, 2, "tsydump <channel>",
#endif
#ifdef TRACE
"trace", dotrace, 0, 0, NULLCHAR,
"strace", dostrace, 0, 0, NULLCHAR,
#endif
"udp", doudp, 0, 0, NULLCHAR,
#ifdef ALLCMD
"upload", doupload, 0, 0, NULLCHAR,
#endif
#ifdef MSDOS
#ifdef ALLCMD
#ifdef SWATCH
"watch", doswatch, 0, 0, NULLCHAR,
#endif
#endif
"watchdog", dowatchdog, 0, 0, NULLCHAR,
#endif
"write", dowrite, 0, 3, "write <user|sock#> <msg>",
#ifdef MAILBOX
"writeall", dowriteall, 0, 2, "writeall <msg>",
#endif
"?", dohelp, 0, 0, NULLCHAR,
NULLCHAR, NULLFP((int,char**,void*)), 0, 0,
"Unknown command; type \"?\" for list",
};
/* List of supported hardware devices */
struct cmds DFAR Attab[] = {
#ifdef PC_EC
/* 3-Com Ethernet interface */
"3c500", ec_attach, 0, 7,
"attach 3c500 <address> <vector> arpa <label> <buffers> <mtu> [ip_addr]",
#endif
#ifdef ASY
/* Ordinary PC asynchronous adaptor */
"asy", asy_attach, 0, 8,
"attach asy <address> <vector> "
#ifdef SLIP
"slip"
#endif
#ifdef AX25
#ifdef SLIP
"|"
#endif
"ax25"
#endif
#ifdef NRS
#if ((defined SLIP) || (defined AX25))
"|"
#endif
"nrs"
#endif
#ifdef POLLEDKISS
#if ((defined SLIP) || (defined AX25) || (defined NRS))
"|"
#endif
"pkiss"
#endif
#ifdef PPP
#if ((defined SLIP) || (defined AX25) || (defined NRS) || (defined POLLEDKISS))
"|"
#endif
"ppp"
#endif
" <label> <bufsize> <mtu> <speed> [options]",
#endif /* ASY */
#ifdef BPQ
/* g8bpq_host */
"bpq", bpq_attach, 0, 3,
"attach bpq init <vec> <stream>\n"
"attach bpq <port> <label> [mtu] [callsign]",
#endif
#ifdef KISS
/* Multi-port KISS interface piggy-backing on ASY interface. */
"kiss", kiss_attach, 0, 4,
"attach kiss <asy_interface_label> <port> <label> [mtu]",
#endif /* KISS */
#ifdef PC100
/* PACCOMM PC-100 8530 HDLC adaptor */
"pc100", pc_attach, 0, 8,
"attach pc100 <address> <vector> ax25 <label> <bufsize>\
<mtu> <speed> [ip_addra] [ip_addrb]",
#endif
#ifdef DRSI
/* DRSI PCPA card in low speed mode */
"drsi", dr_attach, 0, 8,
"attach drsi <address> <vector> ax25 <label> <bufsize> <mtu>\
<chan a speed> <chan b speed> [ip addr a] [ip addr b]",
#endif
#ifdef EAGLE
/* EAGLE RS-232C 8530 HDLC adaptor */
"eagle", eg_attach, 0, 8,
"attach eagle <address> <vector> ax25 <label> <bufsize>\
<mtu> <speed> [ip_addra] [ip_addrb]",
#endif
#ifdef SCC
"escc", scc_attach, 0, 5,
/* "attach escc <board label> baycom|drsi|opto <addr> <vec> [t<tickchan>]\n"*/
"attach escc <board label> <devices> init <addr> <spacing> <Aoff> <Boff> <Dataoff>"
" <intack> <vec> [p]<clock> [[hdwe] [param] [t<tickchan>]]\n"
"attach escc <board label> <chan> "
#ifdef SLIP
"slip"
#if defined(KISS) || (defined AX25) || defined(NRS)
"|"
#endif
#endif
#ifdef KISS
"kiss"
#if (defined AX25) || defined(NRS)
"|"
#endif
#endif
#ifdef AX25
"ax25"
#ifdef NRS
"|"
#endif
#endif
#ifdef NRS
"nrs"
#endif
" <label> <mtu> <speed> <bufsize> [[callsign] [s]]\n",
#endif /* SCC */
#ifdef HAPN
/* Hamilton Area Packet Radio (HAPN) 8273 HDLC adaptor */
"hapn", hapn_attach, 0, 8,
"attach hapn <address> <vector> ax25 <label> <rx bufsize>\
<mtu> csma|full [ip_addr]",
#endif
#ifdef APPLETALK
/* Macintosh AppleTalk */
"0", at_attach, 0, 7,
"attach 0 <protocol type> <device> arpa <label> <rx bufsize> <mtu> [ip_addr]",
#endif
#ifdef NETROM
/* fake netrom interface */
"netrom", nr_attach, 0, 1,
"attach netrom [ip_addr]",
#endif
#ifdef PACKET
/* FTP Software's packet driver spec */
"packet", pk_attach, 0, 4,
"attach packet <int#> <label> <buffers> <mtu> [ip_addr]",
#endif
#ifdef HS
/* Special high speed driver for DRSI PCPA or Eagle cards */
"hs", hs_attach, 0, 7,
"attach hs <address> <vector> ax25 <label> <bufsize> <mtu>\
<txdelay> <persistence> [ip_addra] [ip_addrb]",
#endif
#ifdef PI
/* Special high speed driver for PI 8530 HDLC adapter */
"pi", pi_attach, 0, 8,
"attach pi <address> <vector> <dmachannel> ax25 <label> <bufsize>\
<mtu> <speed a> <speed b> [ip_addra] [ip_addrb]",
#endif
#ifdef SCC
"scc", scc_attach, 0, 5,
/* "attach scc <board label> baycom|drsi|opto <addr> <vec> [t<tick chan>]\n"*/
"attach scc <board label> <devices> init <addr> <spacing> <Aoff> <Boff> <Dataoff>"
" <intack> <vec> [p]<clock> [[hdwe] [param] [t<tickchan>]]\n"
"attach scc <board label> <chan> "
#ifdef SLIP
"slip"
#if defined(KISS) || (defined AX25) || defined(NRS)
"|"
#endif
#endif
#ifdef KISS
"kiss"
#if (defined AX25) || defined(NRS)
"|"
#endif
#endif
#ifdef AX25
"ax25"
#ifdef NRS
"|"
#endif
#endif
#ifdef NRS
"nrs"
#endif
" <label> <mtu> <speed> <bufsize> [[callsign] [s]]\n",
#endif /* SCC */
#ifdef PACKETWIN
/* Gracilis PackeTwin */
"tsync", tsync_attach, 0, 11,
"attach tsync <chan> <vec> <iobase> <hdx|fdx> <dma|ints> <rxdmachan> <name> <rxsize> <txsize> <speed> [txclk] [rxclk] [nrz|nrzi] [ipaddr] [#rxbufs]",
#endif
#ifdef AXIP
"axip",axip_attach, 0, 4,
"attach axip <name> <mtu> <remote-hostid> [callsign]",
#endif
NULLCHAR,
};
#ifndef UNIX
/* Functions to be called on each clock tick */
void (*Cfunc[]) __ARGS((void)) = {
pctick, /* Call PC-specific stuff to keep time */
kbint, /* Necessary because there's no hardware keyboard interrupt */
refiq, /* Replenish interrupt pool */
#ifdef ASY
asytimer,
#endif
#ifdef SCC
scctimer,
#endif
#ifdef BPQ
bpqtimer,
#endif
NULL,
};
/* Entry points for garbage collection */
void (*Gcollect[]) __ARGS((int)) = {
tcp_garbage,
ip_garbage,
udp_garbage,
st_garbage,
#ifdef AX25
lapb_garbage,
#endif
#ifdef NETROM
nr_garbage,
#endif
NULL
};
/* Functions to be called at shutdown */
void (*Shutdown[])() = {
#ifdef SCC
sccstop,
#endif
uchtimer, /* Unlink timer handler from timer chain */
NULLVFP((void)),
};
#endif /* UNIX */
static int
docls(argc,argv,p)
int argc;
char *argv[];
void *p;
{
clrscr();
return 0;
}
/* Packet tracing stuff */
#ifdef TRACE
#include "trace.h"
#define NULLMONFP NULLVFP((int,struct mbuf **, int))
/* Protocol tracing function pointers. Matches list of class definitions
* in pktdrvr.h.
*/
struct trace Tracef[] = {
NULLFP((struct iface*,struct mbuf*)), ip_dump, /* CL_NONE */
#ifdef ETHER /* CL_ETHERNET */
ether_forus, ether_dump,
#else
NULLFP((struct iface*,struct mbuf*)), NULLMONFP,
#endif /* ETHER */
NULLFP((struct iface*,struct mbuf*)), NULLMONFP, /* CL_PRONET_10 */
NULLFP((struct iface*,struct mbuf*)), NULLMONFP, /* CL_IEEE8025 */
NULLFP((struct iface*,struct mbuf*)), NULLMONFP, /* CL_OMNINET */
#ifdef APPLETALK
at_forus, at_dump, /* CL_APPLETALK */
#else
NULLFP((struct iface*,struct mbuf*)), NULLMONFP,
#endif /* APPLETALK */
#ifdef VJCOMPRESS
NULLFP((struct iface*,struct mbuf*)), sl_dump, /* CL_SERIAL_LINE */
#else
NULLFP((struct iface*,struct mbuf*)), ip_dump, /* CL_SERIAL_LINE */
#endif
NULLFP((struct iface*,struct mbuf*)), NULLMONFP, /* CL_STARLAN */
#ifdef ARCNET
arc_forus, arc_dump, /* CL_ARCNET */
#else
NULLFP((struct iface*,struct mbuf*)), NULLMONFP,
#endif /* ARCNET */
#ifdef AX25
ax_forus, ax25_dump, /* CL_AX25 */
#else