DnsDriver.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /** @file
  2. The header files of the driver binding and service binding protocol for DnsDxe driver.
  3. Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _DNS_DRIVER_H_
  7. #define _DNS_DRIVER_H_
  8. #include <Protocol/DriverBinding.h>
  9. #include <Protocol/ServiceBinding.h>
  10. ///
  11. /// Dns service block
  12. ///
  13. typedef struct _DNS_DRIVER_DATA DNS_DRIVER_DATA;
  14. ///
  15. /// Dns service block
  16. ///
  17. typedef struct _DNS_SERVICE DNS_SERVICE;
  18. ///
  19. /// Dns instance block
  20. ///
  21. typedef struct _DNS_INSTANCE DNS_INSTANCE;
  22. #define DNS_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'S')
  23. #define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
  24. struct _DNS_DRIVER_DATA {
  25. EFI_EVENT Timer; /// Ticking timer for DNS cache update.
  26. LIST_ENTRY Dns4CacheList;
  27. LIST_ENTRY Dns4ServerList;
  28. LIST_ENTRY Dns6CacheList;
  29. LIST_ENTRY Dns6ServerList;
  30. };
  31. struct _DNS_SERVICE {
  32. UINT32 Signature;
  33. EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
  34. UINT16 Dns4ChildrenNum;
  35. LIST_ENTRY Dns4ChildrenList;
  36. UINT16 Dns6ChildrenNum;
  37. LIST_ENTRY Dns6ChildrenList;
  38. EFI_HANDLE ControllerHandle;
  39. EFI_HANDLE ImageHandle;
  40. EFI_EVENT TimerToGetMap;
  41. EFI_EVENT Timer; /// Ticking timer for packet retransmission.
  42. UINT8 IpVersion;
  43. UDP_IO *ConnectUdp;
  44. };
  45. struct _DNS_INSTANCE {
  46. UINT32 Signature;
  47. LIST_ENTRY Link;
  48. EFI_DNS4_PROTOCOL Dns4;
  49. EFI_DNS6_PROTOCOL Dns6;
  50. INTN State;
  51. BOOLEAN InDestroy;
  52. DNS_SERVICE *Service;
  53. EFI_HANDLE ChildHandle;
  54. EFI_DNS4_CONFIG_DATA Dns4CfgData;
  55. EFI_DNS6_CONFIG_DATA Dns6CfgData;
  56. EFI_IP_ADDRESS SessionDnsServer;
  57. NET_MAP Dns4TxTokens;
  58. NET_MAP Dns6TxTokens;
  59. UDP_IO *UdpIo;
  60. };
  61. typedef struct {
  62. EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
  63. UINTN NumberOfChildren;
  64. EFI_HANDLE *ChildHandleBuffer;
  65. } DNS_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
  66. extern DNS_DRIVER_DATA *mDriverData;
  67. #define DNS_SERVICE_FROM_THIS(a) \
  68. CR (a, DNS_SERVICE, ServiceBinding, DNS_SERVICE_SIGNATURE)
  69. #define DNS_INSTANCE_FROM_THIS_PROTOCOL4(a) \
  70. CR (a, DNS_INSTANCE, Dns4, DNS_INSTANCE_SIGNATURE)
  71. #define DNS_INSTANCE_FROM_THIS_PROTOCOL6(a) \
  72. CR (a, DNS_INSTANCE, Dns6, DNS_INSTANCE_SIGNATURE)
  73. /**
  74. Destroy the DNS instance and recycle the resources.
  75. @param[in] Instance The pointer to the DNS instance.
  76. **/
  77. VOID
  78. DnsDestroyInstance (
  79. IN DNS_INSTANCE *Instance
  80. );
  81. /**
  82. Create the DNS instance and initialize it.
  83. @param[in] Service The pointer to the DNS service.
  84. @param[out] Instance The pointer to the DNS instance.
  85. @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
  86. @retval EFI_SUCCESS The DNS instance is created.
  87. **/
  88. EFI_STATUS
  89. DnsCreateInstance (
  90. IN DNS_SERVICE *Service,
  91. OUT DNS_INSTANCE **Instance
  92. );
  93. /**
  94. Callback function which provided by user to remove one node in NetDestroyLinkList process.
  95. @param[in] Entry The entry to be removed.
  96. @param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
  97. @retval EFI_SUCCESS The entry has been removed successfully.
  98. @retval Others Fail to remove the entry.
  99. **/
  100. EFI_STATUS
  101. EFIAPI
  102. DnsDestroyChildEntryInHandleBuffer (
  103. IN LIST_ENTRY *Entry,
  104. IN VOID *Context
  105. );
  106. /**
  107. Config a NULL UDP that is used to keep the connection between UDP and DNS.
  108. Just leave the Udp child unconfigured. When UDP is unloaded,
  109. DNS will be informed with DriverBinding Stop.
  110. @param UdpIo The UDP_IO to configure
  111. @param Context The opaque parameter to the callback
  112. @retval EFI_SUCCESS It always return EFI_SUCCESS directly.
  113. **/
  114. EFI_STATUS
  115. EFIAPI
  116. DnsConfigNullUdp (
  117. IN UDP_IO *UdpIo,
  118. IN VOID *Context
  119. );
  120. /**
  121. Release all the resource used the DNS service binding instance.
  122. @param DnsSb The Dns service binding instance.
  123. **/
  124. VOID
  125. DnsDestroyService (
  126. IN DNS_SERVICE *DnsSb
  127. );
  128. /**
  129. Create then initialize a Dns service binding instance.
  130. @param Controller The controller to install the DNS service
  131. binding on
  132. @param Image The driver binding image of the DNS driver
  133. @param IpVersion IpVersion for this service
  134. @param Service The variable to receive the created service
  135. binding instance.
  136. @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to create the instance.
  137. @retval EFI_DEVICE_ERROR Failed to create a NULL UDP port to keep
  138. connection with UDP.
  139. @retval EFI_SUCCESS The service instance is created for the
  140. controller.
  141. **/
  142. EFI_STATUS
  143. DnsCreateService (
  144. IN EFI_HANDLE Controller,
  145. IN EFI_HANDLE Image,
  146. IN UINT8 IpVersion,
  147. OUT DNS_SERVICE **Service
  148. );
  149. /**
  150. Unloads an image.
  151. @param ImageHandle Handle that identifies the image to be unloaded.
  152. @retval EFI_SUCCESS The image has been unloaded.
  153. @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
  154. **/
  155. EFI_STATUS
  156. EFIAPI
  157. DnsUnload (
  158. IN EFI_HANDLE ImageHandle
  159. );
  160. /**
  161. This is the declaration of an EFI image entry point. This entry point is
  162. the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
  163. both device drivers and bus drivers.
  164. @param ImageHandle The firmware allocated handle for the UEFI image.
  165. @param SystemTable A pointer to the EFI System Table.
  166. @retval EFI_SUCCESS The operation completed successfully.
  167. @retval Others An unexpected error occurred.
  168. **/
  169. EFI_STATUS
  170. EFIAPI
  171. DnsDriverEntryPoint (
  172. IN EFI_HANDLE ImageHandle,
  173. IN EFI_SYSTEM_TABLE *SystemTable
  174. );
  175. /**
  176. Tests to see if this driver supports a given controller. If a child device is provided,
  177. it further tests to see if this driver supports creating a handle for the specified child device.
  178. This function checks to see if the driver specified by This supports the device specified by
  179. ControllerHandle. Drivers will typically use the device path attached to
  180. ControllerHandle and/or the services from the bus I/O abstraction attached to
  181. ControllerHandle to determine if the driver supports ControllerHandle. This function
  182. may be called many times during platform initialization. In order to reduce boot times, the tests
  183. performed by this function must be very small, and take as little time as possible to execute. This
  184. function must not change the state of any hardware devices, and this function must be aware that the
  185. device specified by ControllerHandle may already be managed by the same driver or a
  186. different driver. This function must match its calls to AllocatePages() with FreePages(),
  187. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  188. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  189. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  190. to guarantee the state of ControllerHandle is not modified by this function.
  191. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  192. @param[in] ControllerHandle The handle of the controller to test. This handle
  193. must support a protocol interface that supplies
  194. an I/O abstraction to the driver.
  195. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  196. parameter is ignored by device drivers, and is optional for bus
  197. drivers. For bus drivers, if this parameter is not NULL, then
  198. the bus driver must determine if the bus controller specified
  199. by ControllerHandle and the child controller specified
  200. by RemainingDevicePath are both supported by this
  201. bus driver.
  202. @retval EFI_SUCCESS The device specified by ControllerHandle and
  203. RemainingDevicePath is supported by the driver specified by This.
  204. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  205. RemainingDevicePath is already being managed by the driver
  206. specified by This.
  207. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  208. RemainingDevicePath is already being managed by a different
  209. driver or an application that requires exclusive access.
  210. Currently not implemented.
  211. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  212. RemainingDevicePath is not supported by the driver specified by This.
  213. **/
  214. EFI_STATUS
  215. EFIAPI
  216. Dns4DriverBindingSupported (
  217. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  218. IN EFI_HANDLE ControllerHandle,
  219. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  220. );
  221. /**
  222. Starts a device controller or a bus controller.
  223. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  224. As a result, much of the error checking on the parameters to Start() has been moved into this
  225. common boot service. It is legal to call Start() from other locations,
  226. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  227. 1. ControllerHandle must be a valid EFI_HANDLE.
  228. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  229. EFI_DEVICE_PATH_PROTOCOL.
  230. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  231. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  232. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  233. @param[in] ControllerHandle The handle of the controller to start. This handle
  234. must support a protocol interface that supplies
  235. an I/O abstraction to the driver.
  236. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  237. parameter is ignored by device drivers, and is optional for bus
  238. drivers. For a bus driver, if this parameter is NULL, then handles
  239. for all the children of Controller are created by this driver.
  240. If this parameter is not NULL and the first Device Path Node is
  241. not the End of Device Path Node, then only the handle for the
  242. child device specified by the first Device Path Node of
  243. RemainingDevicePath is created by this driver.
  244. If the first Device Path Node of RemainingDevicePath is
  245. the End of Device Path Node, no child handle is created by this
  246. driver.
  247. @retval EFI_SUCCESS The device was started.
  248. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  249. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  250. @retval Others The driver failded to start the device.
  251. **/
  252. EFI_STATUS
  253. EFIAPI
  254. Dns4DriverBindingStart (
  255. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  256. IN EFI_HANDLE ControllerHandle,
  257. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  258. );
  259. /**
  260. Stops a device controller or a bus controller.
  261. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  262. As a result, much of the error checking on the parameters to Stop() has been moved
  263. into this common boot service. It is legal to call Stop() from other locations,
  264. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  265. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  266. same driver's Start() function.
  267. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  268. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  269. Start() function, and the Start() function must have called OpenProtocol() on
  270. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  271. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  272. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  273. support a bus specific I/O protocol for the driver
  274. to use to stop the device.
  275. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  276. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  277. if NumberOfChildren is 0.
  278. @retval EFI_SUCCESS The device was stopped.
  279. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  280. **/
  281. EFI_STATUS
  282. EFIAPI
  283. Dns4DriverBindingStop (
  284. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  285. IN EFI_HANDLE ControllerHandle,
  286. IN UINTN NumberOfChildren,
  287. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  288. );
  289. /**
  290. Tests to see if this driver supports a given controller. If a child device is provided,
  291. it further tests to see if this driver supports creating a handle for the specified child device.
  292. This function checks to see if the driver specified by This supports the device specified by
  293. ControllerHandle. Drivers will typically use the device path attached to
  294. ControllerHandle and/or the services from the bus I/O abstraction attached to
  295. ControllerHandle to determine if the driver supports ControllerHandle. This function
  296. may be called many times during platform initialization. In order to reduce boot times, the tests
  297. performed by this function must be very small, and take as little time as possible to execute. This
  298. function must not change the state of any hardware devices, and this function must be aware that the
  299. device specified by ControllerHandle may already be managed by the same driver or a
  300. different driver. This function must match its calls to AllocatePages() with FreePages(),
  301. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  302. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  303. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  304. to guarantee the state of ControllerHandle is not modified by this function.
  305. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  306. @param[in] ControllerHandle The handle of the controller to test. This handle
  307. must support a protocol interface that supplies
  308. an I/O abstraction to the driver.
  309. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  310. parameter is ignored by device drivers, and is optional for bus
  311. drivers. For bus drivers, if this parameter is not NULL, then
  312. the bus driver must determine if the bus controller specified
  313. by ControllerHandle and the child controller specified
  314. by RemainingDevicePath are both supported by this
  315. bus driver.
  316. @retval EFI_SUCCESS The device specified by ControllerHandle and
  317. RemainingDevicePath is supported by the driver specified by This.
  318. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  319. RemainingDevicePath is already being managed by the driver
  320. specified by This.
  321. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  322. RemainingDevicePath is already being managed by a different
  323. driver or an application that requires exclusive access.
  324. Currently not implemented.
  325. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  326. RemainingDevicePath is not supported by the driver specified by This.
  327. **/
  328. EFI_STATUS
  329. EFIAPI
  330. Dns6DriverBindingSupported (
  331. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  332. IN EFI_HANDLE ControllerHandle,
  333. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  334. );
  335. /**
  336. Starts a device controller or a bus controller.
  337. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  338. As a result, much of the error checking on the parameters to Start() has been moved into this
  339. common boot service. It is legal to call Start() from other locations,
  340. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  341. 1. ControllerHandle must be a valid EFI_HANDLE.
  342. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  343. EFI_DEVICE_PATH_PROTOCOL.
  344. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  345. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  346. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  347. @param[in] ControllerHandle The handle of the controller to start. This handle
  348. must support a protocol interface that supplies
  349. an I/O abstraction to the driver.
  350. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  351. parameter is ignored by device drivers, and is optional for bus
  352. drivers. For a bus driver, if this parameter is NULL, then handles
  353. for all the children of Controller are created by this driver.
  354. If this parameter is not NULL and the first Device Path Node is
  355. not the End of Device Path Node, then only the handle for the
  356. child device specified by the first Device Path Node of
  357. RemainingDevicePath is created by this driver.
  358. If the first Device Path Node of RemainingDevicePath is
  359. the End of Device Path Node, no child handle is created by this
  360. driver.
  361. @retval EFI_SUCCESS The device was started.
  362. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  363. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  364. @retval Others The driver failded to start the device.
  365. **/
  366. EFI_STATUS
  367. EFIAPI
  368. Dns6DriverBindingStart (
  369. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  370. IN EFI_HANDLE ControllerHandle,
  371. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  372. );
  373. /**
  374. Stops a device controller or a bus controller.
  375. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  376. As a result, much of the error checking on the parameters to Stop() has been moved
  377. into this common boot service. It is legal to call Stop() from other locations,
  378. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  379. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  380. same driver's Start() function.
  381. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  382. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  383. Start() function, and the Start() function must have called OpenProtocol() on
  384. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  385. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  386. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  387. support a bus specific I/O protocol for the driver
  388. to use to stop the device.
  389. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  390. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  391. if NumberOfChildren is 0.
  392. @retval EFI_SUCCESS The device was stopped.
  393. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  394. **/
  395. EFI_STATUS
  396. EFIAPI
  397. Dns6DriverBindingStop (
  398. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  399. IN EFI_HANDLE ControllerHandle,
  400. IN UINTN NumberOfChildren,
  401. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  402. );
  403. /**
  404. Creates a child handle and installs a protocol.
  405. The CreateChild() function installs a protocol on ChildHandle.
  406. If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
  407. If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
  408. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  409. @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
  410. then a new handle is created. If it is a pointer to an existing UEFI handle,
  411. then the protocol is added to the existing UEFI handle.
  412. @retval EFI_SUCCES The protocol was added to ChildHandle.
  413. @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
  414. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
  415. the child
  416. @retval other The child handle was not created
  417. **/
  418. EFI_STATUS
  419. EFIAPI
  420. Dns4ServiceBindingCreateChild (
  421. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  422. IN EFI_HANDLE *ChildHandle
  423. );
  424. /**
  425. Destroys a child handle with a protocol installed on it.
  426. The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
  427. that was installed by CreateChild() from ChildHandle. If the removed protocol is the
  428. last protocol on ChildHandle, then ChildHandle is destroyed.
  429. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  430. @param[in] ChildHandle Handle of the child to destroy
  431. @retval EFI_SUCCES The protocol was removed from ChildHandle.
  432. @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
  433. @retval EFI_INVALID_PARAMETER Child handle is NULL.
  434. @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
  435. because its services are being used.
  436. @retval other The child handle was not destroyed
  437. **/
  438. EFI_STATUS
  439. EFIAPI
  440. Dns4ServiceBindingDestroyChild (
  441. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  442. IN EFI_HANDLE ChildHandle
  443. );
  444. /**
  445. Creates a child handle and installs a protocol.
  446. The CreateChild() function installs a protocol on ChildHandle.
  447. If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
  448. If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
  449. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  450. @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
  451. then a new handle is created. If it is a pointer to an existing UEFI handle,
  452. then the protocol is added to the existing UEFI handle.
  453. @retval EFI_SUCCES The protocol was added to ChildHandle.
  454. @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
  455. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
  456. the child
  457. @retval other The child handle was not created
  458. **/
  459. EFI_STATUS
  460. EFIAPI
  461. Dns6ServiceBindingCreateChild (
  462. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  463. IN EFI_HANDLE *ChildHandle
  464. );
  465. /**
  466. Destroys a child handle with a protocol installed on it.
  467. The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
  468. that was installed by CreateChild() from ChildHandle. If the removed protocol is the
  469. last protocol on ChildHandle, then ChildHandle is destroyed.
  470. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  471. @param[in] ChildHandle Handle of the child to destroy
  472. @retval EFI_SUCCES The protocol was removed from ChildHandle.
  473. @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
  474. @retval EFI_INVALID_PARAMETER Child handle is NULL.
  475. @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
  476. because its services are being used.
  477. @retval other The child handle was not destroyed
  478. **/
  479. EFI_STATUS
  480. EFIAPI
  481. Dns6ServiceBindingDestroyChild (
  482. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  483. IN EFI_HANDLE ChildHandle
  484. );
  485. #endif