1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Func.h
1 /** @file
2
3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Tcp4Func.h
15
16 Abstract:
17
18
19 **/
20
21 #ifndef _TCP4_FUNC_H_
22 #define _TCP4_FUNC_H_
23
24 //
25 // Declaration of all the functions in TCP
26 // protocol. It is intended to keep tcp.h
27 // clear.
28 //
29
30 //
31 // Functions in tcp.c
32 //
33 BOOLEAN
34 TcpFindTcbByPeer (
35 IN EFI_IPv4_ADDRESS *Addr,
36 IN TCP_PORTNO Port
37 );
38
39 TCP_CB *
40 TcpLocateTcb (
41 IN TCP_PORTNO LocalPort,
42 IN UINT32 LocalIp,
43 IN TCP_PORTNO RemotePort,
44 IN UINT32 RemoteIp,
45 IN BOOLEAN Syn
46 );
47
48 INTN
49 TcpInsertTcb (
50 IN TCP_CB *Tcb
51 );
52
53 TCP_CB *
54 TcpCloneTcb (
55 IN TCP_CB *Tcb
56 );
57
58 TCP_SEQNO
59 TcpGetIss (
60 VOID
61 );
62
63 VOID
64 TcpInitTcbLocal (
65 IN TCP_CB *Tcb
66 );
67
68 VOID
69 TcpInitTcbPeer (
70 IN TCP_CB *Tcb,
71 IN TCP_SEG *Seg,
72 IN TCP_OPTION *Opt
73 );
74
75 UINT16
76 TcpGetRcvMss (
77 IN SOCKET *Sock
78 );
79
80 VOID
81 TcpSetState (
82 IN TCP_CB *Tcb,
83 IN UINT8 State
84 );
85
86 //
87 // Functions in Tcp4Output.c
88 //
89 INTN
90 TcpSendIpPacket (
91 IN TCP_CB *Tcb,
92 IN NET_BUF *Nbuf,
93 IN UINT32 Src,
94 IN UINT32 Dst
95 );
96
97 INTN
98 TcpToSendData (
99 IN TCP_CB *Tcb,
100 IN INTN Force
101 );
102
103 VOID
104 TcpToSendAck (
105 IN TCP_CB *Tcb
106 );
107
108 VOID
109 TcpSendAck (
110 IN TCP_CB *Tcb
111 );
112
113 INTN
114 TcpSendZeroProbe (
115 IN TCP_CB *Tcb
116 );
117
118 INTN
119 TcpDeliverData (
120 IN TCP_CB *Tcb
121 );
122
123 INTN
124 TcpSendReset (
125 IN TCP_CB *Tcb,
126 IN TCP_HEAD *Head,
127 IN INT32 Len,
128 IN UINT32 Local,
129 IN UINT32 Remote
130 );
131
132 UINT32
133 TcpRcvWinOld (
134 IN TCP_CB *Tcb
135 );
136
137 UINT32
138 TcpRcvWinNow (
139 IN TCP_CB *Tcb
140 );
141
142 INTN
143 TcpRetransmit (
144 IN TCP_CB *Tcb,
145 IN TCP_SEQNO Seq
146 );
147
148 UINT32
149 TcpDataToSend (
150 IN TCP_CB *Tcb,
151 IN INTN Force
152 );
153
154 INTN
155 TcpVerifySegment (
156 IN NET_BUF *Nbuf
157 );
158
159 INTN
160 TcpCheckSndQue (
161 IN NET_LIST_ENTRY *Head
162 );
163
164 NET_BUF *
165 TcpGetSegmentSndQue (
166 IN TCP_CB *Tcb,
167 IN TCP_SEQNO Seq,
168 IN UINT32 Len
169 );
170
171 NET_BUF *
172 TcpGetSegmentSock (
173 IN TCP_CB *Tcb,
174 IN TCP_SEQNO Seq,
175 IN UINT32 Len
176 );
177
178 NET_BUF *
179 TcpGetSegment (
180 IN TCP_CB *Tcb,
181 IN TCP_SEQNO Seq,
182 IN UINT32 Len
183 );
184
185 TCP_SEQNO
186 TcpGetMaxSndNxt (
187 IN TCP_CB *Tcb
188 );
189
190 //
191 // Functions from Tcp4Input.c
192 //
193 VOID
194 TcpIcmpInput (
195 IN NET_BUF *Nbuf,
196 IN ICMP_ERROR IcmpErr,
197 IN UINT32 Src,
198 IN UINT32 Dst
199 );
200
201 INTN
202 TcpInput (
203 IN NET_BUF *Nbuf,
204 IN UINT32 Src,
205 IN UINT32 Dst
206 );
207
208 INTN
209 TcpSeqAcceptable (
210 IN TCP_CB *Tcb,
211 IN TCP_SEG *Seg
212 );
213
214 VOID
215 TcpFastRecover (
216 IN TCP_CB *Tcb,
217 IN TCP_SEG *Seg
218 );
219
220 VOID
221 TcpFastLossRecover (
222 IN TCP_CB *Tcb,
223 IN TCP_SEG *Seg
224 );
225
226 VOID
227 TcpComputeRtt (
228 IN TCP_CB *Tcb,
229 IN UINT32 Measure
230 );
231
232 INTN
233 TcpTrimInWnd (
234 IN TCP_CB *Tcb,
235 IN NET_BUF *Buf
236 );
237
238 VOID
239 TcpQueueData (
240 IN TCP_CB *Tcb,
241 IN NET_BUF *Nbuf
242 );
243
244 VOID
245 TcpAdjustSndQue (
246 IN TCP_CB *Tcb,
247 IN TCP_SEQNO Ack
248 );
249
250 //
251 // Functions from Tcp4Misc.c
252 //
253 UINT16
254 TcpChecksum (
255 IN NET_BUF *Buf,
256 IN UINT16 HeadChecksum
257 );
258
259 TCP_SEG *
260 TcpFormatNetbuf (
261 IN TCP_CB *Tcb,
262 IN NET_BUF *Nbuf
263 );
264
265 VOID
266 TcpOnAppConnect (
267 IN TCP_CB *Tcb
268 );
269
270 INTN
271 TcpOnAppConsume (
272 IN TCP_CB *Tcb
273 );
274
275 VOID
276 TcpOnAppClose (
277 IN TCP_CB *Tcb
278 );
279
280 INTN
281 TcpOnAppSend (
282 IN TCP_CB *Tcb
283 );
284
285 VOID
286 TcpOnAppAbort (
287 IN TCP_CB *Tcb
288 );
289
290 VOID
291 TcpResetConnection (
292 IN TCP_CB *Tcb
293 );
294
295 //
296 // Functions in Tcp4Timer.c
297 //
298 VOID
299 TcpClose (
300 IN TCP_CB *Tcb
301 );
302
303 VOID
304 EFIAPI
305 TcpTicking (
306 IN EFI_EVENT Event,
307 IN VOID *Context
308 );
309
310 VOID
311 TcpSetTimer (
312 IN TCP_CB *Tcb,
313 IN UINT16 Timer,
314 IN UINT32 TimeOut
315 );
316
317 VOID
318 TcpClearTimer (
319 IN TCP_CB *Tcb,
320 IN UINT16 Timer
321 );
322
323 VOID
324 TcpClearAllTimer (
325 IN TCP_CB *Tcb
326 );
327
328 VOID
329 TcpSetProbeTimer (
330 IN TCP_CB *Tcb
331 );
332
333 VOID
334 TcpSetKeepaliveTimer (
335 IN TCP_CB *Tcb
336 );
337
338 VOID
339 TcpBackoffRto (
340 IN TCP_CB *Tcb
341 );
342
343 EFI_STATUS
344 TcpSetVariableData (
345 IN TCP4_SERVICE_DATA *Tcp4Service
346 );
347
348 VOID
349 TcpClearVariableData (
350 IN TCP4_SERVICE_DATA *Tcp4Service
351 );
352
353 EFI_STATUS
354 TcpInstallDevicePath (
355 IN SOCKET *Sock
356 );
357
358 #endif