]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Scrubbed more.
authorjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 09:23:25 +0000 (09:23 +0000)
committerjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 09:23:25 +0000 (09:23 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6454 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h

index 58fb83f5243773b6c38be29d45eceff07ca7cc52..9142e1df42074d88a697fd435ac5c59141544eeb 100644 (file)
@@ -66,9 +66,9 @@ typedef enum {
 #define IP4_ALLSYSTEM_ADDRESS 0xE0000001u\r
 #define IP4_ALLROUTER_ADDRESS 0xE0000002u\r
 \r
 #define IP4_ALLSYSTEM_ADDRESS 0xE0000001u\r
 #define IP4_ALLROUTER_ADDRESS 0xE0000002u\r
 \r
-//\r
-// Compose the fragment field to be used in the IP4 header.\r
-//\r
+///\r
+/// Compose the fragment field to be used in the IP4 header.\r
+///\r
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \\r
     ((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 0x1fff)))\r
 \r
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \\r
     ((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 0x1fff)))\r
 \r
@@ -80,10 +80,10 @@ typedef enum {
 \r
 #define IP4_IS_BROADCAST(CastType) ((CastType) >= IP4_LOCAL_BROADCAST)\r
 \r
 \r
 #define IP4_IS_BROADCAST(CastType) ((CastType) >= IP4_LOCAL_BROADCAST)\r
 \r
-//\r
-// Conver the Microsecond to second. IP transmit/receive time is\r
-// in the unit of microsecond. IP ticks once per second.\r
-//\r
+///\r
+/// Conver the Microsecond to second. IP transmit/receive time is\r
+/// in the unit of microsecond. IP ticks once per second.\r
+///\r
 #define IP4_US_TO_SEC(Us) (((Us) + 999999) / 1000000)\r
 \r
 INTN\r
 #define IP4_US_TO_SEC(Us) (((Us) + 999999) / 1000000)\r
 \r
 INTN\r
index ec07117eeb5adc763782ca5081b2dc5806227f47..e8e60c24906d72b9856d5377aee64b765b81523b 100644 (file)
@@ -64,12 +64,12 @@ VOID
   IN VOID                      *Context\r
   );\r
 \r
   IN VOID                      *Context\r
   );\r
 \r
-//\r
-// Each receive request is wrapped in an IP4_LINK_RX_TOKEN.\r
-// Upon completion, the Callback will be called. Only one\r
-// receive request is send to MNP. IpInstance is always NULL.\r
-// Reference MNP's spec for information.\r
-//\r
+///\r
+/// Each receive request is wrapped in an IP4_LINK_RX_TOKEN.\r
+/// Upon completion, the Callback will be called. Only one\r
+/// receive request is send to MNP. IpInstance is always NULL.\r
+/// Reference MNP's spec for information.\r
+///\r
 typedef struct {\r
   UINT32                                Signature;\r
   IP4_INTERFACE                         *Interface;\r
 typedef struct {\r
   UINT32                                Signature;\r
   IP4_INTERFACE                         *Interface;\r
@@ -81,10 +81,10 @@ typedef struct {
   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  MnpToken;\r
 } IP4_LINK_RX_TOKEN;\r
 \r
   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  MnpToken;\r
 } IP4_LINK_RX_TOKEN;\r
 \r
-//\r
-// Each transmit request is wrapped in an IP4_LINK_TX_TOKEN.\r
-// Upon completion, the Callback will be called.\r
-//\r
+///\r
+/// Each transmit request is wrapped in an IP4_LINK_TX_TOKEN.\r
+/// Upon completion, the Callback will be called.\r
+///\r
 typedef struct {\r
   UINT32                                Signature;\r
   LIST_ENTRY                            Link;\r
 typedef struct {\r
   UINT32                                Signature;\r
   LIST_ENTRY                            Link;\r
@@ -103,12 +103,12 @@ typedef struct {
   EFI_MANAGED_NETWORK_TRANSMIT_DATA     MnpTxData;\r
 } IP4_LINK_TX_TOKEN;\r
 \r
   EFI_MANAGED_NETWORK_TRANSMIT_DATA     MnpTxData;\r
 } IP4_LINK_TX_TOKEN;\r
 \r
-//\r
-// Only one ARP request is requested for all the frames in\r
-// a time. It is started for the first frames to the Ip. Any\r
-// subsequent transmission frame will be linked to Frames, and\r
-// be sent all at once the ARP requests succeed.\r
-//\r
+///\r
+/// Only one ARP request is requested for all the frames in\r
+/// a time. It is started for the first frames to the Ip. Any\r
+/// subsequent transmission frame will be linked to Frames, and\r
+/// be sent all at once the ARP requests succeed.\r
+///\r
 typedef struct {\r
   UINT32                  Signature;\r
   LIST_ENTRY              Link;\r
 typedef struct {\r
   UINT32                  Signature;\r
   LIST_ENTRY              Link;\r
index 9f3fe4a410b54ac7db09d2291d0e862909e4a787..6c48d6aca879cae045b241a17201d014b7e143ac 100644 (file)
@@ -31,12 +31,12 @@ typedef struct {
 } IGMP_HEAD;\r
 #pragma pack()\r
 \r
 } IGMP_HEAD;\r
 #pragma pack()\r
 \r
-//\r
-// The status of multicast group. It isn't necessary to maintain\r
-// explicit state of host state diagram. A group with non-zero\r
-// DelayTime is in "delaying member" state. otherwise, it is in\r
-// "idle member" state.\r
-//\r
+///\r
+/// The status of multicast group. It isn't necessary to maintain\r
+/// explicit state of host state diagram. A group with non-zero\r
+/// DelayTime is in "delaying member" state. otherwise, it is in\r
+/// "idle member" state.\r
+///\r
 typedef struct {\r
   LIST_ENTRY              Link;\r
   INTN                    RefCnt;\r
 typedef struct {\r
   LIST_ENTRY              Link;\r
   INTN                    RefCnt;\r
@@ -46,11 +46,11 @@ typedef struct {
   EFI_MAC_ADDRESS         Mac;\r
 } IGMP_GROUP;\r
 \r
   EFI_MAC_ADDRESS         Mac;\r
 } IGMP_GROUP;\r
 \r
-//\r
-// The IGMP status. Each IP4 service instance has a IGMP_SERVICE_DATA\r
-// attached. The Igmpv1QuerySeen remember whether the server on this\r
-// connected network is v1 or v2.\r
-//\r
+///\r
+/// The IGMP status. Each IP4 service instance has a IGMP_SERVICE_DATA\r
+/// attached. The Igmpv1QuerySeen remember whether the server on this\r
+/// connected network is v1 or v2.\r
+///\r
 typedef struct {\r
   INTN                    Igmpv1QuerySeen;\r
   LIST_ENTRY              Groups;\r
 typedef struct {\r
   INTN                    Igmpv1QuerySeen;\r
   LIST_ENTRY              Groups;\r
index 4e710ca29bb357017366702b26b8d7cd612fc9f8..2026bcc7d4d3444003b3660c52d0a26c6dd4d4ad 100644 (file)
@@ -2435,7 +2435,7 @@ EfiIp4Poll (
 /**\r
   Decrease the life of the transmitted packets. If it is\r
   decreased to zero, cancel the packet. This function is\r
 /**\r
   Decrease the life of the transmitted packets. If it is\r
   decreased to zero, cancel the packet. This function is\r
-  called by Ip4packetTimerTicking which time out both the\r
+  called by Ip4PacketTimerTicking which time out both the\r
   received-but-not-delivered and transmitted-but-not-recycle\r
   packets.\r
 \r
   received-but-not-delivered and transmitted-but-not-recycle\r
   packets.\r
 \r
index dd189ae8da986104374deaeb48af60726b3ad99c..1058432aaef4ae1e756ce865a01999f3901db25c 100644 (file)
@@ -76,15 +76,15 @@ typedef enum {
   IP4_SERVICE_DESTORY\r
 } IP4_IMPL_ENUM_TYPES;\r
 \r
   IP4_SERVICE_DESTORY\r
 } IP4_IMPL_ENUM_TYPES;\r
 \r
-//\r
-// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.\r
-// The user's data is kept in the Packet. When fragment is\r
-// needed, each fragment of the Packet has a reference to the\r
-// Packet, no data is actually copied. The Packet will be\r
-// released when all the fragments of it have been recycled by\r
-// MNP. Upon then, the IP4_TXTOKEN_WRAP will be released, and\r
-// user's event signalled.\r
-//\r
+///\r
+/// IP4_TXTOKEN_WRAP wraps the upper layer's transmit token.\r
+/// The user's data is kept in the Packet. When fragment is\r
+/// needed, each fragment of the Packet has a reference to the\r
+/// Packet, no data is actually copied. The Packet will be\r
+/// released when all the fragments of it have been recycled by\r
+/// MNP. Upon then, the IP4_TXTOKEN_WRAP will be released, and\r
+/// user's event signalled.\r
+///\r
 typedef struct {\r
   IP4_PROTOCOL              *IpInstance;\r
   EFI_IP4_COMPLETION_TOKEN  *Token;\r
 typedef struct {\r
   IP4_PROTOCOL              *IpInstance;\r
   EFI_IP4_COMPLETION_TOKEN  *Token;\r
@@ -93,15 +93,15 @@ typedef struct {
   INTN                      Life;\r
 } IP4_TXTOKEN_WRAP;\r
 \r
   INTN                      Life;\r
 } IP4_TXTOKEN_WRAP;\r
 \r
-//\r
-// IP4_RXDATA_WRAP wraps the data IP4 child delivers to the\r
-// upper layers. The received packet is kept in the Packet.\r
-// The Packet itself may be constructured from some fragments.\r
-// All the fragments of the Packet is organized by a\r
-// IP4_ASSEMBLE_ENTRY structure. If the Packet is recycled by\r
-// the upper layer, the assemble entry and its associated\r
-// fragments will be freed at last.\r
-//\r
+///\r
+/// IP4_RXDATA_WRAP wraps the data IP4 child delivers to the\r
+/// upper layers. The received packet is kept in the Packet.\r
+/// The Packet itself may be constructured from some fragments.\r
+/// All the fragments of the Packet is organized by a\r
+/// IP4_ASSEMBLE_ENTRY structure. If the Packet is recycled by\r
+/// the upper layer, the assemble entry and its associated\r
+/// fragments will be freed at last.\r
+///\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   IP4_PROTOCOL              *IpInstance;\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   IP4_PROTOCOL              *IpInstance;\r
index 620b6314be37237f7f31c435e3b352794a1a521a..59b40af21613d44af9d91cda0915f778bd64a500 100644 (file)
@@ -24,7 +24,7 @@ Abstract:
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Create a empty assemble entry for the packet identified by\r
+  Create an empty assemble entry for the packet identified by\r
   (Dst, Src, Id, Protocol). The default life for the packet is\r
   120 seconds.\r
 \r
   (Dst, Src, Id, Protocol). The default life for the packet is\r
   120 seconds.\r
 \r
@@ -72,7 +72,7 @@ Ip4CreateAssembleEntry (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Release all the fragments of a packet, then free the assemble entry\r
+  Release all the fragments of a packet, then free the assemble entry.\r
 \r
   @param  Assemble               The assemble entry to free\r
 \r
 \r
   @param  Assemble               The assemble entry to free\r
 \r
@@ -110,7 +110,7 @@ Ip4FreeAssembleEntry (
 **/\r
 VOID\r
 Ip4InitAssembleTable (\r
 **/\r
 VOID\r
 Ip4InitAssembleTable (\r
-  IN IP4_ASSEMBLE_TABLE     *Table\r
+  IN OUT IP4_ASSEMBLE_TABLE     *Table\r
   )\r
 {\r
   UINT32                    Index;\r
   )\r
 {\r
   UINT32                    Index;\r
@@ -164,9 +164,9 @@ Ip4CleanAssembleTable (
 **/\r
 VOID\r
 Ip4TrimPacket (\r
 **/\r
 VOID\r
 Ip4TrimPacket (\r
-  IN NET_BUF                *Packet,\r
-  IN INTN                   Start,\r
-  IN INTN                   End\r
+  IN OUT NET_BUF                *Packet,\r
+  IN     INTN                   Start,\r
+  IN     INTN                   End\r
   )\r
 {\r
   IP4_CLIP_INFO             *Info;\r
   )\r
 {\r
   IP4_CLIP_INFO             *Info;\r
@@ -220,17 +220,19 @@ Ip4OnFreeFragments (
   return it to caller. If the packet can't be assembled, NULL is\r
   return.\r
 \r
   return it to caller. If the packet can't be assembled, NULL is\r
   return.\r
 \r
-  @param  Table                  The assemble table used.\r
-  @param  Packet                 The fragment to assemble\r
+  @param  Table     The assemble table used. New assemble entry will be created\r
+                    if the Packet is from a new chain of fragments.\r
+  @param  Packet    The fragment to assemble. It might be freed if the fragment\r
+                    can't be re-assembled.\r
 \r
   @return NULL if the packet can't be reassemble. The point to just assembled\r
 \r
   @return NULL if the packet can't be reassemble. The point to just assembled\r
-  @return packet if all the fragments of the packet have arrived.\r
+          packet if all the fragments of the packet have arrived.\r
 \r
 **/\r
 NET_BUF *\r
 Ip4Reassemble (\r
 \r
 **/\r
 NET_BUF *\r
 Ip4Reassemble (\r
-  IN IP4_ASSEMBLE_TABLE     *Table,\r
-  IN NET_BUF                *Packet\r
+  IN OUT IP4_ASSEMBLE_TABLE     *Table,\r
+  IN OUT NET_BUF                *Packet\r
   )\r
 {\r
   IP4_HEAD                  *IpHead;\r
   )\r
 {\r
   IP4_HEAD                  *IpHead;\r
@@ -393,7 +395,7 @@ Ip4Reassemble (
   //\r
   // Deliver the whole packet if all the fragments received.\r
   // All fragments received if:\r
   //\r
   // Deliver the whole packet if all the fragments received.\r
   // All fragments received if:\r
-  //  1. received the last one, so, the totoal length is know\r
+  //  1. received the last one, so, the total length is know\r
   //  2. received all the data. If the last fragment on the\r
   //     queue ends at the total length, all data is received.\r
   //\r
   //  2. received all the data. If the last fragment on the\r
   //     queue ends at the total length, all data is received.\r
   //\r
@@ -429,7 +431,7 @@ Ip4Reassemble (
       return NULL;\r
     }\r
 \r
       return NULL;\r
     }\r
 \r
-    NewPacket->Ip                  = Assemble->Head;\r
+    NewPacket->Ip = Assemble->Head;\r
     CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));\r
     return NewPacket;\r
   }\r
     CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));\r
     return NewPacket;\r
   }\r
@@ -481,7 +483,7 @@ Ip4AccpetFrame (
   }\r
 \r
   //\r
   }\r
 \r
   //\r
-  // Check that the IP4 header is correctly formated\r
+  // Check that the IP4 header is correctly formatted\r
   //\r
   if (Packet->TotalSize < IP4_MIN_HEADLEN) {\r
     goto RESTART;\r
   //\r
   if (Packet->TotalSize < IP4_MIN_HEADLEN) {\r
     goto RESTART;\r
@@ -627,7 +629,8 @@ DROP:
   @param  Head                   The IP header of the packet\r
   @param  Packet                 The data of the packet\r
 \r
   @param  Head                   The IP header of the packet\r
   @param  Packet                 The data of the packet\r
 \r
-  @return TRUE if the child wants to receive the packet, otherwise return FALSE.\r
+  @retval TRUE   If the child wants to receive the packet.\r
+  @retval FALSE  Otherwise.\r
 \r
 **/\r
 BOOLEAN\r
 \r
 **/\r
 BOOLEAN\r
@@ -648,7 +651,7 @@ Ip4InstanceFrameAcceptable (
   //\r
   // Dirty trick for the Tiano UEFI network stack implmentation. If\r
   // ReceiveTimeout == -1, the receive of the packet for this instance\r
   //\r
   // Dirty trick for the Tiano UEFI network stack implmentation. If\r
   // ReceiveTimeout == -1, the receive of the packet for this instance\r
-  // is disabled. The UEFI spec don't have such captibility. We add\r
+  // is disabled. The UEFI spec don't have such capability. We add\r
   // this to improve the performance because IP will make a copy of\r
   // the received packet for each accepting instance. Some IP instances\r
   // used by UDP/TCP only send packets, they don't wants to receive.\r
   // this to improve the performance because IP will make a copy of\r
   // the received packet for each accepting instance. Some IP instances\r
   // used by UDP/TCP only send packets, they don't wants to receive.\r
@@ -1114,7 +1117,7 @@ Ip4InterfaceDeliverPacket (
   to each IP4 child that accepts the packet. The second pass will\r
   deliver a non-shared copy of the packet to each IP4 child that\r
   has pending receive requests. Data is copied if more than one\r
   to each IP4 child that accepts the packet. The second pass will\r
   deliver a non-shared copy of the packet to each IP4 child that\r
   has pending receive requests. Data is copied if more than one\r
-  child wants to consume the packet bacause each IP child need\r
+  child wants to consume the packet because each IP child needs\r
   its own copy of the packet to make changes.\r
 \r
   @param  IpSb                   The IP4 service instance that received the packet\r
   its own copy of the packet to make changes.\r
 \r
   @param  IpSb                   The IP4 service instance that received the packet\r
index d44029d0858ef7f080587366675706f4488e4023..fcbfb01699602f4d4e46716a04add60e0bec6d49 100644 (file)
@@ -21,25 +21,25 @@ Abstract:
 #ifndef __EFI_IP4_INPUT_H__\r
 #define __EFI_IP4_INPUT_H__\r
 \r
 #ifndef __EFI_IP4_INPUT_H__\r
 #define __EFI_IP4_INPUT_H__\r
 \r
-enum {\r
+typedef enum {\r
   IP4_MIN_HEADLEN       = 20,\r
   IP4_MAX_HEADLEN       = 60,\r
 \r
   IP4_ASSEMLE_HASH_SIZE = 31,\r
   IP4_FRAGMENT_LIFE     = 120,\r
   IP4_MAX_PACKET_SIZE   = 65535\r
   IP4_MIN_HEADLEN       = 20,\r
   IP4_MAX_HEADLEN       = 60,\r
 \r
   IP4_ASSEMLE_HASH_SIZE = 31,\r
   IP4_FRAGMENT_LIFE     = 120,\r
   IP4_MAX_PACKET_SIZE   = 65535\r
-};\r
-\r
-//\r
-// Per packet information for input process. LinkFlag specifies whether\r
-// the packet is received as Link layer unicast, multicast or broadcast.\r
-// The CastType is the IP layer cast type, such as IP multicast or unicast.\r
-// Start, End and Length are staffs used to assemble the packets. Start\r
-// is the sequence number of the first byte of data in the packet. Length\r
-// is the number of bytes of data. End = Start + Length, that is, the\r
-// sequence number of last byte + 1. Each assembled packet has a count down\r
-// life. If it isn't consumed before Life reaches zero, the packet is released.\r
-//\r
+} IP4_INPUT_ENUM_TYPES;\r
+\r
+///\r
+/// Per packet information for input process. LinkFlag specifies whether\r
+/// the packet is received as Link layer unicast, multicast or broadcast.\r
+/// The CastType is the IP layer cast type, such as IP multicast or unicast.\r
+/// Start, End and Length are staffs used to assemble the packets. Start\r
+/// is the sequence number of the first byte of data in the packet. Length\r
+/// is the number of bytes of data. End = Start + Length, that is, the\r
+/// sequence number of last byte + 1. Each assembled packet has a count down\r
+/// life. If it isn't consumed before Life reaches zero, the packet is released.\r
+///\r
 typedef struct {\r
   UINTN                     LinkFlag;\r
   INTN                      CastType;\r
 typedef struct {\r
   UINTN                     LinkFlag;\r
   INTN                      CastType;\r
@@ -50,9 +50,9 @@ typedef struct {
   EFI_STATUS                Status;\r
 } IP4_CLIP_INFO;\r
 \r
   EFI_STATUS                Status;\r
 } IP4_CLIP_INFO;\r
 \r
-//\r
-// Structure used to assemble IP packets.\r
-//\r
+///\r
+/// Structure used to assemble IP packets.\r
+///\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
 \r
 typedef struct {\r
   LIST_ENTRY                Link;\r
 \r
@@ -74,11 +74,11 @@ typedef struct {
   INTN                      Life;       // Count down life for the packet.\r
 } IP4_ASSEMBLE_ENTRY;\r
 \r
   INTN                      Life;       // Count down life for the packet.\r
 } IP4_ASSEMBLE_ENTRY;\r
 \r
-//\r
-// Each Ip service instance has an assemble table to reassemble\r
-// the packets before delivery to its children. It is organized\r
-// as hash table.\r
-//\r
+///\r
+/// Each Ip service instance has an assemble table to reassemble\r
+/// the packets before delivery to its children. It is organized\r
+/// as hash table.\r
+///\r
 typedef struct {\r
   LIST_ENTRY      Bucket[IP4_ASSEMLE_HASH_SIZE];\r
 } IP4_ASSEMBLE_TABLE;\r
 typedef struct {\r
   LIST_ENTRY      Bucket[IP4_ASSEMLE_HASH_SIZE];\r
 } IP4_ASSEMBLE_TABLE;\r
index a28656c9c6f42ec2331c7d780faa5bbc7ba5a8bf..334bb41112aa7dd0699e8b309da291dcef78d46d 100644 (file)
@@ -33,8 +33,8 @@ Abstract:
   @param  Rcvd                  The option is from the packet we received if TRUE,\r
                                 otherwise the option we wants to transmit.\r
 \r
   @param  Rcvd                  The option is from the packet we received if TRUE,\r
                                 otherwise the option we wants to transmit.\r
 \r
-  @return TRUE:  The option is properly formated\r
-  @return FALSE: The option is mal-formated\r
+  @retval TRUE     The option is properly formatted\r
+  @retval FALSE    The option is mal-formated\r
 \r
 **/\r
 BOOLEAN\r
 \r
 **/\r
 BOOLEAN\r
@@ -74,7 +74,7 @@ Ip4OptionIsValid (
       Point = Option[Cur + 2];\r
 \r
       //\r
       Point = Option[Cur + 2];\r
 \r
       //\r
-      // SRR/RR options are formated as |Type|Len|Point|Ip1|Ip2|...\r
+      // SRR/RR options are formatted as |Type|Len|Point|Ip1|Ip2|...\r
       //\r
       if ((OptionLen - Cur < Len) || (Len < 3) || ((Len - 3) % 4 != 0)) {\r
         IcmpPoint = Cur + 1;\r
       //\r
       if ((OptionLen - Cur < Len) || (Len < 3) || ((Len - 3) % 4 != 0)) {\r
         IcmpPoint = Cur + 1;\r
@@ -124,25 +124,25 @@ Ip4OptionIsValid (
   Copy the option from the original option to buffer. It\r
   handles the details such as:\r
   1. whether copy the single IP4 option to the first/non-first\r
   Copy the option from the original option to buffer. It\r
   handles the details such as:\r
   1. whether copy the single IP4 option to the first/non-first\r
-  fragments.\r
-  2. Pad the options copied over to aligened to 4 bytes.\r
+     fragments.\r
+  2. Pad the options copied over to aligned to 4 bytes.\r
 \r
   @param  Option                The original option to copy from\r
   @param  OptionLen             The length of the original option\r
   @param  FirstFragment         Whether it is the first fragment\r
 \r
   @param  Option                The original option to copy from\r
   @param  OptionLen             The length of the original option\r
   @param  FirstFragment         Whether it is the first fragment\r
-  @param  Buf                   The buffer to copy options to\r
+  @param  Buf                   The buffer to copy options to. NULL \r
   @param  BufLen                The length of the buffer\r
 \r
   @retval EFI_SUCCESS           The options are copied over\r
   @param  BufLen                The length of the buffer\r
 \r
   @retval EFI_SUCCESS           The options are copied over\r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer caller provided is too small.\r
+  @retval EFI_BUFFER_TOO_SMALL  Buf is NULL or BufLen provided is too small.\r
 \r
 **/\r
 EFI_STATUS\r
 Ip4CopyOption (\r
 \r
 **/\r
 EFI_STATUS\r
 Ip4CopyOption (\r
-  IN UINT8                  *Option,\r
-  IN UINT32                 OptionLen,\r
-  IN BOOLEAN                FirstFragment,\r
-  IN UINT8                  *Buf,           OPTIONAL\r
+  IN     UINT8              *Option,\r
+  IN     UINT32             OptionLen,\r
+  IN     BOOLEAN            FirstFragment,\r
+  IN OUT UINT8              *Buf,           OPTIONAL\r
   IN OUT UINT32             *BufLen\r
   )\r
 {\r
   IN OUT UINT32             *BufLen\r
   )\r
 {\r
index 4007a4a930c286c76553d8585257f9ef14b58618..70bdba10d36ecb665c65faa72236cfbc9155b3df 100644 (file)
@@ -31,7 +31,7 @@ UINT16  mIp4Id;
 \r
   @param  Packet               The packet to prepend IP4 header to\r
   @param  Head                 The caller supplied header. The caller should set\r
 \r
   @param  Packet               The packet to prepend IP4 header to\r
   @param  Head                 The caller supplied header. The caller should set\r
-                               the  following header fields: Tos, TotalLen, Id,\r
+                               the following header fields: Tos, TotalLen, Id,\r
                                Fragment, Ttl, Protocol, Src and Dst. All the fields\r
                                are in host byte order. This function will fill in\r
                                the Ver, HeadLen, and checksum.\r
                                Fragment, Ttl, Protocol, Src and Dst. All the fields\r
                                are in host byte order. This function will fill in\r
                                the Ver, HeadLen, and checksum.\r
@@ -45,10 +45,10 @@ UINT16  mIp4Id;
 **/\r
 EFI_STATUS\r
 Ip4PrependHead (\r
 **/\r
 EFI_STATUS\r
 Ip4PrependHead (\r
-  IN NET_BUF                *Packet,\r
-  IN IP4_HEAD               *Head,\r
-  IN UINT8                  *Option,\r
-  IN UINT32                 OptLen\r
+  IN OUT NET_BUF                *Packet,\r
+  IN     IP4_HEAD               *Head,\r
+  IN     UINT8                  *Option,\r
+  IN     UINT32                 OptLen\r
   )\r
 {\r
   UINT32                    HeadLen;\r
   )\r
 {\r
   UINT32                    HeadLen;\r
@@ -65,7 +65,7 @@ Ip4PrependHead (
   Ip4CopyOption (Option, OptLen, FirstFragment, NULL, &Len);\r
 \r
   HeadLen = IP4_MIN_HEADLEN + Len;\r
   Ip4CopyOption (Option, OptLen, FirstFragment, NULL, &Len);\r
 \r
   HeadLen = IP4_MIN_HEADLEN + Len;\r
-  ASSERT (((Len %4) == 0) && (HeadLen <= IP4_MAX_HEADLEN));\r
+  ASSERT (((Len % 4) == 0) && (HeadLen <= IP4_MAX_HEADLEN));\r
 \r
   PacketHead = (IP4_HEAD *) NetbufAllocSpace (Packet, HeadLen, NET_BUF_HEAD);\r
 \r
 \r
   PacketHead = (IP4_HEAD *) NetbufAllocSpace (Packet, HeadLen, NET_BUF_HEAD);\r
 \r
@@ -106,7 +106,7 @@ Ip4PrependHead (
   @param  Src                  The source of the packet\r
 \r
   @return NULL if no proper interface is found, otherwise the interface that\r
   @param  Src                  The source of the packet\r
 \r
   @return NULL if no proper interface is found, otherwise the interface that\r
-  @return can be used to send the system packet from.\r
+          can be used to send the system packet from.\r
 \r
 **/\r
 IP4_INTERFACE *\r
 \r
 **/\r
 IP4_INTERFACE *\r
@@ -197,7 +197,7 @@ Ip4SysPacketSent (
                                NULL if the packet is from the system.\r
   @param  Packet               The user data to send, excluding the IP header.\r
   @param  Head                 The caller supplied header. The caller should set\r
                                NULL if the packet is from the system.\r
   @param  Packet               The user data to send, excluding the IP header.\r
   @param  Head                 The caller supplied header. The caller should set\r
-                               the  following header fields: Tos, TotalLen, Id, tl,\r
+                               the following header fields: Tos, TotalLen, Id, tl,\r
                                Fragment, Protocol, Src and Dst. All the fields are\r
                                in host byte  order. This function will fill in the\r
                                Ver, HeadLen,  Fragment, and checksum. The Fragment\r
                                Fragment, Protocol, Src and Dst. All the fields are\r
                                in host byte  order. This function will fill in the\r
                                Ver, HeadLen,  Fragment, and checksum. The Fragment\r
@@ -269,8 +269,8 @@ Ip4Output (
     if (IP4_IS_BROADCAST (Ip4GetNetCast (Dest, IpIf)) || (Dest == IP4_ALLONE_ADDRESS)) {\r
       //\r
       // Set the gateway to local broadcast if the Dest is\r
     if (IP4_IS_BROADCAST (Ip4GetNetCast (Dest, IpIf)) || (Dest == IP4_ALLONE_ADDRESS)) {\r
       //\r
       // Set the gateway to local broadcast if the Dest is\r
-      // is the broadcast address for the connected network\r
-      // or it is local broadcast.\r
+      // the broadcast address for the connected network or\r
+      // it is local broadcast.\r
       //\r
       GateWay = IP4_ALLONE_ADDRESS;\r
 \r
       //\r
       GateWay = IP4_ALLONE_ADDRESS;\r
 \r
@@ -423,8 +423,8 @@ ON_ERROR:
 **/\r
 BOOLEAN\r
 Ip4CancelPacketFragments (\r
 **/\r
 BOOLEAN\r
 Ip4CancelPacketFragments (\r
-  IP4_LINK_TX_TOKEN   *Frame,\r
-  VOID                *Context\r
+  IN IP4_LINK_TX_TOKEN   *Frame,\r
+  IN VOID                *Context\r
   )\r
 {\r
   if ((Frame->Packet == (NET_BUF *) Context) || (Frame->Context == Context)) {\r
   )\r
 {\r
   if ((Frame->Packet == (NET_BUF *) Context) || (Frame->Context == Context)) {\r
index bed4fde0589aedb6de5ee90b35efbd9f3abc0ff0..5bec33e5987a7658258b3a767d9c066b186d26e3 100644 (file)
@@ -31,7 +31,7 @@ Abstract:
   @param  GateWay               The nexthop address\r
 \r
   @return NULL if failed to allocate memeory, otherwise the newly created\r
   @param  GateWay               The nexthop address\r
 \r
   @return NULL if failed to allocate memeory, otherwise the newly created\r
-  @return route entry.\r
+          route entry.\r
 \r
 **/\r
 IP4_ROUTE_ENTRY *\r
 \r
 **/\r
 IP4_ROUTE_ENTRY *\r
@@ -83,7 +83,7 @@ Ip4FreeRouteEntry (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Allocate and initialize a IP4 route cache entry.\r
+  Allocate and initialize an IP4 route cache entry.\r
 \r
   @param  Dst                   The destination address\r
   @param  Src                   The source address\r
 \r
   @param  Dst                   The destination address\r
   @param  Src                   The source address\r
@@ -92,7 +92,7 @@ Ip4FreeRouteEntry (
                                 entries spawned from one route table entry.\r
 \r
   @return NULL if failed to allocate memory for the cache, other point\r
                                 entries spawned from one route table entry.\r
 \r
   @return NULL if failed to allocate memory for the cache, other point\r
-  @return to the created route cache entry.\r
+          to the created route cache entry.\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
@@ -154,7 +154,7 @@ Ip4FreeRouteCacheEntry (
 **/\r
 VOID\r
 Ip4InitRouteCache (\r
 **/\r
 VOID\r
 Ip4InitRouteCache (\r
-  IN IP4_ROUTE_CACHE        *RtCache\r
+  IN OUT IP4_ROUTE_CACHE        *RtCache\r
   )\r
 {\r
   UINT32                    Index;\r
   )\r
 {\r
   UINT32                    Index;\r
@@ -199,10 +199,8 @@ Ip4CleanRouteCache (
 /**\r
   Create an empty route table, includes its internal route cache\r
 \r
 /**\r
   Create an empty route table, includes its internal route cache\r
 \r
-  None\r
-\r
   @return NULL if failed to allocate memory for the route table, otherwise\r
   @return NULL if failed to allocate memory for the route table, otherwise\r
-  @return the point to newly created route table.\r
+          the point to newly created route table.\r
 \r
 **/\r
 IP4_ROUTE_TABLE *\r
 \r
 **/\r
 IP4_ROUTE_TABLE *\r
@@ -291,8 +289,8 @@ Ip4FreeRouteTable (
 **/\r
 VOID\r
 Ip4PurgeRouteCache (\r
 **/\r
 VOID\r
 Ip4PurgeRouteCache (\r
-  IN IP4_ROUTE_CACHE        *RtCache,\r
-  IN UINTN                  Tag\r
+  IN OUT IP4_ROUTE_CACHE        *RtCache,\r
+  IN     UINTN                  Tag\r
   )\r
 {\r
   LIST_ENTRY                *Entry;\r
   )\r
 {\r
   LIST_ENTRY                *Entry;\r
@@ -330,10 +328,10 @@ Ip4PurgeRouteCache (
 **/\r
 EFI_STATUS\r
 Ip4AddRoute (\r
 **/\r
 EFI_STATUS\r
 Ip4AddRoute (\r
-  IN IP4_ROUTE_TABLE        *RtTable,\r
-  IN IP4_ADDR               Dest,\r
-  IN IP4_ADDR               Netmask,\r
-  IN IP4_ADDR               Gateway\r
+  IN OUT IP4_ROUTE_TABLE        *RtTable,\r
+  IN     IP4_ADDR               Dest,\r
+  IN     IP4_ADDR               Netmask,\r
+  IN     IP4_ADDR               Gateway\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
@@ -392,10 +390,10 @@ Ip4AddRoute (
 **/\r
 EFI_STATUS\r
 Ip4DelRoute (\r
 **/\r
 EFI_STATUS\r
 Ip4DelRoute (\r
-  IN IP4_ROUTE_TABLE      *RtTable,\r
-  IN IP4_ADDR             Dest,\r
-  IN IP4_ADDR             Netmask,\r
-  IN IP4_ADDR             Gateway\r
+  IN OUT IP4_ROUTE_TABLE      *RtTable,\r
+  IN     IP4_ADDR             Dest,\r
+  IN     IP4_ADDR             Netmask,\r
+  IN     IP4_ADDR             Gateway\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
@@ -433,7 +431,7 @@ Ip4DelRoute (
   @param  Src                   The source address\r
 \r
   @return NULL if no route entry to the (Dest, Src). Otherwise the point\r
   @param  Src                   The source address\r
 \r
   @return NULL if no route entry to the (Dest, Src). Otherwise the point\r
-  @return to the correct route cache entry.\r
+          to the correct route cache entry.\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
@@ -464,8 +462,8 @@ Ip4FindRouteCache (
 \r
 /**\r
   Search the route table for a most specific match to the Dst. It searches\r
 \r
 /**\r
   Search the route table for a most specific match to the Dst. It searches\r
-  from the longest route area (mask length == 32) to the shortest route area (\r
-  default routes). In each route area, it will first search the instance's\r
+  from the longest route area (mask length == 32) to the shortest route area\r
+  (default routes). In each route area, it will first search the instance's\r
   route table, then the default route table. This is required by the following\r
   requirements:\r
   1. IP search the route table for a most specific match\r
   route table, then the default route table. This is required by the following\r
   requirements:\r
   1. IP search the route table for a most specific match\r
@@ -510,7 +508,7 @@ Ip4FindRouteEntry (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Search the route table to route the packet. Return/creat a route\r
+  Search the route table to route the packet. Return/create a route\r
   cache if there is a route to the destination.\r
 \r
   @param  RtTable               The route table to search from\r
   cache if there is a route to the destination.\r
 \r
   @param  RtTable               The route table to search from\r
@@ -518,7 +516,7 @@ Ip4FindRouteEntry (
   @param  Src                   The source address to search for\r
 \r
   @return NULL if failed to route packet, otherwise a route cache\r
   @param  Src                   The source address to search for\r
 \r
   @return NULL if failed to route packet, otherwise a route cache\r
-  @return entry that can be used to route packet.\r
+          entry that can be used to route packet.\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
@@ -562,9 +560,9 @@ Ip4Route (
 \r
   //\r
   // Found a route to the Dest, if it is a direct route, the packet\r
 \r
   //\r
   // Found a route to the Dest, if it is a direct route, the packet\r
-  // will be send directly to the destination, such as for connected\r
+  // will be sent directly to the destination, such as for connected\r
   // network. Otherwise, it is an indirect route, the packet will be\r
   // network. Otherwise, it is an indirect route, the packet will be\r
-  // send the next hop router.\r
+  // sent to the next hop router.\r
   //\r
   if ((RtEntry->Flag & IP4_DIRECT_ROUTE) != 0) {\r
     NextHop = Dest;\r
   //\r
   if ((RtEntry->Flag & IP4_DIRECT_ROUTE) != 0) {\r
     NextHop = Dest;\r
index f2173071a5d240c4ef3952bd227dd1872ebcb7c8..bc396f94b42bbd9a0a302bd395c974f561fccfbd 100644 (file)
@@ -35,13 +35,13 @@ typedef enum {
 \r
 #define IP4_ROUTE_CACHE_HASH(Dst, Src)  (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH)\r
 \r
 \r
 #define IP4_ROUTE_CACHE_HASH(Dst, Src)  (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH)\r
 \r
-//\r
-// The route entry in the route table. Dest/Netmask is the destion\r
-// network. The nexthop is the gateway to send the packet to in\r
-// order to reach the Dest/Netmask. If the Flag has IP4_DIRECT_ROUTE\r
-// on, the gateway is the destination of the IP packet itself. Route\r
-// enties of the connected network have the flag on.\r
-//\r
+///\r
+/// The route entry in the route table. Dest/Netmask is the destion\r
+/// network. The nexthop is the gateway to send the packet to in\r
+/// order to reach the Dest/Netmask. If the Flag has IP4_DIRECT_ROUTE\r
+/// on, the gateway is the destination of the IP packet itself. Route\r
+/// enties of the connected network have the flag on.\r
+///\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   INTN                      RefCnt;\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   INTN                      RefCnt;\r
@@ -51,16 +51,16 @@ typedef struct {
   UINT32                    Flag;\r
 } IP4_ROUTE_ENTRY;\r
 \r
   UINT32                    Flag;\r
 } IP4_ROUTE_ENTRY;\r
 \r
-//\r
-// The route cache entry. The route cache entry is optional.\r
-// But it is necessary to support the ICMP redirect message.\r
-// Check Ip4ProcessIcmpRedirect for information.\r
-//\r
-// The cache entry field Tag is used to tag all the route\r
-// cache entry spawned from a route table entry. This makes\r
-// it simple to delete all the route cache entries from a\r
-// to-be-deleted route entry.\r
-//\r
+///\r
+/// The route cache entry. The route cache entry is optional.\r
+/// But it is necessary to support the ICMP redirect message.\r
+/// Check Ip4ProcessIcmpRedirect for information.\r
+///\r
+/// The cache entry field Tag is used to tag all the route\r
+/// cache entry spawned from a route table entry. This makes\r
+/// it simple to delete all the route cache entries from a\r
+/// to-be-deleted route entry.\r
+///\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   INTN                      RefCnt;\r
 typedef struct {\r
   LIST_ENTRY                Link;\r
   INTN                      RefCnt;\r
@@ -70,25 +70,25 @@ typedef struct {
   UINTN                     Tag;\r
 } IP4_ROUTE_CACHE_ENTRY;\r
 \r
   UINTN                     Tag;\r
 } IP4_ROUTE_CACHE_ENTRY;\r
 \r
-//\r
-// The route cache table is organized as a hash table. Each\r
-// IP4 route table has a embedded route cache. For now the\r
-// route cache and route table are binded togehter. But keep\r
-// the route cache a seperated structure in case we want to\r
-// detach them later.\r
-//\r
+///\r
+/// The route cache table is organized as a hash table. Each\r
+/// IP4 route table has a embedded route cache. For now the\r
+/// route cache and route table are binded togehter. But keep\r
+/// the route cache a seperated structure in case we want to\r
+/// detach them later.\r
+///\r
 typedef struct {\r
   LIST_ENTRY                CacheBucket[IP4_ROUTE_CACHE_HASH];\r
 } IP4_ROUTE_CACHE;\r
 \r
 typedef struct {\r
   LIST_ENTRY                CacheBucket[IP4_ROUTE_CACHE_HASH];\r
 } IP4_ROUTE_CACHE;\r
 \r
-//\r
-// Each IP4 instance has its own route table. Each ServiceBinding\r
-// instance has a default route table and default address.\r
-//\r
-// All the route table entries with the same mask are linked\r
-// together in one route area. For example, RouteArea[0] contains\r
-// the default routes. A route table also contains a route cache.\r
-//\r
+///\r
+/// Each IP4 instance has its own route table. Each ServiceBinding\r
+/// instance has a default route table and default address.\r
+///\r
+/// All the route table entries with the same mask are linked\r
+/// together in one route area. For example, RouteArea[0] contains\r
+/// the default routes. A route table also contains a route cache.\r
+///\r
 typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE;\r
 \r
 struct _IP4_ROUTE_TABLE {\r
 typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE;\r
 \r
 struct _IP4_ROUTE_TABLE {\r