home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / SLIP.H < prev    next >
C/C++ Source or Header  |  1991-08-21  |  2KB  |  55 lines

  1. #ifndef    _SLIP_H
  2. #define    _SLIP_H
  3.  
  4. #ifndef    _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. #ifndef _IFACE_H
  9. #include "iface.h"
  10. #endif
  11.  
  12. #ifndef _SLHC_H
  13. #include "slhc.h"
  14. #endif
  15.  
  16. #define SLIP_MAX 5        /* Maximum number of slip channels */
  17.  
  18. /* SLIP definitions */
  19. #define    SLIP_ALLOC    100    /* Receiver allocation increment */
  20.  
  21. #define    FR_END        0300    /* Frame End */
  22. #define    FR_ESC        0333    /* Frame Escape */
  23. #define    T_FR_END    0334    /* Transposed frame end */
  24. #define    T_FR_ESC    0335    /* Transposed frame escape */
  25.  
  26. /* Slip protocol control structure */
  27. struct slip {
  28.     struct iface *iface;
  29.     char escaped;        /* Receiver State control flag */
  30. #define SLIP_FLAG    0x01        /* Last char was a frame escape */
  31. #define SLIP_VJCOMPR    0x02        /* TCP header compression enabled */
  32.     struct mbuf *rbp_head;    /* Head of mbuf chain being filled */
  33.     struct mbuf *rbp_tail;    /* Pointer to mbuf currently being written */
  34.     char *rcp;        /* Write pointer */
  35.     int16 rcnt;        /* Length of mbuf chain */
  36.     struct mbuf *tbp;    /* Transmit mbuf being sent */
  37.     int16 errors;        /* Receiver input errors */
  38.     int type;        /* Protocol of input */
  39.     int (*send) __ARGS((int,struct mbuf *));    /* send mbufs to device */
  40.     int (*get) __ARGS((int));    /* fetch input chars from device */
  41.     struct slcompress *slcomp;    /* TCP header compression table */
  42. };
  43.  
  44. /* In slip.c: */
  45. extern struct slip Slip[];
  46.  
  47. void asy_rx __ARGS((int xdev,void *p1,void *p2));
  48. void asytxdone __ARGS((int dev));
  49. int slip_raw __ARGS((struct iface *iface,struct mbuf *data));
  50. int slip_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,int prec,
  51.     int del,int tput,int rel));
  52. void slip_status __ARGS((struct iface *iface));
  53.  
  54. #endif    /* _SLIP_H */
  55.