home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / tcpipsrc / h / if / MBUF < prev    next >
Text File  |  1994-02-25  |  1KB  |  33 lines

  1. /* Basic message buffer structure */
  2. struct mbuf {
  3.         struct mbuf *next;      /* Links mbufs belonging to single packets */
  4.         struct mbuf *anext;     /* Links packets on queues */
  5.         int size;               /* Size of associated data buffer */
  6.         char *data;             /* Active working pointers */
  7.         int cnt;
  8. };
  9. #define NULLBUF (struct mbuf *)0
  10. #define NULLBUFP (struct mbuf **)0
  11.  
  12. struct mbuf *alloc_mbuf(int);
  13. struct mbuf *free_mbuf(struct mbuf *);
  14. struct mbuf *free_p(struct mbuf *);
  15. void   free_q(struct mbuf **);
  16. int    len_mbuf(struct mbuf *);
  17. int    len_q(struct mbuf *);
  18. void   trim_mbuf(struct mbuf **, int);
  19. int    dup_p(struct mbuf **, struct mbuf *, int, int);
  20. struct mbuf *copy_p(struct mbuf *, int);
  21. int    pullone(struct mbuf **, char *);
  22. int    pullup(struct mbuf **, char *, int);
  23. void   append(struct mbuf **, struct mbuf *);
  24. struct mbuf *pushdown(struct mbuf *, int);
  25. void   enqueue(struct mbuf **, struct mbuf *);
  26. struct mbuf *dequeue(struct mbuf **);
  27. struct mbuf *qdata(char *, int);
  28. int    dqdata(struct mbuf *, char *, unsigned int);
  29. int32  pull32(struct mbuf **);
  30. int    pull16(struct mbuf **);
  31. char   pullchar(struct mbuf **);
  32.  
  33.