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.

98 lines
2.4 KiB

  1. #define net_part(addr) ((addr) & net_mask(addr))
  2. #define MASKA 0x000000FFL
  3. #define MASKB 0x0000FFFFL
  4. #define MASKC 0x00FFFFFFL
  5. #define CLSHFT 5 /* Make C generate hyper-optimized case */
  6. #define CLA0 0 /* It takes the same arg; you mask it off, */
  7. #define CLA1 1 /* shift, and then do a case statment with */
  8. #define CLA2 2 /* some code having more than one label. */
  9. #define CLA3 3 /* Values for class A */
  10. #define CLB0 4
  11. #define CLB1 5 /* B */
  12. #define CLC 6 /* C */
  13. #define CLI 7 /* Illegal */
  14. #define BROADCAST 0x00000000L
  15. #define CASTA 0x00FFFFFFL
  16. #define CASTB 0x0000FFFFL
  17. #define CASTC 0x000000FFL
  18. #define HASH_TABLE_SIZE 64
  19. #define NEW_ENTRY 0x01
  20. #define TIMEOUT_TIMER 0x02
  21. #define GARBAGE_TIMER 0x04
  22. #define ROUTE_CHANGE 0x08
  23. typedef
  24. struct _hash_entry {
  25. struct _hash_entry *prev;
  26. struct _hash_entry *next;
  27. unsigned long dest_addr;
  28. unsigned long next_hop;
  29. unsigned long metric;
  30. unsigned long flag;
  31. unsigned long timeout;
  32. long refcount;
  33. unsigned long protocoltype;
  34. } HASH_TABLE_ENTRY;
  35. typedef
  36. struct {
  37. BYTE command;
  38. BYTE version;
  39. unsigned short resrvd1;
  40. } RIP_HEADER;
  41. typedef
  42. struct {
  43. unsigned short addr_fam;
  44. union {
  45. unsigned short resrvd2;
  46. unsigned short routetag;
  47. };
  48. unsigned long ipaddr;
  49. union {
  50. unsigned long resrvd3;
  51. unsigned long subnetmask;
  52. };
  53. union {
  54. unsigned long resrvd4;
  55. unsigned long nexthop;
  56. };
  57. unsigned long metric;
  58. } RIP_ENTRY;
  59. struct InterfaceEntry {
  60. DWORD ipAdEntAddr; // IP address of this entry
  61. DWORD ipAdEntIfIndex; // IF for this entry
  62. DWORD ipAdEntNetMask; // subnet mask of this entry
  63. };
  64. typedef struct InterfaceEntry InterfaceEntry ;
  65. #define RECVBUFSIZE 576
  66. #define SENDBUFSIZE 576
  67. //
  68. // Debugging functions
  69. //
  70. extern int nLogLevel;
  71. extern int nLogType;
  72. #define DBGCONSOLEBASEDLOG 0x1
  73. #define DBGFILEBASEDLOG 0x2
  74. #define DBGEVENTLOGBASEDLOG 0x4
  75. VOID dbgprintf(
  76. IN INT nLevel,
  77. IN LPSTR szFormat,
  78. IN ...
  79. );