VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip4Dxe/Ip4Option.h@ 80721

Last change on this file since 80721 was 80721, checked in by vboxsync, 5 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/** @file
2 IP4 option support routines.
3
4Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __EFI_IP4_OPTION_H__
10#define __EFI_IP4_OPTION_H__
11
12#define IP4_OPTION_EOP 0
13#define IP4_OPTION_NOP 1
14#define IP4_OPTION_LSRR 131 // Loss source and record routing, 10000011
15#define IP4_OPTION_SSRR 137 // Strict source and record routing, 10001001
16#define IP4_OPTION_RR 7 // Record routing, 00000111
17
18#define IP4_OPTION_COPY_MASK 0x80
19
20/**
21 Validate the IP4 option format for both the packets we received
22 and will transmit. It will compute the ICMP error message fields
23 if the option is mal-formated. But this information isn't used.
24
25 @param[in] Option The first byte of the option
26 @param[in] OptionLen The length of the whole option
27 @param[in] Rcvd The option is from the packet we received if TRUE,
28 otherwise the option we wants to transmit.
29
30 @retval TRUE The option is properly formatted
31 @retval FALSE The option is mal-formated
32
33**/
34BOOLEAN
35Ip4OptionIsValid (
36 IN UINT8 *Option,
37 IN UINT32 OptionLen,
38 IN BOOLEAN Rcvd
39 );
40
41/**
42 Copy the option from the original option to buffer. It
43 handles the details such as:
44 1. whether copy the single IP4 option to the first/non-first
45 fragments.
46 2. Pad the options copied over to aligned to 4 bytes.
47
48 @param[in] Option The original option to copy from
49 @param[in] OptionLen The length of the original option
50 @param[in] FirstFragment Whether it is the first fragment
51 @param[in, out] Buf The buffer to copy options to. NULL
52 @param[in, out] BufLen The length of the buffer
53
54 @retval EFI_SUCCESS The options are copied over
55 @retval EFI_BUFFER_TOO_SMALL Buf is NULL or BufLen provided is too small.
56
57**/
58EFI_STATUS
59Ip4CopyOption (
60 IN UINT8 *Option,
61 IN UINT32 OptionLen,
62 IN BOOLEAN FirstFragment,
63 IN OUT UINT8 *Buf, OPTIONAL
64 IN OUT UINT32 *BufLen
65 );
66#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette