home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / tcpipsrc / h / if / NETUSER < prev    next >
Text File  |  1993-12-27  |  2KB  |  48 lines

  1. /* Global structures and constants needed by an Internet user process */
  2.  
  3. #define NCONN   20              /* Maximum number of open network connections */
  4.  
  5. extern int32 ip_addr;   /* Our IP address */
  6.  
  7. extern int net_error;   /* Error return code */
  8. #define NONE    0               /* No error */
  9. #define CON_EXISTS      1       /* Connection already exists */
  10. #define NO_CONN 2               /* Connection does not exist */
  11. #define CON_CLOS        3       /* Connection closing */
  12. #define NO_SPACE        4       /* No memory for TCB creation */
  13. #define WOULDBLK        5       /* Would block */
  14. #define NOPROTO         6       /* Protocol or mode not supported */
  15. #define INVALID         7       /* Invalid arguments */
  16.  
  17. /* Codes for the tcp_open call */
  18. #define TCP_PASSIVE     0
  19. #define TCP_ACTIVE      1
  20. #define TCP_SERVER      2       /* Passive, clone on opening */
  21.  
  22. /* Socket structure */
  23. struct socket {
  24.         int32 address;          /* IP address */
  25.         int16 port;                     /* port number */
  26. };
  27.  
  28. /* Connection structure (two sockets) */
  29. struct connection {
  30.         struct socket local;
  31.         struct socket remote;
  32. };
  33. #define NULLSOCK        (struct socket *)0
  34.  
  35. /* TCP port numbers */
  36. #define ECHO_PORT       7       /* Echo data port */
  37. #define DISCARD_PORT    9       /* Discard data port */
  38. #define FTPD_PORT       20      /* FTP Data port */
  39. #define FTP_PORT        21      /* FTP Control port */
  40. #define TELNET_PORT     23      /* Telnet port */
  41. #define SMTP_PORT       25      /* Mail port */
  42. #define FINGER_PORT     79      /* TCP port for `who' (finger) service */
  43.  
  44. int32 aton(char *);
  45. char *inet_ntoa(int32);
  46. char *psocket(struct socket *);
  47. long htol(char *);
  48.