home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckl197.zip / ckcnet.h < prev    next >
C/C++ Source or Header  |  2000-01-26  |  36KB  |  1,266 lines

  1. /* ckcnet.h -- Symbol and macro definitions for C-Kermit network support */
  2.  
  3. /*
  4.   Author: Frank da Cruz <fdc@columbia.edu>
  5.   Columbia University Academic Information Systems, New York City.
  6.  
  7.   Copyright (C) 1985, 2000,
  8.     Trustees of Columbia University in the City of New York.
  9.     All rights reserved.  See the C-Kermit COPYING.TXT file or the
  10.     copyright text in the ckcmai.c module for disclaimer and permissions.
  11. */
  12. #ifndef CKCNET_H
  13. #define CKCNET_H
  14.  
  15. /* Network types */
  16.  
  17. #define NET_NONE 0            /* None */
  18. #define NET_TCPB 1            /* TCP/IP Berkeley (socket) */
  19. #define NET_TCPA 2            /* TCP/IP AT&T (streams) */
  20. #define NET_SX25 3            /* SUNOS SunLink X.25 */
  21. #define NET_DEC  4            /* DECnet */
  22. #define NET_VPSI 5            /* VAX PSI */
  23. #define NET_PIPE 6            /* LAN Manager Named Pipe */
  24. #define NET_VX25 7            /* Stratus VOS X.25 */
  25. #define NET_BIOS 8            /* IBM NetBios */
  26. #define NET_SLAT 9            /* Meridian Technologies' SuperLAT */
  27. #define NET_FILE 10            /* Read from a file */
  28. #define NET_CMD  11                     /* Read from a sub-process */
  29. #define NET_DLL  12                     /* Load a DLL for use as comm channel*/
  30. #define NET_SSH  13                     /* Use SSH */
  31. #define NET_IX25 14            /* IBM AIX 4.1 X.25 */
  32. #define NET_HX25 15            /* HP-UX 10 X.25 */
  33. #define NET_PTY  16            /* Pseudoterminal */
  34.  
  35. #ifdef OS2                /* In OS/2, only the 32-bit */
  36. #ifndef __32BIT__            /* version gets NETBIOS */
  37. #ifdef CK_NETBIOS
  38. #undef CK_NETBIOS
  39. #endif /* CK_NETBIOS */
  40. #endif /* __32BIT__ */
  41. #endif /* OS2 */
  42.  
  43. #ifdef _M_PPC
  44. #ifdef SUPERLAT
  45. #undef SUPERLAT
  46. #endif /* SUPERLAT */
  47. #endif /* _M_PPC */
  48.  
  49. #ifdef NPIPE                /* For items in common to */
  50. #define NPIPEORBIOS            /* Named Pipes and NETBIOS */
  51. #endif /* NPIPE */
  52. #ifdef CK_NETBIOS
  53. #ifndef NPIPEORBIOS
  54. #define NPIPEORBIOS
  55. #endif /* NPIPEORBIOS */
  56. #endif /* CK_NETBIOS */
  57.  
  58. /* Network virtual terminal protocols */
  59.  
  60. #define NP_DEFAULT 255
  61. #define NP_NONE 0            /* None (async) */
  62. #define NP_TELNET 1            /* TCP/IP telnet */
  63. #define NP_VTP 2            /* ISO Virtual Terminal Protocol */
  64. #define NP_X3 3                /* CCITT X.3 */
  65. #define NP_X28 4            /* CCITT X.28 */
  66. #define NP_X29 5            /* CCITT X.29 */
  67. #define NP_RLOGIN 6            /* TCP/IP Remote login */
  68. #define NP_KERMIT 7            /* TCP/IP Kermit */
  69. #define NP_FTP    8            /* TCP/IP FTP */
  70. #define NP_TCPRAW 9            /* TCP/IP Raw socket */
  71. #define NP_TCPUNK 10                    /* TCP/IP Unknown */
  72. #define NP_SSL 11                       /* TCP/IP SSLv23 */
  73. #define NP_TLS 12                       /* TCP/IP TLSv1 */
  74. #define NP_SSL_TELNET 13                /* TCP/IP Telnet over SSLv23 */
  75. #define NP_TLS_TELNET 14                /* TCP/IP Telnet over TLSv1 */
  76. #define NP_K4LOGIN     15               /* TCP/IP Kerberized remote login */
  77. #define NP_EK4LOGIN    16               /* TCP/IP Encrypted Kerberized ... */
  78. #define NP_K5LOGIN     17               /* TCP/IP Kerberized remote login */
  79. #define NP_EK5LOGIN    18               /* TCP/IP Encrypted Kerberized ... */
  80.  
  81. #define NP_CTERM 20            /* DEC CTERM */
  82. #define NP_LAT 21            /* DEC LAT */
  83. /* others here... */
  84.  
  85. /* RLOGIN Modes */
  86. #define    RL_RAW     0            /*  Do Not Process XON/XOFF */
  87. #define    RL_COOKED  1            /*  Do Process XON/XOFF */
  88.  
  89. /* Encryption types */
  90.  
  91. #define CX_NONE    999
  92.  
  93. #ifdef ENCTYPE_ANY
  94. #define CX_AUTO ENCTYPE_ANY
  95. #else
  96. #define CX_AUTO 0
  97. #endif /* ENCTYPE_ANY */
  98.  
  99. #ifdef ENCTYPE_DES_CFB64
  100. #define CX_DESC64 ENCTYPE_DES_CFB64
  101. #else
  102. #define CX_DESC64 1
  103. #endif /* ENCTYPE_DES_CFB64 */
  104.  
  105. #ifdef ENCTYPE_DES_OFB64
  106. #define CX_DESO64 ENCTYPE_DES_OFB64
  107. #else
  108. #define CX_DESO64 2
  109. #endif /* ENCTYPE_DES_OFB64 */
  110.  
  111. #ifdef ENCTYPE_DES3_CFB64
  112. #define CX_DES3C64 ENCTYPE_DES3_CFB64
  113. #else
  114. #define CX_DES3C64 3
  115. #endif /* ENCTYPE_DES_CFB64 */
  116.  
  117. #ifdef ENCTYPE_DES3_OFB64
  118. #define CX_DESO64 ENCTYPE_DES3_OFB64
  119. #else
  120. #define CX_DES3O64 4
  121. #endif /* ENCTYPE_DES_OFB64 */
  122.  
  123. #ifdef ENCTYPE_CAST5_40_CFB64
  124. #define CX_C540C64 ENCTYPE_CAST5_40_CFB64
  125. #else
  126. #define CX_C540C64 8
  127. #endif /* ENCTYPE_CAST5_40_CFB64 */
  128.  
  129. #ifdef ENCTYPE_CAST5_40_OFB64
  130. #define CX_C540O64 ENCTYPE_CAST5_40_OFB64
  131. #else
  132. #define CX_C540O64 9
  133. #endif /* ENCTYPE_CAST5_40_OFB64 */
  134.  
  135. #ifdef ENCTYPE_CAST128_CFB64
  136. #define CX_C128C64 ENCTYPE_CAST128_CFB64
  137. #else
  138. #define CX_C128C64 10
  139. #endif /* ENCTYPE_CAST128_CFB64 */
  140.  
  141. #ifdef ENCTYPE_CAST128_OFB64
  142. #define CX_C128O64 ENCTYPE_CAST128_OFB64
  143. #else
  144. #define CX_C128O64 11
  145. #endif /* ENCTYPE_CAST128_OFB64 */
  146.  
  147. /* Basic network function prototypes, common to all. */
  148.  
  149. _PROTOTYP( int netopen, (char *, int *, int) );
  150. _PROTOTYP( int netclos, (void) );
  151. _PROTOTYP( int netflui, (void) );
  152. _PROTOTYP( int nettchk, (void) );
  153. _PROTOTYP( int netbreak, (void) );
  154. _PROTOTYP( int netinc, (int) );
  155. _PROTOTYP( int netxin, (int, CHAR *) );
  156. _PROTOTYP( int nettol, (CHAR *, int) );
  157. _PROTOTYP( int nettoc, (CHAR) );
  158. /*
  159.   SunLink X.25 support by Marcello Frutig, Catholic University,
  160.   Rio de Janeiro, Brazil, 1990.
  161.  
  162.   Maybe this can be adapted to VAX PSI and other X.25 products too.
  163. */
  164. #ifndef SUNOS4                /* Only valid for SUNOS4 */
  165. #ifndef SOLARIS
  166. #ifdef SUNX25
  167. #undef SUNX25
  168. #endif /* SUNX25 */
  169. #endif /* SOLARIS */
  170. #endif /* SUNOS4 */
  171.  
  172. #ifdef STRATUSX25
  173. #define ANYX25
  174. #define MAX_USER_DATA 128 /* SUN defines this in a header file, I believe. */
  175. #endif /* STRATUSX25 */
  176.  
  177. #ifdef SUNX25
  178. #define ANYX25
  179. #endif /* SUNX25 */
  180.  
  181. #ifdef IBMX25                /* AIX 4.1 X.25 */
  182. #ifndef AIX41
  183. #undef IBMX25
  184. #else /* AIX41 */
  185. #define ANYX25
  186. #define MAX_USER_DATA NPI_MAX_DATA    /* used for buffer sizes */
  187. #endif /* AIX41 */
  188. #endif /* IBMX25 */
  189.  
  190. #ifdef HPX25                /* HP-UX 10.* X.25 */
  191. #ifndef HPUX10
  192. #undef HPX25
  193. #else /* HPUX10 */
  194. #define ANYX25
  195. #endif /* HPUX10 */
  196. #endif /* HPX25 */
  197.  
  198. #ifdef ANYX25
  199. #ifndef NETCONN                /* ANYX25 implies NETCONN */
  200. #define NETCONN
  201. #endif /* NETCONN */
  202.  
  203. #define MAXPADPARMS                22    /* Number of PAD parameters */
  204. #define MAXCUDATA           12    /* Max length of X.25 call user data */
  205. #define X29PID                1   /* X.29 protocol ID */
  206. #define X29PIDLEN            4   /* X.29 protocol ID length */
  207.  
  208. #define X29_SET_PARMS               2
  209. #define X29_READ_PARMS              4
  210. #define X29_SET_AND_READ_PARMS      6
  211. #define X29_INVITATION_TO_CLEAR     1
  212. #define X29_PARAMETER_INDICATION    0
  213. #define X29_INDICATION_OF_BREAK     3
  214. #define X29_ERROR                   5
  215.  
  216. #define INVALID_PAD_PARM            1
  217.  
  218. #define PAD_BREAK_CHARACTER         0
  219.  
  220. #define PAD_ESCAPE                  1
  221. #define PAD_ECHO                    2
  222. #define PAD_DATA_FORWARD_CHAR       3
  223. #define PAD_DATA_FORWARD_TIMEOUT    4
  224. #define PAD_FLOW_CONTROL_BY_PAD     5
  225. #define PAD_SUPPRESSION_OF_SIGNALS  6
  226. #define PAD_BREAK_ACTION            7
  227. #define PAD_SUPPRESSION_OF_DATA     8
  228. #define PAD_PADDING_AFTER_CR        9
  229. #define PAD_LINE_FOLDING           10
  230. #define PAD_LINE_SPEED             11
  231. #define PAD_FLOW_CONTROL_BY_USER   12
  232. #define PAD_LF_AFTER_CR            13
  233. #define PAD_PADDING_AFTER_LF       14
  234. #define PAD_EDITING                15
  235. #define PAD_CHAR_DELETE_CHAR       16
  236. #define PAD_BUFFER_DELETE_CHAR     17
  237. #define PAD_BUFFER_DISPLAY_CHAR    18
  238.  
  239. #define MAXIX25 MAX_USER_DATA*7
  240. #define MAXOX25 MAX_USER_DATA
  241. #endif /* ANYX25 */
  242.  
  243. #ifdef SUNX25
  244. #ifdef SOLARIS25            /* and presumably SunLink 9.xx */
  245. #include <fcntl.h>
  246. #include <errno.h>
  247. #include <sys/ioccom.h>
  248. #include <sys/types.h>
  249. #include <sys/socket.h>
  250. #include <sys/sockio.h>
  251. #include <sundev/syncstat.h>
  252. #include <netx25/x25_pk.h>
  253. #include <netx25/x25_ctl.h>
  254. #include <netx25/x25_ioctl.h>
  255. #else
  256. #include <sys/ioctl.h>            /* X.25 includes, Sun only */
  257. #include <sys/param.h>
  258. #include <sys/systm.h>
  259. #ifndef SOLARIS
  260. #include <sys/mbuf.h>
  261. #endif /* SOLARIS */
  262. #include <sys/socket.h>
  263. #include <sys/protosw.h>
  264. #ifdef SOLARIS
  265. #include <sys/sockio.h>
  266. #else
  267. #include <sys/domain.h>
  268. #endif /* SOLARIS */
  269. #include <sys/socketvar.h>
  270. #include <net/if.h>
  271. #include <sundev/syncstat.h>
  272. #include <netx25/x25_pk.h>
  273. #include <netx25/x25_ctl.h>
  274. #include <netx25/x25_ioctl.h>
  275. #endif /* SOLARIS25 */
  276. #endif /* SUNX25 */
  277.  
  278. #ifdef ANYX25
  279.  
  280. #ifdef IBMX25                /* X.25 includes, AIX only */
  281. #include <fcntl.h>
  282. #include <sys/twtypes.h>
  283. #include <sys/twlib.h>
  284.  
  285. #include <sys/stream.h>
  286. #include <stropts.h>
  287.  
  288. #define NPI_20                /* required to include the whole NPI */
  289. #include <sys/npi_20.h>
  290. #include <sys/npiapi.h>
  291. #include <sys/pktintf.h>
  292.  
  293. #include <odmi.h>            /* required for access to the ODM   */
  294. #include <sys/cfgodm.h>            /* database, needed to find out the */
  295.                     /* local NUA. see x25local_nua()    */
  296.  
  297.  
  298. /* IBM X25 NPI generic primitive type */
  299. typedef union N_npi_ctl_t {
  300.     ulong        PRIM_type;        /* generic primitive type */
  301.     char        buffer[NPI_MAX_CTL];    /* maximum primitive size */
  302.     N_bind_ack_t        bind_ack;
  303.     N_bind_req_t        bind_req;
  304.     N_conn_con_t        conn_con;
  305.     N_conn_ind_t        conn_ind;
  306.     N_conn_req_t        conn_req;
  307.     N_conn_res_t        conn_res;
  308.     N_data_req_t        data_req;
  309.     N_data_ind_t        data_ind;
  310.     N_discon_ind_t      discon_ind;
  311.     N_discon_req_t      discon_req;
  312.     N_error_ack_t       error_ack;
  313.     N_exdata_ind_t      exdata_ind;
  314.     N_info_ack_t        info_ack;
  315.     N_ok_ack_t          ok_ack;
  316.     N_reset_con_t       reset_con;
  317.     N_reset_req_t       reset_req;
  318.     N_reset_ind_t       reset_ind;
  319. } N_npi_ctl_t;
  320.  
  321. /* some extra definitions to help out */
  322. typedef char    x25addr_t[45];        /* max 40 defined by CCITT */
  323. typedef char    N_npi_data_t[NPI_MAX_DATA];
  324.  
  325. /* fd or server waiting for connections, used by netclos and netopen */
  326. extern int x25serverfd;
  327.  
  328. #endif /* IBMX25 */
  329.  
  330. #ifdef HPX25                /* X.25 includes, HP-UX only */
  331. #include <x25/ccittproto.h>
  332. #include <x25/x25.h>
  333. #include <x25/x25addrstr.h>
  334. #include <x25/x25codes.h>
  335. #include <x25/x25hd_ioctl.h>
  336. #include <x25/x25ioctls.h>
  337. #include <x25/x25str.h>
  338. #include <sys/ioctl.h>
  339. #endif /* HPX25 */
  340.  
  341. /* C-Kermit X.3 / X.25 / X.29 / X.121 support functions */
  342.  
  343. /* (riehm: this list of functions isn't quite right for AIX) */
  344.  
  345. _PROTOTYP( int shopad, (int) );
  346. _PROTOTYP( int shox25, (int) );
  347. _PROTOTYP( VOID initpad, (void) );
  348. _PROTOTYP( VOID setpad, (CHAR *, int) );
  349. _PROTOTYP( VOID readpad, (CHAR *, int, CHAR *) );
  350. _PROTOTYP( int qbitpkt, (CHAR *, int) );
  351. _PROTOTYP( VOID setqbit, (void) );
  352. _PROTOTYP( VOID resetqbit, (void) );
  353. _PROTOTYP( VOID breakact, (void) );
  354. _PROTOTYP( int pkx121, (char *, CHAR *) );
  355. _PROTOTYP( SIGTYP x25oobh, (int) );
  356. _PROTOTYP( int x25diag, (void) );
  357. _PROTOTYP( int x25intr, (char) );
  358. _PROTOTYP( int x25reset, (char, char) );
  359. _PROTOTYP( int x25clear, (void) );
  360. _PROTOTYP( int x25stat, (void) );
  361. _PROTOTYP( int x25in, (int, CHAR *) );
  362. _PROTOTYP( int setpadp, (void) );
  363. _PROTOTYP( int setx25, (void) );
  364. _PROTOTYP( int x25xin, (int, CHAR *) );
  365. _PROTOTYP( int x25inl, (CHAR *, int, int, CHAR) );
  366.  
  367. #ifdef IBMX25
  368.                     /* setup x25 */
  369. _PROTOTYP( ulong x25bind, (int, char *, char *, int, int, int, ulong) );
  370. _PROTOTYP( int x25call, (int, char *, char *) ); /* connect to remote */
  371. _PROTOTYP( int x25unbind, (int) );    /* disconnect */
  372. _PROTOTYP( char *x25prim, (int) );    /* display primitives */
  373. _PROTOTYP( int x25local_nua, (char *) ); /* find local NUA */
  374. #endif /* IBMX25 */
  375.  
  376. #endif /* ANYX25 */
  377.  
  378. /* CMU-OpenVMS/IP */
  379.  
  380. #ifdef CMU_TCPIP            /* CMU_TCPIP implies TCPSOCKET */
  381. #ifndef TCPSOCKET
  382. #define TCPSOCKET
  383. #endif /* TCPSOCKET */
  384. #ifndef TCPIPLIB
  385. #define TCPIPLIB
  386. #endif /* TCPIPLIB */
  387. #endif /* CMU_TCPIP */
  388.  
  389. /* DEC TCP/IP for (Open)VMS, previously known as UCX */
  390.  
  391. #ifdef DEC_TCPIP            /* DEC_TCPIP implies TCPSOCKET */
  392. #ifndef TCPSOCKET
  393. #define TCPSOCKET
  394. #endif /* TCPSOCKET */
  395. #ifndef TCPIPLIB
  396. #define TCPIPLIB
  397. #endif /* TCPIPLIB */
  398. #endif /* DEC_TCPIP */
  399.  
  400. /* SRI/TGV/Cisco/Process MultiNet, TCP/IP for VAX/VMS */
  401.  
  402. #ifdef MULTINET                /* MULTINET implies TCPSOCKET */
  403. #ifndef TCPSOCKET
  404. #define TCPSOCKET
  405. #endif /* TCPSOCKET */
  406. #ifndef TCPIPLIB
  407. #define TCPIPLIB
  408. #endif /* TCPIPLIB */
  409. #ifndef TGVORWIN            /* MULTINET and WINTCP */
  410. #define TGVORWIN            /* share a lot of code... */
  411. #endif /* TGVORWIN */
  412. #endif /* MULTINET */
  413.  
  414. /* Wollongong TCP/IP for VAX/VMS */
  415.  
  416. #ifdef WINTCP                /* WINTCP implies TCPSOCKET */
  417. #ifndef TCPSOCKET
  418. #define TCPSOCKET
  419. #endif /* TCPSOCKET */
  420. #ifndef TCPIPLIB
  421. #define TCPIPLIB
  422. #endif /* TCPIPLIB */
  423. #ifndef TGVORWIN            /* WINTCP and MULTINET */
  424. #define TGVORWIN            /* share a lot of code... */
  425. #endif /* TGVORWIN */
  426. #endif /* WINTCP */
  427.  
  428. /* Wollongong TCP/IP for AT&T Sys V */
  429.  
  430. #ifdef WOLLONGONG            /* WOLLONGONG implies TCPSOCKET */
  431. #ifndef TCPSOCKET            /* Don't confuse WOLLONGONG */
  432. #define TCPSOCKET            /* (which is for UNIX) with */
  433. #endif /* TCPSOCKET */            /* WINTCP, which is for VMS! */
  434. #endif /* WOLLONGONG */
  435.  
  436. #ifdef EXCELAN                /* EXCELAN implies TCPSOCKET */
  437. #ifndef TCPSOCKET
  438. #define TCPSOCKET
  439. #endif /* TCPSOCKET */
  440. #endif /* EXCELAN */
  441.  
  442. #ifdef INTERLAN                /* INTERLAN implies TCPSOCKET */
  443. #ifndef TCPSOCKET
  444. #define TCPSOCKET
  445. #endif /* TCPSOCKET */
  446. #endif /* INTERLAN */
  447.  
  448. #ifdef BEOSORBEBOX
  449. #ifndef TCPIPLIB
  450. #define TCPIPLIB
  451. #endif /* TCPIPLIB */
  452. #define socket_errno    h_errno
  453. #define socket_read(x,y,z)     recv(x,y,sizeof(char),z)
  454. #define socket_write(x,y,z)     send(x,y,sizeof(char),z)
  455. #define socket_ioctl    ioctl
  456. #define socket_close(x)         closesocket(x)
  457. #ifndef FIONBIO
  458. #define FIONBIO 2
  459. #endif /* FIONBIO */
  460. #ifndef COHERENT            /* eh? */
  461. #ifndef FIONREAD
  462. #define FIONREAD       1
  463. #endif /* FIONREAD */
  464. #endif /* COHERENT */
  465. #ifndef SIOCATMARK
  466. #define SIOCATMARK     3
  467. #endif /* SIOCATMARK */
  468. #endif /* BEOSORBEBOX */
  469.  
  470. #ifdef COMMENT /* no longer used but might come in handy again later... */
  471. /*
  472.   CK_READ0 can (and should) be defined if and only if:
  473.   (a) read(fd,&x,0) can be used harmlessly on a TCP/IP socket connection.
  474.   (b) read(fd,&x,0) returns 0 if the connection is up, -1 if it is down.
  475. */
  476. #ifndef CK_READ0
  477. #ifdef TCPSOCKET
  478. #ifdef SUNOS41                /* It works in SunOS 4.1 */
  479. #define CK_READ0
  480. #else
  481. #ifdef NEXT                /* and NeXTSTEP */
  482. #define CK_READ0
  483. #endif /* NEXT */
  484. #endif /* SUNOS41 */
  485. #endif /* TCPSOCKET */
  486. #endif /* CK_READ0 */
  487. #endif /* COMMENT */
  488.  
  489. #ifdef TCPSOCKET
  490. #ifndef NOHADDRLIST
  491. #ifndef HADDRLIST
  492. #ifdef SUNOS41
  493. #define HADDRLIST
  494. #endif /* SUNOS41 */
  495. #ifdef SOLARIS
  496. #define HADDRLIST
  497. #endif /* SOLARIS */
  498. #ifdef LINUX
  499. #define HADDRLIST
  500. #endif /* LINUX */
  501. #ifdef AIXRX
  502. #define HADDRLIST
  503. #endif /* AIXRS */
  504. #ifdef HPUX
  505. #define HADDRLIST
  506. #endif /* HPUX */
  507. #ifdef IRIX
  508. #define HADDRLIST
  509. #endif /* IRIX */
  510. #ifdef I386IX
  511. #define HADDRLIST
  512. #endif /* I386IX */
  513. #endif /* HADDRLIST */
  514. #endif /* NOHADDRLIST */
  515. #endif /* TCPSOCKET */
  516.  
  517. /* Telnet protocol */
  518.  
  519. #ifdef TCPSOCKET            /* TCPSOCKET implies TNCODE */
  520. #ifndef TNCODE                /* Which means... */
  521. #define TNCODE                /* Compile in telnet code */
  522. #endif /* TNCODE */
  523.  
  524. /*
  525.    Platforms where we must call gethostname(buf,len) and then
  526.    gethostbyname(buf) to get local IP address, rather than calling
  527.    gethostbyname("").
  528. */
  529. #ifndef CKGHNLHOST
  530. #ifdef datageneral
  531. #define CKGHNLHOST
  532. #else
  533. #ifdef SOLARIS
  534. #define CKGHNLHOST
  535. #else
  536. #ifdef SUNOS4
  537. #define CKGHNLHOST
  538. #else
  539. #ifdef UNIXWARE
  540. #define CKGHNLHOST
  541. #else
  542. #ifdef SINIX
  543. #define CKGHNLHOST
  544. #endif /* SINIX */
  545. #endif /* UNIXWARE */
  546. #endif /* SUNOS4 */
  547. #endif /* SOLARIS */
  548. #endif /* datageneral */
  549. #endif /* CKGHNLHOST */
  550.  
  551. /*
  552.   Telnet local-echo buffer, used for saving up user data that can't be
  553.   properly displayed and/or evaluated until pending Telnet negotiations are
  554.   complete.  TTLEBUF is defined for platforms (like UNIX) where net i/o is
  555.   done by the same routines that do serial i/o (in which case the relevant
  556.   code goes into the ck?tio.c module, in the ttinc(), ttchk(), etc, routines);
  557.   NETLETBUF is defined for platforms (like VMS) that use different APIs for
  558.   network and serial i/o, and enables the copies of the same routines that
  559.   are in ckcnet.c.
  560. */
  561. #ifndef TTLEBUF
  562. #ifdef UNIX
  563. #define TTLEBUF
  564. #else
  565. #ifdef datageneral
  566. #define TTLEBUF
  567. #endif /* datageneral */
  568. #endif /* UNIX */
  569. #endif /* TTLEBUF */
  570.  
  571. #ifndef NETLEBUF
  572. #ifdef VMS
  573. #define NETLEBUF
  574. #endif /* VMS */
  575. #endif /* NETLEBUF */
  576.  
  577. #ifndef RLOGCODE            /* What about Rlogin? */
  578. #ifndef NORLOGIN
  579. /*
  580.   Rlogin can be enabled only for UNIX versions that have both SIGURG
  581.   (SCO doesn't) and CK_TTGWSIZ (OSF/1 doesn't), so we don't assume that
  582.   any others have these without verifying first.  Not that it really makes
  583.   little difference since you can only use Rlogin if you are root...
  584. */
  585. #ifdef SUNOS41
  586. #define RLOGCODE
  587. #else
  588. #ifdef SOLARIS
  589. #define RLOGCODE
  590. #else
  591. #ifdef HPUX9
  592. #define RLOGCODE
  593. #else
  594. #ifdef HPUX10
  595. #define RLOGCODE
  596. #else
  597. #ifdef OSF40
  598. #define RLOGCODE
  599. #else
  600. #ifdef NEXT
  601. #define RLOGCODE
  602. #else
  603. #ifdef AIX41
  604. #define RLOGCODE
  605. #else
  606. #ifdef UNIXWARE
  607. #define RLOGCODE
  608. #else
  609. #ifdef IRIX51
  610. #define RLOGCODE
  611. #else
  612. #ifdef IRIX60
  613. #define RLOGCODE
  614. #else
  615. #ifdef QNX
  616. #define RLOGCODE
  617. #else
  618. #ifdef __linux__
  619. #define RLOGCODE
  620. #endif /* __linux__ */
  621. #endif /* QNX */
  622. #endif /* IRIX60 */
  623. #endif /* IRIX51 */
  624. #endif /* UNIXWARE */
  625. #endif /* AIX41 */
  626. #endif /* NEXT */
  627. #endif /* OSF40 */
  628. #endif /* HPUX10 */
  629. #endif /* HPUX9 */
  630. #endif /* SOLARIS */
  631. #endif /* SUNOS41 */
  632. #endif /* NORLOGIN */
  633. #ifdef VMS                /* VMS */
  634. #define RLOGCODE
  635. #endif /* VMS */
  636. #endif /* RLOGCODE */
  637. #endif /* TCPSOCKET */
  638.  
  639. #ifdef SUNX25                /* SUNX25 implies TCPSOCKET */
  640. #ifndef TCPSOCKET            /* But doesn't imply TNCODE */
  641. #define TCPSOCKET
  642. #endif /* TCPSOCKET */
  643. #endif /* SUNX25 */
  644.  
  645. #ifndef TCPSOCKET
  646. #ifndef NO_DNS_SRV
  647. #define NO_DNS_SRV
  648. #endif /* NO_DNS_SRV */
  649. #endif /* TCPSOCKET */
  650.  
  651. /* This is the TCPSOCKET section... */
  652.  
  653. #ifdef TCPSOCKET
  654.  
  655. #ifndef NETCONN                /* TCPSOCKET implies NETCONN */
  656. #define NETCONN
  657. #endif /* NETCONN */
  658.  
  659. #ifndef NO_DNS_SRV
  660. #ifdef OS2ONLY
  661. #define NO_DNS_SRV
  662. #endif /* OS2ONLY */
  663. #ifdef VMS
  664. #define NO_DNS_SRV
  665. #endif /* VMS */
  666. #ifdef STRATUS
  667. #define NO_DNS_SRV
  668. #endif /* STRATUS */
  669. #ifdef datageneral
  670. #define NO_DNS_SRV
  671. #endif /* datageneral */
  672. #ifdef ultrix
  673. #define NO_DNS_SRV
  674. #endif /* ultrix */
  675. #ifdef NEXT
  676. #define NO_DNS_SRV
  677. #endif /* NEXT */
  678. #endif /* NO_DNS_SRV */
  679.  
  680. #ifndef CK_DNS_SRV                      /* Use DNS SRV records to determine */
  681. #ifndef NO_DNS_SRV                      /* host and ports */
  682. #define CK_DNS_SRV
  683. #endif /* NO_DNS_SRV */
  684. #endif /* CK_DNS_SRV */
  685.  
  686. #ifndef NOLISTEN            /* select() is required to support */
  687. #ifndef SELECT                /* incoming connections. */
  688. #ifndef VMS
  689. #ifndef OS2
  690. #define NOLISTEN
  691. #endif /* OS2 */
  692. #endif /* VMS */
  693. #endif /* SELECT */
  694. #endif /* NOLISTEN */
  695.  
  696. /* BSD sockets library header files */
  697.  
  698. #ifdef VMS
  699. /*
  700.   Because bzero() and bcopy() are not portable among VMS versions,
  701.   or compilers, or TCP/IP products, etc.
  702. */
  703. #ifndef bzero
  704. #define bzero(s,n) memset(s,0,n)
  705. #endif /* bzero */
  706. #ifndef bcopy
  707. #define bcopy(h,a,l) memcpy(a,h,l)
  708. #endif /* bcopy */
  709. #endif /* VMS */
  710.  
  711. #ifdef UNIX                /* UNIX section */
  712.  
  713. #ifdef SVR4
  714. /*
  715.   These suggested by Rob Healey, rhealey@kas.helios.mn.org, to avoid
  716.   bugs in Berkeley compatibility library on Sys V R4 systems, but untested
  717.   by me (fdc).  Remove this bit if it gives you trouble.
  718.   (Later corrected by Marc Boucher <mboucher@iro.umontreal.ca> because
  719.   bzero/bcopy are not argument-compatible with memset/memcpy|memmove.)
  720. */
  721. #define bzero(s,n) memset(s,0,n)
  722. #ifdef SOLARIS
  723. #ifdef SUNX25
  724. #undef bzero
  725. /*
  726.   WOULD YOU BELIEVE... That the Solaris X.25 /opt/SUNWcomm/lib/libsockx25
  727.   library references bzero, even though the use of bzero is forbidden in
  728.   Solaris?  Look for the function definition in ckcnet.c.
  729. */
  730. _PROTOTYP( void bzero, (char *, int) );
  731. #endif /* SUNX25 */
  732. #define bcopy(h,a,l) memcpy(a,h,l)
  733. #else
  734. #define bcopy(h,a,l) memmove(a,h,l)
  735. #endif /* SOLARIS */
  736. #else /* !SVR4 */
  737. #ifdef PTX                /* Sequent DYNIX PTX 1.3 */
  738. #define bzero(s,n) memset(s,0,n)
  739. #define bcopy(h,a,l) memcpy(a,h,l)
  740. #endif /* PTX */
  741. #endif /* SVR4 */
  742.  
  743. #ifdef INTERLAN                /* Racal-Interlan TCP/IP */
  744. #include <interlan/socket.h>
  745. #include <interlan/il_types.h>
  746. #include <interlan/telnet.h>
  747. #include <interlan/il_errno.h>
  748. #include <interlan/in.h>
  749. #include <interlan/telnet.h>        /* Why twice ? ? ? */
  750. #else /* Not Interlan */
  751. #ifdef BEOSORBEBOX
  752. #include <socket.h>
  753. #else /* Not BEBOX */            /* Normal BSD TCP/IP library */
  754. #ifdef COMMENT
  755. #ifndef HPUX
  756. #include <arpa/telnet.h>
  757. #endif /* HPUX */
  758. #endif /* COMMENT */
  759. #ifdef SCO234
  760. #include <sys/errno.tcp.h>
  761. #include <sys/types.tcp.h>
  762. #endif /* SCO234 */
  763. #include <sys/socket.h>
  764. #ifdef WOLLONGONG
  765. #include <sys/in.h>
  766. #else
  767. #include <netinet/in.h>
  768. #endif /* WOLLONGONG */
  769. #endif /* BEOSORBEBOX */
  770. #endif /* INTERLAN */
  771.  
  772. #ifndef EXCELAN
  773. #include <netdb.h>
  774. #ifndef INTERLAN
  775. #ifdef WOLLONGONG
  776. #define minor                /* Do not include <sys/macros.h> */
  777. #include <sys/inet.h>
  778. #else
  779. #ifndef OXOS
  780. #ifndef HPUX
  781. #ifndef BEOSORBEBOX
  782. #include <arpa/inet.h>
  783. #endif /* BEOSORBEBOX */
  784. #endif /* HPUX */
  785. #else /* OXOS */
  786. /* In too many releases of X/OS, <arpa/inet.h> declares inet_addr() as
  787.  * ``struct in_addr''.  This is definitively wrong, and could cause
  788.  * core dumps.  Instead of including that bad file, inet_addr() is
  789.  * correctly declared here.  Of course, all the declarations done there
  790.  * has been copied here.
  791.  */
  792. unsigned long inet_addr();
  793. char    *inet_ntoa();
  794. struct    in_addr inet_makeaddr();
  795. unsigned long inet_network();
  796. #endif /* OXOS */
  797. #endif /* WOLLONGONG */
  798. #endif /* INTERLAN */
  799. #endif /* EXCELAN */
  800.  
  801. #ifdef EXCELAN                /* Excelan TCP/IP */
  802. #ifndef bzero
  803. #define bzero(s,n) memset(s,0,n)
  804. #endif /* bzero */
  805. #ifndef bcopy
  806. #define bcopy(h,a,l) memcpy(a,h,l)
  807. #endif /* bcopy */
  808. #include <ex_errno.h>
  809. #endif /* EXCELAN */
  810.  
  811. #ifdef I386IX                /* Interactive Sys V R3 network. */
  812. /* #define TELOPTS */            /* This might need defining. */
  813. #define ORG_NLONG ENAMETOOLONG        /* Resolve conflicting symbols */
  814. #undef ENAMETOOLONG            /* in <errno.h> and <net/errno.h> */
  815. #define ORG_NEMPTY ENOTEMPTY
  816. #undef ENOTEMPTY
  817. #include <net/errno.h>
  818. #undef ENAMETOOLONG
  819. #define ENAMETOOLONG ORG_NLONG
  820. #undef ENOTEMPTY
  821. #define ENOTEMPTY ORG_NEMPTY
  822. #include <netinet/tcp.h>        /* for inet_addr() */
  823. #endif /* I386IX */
  824. /*
  825.   Data type of the inet_addr() function...
  826.   We define INADDRX if it is of type struct inaddr.
  827.   If it is undefined, unsigned long is assumed.
  828.   Look at <arpa/inet.h> to find out.  The following known cases are
  829.   handled here.  Other systems that need it can be added here, or else
  830.   -DINADDRX can be included in the CFLAGS on the cc command line.
  831. */
  832. #ifndef NOINADDRX
  833. #ifdef DU2                /* DEC Ultrix 2.0 */
  834. #define INADDRX
  835. #endif /* DU2 */
  836. #endif /* NOINADDRX */
  837.  
  838. #else /* Not UNIX */
  839.  
  840. #ifdef VMS                /* (Open)VMS section */
  841.  
  842. #ifdef MULTINET                /* TGV MultiNet */
  843. /*
  844.   In C-Kermit 7.0 Beta.08 we started getting scads of compile time warnings
  845.   in Multinet builds: "blah" is implicitly declared as a function, where blah
  846.   is socket_read/write/close, ntohs, htons, getpeername, accept, select, etc.
  847.   I have no idea why -- these routines are declared in the header files below,
  848.   and the includes haven't changed.  The executable still seems to work OK.
  849.   Messing with the order of the following includes is disastrous.
  850. */
  851. #ifdef MULTINET_NO_PROTOTYPES
  852. #undef MULTINET_NO_PROTOTYPES
  853. #endif /* MULTINET_NO_PROTOTYPES */
  854.  
  855. #ifdef  __cplusplus
  856. #undef  __cplusplus
  857. #endif /*  __cplusplus */
  858.  
  859. #include "multinet_root:[multinet.include]errno.h"
  860. #include "multinet_root:[multinet.include.sys]types.h"
  861. #include "multinet_root:[multinet.include.sys]socket.h"
  862. #include "multinet_root:[multinet.include]netdb.h"
  863. #include "multinet_root:[multinet.include.netinet]in.h"
  864. #include "multinet_root:[multinet.include.arpa]inet.h"
  865. #include "multinet_root:[multinet.include.sys]ioctl.h"
  866.  
  867. #ifdef COMMENT
  868. /*
  869.   No longer needed because now bzero/bcopy are macros defined as
  870.   memset/memmove in all VMS builds.
  871. */
  872. /*
  873.   We should be able to pick these up from <strings.h> but it's
  874.   not portable between VAXC and DECC.  And even with DECC 5.x we have a
  875.   difference between VAX and Alpha.  We get warnings here on the VAX
  876.   with DECC 5.6-003 but they are not fatal.
  877. */
  878. #ifndef __DECC_VER
  879. #ifndef bzero
  880. _PROTOTYP( void bzero, (char *, int) );
  881. #endif /* bzero */
  882. #ifndef bcopy
  883. _PROTOTYP( void bcopy, (char *, char *, int) );
  884. #endif /* bcopy */
  885. #endif /* __DECC_VER */
  886. #endif /* COMMENT */
  887.  
  888. #ifdef __DECC
  889. /*
  890.    If compiling under DEC C the socket calls must not be prefixed with
  891.    DECC$.  This is done by using the compiler switch /Prefix=Ansi_C89.
  892.    However, this causes some calls that should be prefixed to not be
  893.    (which I think is a bug in the compiler - I've been told these calls
  894.    are present in ANSI compilers).  At any rate, such calls are fixed
  895.    here by explicitly prefixing them.
  896. */
  897. #ifdef COMMENT
  898. /*
  899.    But this causes errors with VMS 6.2 / DEC C 5.3-006 / MultiNet 4.0A on
  900.    a VAX (but not on an Alpha).  So now what happens if we skip doing this?
  901. */
  902. #define close decc$close
  903. #define alarm decc$alarm
  904. #endif /* COMMENT */
  905. #endif /* __DECC */
  906.  
  907. #else /* Not MULTINET */
  908.  
  909. #ifdef WINTCP                /* WIN/TCP = PathWay for VMS */
  910. #ifdef OLD_TWG
  911. #include "twg$tcp:[netdist.include.sys]errno.h"
  912. #include "twg$tcp:[netdist.include.sys]types2.h" /* avoid some duplicates */
  913. #else
  914. #include "twg$tcp:[netdist.include]socket_aliases.h"
  915. #include <errno.h>
  916. #include "twg$tcp:[netdist.include.sys]types.h"
  917. #endif /* OLD_TWG */
  918. #include "twg$tcp:[netdist.include.sys]socket.h"
  919. #include "twg$tcp:[netdist.include]netdb.h"
  920. #include "twg$tcp:[netdist.include.sys]domain.h"
  921. #include "twg$tcp:[netdist.include.sys]protosw.h"
  922. #include "twg$tcp:[netdist.include.netinet]in.h"
  923. #include "twg$tcp:[netdist.include.arpa]inet.h"
  924. #include "twg$tcp:[netdist.include.sys]ioctl.h"
  925.  
  926. #else /* Not WINTCP */
  927.  
  928. #ifdef DEC_TCPIP
  929. #ifdef UCX50
  930. #ifndef IF_DOT_H
  931. #define IF_DOT_H
  932. #endif /*  IF_DOT_H */
  933. #endif /* UCX50 */
  934.  
  935. #ifdef IF_DOT_H
  936. #include <if.h>                /* Needed to put up u_int typedef */
  937. #else
  938. #ifdef NEEDUINT
  939. typedef unsigned int u_int;
  940. #endif /* NEEDUINT */
  941. #endif /* IF_DOT_H */
  942.  
  943. #include <in.h>
  944. #include <netdb.h>
  945. #include <socket.h>
  946. #include "ckvioc.h"
  947. #define socket_errno errno
  948.  
  949. #ifdef COMMENT
  950. /*
  951.   No longer needed because now bzero/bcopy are macros defined as
  952.   memset/memmove in all VMS builds.
  953. */
  954. /*
  955.   Translation: In <strings.h>, which exists only for DECC >= 5.2, bzero()
  956.   and bcopy() are declared only for OpenVMS >= 7.0.  This still might need
  957.   adjustment for DECC 5.0 and higher.
  958. */
  959. #ifdef __DECC_VER
  960. #ifdef VMSV70
  961. /*
  962.   Note: you can't use "#if (__VMS_VER>=70000000)" because that is not
  963.   portable and kills non-VMS builds.
  964. */
  965. #include <strings.h>
  966. #else
  967. #define bzero(s,n) memset(s,0,n)
  968. #define bcopy(h,a,l) memmove(a,h,l)
  969. #endif /* VMSV70 */
  970. #else
  971. #define bzero(s,n) memset(s,0,n)
  972. #define bcopy(h,a,l) memmove(a,h,l)
  973. #endif /* __DECC_VER */
  974. #endif /* COMMENT */
  975.  
  976. #define socket_read     read
  977. #define socket_write     write
  978. #define socket_ioctl    ioctl
  979. #define socket_close    close
  980.  
  981. #ifdef __DECC
  982. int ioctl (int d, int request, void *argp);
  983. #else
  984. int ioctl (int d, int request, char *argp);
  985. #endif /* DECC */
  986. /*
  987.   UCX supports select(), but does not provide the needed symbol and
  988.   structure definitions in any header file, so ...
  989. */
  990. #include <types.h>
  991. #ifndef NBBY
  992. /*-
  993.  * Copyright (c) 1982, 1986, 1991, 1993
  994.  *    The Regents of the University of California.  All rights reserved.
  995.  *
  996.  * Redistribution and use in source and binary forms, with or without
  997.  * modification, are permitted provided that the following conditions
  998.  * are met:
  999.  * 1. Redistributions of source code must retain the above copyright
  1000.  *    notice, this list of conditions and the following disclaimer.
  1001.  * 2. Redistributions in binary form must reproduce the above copyright
  1002.  *    notice, this list of conditions and the following disclaimer in the
  1003.  *    documentation and/or other materials provided with the distribution.
  1004.  * 3. All advertising materials mentioning features or use of this software
  1005.  *    must display the following acknowledgement:
  1006.  *    This product includes software developed by the University of
  1007.  *    California, Berkeley and its contributors.
  1008.  * 4. Neither the name of the University nor the names of its contributors
  1009.  *    may be used to endorse or promote products derived from this software
  1010.  *    without specific prior written permission.
  1011.  *
  1012.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1013.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1014.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1015.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1016.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1017.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1018.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1019.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1020.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1021.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1022.  * SUCH DAMAGE.
  1023.  *
  1024.  *    @(#)types.h    8.1 (Berkeley) 6/2/93
  1025.  */
  1026.  
  1027. #define    NBBY    8        /* number of bits in a byte */
  1028.  
  1029. /*
  1030.  * Select uses bit masks of file descriptors in longs.  These macros
  1031.  * manipulate such bit fields (the filesystem macros use chars).
  1032.  * FD_SETSIZE may be defined by the user, but the default here should
  1033.  * be enough for most uses.
  1034.  */
  1035. #ifndef    FD_SETSIZE
  1036. #define    FD_SETSIZE    256
  1037. #endif
  1038.  
  1039. typedef long    fd_mask;
  1040. #define NFDBITS    (sizeof(fd_mask) * NBBY)    /* bits per mask */
  1041.  
  1042. #ifndef howmany
  1043. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  1044. #endif
  1045.  
  1046. typedef    struct fd_set {
  1047.     fd_mask    fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  1048. } fd_set;
  1049.  
  1050. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  1051. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  1052. #define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  1053. #define    FD_COPY(f, t)    bcopy(f, t, sizeof(*(f)))
  1054. #define    FD_ZERO(p)    bzero(p, sizeof(*(p)))
  1055. #endif /* !NBBY */
  1056.  
  1057. #else  /* Not DEC_TCPIP */
  1058.  
  1059. #ifdef CMU_TCPIP
  1060. #include <types.h>
  1061. #include <in.h>
  1062. #include <netdb.h>
  1063. #include <socket.h>
  1064. #include <ioctl.h>
  1065. #include "ckvioc.h"
  1066. #define socket_errno errno
  1067. #ifdef COMMENT
  1068. /* This is now done above for all VMS builds */
  1069. #define bzero(s,n) memset(s,0,n)
  1070. #define bcopy(h,a,l) memmove(a,h,l)
  1071. #endif /* COMMENT */
  1072.  
  1073. /*
  1074.  * Routines supplied in LIBCMU.OLB
  1075.  */
  1076. #define socket_ioctl    ioctl
  1077. #define socket_read     cmu_read
  1078. #define socket_write     cmu_write
  1079. #define socket_close    cmu_close
  1080.  
  1081. #endif /* CMU_TCPIP */
  1082. #endif /* DEC_TCPIP */
  1083. #endif /* WINTCP */
  1084. #endif /* MULTINET */
  1085.  
  1086. #else /* Not VMS */
  1087.  
  1088. #ifdef OS2
  1089. #include "ckonet.h"
  1090. #ifndef NT
  1091. #include <nerrno.h>
  1092. #endif
  1093. #endif /* OS2 */
  1094.  
  1095. #ifdef STRATUS  /* Stratus VOS using OS TCP/IP products S235, S236, S237 */
  1096. #include <tcp_socket.h>
  1097. /* This gets used some places when TCPSOCKET is defined. */
  1098. /* OS TCP provides bzero(), but not bcopy()... go figure. */
  1099. #define bcopy(s,d,z) memcpy(d,s,z)
  1100. #endif /* STRATUS */
  1101.  
  1102. #ifdef OSK
  1103. #ifndef OSKXXC
  1104. #include <inet/in.h>
  1105. #include <inet/netdb.h>
  1106. #include <inet/socket.h>
  1107. #else
  1108. #include <INET/in.h>
  1109. #include <INET/netdb.h>
  1110. #include <INET/socket.h>
  1111. #endif /* OSKXXC */
  1112. #define bzero(s,n) memset(s,0,n)
  1113. #define bcopy(h,a,l) memcpy(a,h,l)
  1114. typedef char * caddr_t; /* core address type */
  1115. #endif /* OSK */
  1116.  
  1117. #endif /* VMS */
  1118. #endif /* UNIX */
  1119. #endif /* TCPSOCKET */
  1120.  
  1121. #ifdef TNCODE                /* If we're compiling telnet code... */
  1122. #ifndef IKS_OPTION
  1123. #ifndef STRATUS
  1124. #define IKS_OPTION
  1125. #endif /* STRATUS */
  1126. #endif /* IKS_OPTION */
  1127. #include "ckctel.h"
  1128. #else
  1129. extern int sstelnet;
  1130. #ifdef IKSD
  1131. #undef IKSD
  1132. #endif /* IKSD */
  1133. #ifndef NOIKSD
  1134. #define NOIKSD
  1135. #endif /* NOIKSD */
  1136. #ifdef IKS_OPTION
  1137. #undef IKS_OPTION
  1138. #endif /* IKS_OPTION */
  1139. #endif /* TNCODE */
  1140.  
  1141. #ifndef NOTCPOPTS
  1142. /*
  1143.   Automatically define NOTCPOPTS for configurations where they can't be
  1144.   used at runtime or cause too much trouble at compile time.
  1145. */
  1146. #ifdef CMU_TCPIP            /* CMU/Tek */
  1147. #define NOTCPOPTS
  1148. #endif /* CMU_TCPIP */
  1149. #ifdef MULTINET                /* Multinet on Alpha */
  1150. #ifdef __alpha
  1151. #define NOTCPOPTS
  1152. #endif /* __alpha */
  1153. #endif /* MULTINET */
  1154. #endif /* NOTCPOPTS */
  1155.  
  1156. #ifdef NOTCPOPTS
  1157. #ifdef TCP_NODELAY
  1158. #undef TCP_NODELAY
  1159. #endif /* TCP_NODELAY */
  1160. #ifdef SO_LINGER
  1161. #undef SO_LINGER
  1162. #endif /* SO_LINGER */
  1163. #ifdef SO_KEEPALIVE
  1164. #undef SO_KEEPALIVE
  1165. #endif /* SO_KEEPALIVE */
  1166. #ifdef SO_SNDBUF
  1167. #undef SO_SNDBUF
  1168. #endif /* SO_SNDBUF */
  1169. #ifdef SO_RCVBUF
  1170. #undef SO_RCVBUF
  1171. #endif /* SO_RCVBUF */
  1172. #endif /* NOTCPOPTS */
  1173.  
  1174. #ifdef TCPSOCKET
  1175. #ifdef SOL_SOCKET
  1176. #ifdef TCP_NODELAY
  1177. _PROTOTYP( int no_delay, (int) );
  1178. #endif /* TCP_NODELAY */
  1179. #ifdef SO_KEEPALIVE
  1180. _PROTOTYP( int keepalive, (int) ) ;
  1181. #endif /* SO_KEEPALIVE */
  1182. #ifdef SO_LINGER
  1183. _PROTOTYP( int ck_linger, (int, int) ) ;
  1184. #endif /* SO_LINGER */
  1185. #ifdef SO_SNDBUF
  1186. _PROTOTYP( int sendbuf,(int) ) ;
  1187. #endif /* SO_SNDBUF */
  1188. #ifdef SO_RCVBUF
  1189. _PROTOTYP( int recvbuf, (int) ) ;
  1190. #endif /* SO_RCVBUF */
  1191. #ifdef SO_DONTROUTE
  1192. _PROTOTYP(int dontroute, (int));
  1193. #endif /* SO_DONTROUTE */
  1194. #endif /* SOL_SOCKET */
  1195. _PROTOTYP( int getlocalipaddr, (VOID));
  1196. _PROTOTYP( int getlocalipaddrs, (char *,int,int));
  1197. _PROTOTYP( char * ckgetpeer, (VOID));
  1198. _PROTOTYP( char * ckgetfqhostname,(char *));
  1199.  
  1200. /* AIX */
  1201.  
  1202. #ifdef AIXRS
  1203. #ifndef TCP_NODELAY
  1204. #define TCP_NODELAY 0x1
  1205. #endif /* TCP_NODELAY */
  1206. #ifndef TCP_MAXSEG
  1207. #define TCP_MAXSEG 0x2
  1208. #endif /* TCP_MAXSEG */
  1209. #ifndef TCP_KEEPALIVE
  1210. #define TCP_KEEPALIVE 0x8
  1211. #endif /* TCP_KEEPALIVE */
  1212. #endif /* AIXRS */
  1213. #endif /* TCPSOCKET */
  1214.  
  1215. #ifdef RLOGCODE
  1216. #ifndef CK_TTGWSIZ
  1217. SORRY_RLOGIN_REQUIRES_TTGWSIZ_see_ckcplm.doc
  1218. #endif /* CK_TTGWSIZ */
  1219. #endif /* RLOGCODE */
  1220.  
  1221. #ifdef CK_NAWS
  1222. #ifndef CK_TTGWSIZ
  1223. SORRY_CK_NAWS_REQUIRES_TTGWSIZ_see_ckcplm.doc
  1224. #endif /* CK_TTGWSIZ */
  1225. #endif /* CK_NAWS */
  1226.  
  1227. #ifndef PF_INET
  1228. #ifdef  AF_INET
  1229. #define PF_INET AF_INET
  1230. #endif /* AF_INET */
  1231. #endif /* PF_INET */
  1232.  
  1233. #ifndef IPPORT_ECHO
  1234. #define IPPORT_ECHO 7
  1235. #endif /* IPPORT_ECHO */
  1236.  
  1237. #ifdef CK_KERBEROS
  1238. #ifdef RLOGCODE
  1239. _PROTOTYP(int ck_krb_rlogin,(CHAR *, int, CHAR *, CHAR *, CHAR *,
  1240.                               struct sockaddr_in *,
  1241.                               struct sockaddr_in *, int, int));
  1242. #endif /* RLOGCODE */
  1243. #endif /* CK_KERBEROS */
  1244.  
  1245. _PROTOTYP( VOID ini_kerb, ( void ) );   /* Kerberos initialization routine */
  1246. _PROTOTYP( int doauth, (int) );         /* AUTHENTICATE action routine */
  1247.  
  1248. #ifdef CK_DNS_SRV
  1249. _PROTOTYP(int locate_srv_dns,(const char *host, const char *service,
  1250.                   const char *protocol, struct sockaddr **addr_pp,
  1251.                   int *naddrs));
  1252. #endif /* CK_DNS_SRV */
  1253.  
  1254. #ifndef NOHTTP
  1255. _PROTOTYP(int http_get, (char *,char **,char *,char *,char,char *,char *));
  1256. _PROTOTYP(int http_head, (char *,char **,char *,char *,char,char *,char *));
  1257. _PROTOTYP(int http_put, (char *,char **,char *,char *,char *,char,char *,
  1258.              char *));
  1259. _PROTOTYP(int http_delete, (char *,char **,char *,char *,char,char *));
  1260. _PROTOTYP(int http_post, (char *,char **,char *,char *,char *,char,char *,
  1261.           char *));
  1262. _PROTOTYP(int http_index, (char *,char **,char *,char *,char,char *,char *));
  1263. #endif /* NOHTTP */
  1264.  
  1265. #endif /* CKCNET_H */
  1266.