home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / netlite / NET / h / TELNET < prev    next >
Text File  |  1993-04-01  |  1KB  |  49 lines

  1. #define LINESIZE        256     /* Length of local editing buffer */
  2.  
  3.  
  4. /* Telnet command characters */
  5. #define IAC             255     /* Interpret as command */
  6. #define WILL            251
  7. #define WONT            252
  8. #define DO              253
  9. #define DONT            254
  10.  
  11. /* Telnet options */
  12. #define TN_TRANSMIT_BINARY      0
  13. #define TN_ECHO                 1
  14. #define TN_SUPPRESS_GA          3
  15. #define TN_STATUS               5
  16. #define TN_TIMING_MARK          6
  17. #define NOPTIONS                6
  18.  
  19. /* Telnet protocol control block */
  20. struct telnet {
  21.         struct tcb *tcb;
  22.         char state;
  23.  
  24. #define TS_DATA 0       /* Normal data state */
  25. #define TS_IAC  1       /* Received IAC */
  26. #define TS_WILL 2       /* Received IAC-WILL */
  27. #define TS_WONT 3       /* Received IAC-WONT */
  28. #define TS_DO   4       /* Received IAC-DO */
  29. #define TS_DONT 5       /* Received IAC-DONT */
  30.  
  31.         char local[NOPTIONS];   /* Local option settings */
  32.         char remote[NOPTIONS];  /* Remote option settings */
  33.  
  34.         struct session *session;        /* Pointer to session structure */
  35. };
  36. #define NULLTN  (struct telnet *)0
  37.  
  38. extern int refuse_echo;
  39.  
  40. /* In TELNET */
  41. void start_telnet(void);
  42. void unix_send_tel(struct session *, char *, int16);
  43. void send_tel(struct session *, char *, int16);
  44. void tel_input(struct telnet *, struct mbuf *);
  45. void rcv_char(struct tcb *, int16);
  46. void tn_tx(struct tcb *, int16);
  47. void t_state(struct tcb *, char, char);
  48.  
  49.