home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / TELNET.H < prev    next >
Text File  |  1990-11-10  |  1KB  |  51 lines

  1. #ifndef    _TELNET_H
  2. #define    _TELNET_H
  3.  
  4. #ifndef _SESSION_H
  5. #include "session.h"
  6. #endif
  7.  
  8. #define    LINESIZE    256    /* Length of local editing buffer */
  9.  
  10. /* Telnet command characters */
  11. #define    IAC        255    /* Interpret as command */
  12. #define    WILL        251
  13. #define    WONT        252
  14. #define    DO        253
  15. #define    DONT        254
  16.  
  17. /* Telnet options */
  18. #define    TN_TRANSMIT_BINARY    0
  19. #define    TN_ECHO            1
  20. #define    TN_SUPPRESS_GA        3
  21. #define    TN_STATUS        5
  22. #define    TN_TIMING_MARK        6
  23. #define    NOPTIONS        6
  24.  
  25. /* Telnet protocol control block */
  26. struct telnet {
  27.     char local[NOPTIONS];    /* Local option settings */
  28.     char remote[NOPTIONS];    /* Remote option settings */
  29.     struct session *session;    /* Pointer to session structure */
  30.     char eolmode;        /* Control translation of enter key */
  31. };
  32. #define    NULLTN    (struct telnet *)0
  33.  
  34. extern int Refuse_echo;
  35. extern int Tn_cr_mode;
  36.  
  37. /* In telnet.c: */
  38. int tel_connect __ARGS((struct session *sp,char *fsocket,int len));
  39. void tel_output __ARGS((int unused,void *p1,void *p2));
  40. void tnrecv __ARGS((struct telnet *tn));
  41. void doopt __ARGS((struct telnet *tn,int opt));
  42. void dontopt __ARGS((struct telnet *tn,int opt));
  43. void willopt __ARGS((struct telnet *tn,int opt));
  44. void wontopt __ARGS((struct telnet *tn,int opt));
  45. void answer __ARGS((struct telnet *tn,int r1,int r2));
  46.  
  47. /* In ttylink.c: */
  48. void ttylhandle __ARGS((int s,void *unused,void *p));
  49.  
  50. #endif    /* _TELNET_H */
  51.