]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2005 - 2006, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | Ip4Option.h\r | |
16 | \r | |
17 | Abstract:\r | |
18 | \r | |
19 | IP4 option support routines.\r | |
20 | \r | |
21 | \r | |
22 | **/\r | |
23 | \r | |
24 | #ifndef __EFI_IP4_OPTION_H__\r | |
25 | #define __EFI_IP4_OPTION_H__\r | |
26 | \r | |
5405e9a6 | 27 | typedef enum {\r |
83cbd279 | 28 | IP4_OPTION_EOP = 0,\r |
29 | IP4_OPTION_NOP = 1,\r | |
30 | IP4_OPTION_LSRR = 131, // Loss source and record routing, 10000011\r | |
31 | IP4_OPTION_SSRR = 137, // Strict source and record routing, 10001001\r | |
32 | IP4_OPTION_RR = 7, // Record routing, 00000111\r | |
33 | \r | |
34 | IP4_OPTION_COPY_MASK = 0x80\r | |
5405e9a6 | 35 | } IP4_OPTION_ENUM_TYPES;\r |
83cbd279 | 36 | \r |
2ff29212 | 37 | /**\r |
38 | Validate the IP4 option format for both the packets we received\r | |
39 | and will transmit. It will compute the ICMP error message fields\r | |
40 | if the option is mal-formated. But this information isn't used.\r | |
41 | \r | |
42 | @param Option The first byte of the option\r | |
43 | @param OptionLen The length of the whole option\r | |
44 | @param Rcvd The option is from the packet we received if TRUE,\r | |
45 | otherwise the option we wants to transmit.\r | |
46 | \r | |
47 | @retval TRUE The option is properly formatted\r | |
48 | @retval FALSE The option is mal-formated\r | |
49 | \r | |
50 | **/\r | |
83cbd279 | 51 | BOOLEAN\r |
52 | Ip4OptionIsValid (\r | |
53 | IN UINT8 *Option,\r | |
2ff29212 | 54 | IN UINT32 OptionLen,\r |
83cbd279 | 55 | IN BOOLEAN Rcvd\r |
56 | );\r | |
57 | \r | |
2ff29212 | 58 | /**\r |
59 | Copy the option from the original option to buffer. It\r | |
60 | handles the details such as:\r | |
61 | 1. whether copy the single IP4 option to the first/non-first\r | |
62 | fragments.\r | |
63 | 2. Pad the options copied over to aligned to 4 bytes.\r | |
64 | \r | |
65 | @param Option The original option to copy from\r | |
66 | @param OptionLen The length of the original option\r | |
67 | @param FirstFragment Whether it is the first fragment\r | |
68 | @param Buf The buffer to copy options to. NULL \r | |
69 | @param BufLen The length of the buffer\r | |
70 | \r | |
71 | @retval EFI_SUCCESS The options are copied over\r | |
72 | @retval EFI_BUFFER_TOO_SMALL Buf is NULL or BufLen provided is too small.\r | |
73 | \r | |
74 | **/\r | |
83cbd279 | 75 | EFI_STATUS\r |
76 | Ip4CopyOption (\r | |
2ff29212 | 77 | IN UINT8 *Option,\r |
78 | IN UINT32 OptionLen,\r | |
79 | IN BOOLEAN FirstFragment,\r | |
80 | IN OUT UINT8 *Buf, OPTIONAL\r | |
83cbd279 | 81 | IN OUT UINT32 *BufLen\r |
82 | );\r | |
83 | #endif\r |