Ip6Output.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /** @file
  2. The internal functions and routines to transmit the IP6 packet.
  3. Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_IP6_OUTPUT_H__
  7. #define __EFI_IP6_OUTPUT_H__
  8. extern UINT32 mIp6Id;
  9. /**
  10. Output all the available source addresses to the list entry head SourceList. The
  11. number of source addresses are also returned.
  12. @param[in] IpSb Points to a IP6 service binding instance.
  13. @param[in] Destination The IPv6 destination address.
  14. @param[out] Source The selected IPv6 source address according to
  15. the Destination.
  16. @retval EFI_SUCCESS The source addresses were copied to the list entry
  17. head SourceList.
  18. @retval EFI_NO_MAPPING The IPv6 stack is not auto configured.
  19. **/
  20. EFI_STATUS
  21. Ip6SelectSourceAddress (
  22. IN IP6_SERVICE *IpSb,
  23. IN EFI_IPv6_ADDRESS *Destination,
  24. OUT EFI_IPv6_ADDRESS *Source
  25. );
  26. /**
  27. The default callback function for system generated packet.
  28. It will free the packet.
  29. @param[in] Packet The packet that transmitted.
  30. @param[in] IoStatus The result of the transmission: succeeded or failed.
  31. @param[in] LinkFlag Not used when transmission. Check IP6_FRAME_CALLBACK
  32. for reference.
  33. @param[in] Context The context provided by us.
  34. **/
  35. VOID
  36. Ip6SysPacketSent (
  37. NET_BUF *Packet,
  38. EFI_STATUS IoStatus,
  39. UINT32 LinkFlag,
  40. VOID *Context
  41. );
  42. /**
  43. Transmit an IP6 packet. The packet comes either from the IP6
  44. child's consumer (IpInstance != NULL) or the IP6 driver itself
  45. (IpInstance == NULL). It will route the packet, fragment it,
  46. then transmit all the fragments through an interface.
  47. @param[in] IpSb The IP6 service instance to transmit the packet.
  48. @param[in] Interface The IP6 interface to transmit the packet. Ignored
  49. if NULL.
  50. @param[in] IpInstance The IP6 child that issues the transmission. It is
  51. NULL if the packet is from the system.
  52. @param[in] Packet The user data to send, excluding the IP header.
  53. @param[in] Head The caller supplied header. The caller should set
  54. the following header fields: NextHeader, HopLimit,
  55. Src, Dest, FlowLabel, PayloadLength. This function
  56. will fill in the Ver, TrafficClass.
  57. @param[in] ExtHdrs The extension headers to append to the IPv6 basic
  58. header.
  59. @param[in] ExtHdrsLen The length of the extension headers.
  60. @param[in] Callback The callback function to issue when transmission
  61. completed.
  62. @param[in] Context The opaque context for the callback.
  63. @retval EFI_INVALID_PARAMETER Any input parameter or the packet is invalid.
  64. @retval EFI_NO_MAPPING There is no interface to the destination.
  65. @retval EFI_NOT_FOUND There is no route to the destination.
  66. @retval EFI_SUCCESS The packet successfully transmitted.
  67. @retval EFI_OUT_OF_RESOURCES Failed to finish the operation due to lack of
  68. resources.
  69. @retval Others Failed to transmit the packet.
  70. **/
  71. EFI_STATUS
  72. Ip6Output (
  73. IN IP6_SERVICE *IpSb,
  74. IN IP6_INTERFACE *Interface OPTIONAL,
  75. IN IP6_PROTOCOL *IpInstance OPTIONAL,
  76. IN NET_BUF *Packet,
  77. IN EFI_IP6_HEADER *Head,
  78. IN UINT8 *ExtHdrs,
  79. IN UINT32 ExtHdrsLen,
  80. IN IP6_FRAME_CALLBACK Callback,
  81. IN VOID *Context
  82. );
  83. /**
  84. Remove all the frames on the interface that pass the FrameToCancel,
  85. either queued on ARP queues, or that have already been delivered to
  86. MNP and not yet recycled.
  87. @param[in] Interface Interface to remove the frames from.
  88. @param[in] IoStatus The transmit status returned to the frames' callback.
  89. @param[in] FrameToCancel Function to select the frame to cancel; NULL to select all.
  90. @param[in] Context Opaque parameters passed to FrameToCancel. Ignored if
  91. FrameToCancel is NULL.
  92. **/
  93. VOID
  94. Ip6CancelFrames (
  95. IN IP6_INTERFACE *Interface,
  96. IN EFI_STATUS IoStatus,
  97. IN IP6_FRAME_TO_CANCEL FrameToCancel OPTIONAL,
  98. IN VOID *Context OPTIONAL
  99. );
  100. /**
  101. Cancel the Packet and all its fragments.
  102. @param[in] IpIf The interface from which the Packet is sent.
  103. @param[in] Packet The Packet to cancel.
  104. @param[in] IoStatus The status returns to the sender.
  105. **/
  106. VOID
  107. Ip6CancelPacket (
  108. IN IP6_INTERFACE *IpIf,
  109. IN NET_BUF *Packet,
  110. IN EFI_STATUS IoStatus
  111. );
  112. #endif