Source code of Windows XP (NT5)
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.

201 lines
4.9 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. aarp.h
  5. Abstract:
  6. This module contains information for the Appletalk Address Resolution Protocol.
  7. Author:
  8. Jameel Hyder (jameelh@microsoft.com)
  9. Nikhil Kamkolkar (nikhilk@microsoft.com)
  10. Revision History:
  11. 19 Jun 1992 Initial Version
  12. Notes: Tab stop: 4
  13. --*/
  14. #ifndef _AARP_
  15. #define _AARP_
  16. #define AARP_MAX_HW_ADDR_LEN (MAX_HW_ADDR_LEN)
  17. #define AARP_MIN_HW_ADDR_LEN 1
  18. #define AARP_PROTO_ADDR_LEN 4
  19. // AARP offsets (skipping Link/Hardware headers):
  20. #define AARP_HW_TYPE_OFFSET 0
  21. #define AARP_PROTO_TYPE_OFFSET 2
  22. #define AARP_HW_LEN_OFFSET 4
  23. #define AARP_PROTO_LEN_OFFSET 5
  24. #define AARP_COMMAND_OFFSET 6
  25. #define AARP_SRC_ADDR_OFFSET 8
  26. // AARP Command types:
  27. #define AARP_REQUEST 1
  28. #define AARP_RESPONSE 2
  29. #define AARP_PROBE 3
  30. // Supposed to be (for AppleTalk phase II) 10 * 1/5 seconds... but we'll be
  31. // a little more patient.
  32. #define AARP_PROBETIMER 20 // In 100ths of a second
  33. #define AARP_PROBE_TIMER_MS 200 // In milliseconds
  34. #define AARP_NUM_PROBES 15
  35. #define AARP_OFFCABLE_MASK 0x0F
  36. VOID
  37. AtalkAarpPacketIn(
  38. IN OUT PPORT_DESCRIPTOR pPortDesc,
  39. IN PBYTE pLinkHdr,
  40. IN PBYTE pPkt, // Only Aarp data
  41. IN USHORT Length);
  42. VOID
  43. AtalkAarpSendComplete(
  44. NDIS_STATUS Status,
  45. PBUFFER_DESC pBufDesc,
  46. struct _SEND_COMPL_INFO * pSendInfo);
  47. BOOLEAN
  48. AtalkAarpGleanInfo(
  49. IN OUT PPORT_DESCRIPTOR pPortDesc,
  50. IN PBYTE SrcAddr,
  51. IN SHORT AddrLen,
  52. IN OUT PBYTE RouteInfo,
  53. IN USHORT RouteInfoLen,
  54. IN PBYTE Pkt,
  55. IN USHORT Length);
  56. VOID
  57. AtalkAarpOptGleanInfo(
  58. IN OUT PPORT_DESCRIPTOR pPortDesc,
  59. IN PBYTE pLinkHdr,
  60. IN PATALK_ADDR pSrcAddr,
  61. IN PATALK_ADDR pDestAddr,
  62. IN BOOLEAN OffCablePkt);
  63. ATALK_ERROR
  64. AtalkInitAarpForNodeOnPort(
  65. IN PPORT_DESCRIPTOR pPortDesc,
  66. IN BOOLEAN AllowStartupRange,
  67. IN ATALK_NODEADDR DesiredNode,
  68. IN OUT struct _ATALK_NODE ** ppAtalkNode);
  69. BOOLEAN
  70. AtalkInitAarpForNodeInRange(
  71. IN PPORT_DESCRIPTOR pPortDesc,
  72. IN PVOID pRasConn,
  73. IN BOOLEAN fThisIsPPP,
  74. IN ATALK_NETWORKRANGE NetworkRange,
  75. OUT PATALK_NODEADDR Node);
  76. VOID
  77. AtalkAarpReleaseAmt(
  78. IN OUT PPORT_DESCRIPTOR pPortDesc);
  79. VOID
  80. AtalkAarpReleaseBrc(
  81. IN OUT PPORT_DESCRIPTOR pPortDesc);
  82. PBUFFER_DESC
  83. AtalkAarpBuildPacket(
  84. IN PPORT_DESCRIPTOR pPortDesc,
  85. IN USHORT Type,
  86. IN USHORT HardwareLen,
  87. IN PBYTE SrcHardwareAddr,
  88. IN ATALK_NODEADDR SrcLogicalAddr,
  89. IN PBYTE DestHardwareAddr,
  90. IN ATALK_NODEADDR DestLogicalAddr,
  91. IN PBYTE TrueDest,
  92. IN PBYTE RouteInfo,
  93. IN USHORT RouteInfoLen);
  94. #define BUILD_AARPPROBE(pPortDesc,hardwareLength,Node) \
  95. AtalkAarpBuildPacket( \
  96. pPortDesc, \
  97. AARP_PROBE, \
  98. hardwareLength, \
  99. pPortDesc->pd_PortAddr, \
  100. Node, \
  101. NULL, \
  102. Node, \
  103. NULL, \
  104. NULL, \
  105. 0);
  106. #define BUILD_AARPRESPONSE(pPortDesc,hardwareLength,hardwareAddress, \
  107. RoutingInfo,RoutingInfoLength,SourceNode, \
  108. destinationNode) \
  109. \
  110. AtalkAarpBuildPacket( \
  111. pPortDesc, \
  112. AARP_RESPONSE, \
  113. hardwareLength, \
  114. pPortDesc->pd_PortAddr, \
  115. SourceNode, \
  116. hardwareAddress, \
  117. destinationNode, \
  118. hardwareAddress, \
  119. RoutingInfo, \
  120. RoutingInfoLength);
  121. #define BUILD_AARPREQUEST(pPortDesc,hardwareLength,SourceNode, \
  122. destinationNode ) \
  123. AtalkAarpBuildPacket( \
  124. pPortDesc, \
  125. AARP_REQUEST, \
  126. hardwareLength, \
  127. pPortDesc->pd_PortAddr, \
  128. SourceNode, \
  129. NULL, \
  130. destinationNode, \
  131. NULL, \
  132. NULL, \
  133. 0);
  134. LONG FASTCALL
  135. AtalkAarpAmtTimer(
  136. IN PTIMERLIST pTimer,
  137. IN BOOLEAN TimerShuttingDown);
  138. LONG FASTCALL
  139. AtalkAarpBrcTimer(
  140. IN PTIMERLIST pTimer,
  141. IN BOOLEAN TimerShuttingDown);
  142. LOCAL VOID
  143. atalkAarpEnterIntoAmt(
  144. IN PPORT_DESCRIPTOR pPortDesc,
  145. IN PATALK_NODEADDR pSrcNode,
  146. IN PBYTE SrcAddr,
  147. IN SHORT AddrLen,
  148. IN PBYTE RouteInfo,
  149. IN SHORT RouteInfoLen);
  150. LOCAL BOOLEAN
  151. atalkInitAarpForNode(
  152. IN PPORT_DESCRIPTOR pPortDesc,
  153. IN PVOID pRasConn,
  154. IN BOOLEAN fThisIsPPP,
  155. IN USHORT Network,
  156. IN BYTE Node);
  157. LOCAL VOID FASTCALL
  158. atalkAarpTuneRouteInfo(
  159. IN PPORT_DESCRIPTOR pPortDesc,
  160. IN OUT PBYTE RouteInfo);
  161. #define GET_RANDOM(min, max) (((long)AtalkRandomNumber() % \
  162. (long)(((max+1) - (min))) + (min)))
  163. #endif // _AARP_
  164.