NetworkPkg/Ip6Dxe/Ip6Option.c File Reference


Functions

BOOLEAN Ip6IsOptionValid (IN IP6_SERVICE *IpSb, IN NET_BUF *Packet, IN UINT8 *Option, IN UINT8 OptionLen, IN UINT32 Pointer)
BOOLEAN Ip6IsNDOptionValid (IN UINT8 *Option, IN UINT16 OptionLen)
BOOLEAN Ip6IsValidProtocol (IN IP6_SERVICE *IpSb, IN UINT8 NextHeader)
BOOLEAN Ip6IsExtsValid (IN IP6_SERVICE *IpSb, IN NET_BUF *Packet, IN UINT8 *NextHeader, IN UINT8 *ExtHdrs, IN UINT32 ExtHdrsLen, IN BOOLEAN Rcvd, OUT UINT32 *FormerHeader, OUT UINT8 **LastHeader, OUT UINT32 *RealExtsLen, OUT UINT32 *UnFragmentLen, OUT BOOLEAN *Fragmented)
EFI_STATUS Ip6FillHopByHop (OUT UINT8 *Buffer, IN OUT UINTN *BufferLen, IN UINT8 NextHeader)
EFI_STATUS Ip6FillFragmentHeader (IN IP6_SERVICE *IpSb, IN UINT8 NextHeader, IN UINT8 LastHeader, IN UINT8 *ExtHdrs, IN UINT32 ExtHdrsLen, IN UINT16 FragmentOffset, OUT UINT8 **UpdatedExtHdrs)

Detailed Description

IP6 option support functions and routines.

Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

EFI_STATUS Ip6FillFragmentHeader ( IN IP6_SERVICE IpSb,
IN UINT8  NextHeader,
IN UINT8  LastHeader,
IN UINT8 *  ExtHdrs,
IN UINT32  ExtHdrsLen,
IN UINT16  FragmentOffset,
OUT UINT8 **  UpdatedExtHdrs 
)

Insert a Fragment Header to the Extension headers and output it in UpdatedExtHdrs.

Parameters:
[in] IpSb The IP6 service instance to transmit the packet.
[in] NextHeader The extension header type of first extension header.
[in] LastHeader The extension header type of last extension header.
[in] ExtHdrs The length of the original extension header.
[in] ExtHdrsLen The length of the extension headers.
[in] FragmentOffset The fragment offset of the data following the header.
[out] UpdatedExtHdrs The updated ExtHdrs with Fragment header inserted. It's caller's responsiblity to free this buffer.
Return values:
EFI_OUT_OF_RESOURCES Failed to finish the operation due to lake of resource.
EFI_UNSUPPORTED The extension header specified in ExtHdrs is not supported currently.
EFI_SUCCESS The operation performed successfully.

References _IP6_FRAGMENT_HEADER::FragmentOffset, _IP6_FRAGMENT_HEADER::Identification, IP6_FRAGMENT_OFFSET_MASK, Ip6IsValidProtocol(), mIp6Id, _IP6_FRAGMENT_HEADER::NextHeader, and _IP6_FRAGMENT_HEADER::Reserved.

Referenced by Ip6Output(), and Ip6PrependHead().

EFI_STATUS Ip6FillHopByHop ( OUT UINT8 *  Buffer,
IN OUT UINTN *  BufferLen,
IN UINT8  NextHeader 
)

Generate an IPv6 router alert option in network order and output it through Buffer.

Parameters:
[out] Buffer Points to a buffer to record the generated option.
[in,out] BufferLen The length of Buffer, in bytes.
[in] NextHeader The 8-bit selector indicates the type of header immediately following the Hop-by-Hop Options header.
Return values:
EFI_BUFFER_TOO_SMALL The Buffer is too small to contain the generated option. BufferLen is updated for the required size.
EFI_SUCCESS The option is generated and filled in to Buffer.

Referenced by Ip6SendMldDone(), and Ip6SendMldReport().

BOOLEAN Ip6IsExtsValid ( IN IP6_SERVICE IpSb,
IN NET_BUF *  Packet,
IN UINT8 *  NextHeader,
IN UINT8 *  ExtHdrs,
IN UINT32  ExtHdrsLen,
IN BOOLEAN  Rcvd,
OUT UINT32 *  FormerHeader,
OUT UINT8 **  LastHeader,
OUT UINT32 *  RealExtsLen,
OUT UINT32 *  UnFragmentLen,
OUT BOOLEAN *  Fragmented 
)

Validate the IP6 extension header format for both the packets we received and that we will transmit. It will compute the ICMPv6 error message fields if the option is mal-formated.

Parameters:
[in] IpSb The IP6 service instance. This is an optional parameter.
[in] Packet The data of the packet. Ignored if NULL.
[in] NextHeader The next header field in IPv6 basic header.
[in] ExtHdrs The first byte of the option.
[in] ExtHdrsLen The length of the whole option.
[in] Rcvd The option is from the packet we received if TRUE, otherwise, the option we want to transmit.
[out] FormerHeader The offset of NextHeader which points to Fragment Header when we received, of the ExtHdrs. Ignored if we transmit.
[out] LastHeader The pointer of NextHeader of the last extension header processed by IP6.
[out] RealExtsLen The length of extension headers processed by IP6 layer. This is an optional parameter that may be NULL.
[out] UnFragmentLen The length of unfragmented length of extension headers. This is an optional parameter that may be NULL.
[out] Fragmented Indicate whether the packet is fragmented. This is an optional parameter that may be NULL.
Return values:
TRUE The option is properly formated.
FALSE The option is malformated.

References _IP6_FRAGMENT_HEADER::FragmentOffset, _IP6_ROUTING_HEADER::HeaderLen, Ip6IsOptionValid(), Ip6IsValidProtocol(), Ip6SendIcmpError(), and _IP6_ROUTING_HEADER::SegmentsLeft.

Referenced by Ip6InstanceFrameAcceptable(), Ip6Output(), and Ip6PreProcessPacket().

BOOLEAN Ip6IsNDOptionValid ( IN UINT8 *  Option,
IN UINT16  OptionLen 
)

Validate the IP6 option format for both the packets we received and that we will transmit. It supports the defined options in Neighbor Discovery messages.

Parameters:
[in] Option The first byte of the option.
[in] OptionLen The length of the whole option.
Return values:
TRUE The option is properly formatted.
FALSE The option is malformated.

References Ip6OptionMtu, and Ip6OptionPrefixInfo.

Referenced by Ip6ProcessNeighborAdvertise(), Ip6ProcessNeighborSolicit(), Ip6ProcessRedirect(), and Ip6ProcessRouterAdvertise().

BOOLEAN Ip6IsOptionValid ( IN IP6_SERVICE IpSb,
IN NET_BUF *  Packet,
IN UINT8 *  Option,
IN UINT8  OptionLen,
IN UINT32  Pointer 
)

Validate the IP6 option format for both the packets we received and that we will transmit. It will compute the ICMPv6 error message fields if the option is malformated.

Parameters:
[in] IpSb The IP6 service data.
[in] Packet The to be validated packet.
[in] Option The first byte of the option.
[in] OptionLen The length of the whole option.
[in] Pointer Identifies the octet offset within the invoking packet where the error was detected.
Return values:
TRUE The option is properly formatted.
FALSE The option is malformated.

References Ip6OptionDiscard, Ip6OptionMask, Ip6OptionPad1, Ip6OptionPadN, Ip6OptionParameterProblem, Ip6OptionRouterAlert, Ip6OptionSkip, and Ip6SendIcmpError().

Referenced by Ip6IsExtsValid().

BOOLEAN Ip6IsValidProtocol ( IN IP6_SERVICE IpSb,
IN UINT8  NextHeader 
)

Validate whether the NextHeader is a known valid protocol or one of the user configured protocols from the upper layer.

Parameters:
[in] IpSb The IP6 service instance.
[in] NextHeader The next header field.
Return values:
TRUE The NextHeader is a known valid protocol or user configured.
FALSE The NextHeader is not a known valid protocol.

References _IP6_PROTOCOL::ConfigData, IP6_PROTOCOL_SIGNATURE, IP6_SERVICE_SIGNATURE, IP6_STATE_CONFIGED, and _IP6_PROTOCOL::State.

Referenced by Ip6FillFragmentHeader(), and Ip6IsExtsValid().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1