37 while (Cur < OptionLen) {
38 switch (Option[Cur]) {
50 Len = Option[Cur + 1];
51 Point = Option[Cur + 2];
56 if ((OptionLen - Cur < Len) || (Len < 3) || ((Len - 3) % 4 != 0)) {
60 if ((Point > Len + 1) || (Point % 4 != 0)) {
69 if ((Option[Cur] != IP4_OPTION_RR) &&
70 ((Rcvd && (Point != Len + 1)) || (!Rcvd && (Point != 4))))
79 Len = Option[Cur + 1];
81 if ((OptionLen - Cur < Len) || (Len < 2)) {
114 IN BOOLEAN FirstFragment,
115 IN OUT UINT8 *Buf OPTIONAL,
116 IN OUT UINT32 *BufLen
125 ASSERT ((BufLen !=
NULL) && (OptionLen <= 40));
130 while (Cur < OptionLen) {
132 Len = Option[Cur + 1];
134 if (Type == IP4_OPTION_NOP) {
139 OptBuf[Next] = IP4_OPTION_NOP;
142 }
else if (Type == IP4_OPTION_EOP) {
151 if (FirstFragment || ((Type & IP4_OPTION_COPY_MASK) != 0)) {
152 CopyMem (OptBuf + Next, Option + Cur, Len);
172 if ((Next % 4) != 0) {
173 OptBuf[Next] = IP4_OPTION_EOP;
181 Len = ((Next + 3) &~0x03);
186 if ((Buf ==
NULL) || (*BufLen < Len)) {
188 return EFI_BUFFER_TOO_SMALL;
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS Ip4CopyOption(IN UINT8 *Option, IN UINT32 OptionLen, IN BOOLEAN FirstFragment, IN OUT UINT8 *Buf OPTIONAL, IN OUT UINT32 *BufLen)
BOOLEAN Ip4OptionIsValid(IN UINT8 *Option, IN UINT32 OptionLen, IN BOOLEAN Rcvd)