mbuf.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /******************************************************************************
  2. *
  3. * (C)Copyright 1998,1999 SysKonnect,
  4. * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * The information in this file is provided "AS IS" without warranty.
  12. *
  13. ******************************************************************************/
  14. #ifndef _MBUF_
  15. #define _MBUF_
  16. #define M_SIZE 4504
  17. #ifndef MAX_MBUF
  18. #define MAX_MBUF 4
  19. #endif
  20. #ifndef NO_STD_MBUF
  21. #define sm_next m_next
  22. #define sm_off m_off
  23. #define sm_len m_len
  24. #define sm_data m_data
  25. #define SMbuf Mbuf
  26. #define mtod smtod
  27. #define mtodoff smtodoff
  28. #endif
  29. struct s_mbuf {
  30. struct s_mbuf *sm_next ; /* low level linked list */
  31. short sm_off ; /* offset in m_data */
  32. u_int sm_len ; /* len of data */
  33. #ifdef PCI
  34. int sm_use_count ;
  35. #endif
  36. char sm_data[M_SIZE] ;
  37. } ;
  38. typedef struct s_mbuf SMbuf ;
  39. /* mbuf head, to typed data */
  40. #define smtod(x,t) ((t)((x)->sm_data + (x)->sm_off))
  41. #define smtodoff(x,t,o) ((t)((x)->sm_data + (o)))
  42. #endif /* _MBUF_ */