TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Option.h File Reference

Go to the source code of this file.

Macros

#define IP4_OPTION_EOP   0
 
#define IP4_OPTION_NOP   1
 
#define IP4_OPTION_LSRR   131
 
#define IP4_OPTION_SSRR   137
 
#define IP4_OPTION_RR   7
 
#define IP4_OPTION_COPY_MASK   0x80
 

Functions

BOOLEAN Ip4OptionIsValid (IN UINT8 *Option, IN UINT32 OptionLen, IN BOOLEAN Rcvd)
 
EFI_STATUS Ip4CopyOption (IN UINT8 *Option, IN UINT32 OptionLen, IN BOOLEAN FirstFragment, IN OUT UINT8 *Buf OPTIONAL, IN OUT UINT32 *BufLen)
 

Detailed Description

IP4 option support routines.

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip4Option.h.

Macro Definition Documentation

◆ IP4_OPTION_COPY_MASK

#define IP4_OPTION_COPY_MASK   0x80

Definition at line 18 of file Ip4Option.h.

◆ IP4_OPTION_EOP

#define IP4_OPTION_EOP   0

Definition at line 12 of file Ip4Option.h.

◆ IP4_OPTION_LSRR

#define IP4_OPTION_LSRR   131

Definition at line 14 of file Ip4Option.h.

◆ IP4_OPTION_NOP

#define IP4_OPTION_NOP   1

Definition at line 13 of file Ip4Option.h.

◆ IP4_OPTION_RR

#define IP4_OPTION_RR   7

Definition at line 16 of file Ip4Option.h.

◆ IP4_OPTION_SSRR

#define IP4_OPTION_SSRR   137

Definition at line 15 of file Ip4Option.h.

Function Documentation

◆ Ip4CopyOption()

EFI_STATUS Ip4CopyOption ( IN UINT8 *  Option,
IN UINT32  OptionLen,
IN BOOLEAN  FirstFragment,
IN OUT UINT8 *Buf  OPTIONAL,
IN OUT UINT32 *  BufLen 
)

Copy the option from the original option to buffer. It handles the details such as:

  1. whether copy the single IP4 option to the first/non-first fragments.
  2. Pad the options copied over to aligned to 4 bytes.
Parameters
[in]OptionThe original option to copy from
[in]OptionLenThe length of the original option
[in]FirstFragmentWhether it is the first fragment
[in,out]BufThe buffer to copy options to. NULL
[in,out]BufLenThe length of the buffer
Return values
EFI_SUCCESSThe options are copied over
EFI_BUFFER_TOO_SMALLBuf is NULL or BufLen provided is too small.

Definition at line 111 of file Ip4Option.c.

◆ Ip4OptionIsValid()

BOOLEAN Ip4OptionIsValid ( IN UINT8 *  Option,
IN UINT32  OptionLen,
IN BOOLEAN  Rcvd 
)

Validate the IP4 option format for both the packets we received and will transmit. It will compute the ICMP error message fields if the option is malformatted. But this information isn't used.

Parameters
[in]OptionThe first byte of the option
[in]OptionLenThe length of the whole option
[in]RcvdThe option is from the packet we received if TRUE, otherwise the option we wants to transmit.
Return values
TRUEThe option is properly formatted
FALSEThe option is malformatted

Validate the IP4 option format for both the packets we received and will transmit.

Parameters
[in]OptionThe first byte of the option
[in]OptionLenThe length of the whole option
[in]RcvdThe option is from the packet we received if TRUE, otherwise the option we wants to transmit.
Return values
TRUEThe option is properly formatted
FALSEThe option is malformatted

Definition at line 25 of file Ip4Option.c.