📄 ckccfg.doc
字号:
available 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). The network support for TCP/IP and X.25 is in the source files CKCNET.Hand CKCNET.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).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 ProblemsIf 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. insignal.h). If this code should cause problems, you can disable it withoutdisabling the NAWS feature altogether, by defining NOSIGWINCH at compile time.8.1.5. Enabling Incoming TCP/IP ConnectionsThis feature lets you "set host * <port>" and wait for an incoming connectionon the given port. This feature is enabled automatically at compile ifTCPSOCKET is defined and SELECT is also defined. But watch out, simplydefining SELECT on the cc command line does not guarantee successfulcompilation or linking (see section 11).If you want to disable incoming TCP/IP connections, then build C-Kermitwith: -DNOLISTEN8.1.6. Disabling "SET TCP" Options.The main reason for this is because of header file / prototype conflicts atcompile time regardting get/setsockopt(). If you can't fix them (withoutbreaking other builds), just include the following in CFLAGS: -DNOTCPOPTS8.2. X.25X.25 support requires (a) a SUN, (b) the SunLink product (libraries and headerfiles), and (c) an X.25 connection into your SUN, or else Stratus VOS and theappropriate X.25 development tools.In UNIX, special makefile entries sunos4x25 and sunos41x25 (for SUNOS 4.0 and4.1, respectively) are provided to build in this feature, but they only workif conditions (a)-(c) are met. To request this feature, include -DSUNX25 inCFLAGS.SUNX25 and TCPSOCKET can be freely mixed and matched.8.3. Other NetworksSupport for other networking methods -- NETBIOS, LAT, Named Pipes, etc --is included in CK*NET.H and CK*NET.C for implementations (such as OS/2) wherethese methods are supported.Provision is made in the organization of the modules, header files, commands,etc, for addition of new network types such as DECnet, X.25 for other systems(HP-UX, VMS, etc), and so on. Send email to kermit@columbia.edu if you areinterested in working on such a project.9. EXCEPTION HANDLINGThe setjmp/longjmp mechanism is used for handling exceptions. The jumpbuffer is of type jmp_buf, which almost everywhere is typedef'd as an array,in which case you should have no trouble compiling the exception-handlingcode. However, if you are building C-Kermit in/for an environment wherejmp_buf is something other than an array (e.g. a struct), then you'll haveto define the following symbol: JBNOTARRAY10. SECURITY FEATURESCompiling with the NOPUSH symbol defined removes all the "shell escape"features from the program, including the PUSH, RUN, and SPAWN commands, the"!" and "@" command prefixes, OPEN !READ, OPEN !WRITE, job control (includingthe SUSPEND command), the REDIRECT command, shell/DCL escape from CONNECTmode, as well as the server's execution of REMOTE HOST commands (and, ofcourse, the ENABLE HOST command). Add NODISPO to also prevent acceptance ofincoming MAIL or REMOTE PRINT files. For UNIX, also be sure to readCKUINS.DOC about set[ug]id installation. Additional restrictions can beenforced when in server mode; read about the DISABLE command.Compiling with NOCCTRAP prevents the trapping of SIGINT by Kermit. Thusif the user generates a SIGINT signal (e.g. by typing the system's interruptcharacter), Kermit will exit immediately, rather than returning to itsprompt.NOPUSH and NOCCTRAP together allow Kermit to be run from restricted shells,preventing access to system functions.11. ENABLING SELECT()Kermit works best if it can do nonblocking reads, nondestructive input bufferchecking, and millisecond sleeps. All of these functions are bestaccomplished by the select() function, which, unfortunately, is notuniversally available. Furthermore, select() is required if incoming TCP/IPconnections are to be supported.select() was introduced with Berkeley UNIX, rejected by AT&T for System V,but is gradually creeping in to all UNIX versions (and other operating systemstoo) by virtue of its presence in the sockets library, which is needed forTCP/IP. AT&T SVID for System V R4 includes select(), but that does not meanthat all SVR4 implementations have it.Other alternatives include poll() and rdchk(). Only one of these three functions should be included. The following symbols govern this: SELECT Use select() (BSD, or systems with sockets libraries) CK_POLL Use poll() (System V) RDCHK Use rdchk() (SCO)If your system supports the select() function, but your version of C-Kermitdoes not, try adding: -DSELECTto the CFLAGS, and removing -DRDCHK or -DCK_POLL if it is there. If you getcompilation errors, some adjustments to ck*tio.c and/or ck*net.c might beneeded; search for SELECT (uppercase) in these files (note that there areseveral variations on the calling conventions for select()).Various macros and data types need to be defined in order to use select().Usually these are picked up from <types.h> or <sys/types.h>. But on somesystems, they are in <sys/select.h>. In that case, add the following: -DSELECT_Hto the CFLAGS to tell C-Kermit to #include <sys/select.h>. A good indicationthat you need to do this would be if you get compile-time complaints about"fd_set" or "FD_SET" not being declared or defined.WARNING: Some implementations of select() only work with file descriptors thatwere created by socket() and opened by connect() or accept(). This isevidently true on (at least) AOS/VS and BeOS. Who knows where else.----------------------------------------------------------------------APPENDIX I: SUMMARY OF COMPILE-TIME OPTIONSThese are the symbols that can be specified on the cc command line, listedalphabetically. Others are used internally, including those taken from headerfiles, those defined by the compiler itself, and those inferred from the onesgiven below. Kermit's SHOW VERSIONS command attempts to display most ofthese. See ckcdeb.h and ckcnet.h for inference rules. For example SVR3implies ATTSV, MULTINET implies TCPSOCKET, and so on.The following options are not included in all makefile entries, but they are
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -