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.

202 lines
5.3 KiB

  1. //============================================================================
  2. // Copyright (c) 1995, Microsoft Corporation
  3. //
  4. // File: if.h
  5. //
  6. // History:
  7. // V Raman July-11-1997 Created.
  8. //
  9. // Declarations for routines that manipulate interface entries
  10. //============================================================================
  11. #ifndef _IF_H_
  12. #define _IF_H_
  13. #include <mgm.h>
  14. //----------------------------------------------------------------------------
  15. // IF_ENTRY
  16. //
  17. // For each interface owned by a routing protocol an interface entry
  18. // is created in the interface table.
  19. //
  20. // dwIfIndex - Interface index
  21. //
  22. // dwNextHopAddr - Next hop IP address, used to distinguish
  23. // dial-in interfaces that are all connected
  24. // on the same RAS Server Interface.
  25. //
  26. // dwOwningProtocol - Protocol id of routing protocol that
  27. // owns this interface.
  28. //
  29. // dwOwningComponent - Component of protocol.
  30. //
  31. // wAddedByFlag - Flag indicating if the interface entry was
  32. // added by the routing protocol / IGMP / both.
  33. //
  34. // leOutIfList - list of (source, group) entries that reference
  35. // this interface in their outgoing interface list
  36. //
  37. // leInIfList - list of (source, group) entries that reference
  38. // this interface as their incoming interface
  39. //----------------------------------------------------------------------------
  40. typedef struct _IF_ENTRY
  41. {
  42. LIST_ENTRY leIfHashList;
  43. DWORD dwIfIndex;
  44. DWORD dwIfNextHopAddr;
  45. DWORD dwOwningProtocol;
  46. DWORD dwOwningComponent;
  47. WORD wAddedByFlag;
  48. LIST_ENTRY leOutIfList;
  49. LIST_ENTRY leInIfList;
  50. } IF_ENTRY, *PIF_ENTRY;
  51. //----------------------------------------------------------------------------
  52. // IF_REFERENCE_ENTRY
  53. //
  54. // Each interface maintains a list of (source, group) entries that refer
  55. // to this interface. Each entry in this reference list stores the
  56. // source, group info and a flag to determine what protocol caused this
  57. // reference. Protocol could be IGMP/some routing protocol or both.
  58. //
  59. // Fields descriptions are left as an exercise to the reader.
  60. //
  61. //----------------------------------------------------------------------------
  62. typedef struct _IF_REFERENCE_ENTRY
  63. {
  64. LIST_ENTRY leRefList;
  65. DWORD dwGroupAddr;
  66. DWORD dwGroupMask;
  67. DWORD dwSourceAddr;
  68. DWORD dwSourceMask;
  69. WORD wAddedByFlag;
  70. } IF_REFERENCE_ENTRY, *PIF_REFERENCE_ENTRY;
  71. DWORD
  72. CreateIfEntry(
  73. PLIST_ENTRY pleIfList,
  74. DWORD dwIfIndex,
  75. DWORD dwIfNextHopAddr,
  76. DWORD dwProtocolId,
  77. DWORD dwComponentId
  78. );
  79. VOID
  80. DeleteIfEntry(
  81. PIF_ENTRY pieEntry
  82. );
  83. PIF_ENTRY
  84. GetIfEntry(
  85. PLIST_ENTRY pleIfList,
  86. DWORD dwIfIndex,
  87. DWORD dwIfNextHopAddr
  88. );
  89. BOOL
  90. FindIfEntry(
  91. PLIST_ENTRY pleIfList,
  92. DWORD dwIfIndex,
  93. DWORD dwIfNextHopAddr,
  94. PIF_ENTRY * ppie
  95. );
  96. DWORD
  97. AddSourceToOutList(
  98. PLIST_ENTRY pleIfList,
  99. DWORD dwSourceAddr,
  100. DWORD dwSourceMask,
  101. DWORD dwGroupAddr,
  102. DWORD dwGroupMask,
  103. BOOL bIGMP
  104. );
  105. VOID
  106. AddSourceToRefList(
  107. PLIST_ENTRY pleRefList,
  108. DWORD dwSourceAddr,
  109. DWORD dwSourceMask,
  110. DWORD dwGroupAddr,
  111. DWORD dwGroupMask,
  112. BOOL bIGMP
  113. );
  114. VOID
  115. DeleteSourceFromRefList(
  116. PLIST_ENTRY pleIfRefList,
  117. DWORD dwSourceAddr,
  118. DWORD dwSourceMask,
  119. DWORD dwGroupAddr,
  120. DWORD dwGroupMask,
  121. BOOL bIGMP
  122. );
  123. BOOL
  124. FindRefEntry(
  125. PLIST_ENTRY pleRefList,
  126. DWORD dwSourceAddr,
  127. DWORD dwSourceMask,
  128. DWORD dwGroupAddr,
  129. DWORD dwGroupMask,
  130. PIF_REFERENCE_ENTRY * ppire
  131. );
  132. VOID
  133. DeleteOutInterfaceRefs(
  134. PPROTOCOL_ENTRY ppe,
  135. PIF_ENTRY pie,
  136. BOOL bIGMP
  137. );
  138. VOID
  139. DeleteInInterfaceRefs(
  140. PLIST_ENTRY pleRefList
  141. );
  142. DWORD
  143. TransferInterfaceOwnershipToIGMP(
  144. PPROTOCOL_ENTRY ppe,
  145. PIF_ENTRY pie
  146. );
  147. DWORD
  148. TransferInterfaceOwnershipToProtocol(
  149. PPROTOCOL_ENTRY ppe,
  150. PIF_ENTRY pie
  151. );
  152. #endif // _IF_H_