Dhcp6Io.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /** @file
  2. Dhcp6 internal functions declaration.
  3. Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_DHCP6_IO_H__
  7. #define __EFI_DHCP6_IO_H__
  8. /**
  9. Clean up the specific nodes in the retry list.
  10. @param[in] Instance The pointer to the Dhcp6 instance.
  11. @param[in] Scope The scope of cleanup nodes.
  12. **/
  13. VOID
  14. Dhcp6CleanupRetry (
  15. IN DHCP6_INSTANCE *Instance,
  16. IN UINT32 Scope
  17. );
  18. /**
  19. Clean up the session of the instance stateful exchange.
  20. @param[in, out] Instance The pointer to the Dhcp6 instance.
  21. @param[in] Status The return status from udp.
  22. **/
  23. VOID
  24. Dhcp6CleanupSession (
  25. IN OUT DHCP6_INSTANCE *Instance,
  26. IN EFI_STATUS Status
  27. );
  28. /**
  29. Create the solicit message and send it.
  30. @param[in] Instance The pointer to Dhcp6 instance.
  31. @retval EFI_SUCCESS Create and send the solicit message successfully.
  32. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  33. @retval Others Failed to send the solicit message.
  34. **/
  35. EFI_STATUS
  36. Dhcp6SendSolicitMsg (
  37. IN DHCP6_INSTANCE *Instance
  38. );
  39. /**
  40. Create the request message and send it.
  41. @param[in] Instance The pointer to the Dhcp6 instance.
  42. @retval EFI_SUCCESS Create and send the request message successfully.
  43. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  44. @retval EFI_DEVICE_ERROR An unexpected error.
  45. @retval Others Failed to send the request message.
  46. **/
  47. EFI_STATUS
  48. Dhcp6SendRequestMsg (
  49. IN DHCP6_INSTANCE *Instance
  50. );
  51. /**
  52. Create the renew/rebind message and send it.
  53. @param[in] Instance The pointer to the Dhcp6 instance.
  54. @param[in] RebindRequest If TRUE, it is a Rebind type message.
  55. Otherwise, it is a Renew type message.
  56. @retval EFI_SUCCESS Create and send the renew/rebind message successfully.
  57. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  58. @retval EFI_DEVICE_ERROR An unexpected error.
  59. @retval Others Failed to send the renew/rebind message.
  60. **/
  61. EFI_STATUS
  62. Dhcp6SendRenewRebindMsg (
  63. IN DHCP6_INSTANCE *Instance,
  64. IN BOOLEAN RebindRequest
  65. );
  66. /**
  67. Create the decline message and send it.
  68. @param[in] Instance The pointer to the Dhcp6 instance.
  69. @param[in] DecIa The pointer to the decline Ia.
  70. @retval EFI_SUCCESS Create and send the decline message successfully.
  71. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  72. @retval EFI_DEVICE_ERROR An unexpected error.
  73. @retval Others Failed to send the decline message.
  74. **/
  75. EFI_STATUS
  76. Dhcp6SendDeclineMsg (
  77. IN DHCP6_INSTANCE *Instance,
  78. IN EFI_DHCP6_IA *DecIa
  79. );
  80. /**
  81. Create the release message and send it.
  82. @param[in] Instance The pointer to the Dhcp6 instance.
  83. @param[in] RelIa The pointer to the release Ia.
  84. @retval EFI_SUCCESS Create and send the release message successfully.
  85. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  86. @retval EFI_DEVICE_ERROR An unexpected error.
  87. @retval Others Failed to send the release message.
  88. **/
  89. EFI_STATUS
  90. Dhcp6SendReleaseMsg (
  91. IN DHCP6_INSTANCE *Instance,
  92. IN EFI_DHCP6_IA *RelIa
  93. );
  94. /**
  95. Start the information request process.
  96. @param[in] Instance The pointer to the Dhcp6 instance.
  97. @param[in] SendClientId If TRUE, the client identifier option will be included in
  98. information request message. Otherwise, the client identifier
  99. option will not be included.
  100. @param[in] OptionRequest The pointer to the option request option.
  101. @param[in] OptionCount The number options in the OptionList.
  102. @param[in] OptionList The array pointers to the appended options.
  103. @param[in] Retransmission The pointer to the retransmission control.
  104. @param[in] TimeoutEvent The event of timeout.
  105. @param[in] ReplyCallback The callback function when the reply was received.
  106. @param[in] CallbackContext The pointer to the parameter passed to the callback.
  107. @retval EFI_SUCCESS Start the info-request process successfully.
  108. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  109. @retval EFI_NO_MAPPING No source address is available for use.
  110. @retval Others Failed to start the info-request process.
  111. **/
  112. EFI_STATUS
  113. Dhcp6StartInfoRequest (
  114. IN DHCP6_INSTANCE *Instance,
  115. IN BOOLEAN SendClientId,
  116. IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
  117. IN UINT32 OptionCount,
  118. IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,
  119. IN EFI_DHCP6_RETRANSMISSION *Retransmission,
  120. IN EFI_EVENT TimeoutEvent OPTIONAL,
  121. IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,
  122. IN VOID *CallbackContext OPTIONAL
  123. );
  124. /**
  125. Create the information request message and send it.
  126. @param[in] Instance The pointer to the Dhcp6 instance.
  127. @param[in] InfCb The pointer to the information request control block.
  128. @param[in] SendClientId If TRUE, the client identifier option will be included in
  129. information request message. Otherwise, the client identifier
  130. option will not be included.
  131. @param[in] OptionRequest The pointer to the option request option.
  132. @param[in] OptionCount The number options in the OptionList.
  133. @param[in] OptionList The array pointers to the appended options.
  134. @param[in] Retransmission The pointer to the retransmission control.
  135. @retval EFI_SUCCESS Create and send the info-request message successfully.
  136. @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
  137. @retval Others Failed to send the info-request message.
  138. **/
  139. EFI_STATUS
  140. Dhcp6SendInfoRequestMsg (
  141. IN DHCP6_INSTANCE *Instance,
  142. IN DHCP6_INF_CB *InfCb,
  143. IN BOOLEAN SendClientId,
  144. IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
  145. IN UINT32 OptionCount,
  146. IN EFI_DHCP6_PACKET_OPTION *OptionList[],
  147. IN EFI_DHCP6_RETRANSMISSION *Retransmission
  148. );
  149. /**
  150. The receive callback function for the Dhcp6 exchange process.
  151. @param[in] Udp6Wrap The pointer to the received net buffer.
  152. @param[in] EndPoint The pointer to the udp end point.
  153. @param[in] IoStatus The return status from udp io.
  154. @param[in] Context The opaque parameter to the function.
  155. **/
  156. VOID
  157. EFIAPI
  158. Dhcp6ReceivePacket (
  159. IN NET_BUF *Udp6Wrap,
  160. IN UDP_END_POINT *EndPoint,
  161. IN EFI_STATUS IoStatus,
  162. IN VOID *Context
  163. );
  164. /**
  165. The timer routine of the Dhcp6 instance for each second.
  166. @param[in] Event The timer event.
  167. @param[in] Context The opaque parameter to the function.
  168. **/
  169. VOID
  170. EFIAPI
  171. Dhcp6OnTimerTick (
  172. IN EFI_EVENT Event,
  173. IN VOID *Context
  174. );
  175. #endif