-
Notifications
You must be signed in to change notification settings - Fork 2
/
ckuus3.c
13629 lines (12652 loc) · 436 KB
/
ckuus3.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
#ifdef SSHTEST
#define SSHBUILTIN
#endif /* SSHTEST */
#include "ckcsym.h" /* Symbol definitions */
/* C K U U S 3 -- "User Interface" for C-Kermit, part 3 */
/*
Authors:
Frank da Cruz <[email protected]>,
The Kermit Project, Columbia University, New York City
Jeffrey E Altman <[email protected]>
Secure Endpoints Inc., New York City
Copyright (C) 1985, 2011,
Trustees of Columbia University in the City of New York.
All rights reserved. See the C-Kermit COPYING.TXT file or the
copyright text in the ckcmai.c module for disclaimer and permissions.
*/
/* SET command (but much material has been split off into ckuus7.c). */
/*
Kermit-specific includes.
Definitions here supersede those from system include files.
*/
#include "ckcdeb.h" /* Debugging & compiler things */
#include "ckcasc.h" /* ASCII character symbols */
#include "ckcker.h" /* Kermit application definitions */
#include "ckcxla.h" /* Character set translation */
#include "ckcnet.h" /* Network symbols */
char pwbuf[PWBUFL+1] = { NUL, NUL };
int pwflg = 0;
int pwcrypt = 0;
#ifndef NOICP
#ifdef CK_AUTHENTICATION
#include "ckuath.h"
#endif /* CK_AUTHENTICATION */
#ifdef CK_SSL
#include "ck_ssl.h"
#endif /* CK_SSL */
#include "ckuusr.h" /* User interface symbols */
#ifdef OS2
#include "ckcuni.h"
#ifdef SSHBUILTIN
#include "ckossh.h"
#endif /* SSHBUILTIN */
#ifdef CK_NETBIOS
#include <os2.h>
#ifdef COMMENT /* Would you believe */
#undef COMMENT /* <os2.h> defines this ? */
#endif /* COMMENT */
#include "ckonbi.h"
extern UCHAR NetBiosAdapter;
#endif /* CK_NETBIOS */
#include "ckocon.h"
#include "ckokey.h"
#ifndef NOTERM
extern unsigned char colorcmd; /* Command-screen colors */
extern struct keytab ttyclrtab[];
extern int nclrs;
extern int tt_cols[], tt_rows[], tt_szchng[], tt_status[];
#endif /* NOTERM */
_PROTOTYP(int setprty, (void));
extern char startupdir[], exedir[];
extern int tt_modechg;
#ifdef NT
#include <windows.h>
#include <tapi.h>
#include "ckntap.h" /* Microsoft TAPI */
#endif /* NT */
#endif /* OS2 */
#ifndef OS2
extern char * exedir;
#endif /* OS2 */
#ifdef CK_RECALL
extern int cm_retry;
#endif /* CK_RECALL */
#ifdef NEWFTP
extern int ftpisopen();
#endif /* NEWFTP */
extern int cmdint;
extern int srvidl;
#ifdef CKFLOAT
extern CKFLOAT floatval; /* (see isfloat()) */
#endif /* CKFLOAT */
#ifndef NOPUSH
#ifndef NOFRILLS
#ifdef VMS
char editor[CKMAXPATH + 1] = "edit";
#else
char editor[CKMAXPATH + 1] = { NUL, NUL };
#endif /* VMS */
char editopts[128] = { NUL, NUL };
char editfile[CKMAXPATH + 1] = { NUL, NUL };
#ifdef BROWSER
char browser[CKMAXPATH + 1] = { NUL, NUL };
char browsopts[128] = { NUL, NUL };
char browsurl[4096] = { NUL, NUL };
#endif /* BROWSER */
#endif /* NOFRILLS */
#endif /* NOPUSH */
#ifndef NOFRILLS
#ifndef NORENAME
_PROTOTYP(int setrename, (void));
#endif /* NORENAME */
#endif /* NOFRILLS */
/* Variables */
int cmd_quoting = 1;
int cmd_err = 1;
extern int hints, xcmdsrc;
#ifdef CK_KERBEROS
char * k4pwprompt = NULL; /* Kerberos 4 password prompt */
char * k4prprompt = NULL; /* Kerberos 4 principal prompt */
char * k5pwprompt = NULL; /* Kerberos 5 password prompt */
char * k5prprompt = NULL; /* Kerberos 5 principal prompt */
#endif /* CK_KERBEROS */
#ifdef CK_SRP
char * srppwprompt = NULL;
#endif /* CK_SRP */
extern char * ckprompt, * ikprompt; /* Default prompt */
extern xx_strp xxstring;
extern char * cdmsgfile[], * cdmsgstr;
extern int
local, server, success, dest, sleepcan, inserver, flow, autoflow, binary,
parity, escape, what, turn, duplex, backgrd, hwparity, stopbits, turnch,
mdmtyp, network, quiet, nettype, carrier, debses, debtim, cdtimo, nlangs,
bgset, pflag, msgflg, cmdmsk, xsuspend, techo, pacing, xitwarn, xitsta,
outesc, cmd_cols, cmd_rows, ckxech, xaskmore, haveline, didsetlin, isguest,
mdmsav, clearrq, saveask, debmsg;
extern int reliable, setreliable, matchdot, matchfifo, dir_dots;
#ifndef NOSERVER
extern int en_pri;
#endif /* NOSERVER */
#ifdef IKSDCONF
extern int iksdcf;
#endif /* IKSDCONF */
#ifdef TCPSOCKET
extern int tn_exit;
#endif /* TCPSOCKET */
#ifdef TNCODE
char * tn_pr_uid = NULL;
#endif /* TNCODE */
extern int exitonclose;
#ifndef NOKVERBS
extern int nkverbs;
extern struct keytab kverbs[];
#endif /* NOKVERBS */
extern int ttnproto; /* Network protocol */
extern char *ccntab[]; /* Names of control chars */
#ifdef CK_APC
extern int apcactive, apcstatus;
#endif /* CK_APC */
#ifndef NOSCRIPT
extern int secho; /* Whether SCRIPT cmd should echo */
#endif /* NOSCRIPT */
#ifdef DCMDBUF
extern char *atmbuf, *atxbuf;
#else
extern char atmbuf[], atxbuf[];
#endif /* DCMDBUF */
extern int cmflgs;
extern char psave[];
extern char uidbuf[];
extern int sl_uid_saved;
int DeleteStartupFile = 0;
extern int cmdlvl; /* Overall command level */
#ifndef NOSPL
_PROTOTYP( static int parsdir, (int) );
char prmbuf[PWBUFL+1] = { NUL, NUL };
int fndiags = 1; /* Function diagnostics on/off */
int fnerror = 1; /* Function error treatment */
#ifdef DCMDBUF
extern int *count, *takerr, *merror, *inpcas;
#else
extern int count[], takerr[], merror[], inpcas[];
#endif /* DCMDBUF */
extern int mecho; /* Macro echo */
extern long ck_alarm;
extern char alrm_date[], alrm_time[];
#else
extern int takerr[];
#endif /* NOSPL */
extern int x_ifnum;
extern int bigsbsiz, bigrbsiz; /* Packet buffers */
extern long speed; /* Terminal speed */
extern char ttname[]; /* Communication device name */
extern char myhost[] ;
extern char inidir[]; /* Ini File directory */
#ifndef NOSETKEY
extern KEY *keymap; /* Character map for SET KEY (1:1) */
extern MACRO *macrotab; /* Macro map for SET KEY (1:string) */
#endif /* NOSETKEY */
#ifdef OS2
int wideresult; /* For wide OS/2 scan codes/cmnum() */
#endif /* OS2 */
#ifndef NOLOCAL
#ifdef OS2
extern int tt_scrsize[]; /* Scrollback buffer Sizes */
#endif /* OS2 */
#endif /* NOLOCAL */
/* Printer settings */
extern char * printername; /* NULL if printer not redirected */
extern int printpipe;
extern int noprinter;
#ifdef PRINTSWI
int printtimo = 0;
char * printterm = NULL;
char * printsep = NULL;
int printertype = 0;
#ifdef BPRINT
int printbidi = 0; /* SET BPRINTER (bidirectional) */
long pportspeed = 0L; /* Bidirection printer port speed, */
int pportparity = 0; /* parity, */
int pportflow = FLO_KEEP; /* and flow control */
#endif /* BPRINT */
#ifdef OS2
extern int txt2ps; /* Text2PS conversion? */
extern int ps_width, ps_length; /* Text2PS dimensions */
#endif /* OS2 */
#endif /* PRINTSWI */
#ifdef OS2
extern int tcp_avail; /* Nonzero if TCP/IP is available */
#ifdef DECNET
extern int dnet_avail; /* Ditto for DECnet */
#endif /* DECNET */
#ifdef SUPERLAT
extern int slat_avail;
#endif /* SUPERLAT */
#endif /* OS2 */
static struct keytab logintab[] = {
{ "password", LOGI_PSW, CM_INV },
{ "prompt", LOGI_PRM, CM_INV },
{ "userid", LOGI_UID, 0 }
};
#ifndef NOCSETS
/* system-independent character sets, defined in ckcxla.[ch] */
extern struct csinfo tcsinfo[];
extern struct langinfo langs[];
/* Other character-set related variables */
extern int tcharset, tslevel, language;
#endif /* NOCSETS */
/* File-transfer variable declarations */
#ifndef NOXFER
#ifdef CK_AUTODL
extern int cmdadl;
#endif /* CK_AUTODL */
#ifndef NOSERVER
extern int ngetpath;
extern char * getpath[];
#endif /* NOSERVER */
extern struct ck_p ptab[];
extern CHAR sstate; /* Protocol start state */
extern CHAR myctlq; /* Control-character prefix */
extern CHAR myrptq; /* Repeat-count prefix */
extern int protocol, size, spsiz, spmax, urpsiz, srvtim, srvcdmsg, slostart,
srvdis, xfermode, ckdelay, keep, maxtry, unkcs, bctr, bctf, ebqflg, swcapr,
wslotr, lscapr, lscapu, spsizr, rptena, rptmin, docrc, xfrcan, xfrchr,
xfrnum, xfrbel, xfrint, srvping, g_xfermode, xfrxla;
#ifdef PIPESEND
extern int usepipes;
#endif /* PIPESEND */
#ifdef CKXXCHAR /* DOUBLE / IGNORE char table */
extern int dblflag, ignflag, dblchar;
extern short dblt[];
#endif /* CKXXCHAR */
#ifdef CK_SPEED
extern short ctlp[]; /* Control-prefix table */
extern int prefixing;
static struct keytab pfxtab[] = {
"all", PX_ALL, 0,
"cautious", PX_CAU, 0,
"minimal", PX_WIL, 0,
"none", PX_NON, 0
};
#endif /* CK_SPEED */
#endif /* NOXFER */
/* Declarations from cmd package */
#ifdef DCMDBUF
extern char *cmdbuf; /* Command buffer */
extern char *line;
extern char *tmpbuf;
#else
extern char cmdbuf[]; /* Command buffer */
extern char line[]; /* Character buffer for anything */
extern char tmpbuf[];
#endif /* DCMDBUF */
/* From main ckuser module... */
extern char *tp, *lp; /* Temporary buffer */
extern int tlevel; /* Take Command file level */
#ifndef NOLOCAL
extern int sessft; /* Session-log file type */
extern int slogts; /* Session-log timestamps on/off */
extern int slognul; /* Lines null-terminated */
#endif /* NOLOCAL */
char * tempdir = NULL;
#ifdef VMS
int vms_msgs = 1; /* SET MESSAGES */
extern int batch;
#endif /* VMS */
/* Keyword tables for SET commands */
#ifdef CK_SPEED
struct keytab ctltab[] = {
"prefixed", 1, 0, /* Note, the values are important. */
"unprefixed", 0, 0
};
#endif /* CK_SPEED */
static struct keytab oldnew[] = {
"new", 0, 0,
"old", 1, 0
};
#define MCH_FIFO 1
#define MCH_DOTF 2
struct keytab matchtab[] = {
{ "dotfile", MCH_DOTF, 0 },
{ "fifo", MCH_FIFO, 0 }
};
int nmatchtab = (sizeof(matchtab) / sizeof(struct keytab));
#ifndef NOSPL
static struct keytab functab[] = {
"diagnostics", FUNC_DI, 0,
"error", FUNC_ER, 0
};
static int nfunctab = (sizeof(functab) / sizeof(struct keytab));
struct keytab outptab[] = { /* SET OUTPUT parameters */
"pacing", 0, 0, /* only one so far... */
"special-escapes", 1, 0
};
int noutptab = (sizeof(outptab) / sizeof(struct keytab)); /* How many */
#endif /* NOSPL */
struct keytab chktab[] = { /* Block check types */
"1", 1, 0, /* 1 = 6-bit checksum */
"2", 2, 0, /* 2 = 12-bit checksum */
"3", 3, 0, /* 3 = 16-bit CRC */
"4", 4, 0, /* Same as B */
"5", 5, 0, /* Same as F */
"blank-free-2", 4, CM_INV, /* B = 12-bit checksum, no blanks */
"force-3", 5, CM_INV /* F = Force CRC on ALL packets */
};
static int nchkt = (sizeof(chktab) / sizeof(struct keytab));
struct keytab rpttab[] = { /* SET REPEAT */
"counts", 0, 0, /* On or Off */
#ifdef COMMENT
"minimum", 1, 0, /* Threshhold */
#endif /* COMMENT */
"prefix", 2, 0 /* Repeat-prefix character value */
};
#ifndef NOLOCAL
/* For SET [ MODEM ] CARRIER, and also for SET DIAL CONNECT */
struct keytab crrtab[] = {
"automatic", CAR_AUT, 0, /* 2 */
"off", CAR_OFF, 0, /* 0 */
"on", CAR_ON, 0 /* 1 */
};
int ncrr = 3;
#endif /* NOLOCAL */
struct keytab ooatab[] = { /* On/Off/Auto table */
"automatic", SET_AUTO, 0, /* 2 */
"off", SET_OFF, 0, /* 0 */
"on", SET_ON, 0 /* 1 */
};
struct keytab ooetab[] = { /* On/Off/Stderr table 2010/03/12 */
"off", SET_OFF, 0, /* for SET DEBUG MESSAGES */
"on", SET_ON, 0,
"s", 2, CM_ABR|CM_INV,
"st", 2, CM_ABR|CM_INV,
"std", 2, CM_ABR|CM_INV,
"stderr", 2, 0,
"stdout", SET_ON, CM_INV
};
static int nooetab = (sizeof(ooetab) / sizeof(struct keytab));
struct keytab ooktab[] = { /* On/Off/Ask table */
"ask", 2, 0, /* 2 */
"off", SET_OFF, 0, /* 0 */
"on", SET_ON, 0 /* 1 */
};
struct keytab qvtab[] = { /* Quiet/Verbose table */
"quiet", 1, 0,
"verbose", 0, 0
};
int nqvt = 2;
/* For SET DEBUG */
#define DEB_OFF 0
#define DEB_ON 1
#define DEB_SES 2
#define DEB_TIM 3
#define DEB_LEN 4
#define DEB_MSG 5
struct keytab dbgtab[] = {
"linelength", DEB_LEN, CM_INV,
"m", DEB_MSG, CM_ABR|CM_INV,
"message", DEB_MSG, 0,
"msg", DEB_MSG, CM_INV,
"off", DEB_OFF, 0,
"on", DEB_ON, 0,
"session", DEB_SES, 0,
"timestamps", DEB_TIM, 0
};
int ndbg = (sizeof(dbgtab) / sizeof(struct keytab));
#ifndef NOLOCAL
/* Transmission speeds */
#ifdef TTSPDLIST /* Speed table constructed at runtime . . . */
struct keytab * spdtab = NULL;
int nspd = 0;
#else
/*
Note, the values are encoded in cps rather than bps because 19200 and higher
are too big for some ints. All but 75bps are multiples of ten. Result of
lookup in this table must be multiplied by 10 to get actual speed in bps.
If this number is 70, it must be changed to 75. If it is 888, this means
75/1200 split speed.
The values are generic, rather than specific to UNIX. We can't use B75,
B1200, B9600, etc, because non-UNIX versions of C-Kermit will not
necessarily have these symbols defined. The BPS_xxx symbols are
Kermit-specific, and are defined in ckcdeb.h or on the CC command line.
Like all other keytabs, this one must be in "alphabetical" order,
rather than numeric order.
*/
struct keytab spdtab[] = {
"0", 0, CM_INV,
"110", 11, 0,
#ifdef BPS_115K
"115200",11520, 0,
#endif /* BPS_115K */
"1200", 120, 0,
#ifdef BPS_134
"134.5", 134, 0,
#endif /* BPS_134 */
#ifdef BPS_14K
"14400", 1440, 0,
#endif /* BPS_14K */
#ifdef BPS_150
"150", 15, 0,
#endif /* BPS_150 */
#ifdef BPS_1800
"1800", 180, 0,
#endif /* BPS_150 */
#ifdef BPS_19K
"19200", 1920, 0,
#endif /* BPS_19K */
#ifdef BPS_200
"200", 20, 0,
#endif /* BPS_200 */
#ifdef BPS_230K
"230400", 23040, 0,
#endif /* BPS_230K */
"2400", 240, 0,
#ifdef BPS_28K
"28800", 2880, 0,
#endif /* BPS_28K */
"300", 30, 0,
#ifdef BPS_3600
"3600", 360, 0,
#endif /* BPS_3600 */
#ifdef BPS_38K
"38400", 3840, 0,
#endif /* BPS_38K */
#ifdef BPS_460K
"460800", 46080, 0, /* Need 32 bits for this... */
#endif /* BPS_460K */
"4800", 480, 0,
#ifdef BPS_50
"50", 5, 0,
#endif /* BPS_50 */
#ifdef BPS_57K
"57600", 5760, 0,
#endif /* BPS_57K */
"600", 60, 0,
#ifdef BPS_7200
"7200", 720, 0,
#endif /* BPS_7200 */
#ifdef BPS_75
"75", 7, 0,
#endif /* BPS_75 */
#ifdef BPS_7512
"75/1200",888, 0, /* Code "888" for split speed */
#endif /* BPS_7512 */
#ifdef BPS_76K
"76800", 7680, 0,
#endif /* BPS_76K */
#ifdef BPS_921K
"921600", 92160,0, /* Need 32 bits for this... */
#endif /* BPS_921K */
"9600", 960, 0
};
int nspd = (sizeof(spdtab) / sizeof(struct keytab)); /* How many speeds */
#endif /* TTSPDLIST */
#ifdef TN_COMPORT
struct keytab tnspdtab[] = { /* RFC 2217 TELNET COMPORT Option */
"115200", 11520, 0, /* (add any other defined speeds) */
"1200", 120, 0,
"14400", 1440, 0,
"19200", 1920, 0,
"230400", 23040, 0,
"2400", 240, 0,
"28800", 2880, 0,
"300", 30, 0,
"38400", 3840, 0,
"460800", 46080, 0,
"4800", 480, 0,
"57600", 5760, 0,
"600", 60, 0,
"9600", 960, 0
};
int ntnspd = (sizeof(tnspdtab) / sizeof(struct keytab)); /* How many speeds */
#endif /* TN_COMPORT */
#endif /* NOLOCAL */
#ifndef NOCSETS
extern struct keytab lngtab[]; /* Languages for SET LANGUAGE */
extern int nlng;
#endif /* NOCSETS */
#ifndef NOLOCAL
/* Duplex keyword table */
struct keytab dpxtab[] = {
"full", 0, 0,
"half", 1, 0
};
#endif /* NOLOCAL */
/* Flow Control */
struct keytab cxtypesw[] = {
#ifdef DECNET
"/decnet", CXT_DECNET, 0,
#endif /* DECNET */
"/direct-serial", CXT_DIRECT, 0,
#ifdef DECNET
"/lat", CXT_LAT, 0,
#else
#ifdef SUPERLAT
"/lat", CXT_LAT, 0,
#endif /* SUPERLAT */
#endif /* DECNET */
"/modem", CXT_MODEM, 0,
#ifdef NPIPE
"/named-pipe", CXT_NPIPE, 0,
#endif /* NPIPE */
#ifdef NETBIOS
"/netbios", CXT_NETBIOS, 0,
#endif /* NETBIOS */
"/remote", CXT_REMOTE, 0,
#ifdef TCPSOCKET
"/tcpip", CXT_TCPIP, 0,
#endif /* TCPSOCKET */
#ifdef ANYX25
"/x.25", CXT_X25, 0,
#endif /* ANYX25 */
"", 0, 0
};
int ncxtypesw = (sizeof(cxtypesw) / sizeof(struct keytab));
#ifdef TN_COMPORT
struct keytab tnflotab[] = { /* SET FLOW-CONTROL keyword table */
"dtr/cd", FLO_DTRC, 0, /* for RFC 2217 Telnet COMPORT */
"dtr/cts", FLO_DTRT, 0,
"keep", FLO_KEEP, 0,
"none", FLO_NONE, 0,
"rts/cts", FLO_RTSC, 0,
"xon/xoff", FLO_XONX, 0
};
int ntnflo = (sizeof(tnflotab) / sizeof(struct keytab));
#endif /* TN_COMPORT */
struct keytab flotab[] = { /* SET FLOW-CONTROL keyword table */
"automatic", FLO_AUTO, CM_INV, /* Not needed any more */
#ifdef CK_DTRCD
"dtr/cd", FLO_DTRC, 0,
#endif /* CK_DTRCD */
#ifdef CK_DTRCTS
"dtr/cts", FLO_DTRT, 0,
#endif /* CK_DTRCTS */
"keep", FLO_KEEP, 0,
"none", FLO_NONE, 0,
#ifdef CK_RTSCTS
"rts/cts", FLO_RTSC, 0,
#endif /* CK_RTSCTS */
#ifndef Plan9
"xon/xoff", FLO_XONX, 0,
#endif /* Plan9 */
"", 0, 0
};
int nflo = (sizeof(flotab) / sizeof(struct keytab)) - 1;
/* Handshake characters */
struct keytab hshtab[] = {
"bell", 007, 0,
"code", 998, 0,
"cr", 015, 0,
"esc", 033, 0,
"lf", 012, 0,
"none", 999, 0, /* (can't use negative numbers) */
"xoff", 023, 0,
"xon", 021, 0
};
int nhsh = (sizeof(hshtab) / sizeof(struct keytab));
#ifndef NOLOCAL
static struct keytab sfttab[] = { /* File types for SET SESSION-LOG */
"ascii", XYFT_T, CM_INV,
"binary", XYFT_B, 0,
"debug", XYFT_D, 0,
"null-padded-lines", 998, 0,
"text", XYFT_T, 0,
"timestamped-text", 999, 0
};
static int nsfttab = (sizeof(sfttab) / sizeof(struct keytab));
#endif /* NOLOCAL */
#ifndef NODIAL
#ifdef NETCONN /* Networks directory depends */
int nnetdir = 0; /* on DIAL code -- fix later... */
char *netdir[MAXDDIR+2];
#endif /* NETCONN */
_PROTOTYP( static int setdial, (int) );
_PROTOTYP( static int setdcd, (void) );
_PROTOTYP( static int cklogin, (void) );
#ifndef MINIDIAL
#ifdef OLDTBCODE
extern int tbmodel; /* Telebit model ID */
#endif /* OLDTBCODE */
#endif /* MINIDIAL */
extern MDMINF *modemp[]; /* Pointers to modem info structs */
extern struct keytab mdmtab[]; /* Modem types (in module ckudia.c) */
extern int nmdm; /* Number of them */
_PROTOTYP(static int dialstr,(char **, char *));
extern int dialhng, dialtmo, dialksp, dialdpy, dialmhu, dialec, dialdc;
extern int dialrtr, dialint, dialudt, dialsrt, dialrstr, mdmwaitd;
extern int mdmspd, dialfc, dialmth, dialesc, dialfld, dialidt, dialpace;
extern int mdmspk, mdmvol, dialtest;
int dialcvt = 2; /* DIAL CONVERT-DIRECTORY */
int dialcnf = 0; /* DIAL CONFIRMATION */
int dialcon = 2; /* DIAL CONNECT */
int dialcq = 0; /* DIAL CONNECT AUTO quiet/verbose */
extern long dialmax, dialcapas;
int usermdm = 0;
extern int ndialdir;
extern char *dialini, *dialmstr, *dialmprmt, *dialdir[], *dialcmd, *dialnpr,
*dialdcon, *dialdcoff, *dialecon, *dialecoff, *dialhcmd, *dialx3,
*dialhwfc, *dialswfc, *dialnofc, *dialtone, *dialpulse, *dialname, *diallac;
extern char *diallcc, *dialixp, *dialixs, *dialldp, *diallds, *dialtfp,
*dialpxi, *dialpxo, *dialsfx, *dialaaon, *dialaaoff;
extern char *diallcp, *diallcs, *dialini2, *dialmac;
extern char *dialspoff, *dialspon, *dialvol1, *dialvol2, *dialvol3;
char *dialtocc[MAXTPCC] = { NULL, NULL };
int ndialtocc = 0;
char *dialpucc[MAXTPCC] = { NULL, NULL };
int ndialpucc = 0;
char *dialtfc[MAXTOLLFREE] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
int ntollfree = 0;
char *dialpxx[MAXPBXEXCH] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
int ndialpxx = 0;
char *diallcac[MAXLOCALAC] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
int nlocalac = 0;
static struct keytab drstrtab[] = {
"international", 5, 0,
"local", 2, 0,
"long-distance", 4, 0,
"none", 6, 0
};
static struct keytab dcnvtab[] = {
"ask", 2, 0,
"off", 0, 0,
"on", 1, 0
};
struct keytab setmdm[] = {
"capabilities", XYDCAP, 0,
"carrier-watch", XYDMCD, 0,
"command", XYDSTR, 0,
"compression", XYDDC, CM_INV,
"data-compression", XYDDC, 0,
"dial-command", XYDDIA, 0,
"error-correction", XYDEC, 0,
"escape-character", XYDESC, 0,
"flow-control", XYDFC, 0,
"hangup-method", XYDMHU, 0,
#ifndef NOXFER
"kermit-spoof", XYDKSP, 0,
#endif /* NOXFER */
"maximum-speed", XYDMAX, 0,
"name", XYDNAM, 0,
"speaker", XYDSPK, 0,
"speed-matching", XYDSPD, 0,
"type", XYDTYP, 0,
"volume", XYDVOL, 0
};
int nsetmdm = (sizeof(setmdm) / sizeof(struct keytab));
struct keytab voltab[] = {
"high", 3, 0,
"low", 1, 0,
"medium", 2, 0
};
struct keytab mdmcap[] = {
"at-commands", CKD_AT, 0,
"compression", CKD_DC, 0,
"dc", CKD_DC, CM_INV,
"ec", CKD_EC, CM_INV,
"error-correction", CKD_EC, 0,
"hardware-flow", CKD_HW, 0,
"hwfc", CKD_HW, CM_INV,
"itu", CKD_V25, CM_INV,
"kermit-spoof", CKD_KS, 0,
"ks", CKD_KS, CM_INV,
"sb", CKD_SB, CM_INV,
"software-flow", CKD_SW, 0,
"speed-buffering", CKD_SB, 0,
"swfc", CKD_SW, CM_INV,
"tb", CKD_TB, CM_INV,
"telebit", CKD_TB, 0,
"v25bis-commands", CKD_V25, 0
};
int nmdmcap = (sizeof(mdmcap) / sizeof(struct keytab));
#ifdef COMMENT /* SET ANSWER not implemented yet */
static struct keytab answertab[] = {
{ "caller-id", XYA_CID, 0 };
{ "rings", XYA_RNG, 0 };
{ "", 0, 0 }
};
static int nanswertab = (sizeof(answertab) / sizeof(struct keytab)) - 1;
#endif /* COMMENT */
struct keytab dialtab[] = { /* SET DIAL table */
"area-code", XYDLAC, 0, /* Also still includes items */
"compression", XYDDC, CM_INV, /* that were moved to SET MODEM, */
"confirmation", XYDCNF, 0, /* but they are CM_INVisible... */
"connect", XYDCON, 0,
"convert-directory",XYDCVT, 0,
"country-code", XYDLCC, 0,
"dial-command", XYDDIA, CM_INV,
"directory", XYDDIR, 0,
"display", XYDDPY, 0,
"escape-character", XYDESC, CM_INV,
"error-correction", XYDEC, CM_INV,
"flow-control", XYDFC, CM_INV,
"force-long-distance", XYDFLD, 0,
"hangup", XYDHUP, 0,
"ignore-dialtone", XYDIDT, 0,
"interval", XYDINT, 0,
"in", XYDINI, CM_INV|CM_ABR,
"init-string", XYDINI, CM_INV,
"intl-prefix", XYDIXP, 0,
"intl-suffix", XYDIXS, 0,
#ifndef NOXFER
"kermit-spoof", XYDKSP, CM_INV,
#endif /* NOXFER */
"lc-area-codes", XYDLLAC, 0,
"lc-prefix", XYDLCP, 0,
"lc-suffix", XYDLCS, 0,
"ld-prefix", XYDLDP, 0,
"ld-suffix", XYDLDS, 0,
"local-area-code", XYDLAC, CM_INV,
"local-prefix", XYDLCP, CM_INV,
"local-suffix", XYDLCS, CM_INV,
"m", XYDMTH, CM_INV|CM_ABR,
#ifndef NOSPL
"macro", XYDMAC, 0, /* 195 */
#endif /* NOSPL */
#ifdef MDMHUP
"me", XYDMTH, CM_INV|CM_ABR,
#endif /* MDMHUP */
"method", XYDMTH, 0,
"mnp-enable", XYDMNP, CM_INV, /* obsolete but still accepted */
#ifdef MDMHUP
"modem-hangup", XYDMHU, CM_INV,
#endif /* MDMHUP */
"pacing", XYDPAC, 0,
"pbx-exchange", XYDPXX, 0,
"pbx-inside-prefix",XYDPXI, 0,
"pbx-outside-prefix",XYDPXO, 0,
"prefix", XYDNPR, 0,
"pulse-countries", XYDPUCC, 0,
"restrict", XYDRSTR, 0,
"retries", XYDRTM, 0,
"sort", XYDSRT, 0,
"speed-matching", XYDSPD, CM_INV,
"string", XYDSTR, CM_INV,
"suffix", XYDSFX, 0,
"test", XYDTEST, 0,
"timeout", XYDTMO, 0,
"tf-area-code", XYDTFC, CM_INV,
"tf-prefix", XYDTFP, CM_INV,
"toll-free-area-code",XYDTFC,0,
"toll-free-prefix", XYDTFP, 0,
"tone-countries", XYDTOCC, 0
};
int ndial = (sizeof(dialtab) / sizeof(struct keytab));
#ifdef MDMHUP
struct keytab mdmhang[] = {
"dtr", 0, 0,
"modem-command", 1, 0,
"rs232-signal", 0, 0,
"v24-signal", 0, CM_INV
};
#endif /* MDMHUP */
static struct keytab mdmcmd[] = {
"autoanswer", XYDS_AN, 0, /* autoanswer */
"compression", XYDS_DC, 0, /* data compression */
"dial-mode-prompt", XYDS_MP, 0, /* dial mode prompt */
"dial-mode-string", XYDS_MS, 0, /* dial mode string */
"error-correction", XYDS_EC, 0, /* error correction */
"hangup-command", XYDS_HU, 0, /* hangup command */
"hardware-flow", XYDS_HW, 0, /* hwfc */
"ignore-dialtone", XYDS_ID, 0, /* ignore dialtone */
"init-string", XYDS_IN, 0, /* init string */
"no-flow-control", XYDS_NF, 0, /* no flow control */
"predial-init", XYDS_I2, 0, /* last-minute setup commands */
"pulse", XYDS_DP, 0, /* pulse */
"software-flow", XYDS_SW, 0, /* swfc */
"speaker", XYDS_SP, 0, /* Speaker */
"tone", XYDS_DT, 0, /* tone */
"volume", XYDS_VO, 0 /* Volume */
};
static int nmdmcmd = (sizeof(mdmcmd) / sizeof(struct keytab));
struct keytab dial_fc[] = {
"auto", FLO_AUTO, 0,
"none", FLO_NONE, 0,
"rts/cts", FLO_RTSC, 0,
"xon/xoff", FLO_XONX, 0
};
struct keytab dial_m[] = { /* DIAL METHOD */
"auto", XYDM_A, 0,
"default", XYDM_D, 0,
"pulse", XYDM_P, 0,
"tone", XYDM_T, 0
};
int ndial_m = (sizeof(dial_m)/sizeof(struct keytab));
#endif /* NODIAL */
#ifdef CK_TAPI
struct keytab tapitab[] = { /* Top-Level Microsoft TAPI */
"configure-line", XYTAPI_CFG, 0,
"dialing-properties", XYTAPI_DIAL, 0
};
int ntapitab = (sizeof(tapitab)/sizeof(struct keytab));
struct keytab settapitab[] = { /* SET Microsoft TAPI */
"inactivity-timeout", XYTAPI_INA, 0,
"line", XYTAPI_LIN, 0,
"location", XYTAPI_LOC, 0,
"manual-dialing", XYTAPI_MAN, 0,
"modem-dialing", XYTAPI_PASS, 0,
"modem-lights", XYTAPI_LGHT, 0,
"phone-number-conversions", XYTAPI_CON, 0,
"port", XYTAPI_LIN, CM_INV,
"post-dial-terminal", XYTAPI_PST, 0,
"pre-dial-terminal", XYTAPI_PRE, 0,
"use-windows-configuration", XYTAPI_USE, 0,
"wait-for-credit-card-tone", XYTAPI_BNG, 0
};
int nsettapitab = (sizeof(settapitab)/sizeof(struct keytab));
struct keytab * tapiloctab = NULL; /* Microsoft TAPI Locations */
int ntapiloc = 0;
extern struct keytab * tapilinetab; /* Microsoft TAPI Line Devices */
extern int ntapiline;
extern int tttapi; /* TAPI in use */
extern int tapipass; /* TAPI Passthrough mode */
extern int tapiconv; /* TAPI Conversion mode */
extern int tapilights;
extern int tapipreterm;
extern int tapipostterm;
extern int tapimanual;
extern int tapiinactivity;
extern int tapibong;
extern int tapiusecfg;
#endif /* CK_TAPI */
#ifndef NOPUSH
extern int nopush;
extern int wildena;
#ifdef UNIX
struct keytab wildtab[] = { /* SET WILDCARD-EXPANSION */
#ifdef UNIX
"kermit", WILD_KER, 0, /* By Kermit */
#endif /* UNIX */
"off", WILD_OFF, 0, /* Disabled */
"on", WILD_ON, 0, /* Enabled */
#ifdef UNIX
"shell", WILD_SHE, 0, /* By Shell */
#endif /* UNIX */
"", 0, 0
};
int nwild = (sizeof(wildtab) / sizeof(struct keytab)) - 1;
struct keytab wdottab[] = { /* cont'd */