]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/PxeBcDxe/Ip.h
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / PxeBcDxe / Ip.h
CommitLineData
772db4bb 1/** @file
2
3Copyright (c) 2004 - 2006, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13**/
14
15#ifndef _IP_H_
16#define _IP_H_
17
18#include "hton.h"
19
20//
21// portability macros
22//
23#define UDP_FILTER_MASK (EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP | \
24 EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT | \
25 EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP | \
26 EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT | \
27 EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER \
28 )
29
30#define PXE_BOOT_LAYER_MASK 0x7FFF
31#define PXE_BOOT_LAYER_INITIAL 0x0000
32#define PXE_BOOT_LAYER_CREDENTIAL_FLAG 0x8000
33#define MAX_BOOT_SERVERS 32
34
35//
36// macro to evaluate IP address as TRUE if it is a multicast IP address
37//
38#define IS_MULTICAST(ptr) ((*((UINT8 *) ptr) & 0xf0) == 0xe0)
39
40//
41// length macros
42//
43#define IP_ADDRESS_LENGTH(qp) (((qp)->UsingIpv6) ? sizeof (EFI_IPv6_ADDRESS) : sizeof (EFI_IPv4_ADDRESS))
44
45#define MAX_FRAME_DATA_SIZE 1488
46#define ALLOCATE_SIZE(X) (((X) + 7) & 0xfff8)
47#define MODE_ALLOCATE_SIZE ALLOCATE_SIZE (sizeof (EFI_PXE_BASE_CODE_MODE))
48#define BUFFER_ALLOCATE_SIZE (8192 + 512)
49#define ROUTER_ALLOCATE_SIZE ALLOCATE_SIZE ((sizeof (EFI_PXE_BASE_CODE_ROUTE_ENTRY) * PXE_ROUTER_TABLE_SIZE))
50#define ARP_ALLOCATE_SIZE ALLOCATE_SIZE ((sizeof (EFI_PXE_BASE_CODE_ARP_ENTRY) * PXE_ARP_CACHE_SIZE))
51#define FILTER_ALLOCATE_SIZE ALLOCATE_SIZE ((sizeof (EFI_IP_ADDRESS) * PXE_IP_FILTER_SIZE))
52#define PXE_ARP_CACHE_SIZE 8
53#define PXE_ROUTER_TABLE_SIZE 8
54#define PXE_IP_FILTER_SIZE 8
55#define ICMP_ALLOCATE_SIZE ALLOCATE_SIZE (sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR))
56#define TFTP_ERR_ALLOCATE_SIZE ALLOCATE_SIZE (sizeof (EFI_PXE_BASE_CODE_TFTP_ERROR))
57
58//
59// DHCP discover/request packets are sent to this UDP port. ProxyDHCP
60// servers listen on this port for DHCP discover packets that have a
61// class identifier (option 60) with 'PXEClient' in the first 9 bytes.
62// Bootservers also listen on this port for PXE broadcast discover
63// requests from PXE clients.
64//
65#define DHCP_SERVER_PORT 67
66
67//
68// When DHCP, proxyDHCP and Bootservers respond to DHCP and PXE broadcast
69// discover requests by broadcasting the reply packet, the packet is
70// broadcast to this port.
71//
72#define DHCP_CLIENT_PORT 68
73
74//
75// TFTP servers listen for TFTP open requests on this port.
76//
77#define TFTP_OPEN_PORT 69
78
79//
80// proxyDHCP and Bootservers listen on this port for a PXE unicast and/or
81// multicast discover requests from PXE clients. A PXE discover request
82// looks like a DHCP discover or DHCP request packet.
83//
84#define PXE_DISCOVERY_PORT 4011
85
86//
87// This port is used by the PXE client/server protocol tests.
88//
89#define PXE_PORT_PXETEST_PORT 0x8080
90
91//
92// Definitions for Ethertype protocol numbers and interface types
93// Per RFC 1700,
94//
95#define PXE_PROTOCOL_ETHERNET_IP 0x0800
96#define PXE_PROTOCOL_ETHERNET_ARP 0x0806
97#define PXE_PROTOCOL_ETHERNET_RARP 0x8035
98
99#define PXE_IFTYPE_ETHERNET 0x01
100#define PXE_IFTYPE_TOKENRING 0x04
101#define PXE_IFTYPE_FIBRE_CHANNEL 0x12
102
103//
104// Definitions for internet protocol version 4 header
105// Per RFC 791, September 1981.
106//
107#define IPVER4 4
108
109#pragma pack(1) // make network structures packed byte alignment
110typedef union {
111 UINT8 B[4];
112 UINT32 L;
113} IPV4_ADDR;
114
115#define IPV4_HEADER_LENGTH(IpHeaderPtr) (((IpHeaderPtr)->VersionIhl & 0xf) << 2)
116
117#define SET_IPV4_VER_HDL(IpHeaderPtr, IpHeaderLen) { \
118 (IpHeaderPtr)->VersionIhl = (UINT8) ((IPVER4 << 4) | ((IpHeaderLen) >> 2)); \
119 }
120
121typedef struct {
122 UINT8 VersionIhl;
123 UINT8 TypeOfService;
124 UINT16 TotalLength;
125 UINT16 Id;
126 UINT16 FragmentFields;
127 UINT8 TimeToLive;
128 UINT8 Protocol;
129 UINT16 HeaderChecksum;
130 IPV4_ADDR SrcAddr;
131 IPV4_ADDR DestAddr;
132 //
133 // options are not implemented
134 //
135} IPV4_HEADER;
136
137#define IP_FRAG_RSVD 0x8000 // reserved bit - must be zero
138#define IP_NO_FRAG 0x4000 // do not fragment bit
139#define IP_MORE_FRAG 0x2000 // not last fragment
140#define IP_FRAG_OFF_MSK 0x1fff // fragment offset in 8 byte chunks
141#define DEFAULT_RFC_TTL 64
142
143#define PROT_ICMP 1
144#define PROT_IGMP 2
145#define PROT_TCP 6
146#define PROT_UDP 17
147
148/*
149 * Definitions for internet control message protocol version 4 message
150 * structure. Per RFC 792, September 1981.
151 */
152
153//
154// icmp header for all icmp messages
155//
156typedef struct {
157 UINT8 Type; // message type
158 UINT8 Code; // type specific - 0 for types we implement
159 UINT16 Checksum; // ones complement of ones complement sum of 16 bit words of message
160} ICMPV4_HEADER;
161
162#define ICMP_DEST_UNREACHABLE 3
163#define ICMP_SOURCE_QUENCH 4
164#define ICMP_REDIRECT 5
165#define ICMP_ECHO 8
166#define ICMP_ECHO_REPLY 0
167#define ICMP_ROUTER_ADV 9
168#define ICMP_ROUTER_SOLICIT 10
169#define ICMP_TIME_EXCEEDED 11
170#define ICMP_PARAMETER_PROBLEM 12
171#define ICMP_TIMESTAMP 13
172#define ICMP_TIMESTAMP_REPLY 14
173#define ICMP_INFO_REQ 15
174#define ICMP_INFO_REQ_REPLY 16
175#define ICMP_SUBNET_MASK_REQ 17
176#define ICMP_SUBNET_MASK_REPLY 18
177//
178// other ICMP message types ignored in this implementation
179//
180// icmp general messages
181//
182typedef struct {
183 ICMPV4_HEADER Header;
184 //
185 // generally unused except byte [0] for
186 // parameter problem message
187 //
188 UINT8 GenerallyUnused[4];
189 //
190 // original message ip header of plus 64
191 // bits of data
192 //
193 IPV4_HEADER IpHeader;
194} ICMPV4_GENERAL_MESSAGE;
195
196//
197// icmp req/rply message header
198//
199typedef struct {
200 ICMPV4_HEADER Header;
201 UINT16 Id;
202 UINT16 SequenceNumber;
203} ICMPV4_REQUEST_REPLY_HEADER;
204
205//
206// icmp echo message
207//
208typedef struct {
209 ICMPV4_REQUEST_REPLY_HEADER Header;
210 UINT8 EchoData[1]; // variable length data to be echoed
211} ICMPV4_ECHO_MESSAGE;
212
213//
214// icmp timestamp message - times are milliseconds since midnight UT -
215// if non std, set high order bit
216//
217typedef struct {
218 ICMPV4_REQUEST_REPLY_HEADER Header;
219 UINT32 OriginalTime; // originating timestamp
220 UINT32 ReceiveTime; // receiving timestamp
221 UINT32 TransmitTime; // transmitting timestamp
222} ICMPV4_TIMESTAMP_MESSAGE;
223
224//
225// icmp info request structure - fill in source and dest net ip address on reply
226//
227typedef struct {
228 ICMPV4_REQUEST_REPLY_HEADER Header;
229} ICMPV4_INFO_MESSAGE;
230
231//
232// Definitions for internet control message protocol version 4 message structure
233// Router discovery
234// Per RFC 1256, September 1991.
235//
236//
237// icmp router advertisement message
238//
239typedef struct {
240 ICMPV4_HEADER Header;
241 UINT8 NumberEntries; // number of address entries
242 UINT8 EntrySize; // number of 32 bit words per address entry
243 UINT16 Lifetime; // seconds to consider info valid
244 UINT32 RouterIp;
245 UINT32 Preferance;
246} ICMPV4_ROUTER_ADVERTISE_MESSAGE;
247
248//
249// icmp router solicitation message
250//
251typedef struct {
252 ICMPV4_HEADER Header;
253 UINT32 Reserved;
254} ICMPV4_ROUTER_SOLICIT_MESSAGE;
255
256#define MAX_SOLICITATION_DELAY 1 // 1 second
257#define SOLICITATION_INTERVAL 3 // 3 seconds
258#define MAX_SOLICITATIONS 3 // 3 transmissions
259#define V1ROUTER_PRESENT_TIMEOUT 400 // 400 second timeout until v2 reports can be sent
260#define UNSOLICITED_REPORT_INTERVAL 10 // 10 seconds between unsolicited reports
261#define BROADCAST_IPv4 0xffffffff
262
263//
264// Definitions for address resolution protocol message structure
265// Per RFC 826, November 1982
266//
267typedef struct {
268 UINT16 HwType; // hardware type - e.g. ethernet (1)
269 UINT16 ProtType; // protocol type - for ethernet, 0x800 for IP
270 UINT8 HwAddLen; // byte length of a hardware address (e.g. 6 for ethernet)
271 UINT8 ProtAddLen; // byte length of a protocol address (e.g. 4 for ipv4)
272 UINT16 OpCode;
273 //
274 // source and dest hw and prot addresses follow - see example below
275 //
276} ARP_HEADER;
277
278#define ETHERNET_ADD_SPC 1
279
280#define ETHER_TYPE_IP 0x800
281
282#define ARP_REQUEST 1
283#define ARP_REPLY 2
284
285//
286// generic ARP packet
287//
288typedef struct {
289 ARP_HEADER ArpHeader;
290 EFI_MAC_ADDRESS SrcHardwareAddr;
291 EFI_IP_ADDRESS SrcProtocolAddr;
292 EFI_MAC_ADDRESS DestHardwareAddr;
293 EFI_IP_ADDRESS DestProtocolAddr;
294} ARP_PACKET;
295
296#define ENET_HWADDLEN 6
297#define IPV4_PROTADDLEN 4
298
299//
300// Definitions for user datagram protocol version 4 pseudo header & header
301// Per RFC 768, 28 August 1980
302//
303typedef struct {
304 IPV4_ADDR SrcAddr; // source ip address
305 IPV4_ADDR DestAddr; // dest ip address
306 UINT8 Zero; // 0
307 UINT8 Protocol; // protocol
308 UINT16 TotalLength; // UDP length - sizeof udpv4hdr + data length
309} UDPV4_PSEUDO_HEADER;
310
311typedef struct {
312 UINT16 SrcPort; // source port identifier
313 UINT16 DestPort; // destination port identifier
314 UINT16 TotalLength; // total length header plus data
315 //
316 // ones complement of ones complement sum of 16 bit
317 // words of pseudo header, UDP header, and data
318 // zero checksum is transmitted as -0 (ones comp)
319 // zero transmitted means checksum not computed
320 // data follows
321 //
322 UINT16 Checksum;
323} UDPV4_HEADER;
324
325typedef struct {
326 UDPV4_PSEUDO_HEADER Udpv4PseudoHeader;
327 UDPV4_HEADER Udpv4Header;
328} UDPV4_HEADERS;
329
330//
331// Definitions for transmission control protocol header
332// Per RFC 793, September, 1981
333//
334typedef struct {
335 IPV4_ADDR SrcAddr; // source ip address
336 IPV4_ADDR DestAddr; // dest ip address
337 UINT8 Zero; // 0
338 UINT8 Protocol; // protocol
339 UINT16 TotalLength; // TCP length - TCP header length + data length
340} TCPV4_PSEUDO_HEADER;
341
342typedef struct {
343 UINT16 SrcPort; // source port identifier
344 UINT16 DestPort; // destination port identifier
345 UINT32 SeqNumber; // Sequence number
346 UINT32 AckNumber; // Acknowledgement Number
347 //
348 // Nibble of HLEN (length of header in 32-bit multiples)
349 // 6bits of RESERVED
350 // Nibble of Code Bits
351 //
352 UINT16 HlenResCode;
353 UINT16 Window; // Software buffer size (sliding window size) in network-standard byte order
354 //
355 // ones complement of ones complement sum of 16 bit words of
356 // pseudo header, TCP header, and data
357 // zero checksum is transmitted as -0 (ones comp)
358 // zero transmitted means checksum not computed
359 //
360 UINT16 Checksum;
361 UINT16 UrgentPointer; // pointer to urgent data (allows sender to specify urgent data)
362} TCPV4_HEADER;
363
364typedef struct {
365 TCPV4_PSEUDO_HEADER Tcpv4PseudoHeader;
366 TCPV4_HEADER Tcpv4Header;
367} TCPV4_HEADERS;
368
369typedef struct {
370 UINT8 Kind; // one of the following:
371 UINT8 Length; // total option length including Kind and Lth
372 UINT8 Data[1]; // length = Lth - 2
373} TCPV4_OPTION;
374
375#define TCP_OP_END 0 // only used to pad to end of TCP header
376#define TCP_NOP 1 // optional - may be used to pad between options to get alignment
377#define TCP_MAX_SEG 2 // maximum receive segment size - only send at initial connection request
378#define MAX_MEDIA_HDR_SIZE 64
379#define MIN_ENET_DATA_SIZE 64
380#define MAX_ENET_DATA_SIZE 1500 // temp def - make a network based var
381#define MAX_IPV4_PKT_SIZE 65535 // maximum IP packet size
382#define MAX_IPV4_DATA_SIZE (MAX_IPV4_PKT_SIZE - sizeof (IPV4_HEADER))
383#define MAX_IPV4_FRAME_DATA_SIZE (MAX_FRAME_DATA_SIZE - sizeof (IPV4_HEADER))
384#define REAS_IPV4_PKT_SIZE 576 // minimum IP packet size all IP host can handle
385#define REAS_IPV4_DATA_SIZE (REAS_IPV4_PKT_SIZE - sizeof (IPV4_HEADER))
386
387//
388//
389//
390typedef union {
391 UINT8 Data[MAX_ENET_DATA_SIZE];
392 ICMPV4_HEADER IcmpHeader;
393 IGMPV2_MESSAGE IgmpMessage;
394 struct {
395 UDPV4_HEADER UdpHeader;
396 UINT8 Data[1];
397 } Udp;
398 struct {
399 TCPV4_HEADER TcpHeader;
400 UINT8 Data[1];
401 } Tcp;
402} PROTOCOL_UNION;
403
404//
405// out buffer structure
406//
407typedef struct {
408 UINT8 MediaHeader[MAX_MEDIA_HDR_SIZE];
409 IPV4_HEADER IpHeader;
410 //
411 // following union placement only valid if no option IP header
412 //
413 PROTOCOL_UNION u;
414} IPV4_BUFFER;
415
416typedef struct {
417 IPV4_HEADER IpHeader;
418 //
419 // following union placement only valid if no option IP header
420 //
421 PROTOCOL_UNION u;
422} IPV4_STRUCT;
423
424#pragma pack() // reset to default
425
426 ////////////////////////////////////////////////////////////
427//
428// BC IP Filter Routine
429//
430EFI_STATUS
431IpFilter (
432 PXE_BASECODE_DEVICE *Private,
433 IN EFI_PXE_BASE_CODE_IP_FILTER *Filter
434 )
435;
436
437//
438// //////////////////////////////////////////////////////////////////////
439//
440// Udp Write Routine - called by base code - e.g. TFTP - already locked
441//
442EFI_STATUS
443UdpWrite (
444 IN PXE_BASECODE_DEVICE *Private,
445 IN UINT16 OpFlags,
446 IN EFI_IP_ADDRESS *DestIpPtr,
447 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPortptr,
448 IN EFI_IP_ADDRESS *GatewayIpPtr, OPTIONAL
449 IN EFI_IP_ADDRESS *SrcIpPtr, OPTIONAL
450 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPortPtr, OPTIONAL
451 IN UINTN *HeaderSizePtr, OPTIONAL
452 IN VOID *HeaderPtr, OPTIONAL
453 IN UINTN *BufferSizePtr,
454 IN VOID *BufferPtr
455 )
456;
457
458//
459// /////////////////////////////////////////////////////////////////////
460//
461// Udp Read Routine - called by base code - e.g. TFTP - already locked
462//
463EFI_STATUS
464UdpRead (
465 IN PXE_BASECODE_DEVICE *Private,
466 IN UINT16 OpFlags,
467 IN OUT EFI_IP_ADDRESS *DestIpPtr, OPTIONAL
468 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPorPtrt, OPTIONAL
469 IN OUT EFI_IP_ADDRESS *SrcIpPtr, OPTIONAL
470 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPortPtr, OPTIONAL
471 IN UINTN *HeaderSizePtr, OPTIONAL
472 IN VOID *HeaderPtr, OPTIONAL
473 IN OUT UINTN *BufferSizePtr,
474 IN VOID *BufferPtr,
475 IN EFI_EVENT TimeoutEvent
476 )
477;
478
479VOID
480IgmpLeaveGroup (
481 PXE_BASECODE_DEVICE *Private,
482 EFI_IP_ADDRESS *
483 )
484;
485
486VOID
487IgmpJoinGroup (
488 PXE_BASECODE_DEVICE *Private,
489 EFI_IP_ADDRESS *
490 )
491;
492
493//
494// convert number to zero filled ascii value of length lth
495//
496VOID
497CvtNum (
498 UINTN Number,
499 UINT8 *BufferPtr,
500 INTN BufferLen
501 )
502;
503
504//
505// convert number to ascii string at ptr
506//
507VOID
508UtoA10 (
509 UINTN Number,
510 UINT8 *BufferPtr
511 )
512;
513
514//
515// convert ascii numeric string to UINTN
516//
517UINTN
518AtoU (
519 UINT8 *BufferPtr
520 )
521;
522
523UINT64
524AtoU64 (
525 UINT8 *BufferPtr
526 )
527;
528
529//
530// calculate the internet checksum (RFC 1071)
531// return 16 bit ones complement of ones complement sum of 16 bit words
532//
533UINT16
534IpChecksum (
535 UINT16 *MessagePtr,
536 UINTN ByteLength
537 )
538;
539
540//
541// do checksum on non contiguous header and data
542//
543UINT16
544IpChecksum2 (
545 UINT16 *Header,
546 UINTN HeaderLength,
547 UINT16 *Message,
548 UINTN MessageLength
549 )
550;
551
552//
553// update checksum when only a single word changes
554//
555UINT16
556UpdateChecksum (
557 UINT16 OldChecksum,
558 UINT16 OldWord,
559 UINT16 NewWord
560 )
561;
562
563VOID
564SeedRandom (
565 IN PXE_BASECODE_DEVICE *Private,
566 IN UINT16 InitialSeed
567 )
568;
569
570UINT16
571Random (
572 IN PXE_BASECODE_DEVICE *Private
573 )
574;
575
576EFI_STATUS
577SendPacket (
578 PXE_BASECODE_DEVICE *Private,
579 VOID *HeaderPtr,
580 VOID *PacketPtr,
581 INTN PacketLength,
582 VOID *HardwareAddress,
583 UINT16 MediaProtocol,
584 IN EFI_PXE_BASE_CODE_FUNCTION Function
585 )
586;
587
588VOID
589HandleArpReceive (
590 PXE_BASECODE_DEVICE *Private,
591 ARP_PACKET *ArpPacketPtr,
592 VOID *HeaderPtr
593 )
594;
595
596VOID
597HandleIgmp (
598 PXE_BASECODE_DEVICE *Private,
599 IGMPV2_MESSAGE *IgmpMessageptr,
600 UINTN IgmpMessageLen
601 )
602;
603
604VOID
605IgmpCheckTimers (
606 PXE_BASECODE_DEVICE *Private
607 )
608; // poll when doing a receive
609// return hw add of IP and TRUE if available, otherwise FALSE
610//
611BOOLEAN
612GetHwAddr (
613 IN PXE_BASECODE_DEVICE *Private,
614 EFI_IP_ADDRESS *ProtocolAddressPtr,
615 EFI_MAC_ADDRESS *HardwareAddressPtr
616 )
617;
618
619EFI_STATUS
620DoArp (
621 IN PXE_BASECODE_DEVICE *Private,
622 IN EFI_IP_ADDRESS *ProtocolAddressPtr,
623 OUT EFI_MAC_ADDRESS *HardwareAddressptr
624 )
625;
626
627BOOLEAN
628OnSameSubnet (
629 UINTN IpAddressLen,
630 EFI_IP_ADDRESS *Ip1,
631 EFI_IP_ADDRESS *Ip2,
632 EFI_IP_ADDRESS *SubnetMask
633 )
634;
635
636VOID
637IpAddRouter (
638 PXE_BASECODE_DEVICE *Private,
639 EFI_IP_ADDRESS *RouterIp
640 )
641;
642
643#define Ip4AddRouter(Private, Ipv4Ptr) IpAddRouter (Private, (EFI_IP_ADDRESS *) Ipv4Ptr)
644
645//
646// routine to send ipv4 packet
647// ipv4 + upper protocol header for length TotHdrLth in xmtbuf, ipv4 header length IpHdrLth
648// routine fills in ipv4hdr Ver_Hdl, TotLth, and Checksum, moves in Data, and gets dest MAC address
649//
650EFI_STATUS
651Ipv4Xmt (
652 PXE_BASECODE_DEVICE *Private,
653 UINT32 GatewayIP,
654 UINTN IpHeaderLen,
655 UINTN TotalHeaderLen,
656 VOID *Data,
657 UINTN DataLen,
658 EFI_PXE_BASE_CODE_FUNCTION Function
659 )
660;
661
662//
663// send ipv4 packet with ipv4 option
664//
665EFI_STATUS
666Ipv4SendWOp (
667 PXE_BASECODE_DEVICE *Private,
668 UINT32 GatewayIP,
669 UINT8 *MessagePtr,
670 UINTN MessageLth,
671 UINT8 Protocol,
672 UINT8 *Option,
673 UINTN OptionLen,
674 UINT32 DestIp,
675 EFI_PXE_BASE_CODE_FUNCTION Function
676 )
677;
678
679//
680// send MsgLth message at MsgPtr - higher level protocol header already in xmtbuf, length HdrSize
681//
682EFI_STATUS
683Ip4Send (
684 IN PXE_BASECODE_DEVICE *Private, // pointer to instance data
685 IN UINTN MayFragment, //
686 IN UINT8 Protocol, // protocol
687 IN UINT32 SrcIp, // Source IP address
688 IN UINT32 DestIp, // Destination IP address
689 IN UINT32 GatewayIp, // used if not NULL and needed
690 IN UINTN HeaderSize, // protocol header byte length
691 IN UINT8 *MsgPtr, // pointer to data
692 IN UINTN MsgLength
693 )
694; // data byte length
695// receive up to MsgLth message into MsgPtr for protocol Prot
696// return message length, src/dest ips if select any, and pointer to protocol header
697//
698EFI_STATUS
699IpReceive (
700 IN PXE_BASECODE_DEVICE *Private, // pointer to instance data
701 UINT16 OpFlags, // Flags to determine if filtering on IP addresses
702 EFI_IP_ADDRESS *SrcIpPtr, // if filtering, O if accept any
703 EFI_IP_ADDRESS *DstIpPtr, // if filtering, O if accept any
704 UINT8 Protocol, // protocol
705 VOID *HeaderPtr, // address of where to put protocol header
706 UINTN HeaderSize, // protocol header byte length
707 UINT8 *MsgPtr, // pointer to data buffer
708 UINTN *MsgLenPtr, // pointer to data buffer length/ O - returned data length
709 IN EFI_EVENT TimeoutEvent
710 )
711;
712
713#if 0
714VOID
715WaitForTxComplete (
716 IN PXE_BASECODE_DEVICE *Private
717 )
718;
719#endif
720//
721// routine to cycle waiting for a receive or timeout
722//
723EFI_STATUS
724WaitForReceive (
725 IN PXE_BASECODE_DEVICE *Private,
726 IN EFI_PXE_BASE_CODE_FUNCTION Function,
727 IN EFI_EVENT TimeoutEvent,
728 IN OUT UINTN *HeaderSizePtr,
729 IN OUT UINTN *BufferSizePtr,
730 IN OUT UINT16 *ProtocolPtr
731 )
732;
733
734#endif /* _IP_H_ */
735
736/* EOF - ip.h */