TODO drsuapi compressed
[wireshark-sm.git] / epan / dissectors / packet-dhcp.c
blob97f30b482be3577d188827824cb34568bd1ab1ca
1 /* packet-dhcp.c
2 * Routines for DHCP/BOOTP packet disassembly
4 * Copyright 1998, Gilbert Ramirez <gram@alumni.rice.edu>
5 * Copyright 2004, Thomas Anders <thomas.anders [AT] blue-cable.de>
7 * Added option field filters
8 * Copyright 2011, Michael Mann
10 * Added option 77 : RFC 3004 - The User Class Option for DHCP
11 * Added option 117 : RFC 2937 - The Name Service Search Option for DHCP
12 * Added option 119 : RFC 3397 - Dynamic Host Configuration Protocol (DHCP) Domain Search Option
13 * RFC 3396 - Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
14 * Improved opt 120 : Add support of RFC 3396 - Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
15 * Add support compression according to the encoding in Section 4.1.4 of RFC 1035 - DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION
18 * Copyright 2012, Jerome LAFORGE <jerome.laforge [AT] gmail.com>
20 * The information used comes from:
21 * RFC 951: Bootstrap Protocol
22 * RFC 1035: Domain Names - Implementation And Specification
23 * RFC 1497: BOOTP extensions
24 * RFC 1542: Clarifications and Extensions for the Bootstrap Protocol
25 * RFC 2131: Dynamic Host Configuration Protocol
26 * RFC 2132: DHCP Options and BOOTP Vendor Extensions
27 * RFC 2241: DHCP Options for Novell Directory Services
28 * RFC 2242: NetWare/IP Domain Name and Information
29 * RFC 2489: Procedure for Defining New DHCP Options
30 * RFC 2610: DHCP Options for Service Location Protocol
31 * RFC 2685: Virtual Private Networks Identifier
32 * RFC 2937: The Name Service Search Option for DHCP
33 * RFC 3004: The User Class Option for DHCP
34 * RFC 3046: DHCP Relay Agent Information Option
35 * RFC 3118: Authentication for DHCP Messages
36 * RFC 3203: DHCP reconfigure extension
37 * RFC 3315: Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
38 * RFC 3396: Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
39 * RFC 3397: Dynamic Host Configuration Protocol (DHCP) Domain Search Option
40 * RFC 3495: DHCP Option (122) for CableLabs Client Configuration
41 * RFC 3594: PacketCable Security Ticket Control Sub-Option (122.9)
42 * RFC 3442: Classless Static Route Option for DHCP version 4
43 * RFC 3825: Dynamic Host Configuration Protocol Option for Coordinate-based Location Configuration Information
44 * RFC 3925: Vendor-Identifying Vendor Options for Dynamic Host Configuration Protocol version 4 (DHCPv4)
45 * RFC 3942: Reclassifying DHCPv4 Options
46 * RFC 4174: The IPv4 Dynamic Host Configuration Protocol (DHCP) Option for the Internet Storage Name Service
47 * RFC 4243: Vendor-Specific Information Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Option
48 * RFC 4361: Node-specific Client Identifiers for Dynamic Host Configuration Protocol Version Four (DHCPv4)
49 * RFC 4388: Dynamic Host Configuration Protocol (DHCP) Leasequery
50 * RFC 4578: Dynamic Host Configuration Protocol (DHCP) Options for PXE
51 * RFC 4776: Dynamic Host Configuration Protocol (DHCPv4 and DHCPv6) Option for Civic Addresses Configuration Information
52 * RFC 5192: DHCP Options for Protocol for Carrying Authentication for Network Access (PANA) Authentication Agent
53 * RFC 5223: Discovering Location-to-Service Translation (LoST) Servers Using the Dynamic Host Configuration Protocol (DHCP)
54 * RFC 5417: CAPWAP Access Controller DHCP Option
55 * RFC 5969: IPv6 Rapid Deployment on IPv4 Infrastructures (6rd)
56 * RFC 6225: Dynamic Host Configuration Protocol Options for Coordinate-Based Location Configuration Information
57 * RFC 6607: Virtual Subnet Selection Options for DHCPv4 and DHCPv6
58 * RFC 6704: Forcerenew Nonce Authentication
59 * RFC 6731: Improved Recursive DNS Server Selection for Multi-Interfaced Nodes
60 * RFC 6926: DHCPv4 Bulk Leasequery
61 * RFC 7291: DHCP Options for the Port Control Protocol (PCP)
62 * RFC 7618: Dynamic Allocation of Shared IPv4 Addresses
63 * RFC 7710: Captive-Portal Identification Using DHCP or Router Advertisements (RAs)
64 * RFC 7724: Active DHCPv4 Lease Query
65 * RFC 7839: Access-Network-Identifier Option in DHCP
66 * RFC 8357: Generalized UDP Source Port for DHCP Relay
67 * RFC 8910: Captive-Portal Identification in DHCP and Router Advertisements (RAs)
68 * RFC 8925: IPv6-Only Preferred Option for DHCPv4
69 * RFC 8973: DDoS Open Threat Signaling (DOTS) Agent Discovery
70 * draft-ietf-dhc-fqdn-option-07.txt
71 * TFTP Server Address Option for DHCPv4 [draft-raj-dhc-tftp-addr-option-06.txt: https://tools.ietf.org/html/draft-raj-dhc-tftp-addr-option-06]
72 * BOOTP and DHCP Parameters
73 * https://www.iana.org/assignments/bootp-dhcp-parameters
74 * DOCSIS(TM) 2.0 Radio Frequency Interface Specification
75 * https://specification-search.cablelabs.com/radio-frequency-interface-specification-2
76 * DOCSIS(TM) 3.0 MAC and Upper Layer Protocols Interface Specification
77 * https://specification-search.cablelabs.com/CM-SP-MULPIv3.0
78 * PacketCable(TM) 1.0 MTA Device Provisioning Specification
79 * https://specification-search.cablelabs.com/packetcable-mta-device-provisioning-specification
80 * PacketCable(TM) 1.5 MTA Device Provisioning Specification
81 * https://specification-search.cablelabs.com/packetcable-1-5-mta-device-provisioning-specification
82 * PacketCable(TM) 2.0 E-UE Device Provisioning Data Model Specification
83 * https://specification-search.cablelabs.com/e-ue-provisioning-data-model-specification
84 * Business Services over DOCSIS(R) Layer 2 Virtual Private Networks
85 * https://specification-search.cablelabs.com/business-services-over-docsis-layer-2-virtual-private-networks
86 * CableHome(TM) 1.1 Specification
87 * https://web.archive.org/web/20060628173459/http://www.cablelabs.com/projects/cablehome/downloads/specs/CH-SP-CH1.1-I11-060407.pdf
88 * Broadband Forum TR-111
89 * https://web.archive.org/web/20150307135117/http://www.broadband-forum.org/technical/download/TR-111.pdf
90 * Boot Server Discovery Protocol (BSDP)
91 * https://opensource.apple.com/source/bootp/bootp-198.1/Documentation/BSDP.doc
92 * [MS-DHCPE] DHCPv4 Option Code 77 (0x4D) - User Class Option
93 * https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/fe8a2dd4-1e8c-4546-bacd-4ae10de02058
95 * * Copyright 2023, Colin McInnes <colin.mcinnes [AT] vecima.com>
96 * Added additional CableLabs Vendor Class IDs (Option 60) to CableLabs heuristic from:
97 * Remote PHY Specification
98 * https://www.cablelabs.com/specifications/CM-SP-R-PHY
99 * Flexible MAC Architecture System Specification
100 * https://www.cablelabs.com/specifications/CM-SP-FMA-SYS
101 * Data-Over-Cable Service Interface Specifications, eDOCSIS Specification
102 * https://www.cablelabs.com/specifications/CM-SP-eDOCSIS
103 * Data-Over-Cable Service Interface Specifications, IPv4 and IPv6 eRouter Specification
104 * https://www.cablelabs.com/specifications/CM-SP-eRouter
105 * OpenCable Tuning Resolver Interface Specification
106 * https://www.cablelabs.com/specifications/OC-SP-TRIF
107 * DPoE Demarcation Device Specification
108 * https://www.cablelabs.com/specifications/DPoE-SP-DEMARCv1.0
110 * Wireshark - Network traffic analyzer
111 * By Gerald Combs <gerald@wireshark.org>
112 * Copyright 1998 Gerald Combs
114 * SPDX-License-Identifier: GPL-2.0-or-later
118 * Some of the development of the DHCP/BOOTP protocol decoder was sponsored by
119 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
120 * CableLabs' specifications. Your license and use of this protocol decoder
121 * does not mean that you are licensed to use the CableLabs'
122 * specifications. If you have questions about this protocol, contact
123 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
124 * information.
128 #include "config.h"
130 #include <stdio.h> /* for sscanf() */
132 #include <epan/packet.h>
133 #include "packet-arp.h"
134 #include "packet-dns.h" /* for get_dns_name() */
135 #include <epan/addr_resolv.h>
136 #include <epan/prefs.h>
137 #include <epan/tap.h>
138 #include <epan/stat_tap_ui.h>
139 #include <epan/arptypes.h>
140 #include <epan/expert.h>
141 #include <epan/uat.h>
142 #include <epan/sminmpec.h>
143 #include <epan/tfs.h>
144 #include <wsutil/str_util.h>
145 #include <wsutil/strtoi.h>
146 #include <wsutil/array.h>
148 void proto_register_dhcp(void);
149 void proto_reg_handoff_dhcp(void);
151 static int dhcp_bootp_tap;
152 static int proto_dhcp;
153 static int hf_dhcp_type;
154 static int hf_dhcp_hw_type;
155 static int hf_dhcp_hw_len;
156 static int hf_dhcp_hops;
157 static int hf_dhcp_id;
158 static int hf_dhcp_secs;
159 static int hf_dhcp_flags;
160 static int hf_dhcp_flags_broadcast;
161 static int hf_dhcp_flags_reserved;
162 static int hf_dhcp_ip_client;
163 static int hf_dhcp_ip_your;
164 static int hf_dhcp_ip_server;
165 static int hf_dhcp_ip_relay;
166 static int hf_dhcp_hw_addr;
167 static int hf_dhcp_hw_addr_padding;
168 static int hf_dhcp_hw_ether_addr;
169 static int hf_dhcp_server;
170 static int hf_dhcp_file;
171 static int hf_dhcp_cookie;
172 static int hf_dhcp_vendor_specific_options;
173 static int hf_dhcp_bootp;
174 static int hf_dhcp_fqdn_flags;
175 static int hf_dhcp_fqdn_s;
176 static int hf_dhcp_fqdn_o;
177 static int hf_dhcp_fqdn_e;
178 static int hf_dhcp_fqdn_n;
179 static int hf_dhcp_fqdn_mbz;
180 static int hf_dhcp_fqdn_rcode1;
181 static int hf_dhcp_fqdn_rcode2;
182 static int hf_dhcp_fqdn_name;
183 static int hf_dhcp_fqdn_asciiname;
184 static int hf_dhcp_pkt_mta_cap_len;
185 static int hf_dhcp_pkt_mta_cap_type;
186 static int hf_dhcp_docsis_cm_cap_type;
187 static int hf_dhcp_docsis_cm_cap_len;
188 static int hf_dhcp_client_identifier_uuid;
189 static int hf_dhcp_client_id_iaid;
190 static int hf_dhcp_client_id_duid_type;
191 static int hf_dhcp_client_hardware_address;
192 static int hf_dhcp_client_identifier_duid_llt_hw_type;
193 static int hf_dhcp_client_identifier_duid_ll_hw_type;
194 static int hf_dhcp_client_identifier_time;
195 static int hf_dhcp_client_identifier_link_layer_address;
196 static int hf_dhcp_client_identifier_link_layer_address_ether;
197 static int hf_dhcp_client_identifier_enterprise_num;
198 static int hf_dhcp_client_identifier;
199 static int hf_dhcp_client_identifier_type;
200 static int hf_dhcp_client_identifier_undef;
201 static int hf_dhcp_option_type;
202 static int hf_dhcp_option_length;
203 static int hf_dhcp_option_value;
204 static int hf_dhcp_option_value_8;
205 static int hf_dhcp_option_value_16;
206 static int hf_dhcp_option_value_u32;
207 static int hf_dhcp_option_value_s_secs;
208 static int hf_dhcp_option_value_u_secs;
209 static int hf_dhcp_option_value_stringz;
210 static int hf_dhcp_option_value_ip_address;
211 static int hf_dhcp_option_value_boolean;
212 static int hf_dhcp_suboption_length;
214 static int hf_dhcp_option_padding; /* 0 */
215 static int hf_dhcp_option_subnet_mask; /* 1 */
216 static int hf_dhcp_option_time_offset; /* 2 */
217 static int hf_dhcp_option_router; /* 3 */
218 static int hf_dhcp_option_time_server; /* 4 */
219 static int hf_dhcp_option_name_server; /* 5 */
220 static int hf_dhcp_option_domain_name_server; /* 6 */
221 static int hf_dhcp_option_log_server; /* 7 */
222 static int hf_dhcp_option_quotes_server; /* 8 */
223 static int hf_dhcp_option_lpr_server; /* 9 */
224 static int hf_dhcp_option_impress_server; /* 10 */
225 static int hf_dhcp_option_resource_location_server; /* 11 */
226 static int hf_dhcp_option_hostname; /* 12 */
227 static int hf_dhcp_option_boot_file_size; /* 13 */
228 static int hf_dhcp_option_merit_dump_file; /* 14 */
229 static int hf_dhcp_option_domain_name; /* 15 */
230 static int hf_dhcp_option_swap_server; /* 16 */
231 static int hf_dhcp_option_root_path; /* 17 */
232 static int hf_dhcp_option_extension_path; /* 18 */
233 static int hf_dhcp_option_ip_forwarding; /* 19 */
234 static int hf_dhcp_option_non_local_source_routing; /* 20 */
235 static int hf_dhcp_option_policy_filter_ip; /* 21 - IP address */
236 static int hf_dhcp_option_policy_filter_subnet_mask; /* 21 - Subnet mask */
237 static int hf_dhcp_option_max_datagram_reassembly_size; /* 22 */
238 static int hf_dhcp_option_default_ip_ttl; /* 23 */
239 static int hf_dhcp_option_path_mtu_aging_timeout; /* 24 */
240 static int hf_dhcp_option_path_mtu_plateau_table_item; /* 25 */
241 static int hf_dhcp_option_interface_mtu; /* 26 */
242 static int hf_dhcp_option_all_subnets_are_local; /* 27 */
243 static int hf_dhcp_option_broadcast_address; /* 28 */
244 static int hf_dhcp_option_perform_mask_discovery; /* 29 */
245 static int hf_dhcp_option_mask_supplier; /* 30 */
246 static int hf_dhcp_option_perform_router_discover; /* 31 */
247 static int hf_dhcp_option_router_solicitation_address; /* 32 */
248 static int hf_dhcp_option_static_route_ip; /* 33 - Destination IP */
249 static int hf_dhcp_option_static_route_router; /* 33 - Router */
250 static int hf_dhcp_option_trailer_encapsulation; /* 34 */
251 static int hf_dhcp_option_arp_cache_timeout; /* 35 */
252 static int hf_dhcp_option_ethernet_encapsulation; /* 36 */
253 static int hf_dhcp_option_tcp_default_ttl; /* 37 */
254 static int hf_dhcp_option_tcp_keepalive_interval; /* 38 */
255 static int hf_dhcp_option_tcp_keepalive_garbage; /* 39 */
256 static int hf_dhcp_option_nis_domain; /* 40 */
257 static int hf_dhcp_option_nis_server; /* 41 */
258 static int hf_dhcp_option_ntp_server; /* 42 */
260 static int hf_dhcp_option43_suboption; /* 43 unknown vendor suboption */
261 static int hf_dhcp_option43_value; /* 43 suboption value */
262 static int hf_dhcp_option43_value_8; /* 43 suboption value */
263 static int hf_dhcp_option43_value_32; /* 43 suboption value */
264 static int hf_dhcp_option43_value_stringz; /* 43 suboption value */
265 static int hf_dhcp_option43_value_ip_address; /* 43 suboption value */
267 static int hf_dhcp_option43_pxeclient_suboption; /* 43 suboption */
268 static int hf_dhcp_option43_pxeclient_padding; /* 43:0 PXE */
269 static int hf_dhcp_option43_pxeclient_mtftp_ip; /* 43:1 PXE */
270 static int hf_dhcp_option43_pxeclient_mtftp_client_port; /* 43:2 PXE */
271 static int hf_dhcp_option43_pxeclient_mtftp_server_port; /* 43:3 PXE */
272 static int hf_dhcp_option43_pxeclient_mtftp_timeout; /* 43:4 PXE */
273 static int hf_dhcp_option43_pxeclient_mtftp_delay; /* 43:5 PXE */
274 static int hf_dhcp_option43_pxeclient_discovery_control; /* 43:6 PXE */
275 static int hf_dhcp_option43_pxeclient_discovery_control_bc; /* 43:6 PXE */
276 static int hf_dhcp_option43_pxeclient_discovery_control_mc; /* 43:6 PXE */
277 static int hf_dhcp_option43_pxeclient_discovery_control_serverlist; /* 43:6 PXE */
278 static int hf_dhcp_option43_pxeclient_discovery_control_bstrap; /* 43:6 PXE */
279 static int hf_dhcp_option43_pxeclient_multicast_address; /* 43:7 PXE */
280 static int hf_dhcp_option43_pxeclient_boot_servers; /* 43:8 PXE */
281 static int hf_dhcp_option43_pxeclient_boot_server_type; /* 43:8 PXE */
282 static int hf_dhcp_option43_pxeclient_boot_server_count; /* 43:8 PXE */
283 static int hf_dhcp_option43_pxeclient_boot_server_ip; /* 43:8 PXE */
284 static int hf_dhcp_option43_pxeclient_boot_menu; /* 43:9 PXE */
285 static int hf_dhcp_option43_pxeclient_boot_menu_type; /* 43:9 PXE */
286 static int hf_dhcp_option43_pxeclient_boot_menu_length; /* 43:9 PXE */
287 static int hf_dhcp_option43_pxeclient_boot_menu_desc; /* 43:9 PXE */
288 static int hf_dhcp_option43_pxeclient_menu_prompt; /* 43:10 PXE */
289 static int hf_dhcp_option43_pxeclient_menu_prompt_timeout; /* 43:10 PXE */
290 static int hf_dhcp_option43_pxeclient_menu_prompt_prompt; /* 43:10 PXE */
291 static int hf_dhcp_option43_pxeclient_multicast_address_alloc; /* 43:11 PXE */
292 static int hf_dhcp_option43_pxeclient_credential_types; /* 43:12 PXE */
293 static int hf_dhcp_option43_pxeclient_boot_item; /* 43:71 PXE */
294 static int hf_dhcp_option43_pxeclient_boot_item_type; /* 43:71 PXE */
295 static int hf_dhcp_option43_pxeclient_boot_item_layer; /* 43:71 PXE */
296 static int hf_dhcp_option43_pxeclient_lcm_server; /* 43:179 PXE */
297 static int hf_dhcp_option43_pxeclient_lcm_domain; /* 43:180 PXE */
298 static int hf_dhcp_option43_pxeclient_lcm_nic_option; /* 43:181 PXE */
299 static int hf_dhcp_option43_pxeclient_lcm_workgroup; /* 43:190 PXE */
300 static int hf_dhcp_option43_pxeclient_discovery; /* 43:191 PXE */
301 static int hf_dhcp_option43_pxeclient_configured; /* 43:192 PXE */
302 static int hf_dhcp_option43_pxeclient_lcm_version; /* 43:193 PXE */
303 static int hf_dhcp_option43_pxeclient_lcm_serial; /* 43:194 PXE */
304 static int hf_dhcp_option43_pxeclient_end; /* 43:255 PXE */
306 static int hf_dhcp_option43_cl_suboption; /* 43 suboption */
307 static int hf_dhcp_option43_cl_padding; /* 43:0 CL */
308 static int hf_dhcp_option43_cl_suboption_request_list; /* 43:1 CL */
309 static int hf_dhcp_option43_cl_device_type; /* 43:2 CL */
310 static int hf_dhcp_option43_cl_esafe_type; /* 43:3 CL */
311 static int hf_dhcp_option43_cl_serial_number; /* 43:4 CL */
312 static int hf_dhcp_option43_cl_hardware_version; /* 43:5 CL */
313 static int hf_dhcp_option43_cl_software_version; /* 43:6 CL */
314 static int hf_dhcp_option43_cl_boot_rom_version; /* 43:7 CL */
315 static int hf_dhcp_option43_cl_oui_bytes; /* 43:8 CL */
316 static int hf_dhcp_option43_cl_oui_string; /* 43:8 CL */
317 static int hf_dhcp_option43_cl_model_number; /* 43:9 CL */
318 static int hf_dhcp_option43_cl_vendor_name10; /* 43:10 CL */
319 static int hf_dhcp_option43_cl_address_realm; /* 43:11 CL */
320 static int hf_dhcp_option43_cl_cm_ps_system_desc; /* 43:12 CL */
321 static int hf_dhcp_option43_cl_cm_ps_firmware_revision; /* 43:13 CL */
322 static int hf_dhcp_option43_cl_firewall_policy_file_version; /* 43:14 CL */
323 static int hf_dhcp_option43_cl_esafe_config_file_devices; /* 43:15 CL */
324 static int hf_dhcp_option43_cl_video_security_tape; /* 43:18 CL */
325 static int hf_dhcp_option43_cl_mta_mac_address; /* 43:31 CL */
326 static int hf_dhcp_option43_cl_correlation_ID; /* 43:32 CL */
327 static int hf_dhcp_option43_cl_vendor_name51; /* 43:51 CL */
328 static int hf_dhcp_option43_cl_cablecard_capability; /* 43:52 CL */
329 static int hf_dhcp_option43_cl_device_id_ca; /* 43:53 CL */
330 static int hf_dhcp_option43_cl_device_id_x509; /* 43:54 CL */
331 static int hf_dhcp_option43_cl_end; /* 43:255 CL */
333 static int hf_dhcp_option43_aerohive_suboption; /* 43 suboption */
334 static int hf_dhcp_option43_aerohive_unknown; /* 43:X AEROHIVE */
335 static int hf_dhcp_option43_aerohive_xiqhostname; /* 43:225 AEROHIVE */
336 static int hf_dhcp_option43_aerohive_xiqipaddress; /* 43:226 AEROHIVE */
338 static int hf_dhcp_option43_bsdp_suboption; /* 43 suboption */
339 static int hf_dhcp_option43_bsdp_message_type; /* 43:1 BSDP */
340 static int hf_dhcp_option43_bsdp_version; /* 43:2 BSDP */
341 static int hf_dhcp_option43_bsdp_server_identifier; /* 43:3 BSDP */
342 static int hf_dhcp_option43_bsdp_server_priority; /* 43:4 BSDP */
343 static int hf_dhcp_option43_bsdp_reply_port; /* 43:5 BSDP */
344 static int hf_dhcp_option43_bsdp_boot_image_list_path; /* 43:6 BSDP */
345 static int hf_dhcp_option43_bsdp_default_boot_image_id; /* 43:7 BSDP */
346 static int hf_dhcp_option43_bsdp_selected_boot_image_id; /* 43:8 BSDP */
347 static int hf_dhcp_option43_bsdp_boot_image_list; /* 43:9 BSDP */
348 static int hf_dhcp_option43_bsdp_netboot_firmware; /* 43:10 BSDP */
349 static int hf_dhcp_option43_bsdp_attributes_filter_list; /* 43:11 BSDP */
350 static int hf_dhcp_option43_bsdp_message_size; /* 43:12 BSDP */
351 static int hf_dhcp_option43_bsdp_boot_image_index; /* 43 BSDP */
352 static int hf_dhcp_option43_bsdp_boot_image_attribute; /* 43 BSDP */
353 static int hf_dhcp_option43_bsdp_boot_image_attribute_install; /* 43 BSDP */
354 static int hf_dhcp_option43_bsdp_boot_image_attribute_kind; /* 43 BSDP */
355 static int hf_dhcp_option43_bsdp_boot_image_attribute_reserved; /* 43 BSDP */
356 static int hf_dhcp_option43_bsdp_image_desc; /* 43 BSDP */
357 static int hf_dhcp_option43_bsdp_boot_image_name; /* 43 BSDP */
358 static int hf_dhcp_option43_bsdp_boot_image_name_len; /* 43 BSDP */
360 static int hf_dhcp_option43_cisco_suboption; /* 43 Cisco */
361 static int hf_dhcp_option43_cisco_unknown; /* 43 Cisco */
362 static int hf_dhcp_option43_cisco_unknown1; /* 43:1 Cisco */
363 static int hf_dhcp_option43_cisco_unknown2; /* 43:2 Cisco */
364 static int hf_dhcp_option43_cisco_unknown3; /* 43:3 Cisco */
365 static int hf_dhcp_option43_cisco_nodeid; /* 43:4 Cisco */
366 static int hf_dhcp_option43_cisco_unknown5; /* 43:5 Cisco */
367 static int hf_dhcp_option43_cisco_unknown6; /* 43:6 Cisco */
368 static int hf_dhcp_option43_cisco_model; /* 43:7 Cisco */
369 static int hf_dhcp_option43_cisco_apicuuid; /* 43:8 Cisco */
370 static int hf_dhcp_option43_cisco_fabricname; /* 43:9 Cisco */
371 static int hf_dhcp_option43_cisco_unknown10; /* 43:10 Cisco */
372 static int hf_dhcp_option43_cisco_serialno; /* 43:11 Cisco */
373 static int hf_dhcp_option43_cisco_clientint; /* 43:12 Cisco */
375 static int hf_dhcp_option43_alcatel_suboption; /* 43 suboption */
376 static int hf_dhcp_option43_alcatel_padding; /* 43:0 Alcatel */
377 static int hf_dhcp_option43_alcatel_vlan_id; /* 43:58 Alcatel */
378 static int hf_dhcp_option43_alcatel_tftp1; /* 43:64 Alcatel */
379 static int hf_dhcp_option43_alcatel_tftp2; /* 43:65 Alcatel */
380 static int hf_dhcp_option43_alcatel_app_type; /* 43:66 Alcatel */
381 static int hf_dhcp_option43_alcatel_sip_url; /* 43:67 Alcatel */
382 static int hf_dhcp_option43_alcatel_end; /* 43:255 Alcatel */
384 static int hf_dhcp_option43_arubaap_controllerip; /* 43: ArubaAP*/
385 static int hf_dhcp_option43_arubaiap; /* 43: ArubaIAP*/
386 static int hf_dhcp_option43_arubaiap_nameorg; /* 43: ArubaIAP: Name Organisation*/
387 static int hf_dhcp_option43_arubaiap_ampip; /* 43: ArubaIAP: AMP IP Address*/
388 static int hf_dhcp_option43_arubaiap_password; /* 43 :ArubaIAP: Password*/
390 static int hf_dhcp_option_netbios_over_tcpip_name_server; /* 44 */
391 static int hf_dhcp_option_netbios_over_tcpip_dd_name_server; /* 45 */
392 static int hf_dhcp_option_netbios_over_tcpip_node_type; /* 46 */
393 static int hf_dhcp_option_netbios_over_tcpip_scope; /* 47 */
394 static int hf_dhcp_option_xwindows_system_font_server; /* 48 */
395 static int hf_dhcp_option_xwindows_system_display_manager; /* 49 */
396 static int hf_dhcp_option_requested_ip_address; /* 50 */
397 static int hf_dhcp_option_ip_address_lease_time; /* 51 */
398 static int hf_dhcp_option_option_overload; /* 52 */
399 static int hf_dhcp_option_dhcp; /* 53 */
400 static int hf_dhcp_option_dhcp_server_id; /* 54 */
401 static int hf_dhcp_option_parameter_request_list_item; /* 55 */
402 static int hf_dhcp_option_message; /* 56 */
403 static int hf_dhcp_option_dhcp_max_message_size; /* 57 */
404 static int hf_dhcp_option_renewal_time_value; /* 58 */
405 static int hf_dhcp_option_rebinding_time_value; /* 59 */
406 static int hf_dhcp_option_vendor_class_id; /* 60 */
407 static int hf_dhcp_option_vendor_class_data; /* 60 */
409 static int hf_dhcp_option_novell_netware_ip_domain; /* 62 */
411 static int hf_dhcp_option63_suboption; /* 63 suboption */
412 static int hf_dhcp_option63_value; /* 63 suboption value */
413 static int hf_dhcp_option63_value_8; /* 63 suboption value */
414 static int hf_dhcp_option63_value_ip_address; /* 63 suboption value */
415 static int hf_dhcp_option63_value_boolean; /* 63 suboption value */
416 static int hf_dhcp_option63_broadcast; /* 63:5 */
417 static int hf_dhcp_option63_preferred_dss_server; /* 63:6 */
418 static int hf_dhcp_option63_nearest_nwip_server; /* 63:7 */
419 static int hf_dhcp_option63_autoretries; /* 63:8 */
420 static int hf_dhcp_option63_autoretry_delay; /* 63:9 */
421 static int hf_dhcp_option63_support_netware_v1_1; /* 63:10 */
422 static int hf_dhcp_option63_primary_dss; /* 63:11 */
424 static int hf_dhcp_option_nis_plus_domain; /* 64 */
425 static int hf_dhcp_option_nis_plus_server; /* 65 */
426 static int hf_dhcp_option_tftp_server_name; /* 66 */
427 static int hf_dhcp_option_bootfile_name; /* 67 */
428 static int hf_dhcp_option_mobile_ip_home_agent; /* 68 */
429 static int hf_dhcp_option_smtp_server; /* 69 */
430 static int hf_dhcp_option_pop3_server; /* 70 */
431 static int hf_dhcp_option_nntp_server; /* 71 */
432 static int hf_dhcp_option_default_www_server; /* 72 */
433 static int hf_dhcp_option_default_finger_server; /* 73 */
434 static int hf_dhcp_option_default_irc_server; /* 74 */
435 static int hf_dhcp_option_streettalk_server; /* 75 */
436 static int hf_dhcp_option_streettalk_da_server; /* 76 */
437 static int hf_dhcp_option77_user_class; /* 77 User Class instance */
438 static int hf_dhcp_option77_user_class_length; /* 77 length of User Class instance */
439 static int hf_dhcp_option77_user_class_data; /* 77 data of User Class instance */
440 static int hf_dhcp_option77_user_class_text; /* 77 User class text */
441 static int hf_dhcp_option77_user_class_binary_data_length; /* 77, Microsoft */
442 static int hf_dhcp_option77_user_class_binary_data; /* 77, Microsoft */
443 static int hf_dhcp_option77_user_class_padding; /* 77, Microsoft */
444 static int hf_dhcp_option77_user_class_name_length; /* 77, Microsoft */
445 static int hf_dhcp_option77_user_class_name; /* 77, Microsoft */
446 static int hf_dhcp_option77_user_class_description_length; /* 77, Microsoft */
447 static int hf_dhcp_option77_user_class_description; /* 77, Microsoft */
448 static int hf_dhcp_option_slp_directory_agent_value; /* 78 */
449 static int hf_dhcp_option_slp_directory_agent_slpda_address; /* 78 */
450 static int hf_dhcp_option_slp_service_scope_value; /* 79 */
451 static int hf_dhcp_option_slp_service_scope_string; /* 79 */
453 static int hf_dhcp_option82_suboption; /* 82 suboption */
454 static int hf_dhcp_option82_value; /* 82 suboption value */
455 static int hf_dhcp_option82_value_8; /* 82 suboption value */
456 static int hf_dhcp_option82_value_16; /* 82 suboption value */
457 static int hf_dhcp_option82_value_32; /* 82 suboption value */
458 static int hf_dhcp_option82_value_ip_address; /* 82 suboption value */
459 static int hf_dhcp_option82_value_stringz; /* 82 suboption value */
460 static int hf_dhcp_option82_padding; /* 82:0 */
461 static int hf_dhcp_option82_agent_circuit_id; /* 82:1 */
462 static int hf_dhcp_option82_agent_remote_id; /* 82:2 */
463 static int hf_dhcp_option82_reserved; /* 82:3 */
464 static int hf_dhcp_option82_docsis_device_class; /* 82:4 */
465 static int hf_dhcp_option82_link_selection; /* 82:5 */
466 static int hf_dhcp_option82_subscriber_id; /* 82:6 */
467 static int hf_dhcp_option82_radius_attributes; /* 82:7 */
468 static int hf_dhcp_option82_authentication; /* 82:8 */
469 static int hf_dhcp_option82_vi; /* 82:9 */
470 /* 82:9 suboptions */
471 static int hf_dhcp_option82_vi_enterprise;
472 static int hf_dhcp_option82_vi_data_length;
473 static int hf_dhcp_option82_vi_cl_option;
474 static int hf_dhcp_option82_vi_cl_option_length;
475 static int hf_dhcp_option82_vi_cl_tag;
476 static int hf_dhcp_option82_vi_cl_tag_length;
477 static int hf_dhcp_option82_vi_cl_docsis_version; /* 82:9:4491:1 */
478 static int hf_dhcp_option82_vi_cl_dpoe_system_version; /* 82:9:4491:2 */
479 static int hf_dhcp_option82_vi_cl_dpoe_system_pbb_service; /* 82:9:4491:4 */
480 static int hf_dhcp_option82_vi_cl_service_class_name; /* 82:9:4491:5 */
481 static int hf_dhcp_option82_vi_cl_mso_defined_text; /* 82:9:4491:6 */
482 static int hf_dhcp_option82_vi_cl_secure_file_transfer_uri; /* 82:9:4491:7 */
483 /* 82:9 suboptions end */
484 static int hf_dhcp_option82_flags; /* 82:10 */
485 static int hf_dhcp_option82_server_id_override; /* 82:11 */
486 static int hf_dhcp_option82_relay_agent_id; /* 82:12 */
487 static int hf_dhcp_option82_option_ani_att; /* 82:13 */
488 static int hf_dhcp_option82_option_ani_att_res;
489 static int hf_dhcp_option82_option_ani_att_att;
490 static int hf_dhcp_option82_option_ani_network_name; /* 82:14 */
491 static int hf_dhcp_option82_option_ani_ap_name; /* 82:15 */
492 static int hf_dhcp_option82_option_ani_ap_bssid; /* 82:16 */
493 static int hf_dhcp_option82_option_ani_operator_id; /* 82:17 */
494 static int hf_dhcp_option82_option_ani_operator_realm; /* 82:18 */
495 static int hf_dhcp_option82_option_source_port; /* 82:19 */
496 static int hf_dhcp_option82_link_selection_cisco; /* 82:150 */
497 static int hf_dhcp_option82_vrf_name_vpn_id; /* 82:151 */
498 /* 82:151 suboptions */
499 static int hf_dhcp_option82_vrf_name_global;
500 static int hf_dhcp_option82_vrf_name;
501 static int hf_dhcp_option82_vrf_name_vpn_id_oui;
502 static int hf_dhcp_option82_vrf_name_vpn_id_index;
503 /* 82:151 suboptions end */
504 static int hf_dhcp_option82_server_id_override_cisco; /* 82:152 */
506 static int hf_dhcp_option_isns_functions;
507 static int hf_dhcp_option_isns_functions_enabled;
508 static int hf_dhcp_option_isns_functions_dd_authorization;
509 static int hf_dhcp_option_isns_functions_sec_policy_distibution;
510 static int hf_dhcp_option_isns_functions_reserved;
512 static int hf_dhcp_option_isns_discovery_domain_access;
513 static int hf_dhcp_option_isns_discovery_domain_access_enabled;
514 static int hf_dhcp_option_isns_discovery_domain_access_control_node;
515 static int hf_dhcp_option_isns_discovery_domain_access_iscsi_target;
516 static int hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator;
517 static int hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port;
518 static int hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port;
519 static int hf_dhcp_option_isns_discovery_domain_access_reserved;
521 static int hf_dhcp_option_isns_administrative_flags;
522 static int hf_dhcp_option_isns_administrative_flags_enabled;
523 static int hf_dhcp_option_isns_administrative_flags_heartbeat;
524 static int hf_dhcp_option_isns_administrative_flags_management_scns;
525 static int hf_dhcp_option_isns_administrative_flags_default_dd;
526 static int hf_dhcp_option_isns_administrative_flags_reserved;
528 static int hf_dhcp_option_isns_server_security_bitmap;
529 static int hf_dhcp_option_isns_server_security_bitmap_enabled;
530 static int hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled;
531 static int hf_dhcp_option_isns_server_security_bitmap_main_mode;
532 static int hf_dhcp_option_isns_server_security_bitmap_aggressive_mode;
533 static int hf_dhcp_option_isns_server_security_bitmap_pfs;
534 static int hf_dhcp_option_isns_server_security_bitmap_transport_mode;
535 static int hf_dhcp_option_isns_server_security_bitmap_tunnel_mode;
536 static int hf_dhcp_option_isns_server_security_bitmap_reserved;
538 static int hf_dhcp_option_isns_heartbeat_originator_addr;
539 static int hf_dhcp_option_isns_primary_server_addr;
540 static int hf_dhcp_option_isns_secondary_server_addr_list;
542 static int hf_dhcp_option_novell_dss_string; /* 85 */
543 static int hf_dhcp_option_novell_dss_ip; /* 85 */
544 static int hf_dhcp_option_novell_ds_tree_name; /* 86 */
545 static int hf_dhcp_option_novell_ds_context; /* 87 */
546 static int hf_dhcp_option_dhcp_authentication_protocol; /* 90 */
547 static int hf_dhcp_option_dhcp_authentication_alg_delay; /* 90 */
548 static int hf_dhcp_option_dhcp_authentication_algorithm; /* 90 */
549 static int hf_dhcp_option_dhcp_authentication_rdm; /* 90 */
550 static int hf_dhcp_option_dhcp_authentication_rdm_replay_detection; /* 90 */
551 static int hf_dhcp_option_dhcp_authentication_rdm_rdv; /* 90 */
552 static int hf_dhcp_option_dhcp_authentication_secret_id; /* 90 */
553 static int hf_dhcp_option_dhcp_authentication_hmac_md5_hash; /* 90 */
554 static int hf_dhcp_option_dhcp_authentication_information; /* 90 */
555 static int hf_dhcp_option_client_last_transaction_time; /* 91 */
556 static int hf_dhcp_option_associated_ip_option; /* 92 */
557 static int hf_dhcp_option_client_system_architecture; /* 93 */
558 static int hf_dhcp_option_client_network_id_major_ver; /* 94 */
559 static int hf_dhcp_option_client_network_id_minor_ver; /* 94 */
560 static int hf_dhcp_option_civic_location_what; /* 99 */
561 static int hf_dhcp_option_civic_location_country; /* 99 */
562 static int hf_dhcp_option_civic_location_ca_type; /* 99 */
563 static int hf_dhcp_option_civic_location_ca_length; /* 99 */
564 static int hf_dhcp_option_civic_location_ca_value; /* 99 */
565 static int hf_dhcp_option_tz_pcode; /* 100 */
566 static int hf_dhcp_option_tz_tcode; /* 101 */
567 static int hf_dhcp_option_ipv6_only_preferred_wait_time; /* 108 */
568 static int hf_dhcp_option_netinfo_parent_server_address; /* 112 */
569 static int hf_dhcp_option_netinfo_parent_server_tag; /* 113 */
570 static int hf_dhcp_option_captive_portal; /* 114 (ex 160) */
571 static int hf_dhcp_option_dhcp_auto_configuration; /* 116 */
572 static int hf_dhcp_option_dhcp_name_service_search_option; /* 117 */
573 static int hf_dhcp_option_dhcp_dns_domain_search_list_rfc_3396_detected; /* 119 */
574 static int hf_dhcp_option_dhcp_dns_domain_search_list_refer_last_option; /* 119 */
575 static int hf_dhcp_option_dhcp_dns_domain_search_list_fqdn; /* 119 */
576 static int hf_dhcp_option_sip_server_rfc_3396_detected; /* 120 */
577 static int hf_dhcp_option_sip_server_refer_last_option; /* 120 */
578 static int hf_dhcp_option_sip_server_enc; /* 120 */
579 static int hf_dhcp_option_sip_server_name; /* 120 */
580 static int hf_dhcp_option_sip_server_address; /* 120 */
581 static int hf_dhcp_option_classless_static_route; /* 120 */
582 static int hf_dhcp_option_rfc3825_error; /* 123 */
583 static int hf_dhcp_option_rfc3825_latitude; /* 123 */
584 static int hf_dhcp_option_rfc3825_longitude; /* 123 */
585 static int hf_dhcp_option_rfc3825_latitude_res; /* 123 */
586 static int hf_dhcp_option_rfc3825_longitude_res; /* 123 */
587 static int hf_dhcp_option_rfc3825_altitude; /* 123 */
588 static int hf_dhcp_option_rfc3825_altitude_res; /* 123 */
589 static int hf_dhcp_option_rfc3825_altitude_type; /* 123 */
590 static int hf_dhcp_option_rfc3825_map_datum; /* 123 */
591 static int hf_dhcp_option_cl_dss_id_option; /* 123 CL */
592 static int hf_dhcp_option_cl_dss_id_len; /* 123 CL */
593 static int hf_dhcp_option_cl_dss_id; /* 123 CL */
594 static int hf_dhcp_option_vi_class_cl_address_mode; /* 124 */
595 static int hf_dhcp_option_vi_class_enterprise; /* 124 */
596 static int hf_dhcp_option_vi_class_data_length; /* 124 */
597 static int hf_dhcp_option_vi_class_data_item_length; /* 124 */
598 static int hf_dhcp_option_vi_class_data_item_data; /* 124 */
600 static int hf_dhcp_option125_enterprise;
601 static int hf_dhcp_option125_length;
602 static int hf_dhcp_option125_value; /* 125 suboption value */
603 static int hf_dhcp_option125_value_8; /* 125 suboption value */
604 static int hf_dhcp_option125_value_16; /* 125 suboption value */
605 static int hf_dhcp_option125_value_ip_address; /* 125 suboption value */
606 static int hf_dhcp_option125_value_stringz; /* 125 suboption value */
607 static int hf_dhcp_option125_tr111_suboption; /* 125 suboption */
608 static int hf_dhcp_option125_tr111_device_manufacturer_oui; /* 125:TR-111 1 */
609 static int hf_dhcp_option125_tr111_device_serial_number; /* 125:TR-111 2 */
610 static int hf_dhcp_option125_tr111_device_product_class; /* 125:TR-111 3 */
611 static int hf_dhcp_option125_tr111_gateway_manufacturer_oui; /* 125:TR-111 4 */
612 static int hf_dhcp_option125_tr111_gateway_serial_number; /* 125:TR-111 5 */
613 static int hf_dhcp_option125_tr111_gateway_product_class; /* 125:TR-111 6 */
614 static int hf_dhcp_option125_cl_suboption; /* 125 suboption */
615 static int hf_dhcp_option125_cl_option_request; /* 125:CL 1 */
616 static int hf_dhcp_option125_cl_tftp_server_addresses; /* 125:CL 2 */
617 static int hf_dhcp_option125_cl_erouter_container_option; /* 125:CL 3 */
618 static int hf_dhcp_option125_cl_mib_environment_indicator_option; /* 125:CL 4 */
619 static int hf_dhcp_option125_cl_modem_capabilities; /* 125:CL 5 */
621 static int hf_dhcp_option_subnet_selection_option; /* 118 */
622 static int hf_dhcp_option_pana_agent; /* 136 */
623 static int hf_dhcp_option_lost_server_domain_name; /* 137 */
624 static int hf_dhcp_option_capwap_access_controller; /* 138 */
625 static int hf_dhcp_option_andsf_server; /* 142 */
626 static int hf_dhcp_option_forcerenew_nonce_algo; /* 145 */
627 static int hf_dhcp_option_rdnss_reserved; /* 146 */
628 static int hf_dhcp_option_rdnss_pref; /* 146 */
629 static int hf_dhcp_option_rdnss_prim_dns_server; /* 146 */
630 static int hf_dhcp_option_rdnss_sec_dns_server; /* 146 */
631 static int hf_dhcp_option_rdnss_domain; /* 146 */
632 static int hf_dhcp_option_dots_ri; /* 147 */
633 static int hf_dhcp_option_dots_address; /* 148 */
634 static int hf_dhcp_option_tftp_server_address; /* 150 */
635 static int hf_dhcp_option_bulk_lease_status_code; /* 151 */
636 static int hf_dhcp_option_bulk_lease_status_message; /* 151 */
637 static int hf_dhcp_option_bulk_lease_base_time; /* 152 */
638 static int hf_dhcp_option_bulk_lease_start_time_of_state; /* 153 */
639 static int hf_dhcp_option_bulk_lease_query_start; /* 154 */
640 static int hf_dhcp_option_bulk_lease_query_end; /* 155 */
641 static int hf_dhcp_option_bulk_lease_dhcp_state; /* 156 */
642 static int hf_dhcp_option_bulk_lease_data_source; /* 157 */
643 static int hf_dhcp_option_pcp_list_length; /* 158 */
644 static int hf_dhcp_option_pcp_server; /* 158 */
645 static int hf_dhcp_option_portparams_offset; /* 159 */
646 static int hf_dhcp_option_portparams_psid_length; /* 159 */
647 static int hf_dhcp_option_portparams_psid; /* 159 */
648 static int hf_dhcp_option_mudurl; /* 161 */
649 static int hf_dhcp_option_pxe_config_file; /* 209 */
650 static int hf_dhcp_option_pxe_path_prefix; /* 210 */
651 static int hf_dhcp_option_pxe_reboot_time; /* 211 */
652 static int hf_dhcp_option_6RD_ipv4_mask_len; /* 212 */
653 static int hf_dhcp_option_6RD_prefix_len; /* 212 */
654 static int hf_dhcp_option_6RD_prefix; /* 212 */
655 static int hf_dhcp_option_6RD_border_relay_ip; /* 212 */
656 static int hf_dhcp_option242_avaya; /* 242 */
657 static int hf_dhcp_option242_avaya_tlssrvr; /* 242 */
658 static int hf_dhcp_option242_avaya_httpsrvr; /* 242 */
659 static int hf_dhcp_option242_avaya_httpdir; /* 242 */
660 static int hf_dhcp_option242_avaya_static; /* 242 */
661 static int hf_dhcp_option242_avaya_mcipadd; /* 242 */
662 static int hf_dhcp_option242_avaya_dot1x; /* 242 */
663 static int hf_dhcp_option242_avaya_icmpdu; /* 242 */
664 static int hf_dhcp_option242_avaya_icmpred; /* 242 */
665 static int hf_dhcp_option242_avaya_l2q; /* 242 */
666 static int hf_dhcp_option242_avaya_l2qvlan; /* 242 */
667 static int hf_dhcp_option242_avaya_loglocal; /* 242 */
668 static int hf_dhcp_option242_avaya_phy1stat; /* 242 */
669 static int hf_dhcp_option242_avaya_phy2stat; /* 242 */
670 static int hf_dhcp_option242_avaya_procpswd; /* 242 */
671 static int hf_dhcp_option242_avaya_procstat; /* 242 */
672 static int hf_dhcp_option242_avaya_snmpadd; /* 242 */
673 static int hf_dhcp_option242_avaya_snmpstring; /* 242 */
674 static int hf_dhcp_option242_avaya_vlantest; /* 242 */
675 static int hf_dhcp_option_private_proxy_autodiscovery; /* 252 */
676 static int hf_dhcp_option_end; /* 255 */
677 static int hf_dhcp_option_end_overload; /* 255 (with overload)*/
678 static int hf_dhcp_vendor_unknown_suboption;
679 static int hf_dhcp_suboption_data;
680 static int hf_dhcp_pc_ietf_ccc_suboption;
681 static int hf_dhcp_pc_i05_ccc_suboption;
683 static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout;
684 static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout;
685 static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries;
686 static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout;
687 static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout;
688 static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries;
690 static int ett_dhcp;
691 static int ett_dhcp_flags;
692 static int ett_dhcp_option;
693 static int ett_dhcp_option43_suboption;
694 static int ett_dhcp_option43_suboption_discovery;
695 static int ett_dhcp_option43_suboption_tree;
696 static int ett_dhcp_option63_suboption;
697 static int ett_dhcp_option77_instance;
698 static int ett_dhcp_option82_suboption;
699 static int ett_dhcp_option82_suboption9;
700 static int ett_dhcp_option124_vendor_class_data_item;
701 static int ett_dhcp_option125_suboption;
702 static int ett_dhcp_option125_tr111_suboption;
703 static int ett_dhcp_option125_cl_suboption;
704 static int ett_dhcp_option242_suboption;
705 static int ett_dhcp_fqdn;
706 static int ett_dhcp_fqdn_flags;
707 static int ett_dhcp_filename_option;
708 static int ett_dhcp_server_hostname;
709 static int ett_dhcp_isns_functions;
710 static int ett_dhcp_isns_discovery_domain_access;
711 static int ett_dhcp_isns_administrative_flags;
712 static int ett_dhcp_isns_server_security_bitmap;
713 static int ett_dhcp_isns_secondary_server_addr;
714 static int ett_dhcp_o43_bsdp_boot_image;
715 static int ett_dhcp_o43_bsdp_attributes;
716 static int ett_dhcp_o43_bsdp_image_desc_list;
717 static int ett_dhcp_o43_bsdp_image_desc;
718 static int ett_dhcp_o43_bsdp_attributes_flags;
719 static int ett_dhcp_option158_pcp_list;
721 static expert_field ei_dhcp_bad_length;
722 static expert_field ei_dhcp_bad_bitfield;
723 static expert_field ei_dhcp_missing_subopt_length;
724 static expert_field ei_dhcp_missing_subopt_value;
725 static expert_field ei_dhcp_mal_duid;
726 static expert_field ei_dhcp_opt_overload_file_end_missing;
727 static expert_field ei_dhcp_opt_overload_sname_end_missing;
728 static expert_field ei_dhcp_subopt_unknown_type;
729 static expert_field ei_dhcp_option_civic_location_bad_cattype;
730 static expert_field ei_dhcp_option_dhcp_name_service_invalid;
731 static expert_field ei_dhcp_option_sip_server_address_encoding;
732 static expert_field ei_dhcp_option_classless_static_route;
733 static expert_field ei_dhcp_option125_enterprise_malformed;
734 static expert_field ei_dhcp_option_6RD_malformed;
735 static expert_field ei_dhcp_option82_vi_cl_tag_unknown;
736 static expert_field ei_dhcp_option_parse_err;
737 static expert_field ei_dhcp_nonstd_option_data;
738 static expert_field ei_dhcp_suboption_invalid;
739 static expert_field ei_dhcp_secs_le;
740 static expert_field ei_dhcp_end_option_missing;
741 static expert_field ei_dhcp_client_address_not_given;
742 static expert_field ei_dhcp_server_name_overloaded_by_dhcp;
743 static expert_field ei_dhcp_boot_filename_overloaded_by_dhcp;
744 static expert_field ei_dhcp_option_isns_ignored_bitfield;
745 static expert_field ei_dhcp_option242_avaya_l2qvlan_invalid;
746 static expert_field ei_dhcp_option242_avaya_vlantest_invalid;
747 static expert_field ei_dhcp_option93_client_arch_ambiguous;
749 static dissector_table_t dhcp_option_table;
750 static dissector_table_t dhcp_enterprise_class_table;
751 static dissector_table_t dhcp_enterprise_specific_table;
752 static heur_dissector_list_t dhcp_vendor_id_subdissector;
753 static heur_dissector_list_t dhcp_vendor_info_subdissector;
754 static dissector_handle_t dhcp_handle;
755 static dissector_handle_t dhcpopt_basic_handle;
757 typedef struct dhcp_option_data
759 unsigned char option;
760 uint8_t *overload;
761 tvbuff_t *orig_tvb;
762 const char *dhcp_type;
763 const uint8_t *vendor_class_id;
764 } dhcp_option_data_t;
766 #define DHCP_HW_IS_ETHER(hwtype, length) ((hwtype == 1 || hwtype == 6) && length == 6)
768 /* RFC2937 The Name Service Search Option for DHCP */
769 #define RFC2937_LOCAL_NAMING_INFORMATION 0
770 #define RFC2937_DOMAIN_NAME_SERVER_OPTION 6
771 #define RFC2937_NETWORK_INFORMATION_SERVERS_OPTION 41
772 #define RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION 44
773 #define RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION 65
775 /* RFC3825decoder error codes of the conversion function */
776 #define RFC3825_NOERROR 0
777 #define RFC3825_LATITUDE_OUTOFRANGE 1
778 #define RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE 2
779 #define RFC3825_LONGITUDE_OUTOFRANGE 3
780 #define RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE 4
781 #define RFC3825_ALTITUDE_OUTOFRANGE 5
782 #define RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE 6
783 #define RFC3825_ALTITUDE_TYPE_OUTOFRANGE 7
784 #define RFC3825_DATUM_TYPE_OUTOFRANGE 8
786 #define DUID_LLT 1
787 #define DUID_EN 2
788 #define DUID_LL 3
790 struct rfc3825_location_fixpoint_t {
792 int64_t latitude; /* latitude in degrees, allowed range from -90deg to 90deg.
793 Fixpoint A(8,25) with 34 bits */
794 uint8_t latitude_res; /* the resolution of the latitude in bits, allowed range is from 0 to 34.
795 6 bits. */
796 int64_t longitude; /* longitude in degrees, range from -180deg to 180deg.
797 Fixpoint A(8,25) with 34 bits */
798 uint8_t longitude_res; /* the resolution of the longitude in bits, allowed range is from 0 to 34.
799 6 bits. */
800 int32_t altitude; /* the altitude, 30 bits.
801 Depending on alt_type this are meters or floors, no range limit.
802 altitude_type==1: A(13,8) with 22 bits
803 altitude_type==2: A(13,8) with 22 bits */
804 uint8_t altitude_res; /* the resolution of the altitude in bits, allowed range is from 0 to 30.
805 6 bits.
806 altitude_type==1: any value between 0 and 30
807 altitude_type==2: either 0 (floor unknown) or 30 */
808 uint8_t altitude_type; /* the type of the altitude, 4 bits. allowed values are:
809 0: unknown
810 1: altitude in meters
811 2: altitude in floors */
812 uint8_t datum_type; /* the map datum used for the coordinates. 8 bits.
813 All values are allowed although currently only the
814 following ones are defined:
815 1: WGS84
816 2: NAD83/NAVD88
817 3: NAD83/MLLW */
820 /* The rfc3825_location_decimal_t structure holds the location parameters
821 * in decimal (floating point) format.
823 struct rfc3825_location_decimal_t {
825 double latitude; /* latitude in degrees, allowed range from -90deg to 90deg */
826 double latitude_res; /* the uncertainty of the latitude in grad, "0.01" means +-0.01deg
827 from the altitude. During conversion this will be rounded to
828 next smaller value which can be represented in fixpoint arithmetic */
829 double longitude; /* longitude in degrees, range from -180deg to 180deg */
830 double longitude_res; /* the uncertainty of the longitude in grad, "0.01" means +-0.01deg
831 from the longitude. During conversion this will be rounded to
832 next smaller value which can be represented in fixpoint arithmetic */
833 double altitude; /* the altitude, depending on alt_type this are meters or floors, no range limit */
834 double altitude_res; /* the uncertainty of the altitude in either:
835 - altitude-type=meters: "10" means 10 meters which means +-10 meters from the altitude
836 - altitude-type=floors: either 0 (unknown) or 30 (exact) */
837 int altitude_type; /* the type of the altitude, allowed values are
838 0: unknown
839 1: altitude in meters
840 2: altitude in floors */
841 int datum_type; /* the map datum used for the coordinates.
842 All values are allowed although currently only the
843 following ones are defined:
844 1: WGS84
845 2: NAD83/NAVD88
846 3: NAD83/MLLW */
849 /* For managing split options with RFC 3396 */
850 struct rfc3396_for_option_t {
851 unsigned int total_number_of_block;
852 unsigned int index_current_block;
853 tvbuff_t* tvb_composite;
856 /* The RFC 3397 allows to cut long option (RFC 3396). */
857 struct rfc3396_for_option_t rfc3396_dns_domain_search_list;
859 /* The RFC 3361 allows to cut long option (RFC 3396). */
860 struct rfc3396_for_option_t rfc3396_sip_server;
862 enum {
863 RFC_3361_ENC_FQDN,
864 RFC_3361_ENC_IPADDR
867 static void dissect_vendor_avaya_param(proto_tree *tree, packet_info *pinfo, proto_item *vti,
868 tvbuff_t *tvb, int optoff, wmem_strbuf_t *avaya_param_buf);
870 /* converts fixpoint presentation into decimal presentation
871 also converts values which are out of range to allow decoding of received data */
872 static int rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal);
874 /* decodes the LCI string received from DHCP into the fixpoint values */
875 static void rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint);
878 /* Map Datum Types used for the coordinates (RFC 3825) */
879 static const value_string map_datum_type_values[] = {
880 { 1, "WGS 84" },
881 { 2, "NAD83 (NAVD88)" },
882 { 3, "NAD83 (MLLW)" },
883 { 0, NULL }
887 /* Altitude Types used for the coordinates (RFC 3825) */
888 static const value_string altitude_type_values[] = {
889 { 1, "Meters" },
890 { 2, "Floors" },
891 { 0, NULL }
894 /* AutoConfigure (RFC 2563) */
895 static const value_string dhcp_autoconfig[] = {
896 { 0, "DoNotAutoConfigure"},
897 { 1, "AutoConfigure"},
898 { 0, NULL }
901 /* Error Types for RFC 3825 coordinate location decoding */
902 static const value_string rfc3825_error_types[] = {
903 { 1, "Latitude is out of range [-90,90]"},
904 { 2, "Latitude Uncertainty is out of range [0,90]"},
905 { 3, "Longitude is out of range [-180,180]"},
906 { 4, "Longitude Uncertainty is out of range [0,180]"},
907 { 5, "Altitude is out of range [-(2^21),(2^21)-1]"},
908 { 6, "Altitude Uncertainty is out of range [0,2^20]"},
909 { 7, "Altitude Type is out of range [0,2]"},
910 { 8, "Datum is out of range [1,3]"},
911 { 0, NULL }
916 /* Civic Address What field (RFC 4776) */
917 static const value_string civic_address_what_values[] = {
918 { 0, "Location of the DHCP server" },
919 { 1, "Location of the network element believed to be closest to the client" },
920 { 2, "Location of the client"},
921 { 0, NULL}
924 /* Civic Address Type field (RFC 4119, RFC 4776, RFC 5139) */
925 static const value_string civic_address_type_values[] = {
926 { 0, "Language" },
927 { 1, "A1" },
928 { 2, "A2" },
929 { 3, "A3" },
930 { 4, "A4" },
931 { 5, "A5" },
932 { 6, "A6" },
933 { 16, "PRD (Leading street direction)" },
934 { 17, "POD (Trailing street suffix)" },
935 { 18, "STS (Street suffix)" },
936 { 19, "HNO (House number)" },
937 { 20, "HNS (House number suffix)" },
938 { 21, "LMK (Landmark or vanity address)" },
939 { 22, "LOC (Additional location information)" },
940 { 23, "NAM" },
941 { 24, "PC (Postal/ZIP code)" },
942 { 25, "BLD (Building)" },
943 { 26, "UNIT" },
944 { 27, "FLR (Floor)" },
945 { 28, "ROOM" },
946 { 29, "PLC (Place-type)" },
947 { 30, "PCN (Postal community name)" },
948 { 31, "POBOX" },
949 { 32, "ADDCODE (Additional Code)" },
950 { 33, "SEAT" },
951 { 34, "RD (Primary road or street)" },
952 { 35, "RDSEC (Road section)" },
953 { 36, "RDBR (Road branch)" },
954 { 37, "RDSUBBR (Road sub-branch)" },
955 { 38, "PRM (Road pre-modifier)" },
956 { 39, "POM (Road post-modifier" },
957 { 128, "Script" },
958 { 0, NULL }
961 static const value_string cablelab_ipaddr_mode_vals[] = {
962 { 1, "IPv4" },
963 { 2, "IPv6" },
964 { 0, NULL }
967 static const value_string duidtype_vals[] =
969 { DUID_LLT, "link-layer address plus time" },
970 { DUID_EN, "assigned by vendor based on Enterprise number" },
971 { DUID_LL, "link-layer address" },
972 { 0, NULL }
975 static const value_string forcerenew_nonce_algo_vals[] = {
976 { 1, "HMAC-MD5" },
977 { 0, NULL },
980 static const value_string rdnss_pref_vals[] = {
981 { 0, "Medium" },
982 { 1, "High" },
983 { 2, "Reserved" },
984 { 3, "Low" },
985 { 0, NULL },
988 static const value_string bulk_lease_dhcp_status_code_vals[] = {
989 { 0, "Success" },
990 { 1, "UpsecFail" },
991 { 2, "QueryTerminated" },
992 { 3, "MalformedQuery" },
993 { 4, "NotAllowed" },
994 { 5, "DataMissing" },
995 { 6, "ConnectionActive" },
996 { 7, "CatchUpComplete" },
997 { 8, "TLSConnectionRefused" },
998 { 0, NULL },
1001 static const value_string bulk_lease_dhcp_state_vals[] = {
1002 { 1, "Available" },
1003 { 2, "Active" },
1004 { 3, "Expired" },
1005 { 4, "Released" },
1006 { 5, "Abandoned" },
1007 { 6, "Reset" },
1008 { 7, "Remote" },
1009 { 8, "Transitioning" },
1010 { 0, NULL },
1013 static const value_string o43pxeclient_boot_server_types[] = {
1014 { 0, "PXE bootstrap server" },
1015 { 1, "Microsoft Windows NT Boot Server" },
1016 { 2, "Intel LCM Boot Server" },
1017 { 3, "DOS/UNDI Boot Server" },
1018 { 4, "NEC ESMPRO Boot Server" },
1019 { 5, "IBM WSoD Boot Server" },
1020 { 6, "IBM LCCM Boot Server" },
1021 { 7, "CA Unicenter TNG Boot Server" },
1022 { 8, "HP OpenView Boot Server" },
1023 { 65535, "PXE API Test server" },
1024 { 0, NULL },
1027 static const value_string o43pxeclient_boot_menu_types[] = {
1028 { 0, "Local boot" },
1029 { 0, NULL },
1032 static bool novell_string;
1034 static int dhcp_uuid_endian = ENC_LITTLE_ENDIAN;
1036 static const enum_val_t dhcp_uuid_endian_vals[] = {
1037 { "LE", "Little Endian", ENC_LITTLE_ENDIAN},
1038 { "BE", "Big Endian", ENC_BIG_ENDIAN },
1039 { NULL, NULL, 0 }
1042 #define DHCP_SECS_ENDIAN_AUTODETECT -1
1044 static int dhcp_secs_endian = DHCP_SECS_ENDIAN_AUTODETECT;
1046 static const enum_val_t dhcp_secs_endian_vals[] = {
1047 { "Autodetect", "Autodetect", DHCP_SECS_ENDIAN_AUTODETECT},
1048 { "LE", "Little Endian", ENC_LITTLE_ENDIAN},
1049 { "BE", "Big Endian", ENC_BIG_ENDIAN },
1050 { NULL, NULL, 0 }
1053 #define DHCP_UDP_PORT_RANGE "67-68,4011"
1054 #define PROXYDHCP_UDP_PORT 4011
1056 #define BOOTP_BC 0x8000
1057 #define BOOTP_MBZ 0x7FFF
1059 /* FQDN stuff */
1060 #define F_FQDN_S 0x01
1061 #define F_FQDN_O 0x02
1062 #define F_FQDN_E 0x04
1063 #define F_FQDN_N 0x08
1064 #define F_FQDN_MBZ 0xf0
1066 #define ISNS_BITFIELD_NZ_MUST_BE_IGNORED(mask, ena_flag) \
1067 ((mask) && !((mask) & (ena_flag)))
1069 /* iSNS bit fields */
1070 #define F_ISNS_FUNCTIONS_ENABLED 0x0001
1071 #define F_ISNS_FUNCTIONS_DD_AUTH 0x0002
1072 #define F_ISNS_FUNCTIONS_SEC_POLICY 0x0004
1073 #define F_ISNS_FUNCTIONS_RESERVED 0xFFF8
1075 #define F_ISNS_DD_ACCESS_ENABLED 0x0001
1076 #define F_ISNS_DD_ACCESS_CTRL_NODE 0x0002
1077 #define F_ISNS_DD_ACCESS_ISCSI_TARGET 0x0004
1078 #define F_ISNS_DD_ACCESS_ISCSI_INITIATOR 0x0008
1079 #define F_ISNS_DD_ACCESS_IFCP_TARGET_PORT 0x0010
1080 #define F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT 0x0020
1081 #define F_ISNS_DD_ACCESS_RESERVED 0xFFC0
1083 #define F_ISNS_ADMIN_FLAGS_ENABLED 0x0001
1084 #define F_ISNS_ADMIN_FLAGS_HEARTBEAT 0x0002
1085 #define F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS 0x0004
1086 #define F_ISNS_ADMIN_FLAGS_DEFAULT_DD 0x0008
1087 #define F_ISNS_ADMIN_FLAGS_RESERVED 0xFFF0
1089 #define F_ISNS_SRV_SEC_BITMAP_ENABLED 0x0001
1090 #define F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC 0x0002
1091 #define F_ISNS_SRV_SEC_BITMAP_MAIN_MODE 0x0004
1092 #define F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE 0x0008
1093 #define F_ISNS_SRV_SEC_BITMAP_PFS 0x0010
1094 #define F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE 0x0020
1095 #define F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE 0x0040
1096 #define F_ISNS_SRV_SEC_BITMAP_RESERVED 0xFF80
1099 static const true_false_string tfs_fqdn_o = {
1100 "Override",
1101 "No override"
1104 static const true_false_string tfs_fqdn_e = {
1105 "Binary encoding",
1106 "ASCII encoding"
1109 static const true_false_string tfs_fqdn_n = {
1110 "No server updates",
1111 "Some server updates"
1114 static const true_false_string tfs_isns_function_dd_based_auth = {
1115 "Automatically allowed access",
1116 "Explicitly performed",
1119 static const true_false_string tfs_isns_functions_sec_distrib = {
1120 "Download from iSNS server",
1121 "By other means",
1124 static const true_false_string tfs_bulk_lease_data_source = {
1125 "Remote",
1126 "Local"
1129 enum field_type {
1130 special,
1131 none,
1132 presence,
1133 ipv4, /* single IPv4 address */
1134 ipv4_list, /* list of IPv4 addresses */
1135 string,
1136 bytes,
1137 opaque,
1138 val_boolean,
1139 val_u_byte,
1140 val_u_short,
1141 val_u_short_list,
1142 val_u_le_short,
1143 val_u_long,
1144 time_in_s_secs, /* Signed */
1145 time_in_u_secs, /* Unsigned (not micro) */
1146 fqdn,
1147 ipv4_or_fqdn,
1151 struct opt_info {
1152 const char *text;
1153 enum field_type ftype;
1154 int* phf;
1157 static const true_false_string flag_set_broadcast = {
1158 "Broadcast",
1159 "Unicast"
1162 #define BOOTP_MAX_NO_CHAR 64
1164 /* PacketCable/DOCSIS definitions */
1165 #define PACKETCABLE_MTA_CAP10 "pktc1.0:"
1166 #define PACKETCABLE_MTA_CAP15 "pktc1.5:"
1167 #define PACKETCABLE_MTA_CAP20 "pktc2.0:"
1168 #define PACKETCABLE_CM_CAP11 "docsis1.1:"
1169 #define PACKETCABLE_CM_CAP20 "docsis2.0:"
1170 #define PACKETCABLE_CM_CAP30 "docsis3.0:"
1172 #define PACKETCABLE_CCC_I05 1
1173 #define PACKETCABLE_CCC_DRAFT5 2
1174 #define PACKETCABLE_CCC_RFC_3495 3
1176 static const enum_val_t pkt_ccc_protocol_versions[] = {
1177 { "ccc_i05", "PKT-SP-PROV-I05-021127", PACKETCABLE_CCC_I05 },
1178 { "ccc_draft_5", "IETF Draft 5", PACKETCABLE_CCC_DRAFT5 },
1179 { "rfc_3495", "RFC 3495", PACKETCABLE_CCC_RFC_3495 },
1180 { NULL, NULL, 0 }
1183 #define APPLE_BSDP_SERVER "AAPLBSDPC"
1184 #define APPLE_BSDP_CLIENT "AAPLBSDPC/"
1186 #define CISCO_VCID "cisco"
1188 #define AEROHIVE_VCID "AEROHIVE"
1190 static int pkt_ccc_protocol_version = PACKETCABLE_CCC_RFC_3495;
1191 static unsigned pkt_ccc_option = 122;
1193 static void dissect_docsis_cm_cap(packet_info *pinfo, proto_tree *v_tree, tvbuff_t *tvb,
1194 int voff, int len, bool opt125);
1196 #define ARUBA_INSTANT_AP "ArubaInstantAP"
1197 #define ARUBA_AP "ArubaAP"
1199 #define OPT53_DISCOVER "Discover"
1200 /* https://www.iana.org/assignments/bootp-dhcp-parameters */
1201 static const value_string opt53_text[] = {
1202 { 1, OPT53_DISCOVER },
1203 { 2, "Offer" },
1204 { 3, "Request" },
1205 { 4, "Decline" },
1206 { 5, "ACK" },
1207 { 6, "NAK" },
1208 { 7, "Release" },
1209 { 8, "Inform" },
1210 { 9, "Force Renew" },
1211 { 10, "Lease query" }, /* RFC4388 */
1212 { 11, "Lease Unassigned" }, /* RFC4388 */
1213 { 12, "Lease Unknown" }, /* RFC4388 */
1214 { 13, "Lease Active" }, /* RFC4388 */
1215 { 14, "Bulk Lease Query" }, /* RFC6926 */
1216 { 15, "Lease Query Done" }, /* RFC6926 */
1217 { 16, "Active LeaseQuery" }, /* RFC7724 */
1218 { 17, "Lease Query Status" }, /* RFC7724 */
1219 { 18, "TLS" }, /* RFC7724 */
1220 { 0, NULL }
1223 /* DHCP Authentication protocols */
1224 #define AUTHEN_PROTO_CONFIG_TOKEN 0
1225 #define AUTHEN_PROTO_DELAYED_AUTHEN 1
1227 /* DHCP Authentication algorithms for delayed authentication */
1228 #define AUTHEN_DELAYED_ALGO_HMAC_MD5 1
1230 /* DHCP Authentication Replay Detection Methods */
1231 #define AUTHEN_RDM_MONOTONIC_COUNTER 0x00
1233 /* DHCP Option Overload (option code 52) */
1234 #define OPT_OVERLOAD_FILE 1
1235 #define OPT_OVERLOAD_SNAME 2
1236 #define OPT_OVERLOAD_BOTH 3
1238 /* Server name and boot file offsets and lengths */
1239 #define SERVER_NAME_OFFSET 44
1240 #define SERVER_NAME_LEN 64
1241 #define FILE_NAME_OFFSET 108
1242 #define FILE_NAME_LEN 128
1243 #define VENDOR_INFO_OFFSET 236
1245 static const value_string dhcp_nbnt_vals[] = {
1246 {0x1, "B-node" },
1247 {0x2, "P-node" },
1248 {0x4, "M-node" },
1249 {0x8, "H-node" },
1250 {0, NULL }
1254 * There is confusion around some Client Architecture IDs: RFC 4578 section 2.1
1255 * lists *requested* architecture IDs, however the actual assigned IDs
1256 * (https://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture)
1257 * differ. Specifically,
1259 * EFI Byte Code (EFI BC, EBC) was 7 in RFC 4578, but is assigned 9 by IETF.
1260 * EFI x64 was 9 in RFC 4578, but is assigned 7 by IETF.
1262 * For confirmation, refer to RFC erratum 4624:
1263 * https://www.rfc-editor.org/errata/eid4624
1265 static const value_string dhcp_client_arch[] = {
1266 { 0x0000, "IA x86 PC" },
1267 { 0x0001, "NEC/PC98" },
1268 { 0x0002, "IA64 PC" },
1269 { 0x0003, "DEC Alpha" },
1270 { 0x0004, "ArcX86" },
1271 { 0x0005, "Intel Lean Client" },
1272 { 0x0006, "EFI IA32" },
1273 { 0x0007, "EFI x64" }, /* *Not* EFI BC. See comment above. */
1274 { 0x0008, "EFI Xscale" },
1275 { 0x0009, "EFI BC" }, /* *Not* EFI x64. See comment above. */
1276 { 0x000a, "ARM 32-bit UEFI" },
1277 { 0x000b, "ARM 64-bit UEFI" },
1278 { 0x000c, "PowerPC Open Firmware" },
1279 { 0x000d, "PowerPC ePAPR" },
1280 { 0x000e, "POWER OPAL v3" },
1281 { 0x000f, "x86 UEFI HTTP" },
1282 { 0x0010, "x64 UEFI HTTP" },
1283 { 0x0011, "EBC UEFI HTTP" },
1284 { 0x0012, "ARM 32-bit UEFI HTTP" },
1285 { 0x0013, "ARM 64-bit UEFI HTTP" },
1286 { 0x0014, "PC/AT HTTP" },
1287 { 0x0015, "ARM 32-bit uboot" },
1288 { 0x0016, "ARM 64-bit uboot" },
1289 { 0x0017, "ARM 32-bit uboot HTTP" },
1290 { 0x0018, "ARM 64-bit uboot HTTP" },
1291 { 0x0019, "RISC-V 32-bit UEFI" },
1292 { 0x001a, "RISC-V 32-bit UEFI HTTP" },
1293 { 0x001b, "RISC-V 64-bit UEFI" },
1294 { 0x001c, "RISC-V 64-bit UEFI HTTP" },
1295 { 0x001d, "RISC-V 128-bit UEFI" },
1296 { 0x001e, "RISC-V 128-bit UEFI HTTP" },
1297 { 0x001f, "s390 Basic" },
1298 { 0x0020, "s390 Extended" },
1299 { 0, NULL }
1302 static const value_string opt_overload_vals[] = {
1303 { OPT_OVERLOAD_FILE, "Boot file name holds options", },
1304 { OPT_OVERLOAD_SNAME, "Server host name holds options", },
1305 { OPT_OVERLOAD_BOTH, "Boot file and server host names hold options" },
1306 { 0, NULL } };
1308 static const value_string slpda_vals[] = {
1309 {0x00, "Dynamic Discovery" },
1310 {0x01, "Static Discovery" },
1311 {0x80, "Backwards compatibility" },
1312 {0, NULL } };
1314 static const value_string slp_scope_vals[] = {
1315 {0x00, "Preferred Scope" },
1316 {0x01, "Mandatory Scope" },
1317 {0, NULL } };
1319 static const value_string authen_protocol_vals[] = {
1320 {AUTHEN_PROTO_CONFIG_TOKEN, "configuration token" },
1321 {AUTHEN_PROTO_DELAYED_AUTHEN, "delayed authentication" },
1322 {0, NULL } };
1324 static const value_string authen_da_algo_vals[] = {
1325 {AUTHEN_DELAYED_ALGO_HMAC_MD5, "HMAC_MD5" },
1326 {0, NULL } };
1328 static const value_string authen_rdm_vals[] = {
1329 {AUTHEN_RDM_MONOTONIC_COUNTER, "Monotonically-increasing counter" },
1330 {0, NULL } };
1332 static const value_string cl_dss_id_type_vals[] = {
1333 {1, "Primary DSS_ID" },
1334 {2, "Secondary DSS_ID" },
1335 {0, NULL }
1338 static const value_string sip_server_enc_vals[] = {
1339 {0, "Fully Qualified Domain Name" },
1340 {1, "IPv4 Address" },
1341 {0, NULL }
1344 static const value_string o43_bsdp_boot_image_install_vals[] = {
1345 { 0, "non-install" },
1346 { 1, "install" },
1347 { 0, NULL }
1350 static const value_string o43_bsdp_boot_image_kind_vals[] = {
1351 { 0, "Mac OS 9" },
1352 { 1, "Mac OS X" },
1353 { 2, "Mac OS X Server" },
1354 { 3, "Hardware Diagnostics" },
1355 { 0, NULL }
1358 static const value_string o43_bsdp_message_type_vals[] = {
1359 { 1, "LIST" },
1360 { 2, "SELECT" },
1361 { 3, "FAILED" },
1362 { 0, NULL }
1365 static const string_string option242_avaya_phystat_vals[] = {
1366 { "0", "Disabled" },
1367 { "1", "Auto" },
1368 { "2", "10Mbps half" },
1369 { "3", "10Mbps full" },
1370 { "4", "100Mbps half" },
1371 { "5", "100Mbps full" },
1372 { "6", "1000Mbps full" },
1373 { NULL, NULL }
1376 static const string_string option242_avaya_l2q_vals[] = {
1377 { "0", "Auto" },
1378 { "1", "Enabled" },
1379 { "2", "Disabled" },
1380 { NULL, NULL }
1383 static const string_string option242_avaya_dot1x_vals[] = {
1384 { "0", "With PAE pass-through" },
1385 { "1", "With PAE pass-through and proxy Logoff" },
1386 { "2", "Without PAE pass-through or proxy Logoff" },
1387 { NULL, NULL }
1390 static const string_string option242_avaya_icmpdu_vals[] = {
1391 { "0", "No ICMP Destination Unreachable messages" },
1392 { "1", "Send limited Port Unreachable messages" },
1393 { "2", "Send Protocol and Port Unreachable messages" },
1394 { NULL, NULL }
1397 static const string_string option242_avaya_icmpred_vals[] = {
1398 { "0", "Ignore ICMP Redirect messages" },
1399 { "1", "Process ICMP Redirect messages" },
1400 { NULL, NULL }
1403 static const string_string option242_avaya_loglocal_vals[] = {
1404 { "0", "Disabled" },
1405 { "1", "Emergency" },
1406 { "2", "Alerts" },
1407 { "3", "Critical" },
1408 { "4", "Errors" },
1409 { "5", "Warnings" },
1410 { "6", "Notices" },
1411 { "7", "Information" },
1412 { "8", "Debug" },
1413 { NULL, NULL }
1416 static const string_string option242_avaya_procstat_vals[] = {
1417 { "0", "All administrative options" },
1418 { "1", "Only view administrative options" },
1419 { NULL, NULL }
1422 static const string_string option242_avaya_static_vals[] = {
1423 { "0", "Static programming never overrides call server (DHCP) or call server administered data" },
1424 { "1", "Static programming overrides only file server administered data" },
1425 { "2", "Static programming overrides only call server administered data" },
1426 { "3", "Static programming overrides both file server- and call server-administered data" },
1427 { NULL, NULL }
1430 /* dhcp options administration */
1431 #define DHCP_OPT_NUM 256
1433 /* All of the options that have a "basic" type that can be handled by dissect_dhcpopt_basic_type() */
1434 #define DHCP_OPTION_BASICTYPE_RANGE "1-20,22-32,34-42,44-51,53-54,56-59,62,64-76,86-87,91-92,100-101,108,112-113,116,118,136-138,142,147-148,150,153,156-157,161,209-211,252"
1436 /* Re-define structure. Values to be updated by dhcp_init_protocol */
1437 static struct opt_info dhcp_opt[DHCP_OPT_NUM];
1439 static const struct opt_info default_dhcp_opt[DHCP_OPT_NUM] = {
1440 /* 0 */ { "Padding", none, &hf_dhcp_option_padding },
1441 /* 1 */ { "Subnet Mask", ipv4, &hf_dhcp_option_subnet_mask },
1442 /* 2 */ { "Time Offset", time_in_s_secs, &hf_dhcp_option_time_offset },
1443 /* 3 */ { "Router", ipv4_list, &hf_dhcp_option_router },
1444 /* 4 */ { "Time Server", ipv4_list, &hf_dhcp_option_time_server },
1445 /* 5 */ { "Name Server", ipv4_list, &hf_dhcp_option_name_server },
1446 /* 6 */ { "Domain Name Server", ipv4_list, &hf_dhcp_option_domain_name_server },
1447 /* 7 */ { "Log Server", ipv4_list, &hf_dhcp_option_log_server },
1448 /* 8 */ { "Quotes Server", ipv4_list, &hf_dhcp_option_quotes_server },
1449 /* 9 */ { "LPR Server", ipv4_list, &hf_dhcp_option_lpr_server },
1450 /* 10 */ { "Impress Server", ipv4_list, &hf_dhcp_option_impress_server },
1451 /* 11 */ { "Resource Location Server", ipv4_list, &hf_dhcp_option_resource_location_server },
1452 /* 12 */ { "Host Name", string, &hf_dhcp_option_hostname },
1453 /* 13 */ { "Boot File Size", val_u_short, &hf_dhcp_option_boot_file_size },
1454 /* 14 */ { "Merit Dump File", string, &hf_dhcp_option_merit_dump_file },
1455 /* 15 */ { "Domain Name", string, &hf_dhcp_option_domain_name },
1456 /* 16 */ { "Swap Server", ipv4, &hf_dhcp_option_swap_server },
1457 /* 17 */ { "Root Path", string, &hf_dhcp_option_root_path },
1458 /* 18 */ { "Extensions Path", string, &hf_dhcp_option_extension_path },
1459 /* 19 */ { "IP Forwarding", val_boolean, &hf_dhcp_option_ip_forwarding },
1460 /* 20 */ { "Non-Local Source Routing", val_boolean, &hf_dhcp_option_non_local_source_routing },
1461 /* 21 */ { "Policy Filter", special, NULL },
1462 /* 22 */ { "Maximum Datagram Reassembly Size", val_u_short, &hf_dhcp_option_max_datagram_reassembly_size },
1463 /* 23 */ { "Default IP Time-to-Live", val_u_byte, &hf_dhcp_option_default_ip_ttl },
1464 /* 24 */ { "Path MTU Aging Timeout", time_in_u_secs, &hf_dhcp_option_path_mtu_aging_timeout },
1465 /* 25 */ { "Path MTU Plateau Table", val_u_short_list, &hf_dhcp_option_path_mtu_plateau_table_item },
1466 /* 26 */ { "Interface MTU", val_u_short, &hf_dhcp_option_interface_mtu },
1467 /* 27 */ { "All Subnets are Local", val_boolean, &hf_dhcp_option_all_subnets_are_local },
1468 /* 28 */ { "Broadcast Address", ipv4, &hf_dhcp_option_broadcast_address },
1469 /* 29 */ { "Perform Mask Discovery", val_boolean, &hf_dhcp_option_perform_mask_discovery },
1470 /* 30 */ { "Mask Supplier", val_boolean, &hf_dhcp_option_mask_supplier },
1471 /* 31 */ { "Perform Router Discover", val_boolean, &hf_dhcp_option_perform_router_discover },
1472 /* 32 */ { "Router Solicitation Address", ipv4, &hf_dhcp_option_router_solicitation_address },
1473 /* 33 */ { "Static Route", special, NULL },
1474 /* 34 */ { "Trailer Encapsulation", val_boolean, &hf_dhcp_option_trailer_encapsulation },
1475 /* 35 */ { "ARP Cache Timeout", time_in_u_secs, &hf_dhcp_option_arp_cache_timeout },
1476 /* 36 */ { "Ethernet Encapsulation", val_boolean, &hf_dhcp_option_ethernet_encapsulation },
1477 /* 37 */ { "TCP Default TTL", val_u_byte, &hf_dhcp_option_tcp_default_ttl },
1478 /* 38 */ { "TCP Keepalive Interval", time_in_u_secs, &hf_dhcp_option_tcp_keepalive_interval },
1479 /* 39 */ { "TCP Keepalive Garbage", val_boolean, &hf_dhcp_option_tcp_keepalive_garbage },
1480 /* 40 */ { "Network Information Service Domain", string, &hf_dhcp_option_nis_domain },
1481 /* 41 */ { "Network Information Service Servers", ipv4_list, &hf_dhcp_option_nis_server },
1482 /* 42 */ { "Network Time Protocol Servers", ipv4_list, &hf_dhcp_option_ntp_server },
1483 /* 43 */ { "Vendor-Specific Information", special, NULL },
1484 /* 44 */ { "NetBIOS over TCP/IP Name Server", ipv4_list, &hf_dhcp_option_netbios_over_tcpip_name_server },
1485 /* 45 */ { "NetBIOS over TCP/IP Datagram Distribution Name Server", ipv4_list, &hf_dhcp_option_netbios_over_tcpip_dd_name_server },
1486 /* 46 */ { "NetBIOS over TCP/IP Node Type", val_u_byte, &hf_dhcp_option_netbios_over_tcpip_node_type },
1487 /* 47 */ { "NetBIOS over TCP/IP Scope", string, &hf_dhcp_option_netbios_over_tcpip_scope },
1488 /* 48 */ { "X Window System Font Server", ipv4_list, &hf_dhcp_option_xwindows_system_font_server },
1489 /* 49 */ { "X Window System Display Manager", ipv4_list, &hf_dhcp_option_xwindows_system_display_manager },
1490 /* 50 */ { "Requested IP Address", ipv4, &hf_dhcp_option_requested_ip_address },
1491 /* 51 */ { "IP Address Lease Time", time_in_u_secs, &hf_dhcp_option_ip_address_lease_time },
1492 /* 52 */ { "Option Overload", special, &hf_dhcp_option_option_overload },
1493 /* 53 */ { "DHCP Message Type", val_u_byte, &hf_dhcp_option_dhcp },
1494 /* 54 */ { "DHCP Server Identifier", ipv4, &hf_dhcp_option_dhcp_server_id },
1495 /* 55 */ { "Parameter Request List", special, &hf_dhcp_option_parameter_request_list_item },
1496 /* 56 */ { "Message", string, &hf_dhcp_option_message },
1497 /* 57 */ { "Maximum DHCP Message Size", val_u_short, &hf_dhcp_option_dhcp_max_message_size },
1498 /* 58 */ { "Renewal Time Value", time_in_u_secs, &hf_dhcp_option_renewal_time_value },
1499 /* 59 */ { "Rebinding Time Value", time_in_u_secs, &hf_dhcp_option_rebinding_time_value },
1500 /* 60 */ { "Vendor class identifier", special, NULL },
1501 /* 61 */ { "Client identifier", special, NULL },
1502 /* 62 */ { "Novell/Netware IP domain", string, &hf_dhcp_option_novell_netware_ip_domain },
1503 /* 63 */ { "Novell Options", special, NULL },
1504 /* 64 */ { "Network Information Service+ Domain", string, &hf_dhcp_option_nis_plus_domain },
1505 /* 65 */ { "Network Information Service+ Servers", ipv4_list, &hf_dhcp_option_nis_plus_server },
1506 /* 66 */ { "TFTP Server Name", string, &hf_dhcp_option_tftp_server_name },
1507 /* 67 */ { "Bootfile name", string, &hf_dhcp_option_bootfile_name },
1508 /* 68 */ { "Mobile IP Home Agent", ipv4_list, &hf_dhcp_option_mobile_ip_home_agent },
1509 /* 69 */ { "SMTP Server", ipv4_list, &hf_dhcp_option_smtp_server },
1510 /* 70 */ { "POP3 Server", ipv4_list, &hf_dhcp_option_pop3_server },
1511 /* 71 */ { "NNTP Server", ipv4_list, &hf_dhcp_option_nntp_server },
1512 /* 72 */ { "Default WWW Server", ipv4_list, &hf_dhcp_option_default_www_server },
1513 /* 73 */ { "Default Finger Server", ipv4_list, &hf_dhcp_option_default_finger_server },
1514 /* 74 */ { "Default IRC Server", ipv4_list, &hf_dhcp_option_default_irc_server },
1515 /* 75 */ { "StreetTalk Server", ipv4_list, &hf_dhcp_option_streettalk_server },
1516 /* 76 */ { "StreetTalk Directory Assistance Server", ipv4_list, &hf_dhcp_option_streettalk_da_server },
1517 /* 77 */ { "User Class Information", special, NULL },
1518 /* 78 */ { "Directory Agent Information", special, NULL },
1519 /* 79 */ { "Service Location Agent Scope", special, NULL },
1520 /* 80 */ { "Rapid commit", opaque, NULL },
1521 /* 81 */ { "Client Fully Qualified Domain Name", special, NULL},
1522 /* 82 */ { "Agent Information Option", special, NULL},
1523 /* 83 */ { "iSNS", opaque, NULL },
1524 /* 84 */ { "Removed/Unassigned", opaque, NULL },
1525 /* 85 */ { "Novell Directory Services Servers", special, NULL},
1526 /* 86 */ { "Novell Directory Services Tree Name", string, &hf_dhcp_option_novell_ds_tree_name },
1527 /* 87 */ { "Novell Directory Services Context", string, &hf_dhcp_option_novell_ds_context },
1528 /* 88 */ { "BCMCS Controller Domain Name [TODO:RFC4280]", opaque, NULL },
1529 /* 89 */ { "BCMCS Controller IPv4 address [TODO:RFC4280]", opaque, NULL },
1530 /* 90 */ { "Authentication", special, NULL},
1531 /* 91 */ { "Client last transaction time", time_in_u_secs, &hf_dhcp_option_client_last_transaction_time },
1532 /* 92 */ { "Associated IP option", ipv4_list, &hf_dhcp_option_associated_ip_option },
1533 /* 93 */ { "Client System Architecture", special, NULL},
1534 /* 94 */ { "Client Network Device Interface", special, NULL},
1535 /* 95 */ { "LDAP [TODO:RFC3679]", opaque, NULL },
1536 /* 96 */ { "Removed/Unassigned", opaque, NULL },
1537 /* 97 */ { "UUID/GUID-based Client Identifier", special, NULL},
1538 /* 98 */ { "Open Group's User Authentication [TODO:RFC2485]", opaque, NULL },
1539 /* 99 */ { "Civic Addresses Configuration", special, NULL},
1540 /* 100 */ { "PCode", string, &hf_dhcp_option_tz_pcode },
1541 /* 101 */ { "TCode", string, &hf_dhcp_option_tz_tcode },
1542 /* 102 */ { "Removed/unassigned", opaque, NULL },
1543 /* 103 */ { "Removed/unassigned", opaque, NULL },
1544 /* 104 */ { "Removed/unassigned", opaque, NULL },
1545 /* 105 */ { "Removed/unassigned", opaque, NULL },
1546 /* 106 */ { "Removed/unassigned", opaque, NULL },
1547 /* 107 */ { "Removed/unassigned", opaque, NULL },
1548 /* 108 */ { "IPv6-Only Preferred", time_in_u_secs, &hf_dhcp_option_ipv6_only_preferred_wait_time },
1549 /* 109 */ { "Unassigned", opaque, NULL },
1550 /* 110 */ { "Removed/Unassigned", opaque, NULL },
1551 /* 111 */ { "Unassigned", opaque, NULL },
1552 /* 112 */ { "NetInfo Parent Server Address", ipv4_list, &hf_dhcp_option_netinfo_parent_server_address },
1553 /* 113 */ { "NetInfo Parent Server Tag", string, &hf_dhcp_option_netinfo_parent_server_tag },
1554 /* 114 */ { "DHCP Captive-Portal", special, NULL },
1555 /* 115 */ { "Removed/Unassigned", opaque, NULL },
1556 /* 116 */ { "DHCP Auto-Configuration", val_u_byte, &hf_dhcp_option_dhcp_auto_configuration },
1557 /* 117 */ { "Name Service Search", special, NULL },
1558 /* 118 */ { "Subnet Selection Option", ipv4_list, &hf_dhcp_option_subnet_selection_option },
1559 /* 119 */ { "Domain Search", special, NULL },
1560 /* 120 */ { "SIP Servers", special, NULL },
1561 /* 121 */ { "Classless Static Route", special, NULL},
1562 /* 122 */ { "CableLabs Client Configuration [TODO:RFC3495]", opaque, NULL },
1563 /* 123 */ { "Coordinate-based Location Configuration", special, NULL},
1564 /* 124 */ { "V-I Vendor Class", special, NULL},
1565 /* 125 */ { "V-I Vendor-specific Information", special, NULL},
1566 /* 126 */ { "Removed/Unassigned", opaque, NULL },
1567 /* 127 */ { "Removed/Unassigned", opaque, NULL },
1568 /* 128 */ { "DOCSIS full security server IP [TODO]", opaque, NULL },
1569 /* 129 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1570 /* 130 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1571 /* 131 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1572 /* 132 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1573 /* 133 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1574 /* 134 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1575 /* 135 */ { "PXE - undefined (vendor specific)", opaque, NULL },
1576 /* 136 */ { "PANA Authentication Agent", ipv4_list, &hf_dhcp_option_pana_agent },
1577 /* 137 */ { "LoST Server Domain Name", string, &hf_dhcp_option_lost_server_domain_name },
1578 /* 138 */ { "CAPWAP Access Controllers", ipv4_list, &hf_dhcp_option_capwap_access_controller },
1579 /* 139 */ { "IPv4 Address-MoS", opaque, NULL },
1580 /* 140 */ { "IPv4 FQDN-MoS", opaque, NULL },
1581 /* 141 */ { "SIP UA Configuration Domains", opaque, NULL },
1582 /* 142 */ { "IPv4 Address ANDSF", ipv4_list, &hf_dhcp_option_andsf_server },
1583 /* 143 */ { "Zerotouch Redirect [TODO: draft-ietf-netconf-zerotouch]", opaque, NULL },
1584 /* 144 */ { "Geospatial Location [TODO:RFC6225]", opaque, NULL },
1585 /* 145 */ { "Forcerenew Nonce Capable", special, NULL },
1586 /* 146 */ { "RDNSS Selection", special, NULL },
1587 /* 147 */ { "DOTS Reference Identifier", string, &hf_dhcp_option_dots_ri },
1588 /* 148 */ { "DOTS Address", ipv4_list, &hf_dhcp_option_dots_address },
1589 /* 149 */ { "Unassigned", opaque, NULL },
1590 /* 150 */ { "TFTP Server Address", ipv4_list, &hf_dhcp_option_tftp_server_address },
1591 /* 151 */ { "Leasequery Status code", special, NULL },
1592 /* 152 */ { "Leasequery Base Time", special, NULL },
1593 /* 153 */ { "Leasequery Start Time of State", time_in_u_secs, &hf_dhcp_option_bulk_lease_start_time_of_state },
1594 /* 154 */ { "Leasequery Query Start Time", special, NULL },
1595 /* 155 */ { "Leasequery Query End Time", special, NULL },
1596 /* 156 */ { "Leasequery Dhcp State", val_u_byte, &hf_dhcp_option_bulk_lease_dhcp_state },
1597 /* 157 */ { "Leasequery Data Source", val_boolean, &hf_dhcp_option_bulk_lease_data_source },
1598 /* 158 */ { "PCP Server", special, NULL },
1599 /* 159 */ { "Portparams", special, NULL },
1600 /* 160 */ { "Unassigned (ex DHCP Captive-Portal)", special, NULL }, /* Previously assigned by [RFC7710]; known to also be used by Polycom. */
1601 /* 161 */ { "Manufacturer Usage Description", string, &hf_dhcp_option_mudurl},
1602 /* 162 */ { "Unassigned", opaque, NULL },
1603 /* 163 */ { "Unassigned", opaque, NULL },
1604 /* 164 */ { "Unassigned", opaque, NULL },
1605 /* 165 */ { "Unassigned", opaque, NULL },
1606 /* 166 */ { "Unassigned", opaque, NULL },
1607 /* 167 */ { "Unassigned", opaque, NULL },
1608 /* 168 */ { "Unassigned", opaque, NULL },
1609 /* 169 */ { "Unassigned", opaque, NULL },
1610 /* 170 */ { "Unassigned", opaque, NULL },
1611 /* 171 */ { "Unassigned", opaque, NULL },
1612 /* 172 */ { "Unassigned", opaque, NULL },
1613 /* 173 */ { "Unassigned", opaque, NULL },
1614 /* 174 */ { "Unassigned", opaque, NULL },
1615 /* 175 */ { "Etherboot", opaque, NULL },
1616 /* 176 */ { "IP Telephone", opaque, NULL },
1617 /* 177 */ { "Etherboot", opaque, NULL },
1618 /* 178 */ { "Unassigned", opaque, NULL },
1619 /* 179 */ { "Unassigned", opaque, NULL },
1620 /* 180 */ { "Unassigned", opaque, NULL },
1621 /* 181 */ { "Unassigned", opaque, NULL },
1622 /* 182 */ { "Unassigned", opaque, NULL },
1623 /* 183 */ { "Unassigned", opaque, NULL },
1624 /* 184 */ { "Unassigned", opaque, NULL },
1625 /* 185 */ { "Unassigned", opaque, NULL },
1626 /* 186 */ { "Unassigned", opaque, NULL },
1627 /* 187 */ { "Unassigned", opaque, NULL },
1628 /* 188 */ { "Unassigned", opaque, NULL },
1629 /* 189 */ { "Unassigned", opaque, NULL },
1630 /* 190 */ { "Unassigned", opaque, NULL },
1631 /* 191 */ { "Unassigned", opaque, NULL },
1632 /* 192 */ { "Unassigned", opaque, NULL },
1633 /* 193 */ { "Unassigned", opaque, NULL },
1634 /* 194 */ { "Unassigned", opaque, NULL },
1635 /* 195 */ { "Unassigned", opaque, NULL },
1636 /* 196 */ { "Unassigned", opaque, NULL },
1637 /* 197 */ { "Unassigned", opaque, NULL },
1638 /* 198 */ { "Unassigned", opaque, NULL },
1639 /* 199 */ { "Unassigned", opaque, NULL },
1640 /* 200 */ { "Unassigned", opaque, NULL },
1641 /* 201 */ { "Unassigned", opaque, NULL },
1642 /* 202 */ { "Unassigned", opaque, NULL },
1643 /* 203 */ { "Unassigned", opaque, NULL },
1644 /* 204 */ { "Unassigned", opaque, NULL },
1645 /* 205 */ { "Unassigned", opaque, NULL },
1646 /* 206 */ { "Unassigned", opaque, NULL },
1647 /* 207 */ { "Unassigned", opaque, NULL },
1648 /* 208 */ { "PXELINUX Magic", opaque, NULL },
1649 /* 209 */ { "PXE Configuration file", string, &hf_dhcp_option_pxe_config_file },
1650 /* 210 */ { "PXE Path Prefix", string, &hf_dhcp_option_pxe_path_prefix },
1651 /* 211 */ { "Reboot Time", time_in_u_secs, &hf_dhcp_option_pxe_reboot_time },
1652 /* 212 */ { "6RD", opaque, NULL },
1653 /* 213 */ { "V4 Access Domain", opaque, NULL },
1654 /* 214 */ { "Unassigned", opaque, NULL },
1655 /* 215 */ { "Unassigned", opaque, NULL },
1656 /* 216 */ { "Unassigned", opaque, NULL },
1657 /* 217 */ { "Unassigned", opaque, NULL },
1658 /* 218 */ { "Unassigned", opaque, NULL },
1659 /* 219 */ { "Unassigned", opaque, NULL },
1660 /* 220 */ { "Subnet Allocation", opaque, NULL },
1661 /* 221 */ { "Virtual Subnet Selection", opaque, NULL },
1662 /* 222 */ { "Unassigned", opaque, NULL },
1663 /* 223 */ { "Unassigned", opaque, NULL },
1664 /* 224 */ { "Private", opaque, NULL },
1665 /* 225 */ { "Private", opaque, NULL },
1666 /* 226 */ { "Private", opaque, NULL },
1667 /* 227 */ { "Private", opaque, NULL },
1668 /* 228 */ { "Private", opaque, NULL },
1669 /* 229 */ { "Private", opaque, NULL },
1670 /* 230 */ { "Private", opaque, NULL },
1671 /* 231 */ { "Private", opaque, NULL },
1672 /* 232 */ { "Private", opaque, NULL },
1673 /* 233 */ { "Private", opaque, NULL },
1674 /* 234 */ { "Private", opaque, NULL },
1675 /* 235 */ { "Private", opaque, NULL },
1676 /* 236 */ { "Private", opaque, NULL },
1677 /* 237 */ { "Private", opaque, NULL },
1678 /* 238 */ { "Private", opaque, NULL },
1679 /* 239 */ { "Private", opaque, NULL },
1680 /* 240 */ { "Private", opaque, NULL },
1681 /* 241 */ { "Private", opaque, NULL },
1682 /* 242 */ { "Private/Avaya IP Telephone", special, NULL },
1683 /* 243 */ { "Private", opaque, NULL },
1684 /* 244 */ { "Private", opaque, NULL },
1685 /* 245 */ { "Private", opaque, NULL },
1686 /* 246 */ { "Private", opaque, NULL },
1687 /* 247 */ { "Private", opaque, NULL },
1688 /* 248 */ { "Private", opaque, NULL },
1689 /* 249 */ { "Private/Classless Static Route (Microsoft)", special, NULL},
1690 /* 250 */ { "Private", opaque, NULL },
1691 /* 251 */ { "Private", opaque, NULL },
1692 /* 252 */ { "Private/Proxy autodiscovery", string, &hf_dhcp_option_private_proxy_autodiscovery },
1693 /* 253 */ { "Private", opaque, NULL },
1694 /* 254 */ { "Private", opaque, NULL },
1695 /* 255 */ { "End", opaque, NULL }
1698 static void
1699 dhcp_time_in_s_secs_fmt(char *s, uint32_t v)
1701 /* Only used by option 2 Time Offset, which is deprecated. */
1702 char* secs_str = signed_time_secs_to_str(NULL, (int32_t)v);
1703 snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", secs_str, (int32_t)v);
1704 wmem_free(NULL, secs_str);
1707 static void
1708 dhcp_time_in_u_secs_fmt(char *s, uint32_t v)
1710 /* RFC 2131: 3.3 Interpretation and representation of time values */
1711 if (v != 0xffffffff) {
1712 char* secs_str = unsigned_time_secs_to_str(NULL, v);
1713 snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", secs_str, v);
1714 wmem_free(NULL, secs_str);
1715 } else {
1716 snprintf(s, ITEM_LABEL_LENGTH, "infinity (%d)", v);
1720 /*-------------------------------------
1721 * UAT for BOOTP
1722 *-------------------------------------
1724 /* UAT entry structure. */
1725 typedef struct {
1726 unsigned opt;
1727 char *text;
1728 enum field_type ftype;
1730 } uat_dhcp_record_t;
1732 static uat_dhcp_record_t *uat_dhcp_records;
1733 static uat_t *dhcp_uat;
1734 static unsigned num_dhcp_records_uat;
1735 static wmem_list_t *saved_uat_opts; /* List of previous options from UAT to "free" from dissection */
1737 static void* uat_dhcp_record_copy_cb(void* n, const void* o, size_t siz _U_) {
1738 uat_dhcp_record_t* new_record = (uat_dhcp_record_t *)n;
1739 const uat_dhcp_record_t* old_record = (const uat_dhcp_record_t *)o;
1741 new_record->text = g_strdup(old_record->text);
1743 return new_record;
1746 static bool uat_dhcp_record_update_cb(void* r, char** err) {
1747 uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
1749 if ((rec->opt == 0) || (rec->opt >=DHCP_OPT_NUM-1)) {
1750 *err = ws_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2);
1751 return false;
1753 return true;
1756 static void uat_dhcp_record_free_cb(void*r) {
1757 uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
1759 g_free(rec->text);
1762 UAT_DEC_CB_DEF(uat_dhcp_records, opt, uat_dhcp_record_t)
1763 UAT_CSTRING_CB_DEF(uat_dhcp_records, text, uat_dhcp_record_t)
1764 UAT_VS_DEF(uat_dhcp_records, ftype, uat_dhcp_record_t, enum field_type, special, "string")
1767 static const struct opt_info* dhcp_get_opt(unsigned int idx)
1769 if(idx>=DHCP_OPT_NUM)
1770 return NULL;
1772 return &dhcp_opt[idx];
1775 static const char *
1776 dhcp_get_opt_text(unsigned int idx)
1778 if(idx>=DHCP_OPT_NUM)
1779 return "unknown";
1780 return dhcp_opt[idx].text;
1783 struct basic_types_hfs {
1784 int* bytes;
1785 int* ipv4;
1786 int* ipv4_list;
1787 int* string;
1788 int* val_boolean;
1789 int* val_u_byte;
1790 int* val_u_short;
1791 int* val_u_short_list;
1792 int* val_u_long;
1793 int* time_in_s_secs;
1794 int* time_in_u_secs;
1797 /* Handle "basic" datatypes adding to a tree */
1798 static int
1799 dhcp_handle_basic_types(packet_info *pinfo, proto_tree *tree, proto_item *item, tvbuff_t *tvb,
1800 enum field_type ftype, int offset, int total_len,
1801 int *hf, const struct basic_types_hfs* hf_default)
1803 int i, left;
1804 int consumed = 0;
1806 switch (ftype) {
1807 case bytes:
1808 if (hf != NULL)
1809 proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1810 else if (hf_default->bytes != NULL)
1811 proto_tree_add_item(tree, *hf_default->bytes, tvb, offset, total_len, ENC_BIG_ENDIAN);
1812 consumed = total_len;
1813 break;
1815 case ipv4:
1816 if (total_len != 4) {
1817 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1818 break;
1821 if (hf != NULL)
1822 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1823 else if (hf_default->ipv4 != NULL)
1824 proto_tree_add_item(tree, *hf_default->ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1826 /* Show IP address in root of option */
1827 proto_item_append_text(tree, " (%s)", tvb_ip_to_str(pinfo->pool, tvb, offset));
1828 consumed = 4;
1829 break;
1831 case ipv4_list:
1832 for (i = offset, left = total_len; left > 0; i += 4, left -= 4) {
1833 if (left < 4) {
1834 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
1835 break;
1838 if (hf != NULL)
1839 proto_tree_add_item(tree, *hf, tvb, i, 4, ENC_BIG_ENDIAN);
1840 else if (hf_default->ipv4_list != NULL)
1841 proto_tree_add_item(tree, *hf_default->ipv4_list, tvb, i, 4, ENC_BIG_ENDIAN);
1842 consumed += 4;
1845 break;
1847 case string:
1848 if (hf != NULL)
1849 proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1850 else if (hf_default->string != NULL)
1851 proto_tree_add_item(tree, *hf_default->string, tvb, offset, total_len, ENC_BIG_ENDIAN);
1852 consumed = total_len;
1853 break;
1855 case val_boolean:
1856 if (total_len != 1) {
1857 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1858 break;
1861 if (hf != NULL)
1862 proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1863 else if (hf_default->val_boolean != NULL)
1864 proto_tree_add_item(tree, *hf_default->val_boolean, tvb, offset, 1, ENC_BIG_ENDIAN);
1865 consumed = 1;
1866 break;
1868 case val_u_byte:
1869 if (total_len != 1) {
1870 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1871 break;
1874 if (hf != NULL)
1875 proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1876 else if (hf_default->val_u_byte != NULL)
1877 proto_tree_add_item(tree, *hf_default->val_u_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
1878 consumed = 1;
1879 break;
1881 case val_u_short:
1882 if (total_len != 2) {
1883 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1884 break;
1887 if (hf != NULL)
1888 proto_tree_add_item(tree, *hf, tvb, offset, 2, ENC_BIG_ENDIAN);
1889 else if (hf_default->val_u_short != NULL)
1890 proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, ENC_BIG_ENDIAN);
1891 consumed = 2;
1892 break;
1894 case val_u_le_short:
1895 if (total_len != 2) {
1896 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1897 break;
1900 if (hf != NULL)
1901 proto_tree_add_item(tree, *hf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1902 else if (hf_default->val_u_short != NULL)
1903 proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1904 consumed = 2;
1905 break;
1907 case val_u_short_list:
1908 for (i = offset, left = total_len; left > 0; i += 2, left -= 2) {
1909 if (left < 2) {
1910 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
1911 break;
1914 if (hf != NULL)
1915 proto_tree_add_item(tree, *hf, tvb, i, 2, ENC_BIG_ENDIAN);
1916 else if (hf_default->val_u_short_list != NULL)
1917 proto_tree_add_item(tree, *hf_default->val_u_short_list, tvb, i, 2, ENC_BIG_ENDIAN);
1918 consumed += 2;
1920 break;
1922 case val_u_long:
1923 if (total_len != 4) {
1924 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1925 break;
1928 if (hf != NULL)
1929 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1930 else if (hf_default->val_u_long != NULL)
1931 proto_tree_add_item(tree, *hf_default->val_u_long, tvb, offset, 4, ENC_BIG_ENDIAN);
1932 consumed = 4;
1933 break;
1935 case time_in_s_secs:
1936 if (total_len != 4) {
1937 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1938 break;
1941 if (hf != NULL) {
1942 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1944 else if (hf_default->time_in_s_secs != NULL)
1945 proto_tree_add_item(tree, *hf_default->time_in_s_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1947 consumed = 4;
1948 break;
1950 case time_in_u_secs:
1951 if (total_len != 4) {
1952 expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1953 break;
1956 if (hf != NULL) {
1957 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1959 else if (hf_default->time_in_u_secs != NULL)
1960 proto_tree_add_item(tree, *hf_default->time_in_u_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1961 consumed = 4;
1962 break;
1963 default:
1964 /* Ignore other field_types */
1965 break;
1968 return consumed;
1971 static int
1972 dissect_dhcpopt_basic_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1974 const struct opt_info *opt;
1975 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
1976 static const struct basic_types_hfs default_hfs = {
1977 &hf_dhcp_option_value,
1978 &hf_dhcp_option_value_ip_address,
1979 &hf_dhcp_option_value_ip_address,
1980 &hf_dhcp_option_value_stringz,
1981 &hf_dhcp_option_value_boolean,
1982 &hf_dhcp_option_value_8,
1983 &hf_dhcp_option_value_16,
1984 &hf_dhcp_option_value_16,
1985 &hf_dhcp_option_value_u32,
1986 &hf_dhcp_option_value_s_secs,
1987 &hf_dhcp_option_value_u_secs,
1990 opt = dhcp_get_opt(option_data->option);
1991 if (opt == NULL)
1992 return 0;
1994 return dhcp_handle_basic_types(pinfo, tree, tree, tvb, opt->ftype,
1995 0, tvb_reported_length(tvb), opt->phf, &default_hfs);
1998 /* Returns the number of bytes consumed by this option. */
1999 static int
2000 dhcp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
2001 int eoff, bool first_pass, bool *at_end, const char **dhcp_type_p,
2002 const uint8_t **vendor_class_id_p, uint8_t *overload_p)
2004 const struct opt_info *opt;
2005 unsigned char code = tvb_get_uint8(tvb, voff);
2006 int optlen;
2007 int i, consumed;
2008 proto_tree *v_tree;
2009 proto_item *vti, *ti_value;
2010 tvbuff_t *option_tvb;
2011 dhcp_option_data_t option_data;
2013 /* Options whose length isn't "optlen + 2". */
2014 switch (code) {
2016 case 0: /* Padding */
2017 /* check how much padding we have */
2018 for (i = voff + 1; i < eoff; i++ ) {
2019 if (tvb_get_uint8(tvb, i) != 0) {
2020 break;
2023 i = i - voff;
2024 if (!first_pass) {
2025 if (bp_tree != NULL) {
2026 vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2027 tvb, voff, 1, 0, "(0) Padding");
2028 v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2029 proto_tree_add_item(v_tree, hf_dhcp_option_padding, tvb, voff, i, ENC_NA);
2032 consumed = i;
2033 return consumed;
2035 case 255: /* End Option */
2036 if (!first_pass) {
2037 if (bp_tree != NULL) {
2038 vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2039 tvb, voff, 1, 0, "(255) End");
2040 v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2041 if (*overload_p)
2042 proto_tree_add_item(v_tree, hf_dhcp_option_end_overload, tvb, voff, 1, ENC_BIG_ENDIAN);
2043 else
2044 proto_tree_add_item(v_tree, hf_dhcp_option_end, tvb, voff, 1, ENC_BIG_ENDIAN);
2047 *at_end = true;
2048 consumed = 1;
2049 return consumed;
2053 * Get the length of the option, and the number of bytes it
2054 * consumes (the length doesn't include the option code or
2055 * length bytes).
2057 * On the first pass, check first whether we have the length
2058 * byte, so that we don't throw an exception; if we throw an
2059 * exception in the first pass, which is only checking for options
2060 * whose values we need in order to properly dissect the packet
2061 * on the second pass, we won't actually dissect the options, so
2062 * you won't be able to see which option had the problem.
2064 if (first_pass) {
2065 if (!tvb_bytes_exist(tvb, voff+1, 1)) {
2067 * We don't have the length byte; just return 1
2068 * as the number of bytes we consumed, to count
2069 * the code byte.
2071 return 1;
2074 optlen = tvb_get_uint8(tvb, voff+1);
2075 consumed = optlen + 2;
2078 * In the first pass, we don't put anything into the protocol
2079 * tree; we just check for some options we have to look at
2080 * in order to properly process the packet:
2082 * 52 (Overload) - we need this to properly dissect the
2083 * file and sname fields
2085 * 53 (DHCP message type) - if this is present, this is DHCP
2087 * 60 (Vendor class identifier) - we need this in order to
2088 * interpret the vendor-specific info
2090 * We also check, before fetching anything, to make sure we
2091 * have the entire item we're fetching, so that we don't throw
2092 * an exception.
2094 if (first_pass) {
2095 if (tvb_bytes_exist(tvb, voff+2, consumed-2)) {
2096 switch (code) {
2098 case 52:
2099 *overload_p = tvb_get_uint8(tvb, voff+2);
2100 break;
2102 case 53:
2103 *dhcp_type_p =
2104 val_to_str(tvb_get_uint8(tvb, voff+2),
2105 opt53_text,
2106 "Unknown Message Type (0x%02x)");
2107 break;
2109 case 60:
2110 *vendor_class_id_p =
2111 tvb_get_string_enc(pinfo->pool,
2112 tvb, voff+2, consumed-2, ENC_ASCII);
2113 break;
2114 case 119:
2115 rfc3396_dns_domain_search_list.total_number_of_block++;
2116 break;
2117 case 120:
2118 rfc3396_sip_server.total_number_of_block++;
2119 break;
2124 * We don't do anything else here.
2126 return consumed;
2129 /* Normal cases */
2130 opt = dhcp_get_opt(code);
2131 if (opt == NULL)
2133 /* THIS SHOULD NEVER HAPPEN!!! */
2134 return consumed;
2137 vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2138 tvb, voff, consumed, code, "(%d) %s", code, opt->text);
2139 v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2140 proto_tree_add_item(v_tree, hf_dhcp_option_length, tvb, voff+1, 1, ENC_BIG_ENDIAN);
2142 ti_value = proto_tree_add_item(v_tree, hf_dhcp_option_value, tvb, voff+2, optlen, ENC_NA);
2143 proto_item_set_hidden(ti_value);
2145 /* prepare data for dissector table */
2146 option_tvb = tvb_new_subset_length(tvb, voff+2, optlen);
2147 option_data.option = code;
2148 option_data.overload = overload_p;
2149 option_data.dhcp_type = *dhcp_type_p;
2150 option_data.vendor_class_id = *vendor_class_id_p;
2151 option_data.orig_tvb = tvb;
2153 if (!dissector_try_uint_new(dhcp_option_table, code, option_tvb, pinfo, v_tree, false, &option_data)) {
2154 /* hf_dhcp_option_value is already in tree, just make it visible */
2155 proto_item_set_visible(ti_value);
2158 return consumed;
2161 static int
2162 dissect_dhcpopt_policy_filter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2164 int offset = 0;
2166 while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2167 proto_tree_add_item(tree, hf_dhcp_option_policy_filter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2168 offset += 4;
2169 proto_tree_add_item(tree, hf_dhcp_option_policy_filter_subnet_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2170 offset += 4;
2173 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2174 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2177 return tvb_captured_length(tvb);
2180 static int
2181 dissect_dhcpopt_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2183 int offset = 0;
2185 while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2186 proto_tree_add_item(tree, hf_dhcp_option_static_route_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2187 offset += 4;
2188 proto_tree_add_item(tree, hf_dhcp_option_static_route_router, tvb, offset, 4, ENC_BIG_ENDIAN);
2189 offset += 4;
2192 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2193 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2196 return tvb_captured_length(tvb);
2199 typedef unsigned(*test_option_len_t)(unsigned);
2201 /* Look for 'encapsulated vendor-specific options' */
2202 static bool
2203 test_encapsulated_vendor_options(tvbuff_t *tvb, int optoff, int optend, test_option_len_t test_len)
2205 uint8_t subopt;
2206 uint8_t subopt_len;
2208 while (optoff < optend) {
2209 subopt = tvb_get_uint8(tvb, optoff);
2210 optoff++;
2212 /* Skip padding */
2213 if (subopt == 0)
2214 continue;
2215 /* We are done, skip any remaining bytes */
2216 if (subopt == 255)
2217 break;
2219 /* We expect a length byte next */
2220 if (optoff >= optend)
2221 return false;
2222 subopt_len = tvb_get_uint8(tvb, optoff);
2224 if (test_len) {
2225 unsigned expected_subopt_len = test_len(subopt);
2226 if (expected_subopt_len && expected_subopt_len != subopt_len)
2227 return false;
2229 optoff++;
2231 /* Check remaining room for suboption in option */
2232 if (optoff + subopt_len > optend)
2233 return false;
2234 optoff += subopt_len;
2236 return true;
2239 /* Note that Option 43 encapsulated vendor-specific options (RFC 2132 8.4)
2240 * treat option 0 as padding and option 255 as end of suboptions, unlike
2241 * Option 125 which does not treat them specially (RFC 3925 4).
2243 static int
2244 dissect_option43_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
2245 tvbuff_t *tvb)
2247 unsigned suboptoff = 0;
2248 unsigned optend = tvb_reported_length(tvb);
2249 uint8_t subopt;
2250 uint32_t subopt_len;
2251 proto_item *item;
2252 proto_tree *sub_tree;
2254 item = proto_tree_add_item(v_tree, hf_dhcp_option43_suboption, tvb, suboptoff, 1, ENC_NA);
2255 subopt = tvb_get_uint8(tvb, suboptoff);
2257 suboptoff+=1;
2259 if (subopt == 0) {
2260 /* Padding */
2261 return suboptoff;
2264 if (subopt == 255) {
2265 /* END */
2266 /* XXX - Should there be expert info if there are more bytes? */
2267 return optend;
2270 if (suboptoff >= optend) {
2271 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
2272 "Suboption %d: no room left in option for suboption length", subopt);
2273 return optend;
2276 sub_tree = proto_item_add_subtree(item, ett_dhcp_option43_suboption);
2277 proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
2278 suboptoff++;
2280 if (suboptoff+subopt_len > optend) {
2281 expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
2282 "Suboption %d: no room left in option for suboption value", subopt);
2283 return optend;
2286 proto_tree_add_item(sub_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2287 suboptoff+= subopt_len;
2289 return suboptoff;
2293 static int
2294 dissect_dhcpopt_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2296 heur_dtbl_entry_t *hdtbl_entry;
2298 if (!dissector_try_heuristic(dhcp_vendor_info_subdissector, tvb, pinfo, tree, &hdtbl_entry, data)) {
2299 int offset = 0;
2300 if (test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), NULL)) {
2301 /* Generic encapsulated options per RFC 2132 8.4 */
2302 while (tvb_reported_length_remaining(tvb, offset)) {
2303 offset += dissect_option43_generic_suboption(pinfo, proto_tree_get_parent(tree), tree, tvb_new_subset_remaining(tvb, offset));
2305 } else {
2306 /* Default Vendor-Specific Info.. display in bytes */
2307 proto_tree_add_item(tree, hf_dhcp_option43_value, tvb, offset, tvb_reported_length(tvb), ENC_NA);
2311 return tvb_captured_length(tvb);
2314 static int
2315 dissect_dhcpopt_option_overload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2317 int offset = 0;
2318 int suboffset, suboffset_end;
2319 bool at_end;
2320 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2321 uint32_t byte;
2323 if (tvb_reported_length(tvb) < 1) {
2324 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2325 return 1;
2328 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_option_overload, tvb, offset, 1, ENC_BIG_ENDIAN, &byte);
2330 /* Just in case we find an option 52 in sname or file */
2331 if ((*option_data->overload >= 1) && (*option_data->overload <= 3)) {
2332 if (byte & OPT_OVERLOAD_SNAME) {
2333 proto_item *oti;
2334 proto_tree *overload_tree = proto_tree_add_subtree(tree, option_data->orig_tvb,
2335 SERVER_NAME_OFFSET, SERVER_NAME_LEN, ett_dhcp_server_hostname, &oti,
2336 "Server host name option overload");
2337 uint8_t ignore_overload = 0;
2338 suboffset = SERVER_NAME_OFFSET;
2339 suboffset_end = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
2340 at_end = false;
2341 rfc3396_dns_domain_search_list.index_current_block = 0;
2342 rfc3396_sip_server.index_current_block = 0;
2343 while (suboffset < suboffset_end && !at_end) {
2344 suboffset += dhcp_option(option_data->orig_tvb, pinfo, overload_tree, suboffset,
2345 suboffset_end, false, &at_end,
2346 &option_data->dhcp_type, &option_data->vendor_class_id,
2347 &ignore_overload);
2349 if (!at_end)
2351 expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_sname_end_missing);
2354 if (byte & OPT_OVERLOAD_FILE) {
2355 proto_item *oti;
2356 proto_tree *overload_tree = proto_tree_add_subtree(tree, option_data->orig_tvb,
2357 FILE_NAME_OFFSET, FILE_NAME_LEN, ett_dhcp_filename_option, &oti,
2358 "Boot file name option overload");
2359 uint8_t ignore_overload = 0;
2360 suboffset = FILE_NAME_OFFSET;
2361 suboffset_end = FILE_NAME_OFFSET + FILE_NAME_LEN;
2362 at_end = false;
2363 rfc3396_dns_domain_search_list.index_current_block = 0;
2364 rfc3396_sip_server.index_current_block = 0;
2365 while (suboffset < suboffset_end && !at_end) {
2366 suboffset += dhcp_option(option_data->orig_tvb, pinfo, overload_tree, suboffset,
2367 suboffset_end, false, &at_end,
2368 &option_data->dhcp_type, &option_data->vendor_class_id,
2369 &ignore_overload);
2371 if (!at_end)
2373 expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_file_end_missing);
2376 /* The final end option is not in overload */
2377 *option_data->overload = 0;
2380 return tvb_captured_length(tvb);
2383 static int
2384 dissect_dhcpopt_dhcp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2386 uint32_t type;
2388 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp, tvb, 0, 1, ENC_NA, &type);
2389 /* Show the message type name on the Message Type option, and in the protocol root */
2390 proto_item_append_text(tree, " (%s)", val_to_str(type, opt53_text, "Unknown Message Type (0x%02x)"));
2391 proto_item_append_text(proto_item_get_parent(tree), " (%s)", val_to_str(type, opt53_text, "Unknown Message Type (0x%02x)"));
2393 return tvb_captured_length(tvb);
2396 static int
2397 dissect_dhcpopt_param_request_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2399 int offset = 0;
2400 uint8_t byte;
2402 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2403 byte = tvb_get_uint8(tvb, offset);
2404 proto_tree_add_uint_format_value(tree, hf_dhcp_option_parameter_request_list_item,
2405 tvb, offset, 1, byte, "(%d) %s", byte, dhcp_get_opt_text(byte));
2406 offset++;
2409 return tvb_captured_length(tvb);
2412 static int
2413 dissect_dhcpopt_vendor_class_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2415 heur_dtbl_entry_t *hdtbl_entry;
2418 * XXX - RFC 2132 says this is a string of octets;
2419 * should we check for non-printables?
2421 proto_tree_add_item(tree, hf_dhcp_option_vendor_class_id, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
2422 dissector_try_heuristic(dhcp_vendor_id_subdissector, tvb, pinfo, tree, &hdtbl_entry, data);
2424 return tvb_captured_length(tvb);
2427 static int
2428 dissect_dhcpopt_client_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2430 int offset = 0;
2431 int length = tvb_reported_length(tvb);
2432 unsigned char byte;
2434 if (length > 0)
2435 byte = tvb_get_uint8(tvb, offset);
2436 else
2437 byte = 0;
2439 /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2440 guess that the first is the hwtype, and the last 6
2441 are the hw addr */
2442 /* See https://www.iana.org/assignments/arp-parameters */
2443 /* RFC2132 9.14 Client-identifier has the following to say:
2444 A hardware type of 0 (zero) should be used when the value
2445 field contains an identifier other than a hardware address
2446 (e.g. a fully qualified domain name). */
2448 if (length == 7 && byte > 0 && byte < 48) {
2449 proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2451 if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2452 proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2453 else
2454 proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2455 tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2456 } else if (length == 17 && byte == 0) {
2457 /* Identifier is a UUID */
2458 proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2460 /* From RFC 4361 paragraph 6.1 DHCPv4 Client Behavior:
2461 To send an RFC 3315-style binding identifier in a DHCPv4 'client
2462 identifier' option, the type of the 'client identifier' option is set
2463 to 255. */
2464 } else if (byte == 255) {
2465 uint16_t duidtype;
2466 uint16_t hwtype;
2468 /* The type field is immediately followed by the IAID, which is
2469 an opaque 32-bit quantity */
2470 proto_tree_add_string(tree, hf_dhcp_client_id_iaid, tvb, offset+1, 4,
2471 tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 4, byte));
2472 offset += 5;
2473 duidtype = tvb_get_ntohs(tvb, offset);
2474 proto_tree_add_item(tree, hf_dhcp_client_id_duid_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2475 switch (duidtype) {
2476 case DUID_LLT:
2477 if (length < 8) {
2478 expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2479 break;
2481 hwtype=tvb_get_ntohs(tvb, offset + 2);
2482 proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_llt_hw_type,
2483 tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2485 /* XXX seconds since Jan 1 2000 */
2486 proto_tree_add_item(tree, hf_dhcp_client_identifier_time, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2487 if (length > 8) {
2488 proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 8,
2489 length - 13, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+8, length-13, hwtype));
2490 if(DHCP_HW_IS_ETHER(hwtype, length-13)) {
2491 proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2492 tvb, offset+8, length-13, ENC_NA);
2495 break;
2496 case DUID_EN:
2497 if (length < 6) {
2498 expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2499 break;
2501 proto_tree_add_item(tree, hf_dhcp_client_identifier_enterprise_num, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
2502 if (length > 6) {
2503 proto_tree_add_item(tree, hf_dhcp_client_identifier, tvb, offset + 6, length - 11, ENC_NA);
2505 break;
2506 case DUID_LL:
2507 if (length < 4) {
2508 expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2509 break;
2511 hwtype=tvb_get_ntohs(tvb, offset + 2);
2512 proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_ll_hw_type,
2513 tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2515 if (length > 4) {
2516 proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 4,
2517 length - 9, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+4, length-9, hwtype));
2518 if(DHCP_HW_IS_ETHER(hwtype, length-9)) {
2519 proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2520 tvb, offset+4, length-9, ENC_NA);
2523 break;
2525 } else if (byte == 0 && length > 1) {
2526 /* identifier other than a hardware address (e.g. a fully qualified domain name) */
2527 proto_tree_add_item(tree, hf_dhcp_client_identifier_type, tvb, offset, 1, ENC_NA);
2528 proto_tree_add_item(tree, hf_dhcp_client_identifier_undef, tvb, offset+1, length-1, ENC_ASCII);
2529 } else {
2530 /* otherwise, it's opaque data */
2533 return tvb_captured_length(tvb);
2536 static int
2537 dissect_dhcpopt_user_class_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2539 unsigned char user_class_instance_index = 0;
2540 int offset = 0;
2541 proto_item *vtix, *len_item;
2542 proto_tree *o77_v_tree;
2543 unsigned class_length, uci_len = tvb_reported_length(tvb);
2544 if (uci_len < 2) {
2545 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2546 return 1;
2549 /* First byte is the length of User Class data. If it is zero, then let's assume this
2550 * is a Microsoft variant that has the two-byte length field with most-significant byte
2551 * as zero.
2553 uint16_t ms_data_length = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2554 if (ms_data_length <= 0xff) {
2555 /* MSB is zero, this is Microsoft */
2556 proto_tree_add_uint(tree, hf_dhcp_option77_user_class_binary_data_length, tvb, offset, 2, ms_data_length);
2557 offset += 2;
2558 proto_tree_add_item(tree, hf_dhcp_option77_user_class_binary_data, tvb, offset, ms_data_length, ENC_STRING);
2559 offset += ms_data_length;
2560 /* User Class Binary Data is padded to 4-byte boundary */
2561 uint16_t padding_length = (4 - (ms_data_length % 4)) & 0x3;
2562 if (padding_length > 0) {
2563 proto_tree_add_item(tree, hf_dhcp_option77_user_class_padding, tvb, offset, padding_length, ENC_NA);
2564 offset += padding_length;
2566 uint32_t len;
2567 proto_tree_add_item_ret_uint(tree, hf_dhcp_option77_user_class_name_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2568 offset += 2;
2569 proto_tree_add_item(tree, hf_dhcp_option77_user_class_name, tvb, offset, len, ENC_UTF_16);
2570 offset += len;
2571 proto_tree_add_item_ret_uint(tree, hf_dhcp_option77_user_class_description_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2572 offset += 2;
2573 proto_tree_add_item(tree, hf_dhcp_option77_user_class_description, tvb, offset, len, ENC_UTF_16);
2575 return tvb_captured_length(tvb);
2578 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2579 class_length = tvb_get_uint8(tvb, offset);
2580 if (class_length >= uci_len) {
2581 /* Having the sum of the User Class data lengths exceed the total User Option Information length (uci_len)
2582 * is a violation of RFC 3004. In that case the remaining data is treated as a non-conformant (text) option.
2583 * This check will also catch the Microsoft 'variation' implementation (when Vendor class identifier contains
2584 * "MSFT 5.0") such as "RRAS.Microsoft" and others like "iPXE".
2585 * In the unlikely case that the first character can be interpreted as a valid length the next iteration
2586 * of this while loop will catch that.
2587 * https://gitlab.com/wireshark/wireshark/-/issues/16349
2588 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/fe8a2dd4-1e8c-4546-bacd-4ae10de02058
2590 proto_item *expert_ti = proto_tree_add_item(tree, hf_dhcp_option77_user_class_text, tvb, offset, uci_len, ENC_ASCII);
2591 expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
2592 break;
2595 /* Create subtree for instance of User Class. */
2596 vtix = proto_tree_add_uint_format_value(tree, hf_dhcp_option77_user_class,
2597 tvb, offset, 1, user_class_instance_index, "[%d]", user_class_instance_index);
2598 o77_v_tree = proto_item_add_subtree(vtix, ett_dhcp_option77_instance);
2600 /* Add length for instance of User Class. */
2601 len_item = proto_tree_add_uint(o77_v_tree, hf_dhcp_option77_user_class_length, tvb, offset, 1, class_length);
2602 proto_item_set_len(vtix, class_length+1);
2603 offset++;
2605 if (class_length == 0) {
2606 expert_add_info_format(pinfo, len_item, &ei_dhcp_bad_length, "UC_Len_%u isn't >= 1 (UC_Len_%u = 0)", user_class_instance_index, user_class_instance_index);
2607 break;
2610 /* Add data for instance of User Class. */
2611 proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_data, tvb, offset, class_length, ENC_NA);
2613 offset += class_length;
2614 uci_len -= class_length + 1;
2615 user_class_instance_index++;
2618 return tvb_captured_length(tvb);
2621 static int
2622 dissect_dhcpopt_slp_directory_agent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2624 int offset = 0;
2625 uint32_t byte;
2627 if (tvb_reported_length(tvb) < 1) {
2628 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2629 return 1;
2632 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_slp_directory_agent_value, tvb, offset, 1, ENC_BIG_ENDIAN, &byte);
2633 offset++;
2635 if (byte == 0x80) {
2636 if (tvb_reported_length_remaining(tvb, offset) == 0)
2637 return offset;
2639 offset++;
2642 while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2643 proto_tree_add_item(tree, hf_dhcp_option_slp_directory_agent_slpda_address, tvb, offset, 4, ENC_BIG_ENDIAN);
2644 offset += 4;
2647 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2648 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2651 return tvb_captured_length(tvb);
2654 static int
2655 dissect_dhcpopt_slp_service_scope(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2657 int offset = 0;
2659 proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2661 offset++;
2662 proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_string, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2664 return tvb_captured_length(tvb);
2667 static int
2668 dissect_dhcpopt_client_full_domain_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2670 static int * const fqdn_hf_flags[] = {
2671 &hf_dhcp_fqdn_mbz,
2672 &hf_dhcp_fqdn_n,
2673 &hf_dhcp_fqdn_e,
2674 &hf_dhcp_fqdn_o,
2675 &hf_dhcp_fqdn_s,
2676 NULL
2678 uint8_t fqdn_flags;
2679 int offset = 0, length = tvb_reported_length(tvb);
2680 const unsigned char *dns_name;
2681 int dns_name_len;
2683 if (length < 3) {
2684 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3");
2685 return 1;
2688 fqdn_flags = tvb_get_uint8(tvb, offset);
2689 proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_fqdn_flags,
2690 ett_dhcp_fqdn_flags, fqdn_hf_flags, ENC_BIG_ENDIAN);
2692 /* XXX: use code from packet-dns for return code decoding */
2693 proto_tree_add_item(tree, hf_dhcp_fqdn_rcode1, tvb, offset+1, 1, ENC_BIG_ENDIAN);
2694 /* XXX: use code from packet-dns for return code decoding */
2695 proto_tree_add_item(tree, hf_dhcp_fqdn_rcode2, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2697 if (length > 3) {
2698 if (fqdn_flags & F_FQDN_E) {
2699 get_dns_name(tvb, offset+3, length-3, offset+3, (const char **)&dns_name, &dns_name_len);
2700 proto_tree_add_string(tree, hf_dhcp_fqdn_name,
2701 tvb, offset+3, length-3, format_text(pinfo->pool, dns_name, dns_name_len));
2702 } else {
2703 proto_tree_add_item(tree, hf_dhcp_fqdn_asciiname, tvb, offset+3, length-3, ENC_ASCII);
2707 return tvb_captured_length(tvb);
2710 static int
2711 dissect_dhcpopt_novell_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2713 int offset = 0;
2715 /* Option 85 can be sent as a string */
2716 /* Added by Greg Morris (gmorris[AT]novell.com) */
2717 if (novell_string) {
2718 proto_tree_add_item(tree, hf_dhcp_option_novell_dss_string, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
2719 } else {
2720 /* IP addresses */
2721 while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2723 proto_tree_add_item(tree, hf_dhcp_option_novell_dss_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2724 offset += 4;
2727 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2728 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2732 return tvb_captured_length(tvb);
2735 static int
2736 dissect_dhcpopt_dhcp_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2738 int offset = 0;
2739 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2740 uint32_t protocol, rdm;
2741 uint8_t algorithm;
2743 if (tvb_reported_length(tvb) < 11) {
2744 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 11");
2745 return 1;
2748 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_protocol, tvb, offset, 1, ENC_BIG_ENDIAN, &protocol);
2749 offset++;
2751 algorithm = tvb_get_uint8(tvb, offset);
2752 switch (protocol) {
2754 case AUTHEN_PROTO_DELAYED_AUTHEN:
2755 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_alg_delay, tvb, offset, 1, ENC_BIG_ENDIAN);
2756 break;
2758 default:
2759 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN);
2760 break;
2762 offset++;
2764 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_rdm, tvb, offset, 1, ENC_BIG_ENDIAN, &rdm);
2765 offset++;
2767 switch (rdm) {
2769 case AUTHEN_RDM_MONOTONIC_COUNTER:
2770 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_replay_detection, tvb, offset, 8, ENC_BIG_ENDIAN);
2771 break;
2773 default:
2774 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_rdv, tvb, offset, 8, ENC_ASCII);
2775 break;
2777 offset += 8;
2779 switch (protocol) {
2781 case AUTHEN_PROTO_DELAYED_AUTHEN:
2782 switch (algorithm) {
2784 case AUTHEN_DELAYED_ALGO_HMAC_MD5:
2785 if (option_data->dhcp_type && !strcmp(option_data->dhcp_type, OPT53_DISCOVER)) {
2786 /* Discover has no Secret ID nor HMAC MD5 Hash */
2787 break;
2788 } else {
2789 if (tvb_reported_length_remaining(tvb, offset) < 20) {
2790 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 20");
2791 break;
2794 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_secret_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2795 offset += 4;
2796 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_hmac_md5_hash, tvb, offset, 16, ENC_NA);
2797 break;
2800 default:
2801 if (tvb_reported_length_remaining(tvb, offset) == 0)
2802 break;
2804 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2805 break;
2807 break;
2809 default:
2810 if (tvb_reported_length_remaining(tvb, offset) == 0)
2811 break;
2813 proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2814 break;
2817 return tvb_captured_length(tvb);
2820 static int
2821 dissect_dhcpopt_client_architecture(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2823 int offset = 0;
2825 while (tvb_reported_length_remaining(tvb, offset) > 1) {
2826 uint32_t architecture_id;
2827 proto_item *pi;
2829 pi = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_client_system_architecture, tvb, offset, 2, ENC_BIG_ENDIAN, &architecture_id);
2830 offset += 2;
2833 * Some Client Architecture IDs are widely misused. For
2834 * details, refer to the comment at the definition of
2835 * dhcp_client_arch.
2837 * The most common problem is a client using architecture ID 9
2838 * when performing an EFI x64 boot. Windows Server 2008 WDS
2839 * does not recognize ID 9, but most other DHCP servers
2840 * (including newer versions of WDS) silently map architecture
2841 * ID 9 to x64 in order to accommodate these clients.
2843 if (architecture_id == 9) {
2844 expert_add_info_format(pinfo, pi, &ei_dhcp_option93_client_arch_ambiguous, "Client Architecture ID 9 is often incorrectly used for EFI x64");
2848 * Technically, architecture ID 7 is ambiguous for the same
2849 * reason, but it's extremely unlikely to be a real world
2850 * problem, so a warning would probably just be unwelcome
2851 * noise.
2854 if (tvb_reported_length_remaining(tvb, offset) > 0) {
2855 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
2858 return tvb_captured_length(tvb);
2861 static int
2862 dissect_dhcpopt_client_network_interface_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2864 int offset = 0;
2865 uint8_t id_type;
2867 id_type = tvb_get_uint8(tvb, offset);
2868 offset++;
2870 if (id_type == 0x01) {
2871 proto_tree_add_item(tree, hf_dhcp_option_client_network_id_major_ver,
2872 tvb, offset, 1, ENC_LITTLE_ENDIAN);
2873 offset++;
2874 proto_tree_add_item(tree, hf_dhcp_option_client_network_id_minor_ver,
2875 tvb, offset, 1, ENC_LITTLE_ENDIAN);
2878 return tvb_captured_length(tvb);
2881 static int
2882 dissect_dhcpopt_client_identifier_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2884 int offset = 0, length = tvb_reported_length(tvb);
2885 uint8_t byte;
2887 if (length > 0)
2888 byte = tvb_get_uint8(tvb, offset);
2889 else
2890 byte = 0;
2892 /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2893 guess that the first is the hwtype, and the last 6
2894 are the hw addr */
2895 /* See https://www.iana.org/assignments/arp-parameters */
2896 /* RFC2132 9.14 Client-identifier has the following to say:
2897 A hardware type of 0 (zero) should be used when the value
2898 field contains an identifier other than a hardware address
2899 (e.g. a fully qualified domain name). */
2901 if (length == 7 && byte > 0 && byte < 48) {
2902 proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2903 if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2904 proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2905 else
2906 proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2907 tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2908 } else if (length == 17 && byte == 0) {
2909 /* Identifier is a UUID */
2910 proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2911 } else {
2912 /* otherwise, it's opaque data */
2915 return tvb_captured_length(tvb);
2918 static int
2919 dissect_dhcpopt_civic_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2921 int offset = 0;
2923 if (tvb_reported_length(tvb) >= 3)
2925 proto_tree_add_item(tree, hf_dhcp_option_civic_location_what, tvb, offset, 1, ENC_BIG_ENDIAN);
2926 offset++;
2927 proto_tree_add_item(tree, hf_dhcp_option_civic_location_country, tvb, offset, 2, ENC_ASCII);
2928 offset += 2;
2930 while (tvb_reported_length_remaining(tvb, offset) >= 2)
2932 uint32_t calength;
2933 proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2934 offset++;
2935 proto_tree_add_item_ret_uint(tree, hf_dhcp_option_civic_location_ca_length, tvb, offset, 1, ENC_BIG_ENDIAN, &calength);
2936 offset++;
2938 if (calength == 0)
2939 continue;
2941 if (tvb_reported_length_remaining(tvb, offset) >= (int)calength)
2943 proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_value, tvb, offset, calength, ENC_ASCII);
2944 offset += calength;
2946 else
2948 expert_add_info(pinfo, tree, &ei_dhcp_option_civic_location_bad_cattype);
2949 break;
2954 return tvb_captured_length(tvb);
2957 static int
2958 dissect_dhcpopt_name_server_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2960 int offset = 0, length = tvb_reported_length(tvb);
2961 uint16_t ns;
2963 if (length < 2) {
2964 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2965 return 1;
2966 } else if (length & 1) {
2967 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length (%u) isn't even number", length);
2968 return 1;
2971 while (tvb_reported_length_remaining(tvb, offset) > 0) {
2972 ns = tvb_get_ntohs(tvb, offset);
2973 /* XXX - Make this a value_string */
2974 switch (ns) {
2975 case RFC2937_LOCAL_NAMING_INFORMATION:
2976 proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Local naming information (e.g., an /etc/hosts file on a UNIX machine) (0)");
2977 break;
2978 case RFC2937_DOMAIN_NAME_SERVER_OPTION:
2979 proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Domain Name Server Option (6)");
2980 break;
2981 case RFC2937_NETWORK_INFORMATION_SERVERS_OPTION:
2982 proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Servers Option (41)");
2983 break;
2984 case RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION:
2985 proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "NetBIOS over TCP/IP Name Server Option (44)");
2986 break;
2987 case RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION:
2988 proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Service+ Servers Option (65)");
2989 break;
2990 default:
2991 expert_add_info_format(pinfo, tree, &ei_dhcp_option_dhcp_name_service_invalid,
2992 "Invalid Name Service (%u). RFC 2937 defines only 0, 6, 41, 44, and 65 as possible values.", ns);
2993 break;
2995 offset += 2;
2998 return tvb_captured_length(tvb);
3001 static int
3002 dissect_dhcpopt_dhcp_domain_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3004 int length = tvb_reported_length(tvb);
3005 char *name_out;
3006 const unsigned char *dns_name;
3007 int dns_name_len;
3009 /* Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4) (RFC 3396) */
3010 /* Domain Names - Implementation And Specification (RFC 1035) */
3011 rfc3396_dns_domain_search_list.index_current_block++;
3012 if (rfc3396_dns_domain_search_list.total_number_of_block > 1) {
3013 proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_rfc_3396_detected, tvb, 0, length,
3014 wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_dns_domain_search_list.index_current_block, rfc3396_dns_domain_search_list.total_number_of_block));
3015 if (rfc3396_dns_domain_search_list.index_current_block != rfc3396_dns_domain_search_list.total_number_of_block) {
3016 proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_refer_last_option, tvb, 0, length,
3017 wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_dns_domain_search_list.total_number_of_block, rfc3396_dns_domain_search_list.total_number_of_block));
3021 if (rfc3396_dns_domain_search_list.tvb_composite == NULL && length) {
3022 /* We use composite tvb for managing RFC 3396 */
3023 rfc3396_dns_domain_search_list.tvb_composite = tvb_new_composite();
3026 /* Concatenate the block before being interpreted for managing RFC 3396 */
3027 if (length)
3028 tvb_composite_append(rfc3396_dns_domain_search_list.tvb_composite, tvb_new_subset_length(tvb, 0, length));
3030 if (rfc3396_dns_domain_search_list.index_current_block == rfc3396_dns_domain_search_list.total_number_of_block
3031 && rfc3396_dns_domain_search_list.tvb_composite) {
3032 /* Here, we are into the last (or unique) option 119. */
3033 /* We will display the information about fqdn */
3034 unsigned int consumedx = 0;
3035 unsigned int composite_offset = 0;
3036 tvb_composite_finalize(rfc3396_dns_domain_search_list.tvb_composite);
3038 while (composite_offset < tvb_reported_length(rfc3396_dns_domain_search_list.tvb_composite)) {
3039 /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3040 consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, composite_offset,
3041 tvb_reported_length(rfc3396_dns_domain_search_list.tvb_composite), 0, (const char **)&dns_name, &dns_name_len);
3042 name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3043 if (rfc3396_dns_domain_search_list.total_number_of_block == 1) {
3044 /* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
3045 proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_fqdn, tvb, composite_offset, consumedx, name_out);
3046 } else {
3047 /* RFC 3396 is used, so the option is split into several option 119. We don't link fqdn with v_tree. */
3048 proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_fqdn, tvb, 0, 0, name_out);
3050 composite_offset += consumedx;
3052 rfc3396_dns_domain_search_list.tvb_composite = NULL;
3055 return tvb_captured_length(tvb);
3058 static int
3059 dissect_dhcpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3061 int length = tvb_reported_length(tvb);
3062 const unsigned char *dns_name;
3063 int dns_name_len;
3064 char *name_out;
3066 /* Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4) (RFC 3396) */
3067 /* Domain Names - Implementation And Specification (RFC 1035) */
3068 rfc3396_sip_server.index_current_block++;
3069 if (rfc3396_sip_server.total_number_of_block > 1) {
3070 proto_tree_add_string(tree, hf_dhcp_option_sip_server_rfc_3396_detected, tvb, 0, length,
3071 wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_sip_server.index_current_block, rfc3396_sip_server.total_number_of_block));
3072 if (rfc3396_sip_server.index_current_block != rfc3396_sip_server.total_number_of_block) {
3073 proto_tree_add_string(tree, hf_dhcp_option_sip_server_refer_last_option, tvb, 0, length,
3074 wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_sip_server.total_number_of_block, rfc3396_sip_server.total_number_of_block));
3078 if (rfc3396_sip_server.tvb_composite == NULL && length) {
3079 /* We use composite tvb for managing RFC 3396 */
3080 rfc3396_sip_server.tvb_composite = tvb_new_composite();
3083 /* Concatenate the block before being interpreted for managing RFC 3396 */
3084 if (length)
3085 tvb_composite_append(rfc3396_sip_server.tvb_composite, tvb_new_subset_length(tvb, 0, length));
3087 if (rfc3396_sip_server.index_current_block == rfc3396_sip_server.total_number_of_block
3088 && rfc3396_sip_server.tvb_composite) {
3089 /* Here, we are into the last (or unique) option 120. */
3090 /* We will display the information about SIP server */
3091 uint8_t enc;
3092 unsigned int composite_offset = 1; /* ignore enc */
3093 tvb_composite_finalize(rfc3396_sip_server.tvb_composite);
3095 enc = tvb_get_uint8(rfc3396_sip_server.tvb_composite, 0);
3096 if (rfc3396_sip_server.total_number_of_block == 1) {
3097 /* RFC 3396 is not used, so we can easily link the fqdn with tree. */
3098 proto_tree_add_uint(tree, hf_dhcp_option_sip_server_enc, tvb, 0, 1, enc);
3099 } else {
3100 /* RFC 3396 is used, so the option is split into several option 120. We don't link fqdn with tree. */
3101 proto_tree_add_uint(tree, hf_dhcp_option_sip_server_enc, tvb, 0, 0, enc);
3104 switch (enc) {
3105 case RFC_3361_ENC_FQDN: {
3106 unsigned int consumedx = 0;
3107 if (tvb_reported_length(rfc3396_sip_server.tvb_composite) < 3) {
3108 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3 (len = %u)", tvb_reported_length(rfc3396_sip_server.tvb_composite));
3109 break;
3112 while (composite_offset < tvb_reported_length(rfc3396_sip_server.tvb_composite)) {
3113 /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3114 consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, composite_offset, tvb_reported_length(rfc3396_sip_server.tvb_composite),
3115 1 /* ignore enc */, (const char **)&dns_name, &dns_name_len);
3116 name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3118 if (rfc3396_sip_server.total_number_of_block == 1) {
3119 /* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
3120 proto_tree_add_string(tree, hf_dhcp_option_sip_server_name, tvb, composite_offset, consumedx, name_out);
3121 } else {
3122 /* RFC 3396 is used, so the option is split into several option 120. We don't link fqdn with v_tree. */
3123 proto_tree_add_string(tree, hf_dhcp_option_sip_server_name, tvb, 0, 0, name_out);
3125 composite_offset += consumedx;
3127 rfc3396_sip_server.tvb_composite = NULL;
3128 break;
3130 case RFC_3361_ENC_IPADDR:
3131 if (tvb_reported_length(rfc3396_sip_server.tvb_composite) < 5) {
3132 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5 (len = %u)", tvb_reported_length(rfc3396_sip_server.tvb_composite));
3133 break;
3135 /* x % 2^n == x & (2^n - 1) note : (assuming x is a positive integer) */
3136 if ((tvb_reported_length(rfc3396_sip_server.tvb_composite) - 1) & 3) {
3137 if (rfc3396_sip_server.total_number_of_block == 1)
3138 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", tvb_reported_length(rfc3396_sip_server.tvb_composite));
3139 else
3140 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length,
3141 "length isn't a multiple of 4 plus 1 (len = %u). For your information with RFC 3396, the length is the length sum of all options 120 into this BOOTP packet.",
3142 tvb_reported_length(rfc3396_sip_server.tvb_composite));
3143 break;
3145 while (composite_offset < tvb_reported_length(rfc3396_sip_server.tvb_composite)) {
3146 if (rfc3396_sip_server.total_number_of_block == 1) {
3147 /* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
3148 proto_tree_add_item(tree, hf_dhcp_option_sip_server_address, tvb, composite_offset, 4, ENC_BIG_ENDIAN);
3149 } else {
3150 uint32_t sip_server = tvb_get_ipv4(rfc3396_sip_server.tvb_composite, composite_offset);
3151 /* RFC 3396 is used, so the option is split into several option 120. We don't link fqdn with v_tree. */
3152 proto_tree_add_ipv4(tree, hf_dhcp_option_sip_server_address, tvb, 0, 0, sip_server);
3154 composite_offset += 4;
3156 break;
3157 default:
3158 expert_add_info_format(pinfo, tree, &ei_dhcp_option_sip_server_address_encoding, "RFC 3361 defines only 0 and 1 for Encoding byte (Encoding = %u).", enc);
3159 break;
3163 return tvb_captured_length(tvb);
3166 static int
3167 dissect_dhcpopt_classless_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3169 int offset = 0;
3170 int i, mask_width, significant_octets;
3171 proto_item* route_item;
3173 /* minimum length is 5 bytes */
3174 if (tvb_reported_length(tvb) < 5) {
3175 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5");
3176 return 1;
3178 while (tvb_reported_length_remaining(tvb, offset) > 0) {
3179 mask_width = tvb_get_uint8(tvb, offset);
3180 /* mask_width <= 32 */
3181 if (mask_width > 32) {
3182 expert_add_info_format(pinfo, tree, &ei_dhcp_option_classless_static_route, "Mask width (%d) > 32", mask_width);
3183 break;
3185 significant_octets = (mask_width + 7) / 8;
3186 route_item = proto_tree_add_bytes_format(tree, hf_dhcp_option_classless_static_route, tvb, offset,
3187 1 + significant_octets + 4, NULL, " ");
3188 offset++;
3189 /* significant octets + router(4) */
3190 if (tvb_reported_length_remaining(tvb, offset + significant_octets + 4) < 0) {
3191 expert_add_info_format(pinfo, route_item, &ei_dhcp_bad_length, "Remaining length (%d) < %d bytes", tvb_reported_length_remaining(tvb, offset), significant_octets + 4);
3192 break;
3194 if(mask_width == 0)
3195 proto_item_append_text(route_item, "default");
3196 else {
3197 for(i = 0 ; i < significant_octets ; i++) {
3198 if (i > 0)
3199 proto_item_append_text(route_item, ".");
3200 proto_item_append_text(route_item, "%d", tvb_get_uint8(tvb, offset++));
3202 for(i = significant_octets ; i < 4 ; i++)
3203 proto_item_append_text(route_item, ".0");
3204 proto_item_append_text(route_item, "/%d", mask_width);
3206 proto_item_append_text(route_item, "-%s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3207 offset += 4;
3210 return tvb_captured_length(tvb);
3213 static int
3214 dissect_dhcpopt_coordinate_based_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3216 int offset = 0, length = tvb_reported_length(tvb);
3217 proto_item* ti;
3219 if (length == 16) {
3220 int ret;
3221 unsigned char lci[16];
3222 struct rfc3825_location_fixpoint_t location_fp;
3223 struct rfc3825_location_decimal_t location;
3225 tvb_memcpy(tvb, lci, offset, 16);
3227 /* convert lci encoding into fixpoint location */
3228 rfc3825_lci_to_fixpoint(lci, &location_fp);
3230 /* convert location from decimal to fixpoint */
3231 ret = rfc3825_fixpoint_to_decimal(&location_fp, &location);
3233 if (ret != RFC3825_NOERROR) {
3234 ti = proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_error, tvb, offset, 1, ret);
3235 proto_item_set_len(ti, length);
3236 } else {
3237 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude, tvb, offset, 5, location.latitude, "%15.10f", location.latitude);
3238 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_longitude, tvb, offset+5, 5, location.longitude, "%15.10f", location.longitude);
3239 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude_res, tvb, offset, 1, location.latitude_res, "%15.10f", location.latitude_res);
3240 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_longitude_res, tvb, offset+5, 1, location.longitude_res, "%15.10f", location.longitude_res);
3241 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_altitude, tvb, offset+12, 4, location.altitude, "%15.10f", location.altitude);
3242 proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_altitude_res, tvb, offset+10, 2, location.altitude_res, "%15.10f", location.altitude_res);
3243 proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_altitude_type, tvb, offset+10, 1, location.altitude_type);
3244 proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_map_datum, tvb, offset+15, 1, location.datum_type);
3246 } else if (length < 69) { /* CableLabs DSS_ID */
3247 int s_len;
3249 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset, 1, ENC_BIG_ENDIAN);
3250 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1, 1, ENC_BIG_ENDIAN);
3251 s_len = tvb_get_uint8(tvb, offset+1);
3252 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2, s_len, ENC_ASCII);
3254 if (length > s_len+2) { /* Second DSS_ID*/
3256 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset+2+s_len, 1, ENC_BIG_ENDIAN);
3257 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1+2+s_len, 1, ENC_BIG_ENDIAN);
3258 s_len = tvb_get_uint8(tvb, offset+1+2+s_len);
3259 proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2+2+s_len, s_len, ENC_ASCII);
3261 } else {
3262 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Invalid length of DHCP option!");
3265 return tvb_captured_length(tvb);
3268 static int
3269 dissect_dhcpopt_vi_vendor_class(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3271 int offset = 0;
3272 uint32_t enterprise = 0;
3273 uint32_t option_data_len = 0;
3274 int data_len = 0;
3275 int s_end;
3276 proto_item *eti, *expert_ti;
3277 proto_tree *e_tree;
3278 proto_tree *vcdi_tree;
3280 if (tvb_reported_length(tvb) == 1) {
3281 /* CableLab specific */
3282 proto_tree_add_item(tree, hf_dhcp_option_vi_class_cl_address_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
3283 return 1;
3286 while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3288 eti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_vi_class_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
3289 e_tree = proto_item_add_subtree(eti, ett_dhcp_option);
3290 offset += 4;
3291 proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option_vi_class_data_length, tvb, offset, 1, ENC_BIG_ENDIAN, &option_data_len);
3292 offset += 1;
3294 s_end = offset + option_data_len;
3295 if ( tvb_reported_length_remaining(tvb, s_end) < 0) {
3296 break;
3299 while (offset < s_end) {
3300 tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
3301 /* XXX - Do we really want to try the dissector table for *each*
3302 * vendor-class-data for the same enterprise? This tvb is too long on
3303 * subsequent iterations. Only giving the table dissector one attempt
3304 * (and skipping past bytes it doesn't dissect to s_end) might be simpler.
3306 int bytes_dissected = dissector_try_uint(dhcp_enterprise_class_table, enterprise, enterprise_tvb, pinfo, e_tree);
3307 if (bytes_dissected == 0) {
3308 vcdi_tree = proto_tree_add_subtree(e_tree, tvb, offset, option_data_len, ett_dhcp_option124_vendor_class_data_item, NULL, "Vendor Class Data Item");
3309 /* According to RFC 3925, *each* vendor-class-data instance has
3310 * its own length, but in practice some vendors have only included
3311 * the overall per-enterprise option length. See the dhcwg m-l:
3312 * https://mailarchive.ietf.org/arch/msg/dhcwg/B4fNsvUR0EHxcrKDsKCf7lBrc3s/
3314 data_len = tvb_get_uint8(tvb, offset);
3315 if (offset + data_len >= s_end) {
3316 expert_ti = proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, s_end - offset, ENC_NA);
3317 expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
3318 offset = s_end;
3319 break;
3321 proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_length, tvb, offset, 1, ENC_NA);
3322 offset += 1;
3323 proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, data_len, ENC_NA);
3325 /* look for next vendor-class-data-item */
3326 offset += data_len;
3327 } else {
3328 offset += bytes_dissected;
3332 /* loop for the next Enterprise number */
3335 if (tvb_reported_length_remaining(tvb, offset) > 0) {
3336 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
3339 return tvb_captured_length(tvb);
3342 static int
3343 dissect_dhcpopt_forcerenew_nonce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3345 int offset = 0;
3346 while ( tvb_reported_length_remaining(tvb, offset) > 0) {
3347 proto_tree_add_item(tree, hf_dhcp_option_forcerenew_nonce_algo, tvb, offset, 1, ENC_BIG_ENDIAN);
3348 offset += 1;
3351 return tvb_captured_length(tvb);
3354 static int
3355 dissect_dhcpopt_rdnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3357 int offset = 0;
3358 const unsigned char *dns_name;
3359 int dns_name_len;
3361 if (tvb_reported_length(tvb) < 10) {
3362 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 10");
3363 return 1;
3365 proto_tree_add_item(tree, hf_dhcp_option_rdnss_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3366 proto_tree_add_item(tree, hf_dhcp_option_rdnss_pref, tvb, offset, 1, ENC_BIG_ENDIAN);
3367 offset += 1;
3368 proto_tree_add_item(tree, hf_dhcp_option_rdnss_prim_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3369 offset += 4;
3370 proto_tree_add_item(tree, hf_dhcp_option_rdnss_sec_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3371 offset += 4;
3373 get_dns_name(tvb, offset, tvb_reported_length_remaining(tvb,offset), offset, (const char **)&dns_name, &dns_name_len);
3374 proto_tree_add_string(tree, hf_dhcp_option_rdnss_domain, tvb, offset,
3375 tvb_reported_length_remaining(tvb,offset), format_text(pinfo->pool, dns_name, dns_name_len));
3377 return tvb_captured_length(tvb);
3380 static int
3381 dissect_dhcpopt_dhcp_captive_portal(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3383 proto_item *ti_cp;
3384 ti_cp = proto_tree_add_item(tree, hf_dhcp_option_captive_portal, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
3385 proto_item_set_url(ti_cp);
3387 return tvb_captured_length(tvb);
3390 static int
3391 dissect_dhcpopt_bulk_lease_query_start(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3393 if (tvb_reported_length(tvb) != 4) {
3394 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3395 return 1;
3397 proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_start, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3399 return tvb_captured_length(tvb);
3402 static int
3403 dissect_dhcpopt_bulk_lease_query_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3405 if (tvb_reported_length(tvb) != 4) {
3406 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3407 return 1;
3409 proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_end, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3411 return tvb_captured_length(tvb);
3414 static int
3415 dissect_dhcpopt_bulk_lease_base_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3417 if (tvb_reported_length(tvb) != 4) {
3418 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3419 return 1;
3421 proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_base_time, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3423 return tvb_captured_length(tvb);
3426 static int
3427 dissect_dhcpopt_bulk_lease_status_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3429 if (tvb_reported_length(tvb) < 1) {
3430 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 1");
3431 return 1;
3433 proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_code, tvb, 0, 1, ENC_BIG_ENDIAN);
3434 if ( tvb_reported_length_remaining(tvb, 1) > 0) {
3435 proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_message, tvb, 1, tvb_reported_length_remaining(tvb, 1), ENC_UTF_8);
3438 return tvb_captured_length(tvb);
3441 static int
3442 dissect_dhcpopt_pcp_server(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3444 proto_tree *tree_pcp;
3445 int offset = 0;
3446 uint8_t list_length;
3447 uint8_t ip_list_length;
3448 proto_item *ti_pcp;
3450 if (tvb_reported_length(tvb) < 5) {
3451 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 5");
3452 return 1;
3454 while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3455 ip_list_length = 0;
3456 list_length = tvb_get_uint8(tvb, offset);
3457 tree_pcp = proto_tree_add_subtree(tree, tvb, offset, list_length, ett_dhcp_option158_pcp_list,
3458 &ti_pcp, "PCP server list");
3459 proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_list_length, tvb, offset, 1, ENC_NA);
3460 offset += 1;
3461 ip_list_length += 1;
3462 while (((list_length - 1)%4 == 0) && (ip_list_length < list_length) && tvb_reported_length_remaining(tvb,offset) >= 4) {
3463 proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_server, tvb, offset, 4, ENC_NA);
3464 offset += 4;
3465 ip_list_length += 4;
3469 return tvb_captured_length(tvb);
3472 static int
3473 dissect_dhcpopt_portparams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3475 if (tvb_reported_length(tvb) != 4) {
3476 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3477 return 1;
3479 proto_tree_add_item(tree, hf_dhcp_option_portparams_offset, tvb, 0, 1, ENC_NA);
3480 proto_tree_add_item(tree, hf_dhcp_option_portparams_psid_length, tvb, 1, 1, ENC_NA);
3481 proto_tree_add_item(tree, hf_dhcp_option_portparams_psid, tvb, 2, 2, ENC_NA);
3483 return tvb_captured_length(tvb);
3486 static int
3487 dissect_dhcpopt_6RD_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3489 int offset = 0;
3491 if (tvb_reported_length(tvb) < 22) {
3492 expert_add_info(pinfo, tree, &ei_dhcp_option_6RD_malformed);
3493 return 1;
3496 proto_tree_add_item(tree, hf_dhcp_option_6RD_ipv4_mask_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3497 proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix_len, tvb, offset+1, 1, ENC_BIG_ENDIAN);
3498 proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix, tvb, offset+2, 16, ENC_NA);
3499 proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset+18, 4, ENC_BIG_ENDIAN);
3501 /* More Border Relay IPv4 addresses included */
3502 if (tvb_reported_length(tvb) > 22) {
3503 offset += 22;
3504 while (tvb_reported_length_remaining(tvb, offset) >= 4) {
3505 proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
3506 offset += 4;
3508 if (tvb_reported_length_remaining(tvb, offset) > 0) {
3509 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
3513 return tvb_captured_length(tvb);
3516 static int
3517 dissect_dhcpopt_avaya_ip_telephone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3519 int offset = 0;
3520 proto_tree *o242avaya_v_tree;
3521 proto_item *avaya_ti;
3522 const char *avaya_option = NULL;
3523 wmem_strbuf_t *avaya_param_buf = NULL;
3525 /* minimum length is 5 bytes */
3526 if (tvb_reported_length(tvb) < 5) {
3527 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Avaya IP Telephone option length isn't >= 5");
3528 return 1;
3530 avaya_ti = proto_tree_add_item_ret_string(tree, hf_dhcp_option242_avaya, tvb, offset, tvb_reported_length(tvb), ENC_ASCII|ENC_NA, pinfo->pool, (const uint8_t **)&avaya_option);
3531 o242avaya_v_tree = proto_item_add_subtree(avaya_ti, ett_dhcp_option242_suboption);
3532 avaya_param_buf = wmem_strbuf_new(pinfo->pool, "");
3533 char **fields = wmem_strsplit(pinfo->pool, avaya_option, ",", -1);
3534 for (int i = 0; fields[i]; i++) {
3535 const char *field = fields[i];
3536 if (!strchr(field, '=')) {
3537 if (wmem_strbuf_get_len(avaya_param_buf) == 0) {
3538 expert_add_info_format(pinfo, avaya_ti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown parameter %s", field);
3539 offset += (int)strlen(field);
3540 break;
3542 wmem_strbuf_append_printf(avaya_param_buf,",%s", field);
3544 else {
3545 if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3546 dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3547 offset += (int)wmem_strbuf_get_len(avaya_param_buf) + 1;
3548 wmem_strbuf_truncate(avaya_param_buf, 0);
3550 wmem_strbuf_append(avaya_param_buf, field);
3553 if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3554 dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3557 return tvb_captured_length(tvb);
3560 static const value_string option82_suboption_vals[] = {
3561 { 0, "Padding" },
3562 { 1, "Agent Circuit ID" },
3563 { 2, "Agent Remote ID" },
3564 { 3, "Reserved" },
3565 { 4, "DOCSIS Device Class" },
3566 { 5, "Link selection" },
3567 { 6, "Subscriber ID" },
3568 { 7, "RADIUS Attributes" },
3569 { 8, "Authentication" },
3570 { 9, "Vendor-Specific Information" },
3571 { 10, "Flags" },
3572 { 11, "Server ID Override" },
3573 { 12, "Relay Agent Identifier" },
3574 { 13, "Access Technology Type" },
3575 { 14, "Access Network Name" },
3576 { 15, "Access Point Name" },
3577 { 16, "Access Point BSSID" },
3578 { 17, "Access Network Operator ID" },
3579 { 18, "Access Network Operator Realm" },
3580 { 19, "Source Port" },
3581 { 150, "Link selection (Cisco proprietary)" },
3582 { 151, "VRF name/VPN ID" },
3583 { 152, "Server ID Override (Cisco proprietary)" },
3584 { 0, NULL }
3587 #define CL_AI_OPTION_DOCSIS_VERSION 1 /* 82:9:4491:1 */
3588 #define CL_AI_OPTION_DPOE_SYSTEM_VERSION 2 /* 82:9:4491:2 */
3589 #define CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE 4 /* 82:9:4491:4 */
3590 #define CL_AI_OPTION_CMTS_CM_SERVICE_CLASS 5 /* 82:9:4491:5 */
3591 #define CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT 6 /* 82:9:4491:6 */
3592 #define CL_AI_OPTION_SECURE_FILE_TRANSFER_URI 7 /* 82:9:4491:7 */
3594 static const value_string option82_cl_tag_vals[] = {
3595 { CL_AI_OPTION_DOCSIS_VERSION, "CMTS DOCSIS version number" },
3596 { CL_AI_OPTION_DPOE_SYSTEM_VERSION, "DPOE System version number" },
3597 { CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE, "DPOE System DHCPv4 PBB service option" },
3598 { CL_AI_OPTION_CMTS_CM_SERVICE_CLASS, "Service Class or QoS Profile Name" },
3599 { CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT, "MSO Defined Text" },
3600 { CL_AI_OPTION_SECURE_FILE_TRANSFER_URI, "Secure File Transfer URI" },
3601 { 0, NULL }
3604 static int
3605 dhcp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree, tvbuff_t *tvb, int optoff,
3606 int optend)
3608 int suboptoff = optoff;
3609 uint8_t subopt, idx, vs_opt, vs_len;
3610 int subopt_len, subopt_end, datalen;
3611 uint32_t enterprise;
3612 proto_item *vti, *ti;
3613 proto_tree *o82_v_tree, *o82_sub_tree;
3614 int clsuboptoff, clsubopt_end;
3616 static const struct basic_types_hfs default_hfs = {
3617 &hf_dhcp_option82_value,
3618 &hf_dhcp_option82_value_ip_address,
3619 &hf_dhcp_option82_value_ip_address,
3620 &hf_dhcp_option82_value_stringz,
3621 NULL,
3622 &hf_dhcp_option82_value_8,
3623 &hf_dhcp_option82_value_16,
3624 NULL,
3625 &hf_dhcp_option82_value_32,
3626 NULL,
3627 NULL
3630 struct opt82_info {
3631 int id;
3632 struct opt_info info;
3634 static const struct opt82_info o82_opt[]= {
3635 {0, {"nop", bytes, &hf_dhcp_option82_padding}}, /* dummy */
3636 {1, {"Agent Circuit ID", bytes, &hf_dhcp_option82_agent_circuit_id}}, /* [RFC3046] */
3637 {2, {"Agent Remote ID", bytes, &hf_dhcp_option82_agent_remote_id}}, /* [RFC3046] */
3638 {3, {"Reserved", bytes, &hf_dhcp_option82_reserved}},
3639 {4, {"DOCSIS Device Class", val_u_long, &hf_dhcp_option82_docsis_device_class}}, /* [RFC3256] */
3640 {5, {"Link selection", ipv4, &hf_dhcp_option82_link_selection}}, /* [RFC3527] */
3641 {6, {"Subscriber ID", string, &hf_dhcp_option82_subscriber_id}}, /* [RFC3993] */ /***** CHECK STRING TYPE */
3642 {7, {"RADIUS Attributes", bytes, &hf_dhcp_option82_radius_attributes}}, /* [RFC4014] */
3643 {8, {"Authentication", bytes, &hf_dhcp_option82_authentication}}, /* [RFC4030] */
3644 {9, {"Vendor-Specific Information", special, &hf_dhcp_option82_vi}}, /* [RFC 4243] */
3645 {10, {"Flags", val_u_byte, &hf_dhcp_option82_flags}}, /* [RFC5010] */
3646 {11, {"Server ID Override", ipv4, &hf_dhcp_option82_server_id_override}}, /* [RFC 5107] */
3647 {12, {"Relay Agent Identifier", bytes, &hf_dhcp_option82_relay_agent_id}}, /* [RFC 6925] */
3648 {13, {"Access Technology Type", bytes, &hf_dhcp_option82_option_ani_att}}, /* [RFC7839] */
3649 {14, {"Access Network Name", string, &hf_dhcp_option82_option_ani_network_name}}, /* [RFC7839] */
3650 {15, {"Access Point Name", string, &hf_dhcp_option82_option_ani_ap_name}}, /* [RFC7839] */
3651 {16, {"Access Point BSSID", special, &hf_dhcp_option82_option_ani_ap_bssid}}, /* [RFC7839] */
3652 {17, {"Access Network Operator ID", bytes, &hf_dhcp_option82_option_ani_operator_id}}, /* [RFC7839] */
3653 {18, {"Access Network Operator Realm", string, &hf_dhcp_option82_option_ani_operator_realm}}, /* [RFC7839] */
3654 {19, {"Source Port", presence, &hf_dhcp_option82_option_source_port}}, /* [RFC8357] */
3655 {150, {"Link selection (Cisco proprietary)", ipv4, &hf_dhcp_option82_link_selection_cisco}}, /* [RFC3527] */
3656 {151, {"VRF name/VPN ID", special, &hf_dhcp_option82_vrf_name_vpn_id}}, /* [RFC2685] */
3657 {152, {"Server ID Override (Cisco proprietary)", ipv4, &hf_dhcp_option82_server_id_override_cisco}} /* [RFC 5107] */
3660 subopt = tvb_get_uint8(tvb, optoff);
3661 suboptoff++;
3663 if (suboptoff >= optend) {
3664 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
3665 "Suboption %d: no room left in option for suboption length", subopt);
3666 return (optend);
3669 subopt_len = tvb_get_uint8(tvb, suboptoff);
3670 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option82_suboption,
3671 tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str_const(subopt, option82_suboption_vals, "Unknown"));
3673 o82_v_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption);
3674 proto_tree_add_item(o82_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3675 suboptoff++;
3677 subopt_end = suboptoff+subopt_len;
3678 if (subopt_end > optend) {
3679 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
3680 "Suboption %d: no room left in option for suboption value", subopt);
3681 return (optend);
3684 for (idx = 0; idx < array_length(o82_opt); idx++) {
3685 if (o82_opt[idx].id == subopt) {
3686 break;
3690 ti = proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3692 if ( (idx >= 1 ) && (idx < array_length(o82_opt)) ) {
3693 proto_item_set_hidden(ti);
3694 if (o82_opt[idx].info.ftype == special) {
3695 switch(subopt)
3697 case 9:
3698 while (suboptoff < subopt_end) {
3699 enterprise = tvb_get_ntohl(tvb, suboptoff);
3700 vti = proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vi_enterprise, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
3701 suboptoff += 4;
3703 o82_sub_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption9);
3704 datalen = tvb_get_uint8(tvb, suboptoff);
3705 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_data_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3706 suboptoff++;
3708 switch (enterprise) {
3709 case VENDOR_CABLELABS: /* CableLabs */
3710 /* Compare CL-SP-CANN-DHCP-Reg-I06-110210 (2011) and
3711 * CL-SP-CANN-DHCP-Reg-I13-160317 (2016) */
3712 clsuboptoff = suboptoff;
3713 clsubopt_end = clsuboptoff + datalen;
3714 while (clsuboptoff < clsubopt_end) {
3715 vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3716 vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3717 if (vs_opt == CL_AI_OPTION_DOCSIS_VERSION &&
3718 vs_len == 4) {
3720 /* Superseded version with a redundant option code and option-length */
3721 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3722 clsuboptoff++;
3723 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3724 clsuboptoff++;
3726 vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3727 vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3729 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3730 clsuboptoff++;
3731 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3732 clsuboptoff++;
3733 switch (vs_opt) {
3734 case CL_AI_OPTION_DOCSIS_VERSION:
3735 proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_docsis_version,
3736 tvb, clsuboptoff, 2, 0, "%d.%d",
3737 tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3738 clsuboptoff+=2;
3739 break;
3740 case CL_AI_OPTION_DPOE_SYSTEM_VERSION:
3741 proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_version,
3742 tvb, clsuboptoff, 2, 0, "%d.%d",
3743 tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3744 clsuboptoff+=2;
3745 break;
3746 case CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE:
3747 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_pbb_service, tvb, clsuboptoff, vs_len, ENC_NA);
3748 break;
3749 case CL_AI_OPTION_CMTS_CM_SERVICE_CLASS:
3750 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_service_class_name, tvb, clsuboptoff, vs_len, ENC_ASCII);
3751 clsuboptoff += vs_len;
3752 break;
3753 case CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT:
3754 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_mso_defined_text, tvb, clsuboptoff, vs_len, ENC_ASCII);
3755 clsuboptoff += vs_len;
3756 break;
3757 case CL_AI_OPTION_SECURE_FILE_TRANSFER_URI:
3758 proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_secure_file_transfer_uri, tvb, clsuboptoff, vs_len, ENC_ASCII);
3759 clsuboptoff += vs_len;
3760 break;
3761 default:
3762 expert_add_info_format(pinfo, vti, &ei_dhcp_option82_vi_cl_tag_unknown, "Unknown tag %d (%d bytes)", vs_opt, vs_len);
3763 clsuboptoff += vs_len;
3764 break;
3767 suboptoff = clsuboptoff;
3768 break;
3769 default:
3770 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, datalen, ENC_NA);
3771 suboptoff += datalen;
3772 break;
3775 break;
3776 case 13: /* Access Technology Type */
3777 if (subopt_len != 2) {
3778 expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 2");
3779 break;
3781 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_res, tvb, suboptoff, 1, ENC_NA);
3782 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_att, tvb, suboptoff+1, 1, ENC_NA);
3783 break;
3784 break;
3785 case 151:
3786 if (subopt_len == 1) {
3787 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_global, tvb, suboptoff, 1, ENC_NA);
3789 else if (subopt_len != 7) {
3790 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name, tvb, suboptoff, subopt_len, ENC_ASCII);
3791 } else {
3792 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_oui, tvb, suboptoff, 3, ENC_BIG_ENDIAN);
3793 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_index, tvb, suboptoff+3, 4, ENC_BIG_ENDIAN);
3795 break;
3796 default:
3797 if (o82_opt[idx].info.phf != NULL)
3798 proto_tree_add_item(o82_v_tree, *o82_opt[idx].info.phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
3799 else
3800 proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3801 break;
3804 else {
3805 dhcp_handle_basic_types(pinfo, o82_v_tree, vti, tvb, o82_opt[idx].info.ftype,
3806 suboptoff, subopt_len, o82_opt[idx].info.phf, &default_hfs);
3810 optoff += (subopt_len + 2);
3811 return optoff;
3814 static int
3815 dissect_dhcpopt_relay_agent_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3817 int offset = 0;
3819 while (tvb_reported_length_remaining(tvb, offset) > 0) {
3820 offset = dhcp_dhcp_decode_agent_info(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
3823 return tvb_captured_length(tvb);
3826 # define O43PXE_DISCOVERY 6
3827 # define O43PXE_BOOT_SERVER 8
3828 # define O43PXE_BOOT_MENU 9
3829 # define O43PXE_MENU_PROMPT 10
3830 # define O43PXE_BOOT_ITEM 71
3832 static const value_string option43_pxeclient_suboption_vals[] = {
3833 { 0, "Padding" },
3834 { 1, "PXE mtftp IP" },
3835 { 2, "PXE mtftp client port" },
3836 { 3, "PXE mtftp server port" },
3837 { 4, "PXE mtftp timeout" },
3838 { 5, "PXE mtftp delay" },
3839 { O43PXE_DISCOVERY, "PXE discovery control" },
3840 { 7, "PXE multicast address" },
3841 { O43PXE_BOOT_SERVER, "PXE boot servers" },
3842 { O43PXE_BOOT_MENU, "PXE boot menu" },
3843 { O43PXE_MENU_PROMPT, "PXE menu prompt" },
3844 { 11, "PXE multicast address alloc", },
3845 { 12, "PXE credential types" },
3846 { O43PXE_BOOT_ITEM, "PXE boot item" },
3847 { 179, "PXE LCM Server" },
3848 { 180, "PXE LCM Domain" },
3849 { 181, "PXE LCM NIC option 0" },
3850 { 190, "PXE LCM Workgroup" },
3851 { 191, "PXE Discovery" },
3852 { 192, "PXE Configured" },
3853 { 193, "PXE LCM version" },
3854 { 194, "PXE LCM Serial Number" },
3855 { 255, "PXE End" },
3856 { 0, NULL}
3859 static int
3860 dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3861 tvbuff_t *tvb, int optoff, int optend)
3863 int suboptoff = optoff;
3864 int suboptoff_start;
3865 uint8_t subopt;
3866 uint8_t subopt_len;
3867 proto_tree *o43pxeclient_v_tree, *o43pxeclient_suboption_tree;
3868 proto_item *vti, *ti;
3869 uint32_t boot_server_ip_count;
3870 uint32_t boot_menu_length;
3872 static const struct basic_types_hfs default_hfs = {
3873 NULL,
3874 &hf_dhcp_option43_value_ip_address,
3875 &hf_dhcp_option43_value_ip_address,
3876 NULL,
3877 NULL,
3878 &hf_dhcp_option43_value_8,
3879 NULL,
3880 NULL,
3881 NULL,
3882 NULL,
3883 NULL
3886 static int * const o43pxe_discovery_hf_flags[] = {
3887 &hf_dhcp_option43_pxeclient_discovery_control_bc,
3888 &hf_dhcp_option43_pxeclient_discovery_control_mc,
3889 &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
3890 &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
3891 NULL
3894 static const struct opt_info o43pxeclient_opt[]= {
3895 /* 0 */ {"nop", special, &hf_dhcp_option43_pxeclient_padding}, /* dummy */
3896 /* 1 */ {"PXE mtftp IP", ipv4_list, &hf_dhcp_option43_pxeclient_mtftp_ip},
3897 /* 2 */ {"PXE mtftp client port", val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_client_port},
3898 /* 3 */ {"PXE mtftp server port",val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_server_port},
3899 /* 4 */ {"PXE mtftp timeout", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_timeout},
3900 /* 5 */ {"PXE mtftp delay", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_delay},
3901 /* 6 */ {"PXE discovery control", special, NULL},
3902 /* 7 */ {"PXE multicast address", ipv4_list, &hf_dhcp_option43_pxeclient_multicast_address},
3903 /* 8 */ {"PXE boot servers", special, NULL},
3904 /* 9 */ {"PXE boot menu", special, NULL},
3905 /* 10 */ {"PXE menu prompt", special, NULL},
3906 /* 11 */ {"PXE multicast address alloc", special, &hf_dhcp_option43_pxeclient_multicast_address_alloc},
3907 /* 12 */ {"PXE credential types", special, &hf_dhcp_option43_pxeclient_credential_types},
3908 /* 13 */ {"Unassigned", opaque, NULL},
3909 /* 14 */ {"Unassigned", opaque, NULL},
3910 /* 15 */ {"Unassigned", opaque, NULL},
3911 /* 16 */ {"Unassigned", opaque, NULL},
3912 /* 17 */ {"Unassigned", opaque, NULL},
3913 /* 18 */ {"Unassigned", opaque, NULL},
3914 /* 19 */ {"Unassigned", opaque, NULL},
3915 /* 20 */ {"Unassigned", opaque, NULL},
3916 /* 21 */ {"Unassigned", opaque, NULL},
3917 /* 22 */ {"Unassigned", opaque, NULL},
3918 /* 23 */ {"Unassigned", opaque, NULL},
3919 /* 24 */ {"Unassigned", opaque, NULL},
3920 /* 25 */ {"Unassigned", opaque, NULL},
3921 /* 26 */ {"Unassigned", opaque, NULL},
3922 /* 27 */ {"Unassigned", opaque, NULL},
3923 /* 28 */ {"Unassigned", opaque, NULL},
3924 /* 29 */ {"Unassigned", opaque, NULL},
3925 /* 30 */ {"Unassigned", opaque, NULL},
3926 /* 31 */ {"Unassigned", opaque, NULL},
3927 /* 32 */ {"Unassigned", opaque, NULL},
3928 /* 33 */ {"Unassigned", opaque, NULL},
3929 /* 34 */ {"Unassigned", opaque, NULL},
3930 /* 35 */ {"Unassigned", opaque, NULL},
3931 /* 36 */ {"Unassigned", opaque, NULL},
3932 /* 37 */ {"Unassigned", opaque, NULL},
3933 /* 38 */ {"Unassigned", opaque, NULL},
3934 /* 39 */ {"Unassigned", opaque, NULL},
3935 /* 40 */ {"Unassigned", opaque, NULL},
3936 /* 41 */ {"Unassigned", opaque, NULL},
3937 /* 42 */ {"Unassigned", opaque, NULL},
3938 /* 43 */ {"Unassigned", opaque, NULL},
3939 /* 44 */ {"Unassigned", opaque, NULL},
3940 /* 45 */ {"Unassigned", opaque, NULL},
3941 /* 46 */ {"Unassigned", opaque, NULL},
3942 /* 47 */ {"Unassigned", opaque, NULL},
3943 /* 48 */ {"Unassigned", opaque, NULL},
3944 /* 49 */ {"Unassigned", opaque, NULL},
3945 /* 50 */ {"Unassigned", opaque, NULL},
3946 /* 51 */ {"Unassigned", opaque, NULL},
3947 /* 52 */ {"Unassigned", opaque, NULL},
3948 /* 53 */ {"Unassigned", opaque, NULL},
3949 /* 54 */ {"Unassigned", opaque, NULL},
3950 /* 55 */ {"Unassigned", opaque, NULL},
3951 /* 56 */ {"Unassigned", opaque, NULL},
3952 /* 57 */ {"Unassigned", opaque, NULL},
3953 /* 58 */ {"Unassigned", opaque, NULL},
3954 /* 59 */ {"Unassigned", opaque, NULL},
3955 /* 60 */ {"Unassigned", opaque, NULL},
3956 /* 61 */ {"Unassigned", opaque, NULL},
3957 /* 62 */ {"Unassigned", opaque, NULL},
3958 /* 63 */ {"Unassigned", opaque, NULL},
3959 /* 64 */ {"Unassigned", opaque, NULL},
3960 /* 65 */ {"Unassigned", opaque, NULL},
3961 /* 66 */ {"Unassigned", opaque, NULL},
3962 /* 67 */ {"Unassigned", opaque, NULL},
3963 /* 68 */ {"Unassigned", opaque, NULL},
3964 /* 69 */ {"Unassigned", opaque, NULL},
3965 /* 70 */ {"Unassigned", opaque, NULL},
3966 /* 71 */ {"PXE boot item", special, NULL},
3967 /* 72 */ {"Unassigned", opaque, NULL},
3968 /* 73 */ {"Unassigned", opaque, NULL},
3969 /* 74 */ {"Unassigned", opaque, NULL},
3970 /* 75 */ {"Unassigned", opaque, NULL},
3971 /* 76 */ {"Unassigned", opaque, NULL},
3972 /* 77 */ {"Unassigned", opaque, NULL},
3973 /* 78 */ {"Unassigned", opaque, NULL},
3974 /* 79 */ {"Unassigned", opaque, NULL},
3975 /* 80 */ {"Unassigned", opaque, NULL},
3976 /* 81 */ {"Unassigned", opaque, NULL},
3977 /* 82 */ {"Unassigned", opaque, NULL},
3978 /* 83 */ {"Unassigned", opaque, NULL},
3979 /* 84 */ {"Unassigned", opaque, NULL},
3980 /* 85 */ {"Unassigned", opaque, NULL},
3981 /* 86 */ {"Unassigned", opaque, NULL},
3982 /* 87 */ {"Unassigned", opaque, NULL},
3983 /* 88 */ {"Unassigned", opaque, NULL},
3984 /* 89 */ {"Unassigned", opaque, NULL},
3985 /* 90 */ {"Unassigned", opaque, NULL},
3986 /* 91 */ {"Unassigned", opaque, NULL},
3987 /* 92 */ {"Unassigned", opaque, NULL},
3988 /* 93 */ {"Unassigned", opaque, NULL},
3989 /* 94 */ {"Unassigned", opaque, NULL},
3990 /* 95 */ {"Unassigned", opaque, NULL},
3991 /* 96 */ {"Unassigned", opaque, NULL},
3992 /* 97 */ {"Unassigned", opaque, NULL},
3993 /* 98 */ {"Unassigned", opaque, NULL},
3994 /* 99 */ {"Unassigned", opaque, NULL},
3995 /* 100 */ {"Unassigned", opaque, NULL},
3996 /* 101 */ {"Unassigned", opaque, NULL},
3997 /* 102 */ {"Unassigned", opaque, NULL},
3998 /* 103 */ {"Unassigned", opaque, NULL},
3999 /* 104 */ {"Unassigned", opaque, NULL},
4000 /* 105 */ {"Unassigned", opaque, NULL},
4001 /* 106 */ {"Unassigned", opaque, NULL},
4002 /* 107 */ {"Unassigned", opaque, NULL},
4003 /* 108 */ {"Unassigned", opaque, NULL},
4004 /* 109 */ {"Unassigned", opaque, NULL},
4005 /* 110 */ {"Unassigned", opaque, NULL},
4006 /* 111 */ {"Unassigned", opaque, NULL},
4007 /* 112 */ {"Unassigned", opaque, NULL},
4008 /* 113 */ {"Unassigned", opaque, NULL},
4009 /* 114 */ {"Unassigned", opaque, NULL},
4010 /* 115 */ {"Unassigned", opaque, NULL},
4011 /* 116 */ {"Unassigned", opaque, NULL},
4012 /* 117 */ {"Unassigned", opaque, NULL},
4013 /* 118 */ {"Unassigned", opaque, NULL},
4014 /* 119 */ {"Unassigned", opaque, NULL},
4015 /* 120 */ {"Unassigned", opaque, NULL},
4016 /* 121 */ {"Unassigned", opaque, NULL},
4017 /* 122 */ {"Unassigned", opaque, NULL},
4018 /* 123 */ {"Unassigned", opaque, NULL},
4019 /* 124 */ {"Unassigned", opaque, NULL},
4020 /* 125 */ {"Unassigned", opaque, NULL},
4021 /* 126 */ {"Unassigned", opaque, NULL},
4022 /* 127 */ {"Unassigned", opaque, NULL},
4023 /* 128 */ {"Unassigned", opaque, NULL},
4024 /* 129 */ {"Unassigned", opaque, NULL},
4025 /* 130 */ {"Unassigned", opaque, NULL},
4026 /* 131 */ {"Unassigned", opaque, NULL},
4027 /* 132 */ {"Unassigned", opaque, NULL},
4028 /* 133 */ {"Unassigned", opaque, NULL},
4029 /* 134 */ {"Unassigned", opaque, NULL},
4030 /* 135 */ {"Unassigned", opaque, NULL},
4031 /* 136 */ {"Unassigned", opaque, NULL},
4032 /* 137 */ {"Unassigned", opaque, NULL},
4033 /* 138 */ {"Unassigned", opaque, NULL},
4034 /* 139 */ {"Unassigned", opaque, NULL},
4035 /* 140 */ {"Unassigned", opaque, NULL},
4036 /* 141 */ {"Unassigned", opaque, NULL},
4037 /* 142 */ {"Unassigned", opaque, NULL},
4038 /* 143 */ {"Unassigned", opaque, NULL},
4039 /* 144 */ {"Unassigned", opaque, NULL},
4040 /* 145 */ {"Unassigned", opaque, NULL},
4041 /* 146 */ {"Unassigned", opaque, NULL},
4042 /* 147 */ {"Unassigned", opaque, NULL},
4043 /* 148 */ {"Unassigned", opaque, NULL},
4044 /* 149 */ {"Unassigned", opaque, NULL},
4045 /* 150 */ {"Unassigned", opaque, NULL},
4046 /* 151 */ {"Unassigned", opaque, NULL},
4047 /* 152 */ {"Unassigned", opaque, NULL},
4048 /* 153 */ {"Unassigned", opaque, NULL},
4049 /* 154 */ {"Unassigned", opaque, NULL},
4050 /* 155 */ {"Unassigned", opaque, NULL},
4051 /* 156 */ {"Unassigned", opaque, NULL},
4052 /* 157 */ {"Unassigned", opaque, NULL},
4053 /* 158 */ {"Unassigned", opaque, NULL},
4054 /* 159 */ {"Unassigned", opaque, NULL},
4055 /* 160 */ {"Unassigned", opaque, NULL},
4056 /* 161 */ {"Unassigned", opaque, NULL},
4057 /* 162 */ {"Unassigned", opaque, NULL},
4058 /* 163 */ {"Unassigned", opaque, NULL},
4059 /* 164 */ {"Unassigned", opaque, NULL},
4060 /* 165 */ {"Unassigned", opaque, NULL},
4061 /* 166 */ {"Unassigned", opaque, NULL},
4062 /* 167 */ {"Unassigned", opaque, NULL},
4063 /* 168 */ {"Unassigned", opaque, NULL},
4064 /* 169 */ {"Unassigned", opaque, NULL},
4065 /* 170 */ {"Unassigned", opaque, NULL},
4066 /* 171 */ {"Unassigned", opaque, NULL},
4067 /* 172 */ {"Unassigned", opaque, NULL},
4068 /* 173 */ {"Unassigned", opaque, NULL},
4069 /* 174 */ {"Unassigned", opaque, NULL},
4070 /* 175 */ {"Unassigned", opaque, NULL},
4071 /* 176 */ {"Unassigned", opaque, NULL},
4072 /* 177 */ {"Unassigned", opaque, NULL},
4073 /* 178 */ {"Unassigned", opaque, NULL},
4074 /* 179 */ {"LCM Server", string, &hf_dhcp_option43_pxeclient_lcm_server},
4075 /* 180 */ {"LCM Domain", string, &hf_dhcp_option43_pxeclient_lcm_domain},
4076 /* 181 */ {"LCM NIC Option 0", bytes, &hf_dhcp_option43_pxeclient_lcm_nic_option},
4077 /* 182 */ {"Unassigned", opaque, NULL},
4078 /* 183 */ {"Unassigned", opaque, NULL},
4079 /* 184 */ {"Unassigned", opaque, NULL},
4080 /* 185 */ {"Unassigned", opaque, NULL},
4081 /* 186 */ {"Unassigned", opaque, NULL},
4082 /* 187 */ {"Unassigned", opaque, NULL},
4083 /* 188 */ {"Unassigned", opaque, NULL},
4084 /* 189 */ {"Unassigned", opaque, NULL},
4085 /* 190 */ {"LCM Workgroup", string, &hf_dhcp_option43_pxeclient_lcm_workgroup},
4086 /* 191 */ {"Discovery", val_boolean, &hf_dhcp_option43_pxeclient_discovery},
4087 /* 192 */ {"Configured", val_boolean, &hf_dhcp_option43_pxeclient_configured},
4088 /* 193 */ {"LCM Version", val_u_long, &hf_dhcp_option43_pxeclient_lcm_version},
4089 /* 194 */ {"LCM Serial Number", string, &hf_dhcp_option43_pxeclient_lcm_serial},
4090 /* 255 {"PXE end options", special, &hf_dhcp_option43_pxeclient_end} */
4093 subopt = tvb_get_uint8(tvb, optoff);
4094 suboptoff++;
4096 if (subopt == 0) {
4097 proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4098 return (suboptoff);
4099 } else if (subopt == 255) { /* End Option */
4100 proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4101 /* Make sure we skip any junk left this option */
4102 return (optend);
4105 if (suboptoff >= optend) {
4106 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4107 "Suboption %d: no room left in option for suboption length", subopt);
4108 return (optend);
4111 subopt_len = tvb_get_uint8(tvb, suboptoff);
4112 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_pxeclient_suboption,
4113 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4114 subopt, val_to_str_const(subopt, option43_pxeclient_suboption_vals, "Unknown"));
4116 o43pxeclient_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4117 proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4118 suboptoff++;
4120 ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4121 proto_item_set_hidden(ti);
4123 if ((subopt < 1) || (subopt >= array_length(o43pxeclient_opt))) {
4124 expert_add_info_format(pinfo, vti, &ei_dhcp_suboption_invalid, "Unknown suboption %d (%d bytes)", subopt, subopt_len);
4125 } else if (o43pxeclient_opt[subopt].ftype == special) {
4126 /* I may need to decode that properly one day */
4127 if (o43pxeclient_opt[subopt].phf != NULL)
4128 proto_tree_add_item(o43pxeclient_v_tree, *o43pxeclient_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4129 else {
4130 switch(subopt)
4132 case O43PXE_DISCOVERY:
4133 proto_tree_add_bitmask(o43pxeclient_v_tree, tvb, suboptoff, hf_dhcp_option43_pxeclient_discovery_control,
4134 ett_dhcp_option43_suboption_discovery, o43pxe_discovery_hf_flags, ENC_BIG_ENDIAN);
4135 break;
4136 case O43PXE_BOOT_SERVER:
4137 suboptoff_start = suboptoff;
4138 ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_servers, tvb, suboptoff, subopt_len, ENC_NA);
4139 o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4140 while((suboptoff - suboptoff_start) < (subopt_len - 1)) {
4141 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4142 suboptoff += 2;
4143 proto_tree_add_item_ret_uint(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_count, tvb, suboptoff, 1, ENC_BIG_ENDIAN, &boot_server_ip_count);
4144 suboptoff += 1;
4145 while(boot_server_ip_count > 0) {
4146 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_ip, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
4147 suboptoff += 4;
4148 boot_server_ip_count -=1;
4151 break;
4152 case O43PXE_BOOT_MENU:
4153 suboptoff_start = suboptoff;
4154 ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_menu, tvb, suboptoff, subopt_len, ENC_NA);
4155 o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4156 while((suboptoff - suboptoff_start) < (subopt_len - 1)) {
4157 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4158 suboptoff += 2;
4159 proto_tree_add_item_ret_uint(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN, &boot_menu_length);
4160 suboptoff += 1;
4161 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_desc, tvb, suboptoff, boot_menu_length, ENC_ASCII);
4162 suboptoff += boot_menu_length;
4164 break;
4165 case O43PXE_MENU_PROMPT:
4166 ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_menu_prompt, tvb, suboptoff, subopt_len, ENC_NA);
4167 o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4168 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_timeout, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4169 suboptoff += 1;
4170 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_prompt, tvb, suboptoff, subopt_len - 1, ENC_ASCII);
4171 break;
4172 case O43PXE_BOOT_ITEM:
4173 ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_item, tvb, suboptoff, subopt_len, ENC_NA);
4174 o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4175 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4176 suboptoff += 2;
4177 proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_layer, tvb, suboptoff, 2, ENC_NA);
4178 break;
4179 default:
4180 proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4181 break;
4184 } else {
4185 if (dhcp_handle_basic_types(pinfo, o43pxeclient_v_tree, vti, tvb, o43pxeclient_opt[subopt].ftype,
4186 suboptoff, subopt_len, o43pxeclient_opt[subopt].phf, &default_hfs) == 0)
4188 expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4192 optoff += (subopt_len + 2);
4193 return optoff;
4196 static bool
4197 dissect_pxeclient_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4199 int offset = 0;
4200 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4201 proto_tree* vendor_tree;
4203 /* PXE protocol 2.1 as described in the Intel specs */
4204 if ((option_data->vendor_class_id == NULL) ||
4205 (strncmp((const char*)option_data->vendor_class_id, "PXEClient", strlen("PXEClient")) != 0))
4206 return false;
4208 proto_item_append_text(tree, " (PXEClient)");
4209 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4211 while (tvb_reported_length_remaining(tvb, offset) > 0) {
4212 offset = dissect_vendor_pxeclient_suboption(pinfo, tree, vendor_tree,
4213 tvb, offset, tvb_reported_length(tvb));
4216 return true;
4219 static void
4220 dissect_vendor_avaya_param(proto_tree *tree, packet_info *pinfo, proto_item *vti,
4221 tvbuff_t *tvb, int optoff, wmem_strbuf_t *avaya_param_buf)
4223 const char *field;
4224 int len;
4226 field = wmem_strbuf_get_str(avaya_param_buf);
4227 len = (int)wmem_strbuf_get_len(avaya_param_buf);
4229 if((strncmp(field, "TLSSRVR=", 8) == 0) && ( len > 8 )) {
4230 proto_tree_add_string(tree, hf_dhcp_option242_avaya_tlssrvr, tvb, optoff, len, field + 8);
4232 else if((strncmp(field, "HTTPSRVR=", 9) == 0) && ( len > 9)) {
4233 proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpsrvr, tvb, optoff, len, field + 9);
4235 else if((strncmp(field, "HTTPDIR=", 8) == 0) && ( len > 8)) {
4236 proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpdir, tvb, optoff, len, field + 8);
4238 else if((strncmp(field, "STATIC=", 7) == 0) && ( len > 7)) {
4239 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_static, tvb, optoff, len, field + 7, "%s (%s)", field + 7, str_to_str(field + 7, option242_avaya_static_vals, "Unknown (%s)"));
4241 else if((strncmp(field, "MCIPADD=", 8) == 0) && ( len > 8)) {
4242 proto_tree_add_string(tree, hf_dhcp_option242_avaya_mcipadd, tvb, optoff, len, field + 8);
4244 else if((strncmp(field, "DOT1X=", 6) == 0) && ( len > 6)) {
4245 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_dot1x, tvb, optoff, len, field + 6, "%s (%s)", field + 6, str_to_str(field + 6, option242_avaya_dot1x_vals, "Unknown (%s)"));
4247 else if((strncmp(field, "ICMPDU=", 7) == 0) && ( len > 7)) {
4248 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_icmpdu, tvb, optoff, len, field + 7, "%s (%s)", field + 7, str_to_str(field + 7, option242_avaya_icmpdu_vals, "Unknown (%s)"));
4250 else if((strncmp(field, "ICMPRED=", 8) == 0) && ( len > 8)) {
4251 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_icmpred, tvb, optoff, len, field + 8, "%s (%s)", field + 8, str_to_str(field + 8, option242_avaya_icmpred_vals, "Unknown (%s)"));
4253 else if((strncmp(field, "L2Q=", 4) == 0) && ( len > 4)) {
4254 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_l2q, tvb, optoff, len, field + 4, "%s (%s)", field + 4, str_to_str(field + 4, option242_avaya_l2q_vals, "Unknown (%s)"));
4256 else if((strncmp(field, "L2QVLAN=", 8) == 0) && ( len > 8)) {
4257 int32_t val = -1;
4258 bool val_valid;
4259 proto_item* pi;
4261 val_valid = ws_strtoi32(field + 8, NULL, &val);
4262 pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_l2qvlan, tvb, optoff, len, val);
4263 if (val_valid)
4264 expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_l2qvlan_invalid);
4266 else if((strncmp(field, "LOGLOCAL=", 9) == 0) && ( len > 9)) {
4267 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_loglocal, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str(field + 9, option242_avaya_loglocal_vals, "Unknown (%s)"));
4269 else if((strncmp(field, "PHY1STAT=", 9) == 0) && ( len > 9)) {
4270 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_phy1stat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str(field + 9, option242_avaya_phystat_vals, "Unknown (%s)"));
4272 else if((strncmp(field, "PHY2STAT=", 9) == 0) && ( len > 9)) {
4273 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_phy2stat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str(field + 9, option242_avaya_phystat_vals, "Unknown (%s)"));
4275 else if((strncmp(field, "PROCPSWD=", 9) == 0) && ( len > 9)) {
4276 proto_tree_add_string(tree, hf_dhcp_option242_avaya_procpswd, tvb, optoff, len, field + 9);
4278 else if((strncmp(field, "PROCSTAT=", 9) == 0) && ( len > 9)) {
4279 proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_procstat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str(field + 9, option242_avaya_procstat_vals, "Unknown (%s)"));
4281 else if((strncmp(field, "SNMPADD=", 8) == 0) && ( len > 8)) {
4282 proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpadd, tvb, optoff, len, field + 8);
4284 else if((strncmp(field, "SNMPSTRING=", 11) == 0) && ( len > 11)) {
4285 proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpstring, tvb, optoff, len, field + 11);
4287 else if((strncmp(field, "VLANTEST=", 9) == 0) && ( len > 9)) {
4288 int32_t val = -1;
4289 bool val_valid;
4290 proto_item* pi;
4292 val_valid = ws_strtoi32(field + 9, NULL, &val);
4293 pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_vlantest, tvb, optoff, len, val);
4294 if (!val_valid)
4295 expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_vlantest_invalid);
4297 else {
4298 expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown Avaya IP Telephone parameter %s", field);
4302 /* RFC3825Decoder:
4304 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4306 * The code is no longer available.
4308 static void
4309 rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint)
4311 fixpoint->latitude_res = (lci[0]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
4312 if (lci[0] & 2) { /* LSB<<1 contains the sign of the latitude */
4313 /* Latitude is negative, expand two's complement */
4314 fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4315 ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8) |
4316 (int64_t)lci[4] | ((int64_t)0x3FFFFFFF<<34);
4318 } else {
4319 /* Latitude is positive */
4320 fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4321 ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8) |
4322 (int64_t)lci[4];
4324 fixpoint->longitude_res = (lci[5]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
4325 if (lci[5] & 2) { /* LSB<<1 contains the sign of the latitude */
4326 /* Longitude is negative, expand two's complement */
4327 fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4328 ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8) |
4329 (int64_t)lci[9] | ((int64_t)0x3FFFFFFF<<34);
4331 } else {
4332 /* Longitude is positive */
4333 fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4334 ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8) |
4335 (int64_t)lci[9];
4337 fixpoint->altitude_type = (lci[10]>>4) & 0x0F; /* make sure that right-shift does not copy sign bit */
4338 fixpoint->altitude_res = ((lci[10] & 0x0F) << 2) | ((lci[11]>>6) & 0x03);
4339 if (lci[11] & 0x20) { /* LSB<<1 contains the sign of the latitude */
4340 /* Altitude is negative, expand two's complement */
4341 fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4342 ((int32_t)lci[13]<<8) | ((int32_t)lci[14]) |
4343 ((int32_t)0x03<<30);
4345 } else {
4346 /* Altitude is positive */
4347 fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4348 ((int32_t)lci[13]<<8) | ((int32_t)lci[14]);
4351 fixpoint->datum_type = lci[15];
4355 /* RFC3825Decoder:
4357 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4359 * The code is no longer available.
4361 static int
4362 rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal)
4364 /* Latitude */
4365 decimal->latitude = (double) fixpoint->latitude / (1 << 25);
4366 if ((decimal->latitude > 90) || (decimal->latitude < -90)) {
4367 return RFC3825_LATITUDE_OUTOFRANGE;
4370 /* Latitude Uncertainty */
4371 if (fixpoint->latitude_res > 34) {
4372 return RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE;
4374 if (fixpoint->latitude_res > 8 ) {
4375 decimal->latitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->latitude_res - 8));
4376 } else {
4377 decimal->latitude_res = (double) (UINT64_C(1) << (8 - fixpoint->latitude_res));
4380 /* Longitude */
4381 decimal->longitude = (double) fixpoint->longitude / (1 << 25);
4382 if ((decimal->longitude > 180) || (decimal->longitude < -180)) {
4383 return RFC3825_LONGITUDE_OUTOFRANGE;
4386 /* Longitude Uncertainty */
4387 if (fixpoint->longitude_res > 34) {
4388 return RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE;
4390 if (fixpoint->longitude_res > 8 ) {
4391 decimal->longitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->longitude_res - 8));
4392 } else {
4393 decimal->longitude_res = (double) (UINT64_C(1) << (8 - fixpoint->longitude_res));
4396 /* Altitude Type */
4397 decimal->altitude_type = fixpoint->altitude_type;
4398 decimal->altitude = 0;
4399 decimal->altitude_res = 0;
4401 if (decimal->altitude_type == 0) { /* Unknown */
4402 } else if (decimal->altitude_type == 1) { /* Meters */
4403 /* Altitude */
4404 decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4405 if ((decimal->altitude > ((int32_t) 1<<21)-1) || (decimal->altitude < ((int32_t) -(1<<21))))
4406 return RFC3825_ALTITUDE_OUTOFRANGE;
4408 /* Altitude Uncertainty */
4409 if (fixpoint->altitude_res > 30) {
4410 return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4412 if (fixpoint->altitude_res > 21 ) {
4413 decimal->altitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->altitude_res - 21));
4414 } else {
4415 decimal->altitude_res = (double) (UINT64_C(1) << (21 - fixpoint->altitude_res));
4417 } else if (decimal->altitude_type == 2) { /* Floors */
4418 /* Altitude */
4419 if ((fixpoint->altitude_res != 30) && (fixpoint->altitude_res != 0)) {
4420 return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4422 decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4423 } else { /* invalid type */
4424 return RFC3825_ALTITUDE_TYPE_OUTOFRANGE;
4427 /* Datum Type */
4428 decimal->datum_type = 0;
4429 if ((fixpoint->datum_type > 3) || (fixpoint->datum_type < 1)) {
4430 return RFC3825_DATUM_TYPE_OUTOFRANGE;
4432 decimal->datum_type = fixpoint->datum_type;
4434 return RFC3825_NOERROR;
4437 static int
4438 dissect_dhcpopt_isns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4440 static int * const isns_functions_hf_flags[] = {
4441 &hf_dhcp_option_isns_functions_enabled,
4442 &hf_dhcp_option_isns_functions_dd_authorization,
4443 &hf_dhcp_option_isns_functions_sec_policy_distibution,
4444 &hf_dhcp_option_isns_functions_reserved,
4445 NULL
4448 static int * const isns_dda_hf_flags[] = {
4449 &hf_dhcp_option_isns_discovery_domain_access_enabled,
4450 &hf_dhcp_option_isns_discovery_domain_access_control_node,
4451 &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
4452 &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
4453 &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
4454 &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
4455 &hf_dhcp_option_isns_discovery_domain_access_reserved,
4456 NULL
4459 static int * const isns_administrative_flags[] = {
4460 &hf_dhcp_option_isns_administrative_flags_enabled,
4461 &hf_dhcp_option_isns_administrative_flags_heartbeat,
4462 &hf_dhcp_option_isns_administrative_flags_management_scns,
4463 &hf_dhcp_option_isns_administrative_flags_default_dd,
4464 &hf_dhcp_option_isns_administrative_flags_reserved,
4465 NULL
4468 static int * const isns_server_security_flags[] = {
4469 &hf_dhcp_option_isns_server_security_bitmap_enabled,
4470 &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
4471 &hf_dhcp_option_isns_server_security_bitmap_main_mode,
4472 &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
4473 &hf_dhcp_option_isns_server_security_bitmap_pfs,
4474 &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
4475 &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
4476 &hf_dhcp_option_isns_server_security_bitmap_reserved,
4477 NULL
4480 uint16_t function_flags, dd_access_flags, administrative_flags;
4481 uint32_t server_security_flags;
4482 proto_tree *server_tree;
4483 proto_item *item;
4484 int length = tvb_reported_length(tvb);
4485 int offset = 0, heartbeat_set = 0;
4487 if (length < 14) {
4488 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 14");
4489 return 1;
4492 item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_functions,
4493 ett_dhcp_isns_functions, isns_functions_hf_flags, ENC_BIG_ENDIAN);
4494 function_flags = tvb_get_ntohs(tvb, offset);
4495 /* RFC 4174, section "2.1. iSNS Functions Field" specifies that if
4496 * the field "Function Fields Enabled" is set to 0, then "the contents
4497 * of all other iSNS Function fields MUST be ignored. We will display
4498 * the fields but add an informational expert info. This goes for all
4499 * the bitmasks: iSNS Functions, DD Access, Administrative Flags, iSNS
4500 * Server Security Bitmap */
4501 if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(function_flags, F_ISNS_FUNCTIONS_ENABLED))
4502 expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4504 offset += 2;
4505 item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_discovery_domain_access,
4506 ett_dhcp_isns_discovery_domain_access, isns_dda_hf_flags, ENC_BIG_ENDIAN);
4507 dd_access_flags = tvb_get_ntohs(tvb, offset);
4508 if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(dd_access_flags, F_ISNS_DD_ACCESS_ENABLED))
4509 expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4511 offset += 2;
4512 administrative_flags = tvb_get_ntohs(tvb, offset);
4513 if (administrative_flags & F_ISNS_ADMIN_FLAGS_ENABLED) {
4514 if ((administrative_flags & F_ISNS_ADMIN_FLAGS_HEARTBEAT)) {
4515 if (length < 18) {
4516 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 18");
4517 return offset;
4519 heartbeat_set = 1;
4522 item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_administrative_flags,
4523 ett_dhcp_isns_administrative_flags, isns_administrative_flags, ENC_BIG_ENDIAN);
4524 if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(administrative_flags, F_ISNS_ADMIN_FLAGS_ENABLED))
4525 expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4527 offset += 2;
4528 item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_server_security_bitmap,
4529 ett_dhcp_isns_server_security_bitmap, isns_server_security_flags, ENC_BIG_ENDIAN);
4530 server_security_flags = tvb_get_ntohl(tvb, offset);
4531 if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(server_security_flags, F_ISNS_SRV_SEC_BITMAP_ENABLED))
4532 expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4534 offset += 4;
4535 if (heartbeat_set) {
4536 proto_tree_add_item(tree, hf_dhcp_option_isns_heartbeat_originator_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4537 offset += 4;
4540 proto_tree_add_item(tree, hf_dhcp_option_isns_primary_server_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4542 offset += 4;
4543 if (tvb_reported_length_remaining(tvb, offset) > 0) {
4544 server_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_dhcp_isns_secondary_server_addr,
4545 &item, "Secondary iSNS Servers");
4546 dhcp_handle_basic_types(pinfo, server_tree, item, tvb, ipv4_list, offset, tvb_reported_length_remaining(tvb, offset),
4547 &hf_dhcp_option_isns_secondary_server_addr_list, NULL);
4550 return tvb_captured_length(tvb);
4553 static const value_string option43_cl_suboption_vals[] = {
4554 { 0, "Padding" },
4555 { 1, "Suboption Request List" },
4556 { 2, "Device Type" },
4557 { 3, "eSAFE Types" },
4558 { 4, "Serial Number" },
4559 { 5, "Hardware Version" },
4560 { 6, "Software Version" },
4561 { 7, "Boot ROM version" },
4562 { 8, "Organizationally Unique Identifier" },
4563 { 9, "Model Number" },
4564 { 10, "Vendor Name" },
4565 { 11, "Address Realm" },
4566 { 12, "CM/PS System Description" },
4567 { 13, "CM/PS Firmware Revision" },
4568 { 14, "Firewall Policy File Version" },
4569 { 15, "eSafe Config File Devices" },
4570 { 18, "Video Security Type" },
4571 { 31, "MTA MAC Address" },
4572 { 32, "Correlation ID" },
4573 { 51, "Vendor Name" },
4574 { 52, "CableCARD Capability" },
4575 { 53, "Device Identification (CA)" },
4576 { 54, "Device Identification (X.509)" },
4577 { 179, "LCM Server" },
4578 { 180, "LCM Domain" },
4579 { 181, "LCM NIC option 0" },
4580 { 190, "LCM Workgroup" },
4581 { 191, "Discovery" },
4582 { 192, "HH Configured" },
4583 { 193, "LCM Version" },
4584 { 194, "LCM Serial Number" },
4585 { 255, "CL End" },
4586 { 0, NULL}
4589 static const value_string cablehome_subopt11_vals[] = {
4590 { 1, "PS WAN-Man" },
4591 { 2, "PS WAN-Data" },
4592 { 0, NULL }
4595 static int
4596 dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4597 tvbuff_t *tvb, int optoff, int optend)
4599 int suboptoff = optoff;
4600 uint8_t subopt;
4601 uint8_t subopt_len;
4602 proto_tree *o43cl_v_tree;
4603 proto_item *vti;
4605 static const struct basic_types_hfs default_hfs = {
4606 &hf_dhcp_option43_value,
4607 NULL,
4608 NULL,
4609 &hf_dhcp_option43_value_stringz,
4610 NULL,
4611 &hf_dhcp_option43_value_8,
4612 NULL,
4613 NULL,
4614 &hf_dhcp_option43_value_32,
4615 NULL,
4616 NULL
4619 static const struct opt_info o43cablelabs_opt[]= {
4620 /* 0 */ {"nop", special, &hf_dhcp_option43_cl_padding}, /* dummy */
4621 /* 1 */ {"Suboption Request List", string, &hf_dhcp_option43_cl_suboption_request_list},
4622 /* 2 */ {"Device Type", string, &hf_dhcp_option43_cl_device_type},
4623 /* 3 */ {"eSAFE Types", string, &hf_dhcp_option43_cl_esafe_type},
4624 /* 4 */ {"Serial Number", string, &hf_dhcp_option43_cl_serial_number},
4625 /* 5 */ {"Hardware Version", string, &hf_dhcp_option43_cl_hardware_version},
4626 /* 6 */ {"Software Version", string, &hf_dhcp_option43_cl_software_version},
4627 /* 7 */ {"Boot ROM version", string, &hf_dhcp_option43_cl_boot_rom_version},
4628 /* 8 */ {"Organizationally Unique Identifier", special, &hf_dhcp_option43_cl_oui_bytes},
4629 /* 9 */ {"Model Number", string, &hf_dhcp_option43_cl_model_number},
4630 /* 10 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name10},
4631 /* *** 11-30: CableHome *** */
4632 /* 11 */ {"Address Realm", val_u_byte, &hf_dhcp_option43_cl_address_realm},
4633 /* 12 */ {"CM/PS System Description", string, &hf_dhcp_option43_cl_cm_ps_system_desc},
4634 /* 13 */ {"CM/PS Firmware Revision", string, &hf_dhcp_option43_cl_cm_ps_firmware_revision},
4635 /* 14 */ {"Firewall Policy File Version", string, &hf_dhcp_option43_cl_firewall_policy_file_version},
4636 /* 15 */ {"eSafe Config File Devices", string, &hf_dhcp_option43_cl_esafe_config_file_devices},
4637 /* 16 */ {"Unassigned (CableHome)", special, NULL},
4638 /* 17 */ {"Unassigned (CableHome)", special, NULL},
4639 /* 18 */ {"Video Security Type", string, &hf_dhcp_option43_cl_video_security_tape},
4640 /* 19 */ {"Unassigned (CableHome)", special, NULL},
4641 /* 20 */ {"Unassigned (CableHome)", special, NULL},
4642 /* 21 */ {"Unassigned (CableHome)", special, NULL},
4643 /* 22 */ {"Unassigned (CableHome)", special, NULL},
4644 /* 23 */ {"Unassigned (CableHome)", special, NULL},
4645 /* 24 */ {"Unassigned (CableHome)", special, NULL},
4646 /* 25 */ {"Unassigned (CableHome)", special, NULL},
4647 /* 26 */ {"Unassigned (CableHome)", special, NULL},
4648 /* 27 */ {"Unassigned (CableHome)", special, NULL},
4649 /* 28 */ {"Unassigned (CableHome)", special, NULL},
4650 /* 29 */ {"Unassigned (CableHome)", special, NULL},
4651 /* 30 */ {"Unassigned (CableHome)", special, NULL},
4652 /* *** 31-50: PacketCable *** */
4653 /* 31 */ {"MTA MAC Address", special, &hf_dhcp_option43_cl_mta_mac_address},
4654 /* 32 */ {"Correlation ID", val_u_long, &hf_dhcp_option43_cl_correlation_ID},
4655 /* 33 */ {"Unassigned (PacketCable)", special, NULL},
4656 /* 34 */ {"Unassigned (PacketCable)", special, NULL},
4657 /* 35 */ {"Unassigned (PacketCable)", special, NULL},
4658 /* 36 */ {"Unassigned (PacketCable)", special, NULL},
4659 /* 37 */ {"Unassigned (PacketCable)", special, NULL},
4660 /* 38 */ {"Unassigned (PacketCable)", special, NULL},
4661 /* 39 */ {"Unassigned (PacketCable)", special, NULL},
4662 /* 40 */ {"Unassigned (PacketCable)", special, NULL},
4663 /* 41 */ {"Unassigned (PacketCable)", special, NULL},
4664 /* 42 */ {"Unassigned (PacketCable)", special, NULL},
4665 /* 43 */ {"Unassigned (PacketCable)", special, NULL},
4666 /* 44 */ {"Unassigned (PacketCable)", special, NULL},
4667 /* 45 */ {"Unassigned (PacketCable)", special, NULL},
4668 /* 46 */ {"Unassigned (PacketCable)", special, NULL},
4669 /* 47 */ {"Unassigned (PacketCable)", special, NULL},
4670 /* 48 */ {"Unassigned (PacketCable)", special, NULL},
4671 /* 49 */ {"Unassigned (PacketCable)", special, NULL},
4672 /* 50 */ {"Unassigned (PacketCable)", special, NULL},
4673 /* *** 51-127: CableLabs *** */
4674 /* 51 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name51},
4675 /* 52 */ {"CableCARD Capability", special, &hf_dhcp_option43_cl_cablecard_capability},
4676 /* 53 */ {"Device Identification (CA)", special, &hf_dhcp_option43_cl_device_id_ca},
4677 /* 54 */ {"Device Identification (X.509)", string, &hf_dhcp_option43_cl_device_id_x509},
4678 /* 55 */ {"Unassigned (CableLabs)", special, NULL},
4679 /* *** 128-254: Vendors *** */
4680 /* 128-254 {"Unassigned (Vendors)", special, NULL}, */
4681 /* 255 {"end options", special, &hf_dhcp_option43_cl_end} */
4684 subopt = tvb_get_uint8(tvb, optoff);
4685 suboptoff++;
4687 if (subopt == 0) {
4688 proto_tree_add_item(v_tree, hf_dhcp_option43_cl_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4689 return (suboptoff);
4690 } else if (subopt == 255) { /* End Option */
4691 proto_tree_add_item(v_tree, hf_dhcp_option43_cl_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4692 /* Make sure we skip any junk left this option */
4693 return (optend);
4696 if (suboptoff >= optend) {
4697 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4698 "Suboption %d: no room left in option for suboption length", subopt);
4699 return (optend);
4702 subopt_len = tvb_get_uint8(tvb, suboptoff);
4703 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cl_suboption,
4704 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4705 subopt, val_to_str_const(subopt, option43_cl_suboption_vals, "Unknown"));
4707 o43cl_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4708 proto_tree_add_item(o43cl_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4709 suboptoff++;
4711 if (suboptoff+subopt_len > optend) {
4712 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4713 "Suboption %d: no room left in option for suboption value", subopt);
4714 return (optend);
4717 if ( (subopt < 1 ) || (subopt >= array_length(o43cablelabs_opt)) ) {
4718 proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4719 } else if (o43cablelabs_opt[subopt].ftype == special) {
4720 switch(subopt)
4722 case 8:/* OUI */
4723 /* CableLabs specs treat 43.8 inconsistently
4724 * as either binary (3b) or string (6b) */
4725 if (subopt_len == 3) {
4726 proto_tree_add_bytes_format_value(o43cl_v_tree, hf_dhcp_option43_cl_oui_bytes, tvb, suboptoff, subopt_len, NULL,
4727 "%02x:%02x:%02x", tvb_get_uint8(tvb, suboptoff), tvb_get_uint8(tvb, suboptoff+1), tvb_get_uint8(tvb, suboptoff+2));
4728 } else if (subopt_len == 6) {
4729 proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_oui_string, tvb, suboptoff, subopt_len, ENC_ASCII);
4730 } else {
4731 expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 3 or 6");
4733 break;
4734 case 31: /* MTA MAC address */
4735 if (subopt_len != 6) {
4736 expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 6");
4737 break;
4740 proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_mta_mac_address, tvb, suboptoff, 6, ENC_NA);
4741 break;
4742 default:
4743 if (o43cablelabs_opt[subopt].phf != NULL)
4744 proto_tree_add_item(o43cl_v_tree, *o43cablelabs_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4745 else
4746 proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4749 else {
4750 if (dhcp_handle_basic_types(pinfo, o43cl_v_tree, vti, tvb, o43cablelabs_opt[subopt].ftype,
4751 suboptoff, subopt_len, o43cablelabs_opt[subopt].phf, &default_hfs) == 0) {
4752 expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4756 optoff += (subopt_len + 2);
4757 return optoff;
4760 static bool
4761 dissect_cablelabs_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4763 int offset = 0;
4764 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4765 proto_tree* vendor_tree;
4767 /* Vendor Class IDs
4768 * DOCSIS - docsis
4769 * CableHome - CableHome
4770 * OpenCable2.0 - OpenCable2.0
4771 * PacketCable - pktc
4772 * DEMARC - DEMARC
4773 * sRouter - SROUTER
4774 * Remote PHY - RPD
4775 * eDOCSIS - PTA or ECM
4776 * OpenCable TRIF - TR
4779 if ((option_data->vendor_class_id != NULL) &&
4780 ((strncmp((const char*)option_data->vendor_class_id, "pktc", strlen("pktc")) == 0) ||
4781 (strncmp((const char*)option_data->vendor_class_id, "docsis", strlen("docsis")) == 0) ||
4782 (strncmp((const char*)option_data->vendor_class_id, "OpenCable2.0", strlen("OpenCable2.0")) == 0) ||
4783 (strncmp((const char*)option_data->vendor_class_id, "CableHome", strlen("CableHome")) == 0) ||
4784 (strncmp((const char*)option_data->vendor_class_id, "RPD", strlen("RPD")) == 0) ||
4785 (strncmp((const char*)option_data->vendor_class_id, "RMD", strlen("RMD")) == 0) ||
4786 (strncmp((const char*)option_data->vendor_class_id, "ECM", strlen("ECM")) == 0) ||
4787 (strncmp((const char*)option_data->vendor_class_id, "PTA", strlen("PTA")) == 0) ||
4788 (strncmp((const char*)option_data->vendor_class_id, "DEMARC", strlen("DEMARC")) == 0) ||
4789 (strncmp((const char*)option_data->vendor_class_id, "TR", strlen("TR")) == 0) ||
4790 (strncmp((const char*)option_data->vendor_class_id, "SROUTER", strlen("SROUTER")) == 0))) {
4791 /* CableLabs standard - see www.cablelabs.com/projects */
4792 proto_item_append_text(tree, " (CableLabs)");
4793 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4795 while (tvb_reported_length_remaining(tvb, offset) > 0) {
4796 offset = dissect_vendor_cablelabs_suboption(pinfo, tree, vendor_tree,
4797 tvb, offset, tvb_reported_length(tvb));
4799 return true;
4802 return false;
4805 static bool
4806 dissect_aruba_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4808 int offset = 0;
4809 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4810 proto_tree* vendor_tree;
4812 if ((option_data->vendor_class_id == NULL) ||
4813 (strncmp((const char*)option_data->vendor_class_id, ARUBA_AP, strlen(ARUBA_AP)) != 0))
4814 return false;
4816 proto_item_append_text(tree, " (Aruba AP)");
4817 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4819 proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaap_controllerip, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
4820 return true;
4823 static bool
4824 dissect_aruba_instant_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4826 int offset = 0;
4827 int reported_len = tvb_reported_length(tvb);
4828 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4829 proto_tree* vendor_tree;
4830 proto_item* vendor_item;
4831 int32_t nameorglen, ampiplen;
4833 /* Aruba Instant AP */
4834 if ((option_data->vendor_class_id == NULL) ||
4835 (strncmp((const char*)option_data->vendor_class_id, ARUBA_INSTANT_AP, strlen(ARUBA_INSTANT_AP)) != 0))
4836 return false;
4838 proto_item_append_text(tree, " (Aruba Instant AP)");
4840 vendor_item = proto_tree_add_item(tree, hf_dhcp_option43_arubaiap, tvb, offset, reported_len, ENC_ASCII);
4841 vendor_tree = proto_item_add_subtree(vendor_item, ett_dhcp_option43_suboption);
4842 nameorglen = tvb_find_uint8(tvb, offset, tvb_reported_length(tvb), ',');
4843 proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_nameorg, tvb, offset, nameorglen, ENC_ASCII);
4844 offset += (nameorglen+1);
4845 ampiplen = tvb_find_uint8(tvb, offset, reported_len-nameorglen-1, ',') - offset;
4846 proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_ampip, tvb, offset, ampiplen, ENC_ASCII);
4847 offset += (ampiplen+1);
4848 proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_password, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
4850 return true;
4853 static const value_string option43_bsdp_suboption_vals[] = {
4854 { 0, "Pad" },
4855 { 1, "Message Type" },
4856 { 2, "Version" },
4857 { 3, "Server Identifier" },
4858 { 4, "Server Priority" },
4859 { 5, "Reply Port" },
4860 { 6, "Boot Image List Path" },
4861 { 7, "Default Boot Image" },
4862 { 8, "Selected Boot Image" },
4863 { 9, "Boot Image List" },
4864 { 10, "NetBoot 1.0 Firmware" },
4865 { 11, "Boot Image Attributes Filter List" },
4866 { 12, "Maximum Message Size" },
4867 { 255, "End" },
4868 { 0, NULL}
4871 static void
4872 dissect_vendor_bsdp_boot_image(proto_tree *v_tree, tvbuff_t *tvb, int optoff)
4874 static int * const dhcp_o43_bsdp_attributes_flags[] = {
4875 &hf_dhcp_option43_bsdp_boot_image_attribute_install,
4876 &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
4877 &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
4878 NULL
4881 proto_tree_add_bitmask(v_tree, tvb, optoff, hf_dhcp_option43_bsdp_boot_image_attribute, ett_dhcp_o43_bsdp_attributes_flags, dhcp_o43_bsdp_attributes_flags, ENC_NA);
4884 static int
4885 dissect_vendor_bsdp_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4886 tvbuff_t *tvb, int optoff, int optend)
4888 int suboptoff = optoff;
4889 int attributes_off;
4890 uint8_t subopt, string_len;
4891 uint8_t subopt_len, attributes_len;
4892 unsigned item_len;
4893 proto_tree *o43bsdp_v_tree, *o43bsdp_va_tree, *o43bsdp_vb_tree, *o43bsdp_vc_tree, *o43bsdp_vd_tree;
4894 proto_item *vti, *ti, *tj;
4896 subopt = tvb_get_uint8(tvb, optoff);
4897 suboptoff++;
4899 if (subopt == 0 || subopt == 255) {
4900 /* Pad (0) and End (255) have implicit length of 1. */
4901 item_len = 1;
4902 } else if (suboptoff >= optend) {
4903 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4904 "Suboption %d: no room left in option for suboption length", subopt);
4905 return (optend);
4906 } else {
4907 subopt_len = tvb_get_uint8(tvb, suboptoff);
4908 item_len = subopt_len + 2;
4911 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_bsdp_suboption,
4912 tvb, optoff, item_len, subopt, "(%d) %s",
4913 subopt, val_to_str_const(subopt, option43_bsdp_suboption_vals, "Unknown"));
4914 if (item_len == 1) {
4915 return (optoff + 1);
4918 o43bsdp_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4919 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4920 suboptoff++;
4922 if (suboptoff+subopt_len > optend) {
4923 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4924 "Suboption %d: no room left in option for suboption value", subopt);
4925 return (optend);
4928 switch(subopt)
4930 case 1:
4931 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_type, tvb, suboptoff, subopt_len, ENC_ASCII|ENC_NA);
4932 break;
4933 case 2:
4934 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_version, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4935 break;
4936 case 3:
4937 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_identifier, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4938 break;
4939 case 4:
4940 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_priority, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4941 break;
4942 case 5:
4943 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_reply_port, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4944 break;
4945 case 6:
4946 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list_path, tvb, suboptoff, subopt_len, ENC_ASCII);
4947 break;
4948 case 7:
4949 ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_default_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN|ENC_NA);
4950 o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
4951 dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, suboptoff);
4952 proto_tree_add_item(o43bsdp_va_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN|ENC_NA);
4953 break;
4954 case 8:
4955 ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_selected_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN|ENC_NA);
4956 o43bsdp_vc_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
4957 dissect_vendor_bsdp_boot_image(o43bsdp_vc_tree, tvb, suboptoff);
4958 proto_tree_add_item(o43bsdp_vc_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN|ENC_NA);
4959 break;
4960 case 9:
4961 ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN|ENC_NA);
4962 attributes_len = subopt_len;
4963 attributes_off = suboptoff;
4964 o43bsdp_vd_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_image_desc_list);
4965 while (attributes_len >= 5) {
4966 string_len = tvb_get_uint8(tvb, attributes_off+4);
4967 if (string_len > 0) {
4968 tj = proto_tree_add_item(o43bsdp_vd_tree, hf_dhcp_option43_bsdp_image_desc, tvb, attributes_off, string_len+5, ENC_BIG_ENDIAN|ENC_NA);
4969 o43bsdp_vb_tree = proto_item_add_subtree(tj, ett_dhcp_o43_bsdp_image_desc);
4970 dissect_vendor_bsdp_boot_image(o43bsdp_vb_tree, tvb, attributes_off);
4971 proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, attributes_off+2, 2, ENC_BIG_ENDIAN|ENC_NA);
4972 proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name_len, tvb, attributes_off+4, 1, ENC_BIG_ENDIAN|ENC_NA);
4973 proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name, tvb, attributes_off+5, string_len, ENC_UTF_8);
4975 attributes_off += 5 + string_len;
4976 attributes_len -= 5 + string_len;
4978 break;
4979 case 10:
4980 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_netboot_firmware, tvb, suboptoff, subopt_len, ENC_NA);
4981 break;
4982 case 11:
4983 ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_attributes_filter_list, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN|ENC_NA);
4984 attributes_len = subopt_len;
4985 attributes_off = suboptoff;
4986 o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_attributes);
4987 while (attributes_len >= 2) {
4988 dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, attributes_off);
4989 attributes_off+=2;
4990 attributes_len-=2;
4992 break;
4993 case 12:
4994 proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_size, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN|ENC_NA);
4995 break;
4998 optoff += item_len;
4999 return optoff;
5002 static bool
5003 dissect_apple_bsdp_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5005 int offset = 0;
5006 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5007 proto_tree* vendor_tree;
5009 if ((option_data->vendor_class_id == NULL) ||
5010 (strncmp((const char*)option_data->vendor_class_id, APPLE_BSDP_SERVER, strlen(APPLE_BSDP_SERVER)) != 0))
5011 return false;
5013 /* Apple BSDP */
5014 proto_item_append_text(tree, " (Boot Server Discovery Protocol (BSDP))");
5015 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5017 while (tvb_reported_length_remaining(tvb, offset) > 0) {
5018 offset = dissect_vendor_bsdp_suboption(pinfo, tree, vendor_tree,
5019 tvb, offset, tvb_reported_length(tvb));
5022 return true;
5025 /* Cisco Vendor Specific Information */
5028 { 1, "1" }, * D,R: 03 *
5029 { 2, "2" }, * D,R: 01 *
5030 { 3, "3" }, * D,R: 00 01 # O,A: 00 02 *
5031 { 4, "Node ID" }, * O,A: 00 00 00 ca *
5032 { 5, "5" }, * O,A: 01 *
5033 { 6, "6" }, * D,R: 01 # O,A: 01 *
5034 { 7, "Model" }, * D,R: N9K-C9336PQ *
5035 { 8, "APIC UUID" }, * O,A: 09bced36-69f1-11e6-96ce-8baf09371338 *
5036 { 9, "Fabricname" }, * O,A: ams-fab1 *
5037 { 10, "10" }, * D,R: 00 00 00 01 *
5038 { 11, "SerialNo" }, * D,R: SAL1926J4QW *
5039 { 12, "Client Int" }, * D,O: eth1/20.20 # R,A: eth1/20.20 *
5041 static const value_string option43_cisco_suboption_vals[] = {
5042 { 1, "Unk-1 (Node role?)" }, /* uint8 */
5043 { 2, "Unk-2 (Spine level?)" }, /* uint8 */
5044 { 3, "Unk-3 (Pod ID?)" }, /* uint16 */
5045 { 4, "Node ID" }, /* uint32 */
5046 { 5, "Unk-5" }, /* uint8 */
5047 { 6, "Unk-6" }, /* uint8 */
5048 { 7, "Model" }, /* String */
5049 { 8, "APIC UUID" }, /* String */
5050 { 9, "Fabricname" }, /* String */
5051 { 10, "Unk-10" }, /* uint32 */
5052 { 11, "SerialNo" }, /* String */
5053 { 12, "Interfacename" }, /* String */
5055 { 0, NULL}
5058 static int
5059 dissect_vendor_cisco_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5060 tvbuff_t *tvb, int optoff, int optend)
5062 int suboptoff = optoff;
5063 uint8_t subopt;
5064 uint8_t subopt_len;
5065 unsigned item_len;
5066 proto_tree *o43cisco_v_tree;
5067 proto_item *vti;
5069 subopt = tvb_get_uint8(tvb, optoff);
5070 suboptoff++;
5072 if (suboptoff >= optend) {
5073 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5074 "Suboption %d: No room left in option for suboption length", subopt);
5075 return (optend);
5076 } else {
5077 subopt_len = tvb_get_uint8(tvb, suboptoff);
5078 item_len = subopt_len + 2;
5081 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cisco_suboption,
5082 tvb, optoff, item_len, subopt, "(%d) %s",
5083 subopt, val_to_str_const(subopt, option43_cisco_suboption_vals, "Unknown"));
5085 o43cisco_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5086 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5087 suboptoff++;
5089 if (suboptoff+subopt_len > optend) {
5090 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5091 "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5092 return (optend);
5095 switch(subopt)
5097 case 1:
5098 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown1, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5099 break;
5100 case 2:
5101 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown2, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5102 break;
5103 case 3:
5104 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown3, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5105 break;
5106 case 4:
5107 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_nodeid, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5108 break;
5109 case 5:
5110 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown5, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5111 break;
5112 case 6:
5113 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown6, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5114 break;
5115 case 7:
5116 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_model, tvb, suboptoff, subopt_len, ENC_ASCII);
5117 break;
5118 case 8:
5119 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_apicuuid, tvb, suboptoff, subopt_len, ENC_ASCII);
5120 break;
5121 case 9:
5122 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_fabricname, tvb, suboptoff, subopt_len, ENC_ASCII);
5123 break;
5124 case 10:
5125 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown10, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5126 break;
5127 case 11:
5128 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_serialno, tvb, suboptoff, subopt_len, ENC_ASCII);
5129 break;
5130 case 12:
5131 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_clientint, tvb, suboptoff, subopt_len, ENC_ASCII);
5132 break;
5133 default:
5134 proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5137 optoff += item_len;
5138 return optoff;
5141 static bool
5142 dissect_cisco_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5144 int offset = 0;
5145 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5146 proto_tree* vendor_tree;
5148 if ((option_data->vendor_class_id == NULL) ||
5149 (strncmp((const char*)option_data->vendor_class_id, CISCO_VCID, strlen(CISCO_VCID)) != 0))
5150 return false;
5152 /* Cisco ACI Fabric*/
5153 proto_item_append_text(tree, " (Cisco ACI Fabric)");
5154 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5156 while (tvb_reported_length_remaining(tvb, offset) > 0) {
5157 offset = dissect_vendor_cisco_suboption(pinfo, tree, vendor_tree,
5158 tvb, offset, tvb_reported_length(tvb));
5161 return true;
5164 /* Aerohive (Extremenetworks) Vendor Specific Information */
5166 static const value_string option43_aerohive_suboption_vals[] = {
5167 { 225, "XiqHostname" }, /* String */
5168 { 226, "XiqIpAddress" }, /* Ipv4address */
5170 { 0, NULL}
5173 static int
5174 dissect_vendor_aerohive_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5175 tvbuff_t *tvb, int optoff, int optend)
5177 int suboptoff = optoff;
5178 uint8_t subopt;
5179 uint8_t subopt_len;
5180 unsigned item_len;
5181 proto_tree *o43aerohive_v_tree;
5182 proto_item *vti;
5184 subopt = tvb_get_uint8(tvb, optoff);
5185 suboptoff++;
5187 if (suboptoff >= optend) {
5188 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5189 "Suboption %d: No room left in option for suboption length", subopt);
5190 return (optend);
5191 } else {
5192 subopt_len = tvb_get_uint8(tvb, suboptoff);
5193 item_len = subopt_len + 2;
5196 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_aerohive_suboption,
5197 tvb, optoff, item_len, subopt, "(%d) %s",
5198 subopt, val_to_str_const(subopt, option43_aerohive_suboption_vals, "Unknown"));
5200 o43aerohive_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5201 proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5202 suboptoff++;
5204 if (suboptoff+subopt_len > optend) {
5205 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5206 "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5207 return (optend);
5210 switch(subopt)
5212 case 225:
5213 proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqhostname, tvb, suboptoff, subopt_len, ENC_ASCII);
5214 break;
5215 case 226:
5216 proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqipaddress, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5217 break;
5218 default:
5219 proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5222 optoff += item_len;
5223 return optoff;
5226 static bool
5227 dissect_aerohive_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5229 int offset = 0;
5230 dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5231 proto_tree* vendor_tree;
5233 if ((option_data->vendor_class_id == NULL) ||
5234 (strncmp((const char*)option_data->vendor_class_id, AEROHIVE_VCID, strlen(AEROHIVE_VCID)) != 0))
5235 return false;
5237 /* Cisco ACI Fabric*/
5238 proto_item_append_text(tree, " (Aerohive)");
5239 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5241 while (tvb_reported_length_remaining(tvb, offset) > 0) {
5242 offset = dissect_vendor_aerohive_suboption(pinfo, tree, vendor_tree,
5243 tvb, offset, tvb_reported_length(tvb));
5246 return true;
5249 static int
5250 dissect_vendor_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5251 tvbuff_t *tvb, uint32_t optoff, uint32_t optend)
5253 uint32_t suboptoff = optoff;
5254 uint8_t subopt;
5255 uint32_t subopt_len;
5256 proto_item *item;
5257 proto_tree *sub_tree;
5259 item = proto_tree_add_item(v_tree, hf_dhcp_vendor_unknown_suboption, tvb, optoff, 1, ENC_NA);
5260 subopt = tvb_get_uint8(tvb, optoff);
5262 suboptoff+=1;
5264 if (suboptoff >= optend) {
5265 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5266 "Suboption %d: no room left in option for suboption length", subopt);
5267 return (optend);
5270 sub_tree = proto_item_add_subtree(item, ett_dhcp_option125_suboption);
5271 proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
5272 suboptoff++;
5274 if (suboptoff+subopt_len > optend) {
5275 expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
5276 "Suboption %d: no room left in option for suboption value", subopt);
5277 return (optend);
5280 proto_tree_add_item(sub_tree, hf_dhcp_suboption_data, tvb, suboptoff, subopt_len, ENC_NA);
5281 suboptoff+= subopt_len;
5283 return suboptoff;
5287 static int
5288 dissect_dhcpopt_vi_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5290 uint32_t offset = 0;
5291 uint32_t enterprise = 0;
5292 uint32_t s_end = 0;
5293 uint32_t option_data_len = 0;
5294 proto_item *vti;
5295 proto_tree *e_tree;
5297 while (tvb_reported_length_remaining(tvb, offset) >= 5) {
5299 vti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option125_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
5300 e_tree = proto_item_add_subtree(vti, ett_dhcp_option);
5301 offset += 4;
5303 proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option125_length, tvb, offset, 1, ENC_NA, &option_data_len);
5304 offset += 1;
5306 s_end = offset + option_data_len;
5307 if ( tvb_reported_length_remaining(tvb, s_end) < 0 ) {
5308 expert_add_info_format(pinfo, vti, &ei_dhcp_option125_enterprise_malformed, "no room left in option for enterprise %u data", enterprise);
5309 break;
5312 while (offset < s_end) {
5313 tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
5314 int bytes_dissected = dissector_try_uint(dhcp_enterprise_specific_table, enterprise, enterprise_tvb, pinfo, e_tree);
5315 if (bytes_dissected == 0) {
5316 offset = dissect_vendor_generic_suboption(pinfo, vti, e_tree, tvb, offset, s_end);
5317 } else{
5318 offset += bytes_dissected;
5323 if (tvb_reported_length_remaining(tvb, offset) > 0) {
5324 expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
5327 return tvb_captured_length(tvb);
5330 static const value_string option43_alcatel_suboption_vals[] = {
5331 { 0, "Padding" },
5332 { 58, "Voice VLAN ID" },
5333 { 64, "Spatial Redundancy TFTP1" },
5334 { 65, "Spatial Redundancy TFTP2" },
5335 { 66, "Application Type" },
5336 { 67, "SIP URL" },
5337 { 255, "Alcatel-Lucent End" },
5338 { 0, NULL}
5341 static const value_string option43_alcatel_app_type_vals[] = {
5342 { 0, "NOE" },
5343 { 1, "SIP" },
5344 { 0, NULL}
5347 /* If an Alcatel-Lucent Option 43 suboption has a known fixed length,
5348 * return that length. Returns 0 for variable length options and unknown
5349 * options.
5351 static unsigned
5352 get_alcatel_suboption_len(unsigned subopt)
5354 switch(subopt) {
5355 case 58: /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5356 return 2;
5357 case 64: /* 0x40 - Alcatel-Lucent TFTP1 */
5358 return 4;
5359 case 65: /* 0x41 - Alcatel-Lucent TFTP2 */
5360 return 4;
5361 case 66: /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5362 return 1;
5363 case 0: /* Alcatel-Lucent Padding */
5364 case 67: /* 0x43 - Alcatel-Lucent SIP URL */
5365 case 255: /* Alcatel-Lucent End */
5366 default:
5367 return 0;
5371 static int
5372 dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5373 tvbuff_t *tvb, int optoff, int optend)
5375 int suboptoff = optoff;
5376 uint8_t subopt;
5377 uint8_t subopt_len;
5378 proto_item *vti;
5379 proto_tree *o43alcatel_v_tree;
5381 subopt = tvb_get_uint8(tvb, optoff);
5382 suboptoff++;
5384 if (subopt == 0) {
5385 proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
5386 return (suboptoff);
5387 } else if (subopt == 255) { /* End Option */
5388 proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
5389 /* Make sure we skip any junk left this option */
5390 return (optend);
5393 if (suboptoff >= optend) {
5394 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5395 "Suboption %d: no room left in option for suboption length", subopt);
5396 return (optend);
5399 subopt_len = tvb_get_uint8(tvb, suboptoff);
5400 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_alcatel_suboption,
5401 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5402 subopt, val_to_str_const(subopt, option43_alcatel_suboption_vals, "Unknown"));
5404 o43alcatel_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5405 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5406 suboptoff++;
5408 if (suboptoff+subopt_len > optend) {
5409 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5410 "Suboption %d: no room left in option for suboption value", subopt);
5411 return (optend);
5414 unsigned subopt_len_expected = get_alcatel_suboption_len(subopt);
5415 if (subopt_len_expected && subopt_len_expected != subopt_len) {
5416 expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't %u", subopt_len_expected);
5417 return optend;
5419 switch (subopt)
5421 case 58: /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5422 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_vlan_id, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
5423 break;
5424 case 64: /* 0x40 - Alcatel-Lucent TFTP1 */
5425 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp1, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5426 break;
5427 case 65: /* 0x41 - Alcatel-Lucent TFTP2 */
5428 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp2, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5429 break;
5430 case 66: /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5431 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_app_type, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5432 break;
5433 case 67: /* 0x43 - Alcatel-Lucent SIP URL */
5434 proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_sip_url, tvb, suboptoff, subopt_len, ENC_ASCII);
5435 break;
5436 default:
5437 expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
5438 return optend;
5441 optoff += (subopt_len + 2);
5442 return optoff;
5445 static bool
5446 dissect_alcatel_lucent_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
5448 int offset = 0;
5449 uint8_t s_option;
5450 proto_tree* vendor_tree;
5452 if (tvb_reported_length(tvb) < 1)
5453 return false;
5455 s_option = tvb_get_uint8(tvb, offset);
5456 if ((s_option==58 || s_option==64 || s_option==65
5457 || s_option==66 || s_option==67)
5458 && test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), get_alcatel_suboption_len)) {
5460 /* Alcatel-Lucent DHCP Extensions */
5461 proto_item_append_text(tree, " (Alcatel-Lucent)");
5462 vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5464 while (tvb_reported_length_remaining(tvb, offset) > 0) {
5465 offset = dissect_vendor_alcatel_suboption(pinfo, tree, vendor_tree,
5466 tvb, offset, tvb_reported_length(tvb));
5468 return true;
5471 return false;
5474 static const value_string option63_suboption_vals[] = {
5475 { 1, "NWIP does not exist on subnet" },
5476 { 2, "NWIP exists in options area" },
5477 { 3, "NWIP exists in sname/file" },
5478 { 4, "NWIP exists, but too big" },
5479 { 5, "Broadcast for nearest Netware server" },
5480 { 6, "Preferred DSS server" },
5481 { 7, "Nearest NWIP server" },
5482 { 8, "Autoretries" },
5483 { 9, "Autoretry delay, secs" },
5484 { 10, "Support NetWare/IP v1.1" },
5485 { 11, "Primary DSS" },
5486 { 0, NULL }
5489 static int
5490 dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5491 tvbuff_t *tvb, int optoff, int optend)
5493 int suboptoff = optoff;
5494 uint8_t subopt, subopt_len;
5495 proto_tree *o63_v_tree;
5496 proto_item *vti, *ti;
5498 static const struct basic_types_hfs default_hfs = {
5499 NULL,
5500 &hf_dhcp_option63_value_ip_address,
5501 &hf_dhcp_option63_value_ip_address,
5502 NULL,
5503 &hf_dhcp_option63_value_boolean,
5504 &hf_dhcp_option63_value_8,
5505 NULL,
5506 NULL,
5507 NULL,
5508 NULL,
5509 NULL
5512 static const struct opt_info o63_opt[]= {
5513 /* 0 */ {"",none,NULL},
5514 /* 1 */ {"NWIP does not exist on subnet",presence,NULL},
5515 /* 2 */ {"NWIP exists in options area",presence,NULL},
5516 /* 3 */ {"NWIP exists in sname/file",presence,NULL},
5517 /* 4 */ {"NWIP exists, but too big",presence,NULL},
5518 /* 5 */ {"Broadcast for nearest Netware server",val_boolean, &hf_dhcp_option63_broadcast},
5519 /* 6 */ {"Preferred DSS server",ipv4_list,&hf_dhcp_option63_preferred_dss_server},
5520 /* 7 */ {"Nearest NWIP server",ipv4_list,&hf_dhcp_option63_nearest_nwip_server},
5521 /* 8 */ {"Autoretries",val_u_byte,&hf_dhcp_option63_autoretries},
5522 /* 9 */ {"Autoretry delay, secs",val_u_byte,&hf_dhcp_option63_autoretry_delay},
5523 /* 10*/ {"Support NetWare/IP v1.1",val_boolean,&hf_dhcp_option63_support_netware_v1_1},
5524 /* 11*/ {"Primary DSS",ipv4,&hf_dhcp_option63_primary_dss}
5527 subopt = tvb_get_uint8(tvb, optoff);
5528 suboptoff++;
5530 if (suboptoff >= optend) {
5531 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5532 "Suboption %d: no room left in option for suboption length", subopt);
5533 return (optend);
5536 subopt_len = tvb_get_uint8(tvb, suboptoff);
5537 vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option63_suboption,
5538 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5539 subopt, val_to_str_const(subopt, option63_suboption_vals, "Unknown"));
5541 o63_v_tree = proto_item_add_subtree(vti, ett_dhcp_option63_suboption);
5542 proto_tree_add_item(o63_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5543 suboptoff++;
5545 ti = proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5546 proto_item_set_hidden(ti);
5548 if (subopt < array_length(o63_opt)) {
5549 if (dhcp_handle_basic_types(pinfo, o63_v_tree, vti, tvb, o63_opt[subopt].ftype,
5550 suboptoff, subopt_len, o63_opt[subopt].phf, &default_hfs) == 0) {
5551 switch(o63_opt[subopt].ftype)
5553 case presence:
5554 if (subopt_len != 0) {
5555 expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 0");
5557 break;
5558 default:
5559 if (o63_opt[subopt].phf == NULL)
5560 proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5561 break;
5565 optoff += (subopt_len + 2);
5566 return optoff;
5569 static int
5570 dissect_dhcpopt_netware_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5572 int offset = 0;
5574 while (tvb_reported_length_remaining(tvb, offset) > 0) {
5575 offset = dissect_netware_ip_suboption(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
5578 return tvb_captured_length(tvb);
5581 static const value_string option125_tr111_suboption_vals[] = {
5582 { 1, "DeviceManufacturerOUI" },
5583 { 2, "DeviceSerialNumber" },
5584 { 3, "DeviceProductClass" },
5585 { 4, "GatewayManufacturerOUI" },
5586 { 5, "GatewaySerialNumber" },
5587 { 6, "GatewayProductClass" },
5588 { 0, NULL }
5591 static int
5592 dissect_vendor_tr111_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5594 int offset = 0;
5595 proto_tree *o125_v_tree;
5596 proto_item *vti, *ti;
5597 uint8_t subopt, subopt_len;
5599 static const struct basic_types_hfs default_hfs = {
5600 NULL,
5601 NULL,
5602 NULL,
5603 &hf_dhcp_option125_value_stringz,
5604 NULL,
5605 NULL,
5606 NULL,
5607 NULL,
5608 NULL,
5609 NULL,
5610 NULL
5613 /* Reference: TR-111 DHCP Option 125 Sub-Option Data Fields
5614 Page 10.
5617 static const struct opt_info o125_tr111_opt[]= {
5618 /* 0 */ {"nop", special, NULL}, /* dummy */
5619 /* 1 */ {"DeviceManufacturerOUI", oui, &hf_dhcp_option125_tr111_device_manufacturer_oui},
5620 /* 2 */ {"DeviceSerialNumber", string, &hf_dhcp_option125_tr111_device_serial_number},
5621 /* 3 */ {"DeviceProductClass", string, &hf_dhcp_option125_tr111_device_product_class},
5622 /* 4 */ {"GatewayManufacturerOUI", string, &hf_dhcp_option125_tr111_gateway_manufacturer_oui},
5623 /* 5 */ {"GatewaySerialNumber", string, &hf_dhcp_option125_tr111_gateway_serial_number},
5624 /* 6 */ {"GatewayProductClass", string, &hf_dhcp_option125_tr111_gateway_product_class},
5627 subopt = tvb_get_uint8(tvb, offset);
5628 offset++;
5630 if (tvb_reported_length_remaining(tvb, offset) < 1) {
5631 expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5632 "Suboption %d: no room left in option for suboption length", subopt);
5633 return offset;
5636 subopt_len = tvb_get_uint8(tvb, offset);
5637 vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_tr111_suboption,
5638 tvb, offset, subopt_len+2, subopt, "(%d) %s",
5639 subopt, val_to_str_const(subopt, option125_tr111_suboption_vals, "Unknown"));
5641 o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_tr111_suboption);
5642 proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5643 offset++;
5645 if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5646 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5647 "Suboption %d: no room left in option for suboption value", subopt);
5648 return offset;
5651 ti = proto_tree_add_item(tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5652 proto_item_set_hidden(ti);
5654 if (subopt < array_length(o125_tr111_opt)) {
5655 if (dhcp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_tr111_opt[subopt].ftype, offset, subopt_len, o125_tr111_opt[subopt].phf, &default_hfs) == 0) {
5656 if (o125_tr111_opt[subopt].ftype == special) {
5657 if (o125_tr111_opt[subopt].phf != NULL)
5658 proto_tree_add_item(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5659 else
5660 proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5662 else if (o125_tr111_opt[subopt].ftype == oui) {
5663 /* Get hex string. Expecting 6 characters. */
5664 const char *oui_string = (char *)tvb_get_string_enc(pinfo->pool, tvb, offset, subopt_len, ENC_ASCII);
5665 /* Convert to OUI number. Only 3 bytes so no data lost in downcast. */
5666 uint32_t oui_number = (uint32_t)strtol(oui_string, NULL, 16);
5667 /* Add item using oui_vals */
5668 proto_tree_add_uint(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, oui_number);
5669 } else if (o125_tr111_opt[subopt].phf == NULL)
5670 proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5674 return subopt_len + 2;
5677 static const value_string option125_cl_suboption_vals[] = {
5678 { 1, "Option Request" },
5679 { 2, "TFTP Server Addresses" },
5680 { 3, "eRouter Container Option" },
5681 { 4, "MIB Environment Indicator Option" },
5682 { 5, "Modem Capabilities" },
5683 { 0, NULL }
5686 static const value_string pkt_mib_env_ind_opt_vals[] = {
5687 { 0x00, "Reserved" },
5688 { 0x01, "CableLabs" },
5689 { 0x02, "IETF" },
5690 { 0x03, "EuroCableLabs" },
5691 { 0, NULL }
5694 static int
5695 dissect_vendor_cl_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5697 int offset = 0;
5698 uint8_t subopt, subopt_len;
5699 proto_tree *o125_v_tree;
5700 proto_item *vti;
5702 static const struct basic_types_hfs default_hfs = {
5703 &hf_dhcp_option125_value,
5704 &hf_dhcp_option125_value_ip_address,
5705 &hf_dhcp_option125_value_ip_address,
5706 &hf_dhcp_option125_value_stringz,
5707 NULL,
5708 &hf_dhcp_option125_value_8,
5709 &hf_dhcp_option125_value_16,
5710 NULL,
5711 NULL,
5712 NULL,
5713 NULL
5716 static const struct opt_info o125_cl_opt[]= {
5717 /* 0 */ {"nop", special, NULL}, /* dummy */
5718 /* 1 */ {"Option Request = ", bytes, &hf_dhcp_option125_cl_option_request},
5719 /* 2 */ {"TFTP Server Addresses : ", ipv4_list, &hf_dhcp_option125_cl_tftp_server_addresses},
5720 /* 3 */ {"eRouter Container Option : ", bytes, &hf_dhcp_option125_cl_erouter_container_option},
5721 /* 4 */ {"MIB Environment Indicator Option = ", val_u_byte, &hf_dhcp_option125_cl_mib_environment_indicator_option},
5722 /* 5 */ {"Modem Capabilities : ", special, &hf_dhcp_option125_cl_modem_capabilities},
5725 subopt = tvb_get_uint8(tvb, offset);
5726 offset++;
5728 if (tvb_reported_length_remaining(tvb, offset) < 1) {
5729 expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5730 "Suboption %d: no room left in option for suboption length", subopt);
5731 return offset;
5734 subopt_len = tvb_get_uint8(tvb, offset);
5735 vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_cl_suboption,
5736 tvb, offset, subopt_len+2, subopt, "(%d) %s",
5737 subopt, val_to_str_const(subopt, option125_cl_suboption_vals, "Unknown"));
5739 o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_cl_suboption);
5740 proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5741 offset++;
5743 if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5744 expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5745 "Suboption %d: no room left in option for suboption value", subopt);
5746 return offset;
5749 if (subopt < array_length(o125_cl_opt)) {
5750 if (dhcp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_cl_opt[subopt].ftype,
5751 offset, subopt_len, o125_cl_opt[subopt].phf, &default_hfs) == 0) {
5753 switch(o125_cl_opt[subopt].ftype) {
5754 case special:
5755 if (o125_cl_opt[subopt].phf != NULL)
5756 proto_tree_add_item(o125_v_tree, *o125_cl_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5757 else
5758 proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5759 switch(subopt){
5760 case 5: /* Modem Capabilities */
5761 dissect_docsis_cm_cap(pinfo, o125_v_tree, tvb, offset-2, subopt_len+2, true);
5762 break;
5764 break;
5765 default:
5766 if (o125_cl_opt[subopt].phf == NULL)
5767 proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5768 break;
5773 return subopt_len + 2;
5776 /* PacketCable Multimedia Terminal Adapter device capabilities (option 60).
5777 Ref: PKT-SP-I05-021127 sections 8.2 and 10 */
5779 #define PKT_MDC_TLV_OFF 10
5782 /* These are ASCII-encoded hexadecimal digits. We use the raw hex equivalent for
5783 convenience. */
5784 #define PKT_MDC_VERSION 0x3031 /* "01" */
5785 #define PKT_MDC_TEL_END 0x3032 /* "02" */
5786 #define PKT_MDC_TGT 0x3033 /* "03" */
5787 #define PKT_MDC_HTTP_ACC 0x3034 /* "04" */
5788 #define PKT_MDC_SYSLOG 0x3035 /* "05" */
5789 #define PKT_MDC_NCS 0x3036 /* "06" */
5790 #define PKT_MDC_PRI_LINE 0x3037 /* "07" */
5791 #define PKT_MDC_VENDOR_TLV 0x3038 /* "08" */
5792 #define PKT_MDC_NVRAM_STOR 0x3039 /* "09" */
5793 #define PKT_MDC_PROV_REP 0x3041 /* "0A" */
5794 #define PKT_MDC_PROV_REP_LC 0x3061 /* "0a" */
5795 #define PKT_MDC_SUPP_CODECS 0x3042 /* "0B" */
5796 #define PKT_MDC_SUPP_CODECS_LC 0x3062 /* "0b" */
5797 #define PKT_MDC_SILENCE 0x3043 /* "0C" */
5798 #define PKT_MDC_SILENCE_LC 0x3063 /* "0c" */
5799 #define PKT_MDC_ECHO_CANCEL 0x3044 /* "0D" */
5800 #define PKT_MDC_ECHO_CANCEL_LC 0x3064 /* "0d" */
5801 #define PKT_MDC_RSVP 0x3045 /* "0E" */
5802 #define PKT_MDC_RSVP_LC 0x3065 /* "0e" */
5803 #define PKT_MDC_UGS_AD 0x3046 /* "0F" */
5804 #define PKT_MDC_UGS_AD_LC 0x3066 /* "0f" */
5805 #define PKT_MDC_IF_INDEX 0x3130 /* "10" */
5806 #define PKT_MDC_FLOW_LOG 0x3131 /* "11" */
5807 #define PKT_MDC_PROV_FLOWS 0x3132 /* "12" */
5808 /* PacketCable 1.5: */
5809 #define PKT_MDC_T38_VERSION 0x3133 /* "13" */
5810 #define PKT_MDC_T38_EC 0x3134 /* "14" */
5811 #define PKT_MDC_RFC2833_DTMF 0x3135 /* "15" */
5812 #define PKT_MDC_VOICE_METRICS 0x3136 /* "16" */
5813 #define PKT_MDC_MIBS 0x3137 /* "17" */
5814 #define PKT_MDC_MGPI 0x3138 /* "18" */
5815 #define PKT_MDC_V152 0x3139 /* "19" */
5816 #define PKT_MDC_CBS 0x3141 /* "1A" */
5817 #define PKT_MDC_CBS_LC 0x3161 /* "1a" */
5819 static const value_string pkt_mdc_type_vals[] = {
5820 { PKT_MDC_VERSION, "PacketCable Version" },
5821 { PKT_MDC_TEL_END, "Number Of Telephony Endpoints" },
5822 { PKT_MDC_TGT, "TGT Support" },
5823 { PKT_MDC_HTTP_ACC, "HTTP Download File Access Method Support" },
5824 { PKT_MDC_SYSLOG, "MTA-24 Event SYSLOG Notification Support" },
5825 { PKT_MDC_NCS, "NCS Service Flow Support" },
5826 { PKT_MDC_PRI_LINE, "Primary Line Support" },
5827 { PKT_MDC_VENDOR_TLV, "Vendor Specific TLV Type(s)" },
5828 { PKT_MDC_NVRAM_STOR, "NVRAM Ticket/Session Keys Storage Support" },
5829 { PKT_MDC_PROV_REP, "Provisioning Event Reporting Support" },
5830 { PKT_MDC_PROV_REP_LC, "Provisioning Event Reporting Support" },
5831 { PKT_MDC_SUPP_CODECS, "Supported CODEC(s)" },
5832 { PKT_MDC_SUPP_CODECS_LC, "Supported CODEC(s)" },
5833 { PKT_MDC_SILENCE, "Silence Suppression Support" },
5834 { PKT_MDC_SILENCE_LC, "Silence Suppression Support" },
5835 { PKT_MDC_ECHO_CANCEL, "Echo Cancellation Support" },
5836 { PKT_MDC_ECHO_CANCEL_LC, "Echo Cancellation Support" },
5837 { PKT_MDC_RSVP, "RSVP Support/ Reserved" },
5838 { PKT_MDC_RSVP_LC, "RSVP Support/ Reserved" },
5839 { PKT_MDC_UGS_AD, "UGS-AD Support" },
5840 { PKT_MDC_UGS_AD_LC, "UGS-AD Support" },
5841 { PKT_MDC_IF_INDEX, "MTA's \"ifIndex\" starting number in \"ifTable\"" },
5842 { PKT_MDC_FLOW_LOG, "Provisioning Flow Logging Support" },
5843 { PKT_MDC_PROV_FLOWS, "Supported Provisioning Flows" },
5844 /* PacketCable 1.5: */
5845 { PKT_MDC_T38_VERSION, "T38 Version Support" },
5846 { PKT_MDC_T38_EC, "T38 Error Correction Support" },
5847 { PKT_MDC_RFC2833_DTMF, "RFC 2833 DTMF Support" },
5848 { PKT_MDC_VOICE_METRICS, "Voice Metrics Support" },
5849 { PKT_MDC_MIBS, "MIB Support" },
5850 { PKT_MDC_MGPI, "Multiple Grants Per Interval Support" },
5851 { PKT_MDC_V152, "V.152 Support" },
5852 /* PacketCable 2.0: */
5853 { PKT_MDC_CBS, "Certificate Bootstrapping Support" },
5854 { PKT_MDC_CBS_LC, "Certificate Bootstrapping Support" },
5855 { 0, NULL }
5858 static const value_string pkt_mdc_version_vals[] = {
5859 { 0x3030, "PacketCable 1.0" },
5860 { 0x3031, "PacketCable 1.1/1.5" }, /* 1.5 replaces 1.1-1.3 */
5861 { 0x3032, "PacketCable 2.0" },
5862 { 0, NULL }
5865 static const value_string pkt_mdc_boolean_vals[] = {
5866 { 0x3030, "No" },
5867 { 0x3031, "Yes" },
5868 { 0, NULL }
5871 static const value_string pkt_mdc_codec_vals[] = {
5872 { 0x3031, "other" }, /* "01" */
5873 { 0x3032, "unknown" },
5874 { 0x3033, "G.729" },
5875 { 0x3034, "reserved" },
5876 { 0x3035, "G.729E" },
5877 { 0x3036, "PCMU" },
5878 { 0x3037, "G.726-32" },
5879 { 0x3038, "G.728" },
5880 { 0x3039, "PCMA" }, /* "09" */
5881 { 0x3041, "G.726-16" }, /* "0A" */
5882 { 0x3042, "G.726-24" },
5883 { 0x3043, "G.726-40" },
5884 { 0x3044, "iLBC" },
5885 { 0x3045, "BV16" },
5886 { 0x3046, "telephone-event" }, /* "0F" */
5887 { 0, NULL }
5890 static const value_string pkt_mdc_t38_version_vals[] = {
5891 { 0x3030, "Unsupported" },
5892 { 0x3031, "T.38 Version Zero" }, /* default */
5893 { 0x3032, "T.38 Version One" },
5894 { 0x3033, "T.38 Version Two" },
5895 { 0x3035, "T.38 Version Three" },
5896 { 0, NULL }
5899 static const value_string pkt_mdc_t38_ec_vals[] = {
5900 { 0x3030, "None" },
5901 { 0x3031, "Redundancy" }, /* default */
5902 { 0x3032, "FEC" },
5903 { 0, NULL }
5906 static const value_string pkt_mdc_mib_orgs[] = {
5907 { 0x3030, "CableLabs" },
5908 { 0x3031, "IETF" },
5909 { 0x3032, "EuroCableLabs" },
5910 { 0x3033, "Reserved" },
5911 { 0x3034, "Reserved" },
5912 { 0x3035, "Reserved" },
5913 { 0x3036, "Reserved" },
5914 { 0x3037, "Reserved" },
5915 { 0x3038, "Reserved" },
5916 { 0x3039, "Reserved" },
5917 { 0, NULL }
5920 static int hf_dhcp_pkt_mdc_supp_flow_secure;
5921 static int hf_dhcp_pkt_mdc_supp_flow_hybrid;
5922 static int hf_dhcp_pkt_mdc_supp_flow_basic;
5924 #define PKT_MDC_MIB_CL 0x3030
5925 static int hf_dhcp_pkt_mdc_mib_cl_mta;
5926 static int hf_dhcp_pkt_mdc_mib_cl_signaling;
5927 static int hf_dhcp_pkt_mdc_mib_cl_management_event;
5928 static int hf_dhcp_pkt_mdc_mib_cl_mta_extension;
5929 static int hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension;
5930 static int hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension;
5931 static int hf_dhcp_pkt_mdc_mib_cl_reserved;
5933 #define PKT_MDC_MIB_IETF 0x3031
5934 static int hf_dhcp_pkt_mdc_mib_ietf_mta;
5935 static int hf_dhcp_pkt_mdc_mib_ietf_signaling;
5936 static int hf_dhcp_pkt_mdc_mib_ietf_management_event;
5937 static int hf_dhcp_pkt_mdc_mib_ietf_reserved;
5939 #define PKT_MDC_MIB_EURO 0x3032
5940 static int hf_dhcp_pkt_mdc_mib_euro_mta;
5941 static int hf_dhcp_pkt_mdc_mib_euro_signaling;
5942 static int hf_dhcp_pkt_mdc_mib_euro_management_event;
5943 static int hf_dhcp_pkt_mdc_mib_euro_mta_extension;
5944 static int hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension;
5945 static int hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension;
5946 static int hf_dhcp_pkt_mdc_mib_euro_reserved;
5949 static void
5950 dissect_packetcable_mta_cap(proto_tree *v_tree, packet_info *pinfo, tvbuff_t *tvb, int voff, int len)
5952 uint16_t raw_val;
5953 uint32_t flow_val = 0;
5954 int off = PKT_MDC_TLV_OFF + voff;
5955 int subopt_off, max_len;
5956 unsigned tlv_len, i, mib_val;
5957 uint8_t flow_val_str[5];
5958 uint8_t *asc_val;
5959 proto_item *ti, *mib_ti;
5960 proto_tree *subtree, *subtree2;
5962 asc_val = tvb_get_string_enc(pinfo->pool, tvb, off, 2, ENC_ASCII);
5963 if (sscanf((char*)asc_val, "%x", &tlv_len) != 1 || tlv_len > 0xff) {
5964 proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
5965 "Bogus length: %s",
5966 format_text_string(pinfo->pool, asc_val));
5967 return;
5968 } else {
5969 proto_tree_add_uint(v_tree, hf_dhcp_pkt_mta_cap_len, tvb, off, 2, tlv_len);
5970 off += 2;
5972 while (off - voff < len) {
5973 /* Type */
5974 raw_val = tvb_get_ntohs (tvb, off);
5976 /* Length */
5977 asc_val = tvb_get_string_enc(pinfo->pool, tvb, off + 2, 2, ENC_ASCII);
5978 if (sscanf((char*)asc_val, "%x", &tlv_len) != 1
5979 || tlv_len < 1 || tlv_len > UINT16_MAX) {
5980 proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
5981 "Bogus length: %s",
5982 format_text_string(pinfo->pool, asc_val));
5983 return;
5984 } else {
5985 /* Value(s) */
5987 ti = proto_tree_add_uint_format(v_tree, hf_dhcp_pkt_mta_cap_type,
5988 tvb, off, 2, raw_val, "0x%s: %s = ",
5989 tvb_format_text(pinfo->pool, tvb, off, 2),
5990 val_to_str_const(raw_val, pkt_mdc_type_vals, "unknown"));
5991 proto_item_set_len(ti, (tlv_len * 2) + 4);
5992 switch (raw_val) {
5994 case PKT_MDC_VERSION:
5995 raw_val = tvb_get_ntohs(tvb, off + 4);
5996 proto_item_append_text(ti,
5997 "%s (%s)",
5998 val_to_str_const(raw_val, pkt_mdc_version_vals, "Reserved"),
5999 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6000 break;
6002 case PKT_MDC_TEL_END:
6003 case PKT_MDC_IF_INDEX:
6004 proto_item_append_text(ti,
6005 "%s",
6006 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6007 break;
6009 case PKT_MDC_TGT:
6010 case PKT_MDC_HTTP_ACC:
6011 case PKT_MDC_SYSLOG:
6012 case PKT_MDC_NCS:
6013 case PKT_MDC_PRI_LINE:
6014 case PKT_MDC_NVRAM_STOR:
6015 case PKT_MDC_PROV_REP:
6016 case PKT_MDC_PROV_REP_LC:
6017 case PKT_MDC_SILENCE:
6018 case PKT_MDC_SILENCE_LC:
6019 case PKT_MDC_ECHO_CANCEL:
6020 case PKT_MDC_ECHO_CANCEL_LC:
6021 case PKT_MDC_RSVP:
6022 case PKT_MDC_RSVP_LC:
6023 case PKT_MDC_UGS_AD:
6024 case PKT_MDC_UGS_AD_LC:
6025 case PKT_MDC_FLOW_LOG:
6026 case PKT_MDC_RFC2833_DTMF:
6027 case PKT_MDC_VOICE_METRICS:
6028 case PKT_MDC_MGPI:
6029 case PKT_MDC_V152:
6030 case PKT_MDC_CBS:
6031 case PKT_MDC_CBS_LC:
6032 raw_val = tvb_get_ntohs(tvb, off + 4);
6033 proto_item_append_text(ti,
6034 "%s (%s)",
6035 val_to_str_const(raw_val, pkt_mdc_boolean_vals, "unknown"),
6036 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6037 break;
6039 case PKT_MDC_SUPP_CODECS:
6040 case PKT_MDC_SUPP_CODECS_LC:
6041 for (i = 0; i < tlv_len; i++) {
6042 raw_val = tvb_get_ntohs(tvb, off + 4 + (i * 2) );
6043 proto_item_append_text(ti,
6044 "%s%s (%s)",
6045 plurality(i + 1, "", ", "),
6046 val_to_str_const(raw_val, pkt_mdc_codec_vals, "unknown"),
6047 tvb_format_stringzpad(pinfo->pool, tvb, off + 4 + (i * 2), 2) );
6049 break;
6051 case PKT_MDC_PROV_FLOWS:
6052 tvb_memcpy(tvb, flow_val_str, off + 4, 4);
6053 flow_val_str[4] = '\0';
6054 /* We are only reading 4 digits which should fit in 32 bits */
6055 flow_val = (uint32_t)strtoul((char*)flow_val_str, NULL, 16);
6056 proto_item_append_text(ti,
6057 "0x%04x", flow_val);
6058 break;
6060 case PKT_MDC_T38_VERSION:
6061 raw_val = tvb_get_ntohs(tvb, off + 4);
6062 proto_item_append_text(ti,
6063 "%s (%s)",
6064 val_to_str_const(raw_val, pkt_mdc_t38_version_vals, "unknown"),
6065 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6066 break;
6068 case PKT_MDC_T38_EC:
6069 raw_val = tvb_get_ntohs(tvb, off + 4);
6070 proto_item_append_text(ti,
6071 "%s (%s)",
6072 val_to_str_const(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
6073 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6074 break;
6076 case PKT_MDC_MIBS:
6077 break;
6079 case PKT_MDC_VENDOR_TLV:
6080 default:
6081 proto_item_append_text(ti,
6082 "%s",
6083 tvb_format_stringzpad(pinfo->pool, tvb, off + 4, tlv_len * 2) );
6084 break;
6087 subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6088 if (raw_val == PKT_MDC_PROV_FLOWS) {
6089 static int * const flows[] = {
6090 &hf_dhcp_pkt_mdc_supp_flow_secure,
6091 &hf_dhcp_pkt_mdc_supp_flow_hybrid,
6092 &hf_dhcp_pkt_mdc_supp_flow_basic,
6093 NULL
6096 proto_tree_add_bitmask_list_value(subtree, tvb, off + 4, 4, flows, flow_val);
6097 } else if (raw_val == PKT_MDC_MIBS) {
6098 /* 17 06 02 00 38 02 01 07 */
6099 subopt_off = off + 4;
6100 max_len = subopt_off + (tlv_len * 2);
6101 while (subopt_off < max_len) {
6102 raw_val = tvb_get_ntohs(tvb, subopt_off);
6103 if (raw_val != 0x3032) { /* We only know how to handle a length of 2 */
6104 asc_val = tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6105 proto_tree_add_expert_format(subtree, pinfo, &ei_dhcp_bad_length, tvb, subopt_off, 2,
6106 "Bogus length: %s",
6107 format_text_string(pinfo->pool, asc_val));
6108 return;
6111 subopt_off += 2;
6112 raw_val = tvb_get_ntohs(tvb, subopt_off);
6113 asc_val = tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6114 subtree2 = proto_tree_add_subtree_format(subtree, tvb, subopt_off, 2,
6115 ett_dhcp_option, &mib_ti, "%s (%s)",
6116 val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"),
6117 format_text_string(pinfo->pool, asc_val));
6118 if (subopt_off > off + 4 + 2) {
6119 proto_item_append_text(ti, ", ");
6121 proto_item_append_text(ti, "%s", val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"));
6123 subopt_off += 2;
6124 asc_val = tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6125 if (sscanf((char*)asc_val, "%x", &mib_val) != 1) {
6126 proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_bitfield, tvb, subopt_off, 2,
6127 "Bogus bitfield: %s", format_text_string(pinfo->pool, asc_val));
6128 return;
6130 switch (raw_val) {
6132 case PKT_MDC_MIB_CL: {
6133 static int * const cl_flags[] = {
6134 &hf_dhcp_pkt_mdc_mib_cl_mta,
6135 &hf_dhcp_pkt_mdc_mib_cl_signaling,
6136 &hf_dhcp_pkt_mdc_mib_cl_management_event,
6137 &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
6138 &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
6139 &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
6140 &hf_dhcp_pkt_mdc_mib_cl_reserved,
6141 NULL
6144 proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, cl_flags, mib_val);
6146 break;
6148 case PKT_MDC_MIB_IETF: {
6149 static int * const ietf_flags[] = {
6150 &hf_dhcp_pkt_mdc_mib_ietf_mta,
6151 &hf_dhcp_pkt_mdc_mib_ietf_signaling,
6152 &hf_dhcp_pkt_mdc_mib_ietf_management_event,
6153 &hf_dhcp_pkt_mdc_mib_ietf_reserved,
6154 NULL
6157 proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, ietf_flags, mib_val);
6159 break;
6161 case PKT_MDC_MIB_EURO: {
6162 static int * const euro_flags[] = {
6163 &hf_dhcp_pkt_mdc_mib_euro_mta,
6164 &hf_dhcp_pkt_mdc_mib_euro_signaling,
6165 &hf_dhcp_pkt_mdc_mib_euro_management_event,
6166 &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
6167 &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
6168 &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
6169 &hf_dhcp_pkt_mdc_mib_euro_reserved,
6170 NULL
6173 proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, euro_flags, mib_val);
6175 break;
6177 default:
6178 break;
6180 subopt_off += 2;
6184 off += (tlv_len * 2) + 4;
6189 static bool
6190 dissect_packetcable_mta_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6192 uint8_t* vendor_id;
6194 if (tvb_reported_length(tvb) < 8) {
6195 return false;
6198 vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 8, ENC_ASCII|ENC_NA);
6199 if ((strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP10) == 0) ||
6200 (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP15) == 0) ||
6201 (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP20) == 0)) {
6202 dissect_packetcable_mta_cap(tree, pinfo, tvb, 0, tvb_reported_length(tvb));
6203 return true;
6206 return false;
6209 /* DOCSIS Cable Modem device capabilities (option 60/option 125). */
6210 #define DOCSIS_CM_CAP_TLV_OFF 12
6212 #define DOCSIS_CM_CAP_CONCAT_SUP 0x01
6213 #define DOCSIS_CM_CAP_DOCSIS_VER 0x02
6214 #define DOCSIS_CM_CAP_FRAG_SUP 0x03
6215 #define DOCSIS_CM_CAP_PHS_SUP 0x04
6216 #define DOCSIS_CM_CAP_IGMP_SUP 0x05
6217 #define DOCSIS_CM_CAP_PRIV_SUP 0x06
6218 #define DOCSIS_CM_CAP_DSAID_SUP 0x07
6219 #define DOCSIS_CM_CAP_USSF_SUP 0x08
6220 #define DOCSIS_CM_CAP_FILT_SUP 0x09
6221 #define DOCSIS_CM_CAP_TET_MI 0x0a
6222 #define DOCSIS_CM_CAP_TET 0x0b
6223 #define DOCSIS_CM_CAP_DCC_SUP 0x0c
6224 #define DOCSIS_CM_CAP_IPFILT_SUP 0x0d
6225 #define DOCSIS_CM_CAP_LLCFILT_SUP 0x0e
6226 #define DOCSIS_CM_CAP_EXPUNI_SPACE 0x0f
6227 #define DOCSIS_CM_CAP_RNGHLDOFF_SUP 0x10
6228 #define DOCSIS_CM_CAP_L2VPN_SUP 0x11
6229 #define DOCSIS_CM_CAP_L2VPN_HOST_SUP 0x12
6230 #define DOCSIS_CM_CAP_DUTFILT_SUP 0x13
6231 #define DOCSIS_CM_CAP_USFREQRNG_SUP 0x14
6232 #define DOCSIS_CM_CAP_USSYMRATE_SUP 0x15
6233 #define DOCSIS_CM_CAP_SACM2_SUP 0x16
6234 #define DOCSIS_CM_CAP_SACM2HOP_SUP 0x17
6235 #define DOCSIS_CM_CAP_MULTTXCHAN_SUP 0x18
6236 #define DOCSIS_CM_CAP_512USTXCHAN_SUP 0x19
6237 #define DOCSIS_CM_CAP_256USTXCHAN_SUP 0x1a
6238 #define DOCSIS_CM_CAP_TOTALSIDCLU_SUP 0x1b
6239 #define DOCSIS_CM_CAP_SIDCLUPERSF_SUP 0x1c
6240 #define DOCSIS_CM_CAP_MULTRXCHAN_SUP 0x1d
6241 #define DOCSIS_CM_CAP_TOTALDSID_SUP 0x1e
6242 #define DOCSIS_CM_CAP_RESEQDSID_SUP 0x1f
6243 #define DOCSIS_CM_CAP_MULTDSID_SUP 0x20
6244 #define DOCSIS_CM_CAP_MULTDSIDFW_SUP 0x21
6245 #define DOCSIS_CM_CAP_FCTF_SUP 0x22
6246 #define DOCSIS_CM_CAP_DPV_SUP 0x23
6247 #define DOCSIS_CM_CAP_UGSPERUSFLOW_SUP 0x24
6248 #define DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP 0x25
6249 #define DOCSIS_CM_CAP_USDROPCLASSIF_SUP 0x26
6250 #define DOCSIS_CM_CAP_IPV6_SUP 0x27
6251 #define DOCSIS_CM_CAP_ExUsTrPow 0x28
6252 #define DOCSIS_CM_CAP_Opt802MPLSSup 0x29
6253 #define DOCSIS_CM_CAP_DounEnc 0x2a
6254 #define DOCSIS_CM_CAP_EnrgMang 0x2c
6256 static const value_string docsis_cm_cap_type_vals[] = {
6257 { DOCSIS_CM_CAP_CONCAT_SUP, "Concatenation Support" },
6258 { DOCSIS_CM_CAP_DOCSIS_VER, "DOCSIS Version" },
6259 { DOCSIS_CM_CAP_FRAG_SUP, "Fragmentation Support" },
6260 { DOCSIS_CM_CAP_PHS_SUP, "Payload Header Suppression Support" },
6261 { DOCSIS_CM_CAP_IGMP_SUP, "IGMP Support" },
6262 { DOCSIS_CM_CAP_PRIV_SUP, "Privacy Support" },
6263 { DOCSIS_CM_CAP_DSAID_SUP, "Downstream SAID Support" },
6264 { DOCSIS_CM_CAP_USSF_SUP, "Upstream Service Flow Support" },
6265 { DOCSIS_CM_CAP_FILT_SUP, "Optional Filtering Support" },
6266 { DOCSIS_CM_CAP_TET_MI, "Transmit Equalizer Taps per Modulation Interval" },
6267 { DOCSIS_CM_CAP_TET, "Number of Transmit Equalizer Taps" },
6268 { DOCSIS_CM_CAP_DCC_SUP, "DCC Support" },
6269 { DOCSIS_CM_CAP_IPFILT_SUP, "IP Filters Support" },
6270 { DOCSIS_CM_CAP_LLCFILT_SUP, "LLC Filters Support" },
6271 { DOCSIS_CM_CAP_EXPUNI_SPACE, "Expanded Unicast SID Space" },
6272 { DOCSIS_CM_CAP_RNGHLDOFF_SUP, "Ranging Hold-Off Support" },
6273 { DOCSIS_CM_CAP_L2VPN_SUP, "L2VPN Capability" },
6274 { DOCSIS_CM_CAP_L2VPN_HOST_SUP, "L2VPN eSAFE Host Capability" },
6275 { DOCSIS_CM_CAP_DUTFILT_SUP, "Downstream Unencrypted Traffic (DUT) Filtering" },
6276 { DOCSIS_CM_CAP_USFREQRNG_SUP, "Upstream Frequency Range Support" },
6277 { DOCSIS_CM_CAP_USSYMRATE_SUP, "Upstream Symbol Rate Support" },
6278 { DOCSIS_CM_CAP_SACM2_SUP, "Selectable Active Code Mode 2 Support" },
6279 { DOCSIS_CM_CAP_SACM2HOP_SUP, "Code Hopping Mode 2 Support" },
6280 { DOCSIS_CM_CAP_MULTTXCHAN_SUP, "Multiple Transmit Channel Support" },
6281 { DOCSIS_CM_CAP_512USTXCHAN_SUP, "5.12 Msps Upstream Transmit Channel Support" },
6282 { DOCSIS_CM_CAP_256USTXCHAN_SUP, "2.56 Msps Upstream Transmit Channel Support" },
6283 { DOCSIS_CM_CAP_TOTALSIDCLU_SUP, "Total SID Cluster Support" },
6284 { DOCSIS_CM_CAP_SIDCLUPERSF_SUP, "SID Clusters per Service Flow Support" },
6285 { DOCSIS_CM_CAP_MULTRXCHAN_SUP, "Multiple Receive Channel Support" },
6286 { DOCSIS_CM_CAP_TOTALDSID_SUP, "Total Downstream Service ID (DSID) Support" },
6287 { DOCSIS_CM_CAP_RESEQDSID_SUP, "Resequencing Downstream Service ID (DSID) Support" },
6288 { DOCSIS_CM_CAP_MULTDSID_SUP, "Multicast Downstream Service ID (DSID) Support" },
6289 { DOCSIS_CM_CAP_MULTDSIDFW_SUP, "Multicast DSID Forwarding" },
6290 { DOCSIS_CM_CAP_FCTF_SUP, "Frame Control Type Forwarding Capability" },
6291 { DOCSIS_CM_CAP_DPV_SUP, "DPV Capability" },
6292 { DOCSIS_CM_CAP_UGSPERUSFLOW_SUP, "Unsolicited Grant Service/Upstream Service Flow Support" },
6293 { DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP, "MAP and UCD Receipt Support" },
6294 { DOCSIS_CM_CAP_USDROPCLASSIF_SUP, "Upstream Drop Classifier Support" },
6295 { DOCSIS_CM_CAP_IPV6_SUP, "IPv6 Support" },
6296 { DOCSIS_CM_CAP_ExUsTrPow, "Extended Upstream Transmit Power Capability (1/4 dB)" },
6297 { DOCSIS_CM_CAP_Opt802MPLSSup, "Optional 802.1ad, 802.1ah, MPLS Classification Support" },
6298 { DOCSIS_CM_CAP_DounEnc, "D-ONU Capabilities Encoding" },
6299 { DOCSIS_CM_CAP_EnrgMang, "Energy Management Capabilities" },
6300 { 0, NULL }
6303 static const value_string docsis_cm_cap_supported_vals[] = {
6304 { 0x00, "Not Support" },
6305 { 0x01, "Supported" },
6306 { 0, NULL }
6309 static const value_string docsis_cm_cap_version_vals[] = {
6310 { 0x00, "DOCSIS 1.0" },
6311 { 0x01, "DOCSIS 1.1" },
6312 { 0x02, "DOCSIS 2.0" },
6313 { 0x03, "DOCSIS 3.0" },
6314 { 0, NULL }
6317 static const value_string docsis_cm_cap_privacy_vals[] = {
6318 { 0x00, "BPI Support" },
6319 { 0x01, "BPI Plus Support" },
6320 { 0, NULL }
6323 static int hf_dhcp_docsis_cm_cap_ranging_hold_off_cm;
6324 static int hf_dhcp_docsis_cm_cap_ranging_hold_off_eps;
6325 static int hf_dhcp_docsis_cm_cap_ranging_hold_off_emta;
6326 static int hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg;
6328 static const value_string docsis_cm_cap_l2vpn_vals[] = {
6329 { 0x00, "CM not compliant with DOCSIS L2VPN Section 7 (default)" },
6330 { 0x01, "CM compliant with DOCSIS L2VPN Section 7" },
6331 { 0, NULL }
6334 static const value_string docsis_cm_cap_filt_vals[] = {
6335 { 0x00, "802.1P Filtering" },
6336 { 0x01, "802.1Q Filtering" },
6337 { 0, NULL }
6340 static int hf_dhcp_docsis_cm_cap_mpls_stpid;
6341 static int hf_dhcp_docsis_cm_cap_mpls_svid;
6342 static int hf_dhcp_docsis_cm_cap_mpls_spcp;
6343 static int hf_dhcp_docsis_cm_cap_mpls_sdei;
6344 static int hf_dhcp_docsis_cm_cap_mpls_ctpid;
6345 static int hf_dhcp_docsis_cm_cap_mpls_cvid;
6346 static int hf_dhcp_docsis_cm_cap_mpls_cpcp;
6347 static int hf_dhcp_docsis_cm_cap_mpls_ccfi;
6348 static int hf_dhcp_docsis_cm_cap_mpls_stci;
6349 static int hf_dhcp_docsis_cm_cap_mpls_ctci;
6350 static int hf_dhcp_docsis_cm_cap_mpls_itpid;
6351 static int hf_dhcp_docsis_cm_cap_mpls_isid;
6352 static int hf_dhcp_docsis_cm_cap_mpls_itci;
6353 static int hf_dhcp_docsis_cm_cap_mpls_ipcp;
6354 static int hf_dhcp_docsis_cm_cap_mpls_idei;
6355 static int hf_dhcp_docsis_cm_cap_mpls_iuca;
6356 static int hf_dhcp_docsis_cm_cap_mpls_btpid;
6357 static int hf_dhcp_docsis_cm_cap_mpls_btci;
6358 static int hf_dhcp_docsis_cm_cap_mpls_bpcp;
6359 static int hf_dhcp_docsis_cm_cap_mpls_bdei;
6360 static int hf_dhcp_docsis_cm_cap_mpls_bvid;
6361 static int hf_dhcp_docsis_cm_cap_mpls_bda;
6362 static int hf_dhcp_docsis_cm_cap_mpls_bsa;
6363 static int hf_dhcp_docsis_cm_cap_mpls_tc;
6364 static int hf_dhcp_docsis_cm_cap_mpls_label;
6366 static const value_string docsis_cm_cap_enrgmang_vals[] = {
6367 { 0x00, "Energy Management 1x1 Feature" },
6368 { 0, NULL }
6371 static const value_string docsis_cm_cap_usfreqrng_vals[] = {
6372 { 0x00, "Standard Upstream Frequency Range" },
6373 { 0x01, "Standard Upstream Frequency Range and Extended Upstream Frequency Range" },
6374 { 0, NULL }
6377 static const value_string docsis_cm_cap_map_ucd_receipt_vals[] = {
6378 { 0x00, "CM cannot support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6379 { 0x01, "CM can support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6380 { 0, NULL }
6383 static const value_string docsis_cm_cap_map_dpv_support_vals[] = {
6384 { 0x00, "U1 supported as a Start Reference Point for DPV per Path" },
6385 { 0x01, "U1 supported as a Start Reference Point for DPV per Packet" },
6386 { 0, NULL }
6389 static const value_string docsis_cm_cap_map_multDsidForward_support_vals[] = {
6390 { 0x00, "No support for multicast DSID forwarding" },
6391 { 0x01, "Support for GMAC explicit multicast DSID forwarding" },
6392 { 0x02, "Support for GMAC promiscuous multicast DSID forwarding" },
6393 { 0, NULL }
6396 static const value_string docsis_cm_cap_map_fctfc_support_vals[] = {
6397 { 0x00, "Isolation Packet PDU MAC Header (FC_Type of 10) is not forwarded" },
6398 { 0x01, "Isolation Packet PDU MAC Header (FC_Type of 10) is forwarded" },
6399 { 0, NULL }
6402 static const value_string docsis_cm_cap_map_l2vpn_esafe_index_support_vals[] = {
6403 { 0x01, "ePs or eRouter" },
6404 { 0x10, "eMTA" },
6405 { 0x11, "eSTB-IP" },
6406 { 0x12, "eSTB-DSG" },
6407 { 0x13, "eTEA" },
6408 { 0, NULL }
6411 static int hf_dhcp_docsis_cm_cap_ussymrate_160;
6412 static int hf_dhcp_docsis_cm_cap_ussymrate_320;
6413 static int hf_dhcp_docsis_cm_cap_ussymrate_640;
6414 static int hf_dhcp_docsis_cm_cap_ussymrate_1280;
6415 static int hf_dhcp_docsis_cm_cap_ussymrate_2560;
6416 static int hf_dhcp_docsis_cm_cap_ussymrate_5120;
6418 static void
6419 display_uint_with_range_checking(proto_item *ti, uint8_t val_byte, uint16_t val_uint16, int min_value, int max_value)
6421 uint16_t value;
6423 if (0 != val_byte)
6425 value = val_byte;
6427 else
6429 value = val_uint16;
6431 proto_item_append_text(ti, "%i", value);
6432 if ((value < min_value) ||
6433 (value > max_value))
6435 proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
6439 static void get_opt125_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6441 /* Type */
6442 *tlvtype = tvb_get_uint8(tvb, off);
6443 /* Length */
6444 *tlvlen = tvb_get_uint8(tvb, off+1);
6445 /* Value */
6446 *value = (uint8_t *)tvb_memdup(scope, tvb, off + 2, *tlvlen);
6449 static void get_opt60_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6451 unsigned i;
6452 uint8_t *val_asc;
6454 val_asc = (uint8_t *)wmem_alloc0(scope, 4);
6455 /* Type */
6456 tvb_memcpy(tvb, val_asc, off, 2);
6457 *tlvtype = (uint8_t)strtoul((char*)val_asc, NULL, 16);
6458 /* Length */
6459 tvb_memcpy(tvb, val_asc, off + 2, 2);
6460 *tlvlen = (uint8_t)strtoul((char*)val_asc, NULL, 16);
6461 /* Value */
6462 *value = (uint8_t *)wmem_alloc0(scope, *tlvlen);
6463 for (i=0; i<*tlvlen; i++)
6465 memset(val_asc, 0, 4);
6466 tvb_memcpy(tvb, val_asc, off + ((i*2) + 4), 2);
6467 (*value)[i] = (uint8_t)strtoul((char*)val_asc, NULL, 16);
6471 static void
6472 dissect_docsis_cm_cap(packet_info *pinfo, proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, bool opt125)
6474 uint8_t *asc_val;
6475 proto_item *ti;
6476 proto_tree *subtree;
6477 uint8_t tlv_type;
6478 uint8_t tlv_len;
6479 uint8_t val_byte = 0;
6480 uint16_t val_uint16 = 0;
6481 uint8_t *val_other = NULL;
6482 unsigned off = voff;
6484 asc_val = (uint8_t*)wmem_alloc0(pinfo->pool, 4);
6486 if (opt125)
6488 /* Option 125 is formatted as uint8's */
6489 /* Type */
6490 tlv_type = tvb_get_uint8(tvb, off);
6491 /* Length */
6492 tlv_len = tvb_get_uint8(tvb, off+1);
6493 proto_tree_add_uint(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+1, 1, tlv_len);
6495 else
6497 /* Option 60 is formatted as an ASCII string.
6498 Since the capabilities are the same for both options
6499 I am converting the Option 60 values from ASCII to
6500 uint8s to allow the same parser to work for both */
6501 off += DOCSIS_CM_CAP_TLV_OFF;
6502 tvb_memcpy (tvb, asc_val, off, 2);
6503 tlv_len = (uint8_t)strtoul((char*)asc_val, NULL, 16);
6504 proto_tree_add_uint_format_value(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+2, 2,
6505 tlv_len, "%d", tlv_len);
6508 off+=2;
6510 while (off - ((unsigned) voff) < ((unsigned) len))
6512 tlv_type = 0;
6513 tlv_len = 0;
6514 val_byte = 0;
6515 val_uint16 = 0;
6517 if (opt125)
6519 get_opt125_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6520 ti = proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6521 tlv_len + 2,
6522 tlv_type,
6523 "0x%02x: %s = ",
6524 tlv_type,
6525 val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6527 else
6529 /* Option 60 is formatted as an ASCII string. Since the capabilities
6530 are the same for both options I am converting the Option 60 values
6531 from ASCII to uint8s to allow the same parser to work for both */
6532 get_opt60_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6533 ti = proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6534 (tlv_len * 2) + 4,
6535 tlv_type,
6536 "0x%02x: %s = ",
6537 tlv_type,
6538 val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6541 if (tlv_len == 1)
6543 /* The value refers to a byte. */
6544 val_byte = val_other[0];
6546 else
6548 if (tlv_len == 2)
6550 /* The value refers to a uint16. */
6551 val_uint16 = (val_other[0] << 8) + val_other[1];
6555 switch (tlv_type)
6557 case DOCSIS_CM_CAP_CONCAT_SUP:
6558 case DOCSIS_CM_CAP_FRAG_SUP:
6559 case DOCSIS_CM_CAP_PHS_SUP:
6560 case DOCSIS_CM_CAP_IGMP_SUP:
6561 case DOCSIS_CM_CAP_DCC_SUP:
6562 case DOCSIS_CM_CAP_EXPUNI_SPACE:
6563 case DOCSIS_CM_CAP_DUTFILT_SUP:
6564 case DOCSIS_CM_CAP_SACM2_SUP:
6565 case DOCSIS_CM_CAP_SACM2HOP_SUP:
6566 case DOCSIS_CM_CAP_IPV6_SUP:
6567 proto_item_append_text(ti,
6568 "%s",
6569 val_to_str_const(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
6570 break;
6571 case DOCSIS_CM_CAP_DOCSIS_VER:
6572 proto_item_append_text(ti,
6573 "%s",
6574 val_to_str_const(val_byte, docsis_cm_cap_version_vals, "Reserved"));
6575 break;
6576 case DOCSIS_CM_CAP_PRIV_SUP:
6577 proto_item_append_text(ti,
6578 "%s",
6579 val_to_str_const(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
6580 break;
6581 case DOCSIS_CM_CAP_FILT_SUP:
6582 proto_item_append_text(ti,
6583 "%s",
6584 val_to_str_const(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
6585 break;
6586 case DOCSIS_CM_CAP_L2VPN_SUP:
6587 proto_item_append_text(ti,
6588 "%s",
6589 val_to_str_const(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
6590 break;
6591 case DOCSIS_CM_CAP_L2VPN_HOST_SUP:
6592 if (tlv_len == 7) {
6593 proto_item_append_text(ti,
6594 "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
6595 val_to_str_const(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
6596 val_other[0],
6597 val_other[1],
6598 val_other[2],
6599 val_other[3],
6600 val_other[4],
6601 val_other[5],
6602 val_other[6]);
6603 } else {
6604 proto_item_append_text(ti,
6605 "Invalid (length should be 7, is %d)",
6606 tlv_len);
6608 break;
6609 case DOCSIS_CM_CAP_USFREQRNG_SUP:
6610 proto_item_append_text(ti,
6611 "%s",
6612 val_to_str_const(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
6613 break;
6614 case DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP:
6615 proto_item_append_text(ti,
6616 "%s",
6617 val_to_str_const(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
6618 break;
6619 case DOCSIS_CM_CAP_DPV_SUP:
6620 proto_item_append_text(ti,
6621 "%s",
6622 val_to_str_const(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
6623 break;
6624 case DOCSIS_CM_CAP_DSAID_SUP:
6625 case DOCSIS_CM_CAP_MULTTXCHAN_SUP:
6626 case DOCSIS_CM_CAP_512USTXCHAN_SUP:
6627 case DOCSIS_CM_CAP_256USTXCHAN_SUP:
6628 case DOCSIS_CM_CAP_TOTALSIDCLU_SUP:
6629 case DOCSIS_CM_CAP_MULTRXCHAN_SUP:
6630 case DOCSIS_CM_CAP_UGSPERUSFLOW_SUP:
6631 case DOCSIS_CM_CAP_USSF_SUP:
6632 display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
6633 break;
6634 case DOCSIS_CM_CAP_RESEQDSID_SUP:
6635 case DOCSIS_CM_CAP_MULTDSID_SUP:
6636 display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
6637 break;
6638 case DOCSIS_CM_CAP_SIDCLUPERSF_SUP:
6639 display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
6640 break;
6641 case DOCSIS_CM_CAP_TOTALDSID_SUP:
6642 display_uint_with_range_checking(ti, val_byte, val_uint16, 32, 255);
6643 break;
6644 case DOCSIS_CM_CAP_TET:
6645 display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
6646 break;
6647 case DOCSIS_CM_CAP_TET_MI:
6648 if ((val_byte == 1) ||
6649 (val_byte == 2) ||
6650 (val_byte == 4))
6652 proto_item_append_text(ti,
6653 " %i",
6654 val_byte);
6656 else
6658 proto_item_append_text(ti,
6659 " (Invalid Value %i : Should be [1,2,4]",
6660 val_byte);
6662 break;
6663 case DOCSIS_CM_CAP_IPFILT_SUP:
6664 case DOCSIS_CM_CAP_USDROPCLASSIF_SUP:
6665 display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
6666 break;
6667 case DOCSIS_CM_CAP_LLCFILT_SUP:
6668 display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
6669 break;
6670 case DOCSIS_CM_CAP_ExUsTrPow:
6671 if (val_byte == 0)
6673 proto_item_append_text(ti, "%i", val_byte);
6675 else
6677 display_uint_with_range_checking(ti, val_byte, val_uint16, 205, 244);
6679 break;
6680 case DOCSIS_CM_CAP_Opt802MPLSSup:
6681 proto_item_append_text(ti,
6682 "0x%02x", val_byte);
6683 case DOCSIS_CM_CAP_DounEnc:
6684 /* TODO: add D-ONU Capabilities Encoding according DPoE-SP-MULPIv1.0-I02-120607 */
6685 break;
6686 case DOCSIS_CM_CAP_EnrgMang:
6687 proto_item_append_text(ti,
6688 "%s",
6689 val_to_str_const(val_byte, docsis_cm_cap_enrgmang_vals, "Reserved"));
6690 break;
6691 case DOCSIS_CM_CAP_RNGHLDOFF_SUP:
6692 proto_item_append_text(ti,
6693 "Ranging ID ");
6694 if (tlv_len == 4)
6696 proto_item_append_text(ti,
6697 "(0x%04x)", (val_other[0] << sizeof(uint8_t)) + val_other[1]);
6698 proto_item_append_text(ti,
6699 " Component Bit Mask ");
6700 proto_item_append_text(ti,
6701 "(0x%04x)", (val_other[2] << sizeof(uint8_t)) + val_other[3]);
6703 else
6705 proto_item_append_text(ti,
6706 " (Invalid Length %u : Should be 4",
6707 tlv_len);
6709 break;
6710 case DOCSIS_CM_CAP_USSYMRATE_SUP:
6711 proto_item_append_text(ti,
6712 "0x%02x", val_byte);
6713 break;
6714 case DOCSIS_CM_CAP_FCTF_SUP:
6715 proto_item_append_text(ti,
6716 "%s",
6717 val_to_str_const(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
6718 break;
6719 case DOCSIS_CM_CAP_MULTDSIDFW_SUP:
6720 proto_item_append_text(ti,
6721 "%s",
6722 val_to_str_const(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
6723 break;
6726 subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6727 if (tlv_type == DOCSIS_CM_CAP_RNGHLDOFF_SUP && tlv_len >= 4)
6729 static int * const flags[] = {
6730 &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
6731 &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
6732 &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
6733 &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
6734 NULL
6736 val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6738 proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6740 if (tlv_type == DOCSIS_CM_CAP_USSYMRATE_SUP)
6742 static int * const flags[] = {
6743 &hf_dhcp_docsis_cm_cap_ussymrate_160,
6744 &hf_dhcp_docsis_cm_cap_ussymrate_320,
6745 &hf_dhcp_docsis_cm_cap_ussymrate_640,
6746 &hf_dhcp_docsis_cm_cap_ussymrate_1280,
6747 &hf_dhcp_docsis_cm_cap_ussymrate_2560,
6748 &hf_dhcp_docsis_cm_cap_ussymrate_5120,
6749 NULL
6752 proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 1, flags, val_byte);
6754 if (tlv_type == DOCSIS_CM_CAP_Opt802MPLSSup && tlv_len >= 4)
6756 static int * const flags[] = {
6757 &hf_dhcp_docsis_cm_cap_mpls_stpid,
6758 &hf_dhcp_docsis_cm_cap_mpls_svid,
6759 &hf_dhcp_docsis_cm_cap_mpls_spcp,
6760 &hf_dhcp_docsis_cm_cap_mpls_sdei,
6761 &hf_dhcp_docsis_cm_cap_mpls_ctpid,
6762 &hf_dhcp_docsis_cm_cap_mpls_cvid,
6763 &hf_dhcp_docsis_cm_cap_mpls_cpcp,
6764 &hf_dhcp_docsis_cm_cap_mpls_ccfi,
6765 &hf_dhcp_docsis_cm_cap_mpls_stci,
6766 &hf_dhcp_docsis_cm_cap_mpls_ctci,
6767 &hf_dhcp_docsis_cm_cap_mpls_itpid,
6768 &hf_dhcp_docsis_cm_cap_mpls_isid,
6769 &hf_dhcp_docsis_cm_cap_mpls_itci,
6770 &hf_dhcp_docsis_cm_cap_mpls_ipcp,
6771 &hf_dhcp_docsis_cm_cap_mpls_idei,
6772 &hf_dhcp_docsis_cm_cap_mpls_iuca,
6773 &hf_dhcp_docsis_cm_cap_mpls_btpid,
6774 &hf_dhcp_docsis_cm_cap_mpls_btci,
6775 &hf_dhcp_docsis_cm_cap_mpls_bpcp,
6776 &hf_dhcp_docsis_cm_cap_mpls_bdei,
6777 &hf_dhcp_docsis_cm_cap_mpls_bvid,
6778 &hf_dhcp_docsis_cm_cap_mpls_bda,
6779 &hf_dhcp_docsis_cm_cap_mpls_bsa,
6780 &hf_dhcp_docsis_cm_cap_mpls_tc,
6781 &hf_dhcp_docsis_cm_cap_mpls_label,
6782 NULL
6784 val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6786 proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6788 if (opt125)
6790 off += (tlv_len) + 2;
6792 else
6794 off += (tlv_len *2) + 4;
6800 static bool
6801 dissect_packetcable_cm_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6803 uint8_t* vendor_id;
6805 if (tvb_reported_length(tvb) < 10) {
6806 return false;
6809 vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 10, ENC_ASCII|ENC_NA);
6810 if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP11) == 0) ||
6811 (strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP20) == 0)) {
6812 dissect_docsis_cm_cap(pinfo, tree, tvb, 0, tvb_reported_length(tvb), false);
6813 return true;
6816 if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP30) == 0)) {
6817 proto_tree_add_item(tree, hf_dhcp_option_vendor_class_data, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
6818 return true;
6821 return false;
6824 static bool
6825 dissect_apple_bsdp_vendor_id_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6828 int vendor_id_len = (int)strlen(APPLE_BSDP_CLIENT);
6829 if ((int)tvb_reported_length(tvb) < vendor_id_len) {
6830 return false;
6833 if (tvb_memeql(tvb, 0, (const uint8_t*)APPLE_BSDP_CLIENT, vendor_id_len) == 0) {
6834 proto_tree_add_item(tree, hf_dhcp_option_vendor_class_data, tvb, vendor_id_len, tvb_reported_length_remaining(tvb, vendor_id_len), ENC_ASCII);
6835 return true;
6838 return false;
6842 /* Definitions specific to PKT-SP-PROV-I05-021127 begin with "PKT_CCC_I05".
6843 Definitions specific to IETF draft 5 and RFC 3495 begin with "PKT_CCC_IETF".
6844 Shared definitions begin with "PKT_CCC".
6846 #define PKT_CCC_PRI_DHCP 1
6847 #define PKT_CCC_SEC_DHCP 2
6848 #define PKT_CCC_I05_SNMP 3
6849 #define PKT_CCC_IETF_PROV_SRV 3
6850 #define PKT_CCC_I05_PRI_DNS 4
6851 #define PKT_CCC_IETF_AS_KRB 4
6852 #define PKT_CCC_I05_SEC_DNS 5
6853 #define PKT_CCC_IETF_AP_KRB 5
6854 #define PKT_CCC_KRB_REALM 6
6855 #define PKT_CCC_TGT_FLAG 7
6856 #define PKT_CCC_PROV_TIMER 8
6857 #define PKT_CCC_CMS_FQDN 9
6858 #define PKT_CCC_IETF_SEC_TKT 9
6859 #define PKT_CCC_AS_KRB 10
6860 #define PKT_CCC_AP_KRB 11
6861 #define PKT_CCC_MTA_KRB_CLEAR 12
6863 static const value_string pkt_i05_ccc_opt_vals[] = {
6864 { PKT_CCC_PRI_DHCP, "Primary DHCP Server" },
6865 { PKT_CCC_SEC_DHCP, "Secondary DHCP Server" },
6866 { PKT_CCC_I05_SNMP, "SNMP Entity" },
6867 { PKT_CCC_I05_PRI_DNS, "Primary DNS Server" },
6868 { PKT_CCC_I05_SEC_DNS, "Secondary DNS Server" },
6869 { PKT_CCC_KRB_REALM, "Kerberos Realm" },
6870 { PKT_CCC_TGT_FLAG, "MTA should fetch TGT?" },
6871 { PKT_CCC_PROV_TIMER, "Provisioning Timer" },
6872 { PKT_CCC_CMS_FQDN, "CMS FQDN" },
6873 { PKT_CCC_AS_KRB, "AS-REQ/AS-REP Backoff and Retry" },
6874 { PKT_CCC_AP_KRB, "AP-REQ/AP-REP Backoff and Retry" },
6875 { PKT_CCC_MTA_KRB_CLEAR, "MTA should clear Kerberos tickets?" },
6876 { 0, NULL },
6879 static const value_string pkt_draft5_ccc_opt_vals[] = {
6880 { PKT_CCC_PRI_DHCP, "TSP's Primary DHCP Server" },
6881 { PKT_CCC_SEC_DHCP, "TSP's Secondary DHCP Server" },
6882 { PKT_CCC_IETF_PROV_SRV, "TSP's Provisioning Server" },
6883 { PKT_CCC_IETF_AS_KRB, "TSP's AS-REQ/AS-REP Backoff and Retry" },
6884 { PKT_CCC_IETF_AP_KRB, "TSP's AP-REQ/AP-REP Backoff and Retry" },
6885 { PKT_CCC_KRB_REALM, "TSP's Kerberos Realm Name" },
6886 { PKT_CCC_TGT_FLAG, "TSP's Ticket Granting Server Utilization" },
6887 { PKT_CCC_PROV_TIMER, "TSP's Provisioning Timer Value" },
6888 { PKT_CCC_IETF_SEC_TKT, "PacketCable Security Ticket Control" },
6889 { 0, NULL },
6892 static const value_string pkt_i05_ccc_ticket_ctl_vals[] = {
6893 { 1, "Invalidate Provisioning Application Server's ticket" },
6894 { 2, "Invalidate all CMS Application Server tickets" },
6895 { 3, "Invalidate all Application Server tickets" },
6896 { 0, NULL },
6899 static int
6900 dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
6901 tvbuff_t *tvb, int optoff, int optend)
6903 int suboptoff = optoff;
6904 uint8_t subopt, subopt_len, fetch_tgt, timer_val, ticket_ctl;
6905 proto_tree *pkt_s_tree;
6906 proto_item *vti;
6908 subopt = tvb_get_uint8(tvb, optoff);
6909 suboptoff++;
6911 if (suboptoff >= optend) {
6912 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
6913 "Suboption %d: no room left in option for suboption length", subopt);
6914 return (optend);
6917 subopt_len = tvb_get_uint8(tvb, optoff);
6918 suboptoff++;
6920 vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_i05_ccc_suboption, tvb, optoff, 1, subopt);
6921 proto_item_set_len(vti, subopt_len + 2);
6922 proto_item_append_text(vti, ": ");
6924 switch (subopt) {
6926 case PKT_CCC_PRI_DHCP: /* String values */
6927 case PKT_CCC_SEC_DHCP:
6928 case PKT_CCC_I05_SNMP:
6929 case PKT_CCC_I05_PRI_DNS:
6930 case PKT_CCC_I05_SEC_DNS:
6931 case PKT_CCC_KRB_REALM:
6932 case PKT_CCC_CMS_FQDN:
6933 proto_item_append_text(vti, "%s (%u byte%s)",
6934 tvb_format_stringzpad(pinfo->pool, tvb, suboptoff, subopt_len),
6935 subopt_len,
6936 plurality(subopt_len, "", "s") );
6937 suboptoff += subopt_len;
6938 break;
6940 case PKT_CCC_TGT_FLAG:
6941 if (suboptoff+1 > optend) {
6942 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6943 return (optend);
6945 fetch_tgt = tvb_get_uint8(tvb, suboptoff);
6946 proto_item_append_text(vti, "%s (%u byte%s%s)",
6947 fetch_tgt ? "Yes" : "No",
6948 subopt_len,
6949 plurality(subopt_len, "", "s"),
6950 subopt_len != 1 ? " [Invalid]" : "");
6951 suboptoff += subopt_len;
6952 break;
6954 case PKT_CCC_PROV_TIMER:
6955 if (suboptoff+1 > optend) {
6956 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6957 return (optend);
6959 timer_val = tvb_get_uint8(tvb, suboptoff);
6960 proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
6961 timer_val > 30 ? " [Invalid]" : "",
6962 subopt_len,
6963 plurality(subopt_len, "", "s"),
6964 subopt_len != 1 ? " [Invalid]" : "");
6965 suboptoff += subopt_len;
6966 break;
6968 case PKT_CCC_AS_KRB:
6969 if (suboptoff+12 > optend) {
6970 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6971 return (optend);
6973 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
6974 plurality(subopt_len, "", "s"),
6975 subopt_len != 12 ? " [Invalid]" : "");
6976 if (subopt_len == 12) {
6977 pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
6978 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
6979 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout, tvb, suboptoff + 4, 4, ENC_BIG_ENDIAN);
6980 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
6982 suboptoff += subopt_len;
6983 break;
6985 case PKT_CCC_AP_KRB:
6986 if (suboptoff+12 > optend) {
6987 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6988 return (optend);
6990 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
6991 plurality(subopt_len, "", "s"),
6992 subopt_len != 12 ? " [Invalid]" : "");
6993 if (subopt_len == 12) {
6994 pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
6995 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
6996 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
6997 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
6999 suboptoff += subopt_len;
7000 break;
7002 case PKT_CCC_MTA_KRB_CLEAR:
7003 if (suboptoff+1 > optend) {
7004 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7005 return (optend);
7007 ticket_ctl = tvb_get_uint8(tvb, suboptoff);
7008 proto_item_append_text(vti, "%s (%u) (%u byte%s%s)",
7009 val_to_str_const (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
7010 ticket_ctl,
7011 subopt_len,
7012 plurality(subopt_len, "", "s"),
7013 subopt_len != 1 ? " [Invalid]" : "");
7014 suboptoff += subopt_len;
7015 break;
7017 default:
7018 suboptoff += subopt_len;
7019 break;
7022 return suboptoff;
7025 static int hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server;
7026 static int hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management;
7028 static int
7029 dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
7030 tvbuff_t *tvb, int optoff, int optend, int revision)
7032 int suboptoff = optoff;
7033 uint8_t subopt, subopt_len;
7034 uint8_t prov_type, fetch_tgt, timer_val;
7035 uint16_t sec_tcm;
7036 proto_tree *pkt_s_tree;
7037 proto_item *vti;
7038 int max_timer_val = 255;
7039 const unsigned char *dns_name;
7040 int dns_name_len;
7042 subopt = tvb_get_uint8(tvb, suboptoff);
7043 suboptoff++;
7045 if (suboptoff >= optend) {
7046 expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
7047 "Suboption %d: no room left in option for suboption length", subopt);
7048 return (optend);
7050 subopt_len = tvb_get_uint8(tvb, suboptoff);
7051 suboptoff++;
7053 vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_ietf_ccc_suboption, tvb, optoff, 1, subopt);
7054 proto_item_set_len(vti, subopt_len + 2);
7055 proto_item_append_text(vti, ": ");
7057 switch (subopt) {
7059 case PKT_CCC_PRI_DHCP: /* IPv4 values */
7060 case PKT_CCC_SEC_DHCP:
7061 if (suboptoff+4 > optend) {
7062 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7063 return (optend);
7065 proto_item_append_text(vti, "%s (%u byte%s%s)",
7066 tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7067 subopt_len,
7068 plurality(subopt_len, "", "s"),
7069 subopt_len != 4 ? " [Invalid]" : "");
7070 suboptoff += subopt_len;
7071 break;
7073 case PKT_CCC_IETF_PROV_SRV:
7074 if (suboptoff+1 > optend) {
7075 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7076 return (optend);
7078 prov_type = tvb_get_uint8(tvb, suboptoff);
7079 suboptoff += 1;
7080 switch (prov_type) {
7082 case 0:
7083 get_dns_name(tvb, suboptoff, subopt_len, suboptoff, (const char **)&dns_name, &dns_name_len);
7084 proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7085 subopt_len - 1, plurality(subopt_len, "", "s") );
7086 break;
7088 case 1:
7089 if (suboptoff+4 > optend) {
7090 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7091 return (optend);
7093 proto_item_append_text(vti, "%s (%u byte%s%s)",
7094 tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7095 subopt_len,
7096 plurality(subopt_len, "", "s"),
7097 subopt_len != 5 ? " [Invalid]" : "");
7098 break;
7100 default:
7101 proto_item_append_text(vti, "Invalid type: %u (%u byte%s)",
7102 prov_type,
7103 subopt_len,
7104 plurality(subopt_len, "", "s") );
7105 break;
7107 suboptoff += subopt_len - 1;
7108 break;
7110 case PKT_CCC_IETF_AS_KRB:
7111 if (suboptoff+12 > optend) {
7112 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7113 return (optend);
7115 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7116 plurality(subopt_len, "", "s"),
7117 subopt_len != 12 ? " [Invalid]" : "");
7118 if (subopt_len == 12) {
7119 pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7120 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7121 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout, tvb, suboptoff + 4, 4, ENC_BIG_ENDIAN);
7122 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
7124 suboptoff += subopt_len;
7125 break;
7127 case PKT_CCC_IETF_AP_KRB:
7128 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7129 plurality(subopt_len, "", "s"),
7130 subopt_len != 12 ? " [Invalid]" : "");
7131 if (subopt_len == 12) {
7132 pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7133 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7134 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout, tvb, suboptoff + 4, 4, ENC_BIG_ENDIAN);
7135 proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries, tvb, suboptoff + 8, 4, ENC_BIG_ENDIAN);
7137 suboptoff += subopt_len;
7138 break;
7140 case PKT_CCC_KRB_REALM: /* String values */
7141 get_dns_name(tvb, suboptoff, subopt_len, suboptoff, (const char **)&dns_name, &dns_name_len);
7142 proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7143 subopt_len, plurality(subopt_len, "", "s") );
7144 suboptoff += subopt_len;
7145 break;
7147 case PKT_CCC_TGT_FLAG:
7148 if (suboptoff+1 > optend) {
7149 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7150 return (optend);
7152 fetch_tgt = tvb_get_uint8(tvb, suboptoff);
7153 proto_item_append_text(vti, "%s (%u byte%s%s)",
7154 fetch_tgt ? "Yes" : "No",
7155 subopt_len,
7156 plurality(subopt_len, "", "s"),
7157 subopt_len != 1 ? " [Invalid]" : "");
7158 suboptoff += 1;
7159 break;
7161 case PKT_CCC_PROV_TIMER:
7162 if (suboptoff+1 > optend) {
7163 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7164 return (optend);
7166 if (revision == PACKETCABLE_CCC_DRAFT5)
7167 max_timer_val = 30;
7168 timer_val = tvb_get_uint8(tvb, suboptoff);
7169 proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
7170 timer_val > max_timer_val ? " [Invalid]" : "",
7171 subopt_len,
7172 plurality(subopt_len, "", "s"),
7173 subopt_len != 1 ? " [Invalid]" : "");
7174 suboptoff += 1;
7175 break;
7177 case PKT_CCC_IETF_SEC_TKT:
7178 if (suboptoff+2 > optend) {
7179 expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7180 return (optend);
7182 sec_tcm = tvb_get_ntohs(tvb, suboptoff);
7183 proto_item_append_text(vti, "0x%04x (%u byte%s%s)", sec_tcm, subopt_len,
7184 plurality(subopt_len, "", "s"),
7185 subopt_len != 2 ? " [Invalid]" : "");
7186 if (subopt_len == 2) {
7187 pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7188 proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server, tvb, suboptoff, 2, sec_tcm);
7189 proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management, tvb, suboptoff, 2, sec_tcm);
7191 suboptoff += subopt_len;
7192 break;
7194 default:
7195 suboptoff += subopt_len;
7196 break;
7198 return suboptoff;
7201 static int
7202 dissect_dhcpopt_packetcable_ccc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7204 int offset = 0;
7206 while (tvb_reported_length_remaining(tvb, offset) > 0) {
7207 switch (pkt_ccc_protocol_version) {
7209 case PACKETCABLE_CCC_I05:
7210 offset = dissect_packetcable_i05_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
7211 break;
7212 case PACKETCABLE_CCC_DRAFT5:
7213 case PACKETCABLE_CCC_RFC_3495:
7214 offset = dissect_packetcable_ietf_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb), pkt_ccc_protocol_version);
7215 break;
7216 default: /* XXX Should we do something here? */
7217 break;
7221 return tvb_captured_length(tvb);
7224 #define BOOTREQUEST 1
7225 #define BOOTREPLY 2
7227 static const value_string op_vals[] = {
7228 { BOOTREQUEST, "Boot Request" },
7229 { BOOTREPLY, "Boot Reply" },
7230 { 0, NULL }
7233 static int
7234 dissect_dhcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7236 proto_tree *bp_tree;
7237 proto_item *bp_ti, *ti;
7238 proto_item *fi, *hidden_item;
7239 uint8_t op;
7240 uint8_t htype, hlen;
7241 int voff, eoff, tmpvoff; /* vendor offset, end offset */
7242 uint32_t ip_addr;
7243 bool at_end;
7244 bool isProxyDhcp;
7245 const char *dhcp_type = NULL;
7246 const uint8_t *vendor_class_id = NULL;
7247 uint16_t flags, secs;
7248 int offset_delta;
7249 uint8_t overload = 0; /* DHCP option overload */
7250 static int * const dhcp_flags[] = {
7251 &hf_dhcp_flags_broadcast,
7252 &hf_dhcp_flags_reserved,
7253 NULL
7256 rfc3396_dns_domain_search_list.total_number_of_block = 0;
7257 rfc3396_dns_domain_search_list.tvb_composite = NULL;
7258 rfc3396_sip_server.total_number_of_block = 0;
7259 rfc3396_sip_server.tvb_composite = NULL;
7261 if (pinfo->srcport == PROXYDHCP_UDP_PORT ||
7262 pinfo->destport == PROXYDHCP_UDP_PORT) {
7263 /* The "DHCP magic" is mandatory for proxyDHCP. Use it as a heuristic. */
7264 if (!tvb_bytes_exist(tvb, VENDOR_INFO_OFFSET, 4) ||
7265 tvb_get_ntohl(tvb, VENDOR_INFO_OFFSET) != 0x63825363) {
7266 /* Not a DHCP packet at all. */
7267 return 0;
7269 isProxyDhcp = true;
7270 } else {
7271 isProxyDhcp = false;
7274 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BOOTP");
7276 * In case we throw an exception fetching the opcode, etc.
7278 col_clear(pinfo->cinfo, COL_INFO);
7280 op = tvb_get_uint8(tvb, 0);
7281 htype = tvb_get_uint8(tvb, 1);
7282 hlen = tvb_get_uint8(tvb, 2);
7283 switch (op) {
7285 case BOOTREQUEST:
7286 if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7287 && hlen == 6) {
7288 col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
7289 tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype),
7290 tvb_get_ether_name(tvb, 28));
7292 else {
7293 col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
7294 tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7296 break;
7298 case BOOTREPLY:
7299 col_set_str(pinfo->cinfo, COL_INFO, "Boot Reply");
7300 break;
7302 default:
7303 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)", op);
7304 break;
7307 voff = VENDOR_INFO_OFFSET;
7309 /* rfc2132 says it SHOULD exist, not that it MUST exist */
7310 if (tvb_bytes_exist(tvb, voff, 4) &&
7311 (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7312 voff += 4;
7313 } else {
7314 voff += 64;
7316 eoff = tvb_reported_length(tvb);
7318 bp_ti = proto_tree_add_item(tree, proto_dhcp, tvb, 0, -1, ENC_NA);
7319 bp_tree = proto_item_add_subtree(bp_ti, ett_dhcp);
7322 * In the first pass, we just look for the DHCP message type
7323 * and Vendor class identifier options.
7325 tmpvoff = voff;
7326 at_end = false;
7327 rfc3396_dns_domain_search_list.index_current_block = 0;
7328 rfc3396_sip_server.index_current_block = 0;
7329 while (tmpvoff < eoff && !at_end) {
7330 offset_delta = dhcp_option(tvb, pinfo, NULL, tmpvoff, eoff, true, &at_end,
7331 &dhcp_type, &vendor_class_id, &overload);
7332 if (offset_delta <= 0) {
7333 proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7334 tvb, tmpvoff, eoff);
7335 return tmpvoff;
7337 tmpvoff += offset_delta;
7341 * If there was a DHCP message type option, flag this packet
7342 * as DHCP.
7344 if (dhcp_type != NULL) {
7346 * Yes, this is a DHCP packet, and "dhcp_type" is the
7347 * packet type.
7349 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCP");
7351 col_add_fstr(pinfo->cinfo, COL_INFO, "%sDHCP %-8s - Transaction ID 0x%x",
7352 isProxyDhcp ? "proxy" : "", dhcp_type, tvb_get_ntohl(tvb, 4));
7353 tap_queue_packet( dhcp_bootp_tap, pinfo, dhcp_type);
7357 * OK, now populate the protocol tree.
7360 proto_tree_add_uint(bp_tree, hf_dhcp_type, tvb,
7361 0, 1,
7362 op);
7363 proto_tree_add_item(bp_tree, hf_dhcp_hw_type, tvb,
7364 1, 1, ENC_BIG_ENDIAN);
7365 proto_tree_add_uint(bp_tree, hf_dhcp_hw_len, tvb,
7366 2, 1, hlen);
7367 proto_tree_add_item(bp_tree, hf_dhcp_hops, tvb,
7368 3, 1, ENC_BIG_ENDIAN);
7369 proto_tree_add_item(bp_tree, hf_dhcp_id, tvb,
7370 4, 4, ENC_BIG_ENDIAN);
7372 * Windows (98, XP and Vista tested) sends the "secs" value on
7373 * the wire formatted as little-endian. See if the LE value
7374 * makes sense, if autodetect is used.
7376 if (dhcp_secs_endian == DHCP_SECS_ENDIAN_AUTODETECT) {
7377 secs = tvb_get_letohs(tvb, 8);
7378 if (secs > 0 && secs <= 0xff) {
7379 ti = proto_tree_add_uint(bp_tree, hf_dhcp_secs, tvb, 8, 2, secs);
7380 expert_add_info_format(pinfo, ti, &ei_dhcp_secs_le, "Seconds elapsed appears to be encoded as little-endian");
7381 } else {
7382 proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb,
7383 8, 2, ENC_BIG_ENDIAN);
7386 else {
7387 /* Use whatever endianness is configured */
7388 proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb, 8, 2, dhcp_secs_endian);
7390 flags = tvb_get_ntohs(tvb, 10);
7391 fi = proto_tree_add_bitmask(bp_tree, tvb, 10, hf_dhcp_flags,
7392 ett_dhcp_flags, dhcp_flags, ENC_NA);
7393 proto_item_append_text(fi, " (%s)",
7394 (flags & BOOTP_BC) ? "Broadcast" : "Unicast");
7396 proto_tree_add_item(bp_tree, hf_dhcp_ip_client, tvb,
7397 12, 4, ENC_BIG_ENDIAN);
7398 proto_tree_add_item(bp_tree, hf_dhcp_ip_your, tvb,
7399 16, 4, ENC_BIG_ENDIAN);
7400 proto_tree_add_item(bp_tree, hf_dhcp_ip_server, tvb,
7401 20, 4, ENC_BIG_ENDIAN);
7402 proto_tree_add_item(bp_tree, hf_dhcp_ip_relay, tvb,
7403 24, 4, ENC_BIG_ENDIAN);
7405 if (hlen > 0 && hlen <= 16) {
7406 if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7407 && hlen == 6)
7408 proto_tree_add_item(bp_tree, hf_dhcp_hw_ether_addr, tvb, 28, 6, ENC_NA);
7409 else
7410 /* The chaddr element is 16 bytes in length,
7411 although only the first hlen bytes are used */
7412 proto_tree_add_bytes_format_value(bp_tree, hf_dhcp_hw_addr, tvb, 28, 16,
7413 NULL, "%s", tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7414 if ((16 - hlen) > 0)
7415 proto_tree_add_item(bp_tree, hf_dhcp_hw_addr_padding, tvb, 28+hlen, 16-hlen, ENC_NA);
7416 } else {
7417 proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_client_address_not_given, tvb, 28, 16);
7420 if (overload & OPT_OVERLOAD_SNAME) {
7421 proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_server_name_overloaded_by_dhcp, tvb,
7422 SERVER_NAME_OFFSET, SERVER_NAME_LEN);
7423 } else {
7424 /* The server host name is optional */
7425 if (tvb_get_uint8(tvb, SERVER_NAME_OFFSET) != '\0') {
7426 proto_tree_add_item(bp_tree, hf_dhcp_server, tvb,
7427 SERVER_NAME_OFFSET,
7428 SERVER_NAME_LEN, ENC_ASCII);
7430 } else {
7431 proto_tree_add_string_format(bp_tree, hf_dhcp_server, tvb,
7432 SERVER_NAME_OFFSET,
7433 SERVER_NAME_LEN,
7434 "", "Server host name not given");
7438 if (overload & OPT_OVERLOAD_FILE) {
7439 proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_boot_filename_overloaded_by_dhcp, tvb,
7440 FILE_NAME_OFFSET, FILE_NAME_LEN);
7441 } else {
7442 /* Boot file is optional */
7443 if (tvb_get_uint8(tvb, FILE_NAME_OFFSET) != '\0') {
7444 proto_tree_add_item(bp_tree, hf_dhcp_file, tvb,
7445 FILE_NAME_OFFSET,
7446 FILE_NAME_LEN, ENC_ASCII);
7447 } else {
7448 proto_tree_add_string_format(bp_tree, hf_dhcp_file, tvb,
7449 FILE_NAME_OFFSET,
7450 FILE_NAME_LEN,
7451 "", "Boot file name not given");
7455 voff = VENDOR_INFO_OFFSET;
7456 if (dhcp_type == NULL) {
7457 hidden_item = proto_tree_add_boolean(bp_tree, hf_dhcp_bootp, tvb, 0, 0, 1);
7458 proto_item_set_hidden(hidden_item);
7460 if (tvb_bytes_exist(tvb, voff, 4) &&
7461 (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7462 ip_addr = tvb_get_ipv4(tvb, voff);
7463 proto_tree_add_ipv4_format_value(bp_tree, hf_dhcp_cookie, tvb,
7464 voff, 4, ip_addr, "DHCP");
7465 voff += 4;
7466 } else {
7467 proto_tree_add_item(bp_tree, hf_dhcp_vendor_specific_options, tvb,
7468 voff, 64, ENC_NA);
7469 voff += 64;
7472 at_end = false;
7473 rfc3396_dns_domain_search_list.index_current_block = 0;
7474 rfc3396_sip_server.index_current_block = 0;
7475 while (voff < eoff && !at_end) {
7476 offset_delta = dhcp_option(tvb, pinfo, bp_tree, voff, eoff, false, &at_end,
7477 &dhcp_type, &vendor_class_id, &overload);
7478 if (offset_delta <= 0) {
7479 proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7480 tvb, voff, eoff);
7481 return voff;
7483 voff += offset_delta;
7485 if ((dhcp_type != NULL) && (!at_end))
7487 expert_add_info(pinfo, bp_ti, &ei_dhcp_end_option_missing);
7489 if (voff < eoff) {
7491 * Padding after the end option.
7493 proto_tree_add_item(bp_tree, hf_dhcp_option_padding, tvb, voff, eoff - voff, ENC_NA);
7496 return tvb_captured_length(tvb);
7499 static void
7500 dhcp_init_protocol(void)
7502 unsigned i;
7504 /* first copy default_dhcp_opt[] to dhcp_opt[]. This resets all values to default */
7505 memcpy(dhcp_opt, default_dhcp_opt, sizeof(dhcp_opt));
7507 if ((num_dhcp_records_uat > 0) && (saved_uat_opts == NULL))
7509 saved_uat_opts = wmem_list_new(NULL);
7512 /* Now apply the custom options */
7513 for (i = 0; i < num_dhcp_records_uat; i++)
7515 dhcp_opt[uat_dhcp_records[i].opt].text = wmem_strdup(wmem_file_scope(), uat_dhcp_records[i].text);
7516 dhcp_opt[uat_dhcp_records[i].opt].ftype = uat_dhcp_records[i].ftype;
7517 dhcp_opt[uat_dhcp_records[i].opt].phf = NULL;
7519 /* Apply the custom option to the dissection table*/
7520 dissector_change_uint("dhcp.option", uat_dhcp_records[i].opt, dhcpopt_basic_handle);
7522 /* Save the option so it can be cleared later */
7523 wmem_list_append(saved_uat_opts, GUINT_TO_POINTER(uat_dhcp_records[i].opt));
7527 static void
7528 dhcp_clear_uat_dhcpopt(void *data, void *user_data _U_)
7530 dissector_reset_uint("dhcp.option", GPOINTER_TO_UINT(data));
7533 static void
7534 dhcp_cleanup_protocol(void)
7536 if (saved_uat_opts != NULL) {
7537 wmem_list_foreach(saved_uat_opts, dhcp_clear_uat_dhcpopt,
7538 NULL);
7540 wmem_destroy_list(saved_uat_opts);
7541 saved_uat_opts = NULL;
7546 /* TAP STAT INFO */
7547 typedef enum
7549 MESSAGE_TYPE_COLUMN = 0,
7550 PACKET_COLUMN
7551 } dhcp_stat_columns;
7553 static stat_tap_table_item dhcp_stat_fields[] = {{TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "DHCP Message Type", "%-25s"}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Packets", "%d"}};
7555 static void dhcp_stat_init(stat_tap_table_ui* new_stat)
7557 const char *table_name = "DHCP Statistics";
7558 int num_fields = array_length(dhcp_stat_fields);
7559 stat_tap_table *table;
7560 int i = 0;
7561 stat_tap_table_item_type items[array_length(dhcp_stat_fields)];
7563 table = stat_tap_find_table(new_stat, table_name);
7564 if (table) {
7565 if (new_stat->stat_tap_reset_table_cb) {
7566 new_stat->stat_tap_reset_table_cb(table);
7568 return;
7571 table = stat_tap_init_table(table_name, num_fields, 0, NULL);
7572 stat_tap_add_table(new_stat, table);
7574 memset(items, 0x0, sizeof(items));
7575 /* Add a row for each value type */
7576 while (opt53_text[i].strptr)
7578 items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
7579 items[MESSAGE_TYPE_COLUMN].value.string_value = opt53_text[i].strptr;
7580 items[PACKET_COLUMN].type = TABLE_ITEM_UINT;
7581 items[PACKET_COLUMN].value.uint_value = 0;
7583 stat_tap_init_table_row(table, i, num_fields, items);
7584 i++;
7588 static tap_packet_status
7589 dhcp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_)
7591 stat_data_t* stat_data = (stat_data_t*)tapdata;
7592 const char* value = (const char*)data;
7593 stat_tap_table* table;
7594 stat_tap_table_item_type* msg_data;
7595 int idx;
7597 idx = str_to_val_idx(value, opt53_text);
7598 if (idx < 0)
7599 return TAP_PACKET_DONT_REDRAW;
7601 table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
7602 msg_data = stat_tap_get_field_data(table, idx, PACKET_COLUMN);
7603 msg_data->value.uint_value++;
7604 stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data);
7606 return TAP_PACKET_REDRAW;
7609 static void
7610 dhcp_stat_reset(stat_tap_table* table)
7612 unsigned element;
7613 stat_tap_table_item_type* item_data;
7615 for (element = 0; element < table->num_elements; element++)
7617 item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN);
7618 item_data->value.uint_value = 0;
7619 stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
7623 void
7624 proto_register_dhcp(void)
7626 static const value_string dhcp_custom_type_vals[] = {
7627 { ipv4, "IP Address"},
7628 { ipv4_list, "IP Address List" },
7629 { string, "string" },
7630 { bytes, "bytes" },
7631 { val_boolean, "boolean" },
7632 { val_u_byte, "byte" },
7633 { val_u_short, "unsigned short" },
7634 { val_u_short_list, "unsigned short list" },
7635 { val_u_long, "unsigned long" },
7636 { time_in_s_secs, "integer time in seconds" },
7637 { time_in_u_secs, "unsigned integer time in seconds" },
7638 { 0x00, NULL }
7641 static hf_register_info hf[] = {
7642 { &hf_dhcp_bootp,
7643 { "Frame is BOOTP", "dhcp.bootp",
7644 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
7645 NULL, HFILL }},
7647 { &hf_dhcp_type,
7648 { "Message type", "dhcp.type",
7649 FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
7650 NULL, HFILL }},
7652 { &hf_dhcp_hw_type,
7653 { "Hardware type", "dhcp.hw.type",
7654 FT_UINT8, BASE_HEX, VALS(arp_hrd_vals), 0x0,
7655 NULL, HFILL }},
7657 { &hf_dhcp_hw_len,
7658 { "Hardware address length", "dhcp.hw.len",
7659 FT_UINT8, BASE_DEC, NULL, 0x0,
7660 NULL, HFILL }},
7662 { &hf_dhcp_hops,
7663 { "Hops", "dhcp.hops",
7664 FT_UINT8, BASE_DEC, NULL, 0x0,
7665 NULL, HFILL }},
7667 { &hf_dhcp_id,
7668 { "Transaction ID", "dhcp.id",
7669 FT_UINT32, BASE_HEX, NULL, 0x0,
7670 NULL, HFILL }},
7672 { &hf_dhcp_secs,
7673 { "Seconds elapsed", "dhcp.secs",
7674 FT_UINT16, BASE_DEC, NULL, 0x0,
7675 NULL, HFILL }},
7677 { &hf_dhcp_flags,
7678 { "Bootp flags", "dhcp.flags",
7679 FT_UINT16, BASE_HEX, NULL, 0x0,
7680 NULL, HFILL }},
7682 { &hf_dhcp_flags_broadcast,
7683 { "Broadcast flag", "dhcp.flags.bc",
7684 FT_BOOLEAN, 16, TFS(&flag_set_broadcast), BOOTP_BC,
7685 NULL, HFILL }},
7687 { &hf_dhcp_flags_reserved,
7688 { "Reserved flags", "dhcp.flags.reserved",
7689 FT_UINT16, BASE_HEX, NULL, BOOTP_MBZ,
7690 NULL, HFILL }},
7692 { &hf_dhcp_ip_client,
7693 { "Client IP address", "dhcp.ip.client",
7694 FT_IPv4, BASE_NONE, NULL, 0x0,
7695 NULL, HFILL }},
7697 { &hf_dhcp_ip_your,
7698 { "Your (client) IP address", "dhcp.ip.your",
7699 FT_IPv4, BASE_NONE, NULL, 0x0,
7700 NULL, HFILL }},
7702 { &hf_dhcp_ip_server,
7703 { "Next server IP address", "dhcp.ip.server",
7704 FT_IPv4, BASE_NONE, NULL, 0x0,
7705 NULL, HFILL }},
7707 { &hf_dhcp_ip_relay,
7708 { "Relay agent IP address", "dhcp.ip.relay",
7709 FT_IPv4, BASE_NONE, NULL, 0x0,
7710 NULL, HFILL }},
7712 { &hf_dhcp_hw_addr,
7713 { "Client hardware address", "dhcp.hw.addr",
7714 FT_BYTES, BASE_NONE, NULL, 0x0,
7715 NULL, HFILL }},
7717 { &hf_dhcp_hw_addr_padding,
7718 { "Client hardware address padding", "dhcp.hw.addr_padding",
7719 FT_BYTES, BASE_NONE, NULL, 0x0,
7720 NULL, HFILL }},
7722 { &hf_dhcp_hw_ether_addr,
7723 { "Client MAC address", "dhcp.hw.mac_addr",
7724 FT_ETHER, BASE_NONE, NULL, 0x0,
7725 NULL, HFILL }},
7727 { &hf_dhcp_server,
7728 { "Server host name", "dhcp.server",
7729 FT_STRING, BASE_NONE, NULL, 0x0,
7730 NULL, HFILL }},
7732 { &hf_dhcp_file,
7733 { "Boot file name", "dhcp.file",
7734 FT_STRING, BASE_NONE, NULL, 0x0,
7735 NULL, HFILL }},
7737 { &hf_dhcp_cookie,
7738 { "Magic cookie", "dhcp.cookie",
7739 FT_IPv4, BASE_NONE, NULL, 0x0,
7740 NULL, HFILL }},
7742 { &hf_dhcp_vendor_specific_options,
7743 { "Bootp vendor specific options", "dhcp.vendor_specific_options",
7744 FT_BYTES, BASE_NONE, NULL, 0x0,
7745 NULL, HFILL }},
7747 { &hf_dhcp_fqdn_s,
7748 { "Server", "dhcp.fqdn.s",
7749 FT_BOOLEAN, 8, TFS(&tfs_server_client), F_FQDN_S,
7750 "If true, server should do DDNS update", HFILL }},
7752 { &hf_dhcp_fqdn_o,
7753 { "Server overrides", "dhcp.fqdn.o",
7754 FT_BOOLEAN, 8, TFS(&tfs_fqdn_o), F_FQDN_O,
7755 "If true, server insists on doing DDNS update", HFILL }},
7757 { &hf_dhcp_fqdn_e,
7758 { "Encoding", "dhcp.fqdn.e",
7759 FT_BOOLEAN, 8, TFS(&tfs_fqdn_e), F_FQDN_E,
7760 "If true, name is binary encoded", HFILL }},
7762 { &hf_dhcp_fqdn_n,
7763 { "Server DDNS", "dhcp.fqdn.n",
7764 FT_BOOLEAN, 8, TFS(&tfs_fqdn_n), F_FQDN_N,
7765 "If true, server should not do any DDNS updates", HFILL }},
7767 { &hf_dhcp_fqdn_flags,
7768 { "Flags", "dhcp.fqdn.flags",
7769 FT_UINT8, BASE_HEX, NULL, 0,
7770 NULL, HFILL }},
7772 { &hf_dhcp_fqdn_mbz,
7773 { "Reserved flags", "dhcp.fqdn.mbz",
7774 FT_UINT8, BASE_HEX, NULL, F_FQDN_MBZ,
7775 NULL, HFILL }},
7777 { &hf_dhcp_fqdn_rcode1,
7778 { "A-RR result", "dhcp.fqdn.rcode1",
7779 FT_UINT8, BASE_DEC, NULL, 0x0,
7780 "Result code of A-RR update", HFILL }},
7782 { &hf_dhcp_fqdn_rcode2,
7783 { "PTR-RR result", "dhcp.fqdn.rcode2",
7784 FT_UINT8, BASE_DEC, NULL, 0x0,
7785 "Result code of PTR-RR update", HFILL }},
7787 { &hf_dhcp_fqdn_name,
7788 { "Client name", "dhcp.fqdn.name",
7789 FT_STRING, BASE_NONE, NULL, 0x0,
7790 "Name to register via DDNS", HFILL }},
7792 { &hf_dhcp_fqdn_asciiname,
7793 { "Client name", "dhcp.fqdn.name",
7794 FT_STRING, BASE_NONE, NULL, 0x0,
7795 "Name to register via DDNS", HFILL }},
7797 { &hf_dhcp_pkt_mta_cap_len,
7798 { "MTA DC Length", "dhcp.vendor.pktc.mta_cap_len",
7799 FT_UINT16, BASE_DEC, NULL, 0x0,
7800 "PacketCable MTA Device Capabilities Length", HFILL }},
7802 { &hf_dhcp_pkt_mta_cap_type,
7803 { "Type", "dhcp.vendor.pktc.mta_cap_type",
7804 FT_UINT16, BASE_DEC, VALS(pkt_mdc_type_vals), 0x0,
7805 NULL, HFILL }},
7807 { &hf_dhcp_pkt_mdc_supp_flow_secure,
7808 { "Secure Flow (Full Secure Provisioning Flow)", "dhcp.vendor.pktc.mdc.supp_flow.secure",
7809 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
7810 NULL, HFILL }},
7812 { &hf_dhcp_pkt_mdc_supp_flow_hybrid,
7813 { "Hybrid Flow", "dhcp.vendor.pktc.mdc.supp_flow.hybrid",
7814 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
7815 NULL, HFILL }},
7817 { &hf_dhcp_pkt_mdc_supp_flow_basic,
7818 { "Basic Flow", "dhcp.vendor.pktc.mdc.supp_flow.basic",
7819 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
7820 NULL, HFILL }},
7822 { &hf_dhcp_pkt_mdc_mib_cl_mta,
7823 { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta",
7824 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7825 NULL, HFILL }},
7827 { &hf_dhcp_pkt_mdc_mib_cl_signaling,
7828 { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling",
7829 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7830 NULL, HFILL }},
7832 { &hf_dhcp_pkt_mdc_mib_cl_management_event,
7833 { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_cl.mib.management_event",
7834 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7835 NULL, HFILL }},
7837 { &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
7838 { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta_extension",
7839 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
7840 NULL, HFILL }},
7842 { &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
7843 { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling_extension",
7844 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
7845 NULL, HFILL }},
7847 { &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
7848 { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mem_extension",
7849 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
7850 NULL, HFILL }},
7852 { &hf_dhcp_pkt_mdc_mib_cl_reserved,
7853 { "Reserved", "dhcp.vendor.pktc.mdc_cl.mib.reserved",
7854 FT_UINT8, BASE_HEX, NULL, 0xC0,
7855 NULL, HFILL }},
7857 { &hf_dhcp_pkt_mdc_mib_ietf_mta,
7858 { "IETF MTA MIB", "dhcp.vendor.pktc.mdc_ietf.mib.mta",
7859 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7860 NULL, HFILL }},
7862 { &hf_dhcp_pkt_mdc_mib_ietf_signaling,
7863 { "IETF Signaling MIB", "dhcp.vendor.pktc.mdc_ietf.mib.signaling",
7864 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7865 NULL, HFILL }},
7867 { &hf_dhcp_pkt_mdc_mib_ietf_management_event,
7868 { "IETF Management Event MIB", "dhcp.vendor.pktc.mdc_ietf.mib.management_event",
7869 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7870 NULL, HFILL }},
7872 { &hf_dhcp_pkt_mdc_mib_ietf_reserved,
7873 { "Reserved", "dhcp.vendor.pktc.mdc_ietf.mib.reserved",
7874 FT_UINT8, BASE_HEX, NULL, 0xF8,
7875 NULL, HFILL }},
7877 { &hf_dhcp_pkt_mdc_mib_euro_mta,
7878 { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta",
7879 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7880 NULL, HFILL }},
7882 { &hf_dhcp_pkt_mdc_mib_euro_signaling,
7883 { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling",
7884 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7885 NULL, HFILL }},
7887 { &hf_dhcp_pkt_mdc_mib_euro_management_event,
7888 { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_euro.mib.management_event",
7889 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7890 NULL, HFILL }},
7892 { &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
7893 { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta_extension",
7894 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
7895 NULL, HFILL }},
7897 { &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
7898 { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling_extension",
7899 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
7900 NULL, HFILL }},
7902 { &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
7903 { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mem_extension",
7904 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
7905 NULL, HFILL }},
7907 { &hf_dhcp_pkt_mdc_mib_euro_reserved,
7908 { "Reserved", "dhcp.vendor.pktc.mdc_euro.mib.reserved",
7909 FT_UINT8, BASE_HEX, NULL, 0xC0,
7910 NULL, HFILL }},
7912 { &hf_dhcp_docsis_cm_cap_len,
7913 { "CM DC Length", "dhcp.vendor.docsis.cm_cap_len",
7914 FT_UINT8, BASE_DEC, NULL, 0x0,
7915 "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
7917 { &hf_dhcp_docsis_cm_cap_type,
7918 { "CM DC Type", "dhcp.docsis_cm_cap_type",
7919 FT_UINT16, BASE_DEC, VALS(docsis_cm_cap_type_vals), 0x0,
7920 "Docsis Cable Modem Device Capability type", HFILL }},
7922 { &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
7923 { "CM", "dhcp.docsis_cm_cap.ranging_hold_off.cm",
7924 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
7925 NULL, HFILL }},
7927 { &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
7928 { "ePS or eRouter", "dhcp.docsis_cm_cap.ranging_hold_off.eps",
7929 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
7930 NULL, HFILL }},
7932 { &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
7933 { "EMTA or EDVA", "dhcp.docsis_cm_cap.ranging_hold_off.emta",
7934 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
7935 NULL, HFILL }},
7937 { &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
7938 { "DSG/eSTB", "dhcp.docsis_cm_cap.ranging_hold_off.dsg",
7939 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0008,
7940 NULL, HFILL }},
7943 { &hf_dhcp_docsis_cm_cap_mpls_stpid,
7944 { "[IEEE 802.1ad] S-TPID", "dhcp.docsis_cm_cap.mpls.stpid",
7945 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
7946 NULL, HFILL }},
7948 { &hf_dhcp_docsis_cm_cap_mpls_svid,
7949 { "[IEEE 802.1ad] S-VID", "dhcp.docsis_cm_cap.mpls.svid",
7950 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
7951 NULL, HFILL }},
7953 { &hf_dhcp_docsis_cm_cap_mpls_spcp,
7954 { "[IEEE 802.1ad] S-PCP", "dhcp.docsis_cm_cap.mpls.spcp",
7955 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
7956 NULL, HFILL }},
7958 { &hf_dhcp_docsis_cm_cap_mpls_sdei,
7959 { "[IEEE 802.1ad] S-DEI", "dhcp.docsis_cm_cap.mpls.sdei",
7960 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
7961 NULL, HFILL }},
7963 { &hf_dhcp_docsis_cm_cap_mpls_ctpid,
7964 { "[IEEE 802.1ad] C-TPID", "dhcp.docsis_cm_cap.mpls.ctpid",
7965 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
7966 NULL, HFILL }},
7968 { &hf_dhcp_docsis_cm_cap_mpls_cvid,
7969 { "[IEEE 802.1ad] C-VID", "dhcp.docsis_cm_cap.mpls.cvid",
7970 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
7971 NULL, HFILL }},
7973 { &hf_dhcp_docsis_cm_cap_mpls_cpcp,
7974 { "[IEEE 802.1ad] C-PCP", "dhcp.docsis_cm_cap.mpls.cpcp",
7975 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
7976 NULL, HFILL }},
7978 { &hf_dhcp_docsis_cm_cap_mpls_ccfi,
7979 { "[IEEE 802.1ad] C-CFI", "dhcp.docsis_cm_cap.mpls.ccfi",
7980 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
7981 NULL, HFILL }},
7983 { &hf_dhcp_docsis_cm_cap_mpls_stci,
7984 { "[IEEE 802.1ad] S-TCI", "dhcp.docsis_cm_cap.mpls.stci",
7985 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
7986 NULL, HFILL }},
7988 { &hf_dhcp_docsis_cm_cap_mpls_ctci,
7989 { "[IEEE 802.1ad] C-TCI", "dhcp.docsis_cm_cap.mpls.ctci",
7990 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
7991 NULL, HFILL }},
7993 { &hf_dhcp_docsis_cm_cap_mpls_itpid,
7994 { "[IEEE 802.1ad] I-TPID", "dhcp.docsis_cm_cap.mpls.itpid",
7995 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
7996 NULL, HFILL }},
7998 { &hf_dhcp_docsis_cm_cap_mpls_isid,
7999 { "[IEEE 802.1ad] I-SID", "dhcp.docsis_cm_cap.mpls.isid",
8000 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
8001 NULL, HFILL }},
8003 { &hf_dhcp_docsis_cm_cap_mpls_itci,
8004 { "[IEEE 802.1ad] I-TCI", "dhcp.docsis_cm_cap.mpls.itci",
8005 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
8006 NULL, HFILL }},
8008 { &hf_dhcp_docsis_cm_cap_mpls_ipcp,
8009 { "[IEEE 802.1ad] I-PCP", "dhcp.docsis_cm_cap.mpls.ipcp",
8010 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
8011 NULL, HFILL }},
8013 { &hf_dhcp_docsis_cm_cap_mpls_idei,
8014 { "[IEEE 802.1ad] I-DEI", "dhcp.docsis_cm_cap.mpls.idei",
8015 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
8016 NULL, HFILL }},
8018 { &hf_dhcp_docsis_cm_cap_mpls_iuca,
8019 { "[IEEE 802.1ad] I-UCA", "dhcp.docsis_cm_cap.mpls.iuca",
8020 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
8021 NULL, HFILL }},
8023 { &hf_dhcp_docsis_cm_cap_mpls_btpid,
8024 { "[IEEE 802.1ad] B-TPID", "dhcp.docsis_cm_cap.mpls.btpid",
8025 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
8026 NULL, HFILL }},
8028 { &hf_dhcp_docsis_cm_cap_mpls_btci,
8029 { "[IEEE 802.1ad] B-TCI", "dhcp.docsis_cm_cap.mpls.btci",
8030 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
8031 NULL, HFILL }},
8033 { &hf_dhcp_docsis_cm_cap_mpls_bpcp,
8034 { "[IEEE 802.1ad] B-PCP", "dhcp.docsis_cm_cap.mpls.bpcp",
8035 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
8036 NULL, HFILL }},
8038 { &hf_dhcp_docsis_cm_cap_mpls_bdei,
8039 { "[IEEE 802.1ad] B-DEI", "dhcp.docsis_cm_cap.mpls.bdei",
8040 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
8041 NULL, HFILL }},
8043 { &hf_dhcp_docsis_cm_cap_mpls_bvid,
8044 { "[IEEE 802.1ad] B-VID", "dhcp.docsis_cm_cap.mpls.bvid",
8045 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
8046 NULL, HFILL }},
8048 { &hf_dhcp_docsis_cm_cap_mpls_bda,
8049 { "[IEEE 802.1ad] B-DA", "dhcp.docsis_cm_cap.mpls.bda",
8050 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
8051 NULL, HFILL }},
8053 { &hf_dhcp_docsis_cm_cap_mpls_bsa,
8054 { "[IEEE 802.1ad] B-SA", "dhcp.docsis_cm_cap.mpls.bsa",
8055 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
8056 NULL, HFILL }},
8058 { &hf_dhcp_docsis_cm_cap_mpls_tc,
8059 { "MPLS TC", "dhcp.docsis_cm_cap.mpls.tc",
8060 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
8061 NULL, HFILL }},
8063 { &hf_dhcp_docsis_cm_cap_mpls_label,
8064 { "MPLS Label", "dhcp.docsis_cm_cap.mpls.label",
8065 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
8066 NULL, HFILL }},
8069 { &hf_dhcp_docsis_cm_cap_ussymrate_160,
8070 { "160 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.160",
8071 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8072 NULL, HFILL }},
8074 { &hf_dhcp_docsis_cm_cap_ussymrate_320,
8075 { "320 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.320",
8076 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8077 NULL, HFILL }},
8079 { &hf_dhcp_docsis_cm_cap_ussymrate_640,
8080 { "640 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.640",
8081 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8082 NULL, HFILL }},
8084 { &hf_dhcp_docsis_cm_cap_ussymrate_1280,
8085 { "1280 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.1280",
8086 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8087 NULL, HFILL }},
8089 { &hf_dhcp_docsis_cm_cap_ussymrate_2560,
8090 { "2560 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.2560",
8091 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8092 NULL, HFILL }},
8094 { &hf_dhcp_docsis_cm_cap_ussymrate_5120,
8095 { "5120 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.5120",
8096 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8097 NULL, HFILL }},
8099 { &hf_dhcp_client_identifier_uuid,
8100 { "Client Identifier (UUID)", "dhcp.client_id.uuid",
8101 FT_GUID, BASE_NONE, NULL, 0x0,
8102 "Client Machine Identifier (UUID)", HFILL }},
8104 { &hf_dhcp_client_hardware_address,
8105 { "Client hardware address", "dhcp.client_hardware_address",
8106 FT_STRING, BASE_NONE, NULL, 0x0,
8107 NULL, HFILL }},
8109 { &hf_dhcp_client_id_iaid,
8110 { "IAID", "dhcp.client_id.iaid",
8111 FT_STRING, BASE_NONE, NULL, 0x0,
8112 NULL, HFILL }},
8114 { &hf_dhcp_client_id_duid_type,
8115 { "DUID Type", "dhcp.client_id.duid_type",
8116 FT_UINT16, BASE_DEC, VALS(duidtype_vals), 0x0,
8117 NULL, HFILL }},
8119 { &hf_dhcp_client_identifier_duid_llt_hw_type,
8120 { "Hardware type", "dhcp.client_id.duid_llt_hw_type",
8121 FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8122 "Client Identifier DUID LLT Hardware type", HFILL }},
8124 { &hf_dhcp_client_identifier_duid_ll_hw_type,
8125 { "Hardware type", "dhcp.client_id.duid_ll_hw_type",
8126 FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8127 "Client Identifier DUID LL Hardware type", HFILL }},
8129 { &hf_dhcp_client_identifier_time,
8130 { "Time", "dhcp.client_id.time",
8131 FT_UINT32, BASE_DEC, NULL, 0x0,
8132 NULL, HFILL }},
8134 { &hf_dhcp_client_identifier_link_layer_address,
8135 { "Link layer address", "dhcp.client_id.link_layer_address",
8136 FT_STRING, BASE_NONE, NULL, 0x0,
8137 NULL, HFILL }},
8139 { &hf_dhcp_client_identifier_link_layer_address_ether,
8140 { "Link layer address (Ethernet)", "dhcp.client_id.link_layer_address_ether",
8141 FT_ETHER, BASE_NONE, NULL, 0x0,
8142 NULL, HFILL }},
8144 { &hf_dhcp_client_identifier_enterprise_num,
8145 { "Enterprise-number", "dhcp.client_id.enterprise_num",
8146 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
8147 NULL, HFILL }},
8149 { &hf_dhcp_client_identifier,
8150 { "Identifier", "dhcp.client_id",
8151 FT_BYTES, BASE_NONE, NULL, 0x0,
8152 NULL, HFILL }},
8154 { &hf_dhcp_client_identifier_type,
8155 { "Type", "dhcp.client_id.type",
8156 FT_UINT8, BASE_DEC, NULL, 0x0,
8157 NULL, HFILL }},
8159 { &hf_dhcp_client_identifier_undef,
8160 { "Client Identifier", "dhcp.client_id.undef",
8161 FT_STRING, BASE_NONE, NULL, 0x0,
8162 NULL, HFILL }},
8164 { &hf_dhcp_option_type,
8165 { "Option", "dhcp.option.type",
8166 FT_UINT8, BASE_DEC, NULL, 0x0,
8167 "DHCP/BOOTP option type", HFILL }},
8169 { &hf_dhcp_option_length,
8170 { "Length", "dhcp.option.length",
8171 FT_UINT8, BASE_DEC, NULL, 0x0,
8172 "DHCP/BOOTP option length", HFILL }},
8174 { &hf_dhcp_suboption_length,
8175 { "Length", "dhcp.option.suboption_length",
8176 FT_UINT8, BASE_DEC, NULL, 0x0,
8177 "Suboption length", HFILL }},
8179 { &hf_dhcp_option_value,
8180 { "Value", "dhcp.option.value",
8181 FT_BYTES, BASE_NONE, NULL, 0x0,
8182 "DHCP/BOOTP option value", HFILL }},
8184 { &hf_dhcp_option_value_8,
8185 { "Value", "dhcp.option.value.uint",
8186 FT_UINT8, BASE_DEC, NULL, 0x0,
8187 "8-bit DHCP/BOOTP option value", HFILL }},
8189 { &hf_dhcp_option_value_16,
8190 { "Value", "dhcp.option.value.uint",
8191 FT_UINT16, BASE_DEC, NULL, 0x0,
8192 "16-bit DHCP/BOOTP option value", HFILL }},
8194 { &hf_dhcp_option_value_u32,
8195 { "Value", "dhcp.option.value.uint",
8196 FT_UINT32, BASE_HEX, NULL, 0x0,
8197 "32-bit DHCP/BOOTP option value", HFILL }},
8199 { &hf_dhcp_option_value_s_secs,
8200 { "Value", "dhcp.option.value.secs",
8201 FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8202 "32-bit DHCP/BOOTP option value", HFILL }},
8204 { &hf_dhcp_option_value_u_secs,
8205 { "Value", "dhcp.option.value.usecs",
8206 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8207 "32-bit DHCP/BOOTP option value", HFILL }},
8209 { &hf_dhcp_option_value_stringz,
8210 { "Value", "dhcp.option.value.string",
8211 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8212 "Z-String DHCP/BOOTP option value", HFILL }},
8214 { &hf_dhcp_option_value_ip_address,
8215 { "Value", "dhcp.option.value.address",
8216 FT_IPv4, BASE_NONE, NULL, 0x00,
8217 "IP address DHCP/BOOTP option value", HFILL }},
8219 { &hf_dhcp_option_value_boolean,
8220 { "Value", "dhcp.option.value.bool",
8221 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
8222 "Boolean DHCP/BOOTP option value", HFILL }},
8224 { &hf_dhcp_option_padding,
8225 { "Padding", "dhcp.option.padding",
8226 FT_BYTES, BASE_NONE, NULL, 0x0,
8227 "Option 0: Padding", HFILL }},
8229 { &hf_dhcp_option_subnet_mask,
8230 { "Subnet Mask", "dhcp.option.subnet_mask",
8231 FT_IPv4, BASE_NETMASK, NULL, 0x00,
8232 "Option 1: Subnet Mask", HFILL }},
8234 { &hf_dhcp_option_time_offset,
8235 { "Time Offset", "dhcp.option.time_offset",
8236 FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8237 "Option 2: Time Offset", HFILL }},
8239 { &hf_dhcp_option_router,
8240 { "Router", "dhcp.option.router",
8241 FT_IPv4, BASE_NONE, NULL, 0x00,
8242 "Option 3: Router", HFILL }},
8244 { &hf_dhcp_option_time_server,
8245 { "Time Server", "dhcp.option.time_server",
8246 FT_IPv4, BASE_NONE, NULL, 0x00,
8247 "Option 4: Time Server", HFILL }},
8249 { &hf_dhcp_option_name_server,
8250 { "Name Server", "dhcp.option.name_server",
8251 FT_IPv4, BASE_NONE, NULL, 0x00,
8252 "Option 5: Name Server", HFILL }},
8254 { &hf_dhcp_option_domain_name_server,
8255 { "Domain Name Server", "dhcp.option.domain_name_server",
8256 FT_IPv4, BASE_NONE, NULL, 0x00,
8257 "Option 6: Domain Name Server", HFILL }},
8259 { &hf_dhcp_option_log_server,
8260 { "Log Server", "dhcp.option.log_server",
8261 FT_IPv4, BASE_NONE, NULL, 0x00,
8262 "Option 7: Log Server", HFILL }},
8264 { &hf_dhcp_option_quotes_server,
8265 { "Quotes Server", "dhcp.option.quotes_server",
8266 FT_IPv4, BASE_NONE, NULL, 0x00,
8267 "Option 8: Quotes Server", HFILL }},
8269 { &hf_dhcp_option_lpr_server,
8270 { "LPR Server", "dhcp.option.lpr_server",
8271 FT_IPv4, BASE_NONE, NULL, 0x00,
8272 "Option 9: LPR Server", HFILL }},
8274 { &hf_dhcp_option_impress_server,
8275 { "Impress Server", "dhcp.option.impress_server",
8276 FT_IPv4, BASE_NONE, NULL, 0x00,
8277 "Option 10: Impress Server", HFILL }},
8279 { &hf_dhcp_option_resource_location_server,
8280 { "Resource Location Server", "dhcp.option.resource_location_server",
8281 FT_IPv4, BASE_NONE, NULL, 0x00,
8282 "Option 11: Resource Location Server", HFILL }},
8284 { &hf_dhcp_option_hostname,
8285 { "Host Name", "dhcp.option.hostname",
8286 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8287 "Option 12: Host Name", HFILL }},
8289 { &hf_dhcp_option_boot_file_size,
8290 { "Boot File Size", "dhcp.option.boot_file_size",
8291 FT_UINT16, BASE_DEC, NULL, 0x0,
8292 "Option 13: Boot File Size", HFILL }},
8294 { &hf_dhcp_option_merit_dump_file,
8295 { "Merit Dump File", "dhcp.option.merit_dump_file",
8296 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8297 "Option 14: Merit Dump File", HFILL }},
8299 { &hf_dhcp_option_domain_name,
8300 { "Domain Name", "dhcp.option.domain_name",
8301 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8302 "Option 15: Domain Name", HFILL }},
8304 { &hf_dhcp_option_swap_server,
8305 { "Swap Server", "dhcp.option.swap_server",
8306 FT_IPv4, BASE_NONE, NULL, 0x00,
8307 "Option 16: Swap Server", HFILL }},
8309 { &hf_dhcp_option_root_path,
8310 { "Root Path", "dhcp.option.root_path",
8311 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8312 "Option 17: Root Path", HFILL }},
8314 { &hf_dhcp_option_extension_path,
8315 { "Extensions Path", "dhcp.option.extension_path",
8316 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8317 "Option 18: Extensions Path", HFILL }},
8319 { &hf_dhcp_option_ip_forwarding,
8320 { "IP Forwarding", "dhcp.option.ip_forwarding",
8321 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8322 "Option 19: IP Forwarding", HFILL }},
8324 { &hf_dhcp_option_policy_filter_ip,
8325 { "IP Address", "dhcp.option.policy_filter.ip",
8326 FT_IPv4, BASE_NONE, NULL, 0x00,
8327 "Option 21: IP address", HFILL }},
8329 { &hf_dhcp_option_policy_filter_subnet_mask,
8330 { "Subnet Mask", "dhcp.option.policy_filter.subnet_mask",
8331 FT_IPv4, BASE_NETMASK, NULL, 0x00,
8332 "Option 21: Subnet Mask", HFILL }},
8334 { &hf_dhcp_option_non_local_source_routing,
8335 { "Non-Local Source Routing", "dhcp.option.non_local_source_routing",
8336 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8337 "Option 20: Non-Local Source Routing", HFILL }},
8339 { &hf_dhcp_option_max_datagram_reassembly_size,
8340 { "Maximum Datagram Reassembly Size", "dhcp.option.max_datagram_reassembly_size",
8341 FT_UINT16, BASE_DEC, NULL, 0x0,
8342 "Option 22: Maximum Datagram Reassembly Size", HFILL }},
8344 { &hf_dhcp_option_default_ip_ttl,
8345 { "Default IP Time-to-Live", "dhcp.option.default_ip_ttl",
8346 FT_UINT8, BASE_DEC, NULL, 0x0,
8347 "Option 23: Default IP Time-to-Live", HFILL }},
8349 { &hf_dhcp_option_path_mtu_aging_timeout,
8350 { "Path MTU Aging Timeout", "dhcp.option.path_mtu_aging_timeout",
8351 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8352 "Option 24: Path MTU Aging Timeout", HFILL }},
8354 { &hf_dhcp_option_path_mtu_plateau_table_item,
8355 { "Path MTU Plateau Table Item", "dhcp.option.path_mtu_plateau_table_item",
8356 FT_UINT16, BASE_DEC, NULL, 0x0,
8357 "Option 25: Path MTU Plateau Table Item", HFILL }},
8359 { &hf_dhcp_option_interface_mtu,
8360 { "Interface MTU", "dhcp.option.interface_mtu",
8361 FT_UINT16, BASE_DEC, NULL, 0x0,
8362 "Option 26: Interface MTU", HFILL }},
8364 { &hf_dhcp_option_all_subnets_are_local,
8365 { "All Subnets are Local", "dhcp.option.all_subnets_are_local",
8366 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8367 "Option 27: All Subnets are Local", HFILL }},
8369 { &hf_dhcp_option_broadcast_address,
8370 { "Broadcast Address", "dhcp.option.broadcast_address",
8371 FT_IPv4, BASE_NONE, NULL, 0x00,
8372 "Option 28: Broadcast Address", HFILL }},
8374 { &hf_dhcp_option_perform_mask_discovery,
8375 { "Perform Mask Discovery", "dhcp.option.perform_mask_discovery",
8376 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8377 "Option 29: Perform Mask Discovery", HFILL }},
8379 { &hf_dhcp_option_mask_supplier,
8380 { "Mask Supplier", "dhcp.option.mask_supplier",
8381 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8382 "Option 30: Mask Supplier", HFILL }},
8384 { &hf_dhcp_option_perform_router_discover,
8385 { "Perform Router Discover", "dhcp.option.perform_router_discover",
8386 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8387 "Option 31: Perform Router Discover", HFILL }},
8389 { &hf_dhcp_option_router_solicitation_address,
8390 { "Router Solicitation Address", "dhcp.option.router_solicitation_address",
8391 FT_IPv4, BASE_NONE, NULL, 0x00,
8392 "Option 32: Router Solicitation Address", HFILL }},
8394 { &hf_dhcp_option_static_route_ip,
8395 { "Destination IP Address", "dhcp.option.static_route.ip",
8396 FT_IPv4, BASE_NONE, NULL, 0x00,
8397 "Option 33: Destination IP address", HFILL }},
8399 { &hf_dhcp_option_static_route_router,
8400 { "Destination Router", "dhcp.option.static_route.router",
8401 FT_IPv4, BASE_NONE, NULL, 0x00,
8402 "Option 33: Destination Router", HFILL }},
8404 { &hf_dhcp_option_trailer_encapsulation,
8405 { "Trailer Encapsulation", "dhcp.option.trailer_encapsulation",
8406 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8407 "Option 34: Trailer Encapsulation", HFILL }},
8409 { &hf_dhcp_option_arp_cache_timeout,
8410 { "ARP Cache Timeout", "dhcp.option.arp_cache_timeout",
8411 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8412 "Option 35: ARP Cache Timeout", HFILL }},
8414 { &hf_dhcp_option_ethernet_encapsulation,
8415 { "Ethernet Encapsulation", "dhcp.option.ethernet_encapsulation",
8416 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8417 "Option 36: Ethernet Encapsulation", HFILL }},
8419 { &hf_dhcp_option_tcp_default_ttl,
8420 { "TCP Default TTL", "dhcp.option.tcp_default_ttl",
8421 FT_UINT8, BASE_DEC, NULL, 0x0,
8422 "Option 37: TCP Default TTL", HFILL }},
8424 { &hf_dhcp_option_tcp_keepalive_interval,
8425 { "TCP Keepalive Interval", "dhcp.option.tcp_keepalive_interval",
8426 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8427 "Option 38: TCP Keepalive Interval", HFILL }},
8429 { &hf_dhcp_option_tcp_keepalive_garbage,
8430 { "TCP Keepalive Garbage", "dhcp.option.tcp_keepalive_garbage",
8431 FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8432 "Option 39: TCP Keepalive Garbage", HFILL }},
8434 { &hf_dhcp_option_nis_domain,
8435 { "Network Information Service Domain", "dhcp.option.nis_domain",
8436 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8437 "Option 40: Network Information Service Domain", HFILL }},
8439 { &hf_dhcp_option_nis_server,
8440 { "Network Information Service Server", "dhcp.option.nis_server",
8441 FT_IPv4, BASE_NONE, NULL, 0x00,
8442 "Option 41: Network Information Service Server", HFILL }},
8444 { &hf_dhcp_option_ntp_server,
8445 { "Network Time Protocol Server", "dhcp.option.ntp_server",
8446 FT_IPv4, BASE_NONE, NULL, 0x00,
8447 "Option 42: Network Time Protocol Server", HFILL }},
8449 { &hf_dhcp_option43_suboption,
8450 { "Option 43 Suboption", "dhcp.option.vendor.suboption",
8451 FT_UINT8, BASE_DEC, NULL, 0x0,
8452 NULL, HFILL }},
8454 { &hf_dhcp_option43_value,
8455 { "Value", "dhcp.option.vendor.value",
8456 FT_BYTES, BASE_NONE, NULL, 0x0,
8457 "Option 43: Suboption value", HFILL }},
8459 { &hf_dhcp_option43_value_8,
8460 { "Value", "dhcp.option.vendor.value.uint",
8461 FT_UINT8, BASE_DEC, NULL, 0x0,
8462 "Option 43: Suboption 8-bit value", HFILL }},
8464 { &hf_dhcp_option43_value_32,
8465 { "Value", "dhcp.option.vendor.value.uint",
8466 FT_UINT32, BASE_DEC, NULL, 0x0,
8467 "Option 43: Suboption 32-bit value", HFILL }},
8469 { &hf_dhcp_option43_value_stringz,
8470 { "Value", "dhcp.option.vendor.value.string",
8471 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8472 "Option 43: Suboption Z-String value", HFILL }},
8474 { &hf_dhcp_option43_value_ip_address,
8475 { "Value", "dhcp.option.vendor.value.address",
8476 FT_IPv4, BASE_NONE, NULL, 0x00,
8477 "Option 43: Suboption IP address", HFILL }},
8480 { &hf_dhcp_option43_pxeclient_suboption,
8481 { "Option 43 Suboption", "dhcp.option.vendor.pxeclient.suboption",
8482 FT_UINT8, BASE_DEC, VALS(option43_pxeclient_suboption_vals), 0x0,
8483 "Option 43:PXE Client Suboption", HFILL }},
8485 { &hf_dhcp_option43_pxeclient_padding,
8486 { "Padding", "dhcp.option.vendor.pxeclient.padding",
8487 FT_UINT8, BASE_DEC, NULL, 0x0,
8488 "Option 43:PXE Client 0 Padding", HFILL }},
8490 { &hf_dhcp_option43_pxeclient_mtftp_ip,
8491 { "mtftp IP", "dhcp.option.vendor.pxeclient.mtftp_ip",
8492 FT_IPv4, BASE_NONE, NULL, 0x00,
8493 "Option 43:PXE Client 1 mtftp IP", HFILL }},
8495 { &hf_dhcp_option43_pxeclient_mtftp_client_port,
8496 { "mtftp client port", "dhcp.option.vendor.pxeclient.mtftp_client_port",
8497 FT_UINT16, BASE_DEC, NULL, 0x00,
8498 "Option 43:PXE Client 2 mtftp client port", HFILL }},
8500 { &hf_dhcp_option43_pxeclient_mtftp_server_port,
8501 { "mtftp server port", "dhcp.option.vendor.pxeclient.mtftp_server_port",
8502 FT_UINT16, BASE_DEC, NULL, 0x00,
8503 "Option 43:PXE Client 3 mtftp server port", HFILL }},
8505 { &hf_dhcp_option43_pxeclient_mtftp_timeout,
8506 { "mtftp timeout", "dhcp.option.vendor.pxeclient.mtftp_timeout",
8507 FT_UINT8, BASE_DEC, NULL, 0x0,
8508 "Option 43:PXE Client 4 mtftp timeout", HFILL }},
8510 { &hf_dhcp_option43_pxeclient_mtftp_delay,
8511 { "mtftp delay", "dhcp.option.vendor.pxeclient.mtftp_delay",
8512 FT_UINT8, BASE_DEC, NULL, 0x0,
8513 "Option 43:PXE Client 5 mtftp delay", HFILL }},
8515 { &hf_dhcp_option43_pxeclient_discovery_control,
8516 { "discovery control", "dhcp.option.vendor.pxeclient.discovery_control",
8517 FT_UINT8, BASE_HEX, NULL, 0x0,
8518 "Option 43:PXE Client 6 discovery control", HFILL }},
8520 { &hf_dhcp_option43_pxeclient_discovery_control_bc,
8521 { "Disable Broadcast", "dhcp.option.vendor.pxeclient.discovery_control.broadcast",
8522 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
8523 NULL, HFILL }},
8525 { &hf_dhcp_option43_pxeclient_discovery_control_mc,
8526 { "Disable Multicast", "dhcp.option.vendor.pxeclient.discovery_control.multicast",
8527 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
8528 NULL, HFILL }},
8530 { &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
8531 { "Serverlist only", "dhcp.option.vendor.pxeclient.discovery_control.serverlist",
8532 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
8533 NULL, HFILL }},
8535 { &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
8536 { "Bootstrap override", "dhcp.option.vendor.pxeclient.discovery_control.bstrap",
8537 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
8538 NULL, HFILL }},
8540 { &hf_dhcp_option43_pxeclient_multicast_address,
8541 { "multicast address", "dhcp.option.vendor.pxeclient.multicast_address",
8542 FT_IPv4, BASE_NONE, NULL, 0x00,
8543 "Option 43:PXE Client 7 multicast address", HFILL }},
8545 { &hf_dhcp_option43_pxeclient_boot_servers,
8546 { "boot servers", "dhcp.option.vendor.pxeclient.boot_servers",
8547 FT_BYTES, BASE_NONE, NULL, 0x0,
8548 "Option 43:PXE Client 8 boot servers", HFILL }},
8550 { &hf_dhcp_option43_pxeclient_boot_server_type,
8551 { "Type", "dhcp.option.vendor.pxeclient.boot_servers.type",
8552 FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_server_types), 0x0,
8553 NULL, HFILL }},
8555 { &hf_dhcp_option43_pxeclient_boot_server_count,
8556 { "IP count", "dhcp.option.vendor.pxeclient.boot_servers.count",
8557 FT_UINT8, BASE_DEC, NULL, 0x0,
8558 NULL, HFILL }},
8560 { &hf_dhcp_option43_pxeclient_boot_server_ip,
8561 { "IP", "dhcp.option.vendor.pxeclient.boot_servers.ip",
8562 FT_IPv4, BASE_NONE, NULL, 0x0,
8563 NULL, HFILL }},
8565 { &hf_dhcp_option43_pxeclient_boot_menu,
8566 { "boot menu", "dhcp.option.vendor.pxeclient.boot_menu",
8567 FT_BYTES, BASE_NONE, NULL, 0x0,
8568 "Option 43:PXE Client 9 boot menu", HFILL }},
8570 { &hf_dhcp_option43_pxeclient_boot_menu_type,
8571 { "Type", "dhcp.option.vendor.pxeclient.boot_menu.type",
8572 FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_menu_types), 0x0,
8573 NULL, HFILL }},
8575 { &hf_dhcp_option43_pxeclient_boot_menu_length,
8576 { "Length", "dhcp.option.vendor.pxeclient.boot_menu.length",
8577 FT_UINT8, BASE_DEC, NULL, 0x0,
8578 NULL, HFILL }},
8580 { &hf_dhcp_option43_pxeclient_boot_menu_desc,
8581 { "Description", "dhcp.option.vendor.pxeclient.boot_menu.desc",
8582 FT_STRING, BASE_NONE, NULL, 0x0,
8583 NULL, HFILL }},
8585 { &hf_dhcp_option43_pxeclient_menu_prompt,
8586 { "menu prompt", "dhcp.option.vendor.pxeclient.menu_prompt",
8587 FT_BYTES, BASE_NONE, NULL, 0x0,
8588 "Option 43:PXE Client 10 menu prompt", HFILL }},
8590 { &hf_dhcp_option43_pxeclient_menu_prompt_timeout,
8591 { "Timeout", "dhcp.option.vendor.pxeclient.menu_prompt.timeout",
8592 FT_UINT8, BASE_DEC, NULL, 0x0,
8593 NULL, HFILL }},
8595 { &hf_dhcp_option43_pxeclient_menu_prompt_prompt,
8596 { "Prompt", "dhcp.option.vendor.pxeclient.menu_prompt.prompt",
8597 FT_STRING, BASE_NONE, NULL, 0x0,
8598 NULL, HFILL }},
8600 { &hf_dhcp_option43_pxeclient_multicast_address_alloc,
8601 { "multicast address alloc", "dhcp.option.vendor.pxeclient.multicast_address_alloc",
8602 FT_BYTES, BASE_NONE, NULL, 0x0,
8603 "Option 43:PXE Client 11 multicast address alloc", HFILL }},
8605 { &hf_dhcp_option43_pxeclient_credential_types,
8606 { "credential types", "dhcp.option.vendor.pxeclient.credential_types",
8607 FT_BYTES, BASE_NONE, NULL, 0x0,
8608 "Option 43:PXE Client 12 credential types", HFILL }},
8610 { &hf_dhcp_option43_pxeclient_boot_item,
8611 { "boot item", "dhcp.option.vendor.pxeclient.boot_item",
8612 FT_BYTES, BASE_NONE, NULL, 0x0,
8613 "Option 43:PXE Client 71 boot item", HFILL }},
8615 { &hf_dhcp_option43_pxeclient_boot_item_type,
8616 { "Type", "dhcp.option.vendor.pxeclient.boot_item.type",
8617 FT_UINT16, BASE_DEC, NULL, 0x0,
8618 NULL, HFILL }},
8620 { &hf_dhcp_option43_pxeclient_boot_item_layer,
8621 { "Layer", "dhcp.option.vendor.pxeclient.boot_item.layer",
8622 FT_BYTES, BASE_NONE, NULL, 0x0,
8623 NULL, HFILL }},
8625 { &hf_dhcp_option43_pxeclient_lcm_server,
8626 { "LCM Server Name", "dhcp.option.vendor.pxeclient.lcm_server",
8627 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8628 "Option 43:PXE Client 179 LCM Server", HFILL }},
8630 { &hf_dhcp_option43_pxeclient_lcm_domain,
8631 { "LCM Domain", "dhcp.option.vendor.pxeclient.lcm_domain",
8632 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8633 "Option 43:PXE Client 180 LCM Domain", HFILL }},
8635 { &hf_dhcp_option43_pxeclient_lcm_nic_option,
8636 { "LCM NIC option", "dhcp.option.vendor.pxeclient.lcm_nic_option",
8637 FT_BYTES, BASE_NONE, NULL, 0x0,
8638 "Option 43:PXE Client 181 LCM NIC Option", HFILL }},
8640 { &hf_dhcp_option43_pxeclient_lcm_workgroup,
8641 { "LCM Workgroup", "dhcp.option.vendor.pxeclient.lcm_workgroup",
8642 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8643 "Option 43:PXE Client 190 LCM Workgroup", HFILL }},
8645 { &hf_dhcp_option43_pxeclient_discovery,
8646 { "Discovery", "dhcp.option.vendor.pxeclient.discovery",
8647 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8648 "Option 43:PXE Client 191 Discovery", HFILL }},
8650 { &hf_dhcp_option43_pxeclient_configured,
8651 { "Configured", "dhcp.option.vendor.pxeclient.configured",
8652 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8653 "Option 43:PXE Client 192 Configured", HFILL }},
8655 { &hf_dhcp_option43_pxeclient_lcm_version,
8656 { "LCM Version", "dhcp.option.vendor.pxeclient.lcm_version",
8657 FT_UINT32, BASE_DEC, NULL, 0x0,
8658 "Option 43:PXE Client 193 LCM Version", HFILL }},
8660 { &hf_dhcp_option43_pxeclient_lcm_serial,
8661 { "LCM Serial Number", "dhcp.option.vendor.pxeclient.lcm_serial",
8662 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8663 "Option 43:PXE Client 194 LCM Serial Number", HFILL }},
8665 { &hf_dhcp_option43_pxeclient_end,
8666 { "PXE Client End", "dhcp.option.vendor.pxeclient.end",
8667 FT_UINT8, BASE_DEC, NULL, 0x0,
8668 "Option 43:PXE Client 255 End", HFILL }},
8671 /* AEROHIVE (Extremenetworks) vendor suboptions */
8672 { &hf_dhcp_option43_aerohive_suboption,
8673 { "Option 43 Suboption", "dhcp.option.vendor.aerohive.suboption",
8674 FT_UINT8, BASE_DEC, VALS(option43_aerohive_suboption_vals), 0x0,
8675 "Option 43:AEROHIVE Suboption", HFILL }},
8677 { &hf_dhcp_option43_aerohive_unknown,
8678 { "Unknown", "dhcp.option.vendor.aerohive.unknown",
8679 FT_BYTES, BASE_NONE, NULL, 0x0,
8680 NULL, HFILL }},
8682 { &hf_dhcp_option43_aerohive_xiqhostname,
8683 { "HM FQDN", "dhcp.option.vendor.aerohive.xiqhostname",
8684 FT_STRING, BASE_NONE, NULL, 0x0,
8685 "Hive Manager NG FQDN", HFILL }},
8687 { &hf_dhcp_option43_aerohive_xiqipaddress,
8688 { "HM IP", "dhcp.option.vendor.aerohive.xiqipaddress",
8689 FT_IPv4, BASE_NONE, NULL, 0x0,
8690 "Hive Manager NG IP address", HFILL }},
8693 { &hf_dhcp_option43_cl_suboption,
8694 { "Option 43 Suboption", "dhcp.option.vendor.cl.suboption",
8695 FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
8696 "Option 43:CL Suboption", HFILL }},
8698 { &hf_dhcp_option43_cl_padding,
8699 { "Padding", "dhcp.option.vendor.cl.padding",
8700 FT_UINT8, BASE_DEC, NULL, 0x0,
8701 "Option 43:CL 0 Padding", HFILL }},
8703 { &hf_dhcp_option43_cl_suboption_request_list,
8704 { "Suboption Request List", "dhcp.option.vendor.cl.suboption_request_list",
8705 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8706 "Option 43:CL 1 Suboption Request List", HFILL }},
8708 { &hf_dhcp_option43_cl_device_type,
8709 { "Device Type", "dhcp.option.vendor.cl.device_type",
8710 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8711 "Option 43:CL 2 Device Type", HFILL }},
8713 { &hf_dhcp_option43_cl_esafe_type,
8714 { "eSAFE Types", "dhcp.option.vendor.cl.esafe_type",
8715 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8716 "Option 43:CL 3 eSAFE Types", HFILL }},
8718 { &hf_dhcp_option43_cl_serial_number,
8719 { "Serial Number", "dhcp.option.vendor.cl.serial_number",
8720 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8721 "Option 43:CL 4 Serial Number", HFILL }},
8723 { &hf_dhcp_option43_cl_hardware_version,
8724 { "Hardware Version", "dhcp.option.vendor.cl.hardware_version",
8725 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8726 "Option 43:CL 5 Hardware Version", HFILL }},
8728 { &hf_dhcp_option43_cl_software_version,
8729 { "Software Version", "dhcp.option.vendor.cl.software_version",
8730 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8731 "Option 43:CL 6 Software Version", HFILL }},
8733 { &hf_dhcp_option43_cl_boot_rom_version,
8734 { "Boot ROM version", "dhcp.option.vendor.cl.boot_rom_version",
8735 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8736 "Option 43:CL 7 Boot ROM version", HFILL }},
8738 { &hf_dhcp_option43_cl_oui_string,
8739 { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_string",
8740 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8741 "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8743 { &hf_dhcp_option43_cl_oui_bytes,
8744 { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_bytes",
8745 FT_BYTES, BASE_NONE, NULL, 0x0,
8746 "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8748 { &hf_dhcp_option43_cl_model_number,
8749 { "Model Number", "dhcp.option.vendor.cl.model_number",
8750 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8751 "Option 43:CL 9 Model Number", HFILL }},
8753 { &hf_dhcp_option43_cl_vendor_name10,
8754 { "Vendor Name", "dhcp.option.vendor.cl.vendor_name10",
8755 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8756 "Option 43:CL 10 Vendor Name", HFILL }},
8758 { &hf_dhcp_option43_cl_address_realm,
8759 { "Address Realm", "dhcp.option.vendor.cl.address_realm",
8760 FT_UINT8, BASE_DEC, VALS(cablehome_subopt11_vals), 0x0,
8761 "Option 43:CL 11 Address Realm", HFILL }},
8763 { &hf_dhcp_option43_cl_cm_ps_system_desc,
8764 { "CM/PS System Description", "dhcp.option.vendor.cl.cm_ps_system_desc",
8765 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8766 "Option 43:CL 12 CM/PS System Description", HFILL }},
8768 { &hf_dhcp_option43_cl_cm_ps_firmware_revision,
8769 { "CM/PS Firmware Revision", "dhcp.option.vendor.cl.cm_ps_firmware_revision",
8770 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8771 "Option 43:CL 13 CM/PS Firmware Revision", HFILL }},
8773 { &hf_dhcp_option43_cl_firewall_policy_file_version,
8774 { "Firewall Policy File Version", "dhcp.option.vendor.cl.firewall_policy_file_version",
8775 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8776 "Option 43:CL 14 Firewall Policy File Version", HFILL }},
8778 { &hf_dhcp_option43_cl_esafe_config_file_devices,
8779 { "eSafe Config File Devices", "dhcp.option.vendor.cl.esafe_config_file_devices",
8780 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8781 "Option 43:CL 15 eSafe Config File Devices", HFILL }},
8783 { &hf_dhcp_option43_cl_video_security_tape,
8784 { "Video Security Type", "dhcp.option.vendor.cl.video_security_tape",
8785 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8786 "Option 43:CL 18 Video Security Type", HFILL }},
8788 { &hf_dhcp_option43_cl_mta_mac_address,
8789 { "MTA MAC Address", "dhcp.option.vendor.cl.mta_mac_address",
8790 FT_ETHER, BASE_NONE, NULL, 0x0,
8791 "Option 43:CL 31 MTA MAC Address", HFILL }},
8793 { &hf_dhcp_option43_cl_correlation_ID,
8794 { "Correlation ID", "dhcp.option.vendor.cl.correlation_ID",
8795 FT_UINT32, BASE_DEC, NULL, 0x0,
8796 "Option 43: CL 32 Correlation ID", HFILL }},
8798 { &hf_dhcp_option43_cl_vendor_name51,
8799 { "Vendor Name", "dhcp.option.vendor.cl.vendor_name51",
8800 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8801 "Option 43:CL 51 Vendor Name", HFILL }},
8803 { &hf_dhcp_option43_cl_cablecard_capability,
8804 { "CableCARD Capability", "dhcp.option.vendor.cl.cablecard_capability",
8805 FT_BYTES, BASE_NONE, NULL, 0x0,
8806 "Option 43:CL 52 CableCARD Capability", HFILL }},
8808 { &hf_dhcp_option43_cl_device_id_ca,
8809 { "Device Identification (CA)", "dhcp.option.vendor.cl.device_id_ca",
8810 FT_BYTES, BASE_NONE, NULL, 0x0,
8811 "Option 43:CL 53 Device Identification (CA)", HFILL }},
8813 { &hf_dhcp_option43_cl_device_id_x509,
8814 { "Device Identification (X.509)", "dhcp.option.vendor.cl.device_id_x509",
8815 FT_STRINGZ, BASE_NONE, NULL, 0x0,
8816 "Option 43:CL 54 Device Identification (X.509)", HFILL }},
8818 { &hf_dhcp_option43_cl_end,
8819 { "CL End", "dhcp.option.vendor.cl.end",
8820 FT_UINT8, BASE_DEC, NULL, 0x0,
8821 "Option 43:CL 255 End", HFILL }},
8824 { &hf_dhcp_option43_alcatel_suboption,
8825 { "Option 43 Suboption", "dhcp.option.vendor.alu.suboption",
8826 FT_UINT8, BASE_DEC, VALS(option43_alcatel_suboption_vals), 0x0,
8827 "Option 43:Alcatel Suboption", HFILL }},
8829 { &hf_dhcp_option43_alcatel_padding,
8830 { "Padding", "dhcp.option.vendor.alu.padding",
8831 FT_UINT8, BASE_DEC, NULL, 0x0,
8832 "Option 43:Alcatel 0 Padding", HFILL }},
8834 { &hf_dhcp_option43_alcatel_vlan_id,
8835 { "Voice VLAN ID", "dhcp.option.vendor.alu.vid",
8836 FT_UINT16, BASE_DEC, NULL, 0x0,
8837 "Option 43:Alcatel 58 Voice VLAN ID", HFILL }},
8839 { &hf_dhcp_option43_alcatel_tftp1,
8840 { "Spatial Redundancy TFTP1", "dhcp.option.vendor.alu.tftp1",
8841 FT_IPv4, BASE_NONE, NULL, 0x0,
8842 "Option 43:Alcatel 64 Spatial Redundancy TFTP1", HFILL }},
8844 { &hf_dhcp_option43_alcatel_tftp2,
8845 { "Spatial Redundancy TFTP2", "dhcp.option.vendor.alu.tftp2",
8846 FT_IPv4, BASE_NONE, NULL, 0x0,
8847 "Option 43:Alcatel 65 Spatial Redundancy TFTP2", HFILL }},
8849 { &hf_dhcp_option43_alcatel_app_type,
8850 { "Application Type", "dhcp.option.vendor.alu.app_type",
8851 FT_UINT8, BASE_DEC, VALS(option43_alcatel_app_type_vals), 0x0,
8852 "Option 43:Alcatel 66 Application Type", HFILL }},
8854 { &hf_dhcp_option43_alcatel_sip_url,
8855 { "SIP URL", "dhcp.option.vendor.alu.sip_url",
8856 FT_STRING, BASE_NONE, NULL, 0x0,
8857 "Option 43:Alcatel 67 SIP URL", HFILL }},
8859 { &hf_dhcp_option43_alcatel_end,
8860 { "Alcatel End", "dhcp.option.vendor.alu.end",
8861 FT_UINT8, BASE_DEC, NULL, 0x0,
8862 "Option 43:Alcatel 255 End", HFILL }},
8864 { &hf_dhcp_option43_arubaap_controllerip,
8865 { "Aruba Controller IP", "dhcp.option.vendor.arubaap.controllerip",
8866 FT_STRING, BASE_NONE, NULL, 0x0,
8867 "Address IP of Aruba controller", HFILL }},
8869 { &hf_dhcp_option43_arubaiap,
8870 { "Aruba Instant AP", "dhcp.option.vendor.arubaiap",
8871 FT_STRING, BASE_NONE, NULL, 0x0,
8872 "nameorg,amp-ip-address,password", HFILL }},
8874 { &hf_dhcp_option43_arubaiap_nameorg,
8875 { "Name Organisation", "dhcp.option.vendor.arubaiap.name_org",
8876 FT_STRING, BASE_NONE, NULL, 0x0,
8877 NULL, HFILL }},
8879 { &hf_dhcp_option43_arubaiap_ampip,
8880 { "AMP IP Address", "dhcp.option.vendor.arubaiap.amp_ip",
8881 FT_STRING, BASE_NONE, NULL, 0x0,
8882 "Address IP of Airwave server (AMP)", HFILL }},
8884 { &hf_dhcp_option43_arubaiap_password,
8885 { "Password", "dhcp.option.vendor.arubaiap.password",
8886 FT_STRING, BASE_NONE, NULL, 0x0,
8887 "Password for Instant AP Airwave server (AMP)", HFILL }},
8890 { &hf_dhcp_option43_bsdp_suboption,
8891 { "Option 43 Suboption", "dhcp.option.vendor.bsdp.suboption",
8892 FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
8893 "Option 43:BSDP Suboption", HFILL }},
8895 { &hf_dhcp_option43_bsdp_message_type,
8896 { "Message Type", "dhcp.option.vendor.bsdp.message_type",
8897 FT_UINT8, BASE_DEC, VALS(o43_bsdp_message_type_vals), 0x0,
8898 NULL, HFILL }},
8900 { &hf_dhcp_option43_bsdp_version,
8901 { "Version", "dhcp.option.vendor.bsdp.version",
8902 FT_UINT16, BASE_HEX, NULL, 0x0,
8903 NULL, HFILL }},
8905 { &hf_dhcp_option43_bsdp_server_identifier,
8906 { "Server Identifier", "dhcp.option.vendor.bsdp.server_identifier",
8907 FT_IPv4, BASE_NONE, NULL, 0x0,
8908 NULL, HFILL }},
8910 { &hf_dhcp_option43_bsdp_server_priority,
8911 { "Server Priority", "dhcp.option.vendor.bsdp.server_priority",
8912 FT_UINT16, BASE_DEC, NULL, 0x0,
8913 NULL, HFILL }},
8915 { &hf_dhcp_option43_bsdp_reply_port,
8916 { "Reply Port", "dhcp.option.vendor.bsdp.reply_port",
8917 FT_UINT16, BASE_DEC, NULL, 0x0,
8918 NULL, HFILL }},
8920 { &hf_dhcp_option43_bsdp_boot_image_list_path,
8921 { "Boot Image List Path", "dhcp.option.vendor.bsdp.boot_image_list_path",
8922 FT_STRING, BASE_NONE, NULL, 0x0,
8923 NULL, HFILL }},
8925 { &hf_dhcp_option43_bsdp_boot_image_index,
8926 { "Boot Image Index", "dhcp.option.vendor.bsdp.boot_image.index",
8927 FT_UINT16, BASE_HEX, NULL, 0x0,
8928 NULL, HFILL }},
8930 { &hf_dhcp_option43_bsdp_default_boot_image_id,
8931 { "Default Boot Image ID", "dhcp.option.vendor.bsdp.default_boot_image_id",
8932 FT_UINT32, BASE_HEX, NULL, 0x0,
8933 NULL, HFILL }},
8935 { &hf_dhcp_option43_bsdp_selected_boot_image_id,
8936 { "Selected Boot Image ID", "dhcp.option.vendor.bsdp.selected_boot_image_id",
8937 FT_UINT32, BASE_HEX, NULL, 0x0,
8938 NULL, HFILL }},
8940 { &hf_dhcp_option43_bsdp_boot_image_list,
8941 { "Boot Image List", "dhcp.option.vendor.bsdp.boot_image_list",
8942 FT_BYTES, BASE_NONE, NULL, 0x0,
8943 NULL, HFILL }},
8945 { &hf_dhcp_option43_bsdp_image_desc,
8946 { "Boot Image Description", "dhcp.option.vendor.bsdp.boot_image.desc",
8947 FT_BYTES, BASE_NONE, NULL, 0x0,
8948 NULL, HFILL }},
8950 { &hf_dhcp_option43_bsdp_boot_image_name_len,
8951 { "Boot Image Name Length", "dhcp.option.vendor.bsdp.boot_image.name_len",
8952 FT_UINT8, BASE_DEC, NULL, 0x0,
8953 NULL, HFILL }},
8955 { &hf_dhcp_option43_bsdp_boot_image_name,
8956 { "Boot Image Name", "dhcp.option.vendor.bsdp.boot_image.name",
8957 FT_STRING, BASE_NONE, NULL, 0x0,
8958 NULL, HFILL }},
8960 { &hf_dhcp_option43_bsdp_netboot_firmware,
8961 { "NetBoot 1.0 Firmware", "dhcp.option.vendor.bsdp.netboot_firmware",
8962 FT_NONE, BASE_NONE, NULL, 0x0,
8963 NULL, HFILL }},
8965 { &hf_dhcp_option43_bsdp_attributes_filter_list,
8966 { "Boot Image Attributes Filter List", "dhcp.option.vendor.bsdp.attributes_filter_list",
8967 FT_BYTES, BASE_NONE, NULL, 0x0,
8968 NULL, HFILL }},
8970 { &hf_dhcp_option43_bsdp_boot_image_attribute,
8971 { "Boot Image Attribute", "dhcp.option.vendor.bsdp.boot_image.attribute",
8972 FT_UINT16, BASE_HEX, NULL, 0x0,
8973 NULL, HFILL }},
8975 { &hf_dhcp_option43_bsdp_boot_image_attribute_install,
8976 { "Install", "dhcp.option.vendor.bsdp.boot_image.attribute.install",
8977 FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_install_vals), 0x8000,
8978 "Boot Image Attribute Install", HFILL }},
8980 { &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
8981 { "Kind", "dhcp.option.vendor.bsdp.boot_image.attribute.kind",
8982 FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_kind_vals), 0x7f00,
8983 "Boot Image Attribute Kind", HFILL }},
8985 { &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
8986 { "Reserved", "dhcp.option.vendor.bsdp.boot_image.attribute.reserved",
8987 FT_UINT16, BASE_HEX, NULL, 0x00ff,
8988 "Boot Image Attribute Reserved", HFILL }},
8990 { &hf_dhcp_option43_bsdp_message_size,
8991 { "Message Size", "dhcp.option.vendor.bsdp.message_size",
8992 FT_UINT16, BASE_DEC, NULL, 0x0,
8993 NULL, HFILL }},
8996 { &hf_dhcp_option_netbios_over_tcpip_name_server,
8997 { "NetBIOS over TCP/IP Name Server", "dhcp.option.netbios_over_tcpip_name_server",
8998 FT_IPv4, BASE_NONE, NULL, 0x00,
8999 "Option 44: NetBIOS over TCP/IP Name Server", HFILL }},
9001 { &hf_dhcp_option_netbios_over_tcpip_dd_name_server,
9002 { "NetBIOS over TCP/IP Datagram Distribution Name Server", "dhcp.option.netbios_over_tcpip_dd_name_server",
9003 FT_IPv4, BASE_NONE, NULL, 0x00,
9004 "Option 45: NetBIOS over TCP/IP Datagram Distribution Name Server", HFILL }},
9006 { &hf_dhcp_option_netbios_over_tcpip_node_type,
9007 { "NetBIOS over TCP/IP Node Type", "dhcp.option.netbios_over_tcpip_node_type",
9008 FT_UINT8, BASE_DEC, VALS(dhcp_nbnt_vals), 0x0,
9009 "Option 46: NetBIOS over TCP/IP Node Type", HFILL }},
9011 { &hf_dhcp_option_netbios_over_tcpip_scope,
9012 { "NetBIOS over TCP/IP Scope", "dhcp.option.netbios_over_tcpip_scope",
9013 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9014 "Option 47: NetBIOS over TCP/IP Scope", HFILL }},
9016 { &hf_dhcp_option_xwindows_system_font_server,
9017 { "X Window System Font Server", "dhcp.option.xwindows_system_font_server",
9018 FT_IPv4, BASE_NONE, NULL, 0x00,
9019 "Option 48: X Window System Font Server", HFILL }},
9021 { &hf_dhcp_option_xwindows_system_display_manager,
9022 { "X Window System Display Manager", "dhcp.option.xwindows_system_display_manager",
9023 FT_IPv4, BASE_NONE, NULL, 0x00,
9024 "Option 49: X Window System Display Manager", HFILL }},
9026 { &hf_dhcp_option_requested_ip_address,
9027 { "Requested IP Address", "dhcp.option.requested_ip_address",
9028 FT_IPv4, BASE_NONE, NULL, 0x00,
9029 "Option 50: Requested IP Address", HFILL }},
9031 { &hf_dhcp_option_ip_address_lease_time,
9032 { "IP Address Lease Time", "dhcp.option.ip_address_lease_time",
9033 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9034 "Option 51: IP Address Lease Time", HFILL }},
9036 { &hf_dhcp_option_option_overload,
9037 { "Option Overload", "dhcp.option.option_overload",
9038 FT_UINT8, BASE_DEC, VALS(opt_overload_vals), 0x0,
9039 "Option 52: Option Overload", HFILL }},
9041 { &hf_dhcp_option_dhcp,
9042 { "DHCP", "dhcp.option.dhcp",
9043 FT_UINT8, BASE_DEC, VALS(opt53_text), 0x0,
9044 "Option 53: DHCP option", HFILL }},
9046 { &hf_dhcp_option_dhcp_server_id,
9047 { "DHCP Server Identifier", "dhcp.option.dhcp_server_id",
9048 FT_IPv4, BASE_NONE, NULL, 0x00,
9049 "Option 54: DHCP Server Identifier", HFILL }},
9051 { &hf_dhcp_option_parameter_request_list_item,
9052 { "Parameter Request List Item", "dhcp.option.request_list_item",
9053 FT_UINT8, BASE_DEC, NULL, 0x0,
9054 "Option 55: Parameter Request List Item", HFILL }},
9056 { &hf_dhcp_option_message,
9057 { "Message", "dhcp.option.message",
9058 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9059 "Option 56: Option message", HFILL }},
9061 { &hf_dhcp_option_dhcp_max_message_size,
9062 { "Maximum DHCP Message Size", "dhcp.option.dhcp_max_message_size",
9063 FT_UINT16, BASE_DEC, NULL, 0x0,
9064 "Option 57: Maximum DHCP Message Size", HFILL }},
9066 { &hf_dhcp_option_renewal_time_value,
9067 { "Renewal Time Value", "dhcp.option.renewal_time_value",
9068 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9069 "Option 58: Renewal Time Value", HFILL }},
9071 { &hf_dhcp_option_rebinding_time_value,
9072 { "Rebinding Time Value", "dhcp.option.rebinding_time_value",
9073 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9074 "Option 59: Rebinding Time Value", HFILL }},
9076 { &hf_dhcp_option_vendor_class_id,
9077 { "Vendor class identifier", "dhcp.option.vendor_class_id",
9078 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9079 "Option 60: Vendor class identifier", HFILL }},
9081 { &hf_dhcp_option_vendor_class_data,
9082 { "vendor-class-data", "dhcp.option.vendor_class_data",
9083 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9084 "Option 60: Vendor class data", HFILL }},
9086 { &hf_dhcp_option_novell_netware_ip_domain,
9087 { "Novell/Netware IP domain", "dhcp.option.novell_netware_ip_domain",
9088 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9089 "Option 62: Novell/Netware IP domain", HFILL }},
9091 { &hf_dhcp_option63_suboption,
9092 { "Option 63 Suboption", "dhcp.option.novell_options.suboption",
9093 FT_UINT8, BASE_DEC, VALS(option63_suboption_vals), 0x0,
9094 "Option 63: Suboption", HFILL }},
9096 { &hf_dhcp_option63_value,
9097 { "Value", "dhcp.option.novell_options.value",
9098 FT_BYTES, BASE_NONE, NULL, 0x0,
9099 "Option 63: Suboption value", HFILL }},
9101 { &hf_dhcp_option63_value_8,
9102 { "Value", "dhcp.option.novell_options.value.uint",
9103 FT_UINT8, BASE_DEC, NULL, 0x0,
9104 "Option 63: Suboption 8-bit value", HFILL }},
9106 { &hf_dhcp_option63_value_ip_address,
9107 { "Value", "dhcp.option.novell_options.value.address",
9108 FT_IPv4, BASE_NONE, NULL, 0x00,
9109 "Option 63: Suboption IP address", HFILL }},
9111 { &hf_dhcp_option63_value_boolean,
9112 { "Value", "dhcp.option.novell_options.value.bool",
9113 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
9114 "Option 63: Suboption Boolean value", HFILL }},
9116 { &hf_dhcp_option63_broadcast,
9117 { "Broadcast for nearest Netware server", "dhcp.option.novell_options.broadcast",
9118 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9119 "Option 63:5 Broadcast for nearest Netware server", HFILL }},
9121 { &hf_dhcp_option63_preferred_dss_server,
9122 { "Preferred DSS server", "dhcp.option.novell_options.preferred_dss_server",
9123 FT_IPv4, BASE_NONE, NULL, 0x00,
9124 "Option 63:6 Preferred DSS server", HFILL }},
9126 { &hf_dhcp_option63_nearest_nwip_server,
9127 { "Nearest NWIP server", "dhcp.option.novell_options.nearest_nwip_server",
9128 FT_IPv4, BASE_NONE, NULL, 0x00,
9129 "Option 63:7 Nearest NWIP server", HFILL }},
9131 { &hf_dhcp_option63_autoretries,
9132 { "Autoretries", "dhcp.option.novell_options.autoretries",
9133 FT_UINT8, BASE_DEC, NULL, 0x0,
9134 "Option 63:8 Autoretries", HFILL }},
9136 { &hf_dhcp_option63_autoretry_delay,
9137 { "Autoretry delay, sec",
9138 "dhcp.option.novell_options.autoretry_delay", FT_UINT8, BASE_DEC, NULL,
9139 0x0, "Option 63:9 Autoretry delay, sec", HFILL }},
9141 { &hf_dhcp_option63_support_netware_v1_1,
9142 { "Broadcast for nearest Netware server", "dhcp.option.novell_options.support_netware_v1_1",
9143 FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9144 "Option 63:10 Broadcast for nearest Netware server", HFILL }},
9146 { &hf_dhcp_option63_primary_dss,
9147 { "Primary DSS", "dhcp.option.novell_options.primary_dss",
9148 FT_IPv4, BASE_NONE, NULL, 0x00,
9149 "Option 63:11 Primary DSS", HFILL }},
9152 { &hf_dhcp_option_nis_plus_domain,
9153 { "Network Information Service+ Domain", "dhcp.option.nis_plus_domain",
9154 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9155 "Option 64: Network Information Service+ Domain", HFILL }},
9157 { &hf_dhcp_option_nis_plus_server,
9158 { "Network Information Service+ Server", "dhcp.option.nis_plus_server",
9159 FT_IPv4, BASE_NONE, NULL, 0x00,
9160 "Option 65: Network Information Service+ Server", HFILL }},
9162 { &hf_dhcp_option_tftp_server_name,
9163 { "TFTP Server Name", "dhcp.option.tftp_server_name",
9164 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9165 "Option 66: TFTP Server Name", HFILL }},
9167 { &hf_dhcp_option_bootfile_name,
9168 { "Bootfile name", "dhcp.option.bootfile_name",
9169 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9170 "Option 67: Bootfile name", HFILL }},
9172 { &hf_dhcp_option_mobile_ip_home_agent,
9173 { "Mobile IP Home Agent", "dhcp.option.mobile_ip_home_agent",
9174 FT_IPv4, BASE_NONE, NULL, 0x00,
9175 "Option 68: Mobile IP Home Agent", HFILL }},
9177 { &hf_dhcp_option_smtp_server,
9178 { "SMTP Server", "dhcp.option.smtp_server",
9179 FT_IPv4, BASE_NONE, NULL, 0x00,
9180 "Option 69: SMTP Server", HFILL }},
9182 { &hf_dhcp_option_pop3_server,
9183 { "POP3 Server", "dhcp.option.pop3_server",
9184 FT_IPv4, BASE_NONE, NULL, 0x00,
9185 "Option 70: POP3 Server", HFILL }},
9187 { &hf_dhcp_option_nntp_server,
9188 { "NNTP Server", "dhcp.option.nntp_server",
9189 FT_IPv4, BASE_NONE, NULL, 0x00,
9190 "Option 71: NNTP Server", HFILL }},
9192 { &hf_dhcp_option_default_www_server,
9193 { "Default WWW Server", "dhcp.option.default_www_server",
9194 FT_IPv4, BASE_NONE, NULL, 0x00,
9195 "Option 72: Default WWW Server", HFILL }},
9197 { &hf_dhcp_option_default_finger_server,
9198 { "Default Finger Server", "dhcp.option.default_finger_server",
9199 FT_IPv4, BASE_NONE, NULL, 0x00,
9200 "Option 73: Default Finger Server", HFILL }},
9202 { &hf_dhcp_option_default_irc_server,
9203 { "Default IRC Server", "dhcp.option.default_irc_server",
9204 FT_IPv4, BASE_NONE, NULL, 0x00,
9205 "Option 74: Default IRC Server", HFILL }},
9207 { &hf_dhcp_option_streettalk_server,
9208 { "StreetTalk Server", "dhcp.option.streettalk_server",
9209 FT_IPv4, BASE_NONE, NULL, 0x00,
9210 "Option 75: StreetTalk Server", HFILL }},
9212 { &hf_dhcp_option_streettalk_da_server,
9213 { "StreetTalk Directory Assistance Server", "dhcp.option.streettalk_da_server",
9214 FT_IPv4, BASE_NONE, NULL, 0x00,
9215 "Option 76: StreetTalk Directory Assistance Server", HFILL }},
9217 { &hf_dhcp_option77_user_class,
9218 { "Instance of User Class", "dhcp.option.user_class",
9219 FT_UINT8, BASE_DEC, NULL, 0x0,
9220 NULL, HFILL }},
9222 { &hf_dhcp_option77_user_class_length,
9223 { "User Class Length", "dhcp.option.user_class.length",
9224 FT_UINT8, BASE_DEC, NULL, 0x0,
9225 "Length of User Class Instance", HFILL }},
9227 { &hf_dhcp_option77_user_class_data,
9228 { "User Class Data", "dhcp.option.user_class.data",
9229 FT_BYTES, BASE_NONE, NULL, 0x0,
9230 "Data of User Class Instance", HFILL }},
9232 { &hf_dhcp_option77_user_class_text,
9233 { "User Class Data (Text)", "dhcp.option.user_class.text",
9234 FT_STRING, BASE_NONE, NULL, 0x0,
9235 "Text of User Class Instance", HFILL }},
9237 { &hf_dhcp_option77_user_class_binary_data_length,
9238 { "User Class Binary Data Length", "dhcp.option.user_class_binary_data_length",
9239 FT_UINT16, BASE_DEC, NULL, 0x0,
9240 "Length of User Class Binary Data (Microsoft)", HFILL }},
9242 { &hf_dhcp_option77_user_class_binary_data,
9243 { "User Class Binary Data", "dhcp.option.user_class_binary_data",
9244 FT_STRING, BASE_NONE, NULL, 0x0,
9245 "User Class Binary Data (Microsoft)", HFILL }},
9247 { &hf_dhcp_option77_user_class_padding,
9248 { "User Class padding", "dhcp.option.user_class_padding",
9249 FT_BYTES, BASE_NONE, NULL, 0x0,
9250 "User Class padding (Microsoft)", HFILL }},
9252 { &hf_dhcp_option77_user_class_name_length,
9253 { "User Class Name Length", "dhcp.option.user_class_name_length",
9254 FT_UINT16, BASE_DEC, NULL, 0x0,
9255 "Length of User Class Name (Microsoft)", HFILL }},
9257 { &hf_dhcp_option77_user_class_name,
9258 { "User Class Name", "dhcp.option.user_class_name",
9259 FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9260 "User Class Name (Microsoft)", HFILL }},
9262 { &hf_dhcp_option77_user_class_description_length,
9263 { "User Class Description Length", "dhcp.option.user_class_description_length",
9264 FT_UINT16, BASE_DEC, NULL, 0x0,
9265 "Length of User Class Description (Microsoft)", HFILL }},
9267 { &hf_dhcp_option77_user_class_description,
9268 { "User Class Description", "dhcp.option.user_class_description",
9269 FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9270 "User Class Description (Microsoft)", HFILL }},
9272 { &hf_dhcp_option_slp_directory_agent_value,
9273 { "Value", "dhcp.option.slp_directory_agent.value",
9274 FT_UINT8, BASE_DEC, VALS(slpda_vals), 0x0,
9275 "Option 78: SLPDA Value", HFILL }},
9277 { &hf_dhcp_option_slp_directory_agent_slpda_address,
9278 { "IP Address", "dhcp.option.slp_directory_agent.slpda_address",
9279 FT_IPv4, BASE_NONE, NULL, 0x00,
9280 "Option 78: SLPDA Address", HFILL }},
9282 { &hf_dhcp_option_slp_service_scope_value,
9283 { "Value", "dhcp.option.slp_service_scope.value",
9284 FT_UINT8, BASE_DEC, VALS(slp_scope_vals), 0x0,
9285 "Option 79: SLP Service Scope Value", HFILL }},
9287 { &hf_dhcp_option_slp_service_scope_string,
9288 { "SLP Service Scope", "dhcp.option.slp_service_scope.string",
9289 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9290 "Option 79: SLP Service Scope", HFILL }},
9293 { &hf_dhcp_option82_suboption,
9294 { "Option 82 Suboption", "dhcp.option.agent_information_option.suboption",
9295 FT_UINT8, BASE_DEC, VALS(option82_suboption_vals), 0x0,
9296 "Option 82: Suboption", HFILL }},
9298 { &hf_dhcp_option82_value,
9299 { "Value", "dhcp.option.agent_information_option.value",
9300 FT_BYTES, BASE_NONE, NULL, 0x0,
9301 "Option 82: Suboption value", HFILL }},
9303 { &hf_dhcp_option82_value_8,
9304 { "Value", "dhcp.option.agent_information_option.value.uint",
9305 FT_UINT8, BASE_DEC, NULL, 0x0,
9306 "Option 82: Suboption 8-bit value", HFILL }},
9308 { &hf_dhcp_option82_value_16,
9309 { "Value", "dhcp.option.agent_information_option.value.uint",
9310 FT_UINT16, BASE_DEC, NULL, 0x0,
9311 "Option 162: Suboption 16-bit value", HFILL }},
9313 { &hf_dhcp_option82_value_32,
9314 { "Value", "dhcp.option.agent_information_option.value.uint",
9315 FT_UINT32, BASE_DEC, NULL, 0x0,
9316 "Option 82: Suboption 32-bit value", HFILL }},
9318 { &hf_dhcp_option82_value_ip_address,
9319 { "Value", "dhcp.option.agent_information_option.value.address",
9320 FT_IPv4, BASE_NONE, NULL, 0x00,
9321 "Option 82: Suboption IP address", HFILL }},
9323 { &hf_dhcp_option82_value_stringz,
9324 { "Value", "dhcp.option.agent_information_option.value.string",
9325 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9326 "Option 82: Suboption Z-String value", HFILL }},
9328 { &hf_dhcp_option82_padding,
9329 { "Padding", "dhcp.option.agent_information_option.padding",
9330 FT_UINT8, BASE_DEC, NULL, 0x0,
9331 "Option 82:0 Padding", HFILL }},
9333 { &hf_dhcp_option82_agent_circuit_id,
9334 { "Agent Circuit ID", "dhcp.option.agent_information_option.agent_circuit_id",
9335 FT_BYTES, BASE_NONE, NULL, 0x0,
9336 "Option 82:1 Agent Circuit ID", HFILL }},
9338 { &hf_dhcp_option82_agent_remote_id,
9339 { "Agent Remote ID", "dhcp.option.agent_information_option.agent_remote_id",
9340 FT_BYTES, BASE_NONE, NULL, 0x0,
9341 "Option 82:2 Agent Remote ID", HFILL }},
9343 { &hf_dhcp_option82_reserved,
9344 { "Reserved", "dhcp.option.agent_information_option.reserved",
9345 FT_BYTES, BASE_NONE, NULL, 0x0,
9346 "Option 82:3 Reserved", HFILL }},
9348 { &hf_dhcp_option82_docsis_device_class,
9349 { "DOCSIS Device Class", "dhcp.option.agent_information_option.docsis_device_class",
9350 FT_UINT32, BASE_HEX, NULL, 0x0,
9351 "Option 82:4 DOCSIS Device Class", HFILL }},
9353 { &hf_dhcp_option82_link_selection,
9354 { "Link selection", "dhcp.option.agent_information_option.link_selection",
9355 FT_IPv4, BASE_NONE, NULL, 0x00,
9356 "Option 82:5 Link selection", HFILL }},
9358 { &hf_dhcp_option82_subscriber_id,
9359 { "Subscriber ID", "dhcp.option.agent_information_option.subscriber_id",
9360 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9361 "Option 82:6 Subscriber ID", HFILL }},
9363 { &hf_dhcp_option82_radius_attributes,
9364 { "RADIUS Attributes", "dhcp.option.agent_information_option.radius_attributes",
9365 FT_BYTES, BASE_NONE, NULL, 0x0,
9366 "Option 82:7 RADIUS Attributes", HFILL }},
9368 { &hf_dhcp_option82_authentication,
9369 { "Authentication", "dhcp.option.agent_information_option.authentication",
9370 FT_BYTES, BASE_NONE, NULL, 0x0,
9371 "Option 82:8 Authentication", HFILL }},
9373 { &hf_dhcp_option82_vi,
9374 { "Vendor-Specific Information", "dhcp.option.agent_information_option.vi",
9375 FT_BYTES, BASE_NONE, NULL, 0x0,
9376 "Option 82:9 Vendor-Specific Information", HFILL }},
9378 { &hf_dhcp_option82_vi_enterprise,
9379 { "Enterprise", "dhcp.option.agent_information_option.vi.enterprise",
9380 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
9381 "Option 82:9 VI Enterprise", HFILL }},
9383 { &hf_dhcp_option82_vi_data_length,
9384 { "Data Length", "dhcp.option.agent_information_option.vi.data_length",
9385 FT_UINT8, BASE_DEC, NULL, 0x0,
9386 "Option 82:9 VI Data Length", HFILL }},
9388 { &hf_dhcp_option82_vi_cl_option,
9389 { "Option", "dhcp.option.agent_information_option.vi.cl.option",
9390 FT_UINT8, BASE_DEC, NULL, 0x0,
9391 "Option 82:9 VI CL Option", HFILL }},
9393 { &hf_dhcp_option82_vi_cl_option_length,
9394 { "Option Length", "dhcp.option.agent_information_option.vi.cl.option_length",
9395 FT_UINT8, BASE_DEC, NULL, 0x0,
9396 "Option 82:9 VI CL Option Length", HFILL }},
9398 { &hf_dhcp_option82_vi_cl_tag,
9399 { "Tag", "dhcp.option.agent_information_option.vi.cl.tag",
9400 FT_UINT8, BASE_DEC, VALS(option82_cl_tag_vals), 0x0,
9401 "Option 82:9 VI CL Tag", HFILL }},
9403 { &hf_dhcp_option82_vi_cl_tag_length,
9404 { "Tag Length", "dhcp.option.agent_information_option.vi.cl.tag_length",
9405 FT_UINT8, BASE_DEC, NULL, 0x0,
9406 "Option 82:9 VI CL Tag Length", HFILL }},
9408 { &hf_dhcp_option82_vi_cl_docsis_version,
9409 { "DOCSIS Version Number", "dhcp.option.agent_information_option.vi.cl.docsis_version",
9410 FT_UINT16, BASE_HEX, NULL, 0x0,
9411 "Option 82:9 VI CL DOCSIS Version Number", HFILL }},
9413 { &hf_dhcp_option82_vi_cl_dpoe_system_version,
9414 { "DPoE System Version Number", "dhcp.option.agent_information_option.vi.cl.dpoe_system_version",
9415 FT_UINT16, BASE_HEX, NULL, 0x0,
9416 "Option 82:9 VI CL DPoE System Version Number", HFILL }},
9418 { &hf_dhcp_option82_vi_cl_dpoe_system_pbb_service,
9419 { "DPoE System PBB Service", "dhcp.option.agent_information_option.vi.cl.dpoe_system_pbb_service",
9420 FT_BYTES, BASE_NONE, NULL, 0x0,
9421 "Option 82:9 VI CL DPoE System PBB Service", HFILL }},
9423 { &hf_dhcp_option82_vi_cl_service_class_name,
9424 { "Service Class Name", "dhcp.option.agent_information_option.vi.cl.service_class_name",
9425 FT_STRING, BASE_NONE, NULL, 0x0,
9426 "Option 82:9 VI CL Service Class Name", HFILL }},
9428 { &hf_dhcp_option82_vi_cl_mso_defined_text,
9429 { "MSO Defined Text", "dhcp.option.agent_information_option.vi.cl.mso_defined_text",
9430 FT_STRING, BASE_NONE, NULL, 0x0,
9431 "Option 82:9 VI CL MSO Defined Text", HFILL }},
9433 { &hf_dhcp_option82_vi_cl_secure_file_transfer_uri,
9434 { "Secure File Transfer URI", "dhcp.option.agent_information_option.vi.cl.secure_file_transfer_uri",
9435 FT_STRING, BASE_NONE, NULL, 0x0,
9436 "Option 82:9 VI CL Secure File Transfer URI", HFILL }},
9438 { &hf_dhcp_option82_flags,
9439 { "Flags", "dhcp.option.agent_information_option.flags",
9440 FT_UINT8, BASE_HEX, NULL, 0x0,
9441 "Option 82:10 Flags", HFILL }},
9443 { &hf_dhcp_option82_server_id_override,
9444 { "Server ID Override", "dhcp.option.agent_information_option.server_id_override",
9445 FT_IPv4, BASE_NONE, NULL, 0x00,
9446 "Option 82:11 Server ID Override", HFILL }},
9448 { &hf_dhcp_option82_relay_agent_id,
9449 { "Relay Agent Identifier", "dhcp.option.agent_information_option.relay_agent_id",
9450 FT_BYTES, BASE_NONE, NULL, 0x00,
9451 "Option 82:12 Relay Agent Identifier", HFILL }},
9453 { &hf_dhcp_option82_option_ani_att,
9454 { "Access Technology Type", "dhcp.option.agent_information_option.ani_att",
9455 FT_UINT8, BASE_DEC, NULL, 0x00,
9456 "Option 82:13 Access Technology Type", HFILL }},
9458 { &hf_dhcp_option82_option_ani_att_res,
9459 { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.res",
9460 FT_UINT8, BASE_DEC, NULL, 0x00,
9461 "Option 82:13 Access Technology Type Reserved", HFILL }},
9463 { &hf_dhcp_option82_option_ani_att_att,
9464 { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.att",
9465 FT_UINT8, BASE_DEC, NULL, 0x00,
9466 "Option 82:13 Access Technology Type Value", HFILL }},
9468 { &hf_dhcp_option82_option_ani_network_name,
9469 { "Access Network Name", "dhcp.option.agent_information_option.ani_network_name",
9470 FT_STRING, BASE_NONE, NULL, 0x00,
9471 "Option 82:14 Access Network Name", HFILL }},
9473 { &hf_dhcp_option82_option_ani_ap_name,
9474 { "Access Point Name", "dhcp.option.agent_information_option.ani_ap_name",
9475 FT_STRING, BASE_NONE, NULL, 0x00,
9476 "Option 82:15 Access Point Name", HFILL }},
9478 { &hf_dhcp_option82_option_ani_ap_bssid,
9479 { "Access Point BSSID", "dhcp.option.agent_information_option.ani_ap_bssid",
9480 FT_ETHER, BASE_NONE, NULL, 0x0,
9481 "Option 82:16 Access Point BSSID", HFILL }},
9483 { &hf_dhcp_option82_option_ani_operator_id,
9484 { "Access Network Operator ID", "dhcp.option.agent_information_option.ani_operator_id",
9485 FT_BYTES, BASE_NONE, NULL, 0x00,
9486 "Option 82:17 Access Network Operator ID", HFILL }},
9488 { &hf_dhcp_option82_option_ani_operator_realm,
9489 { "Access Network Operator Realm", "dhcp.option.agent_information_option.ani_operator_realm",
9490 FT_STRING, BASE_NONE, NULL, 0x00,
9491 "Option 82:18 Access Network Operator Realm", HFILL }},
9493 { &hf_dhcp_option82_option_source_port,
9494 { "Source Port", "dhcp.option.agent_information_option.source_port",
9495 FT_NONE, BASE_NONE, NULL, 0x00,
9496 "Option 82:19 Source Port", HFILL }},
9498 { &hf_dhcp_option82_link_selection_cisco,
9499 { "Link selection (Cisco proprietary)", "dhcp.option.agent_information_option.link_selection_cisco",
9500 FT_IPv4, BASE_NONE, NULL, 0x00,
9501 "Option 82:150 Link selection (Cisco proprietary)", HFILL }},
9503 { &hf_dhcp_option82_vrf_name_vpn_id,
9504 { "VRF name/VPN ID", "dhcp.option.agent_information_option.vrf_name.vpn_id",
9505 FT_BYTES, BASE_NONE, NULL, 0x00,
9506 "Option 82:151 VRF name/VPN ID", HFILL }},
9508 { &hf_dhcp_option82_vrf_name_global,
9509 { "Global, default VPN", "dhcp.option.agent_information_option.vrf_name.global",
9510 FT_UINT8, BASE_DEC, NULL, 0x00,
9511 "Option 82:151 Global, default VPN", HFILL }},
9513 { &hf_dhcp_option82_vrf_name,
9514 { "VRF name", "dhcp.option.agent_information_option.vrf_name",
9515 FT_STRING, BASE_NONE, NULL, 0x00,
9516 "Option 82:151 VRF name", HFILL }},
9518 { &hf_dhcp_option82_vrf_name_vpn_id_oui,
9519 { "VRF name/VPN ID OUI", "dhcp.option.agent_information_option.vrf_name.vpn_id.oui",
9520 FT_UINT24, BASE_HEX, NULL, 0x00,
9521 "Option 82:151 VRF name/VPN ID OUI", HFILL }},
9523 { &hf_dhcp_option82_vrf_name_vpn_id_index,
9524 { "VRF name/VPN ID Index", "dhcp.option.agent_information_option.vrf_name.vpn_id.index",
9525 FT_UINT32, BASE_HEX, NULL, 0x00,
9526 "Option 82:151 VRF name/VPN ID Index", HFILL }},
9528 { &hf_dhcp_option82_server_id_override_cisco,
9529 { "Server ID Override (Cisco proprietary)", "dhcp.option.agent_information_option.server_id_override_cisco",
9530 FT_IPv4, BASE_NONE, NULL, 0x00,
9531 "Option 82:152 Server ID Override (Cisco proprietary)", HFILL }},
9534 { &hf_dhcp_option_isns_functions,
9535 { "iSNS Functions", "dhcp.option.isns.functions",
9536 FT_UINT16, BASE_HEX, NULL, 0x00,
9537 "iSNS: the functions supported by the iSNS servers", HFILL }},
9539 { &hf_dhcp_option_isns_functions_enabled,
9540 { "Function Fields Enabled", "dhcp.option.isns.functions.enabled",
9541 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_FUNCTIONS_ENABLED,
9542 "If set to zero, then the contents of all other iSNS Function fields MUST be ignored", HFILL }},
9544 { &hf_dhcp_option_isns_functions_dd_authorization,
9545 { "Discovery Domain based Authorization", "dhcp.option.isns.functions.dd_base_authorization",
9546 FT_BOOLEAN, 16, TFS(&tfs_isns_function_dd_based_auth), F_ISNS_FUNCTIONS_DD_AUTH,
9547 "If set to zero, then access authorization must be explicitly performed by each device", HFILL }},
9549 { &hf_dhcp_option_isns_functions_sec_policy_distibution,
9550 { "Security Policy Distribution", "dhcp.option.isns.functions.sec_policy_distribution",
9551 FT_BOOLEAN, 16, TFS(&tfs_isns_functions_sec_distrib), F_ISNS_FUNCTIONS_SEC_POLICY,
9552 NULL, HFILL }},
9554 { &hf_dhcp_option_isns_functions_reserved,
9555 { "Reserved flags", "dhcp.option.isns.functions.reserved",
9556 FT_UINT16, BASE_HEX, NULL, F_ISNS_FUNCTIONS_RESERVED,
9557 NULL, HFILL }},
9559 { &hf_dhcp_option_isns_discovery_domain_access,
9560 { "Discovery Domain Access flags", "dhcp.option.isns.discovery_domain_access",
9561 FT_UINT16, BASE_HEX, NULL, 0x00,
9562 "iSNS: the types of iSNS clients that are allowed to modify Discovery Domains", HFILL }},
9564 { &hf_dhcp_option_isns_discovery_domain_access_enabled,
9565 { "Discovery Domain Enabled", "dhcp.option.isns.discovery_domain_access.enabled",
9566 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ENABLED,
9567 "If set to zero, then the contents of the remainder of this field MUST be ignored", HFILL }},
9569 { &hf_dhcp_option_isns_discovery_domain_access_control_node,
9570 { "Control Node", "dhcp.option.isns.discovery_domain_access_control.node",
9571 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_CTRL_NODE,
9572 NULL, HFILL }},
9574 { &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
9575 { "iSCSI Target", "dhcp.option.isns.discovery_domain_access.iscsi_target",
9576 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_TARGET,
9577 NULL, HFILL }},
9579 { &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
9580 { "iSCSI Initiator", "dhcp.option.isns.discovery_domain_access.iscsi_initiator",
9581 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_INITIATOR,
9582 NULL, HFILL }},
9584 { &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
9585 { "iFCP Target Port", "dhcp.option.isns.discovery_domain_access.ifcp_target_port",
9586 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_TARGET_PORT,
9587 NULL, HFILL }},
9589 { &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
9590 { "iFCP Initiator Port", "dhcp.option.isns.discovery_domain_access.initiator_target_port",
9591 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT,
9592 NULL, HFILL }},
9594 { &hf_dhcp_option_isns_discovery_domain_access_reserved,
9595 { "Reserved Flags", "dhcp.option.isns.discovery_domain_access.reserved",
9596 FT_UINT16, BASE_HEX, NULL, F_ISNS_DD_ACCESS_RESERVED,
9597 NULL, HFILL }},
9599 { &hf_dhcp_option_isns_administrative_flags,
9600 { "Administrative Flags", "dhcp.option.isns.administrative_flags",
9601 FT_UINT16, BASE_HEX, NULL, 0x00,
9602 "iSNS: administrative settings for the iSNS servers discovered through the DHCP query", HFILL }},
9604 { &hf_dhcp_option_isns_administrative_flags_enabled,
9605 { "Administrative Flags Enabled", "dhcp.option.isns.administrative_flags.enabled",
9606 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_ENABLED,
9607 NULL, HFILL }},
9609 { &hf_dhcp_option_isns_administrative_flags_heartbeat,
9610 { "Heartbeat", "dhcp.option.isns.administrative_flags.heartbeat",
9611 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_HEARTBEAT,
9612 NULL, HFILL }},
9614 { &hf_dhcp_option_isns_administrative_flags_management_scns,
9615 { "Management SCNs", "dhcp.option.isns.administrative_flags.management_scns",
9616 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS,
9617 NULL, HFILL }},
9619 { &hf_dhcp_option_isns_administrative_flags_default_dd,
9620 { "Default Discovery Domain", "dhcp.option.isns.administrative_flags.default_discovery_domain",
9621 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_DEFAULT_DD,
9622 NULL, HFILL }},
9624 { &hf_dhcp_option_isns_administrative_flags_reserved,
9625 { "Reserved Flags", "dhcp.option.isns.administrative_flags.reserved",
9626 FT_UINT16, BASE_HEX, NULL, F_ISNS_ADMIN_FLAGS_RESERVED,
9627 NULL, HFILL }},
9629 { &hf_dhcp_option_isns_server_security_bitmap,
9630 { "iSNS Server Security Bitmap", "dhcp.option.isns.server_security_bitmap",
9631 FT_UINT32, BASE_HEX, NULL, 0x00,
9632 "iSNS: server security settings", HFILL }},
9634 { &hf_dhcp_option_isns_server_security_bitmap_enabled,
9635 { "Server Security Bitmap Enabled", "dhcp.option.isns.server_security_bitmap.enabled",
9636 FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_SRV_SEC_BITMAP_ENABLED,
9637 NULL, HFILL }},
9639 { &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
9640 { "IKE/IPSec", "dhcp.option.isns.server_security_bitmap.ike_ipsec_enabled",
9641 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC,
9642 NULL, HFILL }},
9644 { &hf_dhcp_option_isns_server_security_bitmap_main_mode,
9645 { "Main Mode", "dhcp.option.isns.server_security_bitmap.main_mode",
9646 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_MAIN_MODE,
9647 NULL, HFILL }},
9649 { &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
9650 { "Aggressive Mode", "dhcp.option.isns.server_security_bitmap.aggressive_mode",
9651 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE,
9652 NULL, HFILL }},
9654 { &hf_dhcp_option_isns_server_security_bitmap_pfs,
9655 { "PFS", "dhcp.option.isns.server_security_bitmap.pfs",
9656 FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_PFS,
9657 NULL, HFILL }},
9659 { &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
9660 { "Transport Mode", "dhcp.option.isns.server_security_bitmap.transport_mode",
9661 FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE,
9662 NULL, HFILL }},
9664 { &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
9665 { "Tunnel Mode", "dhcp.option.isns.server_security_bitmap.tunnel_mode",
9666 FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE,
9667 NULL, HFILL }},
9669 { &hf_dhcp_option_isns_server_security_bitmap_reserved,
9670 { "Reserved Flags", "dhcp.option.isns.server_security_bitmap.reserved",
9671 FT_UINT16, BASE_HEX, NULL, F_ISNS_SRV_SEC_BITMAP_RESERVED,
9672 NULL, HFILL }},
9674 { &hf_dhcp_option_isns_primary_server_addr,
9675 { "Primary Server Address", "dhcp.option.isns.primary_server_addr",
9676 FT_IPv4, BASE_NONE, NULL, 0x00,
9677 "iSNS: IP address of the primary server", HFILL }},
9679 { &hf_dhcp_option_isns_heartbeat_originator_addr,
9680 { "Heartbeat Originator Address", "dhcp.option.isns.heartbeat_originator_addr",
9681 FT_IPv4, BASE_NONE, NULL, 0x00,
9682 "iSNS: IP address from which the iSNS heartbeat originates", HFILL }},
9684 { &hf_dhcp_option_isns_secondary_server_addr_list,
9685 { "Secondary Server Address", "dhcp.option.isns.secondary_server_addr",
9686 FT_IPv4, BASE_NONE, NULL, 0x00,
9687 "iSNS: a list of IP addresses of the secondary iSNS servers", HFILL }},
9690 { &hf_dhcp_option_novell_dss_string,
9691 { "Novell Directory Services Servers String", "dhcp.option.novell_dss.string",
9692 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9693 "Option 85: Novell Directory Services Servers String", HFILL }},
9695 { &hf_dhcp_option_novell_dss_ip,
9696 { "IP Address", "dhcp.option.novell_dss.ip",
9697 FT_IPv4, BASE_NONE, NULL, 0x00,
9698 "Option 85: Novell Directory Services Servers IP Address", HFILL }},
9700 { &hf_dhcp_option_novell_ds_tree_name,
9701 { "Novell Directory Services Tree Name", "dhcp.option.novell_ds_tree_name",
9702 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9703 "Option 86: Novell Directory Services Tree Name", HFILL }},
9705 { &hf_dhcp_option_novell_ds_context,
9706 { "Novell Directory Services Context", "dhcp.option.novell_ds_context",
9707 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9708 "Option 87: Novell Directory Services Context", HFILL }},
9710 { &hf_dhcp_option_dhcp_authentication_protocol,
9711 { "Protocol", "dhcp.option.dhcp_authentication.protocol",
9712 FT_UINT8, BASE_DEC, VALS(authen_protocol_vals), 0x0,
9713 "Option 90: Authentication Protocol", HFILL }},
9715 { &hf_dhcp_option_dhcp_authentication_alg_delay,
9716 { "Delay Algorithm", "dhcp.option.dhcp_authentication.alg_delay",
9717 FT_UINT8, BASE_DEC, VALS(authen_da_algo_vals), 0x0,
9718 "Option 90: Delayed Authentication Algorithm", HFILL }},
9720 { &hf_dhcp_option_dhcp_authentication_algorithm,
9721 { "Algorithm", "dhcp.option.dhcp_authentication.algorithm",
9722 FT_UINT8, BASE_DEC, NULL, 0x0,
9723 "Option 90: Authentication Algorithm", HFILL }},
9725 { &hf_dhcp_option_dhcp_authentication_rdm,
9726 { "Replay Detection Method", "dhcp.option.dhcp_authentication.rdm",
9727 FT_UINT8, BASE_DEC, VALS(authen_rdm_vals), 0x0,
9728 "Option 90: Replay Detection Method", HFILL }},
9730 { &hf_dhcp_option_dhcp_authentication_rdm_replay_detection,
9731 { "RDM Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_replay_detection",
9732 FT_UINT64, BASE_HEX, NULL, 0x0,
9733 "Option 90: RDM Replay Detection Value", HFILL }},
9735 { &hf_dhcp_option_dhcp_authentication_rdm_rdv,
9736 { "Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_rdv",
9737 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9738 "Option 90: Replay Detection Value", HFILL }},
9740 { &hf_dhcp_option_dhcp_authentication_secret_id,
9741 { "Secret ID", "dhcp.option.dhcp_authentication.secret_id",
9742 FT_UINT32, BASE_HEX, NULL, 0x0,
9743 "Option 90: Secret ID", HFILL }},
9745 { &hf_dhcp_option_dhcp_authentication_hmac_md5_hash,
9746 { "HMAC MD5 Hash", "dhcp.option.dhcp_authentication.hmac_md5_hash",
9747 FT_BYTES, BASE_NONE, NULL, 0x0,
9748 "Option 90: HMAC MD5 Hash", HFILL }},
9750 { &hf_dhcp_option_dhcp_authentication_information,
9751 { "Authentication Information", "dhcp.option.dhcp_authentication.information",
9752 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9753 "Option 90: Authentication Information", HFILL }},
9755 { &hf_dhcp_option_client_last_transaction_time,
9756 { "Client last transaction time", "dhcp.option.client_last_transaction_time",
9757 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9758 "Option 91: Client last transaction time", HFILL }},
9760 { &hf_dhcp_option_associated_ip_option,
9761 { "Associated IP option", "dhcp.option.associated_ip_option",
9762 FT_IPv4, BASE_NONE, NULL, 0x00,
9763 "Option 92: Associated IP option", HFILL }},
9765 { &hf_dhcp_option_client_system_architecture,
9766 { "Client System Architecture", "dhcp.option.client_system_architecture",
9767 FT_UINT16, BASE_DEC, VALS(dhcp_client_arch), 0x0,
9768 "Option 93: Client System Architecture", HFILL }},
9770 { &hf_dhcp_option_client_network_id_major_ver,
9771 { "Major Version", "dhcp.client_network_id_major",
9772 FT_UINT8, BASE_DEC, NULL, 0x0,
9773 "Option 94: Major Version", HFILL }},
9775 { &hf_dhcp_option_client_network_id_minor_ver,
9776 { "Minor Version", "dhcp.client_network_id_minor",
9777 FT_UINT8, BASE_DEC, NULL, 0x0,
9778 "Option 94: Minor Version", HFILL }},
9780 { &hf_dhcp_option_civic_location_what,
9781 { "What", "dhcp.option.civic_location.what",
9782 FT_UINT8, BASE_DEC, VALS(civic_address_what_values), 0x0,
9783 "Option 99: What", HFILL }},
9785 { &hf_dhcp_option_civic_location_country,
9786 { "Country", "dhcp.option.civic_location.country",
9787 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9788 "Option 99: Country", HFILL }},
9790 { &hf_dhcp_option_civic_location_ca_type,
9791 { "CA Type", "dhcp.option.civic_location.ca_type",
9792 FT_UINT8, BASE_DEC, VALS(civic_address_type_values), 0x0,
9793 "Option 99: CA Type", HFILL }},
9795 { &hf_dhcp_option_civic_location_ca_length,
9796 { "CA Length", "dhcp.option.civic_location.ca_length",
9797 FT_UINT8, BASE_DEC, NULL, 0x0,
9798 "Option 99: CA Length", HFILL }},
9800 { &hf_dhcp_option_civic_location_ca_value,
9801 { "CA Value", "dhcp.option.civic_location.ca_value",
9802 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9803 "Option 99: CA Value", HFILL }},
9805 { &hf_dhcp_option_tz_pcode,
9806 { "TZ PCode", "dhcp.option.tz_pcode",
9807 FT_STRING, BASE_NONE, NULL, 0x0,
9808 "Option 100: TZ PCode", HFILL }},
9810 { &hf_dhcp_option_tz_tcode,
9811 { "TZ TCode", "dhcp.option.tz_tcode",
9812 FT_STRING, BASE_NONE, NULL, 0x0,
9813 "Option 101: TZ TCode", HFILL }},
9815 { &hf_dhcp_option_ipv6_only_preferred_wait_time,
9816 { "IPv6-Only Preferred wait time", "dhcp.option.ipv6only_preferred_wait_time",
9817 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9818 "Option 108: IPv6-Only Preferred wait time", HFILL }},
9820 { &hf_dhcp_option_netinfo_parent_server_address,
9821 { "NetInfo Parent Server Address", "dhcp.option.netinfo_parent_server_address",
9822 FT_IPv4, BASE_NONE, NULL, 0x00,
9823 "Option 112: NetInfo Parent Server Address", HFILL }},
9825 { &hf_dhcp_option_netinfo_parent_server_tag,
9826 { "NetInfo Parent Server Tag", "dhcp.option.netinfo_parent_server_tag",
9827 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9828 "Option 113: NetInfo Parent Server Tag", HFILL }},
9830 { &hf_dhcp_option_dhcp_auto_configuration,
9831 { "DHCP Auto-Configuration", "dhcp.option.dhcp_auto_configuration",
9832 FT_UINT8, BASE_DEC, VALS(dhcp_autoconfig), 0x0,
9833 "Option 116: DHCP Auto-Configuration", HFILL }},
9835 { &hf_dhcp_option_dhcp_name_service_search_option,
9836 { "Name Service", "dhcp.option.dhcp_name_service_search_option",
9837 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9838 "Option 117: Name Service", HFILL }},
9840 { &hf_dhcp_option_dhcp_dns_domain_search_list_rfc_3396_detected,
9841 { "Encoding Long Options detected (RFC 3396)", "dhcp.option.dhcp_dns_domain_search_list_rfc_3396_detected",
9842 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9843 "Option 119: Encoding Long Options detected (RFC 3396)", HFILL }},
9845 { &hf_dhcp_option_dhcp_dns_domain_search_list_refer_last_option,
9846 { "For the data, please refer to last option 119", "dhcp.option.dhcp_dns_domain_search_list_refer_last_option",
9847 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9848 "Option 119: For the data, please refer to last option 119", HFILL }},
9850 { &hf_dhcp_option_dhcp_dns_domain_search_list_fqdn,
9851 { "FQDN", "dhcp.option.dhcp_dns_domain_search_list_fqdn",
9852 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9853 "Option 119: FQDN", HFILL }},
9855 { &hf_dhcp_option_sip_server_rfc_3396_detected,
9856 { "Encoding Long Options detected (RFC 3396)", "dhcp.option.sip_server.rfc_3396_detected",
9857 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9858 "Option 120: Encoding Long Options detected (RFC 3396)", HFILL }},
9860 { &hf_dhcp_option_sip_server_refer_last_option,
9861 { "For the data, please refer to last option 120", "dhcp.option.sip_server.refer_last_option",
9862 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9863 "Option 120: For the data, please refer to last option 120", HFILL }},
9865 { &hf_dhcp_option_sip_server_enc,
9866 { "SIP Server Encoding", "dhcp.option.sip_server.encoding",
9867 FT_UINT8, BASE_DEC, VALS(sip_server_enc_vals), 0x0,
9868 "Option 120: SIP Server encoding", HFILL }},
9870 { &hf_dhcp_option_sip_server_name,
9871 { "SIP Server Name", "dhcp.option.sip_server.name",
9872 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9873 "Option 120: SIP Server Name", HFILL }},
9875 { &hf_dhcp_option_sip_server_address,
9876 { "SIP Server Address", "dhcp.option.sip_server.address",
9877 FT_IPv4, BASE_NONE, NULL, 0x0,
9878 "Option 120: SIP Server Address", HFILL }},
9880 { &hf_dhcp_option_classless_static_route,
9881 { "Subnet/MaskWidth-Router", "dhcp.option.classless_static_route",
9882 FT_BYTES, BASE_NONE, NULL, 0x0,
9883 "Option 121: Subnet/MaskWidth-Router", HFILL }},
9885 { &hf_dhcp_option_rfc3825_error,
9886 { "Error", "dhcp.option.rfc3825.error",
9887 FT_UINT8, BASE_DEC, VALS(rfc3825_error_types), 0x0,
9888 "Option 123: Error", HFILL }},
9890 { &hf_dhcp_option_rfc3825_latitude,
9891 { "Latitude", "dhcp.option.rfc3825.latitude",
9892 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9893 "Option 123: Latitude", HFILL }},
9895 { &hf_dhcp_option_rfc3825_longitude,
9896 { "Longitude", "dhcp.option.rfc3825.longitude",
9897 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9898 "Option 123: Longitude", HFILL }},
9900 { &hf_dhcp_option_rfc3825_latitude_res,
9901 { "Latitude resolution", "dhcp.option.rfc3825.latitude_res",
9902 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9903 "Option 123: Latitude resolution", HFILL }},
9905 { &hf_dhcp_option_rfc3825_longitude_res,
9906 { "Longitude resolution", "dhcp.option.rfc3825.longitude_res",
9907 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9908 "Option 123: Longitude resolution", HFILL }},
9910 { &hf_dhcp_option_rfc3825_altitude,
9911 { "Altitude", "dhcp.option.rfc3825.altitude",
9912 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9913 "Option 123: Altitude", HFILL }},
9915 { &hf_dhcp_option_rfc3825_altitude_res,
9916 { "Altitude resolution", "dhcp.option.rfc3825.altitude_res",
9917 FT_DOUBLE, BASE_NONE, NULL, 0x0,
9918 "Option 123: Altitude resolution", HFILL }},
9920 { &hf_dhcp_option_rfc3825_altitude_type,
9921 { "Altitude type", "dhcp.option.rfc3825.altitude_type",
9922 FT_UINT8, BASE_DEC, VALS(altitude_type_values), 0x0,
9923 "Option 123: Altitude type", HFILL }},
9925 { &hf_dhcp_option_rfc3825_map_datum,
9926 { "Map Datum", "dhcp.option.rfc3825.map_datum",
9927 FT_UINT8, BASE_DEC, VALS(map_datum_type_values), 0x0,
9928 "Option 123: Map Datum", HFILL }},
9930 { &hf_dhcp_option_cl_dss_id_option,
9931 { "DSS_ID Type", "dhcp.option.cl_dss_id.option",
9932 FT_UINT8, BASE_DEC, VALS(cl_dss_id_type_vals), 0x0,
9933 "Option 123:CL DSS_ID Type", HFILL }},
9935 { &hf_dhcp_option_cl_dss_id_len,
9936 { "DSS_ID Length", "dhcp.option.cl_dss_id.len",
9937 FT_UINT8, BASE_DEC, NULL, 0x0,
9938 "Option 123:CL DSS_ID Length", HFILL }},
9940 { &hf_dhcp_option_cl_dss_id,
9941 { "Country", "dhcp.option.cl_dss_id",
9942 FT_STRINGZ, BASE_NONE, NULL, 0x0,
9943 "Option 123:CL DSS_ID", HFILL }},
9945 { &hf_dhcp_option_vi_class_cl_address_mode,
9946 { "CableLab Address Mode", "dhcp.option.vi_class.cl_address_mode",
9947 FT_UINT8, BASE_DEC, VALS(cablelab_ipaddr_mode_vals), 0x0,
9948 "Option 124: CableLab Address Mode", HFILL }},
9950 { &hf_dhcp_option_vi_class_enterprise,
9951 { "Enterprise", "dhcp.option.vi_class.enterprise",
9952 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
9953 "Option 124: Enterprise", HFILL }},
9955 { &hf_dhcp_option_vi_class_data_length,
9956 { "Length", "dhcp.option.vi_class.length",
9957 FT_UINT8, BASE_DEC, NULL, 0x0,
9958 "Option 124: Length", HFILL }},
9960 { &hf_dhcp_option_vi_class_data_item_length,
9961 { "Length", "dhcp.option.vi_class.vendor_class_data.item.length",
9962 FT_UINT8, BASE_DEC, NULL, 0x0,
9963 "Option 124: Length", HFILL }},
9965 { &hf_dhcp_option_vi_class_data_item_data,
9966 { "Data", "dhcp.option.vi_class.vendor_class_data.item.data",
9967 FT_BYTES, BASE_NONE, NULL, 0x0,
9968 "Option 124: Data", HFILL }},
9970 { &hf_dhcp_option125_enterprise,
9971 { "Enterprise", "dhcp.option.vi.enterprise",
9972 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
9973 "Option 125: Enterprise", HFILL }},
9975 { &hf_dhcp_option125_length,
9976 { "Length", "dhcp.option.vi.length",
9977 FT_UINT8, BASE_DEC, NULL, 0x00,
9978 "Option 125: Length", HFILL }},
9980 { &hf_dhcp_option125_value,
9981 { "Value", "dhcp.option.vi.value",
9982 FT_BYTES, BASE_NONE, NULL, 0x0,
9983 "Option 125: Suboption value", HFILL }},
9985 { &hf_dhcp_option125_value_8,
9986 { "Value", "dhcp.option.vi.value.uint",
9987 FT_UINT8, BASE_DEC, NULL, 0x0,
9988 "Option 125: Suboption 8-bit value", HFILL }},
9990 { &hf_dhcp_option125_value_16,
9991 { "Value", "dhcp.option.vi.value.uint",
9992 FT_UINT16, BASE_DEC, NULL, 0x0,
9993 "Option 125: Suboption 16-bit value", HFILL }},
9995 { &hf_dhcp_option125_value_ip_address,
9996 { "Value", "dhcp.option.vi.value.address",
9997 FT_IPv4, BASE_NONE, NULL, 0x00,
9998 "Option 125: Suboption IP address value", HFILL }},
10000 { &hf_dhcp_option125_value_stringz,
10001 { "Value", "dhcp.option.vi.value.string",
10002 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10003 "Option 125: Suboption Z-String value", HFILL }},
10005 { &hf_dhcp_option125_tr111_suboption,
10006 { "Option 125 Suboption", "dhcp.option.vi.tr111.suboption",
10007 FT_UINT8, BASE_DEC, VALS(option125_tr111_suboption_vals), 0x0,
10008 "Option 125:TR 111 Suboption", HFILL }},
10010 { &hf_dhcp_option125_tr111_device_manufacturer_oui,
10011 { "DeviceManufacturerOUI", "dhcp.option.vi.tr111.device_manufacturer_oui",
10012 FT_UINT24, BASE_OUI, NULL, 0x0,
10013 "Option 125:TR 111 1 DeviceManufacturerOUI", HFILL }},
10015 { &hf_dhcp_option125_tr111_device_serial_number,
10016 { "DeviceSerialNumber", "dhcp.option.vi.tr111.device_serial_number",
10017 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10018 "Option 125:TR 111 2 DeviceSerialNumber", HFILL }},
10020 { &hf_dhcp_option125_tr111_device_product_class,
10021 { "DeviceProductClass", "dhcp.option.vi.tr111.device_product_class",
10022 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10023 "Option 125:TR 111 3 DeviceProductClass", HFILL }},
10025 { &hf_dhcp_option125_tr111_gateway_manufacturer_oui,
10026 { "GatewayManufacturerOUI", "dhcp.option.vi.tr111.gateway_manufacturer_oui",
10027 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10028 "Option 125:TR 111 4 GatewayManufacturerOUI", HFILL }},
10030 { &hf_dhcp_option125_tr111_gateway_serial_number,
10031 { "GatewaySerialNumber", "dhcp.option.vi.tr111.gateway_serial_number",
10032 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10033 "Option 125:TR 111 5 GatewaySerialNumber", HFILL }},
10035 { &hf_dhcp_option125_tr111_gateway_product_class,
10036 { "GatewayProductClass", "dhcp.option.vi.tr111.gateway_product_class",
10037 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10038 "Option 125:TR 111 6 GatewayProductClass", HFILL }},
10040 { &hf_dhcp_option125_cl_suboption,
10041 { "Option 125 Suboption", "dhcp.option.vi.cl.suboption",
10042 FT_UINT8, BASE_DEC, VALS(option125_cl_suboption_vals), 0x0,
10043 "Option 125:CL Suboption", HFILL }},
10045 { &hf_dhcp_option125_cl_option_request,
10046 { "Option Request", "dhcp.option.vi.cl.option_request",
10047 FT_BYTES, SEP_SPACE, NULL, 0x0,
10048 "Option 125:CL 1 Option Request", HFILL }},
10050 { &hf_dhcp_option125_cl_tftp_server_addresses,
10051 { "TFTP Server Addresses", "dhcp.option.vi.cl.tftp_server_addresses",
10052 FT_IPv4, BASE_NONE, NULL, 0x00,
10053 "Option 125:CL 2 TFTP Server Addresses", HFILL }},
10055 { &hf_dhcp_option125_cl_erouter_container_option,
10056 { "eRouter Container Option", "dhcp.option.vi.cl.erouter_container_option",
10057 FT_BYTES, BASE_NONE, NULL, 0x0,
10058 "Option 125:CL 3 eRouter Container Option", HFILL }},
10060 { &hf_dhcp_option125_cl_mib_environment_indicator_option,
10061 { "MIB Environment Indicator Option", "dhcp.option.vi.cl.mib_environment_indicator_option",
10062 FT_UINT8, BASE_DEC, VALS(pkt_mib_env_ind_opt_vals), 0x0,
10063 "Option 125:CL 4 MIB Environment Indicator Option", HFILL }},
10065 { &hf_dhcp_option125_cl_modem_capabilities,
10066 { "Modem Capabilities", "dhcp.option.vi.cl.modem_capabilities",
10067 FT_BYTES, BASE_NONE, NULL, 0x0,
10068 "Option 125:CL 5 Modem Capabilities", HFILL }},
10070 { &hf_dhcp_option_subnet_selection_option,
10071 { "Subnet Selection Option", "dhcp.option.subnet_selection_option",
10072 FT_IPv4, BASE_NONE, NULL, 0x00,
10073 "Option 118: Subnet Selection Option", HFILL }},
10075 { &hf_dhcp_option_pana_agent,
10076 { "PAA IPv4 Address", "dhcp.option.pana_agent",
10077 FT_IPv4, BASE_NONE, NULL, 0x0,
10078 "Protocol for Carrying Authentication for Network Access (PANA) Authentication Agents IPv4 Address", HFILL }},
10080 { &hf_dhcp_option_lost_server_domain_name,
10081 { "LoST Server Domain Name", "dhcp.option.lost_server_domain_name",
10082 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10083 "Option 137: LoST Server Domain Name", HFILL }},
10085 { &hf_dhcp_option_capwap_access_controller,
10086 { "CAPWAP Access Controllers", "dhcp.option.capwap_access_controller",
10087 FT_IPv4, BASE_NONE, NULL, 0x00,
10088 "Option 138: CAPWAP Access Controllers", HFILL }},
10090 { &hf_dhcp_option_andsf_server,
10091 { "ANDSF Server", "dhcp.option.andsf_server",
10092 FT_IPv4, BASE_NONE, NULL, 0x00,
10093 "ANDSF (Access Network Discovery and Selection Function) Server", HFILL }},
10095 { &hf_dhcp_option_forcerenew_nonce_algo,
10096 { "Algorithm", "dhcp.option.forcerenew_nonce.algorithm",
10097 FT_UINT8, BASE_DEC, VALS(forcerenew_nonce_algo_vals), 0x00,
10098 "Forcenew Nonce Algorithm", HFILL }},
10100 { &hf_dhcp_option_rdnss_reserved,
10101 { "Reserved", "dhcp.option.rdnss.reserved",
10102 FT_UINT8, BASE_HEX, NULL, 0xfc,
10103 "RDNSS Reserved", HFILL }},
10105 { &hf_dhcp_option_rdnss_pref,
10106 { "Preference", "dhcp.option.rdnss.preference",
10107 FT_UINT8, BASE_DEC, VALS(rdnss_pref_vals), 0x03,
10108 "RDNSS (Recursive DNS Server) Preference", HFILL }},
10110 { &hf_dhcp_option_rdnss_prim_dns_server,
10111 { "Primary DNS", "dhcp.option.rdnss.primary_dns",
10112 FT_IPv4, BASE_NONE, NULL, 0x00,
10113 "RDNSS Primary DNS-recursive-name-server's IPv4 address", HFILL }},
10115 { &hf_dhcp_option_rdnss_sec_dns_server,
10116 { "Secondary DNS", "dhcp.option.rdnss.secondary_dns",
10117 FT_IPv4, BASE_NONE, NULL, 0x00,
10118 "RDNSS Secondary DNS-recursive-name-server's IPv4 address", HFILL }},
10120 { &hf_dhcp_option_rdnss_domain,
10121 { "Domains and networks", "dhcp.option.rdnss.domain",
10122 FT_STRING, BASE_NONE, NULL, 0x00,
10123 "RDNSS Domains and networks", HFILL }},
10125 { &hf_dhcp_option_dots_ri,
10126 { "DOTS Reference Identifier", "dhcp.option.dots.ri",
10127 FT_STRING, BASE_NONE, NULL, 0x00,
10128 "Peer DOTS Agent name", HFILL }},
10130 { &hf_dhcp_option_dots_address,
10131 { "DOTS Address", "dhcp.option.dots.address",
10132 FT_IPv4, BASE_NONE, NULL, 0x00,
10133 "Peer DOTS Agent Address", HFILL }},
10135 { &hf_dhcp_option_tftp_server_address,
10136 { "TFTP Server Address", "dhcp.option.tftp_server_address",
10137 FT_IPv4, BASE_NONE, NULL, 0x00,
10138 "Option 150: TFTP Server Address", HFILL }},
10140 { &hf_dhcp_option_bulk_lease_status_code,
10141 { "Status Code", "dhcp.option.bulk_lease.status_code",
10142 FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_status_code_vals), 0x00,
10143 "DHCPv4 Bulk Leasequery Status Code", HFILL }},
10145 { &hf_dhcp_option_bulk_lease_status_message,
10146 { "Status Code Message", "dhcp.option.bulk_lease.status_code_message",
10147 FT_STRING, BASE_NONE, NULL, 0x00,
10148 "DHCPv4 Bulk Leasequery Status Code Message", HFILL }},
10150 { &hf_dhcp_option_bulk_lease_base_time,
10151 { "Base Time", "dhcp.option.bulk_lease.base_time",
10152 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10153 "DHCPv4 Bulk Leasequery Base Time", HFILL }},
10155 { &hf_dhcp_option_bulk_lease_start_time_of_state,
10156 { "Start Time Of State", "dhcp.option.bulk_lease.start_time_of_state",
10157 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10158 "DHCPv4 Bulk Leasequery Start Time Of State", HFILL }},
10160 { &hf_dhcp_option_bulk_lease_query_start,
10161 { "Query Start Time", "dhcp.option.bulk_lease.query_start_time",
10162 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10163 "DHCPv4 Bulk Leasequery Query Start Time", HFILL }},
10165 { &hf_dhcp_option_bulk_lease_query_end,
10166 { "Query End Time", "dhcp.option.bulk_lease.query_end_time",
10167 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10168 "DHCPv4 Bulk Leasequery Query End Time", HFILL }},
10170 { &hf_dhcp_option_bulk_lease_dhcp_state,
10171 { "Dhcp State", "dhcp.option.bulk_lease.dhcp_state",
10172 FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_state_vals), 0x00,
10173 "DHCPv4 Bulk Leasequery Dhcp State", HFILL }},
10175 { &hf_dhcp_option_bulk_lease_data_source,
10176 { "Data Source", "dhcp.option.bulk_lease.data_source",
10177 FT_BOOLEAN, BASE_NONE, TFS(&tfs_bulk_lease_data_source), 0x00,
10178 "DHCPv4 Bulk Leasequery Data Source", HFILL }},
10180 { &hf_dhcp_option_pcp_list_length,
10181 { "List-Length", "dhcp.option.pcp.list_length",
10182 FT_UINT8, BASE_DEC, NULL, 0x0,
10183 "Port Control Protocol (PCP) List Length", HFILL }},
10185 { &hf_dhcp_option_pcp_server,
10186 { "PCP Server", "dhcp.option.pcp.server",
10187 FT_IPv4, BASE_NONE, NULL, 0x0,
10188 "Port Control Protocol (PCP) Server", HFILL }},
10190 { &hf_dhcp_option_portparams_offset,
10191 { "Offset", "dhcp.option.portparams.offset",
10192 FT_UINT8, BASE_DEC, NULL, 0x0,
10193 "Port Set ID (PSID) offset", HFILL }},
10195 { &hf_dhcp_option_portparams_psid_length,
10196 { "PSID-Length", "dhcp.option.portparams.psid_length",
10197 FT_UINT8, BASE_DEC, NULL, 0x0,
10198 "Port Set ID (PSID) Length", HFILL }},
10200 { &hf_dhcp_option_portparams_psid,
10201 { "PSID", "dhcp.option.portparams.psid",
10202 FT_BYTES, BASE_NONE, NULL, 0x0,
10203 "Port Set ID (PSID)", HFILL }},
10205 { &hf_dhcp_option_mudurl,
10206 { "MUDURL", "dhcp.option.mudurl",
10207 FT_STRING, BASE_NONE, NULL, 0x0,
10208 "Option 161: MUDURL", HFILL }},
10210 { &hf_dhcp_option_pxe_config_file,
10211 { "PXELINUX configuration file", "dhcp.option.pxe_config_file",
10212 FT_STRING, BASE_NONE, NULL, 0x0,
10213 "Option 209: PXE Configuration File", HFILL }},
10215 { &hf_dhcp_option_pxe_path_prefix,
10216 { "PXELINUX path prefix", "dhcp.option.pxe_path_prefix",
10217 FT_STRING, BASE_NONE, NULL, 0x0,
10218 "Option 210: PXE Path Prefix", HFILL }},
10220 { &hf_dhcp_option_pxe_reboot_time,
10221 { "PXELINUX Reboot Time", "dhcp.option.pxe_reboot_time",
10222 FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10223 "Option 211: PXE Reboot Time", HFILL }},
10225 { &hf_dhcp_option_captive_portal,
10226 { "Captive Portal", "dhcp.option.captive_portal",
10227 FT_STRING, BASE_NONE, NULL, 0x0,
10228 "The contact URI for the captive portal that the user should connect to", HFILL }},
10230 { &hf_dhcp_option_6RD_ipv4_mask_len,
10231 { "6RD IPv4 Mask Length", "dhcp.option.6RD.ipv4_mask_len",
10232 FT_UINT8, BASE_DEC, NULL, 0x0,
10233 "Option 212: 6RD IPv4 Mask Length", HFILL }},
10235 { &hf_dhcp_option_6RD_prefix_len,
10236 { "6RD Prefix Length", "dhcp.option.6RD.prefix_len",
10237 FT_UINT8, BASE_DEC, NULL, 0x0,
10238 "Option 212: 6RD Prefix Length", HFILL }},
10240 { &hf_dhcp_option_6RD_prefix,
10241 { "6RD Prefix", "dhcp.option.6RD.prefix",
10242 FT_IPv6, BASE_NONE, NULL, 0x00,
10243 "Option 212: 6RD Prefix", HFILL }},
10245 { &hf_dhcp_option_6RD_border_relay_ip,
10246 { "Border Relay IP", "dhcp.option.6RD.border_relay_ip",
10247 FT_IPv4, BASE_NONE, NULL, 0x00,
10248 "Option 212: Border Relay IP", HFILL }},
10250 { &hf_dhcp_option_private_proxy_autodiscovery,
10251 { "Private/Proxy autodiscovery", "dhcp.option.private_proxy_autodiscovery",
10252 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10253 "Option 252: Private/Proxy autodiscovery", HFILL }},
10255 { &hf_dhcp_option_end,
10256 { "Option End", "dhcp.option.end",
10257 FT_UINT8, BASE_DEC, NULL, 0x0,
10258 "Option 255: End", HFILL }},
10260 { &hf_dhcp_option_end_overload,
10261 { "Option End (Overload)", "dhcp.option.end",
10262 FT_UINT8, BASE_DEC, NULL, 0x0,
10263 "Option 255: End (Overload)", HFILL }},
10265 { &hf_dhcp_vendor_unknown_suboption,
10266 { "Option 125 Suboption", "dhcp.vendor.suboption",
10267 FT_UINT8, BASE_DEC, NULL, 0x0,
10268 NULL, HFILL }},
10270 { &hf_dhcp_suboption_data,
10271 { "Data", "dhcp.vendor.data",
10272 FT_BYTES, BASE_NONE, NULL, 0x0,
10273 NULL, HFILL }},
10275 { &hf_dhcp_pc_ietf_ccc_suboption,
10276 { "Suboption", "dhcp.vendor.pc.ietf_ccc.suboption",
10277 FT_UINT8, BASE_DEC, VALS(pkt_draft5_ccc_opt_vals), 0x0,
10278 NULL, HFILL }},
10280 { &hf_dhcp_pc_i05_ccc_suboption,
10281 { "Suboption", "dhcp.vendor.pc.i05_ccc.suboption",
10282 FT_UINT8, BASE_DEC, VALS(pkt_i05_ccc_opt_vals), 0x0,
10283 NULL, HFILL }},
10285 { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout,
10286 { "pktcMtaDevRealmUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_nom_timeout",
10287 FT_UINT32, BASE_DEC, NULL, 0x0,
10288 NULL, HFILL }},
10290 { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout,
10291 { "pktcMtaDevRealmUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_timeout",
10292 FT_UINT32, BASE_DEC, NULL, 0x0,
10293 NULL, HFILL }},
10295 { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries,
10296 { "pktcMtaDevRealmUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_retries",
10297 FT_UINT32, BASE_DEC, NULL, 0x0,
10298 NULL, HFILL }},
10300 { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout,
10301 { "pktcMtaDevProvUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_nom_timeout",
10302 FT_UINT32, BASE_DEC, NULL, 0x0,
10303 NULL, HFILL }},
10305 { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout,
10306 { "pktcMtaDevProvUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_timeout",
10307 FT_UINT32, BASE_DEC, NULL, 0x0,
10308 NULL, HFILL }},
10310 { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries,
10311 { "pktcMtaDevProvUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_retries",
10312 FT_UINT32, BASE_DEC, NULL, 0x0,
10313 NULL, HFILL }},
10315 { &hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server,
10316 { "Invalidate PacketCable Provisioning Server", "dhcp.ccc.ietf.sec_tkt.pc_provision_server",
10317 FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
10318 NULL, HFILL }},
10320 { &hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management,
10321 { "Invalidate All PacketCable Call Management Servers", "dhcp.ccc.ietf.sec_tkt.all_pc_call_management",
10322 FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
10323 NULL, HFILL }},
10325 { &hf_dhcp_option242_avaya,
10326 { "Private/Avaya IP Telephone", "dhcp.option.vendor.avaya",
10327 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10328 "Option 242: Private/Avaya IP Telephone", HFILL }},
10330 { &hf_dhcp_option242_avaya_tlssrvr,
10331 { "TLSSRVR", "dhcp.option.vendor.avaya.tlssrvr",
10332 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10333 "Option 242: TLSSRVR (HTTPS server(s) to download configuration)", HFILL }},
10335 { &hf_dhcp_option242_avaya_httpsrvr,
10336 { "HTTPSRVR", "dhcp.option.vendor.avaya.httpsrvr",
10337 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10338 "Option 242: HTTPSRVR (HTTP server(s) to download configuration)", HFILL }},
10340 { &hf_dhcp_option242_avaya_httpdir,
10341 { "HTTPDIR", "dhcp.option.vendor.avaya.httpdir",
10342 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10343 "Option 242: HTTPDIR (Path to configuration files)", HFILL }},
10345 { &hf_dhcp_option242_avaya_static,
10346 { "STATIC", "dhcp.option.vendor.avaya.static",
10347 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10348 "Option 242: STATIC (Static programming override flag)", HFILL }},
10350 { &hf_dhcp_option242_avaya_mcipadd,
10351 { "MCIPADD", "dhcp.option.vendor.avaya.mcipadd",
10352 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10353 "Option 242: MCIPADD (List of CM server(s))", HFILL }},
10355 { &hf_dhcp_option242_avaya_dot1x,
10356 { "DOT1X", "dhcp.option.vendor.avaya.dot1x",
10357 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10358 "Option 242: DOT1X (802.1X Supplicant operation mode)", HFILL }},
10360 { &hf_dhcp_option242_avaya_icmpdu,
10361 { "ICMPDU", "dhcp.option.vendor.avaya.icmpdu",
10362 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10363 "Option 242: ICMPDU (ICMP Destination Unreachable processing)", HFILL }},
10365 { &hf_dhcp_option242_avaya_icmpred,
10366 { "ICMPRED", "dhcp.option.vendor.avaya.icmpred",
10367 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10368 "Option 242: ICMPRED (ICMP Redirect handling)", HFILL }},
10370 { &hf_dhcp_option242_avaya_l2q,
10371 { "L2Q", "dhcp.option.vendor.avaya.l2q",
10372 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10373 "Option 242: L2Q (Controls 802.1Q tagging)", HFILL }},
10375 { &hf_dhcp_option242_avaya_l2qvlan,
10376 { "L2QVLAN", "dhcp.option.vendor.avaya.l2qvlan",
10377 FT_INT32, BASE_DEC, NULL, 0x0,
10378 "Option 242: L2QVLAN (VLAN ID)", HFILL }},
10380 { &hf_dhcp_option242_avaya_loglocal,
10381 { "LOGLOCAL", "dhcp.option.vendor.avaya.loglocal",
10382 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10383 "Option 242: LOGLOCAL (Log level)", HFILL }},
10385 { &hf_dhcp_option242_avaya_phy1stat,
10386 { "PHY1STAT", "dhcp.option.vendor.avaya.phy1stat",
10387 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10388 "Option 242: PHY1STAT (Interface configuration)", HFILL }},
10390 { &hf_dhcp_option242_avaya_phy2stat,
10391 { "PHY2STAT", "dhcp.option.vendor.avaya.phy2stat",
10392 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10393 "Option 242: PHY2STAT (Interface configuration)", HFILL }},
10395 { &hf_dhcp_option242_avaya_procpswd,
10396 { "PROCPSWD", "dhcp.option.vendor.avaya.procpswd",
10397 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10398 "Option 242: PROCPSWD (Security string used to access local procedures)", HFILL }},
10400 { &hf_dhcp_option242_avaya_procstat,
10401 { "PROCSTAT", "dhcp.option.vendor.avaya.procstat",
10402 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10403 "Option 242: PROCSTAT (Local (dialpad) Administrative access)", HFILL }},
10405 { &hf_dhcp_option242_avaya_snmpadd,
10406 { "SNMPADD", "dhcp.option.vendor.avaya.snmpadd",
10407 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10408 "Option 242: SNMPADD (Allowable source IP Address(es) for SNMP queries)", HFILL }},
10410 { &hf_dhcp_option242_avaya_snmpstring,
10411 { "SNMPSTRING", "dhcp.option.vendor.avaya.snmpstring",
10412 FT_STRINGZ, BASE_NONE, NULL, 0x0,
10413 "Option 242: SNMPSTRING (SNMP community string)", HFILL }},
10415 { &hf_dhcp_option242_avaya_vlantest,
10416 { "VLANTEST", "dhcp.option.vendor.avaya.vlantest",
10417 FT_INT32, BASE_DEC, NULL, 0x0,
10418 "Option 242: VLANTEST (Timeout in seconds)", HFILL }},
10420 /* Cisco vendor suboptions */
10421 { &hf_dhcp_option43_cisco_suboption,
10422 { "Option 43 Suboption", "dhcp.option.vendor.cisco.suboption",
10423 FT_UINT8, BASE_DEC, VALS(option43_cisco_suboption_vals), 0x0,
10424 "Option 43:Cisco Suboption", HFILL }},
10426 { &hf_dhcp_option43_cisco_unknown,
10427 { "Unknown", "dhcp.option.vendor.cisco.unknown",
10428 FT_BYTES, BASE_NONE, NULL, 0x0,
10429 NULL, HFILL }},
10431 { &hf_dhcp_option43_cisco_unknown1,
10432 { "Unknown1", "dhcp.option.vendor.cisco.unknown1",
10433 FT_UINT8, BASE_DEC, NULL, 0x0,
10434 NULL, HFILL }},
10436 { &hf_dhcp_option43_cisco_unknown2,
10437 { "Unknown2", "dhcp.option.vendor.cisco.unknown2",
10438 FT_UINT8, BASE_DEC, NULL, 0x0,
10439 NULL, HFILL }},
10441 { &hf_dhcp_option43_cisco_unknown3,
10442 { "Unknown3", "dhcp.option.vendor.cisco.unknown3",
10443 FT_UINT16, BASE_DEC, NULL, 0x0,
10444 NULL, HFILL }},
10446 { &hf_dhcp_option43_cisco_nodeid,
10447 { "Node ID", "dhcp.option.vendor.cisco.nodeid",
10448 FT_UINT32, BASE_DEC, NULL, 0x0,
10449 NULL, HFILL }},
10451 { &hf_dhcp_option43_cisco_unknown5,
10452 { "Unknown5", "dhcp.option.vendor.cisco.unknown5",
10453 FT_UINT8, BASE_DEC, NULL, 0x0,
10454 NULL, HFILL }},
10456 { &hf_dhcp_option43_cisco_unknown6,
10457 { "Unknown6", "dhcp.option.vendor.cisco.unknown6",
10458 FT_UINT8, BASE_DEC, NULL, 0x0,
10459 NULL, HFILL }},
10461 { &hf_dhcp_option43_cisco_model,
10462 { "Model", "dhcp.option.vendor.cisco.model",
10463 FT_STRING, BASE_NONE, NULL, 0x0,
10464 NULL, HFILL }},
10466 { &hf_dhcp_option43_cisco_apicuuid,
10467 { "APIC UUID", "dhcp.option.vendor.cisco.apicuuid",
10468 FT_STRING, BASE_NONE, NULL, 0x0,
10469 NULL, HFILL }},
10471 { &hf_dhcp_option43_cisco_fabricname,
10472 { "Fabricname", "dhcp.option.vendor.cisco.fabricname",
10473 FT_STRING, BASE_NONE, NULL, 0x0,
10474 NULL, HFILL }},
10476 { &hf_dhcp_option43_cisco_unknown10,
10477 { "Unknown10", "dhcp.option.vendor.cisco.unknown10",
10478 FT_UINT32, BASE_DEC, NULL, 0x0,
10479 NULL, HFILL }},
10481 { &hf_dhcp_option43_cisco_serialno,
10482 { "SerialNo", "dhcp.option.vendor.cisco.serialno",
10483 FT_STRING, BASE_NONE, NULL, 0x0,
10484 NULL, HFILL }},
10486 { &hf_dhcp_option43_cisco_clientint,
10487 { "Client Int", "dhcp.option.vendor.cisco.clientint",
10488 FT_STRING, BASE_NONE, NULL, 0x0,
10489 NULL, HFILL }},
10492 static uat_field_t dhcp_uat_flds[] = {
10493 UAT_FLD_DEC(uat_dhcp_records, opt, "Option number", "Custom Option Number"),
10494 UAT_FLD_CSTRING(uat_dhcp_records, text, "Option Name", "Custom Option Name"),
10495 UAT_FLD_VS(uat_dhcp_records, ftype, "Option type", dhcp_custom_type_vals, "Option datatype"),
10496 UAT_END_FIELDS
10499 static int *ett[] = {
10500 &ett_dhcp,
10501 &ett_dhcp_flags,
10502 &ett_dhcp_option,
10503 &ett_dhcp_option43_suboption,
10504 &ett_dhcp_option43_suboption_discovery,
10505 &ett_dhcp_option43_suboption_tree,
10506 &ett_dhcp_option63_suboption,
10507 &ett_dhcp_option77_instance,
10508 &ett_dhcp_option82_suboption,
10509 &ett_dhcp_option82_suboption9,
10510 &ett_dhcp_option124_vendor_class_data_item,
10511 &ett_dhcp_option125_suboption,
10512 &ett_dhcp_option125_tr111_suboption,
10513 &ett_dhcp_option125_cl_suboption,
10514 &ett_dhcp_option242_suboption,
10515 &ett_dhcp_fqdn,
10516 &ett_dhcp_filename_option,
10517 &ett_dhcp_server_hostname,
10518 &ett_dhcp_fqdn_flags,
10519 &ett_dhcp_isns_functions,
10520 &ett_dhcp_isns_discovery_domain_access,
10521 &ett_dhcp_isns_administrative_flags,
10522 &ett_dhcp_isns_server_security_bitmap,
10523 &ett_dhcp_isns_secondary_server_addr,
10524 &ett_dhcp_o43_bsdp_boot_image,
10525 &ett_dhcp_o43_bsdp_attributes,
10526 &ett_dhcp_o43_bsdp_image_desc_list,
10527 &ett_dhcp_o43_bsdp_image_desc,
10528 &ett_dhcp_o43_bsdp_attributes_flags,
10529 &ett_dhcp_option158_pcp_list,
10532 static ei_register_info ei[] = {
10533 { &ei_dhcp_bad_length, { "dhcp.bad_length", PI_PROTOCOL, PI_ERROR, "length isn't 0", EXPFILL }},
10534 { &ei_dhcp_bad_bitfield, { "dhcp.bad_bitfield", PI_PROTOCOL, PI_ERROR, "Bogus bitfield", EXPFILL }},
10535 { &ei_dhcp_missing_subopt_length, { "dhcp.missing_subopt_length", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption length", EXPFILL }},
10536 { &ei_dhcp_missing_subopt_value, { "dhcp.missing_subopt_value", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value", EXPFILL }},
10537 { &ei_dhcp_mal_duid, { "dhcp.malformed.duid", PI_PROTOCOL, PI_ERROR, "DUID: malformed option", EXPFILL }},
10538 { &ei_dhcp_opt_overload_file_end_missing, { "dhcp.option.option_overload.file_end_missing", PI_PROTOCOL, PI_ERROR, "file overload end option missing", EXPFILL }},
10539 { &ei_dhcp_opt_overload_sname_end_missing, { "dhcp.option.option_overload.sname_end_missing", PI_PROTOCOL, PI_ERROR, "sname overload end option missing", EXPFILL }},
10540 { &ei_dhcp_subopt_unknown_type, { "dhcp.subopt.unknown_type", PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler", EXPFILL }},
10541 { &ei_dhcp_option_civic_location_bad_cattype, { "dhcp.option.civic_location.bad_cattype", PI_PROTOCOL, PI_ERROR, "Error with CAType", EXPFILL }},
10542 { &ei_dhcp_option_dhcp_name_service_invalid, { "dhcp.option.dhcp_name_service.invalid", PI_PROTOCOL, PI_ERROR, "Invalid Name Service", EXPFILL }},
10543 { &ei_dhcp_option_sip_server_address_encoding, { "dhcp.option.sip_server_address.encoding", PI_PROTOCOL, PI_ERROR, "RFC 3361 defines only 0 and 1 for Encoding byte", EXPFILL }},
10544 { &ei_dhcp_option_classless_static_route, { "dhcp.option.classless_static.route", PI_PROTOCOL, PI_ERROR, "Mask width > 32", EXPFILL }},
10545 { &ei_dhcp_option125_enterprise_malformed, { "dhcp.option.enterprise.malformed", PI_PROTOCOL, PI_ERROR, "no room left in option for enterprise data", EXPFILL }},
10546 { &ei_dhcp_option_6RD_malformed, { "dhcp.option.6RD.malformed", PI_PROTOCOL, PI_ERROR, "6RD: malformed option", EXPFILL }},
10547 { &ei_dhcp_option82_vi_cl_tag_unknown, { "dhcp.option.option.vi.cl.tag_unknown", PI_PROTOCOL, PI_ERROR, "Unknown tag", EXPFILL }},
10548 { &ei_dhcp_option_parse_err, { "dhcp.option.parse_err", PI_PROTOCOL, PI_ERROR, "Parse error", EXPFILL }},
10549 { &ei_dhcp_nonstd_option_data, { "dhcp.option.nonstd_data", PI_PROTOCOL, PI_NOTE, "Non standard compliant option data", EXPFILL }},
10550 { &ei_dhcp_suboption_invalid, { "dhcp.suboption_invalid", PI_PROTOCOL, PI_ERROR, "Invalid suboption", EXPFILL }},
10551 { &ei_dhcp_secs_le, { "dhcp.secs_le", PI_PROTOCOL, PI_NOTE, "Seconds elapsed appears to be encoded as little-endian", EXPFILL }},
10552 { &ei_dhcp_end_option_missing, { "dhcp.end_option_missing", PI_PROTOCOL, PI_ERROR, "End option missing", EXPFILL }},
10553 { &ei_dhcp_client_address_not_given, { "dhcp.client_address_not_given", PI_PROTOCOL, PI_NOTE, "Client address not given", EXPFILL }},
10554 { &ei_dhcp_server_name_overloaded_by_dhcp, { "dhcp.server_name_overloaded_by_dhcp", PI_PROTOCOL, PI_NOTE, "Server name option overloaded by DHCP", EXPFILL }},
10555 { &ei_dhcp_boot_filename_overloaded_by_dhcp, { "dhcp.boot_filename_overloaded_by_dhcp", PI_PROTOCOL, PI_NOTE, "Boot file name option overloaded by DHCP", EXPFILL }},
10556 { &ei_dhcp_option_isns_ignored_bitfield, { "dhcp.option.isns.ignored_bitfield", PI_PROTOCOL, PI_NOTE, "Enabled field is not set - non-zero bitmask ignored", EXPFILL }},
10557 { &ei_dhcp_option242_avaya_l2qvlan_invalid, { "dhcp.option.vendor.avaya.l2qvlan.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (L2QVLAN) invalid", EXPFILL }},
10558 { &ei_dhcp_option242_avaya_vlantest_invalid, { "dhcp.option.vendor.avaya.vlantest.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (avaya vlantest) invalid", EXPFILL }},
10559 { &ei_dhcp_option93_client_arch_ambiguous, { "dhcp.option.client_architecture.ambiguous", PI_PROTOCOL, PI_WARN, "Client Architecture ID may be ambiguous", EXPFILL }},
10562 static tap_param dhcp_stat_params[] = {
10563 { PARAM_FILTER, "filter", "Filter", NULL, true }
10566 static stat_tap_table_ui dhcp_stat_table = {
10567 REGISTER_PACKET_STAT_GROUP_UNSORTED,
10568 "DHCP (BOOTP) Statistics",
10569 "dhcp",
10570 "dhcp,stat",
10571 dhcp_stat_init,
10572 dhcp_stat_packet,
10573 dhcp_stat_reset,
10574 NULL,
10575 NULL,
10576 array_length(dhcp_stat_fields), dhcp_stat_fields,
10577 array_length(dhcp_stat_params), dhcp_stat_params,
10578 NULL,
10582 module_t *dhcp_module;
10583 expert_module_t* expert_dhcp;
10585 proto_dhcp = proto_register_protocol("Dynamic Host Configuration Protocol", "DHCP/BOOTP", "dhcp");
10586 proto_register_field_array(proto_dhcp, hf, array_length(hf));
10587 proto_register_alias(proto_dhcp, "bootp");
10588 proto_register_subtree_array(ett, array_length(ett));
10589 dhcp_bootp_tap = register_tap("dhcp");
10591 expert_dhcp = expert_register_protocol(proto_dhcp);
10592 expert_register_field_array(expert_dhcp, ei, array_length(ei));
10594 dhcp_option_table = register_dissector_table("dhcp.option", "BOOTP Options", proto_dhcp, FT_UINT8, BASE_DEC);
10595 dhcp_vendor_id_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_id", "DHCP Vendor ID", proto_dhcp);
10596 dhcp_vendor_info_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_info", "DHCP Vendor Info", proto_dhcp);
10597 dhcp_enterprise_class_table = register_dissector_table("dhcp.enterprise_class", "V-I Vendor Class Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10598 dhcp_enterprise_specific_table = register_dissector_table("dhcp.enterprise", "V-I Vendor Specific Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10600 /* register init/cleanup routine to handle the custom dhcp options */
10601 register_init_routine(&dhcp_init_protocol);
10602 register_cleanup_routine(&dhcp_cleanup_protocol);
10604 /* Allow dissector to find be found by name. */
10605 dhcp_handle = register_dissector("dhcp", dissect_dhcp, proto_dhcp);
10607 dhcp_module = prefs_register_protocol(proto_dhcp, NULL);
10609 prefs_register_bool_preference(dhcp_module, "novellserverstring",
10610 "Decode Option 85 as String",
10611 "Novell Servers option 85 can be configured as a string instead of address",
10612 &novell_string);
10614 prefs_register_enum_preference(dhcp_module, "pkt.ccc.protocol_version",
10615 "PacketCable CCC protocol version",
10616 "The PacketCable CCC protocol version",
10617 &pkt_ccc_protocol_version,
10618 pkt_ccc_protocol_versions,
10619 false);
10621 prefs_register_uint_preference(dhcp_module, "pkt.ccc.option",
10622 "PacketCable CCC option",
10623 "Option Number for PacketCable CableLabs Client Configuration",
10625 &pkt_ccc_option);
10627 prefs_register_enum_preference(dhcp_module, "uuid.endian",
10628 "Endianness of UUID",
10629 "Endianness applied to UUID fields",
10630 &dhcp_uuid_endian,
10631 dhcp_uuid_endian_vals,
10632 false);
10634 prefs_register_enum_preference(dhcp_module, "secs.endian",
10635 "Endianness of seconds elapsed field",
10636 "Endianness applied to seconds elapsed field",
10637 &dhcp_secs_endian,
10638 dhcp_secs_endian_vals,
10639 false);
10641 prefs_register_obsolete_preference(dhcp_module, "displayasstring");
10643 dhcp_uat = uat_new("Custom DHCP/BootP Options (Excl. suboptions)",
10644 sizeof(uat_dhcp_record_t), /* record size */
10645 "custom_bootp", /* filename */
10646 true, /* from_profile */
10647 &uat_dhcp_records, /* data_ptr */
10648 &num_dhcp_records_uat, /* numitems_ptr */
10649 UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
10650 NULL, /* help */
10651 uat_dhcp_record_copy_cb, /* copy callback */
10652 uat_dhcp_record_update_cb, /* update callback */
10653 uat_dhcp_record_free_cb, /* free callback */
10654 NULL, /* post update callback */
10655 NULL, /* reset callback */
10656 dhcp_uat_flds); /* UAT field definitions */
10658 prefs_register_uat_preference(dhcp_module,
10659 "custom_dhcp_table",
10660 "Custom DHCP/BootP Options (Excl. suboptions)",
10661 "Custom DHCP/BootP Options (Excl. suboptions)",
10662 dhcp_uat);
10664 register_stat_tap_table_ui(&dhcp_stat_table);
10667 void
10668 proto_reg_handoff_dhcp(void)
10670 range_t *dhcpopt_basictype_range;
10672 dissector_add_uint_range_with_preference("udp.port", DHCP_UDP_PORT_RANGE, dhcp_handle);
10674 /* Create dissection function handles for all DHCP/BOOTP options */
10675 dhcpopt_basic_handle = create_dissector_handle( dissect_dhcpopt_basic_type, proto_dhcp );
10676 range_convert_str(wmem_epan_scope(), &dhcpopt_basictype_range, DHCP_OPTION_BASICTYPE_RANGE, 0xFF);
10677 dissector_add_uint_range("dhcp.option", dhcpopt_basictype_range, dhcpopt_basic_handle);
10679 dissector_add_uint("dhcp.option", 21, create_dissector_handle( dissect_dhcpopt_policy_filter, proto_dhcp ));
10680 dissector_add_uint("dhcp.option", 33, create_dissector_handle( dissect_dhcpopt_static_route, proto_dhcp ));
10681 dissector_add_uint("dhcp.option", 43, create_dissector_handle( dissect_dhcpopt_vendor_specific_info, proto_dhcp ));
10682 dissector_add_uint("dhcp.option", 52, create_dissector_handle( dissect_dhcpopt_option_overload, proto_dhcp ));
10683 dissector_add_uint("dhcp.option", 53, create_dissector_handle( dissect_dhcpopt_dhcp, proto_dhcp ));
10684 dissector_add_uint("dhcp.option", 55, create_dissector_handle( dissect_dhcpopt_param_request_list, proto_dhcp ));
10685 dissector_add_uint("dhcp.option", 60, create_dissector_handle( dissect_dhcpopt_vendor_class_identifier, proto_dhcp ));
10686 dissector_add_uint("dhcp.option", 61, create_dissector_handle( dissect_dhcpopt_client_identifier, proto_dhcp ));
10687 dissector_add_uint("dhcp.option", 63, create_dissector_handle( dissect_dhcpopt_netware_ip, proto_dhcp ));
10688 dissector_add_uint("dhcp.option", 77, create_dissector_handle( dissect_dhcpopt_user_class_information, proto_dhcp ));
10689 dissector_add_uint("dhcp.option", 78, create_dissector_handle( dissect_dhcpopt_slp_directory_agent, proto_dhcp ));
10690 dissector_add_uint("dhcp.option", 79, create_dissector_handle( dissect_dhcpopt_slp_service_scope, proto_dhcp ));
10691 dissector_add_uint("dhcp.option", 81, create_dissector_handle( dissect_dhcpopt_client_full_domain_name, proto_dhcp ));
10692 dissector_add_uint("dhcp.option", 82, create_dissector_handle( dissect_dhcpopt_relay_agent_info, proto_dhcp ));
10693 dissector_add_uint("dhcp.option", 83, create_dissector_handle( dissect_dhcpopt_isns, proto_dhcp ));
10694 dissector_add_uint("dhcp.option", 85, create_dissector_handle( dissect_dhcpopt_novell_servers, proto_dhcp ));
10695 dissector_add_uint("dhcp.option", 90, create_dissector_handle( dissect_dhcpopt_dhcp_authentication, proto_dhcp ));
10696 dissector_add_uint("dhcp.option", 93, create_dissector_handle( dissect_dhcpopt_client_architecture, proto_dhcp ));
10697 dissector_add_uint("dhcp.option", 94, create_dissector_handle( dissect_dhcpopt_client_network_interface_id, proto_dhcp ));
10698 dissector_add_uint("dhcp.option", 97, create_dissector_handle( dissect_dhcpopt_client_identifier_uuid, proto_dhcp ));
10699 dissector_add_uint("dhcp.option", 99, create_dissector_handle( dissect_dhcpopt_civic_location, proto_dhcp ));
10700 dissector_add_uint("dhcp.option", 114, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10701 dissector_add_uint("dhcp.option", 117, create_dissector_handle( dissect_dhcpopt_name_server_search, proto_dhcp ));
10702 dissector_add_uint("dhcp.option", 119, create_dissector_handle( dissect_dhcpopt_dhcp_domain_search, proto_dhcp ));
10703 dissector_add_uint("dhcp.option", 120, create_dissector_handle( dissect_dhcpopt_sip_servers, proto_dhcp ));
10704 dissector_add_uint("dhcp.option", 121, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10705 /* The PacketCable CCC option number can vary. Still handled through preference */
10706 dissector_add_uint("dhcp.option", 122, create_dissector_handle( dissect_dhcpopt_packetcable_ccc, proto_dhcp ));
10708 dissector_add_uint("dhcp.option", 123, create_dissector_handle( dissect_dhcpopt_coordinate_based_location, proto_dhcp ));
10709 dissector_add_uint("dhcp.option", 124, create_dissector_handle( dissect_dhcpopt_vi_vendor_class, proto_dhcp ));
10710 dissector_add_uint("dhcp.option", 125, create_dissector_handle( dissect_dhcpopt_vi_vendor_specific_info, proto_dhcp ));
10711 dissector_add_uint("dhcp.option", 145, create_dissector_handle( dissect_dhcpopt_forcerenew_nonce, proto_dhcp ));
10712 dissector_add_uint("dhcp.option", 146, create_dissector_handle( dissect_dhcpopt_rdnss, proto_dhcp ));
10713 dissector_add_uint("dhcp.option", 151, create_dissector_handle( dissect_dhcpopt_bulk_lease_status_code, proto_dhcp ));
10714 dissector_add_uint("dhcp.option", 152, create_dissector_handle( dissect_dhcpopt_bulk_lease_base_time, proto_dhcp ));
10715 dissector_add_uint("dhcp.option", 154, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_start, proto_dhcp ));
10716 dissector_add_uint("dhcp.option", 155, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_end, proto_dhcp ));
10717 dissector_add_uint("dhcp.option", 158, create_dissector_handle( dissect_dhcpopt_pcp_server, proto_dhcp ));
10718 dissector_add_uint("dhcp.option", 159, create_dissector_handle( dissect_dhcpopt_portparams, proto_dhcp ));
10719 dissector_add_uint("dhcp.option", 160, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10720 dissector_add_uint("dhcp.option", 212, create_dissector_handle( dissect_dhcpopt_6RD_option, proto_dhcp ));
10721 dissector_add_uint("dhcp.option", 242, create_dissector_handle( dissect_dhcpopt_avaya_ip_telephone, proto_dhcp ));
10722 dissector_add_uint("dhcp.option", 249, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10724 /* Create heuristic dissection for DHCP vendor class id */
10725 heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_mta_vendor_id_heur, "PacketCable MTA", "packetcable_mta_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10726 heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_cm_vendor_id_heur, "PacketCable CM", "packetcable_cm_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10727 heur_dissector_add( "dhcp.vendor_id", dissect_apple_bsdp_vendor_id_heur, "Apple BSDP", "apple_bsdp_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10729 /* Create heuristic dissection for DHCP vendor specific information */
10731 /* Note that this is a rather weak (permissive) heuristic,
10732 it's put first so it ends up at the end of the list, I guess this is OK.
10733 Add any stronger (less permissive) heuristics after this!
10734 XXX - Should we just disable by default? */
10735 heur_dissector_add( "dhcp.vendor_info", dissect_alcatel_lucent_vendor_info_heur, "Alcatel-Lucent", "alcatel_lucent_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10737 heur_dissector_add( "dhcp.vendor_info", dissect_pxeclient_vendor_info_heur, "PXEClient", "pxeclient_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10738 heur_dissector_add( "dhcp.vendor_info", dissect_cablelabs_vendor_info_heur, "CableLabs", "cablelabs_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10739 heur_dissector_add( "dhcp.vendor_info", dissect_aruba_ap_vendor_info_heur, ARUBA_AP, "aruba_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10740 heur_dissector_add( "dhcp.vendor_info", dissect_aruba_instant_ap_vendor_info_heur, ARUBA_INSTANT_AP, "aruba_instant_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10741 heur_dissector_add( "dhcp.vendor_info", dissect_apple_bsdp_vendor_info_heur, "Apple BSDP", "apple_bsdp_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10742 heur_dissector_add( "dhcp.vendor_info", dissect_aerohive_vendor_info_heur, "AEROHIVE", "aerohive_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10743 heur_dissector_add( "dhcp.vendor_info", dissect_cisco_vendor_info_heur, "Cisco", "cisco_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10745 /* Create dissection function handles for DHCP Enterprise dissection */
10746 dissector_add_uint("dhcp.enterprise", 4491, create_dissector_handle( dissect_vendor_cl_suboption, proto_dhcp ));
10747 dissector_add_uint("dhcp.enterprise", 3561, create_dissector_handle( dissect_vendor_tr111_suboption, proto_dhcp ));
10751 * Editor modelines - https://www.wireshark.org/tools/modelines.html
10753 * Local variables:
10754 * c-basic-offset: 8
10755 * tab-width: 8
10756 * indent-tabs-mode: t
10757 * End:
10759 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
10760 * :indentSize=8:tabSize=8:noTabs=false: