TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Option.c File Reference
#include "Ip4Impl.h"

Go to the source code of this file.

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 functions.

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

Definition in file Ip4Option.c.

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.

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.