efitcp.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. #ifndef _EFI_TCP_H
  2. #define _EFI_TCP_H
  3. /*++
  4. Copyright (c) 2013 Intel Corporation
  5. --*/
  6. #define EFI_TCP4_SERVICE_BINDING_PROTOCOL \
  7. { 0x00720665, 0x67eb, 0x4a99, {0xba, 0xf7, 0xd3, 0xc3, 0x3a, 0x1c,0x7c, 0xc9}}
  8. #define EFI_TCP4_PROTOCOL \
  9. { 0x65530bc7, 0xa359, 0x410f, {0xb0, 0x10, 0x5a, 0xad, 0xc7, 0xec, 0x2b, 0x62}}
  10. #define EFI_TCP6_SERVICE_BINDING_PROTOCOL \
  11. { 0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0xd, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64}}
  12. #define EFI_TCP6_PROTOCOL \
  13. { 0x46e44855, 0xbd60, 0x4ab7, {0xab, 0xd, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77}}
  14. INTERFACE_DECL(_EFI_TCP4);
  15. INTERFACE_DECL(_EFI_TCP6);
  16. typedef struct {
  17. BOOLEAN UseDefaultAddress;
  18. EFI_IPv4_ADDRESS StationAddress;
  19. EFI_IPv4_ADDRESS SubnetMask;
  20. UINT16 StationPort;
  21. EFI_IPv4_ADDRESS RemoteAddress;
  22. UINT16 RemotePort;
  23. BOOLEAN ActiveFlag;
  24. } EFI_TCP4_ACCESS_POINT;
  25. typedef struct {
  26. UINT32 ReceiveBufferSize;
  27. UINT32 SendBufferSize;
  28. UINT32 MaxSynBackLog;
  29. UINT32 ConnectionTimeout;
  30. UINT32 DataRetries;
  31. UINT32 FinTimeout;
  32. UINT32 TimeWaitTimeout;
  33. UINT32 KeepAliveProbes;
  34. UINT32 KeepAliveTime;
  35. UINT32 KeepAliveInterval;
  36. BOOLEAN EnableNagle;
  37. BOOLEAN EnableTimeStamp;
  38. BOOLEAN EnableWindowScaling;
  39. BOOLEAN EnableSelectiveAck;
  40. BOOLEAN EnablePAthMtuDiscovery;
  41. } EFI_TCP4_OPTION;
  42. typedef struct {
  43. // Receiving Filters
  44. // I/O parameters
  45. UINT8 TypeOfService;
  46. UINT8 TimeToLive;
  47. // Access Point
  48. EFI_TCP4_ACCESS_POINT AccessPoint;
  49. // TCP Control Options
  50. EFI_TCP4_OPTION *ControlOption;
  51. } EFI_TCP4_CONFIG_DATA;
  52. typedef enum {
  53. Tcp4StateClosed = 0,
  54. Tcp4StateListen = 1,
  55. Tcp4StateSynSent = 2,
  56. Tcp4StateSynReceived = 3,
  57. Tcp4StateEstablished = 4,
  58. Tcp4StateFinWait1 = 5,
  59. Tcp4StateFinWait2 = 6,
  60. Tcp4StateClosing = 7,
  61. Tcp4StateTimeWait = 8,
  62. Tcp4StateCloseWait = 9,
  63. Tcp4StateLastAck = 10
  64. } EFI_TCP4_CONNECTION_STATE;
  65. typedef
  66. EFI_STATUS
  67. (EFIAPI *EFI_TCP4_GET_MODE_DATA) (
  68. IN struct _EFI_TCP4 *This,
  69. OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,
  70. OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,
  71. OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
  72. OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
  73. OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
  74. );
  75. typedef
  76. EFI_STATUS
  77. (EFIAPI *EFI_TCP4_CONFIGURE) (
  78. IN struct _EFI_TCP4 *This,
  79. IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL
  80. );
  81. typedef
  82. EFI_STATUS
  83. (EFIAPI *EFI_TCP4_ROUTES) (
  84. IN struct _EFI_TCP4 *This,
  85. IN BOOLEAN DeleteRoute,
  86. IN EFI_IPv4_ADDRESS *SubnetAddress,
  87. IN EFI_IPv4_ADDRESS *SubnetMask,
  88. IN EFI_IPv4_ADDRESS *GatewayAddress
  89. );
  90. typedef struct {
  91. EFI_EVENT Event;
  92. EFI_STATUS Status;
  93. } EFI_TCP4_COMPLETION_TOKEN;
  94. typedef struct {
  95. EFI_TCP4_COMPLETION_TOKEN CompletionToken;
  96. } EFI_TCP4_CONNECTION_TOKEN;
  97. typedef
  98. EFI_STATUS
  99. (EFIAPI *EFI_TCP4_CONNECT) (
  100. IN struct _EFI_TCP4 *This,
  101. IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken
  102. );
  103. typedef struct {
  104. EFI_TCP4_COMPLETION_TOKEN CompletionToken;
  105. EFI_HANDLE NewChildHandle;
  106. } EFI_TCP4_LISTEN_TOKEN;
  107. typedef
  108. EFI_STATUS
  109. (EFIAPI *EFI_TCP4_ACCEPT) (
  110. IN struct _EFI_TCP4 *This,
  111. IN EFI_TCP4_LISTEN_TOKEN *ListenToken
  112. );
  113. #define EFI_CONNECTION_FIN EFIERR(104)
  114. #define EFI_CONNECTION_RESET EFIERR(105)
  115. #define EFI_CONNECTION_REFUSED EFIERR(106)
  116. typedef struct {
  117. UINT32 FragmentLength;
  118. VOID *FragmentBuffer;
  119. } EFI_TCP4_FRAGMENT_DATA;
  120. typedef struct {
  121. BOOLEAN UrgentFlag;
  122. UINT32 DataLength;
  123. UINT32 FragmentCount;
  124. EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
  125. } EFI_TCP4_RECEIVE_DATA;
  126. typedef struct {
  127. BOOLEAN Push;
  128. BOOLEAN Urgent;
  129. UINT32 DataLength;
  130. UINT32 FragmentCount;
  131. EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
  132. } EFI_TCP4_TRANSMIT_DATA;
  133. typedef struct {
  134. EFI_TCP4_COMPLETION_TOKEN CompletionToken;
  135. union {
  136. EFI_TCP4_RECEIVE_DATA *RxData;
  137. EFI_TCP4_TRANSMIT_DATA *TxData;
  138. } Packet;
  139. } EFI_TCP4_IO_TOKEN;
  140. typedef
  141. EFI_STATUS
  142. (EFIAPI *EFI_TCP4_TRANSMIT) (
  143. IN struct _EFI_TCP4 *This,
  144. IN EFI_TCP4_IO_TOKEN *Token
  145. );
  146. typedef
  147. EFI_STATUS
  148. (EFIAPI *EFI_TCP4_RECEIVE) (
  149. IN struct _EFI_TCP4 *This,
  150. IN EFI_TCP4_IO_TOKEN *Token
  151. );
  152. typedef struct {
  153. EFI_TCP4_COMPLETION_TOKEN CompletionToken;
  154. BOOLEAN AbortOnClose;
  155. } EFI_TCP4_CLOSE_TOKEN;
  156. typedef
  157. EFI_STATUS
  158. (EFIAPI *EFI_TCP4_CLOSE)(
  159. IN struct _EFI_TCP4 *This,
  160. IN EFI_TCP4_CLOSE_TOKEN *CloseToken
  161. );
  162. typedef
  163. EFI_STATUS
  164. (EFIAPI *EFI_TCP4_CANCEL)(
  165. IN struct _EFI_TCP4 *This,
  166. IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL
  167. );
  168. typedef
  169. EFI_STATUS
  170. (EFIAPI *EFI_TCP4_POLL) (
  171. IN struct _EFI_TCP4 *This
  172. );
  173. typedef struct _EFI_TCP4 {
  174. EFI_TCP4_GET_MODE_DATA GetModeData;
  175. EFI_TCP4_CONFIGURE Configure;
  176. EFI_TCP4_ROUTES Routes;
  177. EFI_TCP4_CONNECT Connect;
  178. EFI_TCP4_ACCEPT Accept;
  179. EFI_TCP4_TRANSMIT Transmit;
  180. EFI_TCP4_RECEIVE Receive;
  181. EFI_TCP4_CLOSE Close;
  182. EFI_TCP4_CANCEL Cancel;
  183. EFI_TCP4_POLL Poll;
  184. } EFI_TCP4;
  185. typedef enum {
  186. Tcp6StateClosed = 0,
  187. Tcp6StateListen = 1,
  188. Tcp6StateSynSent = 2,
  189. Tcp6StateSynReceived = 3,
  190. Tcp6StateEstablished = 4,
  191. Tcp6StateFinWait1 = 5,
  192. Tcp6StateFinWait2 = 6,
  193. Tcp6StateClosing = 7,
  194. Tcp6StateTimeWait = 8,
  195. Tcp6StateCloseWait = 9,
  196. Tcp6StateLastAck = 10
  197. } EFI_TCP6_CONNECTION_STATE;
  198. typedef struct {
  199. EFI_IPv6_ADDRESS StationAddress;
  200. UINT16 StationPort;
  201. EFI_IPv6_ADDRESS RemoteAddress;
  202. UINT16 RemotePort;
  203. BOOLEAN ActiveFlag;
  204. } EFI_TCP6_ACCESS_POINT;
  205. typedef struct {
  206. UINT32 ReceiveBufferSize;
  207. UINT32 SendBufferSize;
  208. UINT32 MaxSynBackLog;
  209. UINT32 ConnectionTimeout;
  210. UINT32 DataRetries;
  211. UINT32 FinTimeout;
  212. UINT32 TimeWaitTimeout;
  213. UINT32 KeepAliveProbes;
  214. UINT32 KeepAliveTime;
  215. UINT32 KeepAliveInterval;
  216. BOOLEAN EnableNagle;
  217. BOOLEAN EnableTimeStamp;
  218. BOOLEAN EnableWindbowScaling;
  219. BOOLEAN EnableSelectiveAck;
  220. BOOLEAN EnablePathMtuDiscovery;
  221. } EFI_TCP6_OPTION;
  222. typedef struct {
  223. UINT8 TrafficClass;
  224. UINT8 HopLimit;
  225. EFI_TCP6_ACCESS_POINT AccessPoint;
  226. EFI_TCP6_OPTION *ControlOption;
  227. } EFI_TCP6_CONFIG_DATA;
  228. typedef
  229. EFI_STATUS
  230. (EFIAPI *EFI_TCP6_GET_MODE_DATA) (
  231. IN struct _EFI_TCP6 *This,
  232. OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL,
  233. OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL,
  234. OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
  235. OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
  236. OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
  237. );
  238. typedef
  239. EFI_STATUS
  240. (EFIAPI *EFI_TCP6_CONFIGURE) (
  241. IN struct _EFI_TCP6 *This,
  242. IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL
  243. );
  244. typedef struct {
  245. EFI_EVENT Event;
  246. EFI_STATUS Status;
  247. } EFI_TCP6_COMPLETION_TOKEN;
  248. typedef struct {
  249. EFI_TCP6_COMPLETION_TOKEN CompletionToken;
  250. } EFI_TCP6_CONNECTION_TOKEN;
  251. typedef
  252. EFI_STATUS
  253. (EFIAPI *EFI_TCP6_CONNECT) (
  254. IN struct _EFI_TCP6 *This,
  255. IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken
  256. );
  257. typedef struct {
  258. EFI_TCP6_COMPLETION_TOKEN CompletionToken;
  259. EFI_HANDLE NewChildHandle;
  260. } EFI_TCP6_LISTEN_TOKEN;
  261. typedef
  262. EFI_STATUS
  263. (EFIAPI *EFI_TCP6_ACCEPT) (
  264. IN struct _EFI_TCP6 *This,
  265. IN EFI_TCP6_LISTEN_TOKEN *ListenToken
  266. );
  267. typedef struct {
  268. UINT32 FragmentLength;
  269. VOID *FragmentBuffer;
  270. } EFI_TCP6_FRAGMENT_DATA;
  271. typedef struct {
  272. BOOLEAN UrgentFlag;
  273. UINT32 DataLength;
  274. UINT32 FragmentCount;
  275. EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
  276. } EFI_TCP6_RECEIVE_DATA;
  277. typedef struct {
  278. BOOLEAN Push;
  279. BOOLEAN Urgent;
  280. UINT32 DataLength;
  281. UINT32 FragmentCount;
  282. EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
  283. } EFI_TCP6_TRANSMIT_DATA;
  284. typedef struct {
  285. EFI_TCP6_COMPLETION_TOKEN CompletionToken;
  286. union {
  287. EFI_TCP6_RECEIVE_DATA *RxData;
  288. EFI_TCP6_TRANSMIT_DATA *TxData;
  289. } Packet;
  290. } EFI_TCP6_IO_TOKEN;
  291. typedef
  292. EFI_STATUS
  293. (EFIAPI *EFI_TCP6_TRANSMIT) (
  294. IN struct _EFI_TCP6 *This,
  295. IN EFI_TCP6_IO_TOKEN *Token
  296. );
  297. typedef
  298. EFI_STATUS
  299. (EFIAPI *EFI_TCP6_RECEIVE) (
  300. IN struct _EFI_TCP6 *This,
  301. IN EFI_TCP6_IO_TOKEN *Token
  302. );
  303. typedef struct {
  304. EFI_TCP6_COMPLETION_TOKEN CompletionToken;
  305. BOOLEAN AbortOnClose;
  306. } EFI_TCP6_CLOSE_TOKEN;
  307. typedef
  308. EFI_STATUS
  309. (EFIAPI *EFI_TCP6_CLOSE)(
  310. IN struct _EFI_TCP6 *This,
  311. IN EFI_TCP6_CLOSE_TOKEN *CloseToken
  312. );
  313. typedef
  314. EFI_STATUS
  315. (EFIAPI *EFI_TCP6_CANCEL)(
  316. IN struct _EFI_TCP6 *This,
  317. IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL
  318. );
  319. typedef
  320. EFI_STATUS
  321. (EFIAPI *EFI_TCP6_POLL) (
  322. IN struct _EFI_TCP6 *This
  323. );
  324. typedef struct _EFI_TCP6 {
  325. EFI_TCP6_GET_MODE_DATA GetModeData;
  326. EFI_TCP6_CONFIGURE Configure;
  327. EFI_TCP6_CONNECT Connect;
  328. EFI_TCP6_ACCEPT Accept;
  329. EFI_TCP6_TRANSMIT Transmit;
  330. EFI_TCP6_RECEIVE Receive;
  331. EFI_TCP6_CLOSE Close;
  332. EFI_TCP6_CANCEL Cancel;
  333. EFI_TCP6_POLL Poll;
  334. } EFI_TCP6;
  335. #endif /* _EFI_TCP_H */