Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.0 KiB

  1. #ifndef H__netpkt
  2. #define H__netpkt
  3. #include "netbasic.h"
  4. /*
  5. N E T P K T
  6. NETPKT is the data structure sent across the variety of network
  7. interfaces.
  8. */
  9. typedef struct {
  10. /* checksum of pkthdr. Set and checked in netintf only. */
  11. DWORD np_cksHeader;
  12. /* magic number of this connection ... unused at this time */
  13. DWORD np_magicNum;
  14. /* offset of this packet in a message. PKTZ level only. */
  15. DWORD np_pktOffsInMsg;
  16. /* size of overall message. PKTZ level only */
  17. DWORD np_msgSize;
  18. /* id of last packet received OK. PKTZ level only. Set when ready
  19. to xmt */
  20. PKTID np_lastPktOK;
  21. /* last packet received. PKTZ level only. Set when ready to xmt */
  22. PKTID np_lastPktRcvd;
  23. /* size of packet excluding header. If 0, this indicates control pkt and
  24. np_type should be NPKT_CONTROL. Only set/checked at pktz level */
  25. WORD np_pktSize;
  26. /* status of np_lastPktRcvd, one of:
  27. PS_NO_INFO
  28. PS_OK
  29. PS_DATA_ERR
  30. PS_MEMORY_ERR
  31. PKTZ level only ... set when ready to xmt
  32. */
  33. BYTE np_lastPktStatus;
  34. /* either VERMETH_CRC16 or VERMETH_CKS32. This represents how the fields
  35. np_cksData and np_cksHeader are calculated. Only played with at
  36. netintf level */
  37. BYTE np_verifyMethod;
  38. /* either NPKT_ROUTER, NPKT_PKTZ or NPKT_CONTROL. Pktz level only */
  39. BYTE np_type;
  40. /* filler for byte-alignment problems */
  41. BYTE np_filler[3];
  42. /* packet ID of this packet. PKTZ level only */
  43. PKTID np_pktID;
  44. /* checksum of data portion of pkt. Only set and/or checked at
  45. netintf level */
  46. DWORD np_cksData;
  47. } NETPKT;
  48. typedef NETPKT FAR *LPNETPKT;
  49. /* packet status */
  50. #define PS_NO_INFO (1)
  51. #define PS_OK (2)
  52. #define PS_DATA_ERR (3)
  53. #define PS_MEMORY_ERR (4)
  54. #define PS_NO_RESPONSE (5)
  55. /* packet type */
  56. #define NPKT_ROUTER (1)
  57. #define NPKT_PKTZ (2)
  58. #define NPKT_CONTROL (3)
  59. #define NPKT_NETIF (4)
  60. #endif