Changeset 105670 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
- Timestamp:
- Aug 14, 2024 1:16:30 PM (4 months ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-159268 /vendor/edk2/current 103735-103757,103769-103776,129194-164365
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
r99404 r105670 59 59 #define DHCP6_INSTANCE_FROM_THIS(Instance) CR ((Instance), DHCP6_INSTANCE, Dhcp6, DHCP6_INSTANCE_SIGNATURE) 60 60 #define DHCP6_SERVICE_FROM_THIS(Service) CR ((Service), DHCP6_SERVICE, ServiceBinding, DHCP6_SERVICE_SIGNATURE) 61 62 // 63 // For more information on DHCP options see RFC 8415, Section 21.1 64 // 65 // The format of DHCP options is: 66 // 67 // 0 1 2 3 68 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 69 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 70 // | option-code | option-len | 71 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 72 // | option-data | 73 // | (option-len octets) | 74 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 75 // 76 #define DHCP6_SIZE_OF_OPT_CODE (sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpCode)) 77 #define DHCP6_SIZE_OF_OPT_LEN (sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpLen)) 78 79 // Combined size of Code and Length 80 #define DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN (DHCP6_SIZE_OF_OPT_CODE + \ 81 DHCP6_SIZE_OF_OPT_LEN) 82 83 STATIC_ASSERT ( 84 DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN == 4, 85 "Combined size of Code and Length must be 4 per RFC 8415" 86 ); 87 88 // Offset to the length is just past the code 89 #define DHCP6_OFFSET_OF_OPT_LEN(a) (a + DHCP6_SIZE_OF_OPT_CODE) 90 STATIC_ASSERT ( 91 DHCP6_OFFSET_OF_OPT_LEN (0) == 2, 92 "Offset of length is + 2 past start of option" 93 ); 94 95 #define DHCP6_OFFSET_OF_OPT_DATA(a) (a + DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN) 96 STATIC_ASSERT ( 97 DHCP6_OFFSET_OF_OPT_DATA (0) == 4, 98 "Offset to option data should be +4 from start of option" 99 ); 100 // 101 // Identity Association options (both NA (Non-Temporary) and TA (Temporary Association)) 102 // are defined in RFC 8415 and are a deriviation of a TLV stucture 103 // For more information on IA_NA see Section 21.4 104 // For more information on IA_TA see Section 21.5 105 // 106 // 107 // The format of IA_NA and IA_TA option: 108 // 109 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 110 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 111 // | OPTION_IA_NA | option-len | 112 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 113 // | IAID (4 octets) | 114 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 115 // | T1 (only for IA_NA) | 116 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 117 // | T2 (only for IA_NA) | 118 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 119 // | | 120 // . IA_NA-options/IA_TA-options . 121 // . . 122 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 123 // 124 #define DHCP6_SIZE_OF_IAID (sizeof(UINT32)) 125 #define DHCP6_SIZE_OF_TIME_INTERVAL (sizeof(UINT32)) 126 127 // Combined size of IAID, T1, and T2 128 #define DHCP6_SIZE_OF_COMBINED_IAID_T1_T2 (DHCP6_SIZE_OF_IAID + \ 129 DHCP6_SIZE_OF_TIME_INTERVAL + \ 130 DHCP6_SIZE_OF_TIME_INTERVAL) 131 STATIC_ASSERT ( 132 DHCP6_SIZE_OF_COMBINED_IAID_T1_T2 == 12, 133 "Combined size of IAID, T1, T2 must be 12 per RFC 8415" 134 ); 135 136 // This is the size of IA_TA without options 137 #define DHCP6_MIN_SIZE_OF_IA_TA (DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \ 138 DHCP6_SIZE_OF_IAID) 139 STATIC_ASSERT ( 140 DHCP6_MIN_SIZE_OF_IA_TA == 8, 141 "Minimum combined size of IA_TA per RFC 8415" 142 ); 143 144 // Offset to a IA_TA inner option 145 #define DHCP6_OFFSET_OF_IA_TA_INNER_OPT(a) (a + DHCP6_MIN_SIZE_OF_IA_TA) 146 STATIC_ASSERT ( 147 DHCP6_OFFSET_OF_IA_TA_INNER_OPT (0) == 8, 148 "Offset of IA_TA Inner option is + 8 past start of option" 149 ); 150 151 // This is the size of IA_NA without options (16) 152 #define DHCP6_MIN_SIZE_OF_IA_NA DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \ 153 DHCP6_SIZE_OF_COMBINED_IAID_T1_T2 154 STATIC_ASSERT ( 155 DHCP6_MIN_SIZE_OF_IA_NA == 16, 156 "Minimum combined size of IA_TA per RFC 8415" 157 ); 158 159 #define DHCP6_OFFSET_OF_IA_NA_INNER_OPT(a) (a + DHCP6_MIN_SIZE_OF_IA_NA) 160 STATIC_ASSERT ( 161 DHCP6_OFFSET_OF_IA_NA_INNER_OPT (0) == 16, 162 "Offset of IA_NA Inner option is + 16 past start of option" 163 ); 164 165 #define DHCP6_OFFSET_OF_IA_NA_T1(a) (a + \ 166 DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN + \ 167 DHCP6_SIZE_OF_IAID) 168 STATIC_ASSERT ( 169 DHCP6_OFFSET_OF_IA_NA_T1 (0) == 8, 170 "Offset of IA_NA Inner option is + 8 past start of option" 171 ); 172 173 #define DHCP6_OFFSET_OF_IA_NA_T2(a) (a + \ 174 DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN +\ 175 DHCP6_SIZE_OF_IAID + \ 176 DHCP6_SIZE_OF_TIME_INTERVAL) 177 STATIC_ASSERT ( 178 DHCP6_OFFSET_OF_IA_NA_T2 (0) == 12, 179 "Offset of IA_NA Inner option is + 12 past start of option" 180 ); 181 182 // 183 // For more information see RFC 8415 Section 21.13 184 // 185 // The format of the Status Code Option: 186 // 187 // 0 1 2 3 188 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 189 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 190 // | OPTION_STATUS_CODE | option-len | 191 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 192 // | status-code | | 193 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 194 // . . 195 // . status-message . 196 // . . 197 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 198 // 199 #define DHCP6_OFFSET_OF_STATUS_CODE(a) (a + DHCP6_SIZE_OF_COMBINED_CODE_AND_LEN) 200 STATIC_ASSERT ( 201 DHCP6_OFFSET_OF_STATUS_CODE (0) == 4, 202 "Offset of status is + 4 past start of option" 203 ); 61 204 62 205 extern EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress;
Note:
See TracChangeset
for help on using the changeset viewer.