📄 ckccfg.txt
字号:
-DRBSIZ=xxxx - Total allocation for receive-packet buffers, default 3008.The program size is affected by SBSIZ and RBSIZ (send and receive packetbuffer size). These are static character arrays compiled into the program.If you wish, you can have Kermit allocate packet buffers dynamically atruntime using malloc() by including the CFLAGS switch: -DDYNAMICIn this case, the default packet and buffers sizes are changed to: -DMAXSP=9024 (for UNIX, 2048 for VMS) -DMAXRP=9024 (for UNIX, 1920 for VMS) -DSBSIZ=9050 -DRBSIZ=9050but you can change the packet buffer sizes (not the maximum packet size) atruntime using the command: SET BUFFERS <sbsiz> <rbsiz>Using dynamic allocation (-DDYNAMIC) reduces storage requirements for theexecutable program on disk, and allows more and bigger packets at runtime.But dynamic allocation might not work on all systems. Try it. If it worksfor you, there is no reason not to use it. But if the program hangs or coredumps, then omit the -DDYNAMIC option from CFLAGS.6.4. Other Size-Related ItemsTo make Kermit compile and load successfully, you might have to change yourbuild procedure to: a. Request a larger ("large" or "huge") model. This is particularly true for 16-bit PC-based UNIX versions. This is typically done with a -M and/or -F switch (see your cc manual or man page for details). b. Some systems support overlays. If the program is too big to be built as is, check your loader manual ("man ld") to see if an overlay feature is available. See the 2.10/2.11 BSD example in the UNIX makefile. c. Similarly, some systems support "code mapping", which is similar to overlays. Again, see "man ld".It is also possible to reduce the size of the executable program file inseveral other ways: a. Include the -O (optimize) compiler switch if it isn't already included in your "make" entry (and if it works!). If your compiler supports higher levels of optimization (e.g. -O2), try them. b. If your UNIX system supports shared libraries, change the make entry to take advantage of this feature. The way to do this depends on your particular system. Some (like SunOS) do it automatically. See the NeXT entry for an example. c. Strip the program image after building ("man strip" for further info), or add -s to the LNKFLAGS (UNIX only). This strips the program of its symbol table and relocation information. d. Move character strings into a separate file. See the 2.10 BSD entry for an example.6.5. Space/Time TradeoffsThere are over 2000 debug() statements in the program. If you want to saveboth space (program size) and time (program execution time), include -DNODEBUGin the compilation. If you want to include debugging for tracking downproblems, omit -DNODEBUG from the make entry. But when you include debugging,you have two choices for how it's done. One definition defines debug() to bea function call; this is cheap in space but expensive in execution. The otherdefines debug as "if (deblog)" and then the function call, to omit thefunction call overhead when the debug log is not active. But this adds a lotof space to the program. Both methods work, take your choice; IFDEBUG ispreferred if memory is not a constraint but the computer is likely to be slow.The first method is the default, i.e. if nothing is done to the CFLAGS or inckcdeb.h (but in some cases, e.g. VMS, it is). To select the second method,include -DIFDEBUG in the compilation (and don't include -DNODEBUG).7. DIALER SUPPORT-DNODIAL removes automatic modem dialing completely, including the entireckudia.c module, plus all commands that refer to dialing in the variousckuus*.c modules.-DMINIDIAL leaves the DIAL and related commands (SET/SHOW MODEM, SET/SHOWDIAL) intact, but removes support for all types of modems except CCITT, Hayes,Unknown, User-defined, Generic-high-speed, and None (= Direct). The MINIDIALoption cuts the size of the dial module approximately in half. Use thisoption if you have only Hayes or CCITT modems and don't want to carry thebaggage for the other types.A compromise between full dialer support and MINIDIAL is obtained by removingsupport for "old" modems -- all the strange non-Hayes compatible 1200 and 2400bps modems that C-Kermit has been carrying around code for since 1985 or so.To remove support for these modems, add -DNOOLDMODEMS to CFLAGS at compilationtime.Finally, if you keep support for old modems, you will notice that their namesappear on the "set modem ?" menu. That's because their names are, by default,"visible". But the list is confusing to the younger generation, who have onlyheard of modems from the V.32bis-and-later era. If you want to be able touse old modems, but don't want their names cluttering up menus, add this toCFLAGS: -DM_OLD=18. NETWORK SUPPORTC-Kermit supports not only RS-232 serial connections, direct and modem, butalso TCP/IP and X.25 network connections. The OS/2 version supports DECnet(LAT) connections. If you define the following symbol: NONETthen all network support will be compiled away.8.1. TCP/IPTCP/IP support requires the Berkeley sockets library, and is generallyavailable on any UNIX system. It is also available in OS/2, VMS, AOS/VS, VOS,etc. The TCP/IP support includes built-in TELNET negotiation handling. Toselect TCP/IP support, include -DTCPSOCKET in your makefile entry's CFLAGS, orthe appropriate variant (e.g. -DWOLLONGONG, -DMULTINET, -DEXCELAN, -DWINTCP,etc).Reportedly, even some of these are not consistent within themselves. Forexample, Wollongong reportedly puts header files in different directories fordifferent UNIX versions: in.h can be in either /usr/include/sys or /user/include/netinet. telnet.h can be in either /usr/include/arpa or /user/include/netinet. inet.h can be in either /usr/include/arpa or /user/include/sys.In cases like this, use the -I cc command-line option when possible; otherwiseit's better to make links in the file system than it is to hack up theC-Kermit source code. Suppose, for example, Kermit is looking for telnet.h in/usr/include/arpa, but on your system it is in /usr/include/netinet. Do this(as root, or get the system manager to do it): cd /usr/include/arpa ln /usr/include/netinet/telnet.h telnet.h("man ln" for details about links.)The network support for TCP/IP and X.25 is in the source files CKCNET.H andCKCNET.C, with miscellaneous SHOW commands, etc, in the various CKUUS*.Cmodules, plus code in the CK*CON.C (CONNECT command) and several other modulesto detect TELNET negotiations, etc.Within the TCPSOCKET code, some socket-level controls are included ifTCPSOCKET is defined in the C-Kermit CFLAGS and SOL_SOCKET is defined inin the system's TCP-related header files, such as <sys/socket.h>. These are SET TCP KEEPALIVE SET TCP LINGER SET TCP RECVBUF SET TCP SENDBUFIn addition, if TCP_NODELAY is defined, the following command is alsoenabled: SET TCP NODELAY (Nagle algorithm)See the user documentation for descriptions of these commands.8.1.1. FirewallsThere exist various types of firewalls, set up allow separate users of aninternal TCP/IP network from the great wide Internet. Of course, this couldbe accomplished most easily and safely by simply not connecting the internalnetwork to the Internet, but in many cases some restricted forms of access areneeded. Thus a "firewall" is set up to allow only authorized accesses.One firewall method is called SOCKS, in which a proxy server allows usersinside a firewall to access the outside world, based on a permission listgenerally stored in a file. SOCKS is enabled in one of two ways. First, thestandard sockets library is modified to handle the firewall, and then all theclient applications are relinked (in systems where linking is not dynamic)with the modified sockets library. The APIs are all the same, so theapplications do not need to be recoded or recompiled.In the other method, the applications must be modified to call replacementroutines, such as Raccept() instead of accept(), Rbind() instead of bind(),etc, and then linked with a separate SOCKS library. This second method isaccomplished in C-Kermit by including -DCK_SOCKS in your CFLAGS, and alsoadding: -lsocksto LIBS, or replacing -lsockets with -lsocks (depending on whether the sockslibrary also includes all the sockets entry points).For SOCKS5, use -DCK_SOCKS5.Explicit firewall support can, in general, not be a standard feature or afeature that is selected at runtime, because the SOCKS library tends to bedifferent at each site -- local modifications abound.The ideal situation occurs when firewalls are supported by the first method,using dynamically linked sockets-replacement libraries; in this case, all yourTCP/IP client applications will negotiate the firewall transparently.8.1.2. Solving Compilation and Linking ProblemsThe main() routine is in ckcmai.c. If you get complaints about "main: returntype is not blah", define MAINTYPE on the CC command line, e.g. make xxx "KFLAGS=-DMAINTYPE=blah" (where "blah" is int, long, or whatever).If the complaint is "Attempt to return a value from a function of type void"then add -DMAINISVOID: make xxx "KFLAGS=-DMAINISVOID"If you get a compilation error in CKCNET.C, with a complaint like"incompatible types in assignment", it probably has something to do with thedata type your system uses for the inet_addr() function, which is declared(usually) in <arpa/inet.h>. Kermit uses "unsigned long" unless the symbolINADDRX is defined, in which case "struct inaddr" is used instead. Try adding-DINADDRX to CFLAGS in your make entry, and if that fixes the problem, pleasesend a report to kermit@columbia.edu.Compilation errors might also have to do with the data type used forgetsockopt() and setsockopt() option-length field. This is normally an int,but sometimes it's a short, a long, or an unsigned any of those, or a size_t.To fix the compilation problem, add -DSOCKOPT_T=xxx to the CFLAGS in yourmakefile entry, where xxx is the appropriate type (use "man getsockopt" orgrep through your system/network header files to find the needed type).8.1.3. Enabling Host Address ListsWhen you give Kermit an IP host name, it calls the socket routinegethostbyname() to resolve it. gethostbyname() returns a hostent struct,which might or might not not include a list of addresses; if it does, thenif the first one fails, Kermit can try the second one, and so on. However,this will only work if the symbol "h_addr" is a macro defined as"h_addr_list[0]", usually in netdb.h. If it is, then you can activate thisfeature by defining the following symbol in CFLAGS: HADDRLIST8.1.4. Enabling Telnet NAWSTELNET Negotiation About Window Size (NAWS) support requires the ability tofind out the terminal screen's dimensions. E.g. in UNIX, we need somethinglike ioctl(0, TIOCGWINSZ, ...). If your version of Kermit was built with NAWScapability, SHOW VERSIONS will include CK_NAWS among the compiler options. Ifit doesn't, you can add it by defining CK_NAWS at compile time. Then, if thecompiler or linker complain about undefined or missing symbols, or there is nocomplaint but SHOW TERMINAL fails to show reasonable "Rows =, Columns ="values, then take a look at (or write) the appropriate ttgwsiz() routine. Onthe other hand, if CK_NAWS is defined by default for your system (in ckcnet.h),but causes trouble, you can override this definition by including the -DNONAWSswitch on your CC command line, thus disabling the NAWS feature.This appears to be needed at least on the AT&T 3B2, where in ckutio.c,the routine ttgwsiz() finds that the TIOCGWINSZ symbol is defined but lacksdefinitions for the corresponding winsize struct and its members ws_coland ws_row.The UNIX version of C-Kermit also traps SIGWINCH, so it can send a NAWS anytime the console terminal window size changes, e.g. when you stretch it with amouse. The SIGWINCH-trapping code is enabled if SIGWINCH is defined (i.e. in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -