summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h95
1 files changed, 90 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
index fcbfb01699..43833af8c4 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
@@ -91,16 +91,49 @@ typedef struct {
#define IP4_RXDATA_WRAP_SIZE(NumFrag) \
(sizeof (IP4_RXDATA_WRAP) + sizeof (EFI_IP4_FRAGMENT_DATA) * ((NumFrag) - 1))
+/**
+ Initialize an already allocated assemble table. This is generally
+ the assemble table embedded in the IP4 service instance.
+
+ @param Table The assemble table to initialize.
+
+ @return NONE
+
+**/
VOID
Ip4InitAssembleTable (
- IN IP4_ASSEMBLE_TABLE *Table
+ IN OUT IP4_ASSEMBLE_TABLE *Table
);
+/**
+ Clean up the assemble table: remove all the fragments
+ and assemble entries.
+
+ @param Table The assemble table to clean up
+
+ @return None
+
+**/
VOID
Ip4CleanAssembleTable (
IN IP4_ASSEMBLE_TABLE *Table
);
+/**
+ The IP4 input routine. It is called by the IP4_INTERFACE when a
+ IP4 fragment is received from MNP.
+
+ @param Ip4Instance The IP4 child that request the receive, most like
+ it is NULL.
+ @param Packet The IP4 packet received.
+ @param IoStatus The return status of receive request.
+ @param Flag The link layer flag for the packet received, such
+ as multicast.
+ @param Context The IP4 service instance that own the MNP.
+
+ @return None
+
+**/
VOID
Ip4AccpetFrame (
IN IP4_PROTOCOL *Ip4Instance,
@@ -110,26 +143,78 @@ Ip4AccpetFrame (
IN VOID *Context
);
+/**
+ Demultiple the packet. the packet delivery is processed in two
+ passes. The first pass will enque a shared copy of the packet
+ to each IP4 child that accepts the packet. The second pass will
+ deliver a non-shared copy of the packet to each IP4 child that
+ has pending receive requests. Data is copied if more than one
+ child wants to consume the packet because each IP child needs
+ its own copy of the packet to make changes.
+
+ @param IpSb The IP4 service instance that received the packet
+ @param Head The header of the received packet
+ @param Packet The data of the received packet
+
+ @retval EFI_NOT_FOUND No IP child accepts the packet
+ @retval EFI_SUCCESS The packet is enqueued or delivered to some IP
+ children.
+
+**/
EFI_STATUS
Ip4Demultiplex (
- IN IP4_SERVICE *SbInstance,
+ IN IP4_SERVICE *IpSb,
IN IP4_HEAD *Head,
IN NET_BUF *Packet
);
+/**
+ Enqueue a received packet to all the IP children that share
+ the same interface.
+
+ @param IpSb The IP4 service instance that receive the packet
+ @param Head The header of the received packet
+ @param Packet The data of the received packet
+ @param IpIf The interface to enqueue the packet to
+
+ @return The number of the IP4 children that accepts the packet
+
+**/
INTN
Ip4InterfaceEnquePacket (
- IN IP4_SERVICE *SbInstance,
+ IN IP4_SERVICE *IpSb,
IN IP4_HEAD *Head,
IN NET_BUF *Packet,
- IN IP4_INTERFACE *Interface
+ IN IP4_INTERFACE *IpIf
);
+/**
+ Deliver the received packets to upper layer if there are both received
+ requests and enqueued packets. If the enqueued packet is shared, it will
+ duplicate it to a non-shared packet, release the shared packet, then
+ deliver the non-shared packet up.
+
+ @param IpInstance The IP child to deliver the packet up.
+
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resources to deliver the
+ packets.
+ @retval EFI_SUCCESS All the enqueued packets that can be delivered
+ are delivered up.
+
+**/
EFI_STATUS
Ip4InstanceDeliverPacket (
- IN IP4_PROTOCOL *Ip4Instance
+ IN IP4_PROTOCOL *IpInstance
);
+/**
+ Timeout the fragment and enqueued packets.
+
+ @param IpSb The IP4 service instance to timeout
+
+ @return None
+
+**/
VOID
Ip4PacketTimerTicking (
IN IP4_SERVICE *IpSb