efiudp.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. #ifndef _EFI_UDP_H
  2. #define _EFI_UDP_H
  3. /*++
  4. Copyright (c) 2013 Intel Corporation
  5. --*/
  6. #define EFI_UDP4_SERVICE_BINDING_PROTOCOL \
  7. { 0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6} }
  8. #define EFI_UDP4_PROTOCOL \
  9. { 0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3} }
  10. #define EFI_UDP6_SERVICE_BINDING_PROTOCOL \
  11. { 0x66ed4721, 0x3c98, 0x4d3e, {0x81, 0xe3, 0xd0, 0x3d, 0xd3, 0x9a, 0x72, 0x54} }
  12. #define EFI_UDP6_PROTOCOL \
  13. { 0x4f948815, 0xb4b9, 0x43cb, {0x8a, 0x33, 0x90, 0xe0, 0x60, 0xb3,0x49, 0x55} }
  14. INTERFACE_DECL(_EFI_UDP4);
  15. INTERFACE_DECL(_EFI_UDP6);
  16. typedef struct {
  17. BOOLEAN AcceptBroadcast;
  18. BOOLEAN AcceptPromiscuous;
  19. BOOLEAN AcceptAnyPort;
  20. BOOLEAN AllowDuplicatePort;
  21. UINT8 TypeOfService;
  22. UINT8 TimeToLive;
  23. BOOLEAN DoNotFragment;
  24. UINT32 ReceiveTimeout;
  25. UINT32 TransmitTimeout;
  26. BOOLEAN UseDefaultAddress;
  27. EFI_IPv4_ADDRESS StationAddress;
  28. EFI_IPv4_ADDRESS SubnetMask;
  29. UINT16 StationPort;
  30. EFI_IPv4_ADDRESS RemoteAddress;
  31. UINT16 RemotePort;
  32. } EFI_UDP4_CONFIG_DATA;
  33. typedef
  34. EFI_STATUS
  35. (EFIAPI *EFI_UDP4_GET_MODE_DATA) (
  36. IN struct _EFI_UDP4 *This,
  37. OUT EFI_UDP4_CONFIG_DATA *Udp4ConfigData OPTIONAL,
  38. OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
  39. OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
  40. OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
  41. );
  42. typedef
  43. EFI_STATUS
  44. (EFIAPI *EFI_UDP4_CONFIGURE) (
  45. IN struct _EFI_UDP4 *This,
  46. IN EFI_UDP4_CONFIG_DATA *UdpConfigData OPTIONAL
  47. );
  48. typedef
  49. EFI_STATUS
  50. (EFIAPI *EFI_UDP4_GROUPS) (
  51. IN struct _EFI_UDP4 *This,
  52. IN BOOLEAN JoinFlag,
  53. IN EFI_IPv4_ADDRESS *MulticastAddress OPTIONAL
  54. );
  55. typedef
  56. EFI_STATUS
  57. (EFIAPI *EFI_UDP4_ROUTES) (
  58. IN struct _EFI_UDP4 *This,
  59. IN BOOLEAN DeleteRoute,
  60. IN EFI_IPv4_ADDRESS *SubnetAddress,
  61. IN EFI_IPv4_ADDRESS *SubnetMask,
  62. IN EFI_IPv4_ADDRESS *GatewayAddress
  63. );
  64. #define EFI_NETWORK_UNREACHABLE EFIERR(100)
  65. #define EFI_HOST_UNREACHABLE EFIERR(101)
  66. #define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
  67. #define EFI_PORT_UNREACHABLE EFIERR(103)
  68. typedef struct {
  69. EFI_IPv4_ADDRESS SourceAddress;
  70. UINT16 SourcePort;
  71. EFI_IPv4_ADDRESS DestinationAddress;
  72. UINT16 DestinationPort;
  73. } EFI_UDP4_SESSION_DATA;
  74. typedef struct {
  75. UINT32 FragmentLength;
  76. VOID *FragmentBuffer;
  77. } EFI_UDP4_FRAGMENT_DATA;
  78. typedef struct {
  79. EFI_TIME TimeStamp;
  80. EFI_EVENT RecycleSignal;
  81. EFI_UDP4_SESSION_DATA UdpSession;
  82. UINT32 DataLength;
  83. UINT32 FragmentCount;
  84. EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
  85. } EFI_UDP4_RECEIVE_DATA;
  86. typedef struct {
  87. EFI_UDP4_SESSION_DATA *UdpSessionData;
  88. EFI_IPv4_ADDRESS *GatewayAddress;
  89. UINT32 DataLength;
  90. UINT32 FragmentCount;
  91. EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
  92. } EFI_UDP4_TRANSMIT_DATA;
  93. typedef struct {
  94. EFI_EVENT Event;
  95. EFI_STATUS Status;
  96. union {
  97. EFI_UDP4_RECEIVE_DATA *RxData;
  98. EFI_UDP4_TRANSMIT_DATA *TxData;
  99. } Packet;
  100. } EFI_UDP4_COMPLETION_TOKEN;
  101. typedef
  102. EFI_STATUS
  103. (EFIAPI *EFI_UDP4_TRANSMIT) (
  104. IN struct _EFI_UDP4 *This,
  105. IN EFI_UDP4_COMPLETION_TOKEN *Token
  106. );
  107. typedef
  108. EFI_STATUS
  109. (EFIAPI *EFI_UDP4_RECEIVE) (
  110. IN struct _EFI_UDP4 *This,
  111. IN EFI_UDP4_COMPLETION_TOKEN *Token
  112. );
  113. typedef
  114. EFI_STATUS
  115. (EFIAPI *EFI_UDP4_CANCEL)(
  116. IN struct _EFI_UDP4 *This,
  117. IN EFI_UDP4_COMPLETION_TOKEN *Token OPTIONAL
  118. );
  119. typedef
  120. EFI_STATUS
  121. (EFIAPI *EFI_UDP4_POLL) (
  122. IN struct _EFI_UDP4 *This
  123. );
  124. typedef struct _EFI_UDP4 {
  125. EFI_UDP4_GET_MODE_DATA GetModeData;
  126. EFI_UDP4_CONFIGURE Configure;
  127. EFI_UDP4_GROUPS Groups;
  128. EFI_UDP4_ROUTES Routes;
  129. EFI_UDP4_TRANSMIT Transmit;
  130. EFI_UDP4_RECEIVE Receive;
  131. EFI_UDP4_CANCEL Cancel;
  132. EFI_UDP4_POLL Poll;
  133. } EFI_UDP4;
  134. typedef struct {
  135. BOOLEAN AcceptPromiscuous;
  136. BOOLEAN AcceptAnyPort;
  137. BOOLEAN AllowDuplicatePort;
  138. UINT8 TrafficClass;
  139. UINT8 HopLimit;
  140. UINT32 ReceiveTimeout;
  141. UINT32 TransmitTimeout;
  142. EFI_IPv6_ADDRESS StationAddress;
  143. UINT16 StationPort;
  144. EFI_IPv6_ADDRESS RemoteAddress;
  145. UINT16 RemotePort;
  146. } EFI_UDP6_CONFIG_DATA;
  147. typedef
  148. EFI_STATUS
  149. (EFIAPI *EFI_UDP6_GET_MODE_DATA) (
  150. IN struct _EFI_UDP6 *This,
  151. OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
  152. OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
  153. OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
  154. OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
  155. );
  156. typedef
  157. EFI_STATUS
  158. (EFIAPI *EFI_UDP6_CONFIGURE) (
  159. IN struct _EFI_UDP6 *This,
  160. IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
  161. );
  162. typedef
  163. EFI_STATUS
  164. (EFIAPI *EFI_UDP6_GROUPS) (
  165. IN struct _EFI_UDP6 *This,
  166. IN BOOLEAN JoinFlag,
  167. IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
  168. );
  169. typedef struct {
  170. EFI_IPv6_ADDRESS SourceAddress;
  171. UINT16 SourcePort;
  172. EFI_IPv6_ADDRESS DestinationAddress;
  173. UINT16 DestinationPort;
  174. } EFI_UDP6_SESSION_DATA;
  175. typedef struct {
  176. UINT32 FragmentLength;
  177. VOID *FragmentBuffer;
  178. } EFI_UDP6_FRAGMENT_DATA;
  179. typedef struct {
  180. EFI_TIME TimeStamp;
  181. EFI_EVENT RecycleSignal;
  182. EFI_UDP6_SESSION_DATA UdpSession;
  183. UINT32 DataLength;
  184. UINT32 FragmentCount;
  185. EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
  186. } EFI_UDP6_RECEIVE_DATA;
  187. typedef struct {
  188. EFI_UDP6_SESSION_DATA *UdpSessionData;
  189. UINT32 DataLength;
  190. UINT32 FragmentCount;
  191. EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
  192. } EFI_UDP6_TRANSMIT_DATA;
  193. typedef struct {
  194. EFI_EVENT Event;
  195. EFI_STATUS Status;
  196. union {
  197. EFI_UDP6_RECEIVE_DATA *RxData;
  198. EFI_UDP6_TRANSMIT_DATA *TxData;
  199. } Packet;
  200. } EFI_UDP6_COMPLETION_TOKEN;
  201. typedef
  202. EFI_STATUS
  203. (EFIAPI *EFI_UDP6_TRANSMIT) (
  204. IN struct _EFI_UDP6 *This,
  205. IN EFI_UDP6_COMPLETION_TOKEN *Token
  206. );
  207. typedef
  208. EFI_STATUS
  209. (EFIAPI *EFI_UDP6_RECEIVE) (
  210. IN struct _EFI_UDP6 *This,
  211. IN EFI_UDP6_COMPLETION_TOKEN *Token
  212. );
  213. typedef
  214. EFI_STATUS
  215. (EFIAPI *EFI_UDP6_CANCEL)(
  216. IN struct _EFI_UDP6 *This,
  217. IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
  218. );
  219. typedef
  220. EFI_STATUS
  221. (EFIAPI *EFI_UDP6_POLL) (
  222. IN struct _EFI_UDP6 *This
  223. );
  224. typedef struct _EFI_UDP6 {
  225. EFI_UDP6_GET_MODE_DATA GetModeData;
  226. EFI_UDP6_CONFIGURE Configure;
  227. EFI_UDP6_GROUPS Groups;
  228. EFI_UDP6_TRANSMIT Transmit;
  229. EFI_UDP6_RECEIVE Receive;
  230. EFI_UDP6_CANCEL Cancel;
  231. EFI_UDP6_POLL Poll;
  232. } EFI_UDP6;
  233. #endif /* _EFI_UDP_H */