Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-dhcp.c
Line
Count
Source
1
/* packet-dhcp.c
2
 * Routines for DHCP/BOOTP packet disassembly
3
 *
4
 * Copyright 1998, Gilbert Ramirez <gram@alumni.rice.edu>
5
 * Copyright 2004, Thomas Anders <thomas.anders [AT] blue-cable.de>
6
 *
7
 * Added option field filters
8
 * Copyright 2011, Michael Mann
9
 *
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
16
 *
17
 *
18
 * Copyright 2012, Jerome LAFORGE <jerome.laforge [AT] gmail.com>
19
 *
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 4014: Remote Authentication Dial-In User Service (RADIUS) Attributes Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Information Option
47
 * RFC 4174: The IPv4 Dynamic Host Configuration Protocol (DHCP) Option for the Internet Storage Name Service
48
 * RFC 4243: Vendor-Specific Information Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Option
49
 * RFC 4361: Node-specific Client Identifiers for Dynamic Host Configuration Protocol Version Four (DHCPv4)
50
 * RFC 4388: Dynamic Host Configuration Protocol (DHCP) Leasequery
51
 * RFC 4578: Dynamic Host Configuration Protocol (DHCP) Options for PXE
52
 * RFC 4776: Dynamic Host Configuration Protocol (DHCPv4 and DHCPv6) Option for Civic Addresses Configuration Information
53
 * RFC 5010: The Dynamic Host Configuration Protocol Version 4 (DHCPv4) Relay Agent Flags Suboption
54
 * RFC 5192: DHCP Options for Protocol for Carrying Authentication for Network Access (PANA) Authentication Agent
55
 * RFC 5223: Discovering Location-to-Service Translation (LoST) Servers Using the Dynamic Host Configuration Protocol (DHCP)
56
 * RFC 5417: CAPWAP Access Controller DHCP Option
57
 * RFC 5969: IPv6 Rapid Deployment on IPv4 Infrastructures (6rd)
58
 * RFC 6225: Dynamic Host Configuration Protocol Options for Coordinate-Based Location Configuration Information
59
 * RFC 6607: Virtual Subnet Selection Options for DHCPv4 and DHCPv6
60
 * RFC 6704: Forcerenew Nonce Authentication
61
 * RFC 6731: Improved Recursive DNS Server Selection for Multi-Interfaced Nodes
62
 * RFC 6926: DHCPv4 Bulk Leasequery
63
 * RFC 7291: DHCP Options for the Port Control Protocol (PCP)
64
 * RFC 7618: Dynamic Allocation of Shared IPv4 Addresses
65
 * RFC 7710: Captive-Portal Identification Using DHCP or Router Advertisements (RAs)
66
 * RFC 7724: Active DHCPv4 Lease Query
67
 * RFC 7839: Access-Network-Identifier Option in DHCP
68
 * RFC 8357: Generalized UDP Source Port for DHCP Relay
69
 * RFC 8910: Captive-Portal Identification in DHCP and Router Advertisements (RAs)
70
 * RFC 8925: IPv6-Only Preferred Option for DHCPv4
71
 * RFC 8973: DDoS Open Threat Signaling (DOTS) Agent Discovery
72
 * draft-ietf-dhc-fqdn-option-07.txt
73
 * 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]
74
 * BOOTP and DHCP Parameters
75
 *     https://www.iana.org/assignments/bootp-dhcp-parameters
76
 * DOCSIS(TM) 2.0 Radio Frequency Interface Specification
77
 *     https://specification-search.cablelabs.com/radio-frequency-interface-specification-2
78
 * DOCSIS(TM) 3.0 MAC and Upper Layer Protocols Interface Specification
79
 *     https://specification-search.cablelabs.com/CM-SP-MULPIv3.0
80
 * PacketCable(TM) 1.0 MTA Device Provisioning Specification
81
 *     https://specification-search.cablelabs.com/packetcable-mta-device-provisioning-specification
82
 * PacketCable(TM) 1.5 MTA Device Provisioning Specification
83
 *     https://specification-search.cablelabs.com/packetcable-1-5-mta-device-provisioning-specification
84
 * PacketCable(TM) 2.0 E-UE Device Provisioning Data Model Specification
85
 *     https://specification-search.cablelabs.com/e-ue-provisioning-data-model-specification
86
 * Business Services over DOCSIS(R) Layer 2 Virtual Private Networks
87
 *     https://specification-search.cablelabs.com/business-services-over-docsis-layer-2-virtual-private-networks
88
 * CableHome(TM) 1.1 Specification
89
 *     https://web.archive.org/web/20060628173459/http://www.cablelabs.com/projects/cablehome/downloads/specs/CH-SP-CH1.1-I11-060407.pdf
90
 * Broadband Forum TR-111
91
 *     https://web.archive.org/web/20150307135117/http://www.broadband-forum.org/technical/download/TR-111.pdf
92
 * Boot Server Discovery Protocol (BSDP)
93
 *     https://opensource.apple.com/source/bootp/bootp-198.1/Documentation/BSDP.doc
94
 * [MS-DHCPE] DHCPv4 Option Code 77 (0x4D) - User Class Option
95
 *     https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/fe8a2dd4-1e8c-4546-bacd-4ae10de02058
96
 *
97
 *  * Copyright 2023, Colin McInnes <colin.mcinnes [AT] vecima.com>
98
 * Added additional CableLabs Vendor Class IDs (Option 60) to CableLabs heuristic from:
99
 * Remote PHY Specification
100
 *     https://www.cablelabs.com/specifications/CM-SP-R-PHY
101
 * Flexible MAC Architecture System Specification
102
 *     https://www.cablelabs.com/specifications/CM-SP-FMA-SYS
103
 * Data-Over-Cable Service Interface Specifications, eDOCSIS Specification
104
 *     https://www.cablelabs.com/specifications/CM-SP-eDOCSIS
105
 * Data-Over-Cable Service Interface Specifications, IPv4 and IPv6 eRouter Specification
106
 *     https://www.cablelabs.com/specifications/CM-SP-eRouter
107
 * OpenCable Tuning Resolver Interface Specification
108
 *     https://www.cablelabs.com/specifications/OC-SP-TRIF
109
 * DPoE Demarcation Device Specification
110
 *     https://www.cablelabs.com/specifications/DPoE-SP-DEMARCv1.0
111
 *
112
 * Wireshark - Network traffic analyzer
113
 * By Gerald Combs <gerald@wireshark.org>
114
 * Copyright 1998 Gerald Combs
115
 *
116
 * SPDX-License-Identifier: GPL-2.0-or-later
117
 */
118
119
/*
120
 * Some of the development of the DHCP/BOOTP protocol decoder was sponsored by
121
 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
122
 * CableLabs' specifications. Your license and use of this protocol decoder
123
 * does not mean that you are licensed to use the CableLabs'
124
 * specifications.  If you have questions about this protocol, contact
125
 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
126
 * information.
127
 */
128
129
130
#include "config.h"
131
132
#include <stdio.h>    /* for sscanf() */
133
134
#include <epan/packet.h>
135
#include "packet-arp.h"
136
#include "packet-dns.h"       /* for get_dns_name() */
137
#include "packet-radius.h"
138
#include <epan/addr_resolv.h>
139
#include <epan/prefs.h>
140
#include <epan/tap.h>
141
#include <epan/stat_tap_ui.h>
142
#include <epan/arptypes.h>
143
#include <epan/expert.h>
144
#include <epan/uat.h>
145
#include <epan/sminmpec.h>
146
#include <epan/tfs.h>
147
148
#include <wsutil/str_util.h>
149
#include <wsutil/strtoi.h>
150
#include <wsutil/array.h>
151
#include <wsutil/ws_padding_to.h>
152
153
void proto_register_dhcp(void);
154
void proto_reg_handoff_dhcp(void);
155
156
static int dhcp_bootp_tap;
157
static int proto_dhcp;
158
static int hf_dhcp_type;
159
static int hf_dhcp_hw_type;
160
static int hf_dhcp_hw_len;
161
static int hf_dhcp_hops;
162
static int hf_dhcp_id;
163
static int hf_dhcp_secs;
164
static int hf_dhcp_flags;
165
static int hf_dhcp_flags_broadcast;
166
static int hf_dhcp_flags_reserved;
167
static int hf_dhcp_ip_client;
168
static int hf_dhcp_ip_your;
169
static int hf_dhcp_ip_server;
170
static int hf_dhcp_ip_relay;
171
static int hf_dhcp_hw_addr;
172
static int hf_dhcp_hw_addr_padding;
173
static int hf_dhcp_hw_ether_addr;
174
static int hf_dhcp_server;
175
static int hf_dhcp_file;
176
static int hf_dhcp_cookie;
177
static int hf_dhcp_vendor_specific_options;
178
static int hf_dhcp_bootp;
179
static int hf_dhcp_fqdn_flags;
180
static int hf_dhcp_fqdn_s;
181
static int hf_dhcp_fqdn_o;
182
static int hf_dhcp_fqdn_e;
183
static int hf_dhcp_fqdn_n;
184
static int hf_dhcp_fqdn_mbz;
185
static int hf_dhcp_fqdn_rcode1;
186
static int hf_dhcp_fqdn_rcode2;
187
static int hf_dhcp_fqdn_name;
188
static int hf_dhcp_fqdn_asciiname;
189
static int hf_dhcp_pkt_mta_cap_len;
190
static int hf_dhcp_pkt_mta_cap_type;
191
static int hf_dhcp_docsis_cm_cap_type;
192
static int hf_dhcp_docsis_cm_cap_len;
193
static int hf_dhcp_client_identifier_uuid;
194
static int hf_dhcp_client_id_iaid;
195
static int hf_dhcp_client_id_duid_type;
196
static int hf_dhcp_client_hardware_address;
197
static int hf_dhcp_client_identifier_duid_llt_hw_type;
198
static int hf_dhcp_client_identifier_duid_ll_hw_type;
199
static int hf_dhcp_client_identifier_time;
200
static int hf_dhcp_client_identifier_link_layer_address;
201
static int hf_dhcp_client_identifier_link_layer_address_ether;
202
static int hf_dhcp_client_identifier_enterprise_num;
203
static int hf_dhcp_client_identifier;
204
static int hf_dhcp_client_identifier_type;
205
static int hf_dhcp_client_identifier_undef;
206
static int hf_dhcp_option_type;
207
static int hf_dhcp_option_length;
208
static int hf_dhcp_option_value;
209
static int hf_dhcp_option_value_8;
210
static int hf_dhcp_option_value_16;
211
static int hf_dhcp_option_value_u32;
212
static int hf_dhcp_option_value_s_secs;
213
static int hf_dhcp_option_value_u_secs;
214
static int hf_dhcp_option_value_stringz;
215
static int hf_dhcp_option_value_ip_address;
216
static int hf_dhcp_option_value_boolean;
217
static int hf_dhcp_option_rfc_3396_detected;
218
static int hf_dhcp_suboption_length;
219
220
static int hf_dhcp_option_padding;          /* 0 */
221
static int hf_dhcp_option_subnet_mask;        /* 1 */
222
static int hf_dhcp_option_time_offset;        /* 2 */
223
static int hf_dhcp_option_router;         /* 3 */
224
static int hf_dhcp_option_time_server;        /* 4 */
225
static int hf_dhcp_option_name_server;        /* 5 */
226
static int hf_dhcp_option_domain_name_server;     /* 6 */
227
static int hf_dhcp_option_log_server;       /* 7 */
228
static int hf_dhcp_option_quotes_server;        /* 8 */
229
static int hf_dhcp_option_lpr_server;       /* 9 */
230
static int hf_dhcp_option_impress_server;       /* 10 */
231
static int hf_dhcp_option_resource_location_server;   /* 11 */
232
static int hf_dhcp_option_hostname;       /* 12 */
233
static int hf_dhcp_option_boot_file_size;       /* 13 */
234
static int hf_dhcp_option_merit_dump_file;        /* 14 */
235
static int hf_dhcp_option_domain_name;        /* 15 */
236
static int hf_dhcp_option_swap_server;        /* 16 */
237
static int hf_dhcp_option_root_path;        /* 17 */
238
static int hf_dhcp_option_extension_path;       /* 18 */
239
static int hf_dhcp_option_ip_forwarding;        /* 19 */
240
static int hf_dhcp_option_non_local_source_routing;   /* 20 */
241
static int hf_dhcp_option_policy_filter_ip;     /* 21 - IP address */
242
static int hf_dhcp_option_policy_filter_subnet_mask;    /* 21 - Subnet mask */
243
static int hf_dhcp_option_max_datagram_reassembly_size;   /* 22 */
244
static int hf_dhcp_option_default_ip_ttl;       /* 23 */
245
static int hf_dhcp_option_path_mtu_aging_timeout;     /* 24 */
246
static int hf_dhcp_option_path_mtu_plateau_table_item;    /* 25 */
247
static int hf_dhcp_option_interface_mtu;        /* 26 */
248
static int hf_dhcp_option_all_subnets_are_local;      /* 27 */
249
static int hf_dhcp_option_broadcast_address;      /* 28 */
250
static int hf_dhcp_option_perform_mask_discovery;     /* 29 */
251
static int hf_dhcp_option_mask_supplier;        /* 30 */
252
static int hf_dhcp_option_perform_router_discover;      /* 31 */
253
static int hf_dhcp_option_router_solicitation_address;    /* 32 */
254
static int hf_dhcp_option_static_route_ip;        /* 33 - Destination IP */
255
static int hf_dhcp_option_static_route_router;      /* 33 - Router */
256
static int hf_dhcp_option_trailer_encapsulation;      /* 34 */
257
static int hf_dhcp_option_arp_cache_timeout;      /* 35 */
258
static int hf_dhcp_option_ethernet_encapsulation;     /* 36 */
259
static int hf_dhcp_option_tcp_default_ttl;        /* 37 */
260
static int hf_dhcp_option_tcp_keepalive_interval;     /* 38 */
261
static int hf_dhcp_option_tcp_keepalive_garbage;      /* 39 */
262
static int hf_dhcp_option_nis_domain;       /* 40 */
263
static int hf_dhcp_option_nis_server;       /* 41 */
264
static int hf_dhcp_option_ntp_server;       /* 42 */
265
266
static int hf_dhcp_option43_suboption;          /* 43 unknown vendor suboption */
267
static int hf_dhcp_option43_value;          /* 43 suboption value */
268
static int hf_dhcp_option43_value_8;        /* 43 suboption value */
269
static int hf_dhcp_option43_value_32;       /* 43 suboption value */
270
static int hf_dhcp_option43_value_stringz;        /* 43 suboption value */
271
static int hf_dhcp_option43_value_ip_address;     /* 43 suboption value */
272
273
static int hf_dhcp_option43_pxeclient_suboption;      /* 43 suboption */
274
static int hf_dhcp_option43_pxeclient_padding;      /* 43:0 PXE  */
275
static int hf_dhcp_option43_pxeclient_mtftp_ip;     /* 43:1 PXE  */
276
static int hf_dhcp_option43_pxeclient_mtftp_client_port;    /* 43:2 PXE  */
277
static int hf_dhcp_option43_pxeclient_mtftp_server_port;    /* 43:3 PXE  */
278
static int hf_dhcp_option43_pxeclient_mtftp_timeout;    /* 43:4 PXE  */
279
static int hf_dhcp_option43_pxeclient_mtftp_delay;      /* 43:5 PXE  */
280
static int hf_dhcp_option43_pxeclient_discovery_control;    /* 43:6 PXE  */
281
static int hf_dhcp_option43_pxeclient_discovery_control_bc; /* 43:6 PXE  */
282
static int hf_dhcp_option43_pxeclient_discovery_control_mc; /* 43:6 PXE  */
283
static int hf_dhcp_option43_pxeclient_discovery_control_serverlist; /* 43:6 PXE  */
284
static int hf_dhcp_option43_pxeclient_discovery_control_bstrap; /* 43:6 PXE  */
285
static int hf_dhcp_option43_pxeclient_multicast_address;    /* 43:7 PXE  */
286
static int hf_dhcp_option43_pxeclient_boot_servers;   /* 43:8 PXE  */
287
static int hf_dhcp_option43_pxeclient_boot_server_type;   /* 43:8 PXE  */
288
static int hf_dhcp_option43_pxeclient_boot_server_count;    /* 43:8 PXE  */
289
static int hf_dhcp_option43_pxeclient_boot_server_ip;   /* 43:8 PXE  */
290
static int hf_dhcp_option43_pxeclient_boot_menu;      /* 43:9 PXE  */
291
static int hf_dhcp_option43_pxeclient_boot_menu_type;   /* 43:9 PXE  */
292
static int hf_dhcp_option43_pxeclient_boot_menu_length;   /* 43:9 PXE  */
293
static int hf_dhcp_option43_pxeclient_boot_menu_desc;   /* 43:9 PXE  */
294
static int hf_dhcp_option43_pxeclient_menu_prompt;      /* 43:10 PXE  */
295
static int hf_dhcp_option43_pxeclient_menu_prompt_timeout;    /* 43:10 PXE  */
296
static int hf_dhcp_option43_pxeclient_menu_prompt_prompt;   /* 43:10 PXE  */
297
static int hf_dhcp_option43_pxeclient_multicast_address_alloc;  /* 43:11 PXE  */
298
static int hf_dhcp_option43_pxeclient_credential_types;   /* 43:12 PXE  */
299
static int hf_dhcp_option43_pxeclient_boot_item;      /* 43:71 PXE  */
300
static int hf_dhcp_option43_pxeclient_boot_item_type;   /* 43:71 PXE  */
301
static int hf_dhcp_option43_pxeclient_boot_item_layer;    /* 43:71 PXE  */
302
static int hf_dhcp_option43_pxeclient_lcm_server;     /* 43:179 PXE  */
303
static int hf_dhcp_option43_pxeclient_lcm_domain;     /* 43:180 PXE  */
304
static int hf_dhcp_option43_pxeclient_lcm_nic_option;   /* 43:181 PXE  */
305
static int hf_dhcp_option43_pxeclient_lcm_workgroup;    /* 43:190 PXE  */
306
static int hf_dhcp_option43_pxeclient_discovery;      /* 43:191 PXE  */
307
static int hf_dhcp_option43_pxeclient_configured;     /* 43:192 PXE  */
308
static int hf_dhcp_option43_pxeclient_lcm_version;      /* 43:193 PXE  */
309
static int hf_dhcp_option43_pxeclient_lcm_serial;     /* 43:194 PXE  */
310
static int hf_dhcp_option43_pxeclient_end;        /* 43:255 PXE */
311
312
static int hf_dhcp_option43_cl_suboption;       /* 43 suboption */
313
static int hf_dhcp_option43_cl_padding;       /* 43:0 CL  */
314
static int hf_dhcp_option43_cl_suboption_request_list;    /* 43:1 CL  */
315
static int hf_dhcp_option43_cl_device_type;     /* 43:2 CL  */
316
static int hf_dhcp_option43_cl_esafe_type;        /* 43:3 CL  */
317
static int hf_dhcp_option43_cl_serial_number;     /* 43:4 CL  */
318
static int hf_dhcp_option43_cl_hardware_version;      /* 43:5 CL  */
319
static int hf_dhcp_option43_cl_software_version;      /* 43:6 CL  */
320
static int hf_dhcp_option43_cl_boot_rom_version;      /* 43:7 CL  */
321
static int hf_dhcp_option43_cl_oui_bytes;       /* 43:8 CL  */
322
static int hf_dhcp_option43_cl_oui_string;        /* 43:8 CL  */
323
static int hf_dhcp_option43_cl_model_number;      /* 43:9 CL  */
324
static int hf_dhcp_option43_cl_vendor_name10;     /* 43:10 CL  */
325
static int hf_dhcp_option43_cl_address_realm;     /* 43:11 CL  */
326
static int hf_dhcp_option43_cl_cm_ps_system_desc;     /* 43:12 CL  */
327
static int hf_dhcp_option43_cl_cm_ps_firmware_revision;   /* 43:13 CL  */
328
static int hf_dhcp_option43_cl_firewall_policy_file_version;  /* 43:14 CL  */
329
static int hf_dhcp_option43_cl_esafe_config_file_devices;   /* 43:15 CL  */
330
static int hf_dhcp_option43_cl_video_security_tape;   /* 43:18 CL  */
331
static int hf_dhcp_option43_cl_mta_mac_address;     /* 43:31 CL  */
332
static int hf_dhcp_option43_cl_correlation_ID;      /* 43:32 CL  */
333
static int hf_dhcp_option43_cl_vendor_name51;     /* 43:51 CL  */
334
static int hf_dhcp_option43_cl_cablecard_capability;    /* 43:52 CL  */
335
static int hf_dhcp_option43_cl_device_id_ca;      /* 43:53 CL  */
336
static int hf_dhcp_option43_cl_device_id_x509;      /* 43:54 CL  */
337
static int hf_dhcp_option43_cl_end;       /* 43:255 CL */
338
339
static int hf_dhcp_option43_aerohive_suboption;     /* 43 suboption */
340
static int hf_dhcp_option43_aerohive_unknown;     /* 43:X AEROHIVE */
341
static int hf_dhcp_option43_aerohive_xiqhostname;     /* 43:225 AEROHIVE */
342
static int hf_dhcp_option43_aerohive_xiqipaddress;      /* 43:226 AEROHIVE */
343
344
static int hf_dhcp_option43_bsdp_suboption;     /* 43 suboption */
345
static int hf_dhcp_option43_bsdp_message_type;      /* 43:1 BSDP  */
346
static int hf_dhcp_option43_bsdp_version;       /* 43:2 BSDP  */
347
static int hf_dhcp_option43_bsdp_server_identifier;   /* 43:3 BSDP  */
348
static int hf_dhcp_option43_bsdp_server_priority;     /* 43:4 BSDP  */
349
static int hf_dhcp_option43_bsdp_reply_port;      /* 43:5 BSDP  */
350
static int hf_dhcp_option43_bsdp_boot_image_list_path;    /* 43:6 BSDP  */
351
static int hf_dhcp_option43_bsdp_default_boot_image_id;   /* 43:7 BSDP  */
352
static int hf_dhcp_option43_bsdp_selected_boot_image_id;    /* 43:8 BSDP  */
353
static int hf_dhcp_option43_bsdp_boot_image_list;     /* 43:9 BSDP  */
354
static int hf_dhcp_option43_bsdp_netboot_firmware;      /* 43:10 BSDP  */
355
static int hf_dhcp_option43_bsdp_attributes_filter_list;    /* 43:11 BSDP  */
356
static int hf_dhcp_option43_bsdp_message_size;      /* 43:12 BSDP  */
357
static int hf_dhcp_option43_bsdp_boot_image_index;      /* 43 BSDP  */
358
static int hf_dhcp_option43_bsdp_boot_image_attribute;    /* 43 BSDP  */
359
static int hf_dhcp_option43_bsdp_boot_image_attribute_install;  /* 43 BSDP  */
360
static int hf_dhcp_option43_bsdp_boot_image_attribute_kind; /* 43 BSDP  */
361
static int hf_dhcp_option43_bsdp_boot_image_attribute_reserved; /* 43 BSDP  */
362
static int hf_dhcp_option43_bsdp_image_desc;      /* 43 BSDP  */
363
static int hf_dhcp_option43_bsdp_boot_image_name;     /* 43 BSDP  */
364
static int hf_dhcp_option43_bsdp_boot_image_name_len;   /* 43 BSDP  */
365
366
static int hf_dhcp_option43_cisco_suboption;      /* 43 Cisco */
367
static int hf_dhcp_option43_cisco_unknown;        /* 43 Cisco */
368
static int hf_dhcp_option43_cisco_unknown1;     /* 43:1 Cisco */
369
static int hf_dhcp_option43_cisco_unknown2;     /* 43:2 Cisco */
370
static int hf_dhcp_option43_cisco_unknown3;     /* 43:3 Cisco */
371
static int hf_dhcp_option43_cisco_nodeid;       /* 43:4 Cisco */
372
static int hf_dhcp_option43_cisco_unknown5;     /* 43:5 Cisco */
373
static int hf_dhcp_option43_cisco_unknown6;     /* 43:6 Cisco */
374
static int hf_dhcp_option43_cisco_model;        /* 43:7 Cisco */
375
static int hf_dhcp_option43_cisco_apicuuid;     /* 43:8 Cisco */
376
static int hf_dhcp_option43_cisco_fabricname;     /* 43:9 Cisco */
377
static int hf_dhcp_option43_cisco_unknown10;      /* 43:10 Cisco */
378
static int hf_dhcp_option43_cisco_serialno;     /* 43:11 Cisco */
379
static int hf_dhcp_option43_cisco_clientint;      /* 43:12 Cisco */
380
381
static int hf_dhcp_option43_alcatel_suboption;      /* 43 suboption */
382
static int hf_dhcp_option43_alcatel_padding;      /* 43:0 Alcatel  */
383
static int hf_dhcp_option43_alcatel_vlan_id;      /* 43:58 Alcatel  */
384
static int hf_dhcp_option43_alcatel_tftp1;        /* 43:64 Alcatel  */
385
static int hf_dhcp_option43_alcatel_tftp2;        /* 43:65 Alcatel  */
386
static int hf_dhcp_option43_alcatel_app_type;     /* 43:66 Alcatel  */
387
static int hf_dhcp_option43_alcatel_sip_url;      /* 43:67 Alcatel  */
388
static int hf_dhcp_option43_alcatel_end;        /* 43:255 Alcatel */
389
390
static int hf_dhcp_option43_arubaap_controllerip;     /* 43: ArubaAP*/
391
static int hf_dhcp_option43_arubaiap;       /* 43: ArubaIAP*/
392
static int hf_dhcp_option43_arubaiap_nameorg;     /* 43: ArubaIAP: Name Organisation*/
393
static int hf_dhcp_option43_arubaiap_ampip;     /* 43: ArubaIAP: AMP IP Address*/
394
static int hf_dhcp_option43_arubaiap_password;      /* 43 :ArubaIAP: Password*/
395
396
static int hf_dhcp_option_netbios_over_tcpip_name_server;   /* 44 */
397
static int hf_dhcp_option_netbios_over_tcpip_dd_name_server;  /* 45 */
398
static int hf_dhcp_option_netbios_over_tcpip_node_type;   /* 46 */
399
static int hf_dhcp_option_netbios_over_tcpip_scope;   /* 47 */
400
static int hf_dhcp_option_xwindows_system_font_server;    /* 48 */
401
static int hf_dhcp_option_xwindows_system_display_manager;    /* 49 */
402
static int hf_dhcp_option_requested_ip_address;     /* 50 */
403
static int hf_dhcp_option_ip_address_lease_time;      /* 51 */
404
static int hf_dhcp_option_option_overload;        /* 52 */
405
static int hf_dhcp_option_dhcp;         /* 53 */
406
static int hf_dhcp_option_dhcp_server_id;       /* 54 */
407
static int hf_dhcp_option_parameter_request_list_item;    /* 55 */
408
static int hf_dhcp_option_message;          /* 56 */
409
static int hf_dhcp_option_dhcp_max_message_size;      /* 57 */
410
static int hf_dhcp_option_renewal_time_value;     /* 58 */
411
static int hf_dhcp_option_rebinding_time_value;     /* 59 */
412
static int hf_dhcp_option_vendor_class_id;        /* 60 */
413
static int hf_dhcp_option_vendor_class_data;      /* 60 */
414
415
static int hf_dhcp_option_novell_netware_ip_domain;   /* 62 */
416
417
static int hf_dhcp_option63_suboption;        /* 63 suboption */
418
static int hf_dhcp_option63_value;          /* 63 suboption value */
419
static int hf_dhcp_option63_value_8;        /* 63 suboption value */
420
static int hf_dhcp_option63_value_ip_address;     /* 63 suboption value */
421
static int hf_dhcp_option63_value_boolean;        /* 63 suboption value */
422
static int hf_dhcp_option63_broadcast;        /* 63:5 */
423
static int hf_dhcp_option63_preferred_dss_server;     /* 63:6 */
424
static int hf_dhcp_option63_nearest_nwip_server;      /* 63:7 */
425
static int hf_dhcp_option63_autoretries;        /* 63:8 */
426
static int hf_dhcp_option63_autoretry_delay;      /* 63:9 */
427
static int hf_dhcp_option63_support_netware_v1_1;     /* 63:10 */
428
static int hf_dhcp_option63_primary_dss;        /* 63:11 */
429
430
static int hf_dhcp_option_nis_plus_domain;        /* 64 */
431
static int hf_dhcp_option_nis_plus_server;        /* 65 */
432
static int hf_dhcp_option_tftp_server_name;     /* 66 */
433
static int hf_dhcp_option_bootfile_name;        /* 67 */
434
static int hf_dhcp_option_mobile_ip_home_agent;     /* 68 */
435
static int hf_dhcp_option_smtp_server;        /* 69 */
436
static int hf_dhcp_option_pop3_server;        /* 70 */
437
static int hf_dhcp_option_nntp_server;        /* 71 */
438
static int hf_dhcp_option_default_www_server;     /* 72 */
439
static int hf_dhcp_option_default_finger_server;      /* 73 */
440
static int hf_dhcp_option_default_irc_server;     /* 74 */
441
static int hf_dhcp_option_streettalk_server;      /* 75 */
442
static int hf_dhcp_option_streettalk_da_server;     /* 76 */
443
static int hf_dhcp_option77_user_class;       /* 77 User Class instance */
444
static int hf_dhcp_option77_user_class_length;      /* 77 length of User Class instance */
445
static int hf_dhcp_option77_user_class_data;      /* 77 data of User Class instance */
446
static int hf_dhcp_option77_user_class_text;      /* 77 User class text */
447
static int hf_dhcp_option77_user_class_binary_data_length;  /* 77, Microsoft */
448
static int hf_dhcp_option77_user_class_binary_data;   /* 77, Microsoft */
449
static int hf_dhcp_option77_user_class_padding;     /* 77, Microsoft */
450
static int hf_dhcp_option77_user_class_name_length;   /* 77, Microsoft */
451
static int hf_dhcp_option77_user_class_name;        /* 77, Microsoft */
452
static int hf_dhcp_option77_user_class_description_length;  /* 77, Microsoft */
453
static int hf_dhcp_option77_user_class_description;   /* 77, Microsoft */
454
static int hf_dhcp_option_slp_directory_agent_value;    /* 78 */
455
static int hf_dhcp_option_slp_directory_agent_slpda_address;  /* 78 */
456
static int hf_dhcp_option_slp_service_scope_value;      /* 79 */
457
static int hf_dhcp_option_slp_service_scope_string;   /* 79 */
458
459
static int hf_dhcp_option82_suboption;        /* 82 suboption */
460
static int hf_dhcp_option82_value;          /* 82 suboption value */
461
static int hf_dhcp_option82_value_8;        /* 82 suboption value */
462
static int hf_dhcp_option82_value_16;       /* 82 suboption value */
463
static int hf_dhcp_option82_value_32;       /* 82 suboption value */
464
static int hf_dhcp_option82_value_ip_address;     /* 82 suboption value */
465
static int hf_dhcp_option82_value_stringz;        /* 82 suboption value */
466
static int hf_dhcp_option82_padding;        /* 82:0 */
467
static int hf_dhcp_option82_agent_circuit_id;     /* 82:1 */
468
static int hf_dhcp_option82_agent_remote_id;      /* 82:2 */
469
static int hf_dhcp_option82_reserved;       /* 82:3 */
470
static int hf_dhcp_option82_docsis_device_class;      /* 82:4 */
471
static int hf_dhcp_option82_link_selection;     /* 82:5 */
472
static int hf_dhcp_option82_subscriber_id;        /* 82:6 */
473
static int hf_dhcp_option82_radius_attributes;      /* 82:7 */
474
static int hf_dhcp_option82_authentication;     /* 82:8 */
475
static int hf_dhcp_option82_vi;         /* 82:9 */
476
                  /* 82:9 suboptions */
477
static int hf_dhcp_option82_vi_enterprise;
478
static int hf_dhcp_option82_vi_data_length;
479
static int hf_dhcp_option82_vi_cl_option;
480
static int hf_dhcp_option82_vi_cl_option_length;
481
static int hf_dhcp_option82_vi_cl_tag;
482
static int hf_dhcp_option82_vi_cl_tag_length;
483
static int hf_dhcp_option82_vi_cl_docsis_version;     /* 82:9:4491:1 */
484
static int hf_dhcp_option82_vi_cl_dpoe_system_version;    /* 82:9:4491:2 */
485
static int hf_dhcp_option82_vi_cl_dpoe_system_pbb_service;    /* 82:9:4491:4 */
486
static int hf_dhcp_option82_vi_cl_service_class_name;   /* 82:9:4491:5 */
487
static int hf_dhcp_option82_vi_cl_mso_defined_text;   /* 82:9:4491:6 */
488
static int hf_dhcp_option82_vi_cl_secure_file_transfer_uri; /* 82:9:4491:7 */
489
                  /* 82:9 suboptions end */
490
static int hf_dhcp_option82_flags;          /* 82:10 */
491
static int hf_dhcp_option82_flags_unicast;      /* 82:10 */
492
static int hf_dhcp_option82_flags_reserved;     /* 82:10 */
493
static int hf_dhcp_option82_server_id_override;     /* 82:11 */
494
static int hf_dhcp_option82_relay_agent_id;     /* 82:12 */
495
static int hf_dhcp_option82_option_ani_att;     /* 82:13 */
496
static int hf_dhcp_option82_option_ani_att_res;
497
static int hf_dhcp_option82_option_ani_att_att;
498
static int hf_dhcp_option82_option_ani_network_name;    /* 82:14 */
499
static int hf_dhcp_option82_option_ani_ap_name;     /* 82:15 */
500
static int hf_dhcp_option82_option_ani_ap_bssid;      /* 82:16 */
501
static int hf_dhcp_option82_option_ani_operator_id;   /* 82:17 */
502
static int hf_dhcp_option82_option_ani_operator_realm;    /* 82:18 */
503
static int hf_dhcp_option82_option_source_port;     /* 82:19 */
504
static int hf_dhcp_option82_link_selection_cisco;     /* 82:150 */
505
static int hf_dhcp_option82_vrf_name_vpn_id;      /* 82:151 */
506
                  /* 82:151 suboptions */
507
static int hf_dhcp_option82_vrf_name_global;
508
static int hf_dhcp_option82_vrf_name;
509
static int hf_dhcp_option82_vrf_name_vpn_id_oui;
510
static int hf_dhcp_option82_vrf_name_vpn_id_index;
511
                  /* 82:151 suboptions end */
512
static int hf_dhcp_option82_server_id_override_cisco;   /* 82:152 */
513
514
static int hf_dhcp_option_isns_functions;
515
static int hf_dhcp_option_isns_functions_enabled;
516
static int hf_dhcp_option_isns_functions_dd_authorization;
517
static int hf_dhcp_option_isns_functions_sec_policy_distibution;
518
static int hf_dhcp_option_isns_functions_reserved;
519
520
static int hf_dhcp_option_isns_discovery_domain_access;
521
static int hf_dhcp_option_isns_discovery_domain_access_enabled;
522
static int hf_dhcp_option_isns_discovery_domain_access_control_node;
523
static int hf_dhcp_option_isns_discovery_domain_access_iscsi_target;
524
static int hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator;
525
static int hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port;
526
static int hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port;
527
static int hf_dhcp_option_isns_discovery_domain_access_reserved;
528
529
static int hf_dhcp_option_isns_administrative_flags;
530
static int hf_dhcp_option_isns_administrative_flags_enabled;
531
static int hf_dhcp_option_isns_administrative_flags_heartbeat;
532
static int hf_dhcp_option_isns_administrative_flags_management_scns;
533
static int hf_dhcp_option_isns_administrative_flags_default_dd;
534
static int hf_dhcp_option_isns_administrative_flags_reserved;
535
536
static int hf_dhcp_option_isns_server_security_bitmap;
537
static int hf_dhcp_option_isns_server_security_bitmap_enabled;
538
static int hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled;
539
static int hf_dhcp_option_isns_server_security_bitmap_main_mode;
540
static int hf_dhcp_option_isns_server_security_bitmap_aggressive_mode;
541
static int hf_dhcp_option_isns_server_security_bitmap_pfs;
542
static int hf_dhcp_option_isns_server_security_bitmap_transport_mode;
543
static int hf_dhcp_option_isns_server_security_bitmap_tunnel_mode;
544
static int hf_dhcp_option_isns_server_security_bitmap_reserved;
545
546
static int hf_dhcp_option_isns_heartbeat_originator_addr;
547
static int hf_dhcp_option_isns_primary_server_addr;
548
static int hf_dhcp_option_isns_secondary_server_addr_list;
549
550
static int hf_dhcp_option_novell_dss_string;      /* 85 */
551
static int hf_dhcp_option_novell_dss_ip;        /* 85 */
552
static int hf_dhcp_option_novell_ds_tree_name;      /* 86 */
553
static int hf_dhcp_option_novell_ds_context;      /* 87 */
554
static int hf_dhcp_option_dhcp_authentication_protocol;   /* 90 */
555
static int hf_dhcp_option_dhcp_authentication_alg_delay;    /* 90 */
556
static int hf_dhcp_option_dhcp_authentication_algorithm;    /* 90 */
557
static int hf_dhcp_option_dhcp_authentication_rdm;      /* 90 */
558
static int hf_dhcp_option_dhcp_authentication_rdm_replay_detection;   /* 90 */
559
static int hf_dhcp_option_dhcp_authentication_rdm_rdv;    /* 90 */
560
static int hf_dhcp_option_dhcp_authentication_secret_id;    /* 90 */
561
static int hf_dhcp_option_dhcp_authentication_hmac_md5_hash;  /* 90 */
562
static int hf_dhcp_option_dhcp_authentication_information;    /* 90 */
563
static int hf_dhcp_option_client_last_transaction_time;   /* 91 */
564
static int hf_dhcp_option_associated_ip_option;     /* 92 */
565
static int hf_dhcp_option_client_system_architecture;   /* 93 */
566
static int hf_dhcp_option_client_network_id_major_ver;    /* 94 */
567
static int hf_dhcp_option_client_network_id_minor_ver;    /* 94 */
568
static int hf_dhcp_option_civic_location_what;      /* 99 */
569
static int hf_dhcp_option_civic_location_country;     /* 99 */
570
static int hf_dhcp_option_civic_location_ca_type;     /* 99 */
571
static int hf_dhcp_option_civic_location_ca_length;   /* 99 */
572
static int hf_dhcp_option_civic_location_ca_value;      /* 99 */
573
static int hf_dhcp_option_tz_pcode;       /* 100 */
574
static int hf_dhcp_option_tz_tcode;       /* 101 */
575
static int hf_dhcp_option_ipv6_only_preferred_wait_time;    /* 108 */
576
static int hf_dhcp_option_netinfo_parent_server_address;    /* 112 */
577
static int hf_dhcp_option_netinfo_parent_server_tag;    /* 113 */
578
static int hf_dhcp_option_captive_portal;       /* 114 (ex 160) */
579
static int hf_dhcp_option_dhcp_auto_configuration;      /* 116 */
580
static int hf_dhcp_option_dhcp_name_service_search_option;    /* 117 */
581
static int hf_dhcp_option_dhcp_dns_domain_search_list_fqdn;   /* 119 */
582
static int hf_dhcp_option_sip_server_enc;       /* 120 */
583
static int hf_dhcp_option_sip_server_name;        /* 120 */
584
static int hf_dhcp_option_sip_server_address;     /* 120 */
585
static int hf_dhcp_option_classless_static_route;     /* 120 */
586
static int hf_dhcp_option_rfc3825_error;        /* 123 */
587
static int hf_dhcp_option_rfc3825_latitude;     /* 123 */
588
static int hf_dhcp_option_rfc3825_longitude;      /* 123 */
589
static int hf_dhcp_option_rfc3825_latitude_res;     /* 123 */
590
static int hf_dhcp_option_rfc3825_longitude_res;      /* 123 */
591
static int hf_dhcp_option_rfc3825_altitude;     /* 123 */
592
static int hf_dhcp_option_rfc3825_altitude_res;     /* 123 */
593
static int hf_dhcp_option_rfc3825_altitude_type;      /* 123 */
594
static int hf_dhcp_option_rfc3825_map_datum;      /* 123 */
595
static int hf_dhcp_option_cl_dss_id_option;     /* 123 CL */
596
static int hf_dhcp_option_cl_dss_id_len;        /* 123 CL */
597
static int hf_dhcp_option_cl_dss_id;        /* 123 CL */
598
static int hf_dhcp_option_vi_class_cl_address_mode;   /* 124 */
599
static int hf_dhcp_option_vi_class_enterprise;      /* 124 */
600
static int hf_dhcp_option_vi_class_data_length;     /* 124 */
601
static int hf_dhcp_option_vi_class_data_item_length;    /* 124 */
602
static int hf_dhcp_option_vi_class_data_item_data;      /* 124 */
603
604
static int hf_dhcp_option125_enterprise;
605
static int hf_dhcp_option125_length;
606
static int hf_dhcp_option125_value;       /* 125 suboption value */
607
static int hf_dhcp_option125_value_8;       /* 125 suboption value */
608
static int hf_dhcp_option125_value_16;        /* 125 suboption value */
609
static int hf_dhcp_option125_value_ip_address;      /* 125 suboption value */
610
static int hf_dhcp_option125_value_stringz;     /* 125 suboption value */
611
static int hf_dhcp_option125_tr111_suboption;     /* 125 suboption */
612
static int hf_dhcp_option125_tr111_device_manufacturer_oui; /* 125:TR-111 1 */
613
static int hf_dhcp_option125_tr111_device_serial_number;    /* 125:TR-111 2 */
614
static int hf_dhcp_option125_tr111_device_product_class;    /* 125:TR-111 3 */
615
static int hf_dhcp_option125_tr111_gateway_manufacturer_oui;  /* 125:TR-111 4 */
616
static int hf_dhcp_option125_tr111_gateway_serial_number;   /* 125:TR-111 5 */
617
static int hf_dhcp_option125_tr111_gateway_product_class;   /* 125:TR-111 6 */
618
static int hf_dhcp_option125_cl_suboption;        /* 125 suboption */
619
static int hf_dhcp_option125_cl_option_request;     /* 125:CL 1 */
620
static int hf_dhcp_option125_cl_tftp_server_addresses;    /* 125:CL 2 */
621
static int hf_dhcp_option125_cl_erouter_container_option;   /* 125:CL 3 */
622
static int hf_dhcp_option125_cl_mib_environment_indicator_option; /* 125:CL 4 */
623
static int hf_dhcp_option125_cl_modem_capabilities;   /* 125:CL 5 */
624
625
static int hf_dhcp_option_subnet_selection_option;      /* 118 */
626
static int hf_dhcp_option_pana_agent;       /* 136 */
627
static int hf_dhcp_option_lost_server_domain_name;      /* 137 */
628
static int hf_dhcp_option_capwap_access_controller;   /* 138 */
629
static int hf_dhcp_option_andsf_server;       /* 142 */
630
static int hf_dhcp_option_forcerenew_nonce_algo;      /* 145 */
631
static int hf_dhcp_option_rdnss_reserved;       /* 146 */
632
static int hf_dhcp_option_rdnss_pref;       /* 146 */
633
static int hf_dhcp_option_rdnss_prim_dns_server;      /* 146 */
634
static int hf_dhcp_option_rdnss_sec_dns_server;     /* 146 */
635
static int hf_dhcp_option_rdnss_domain;       /* 146 */
636
static int hf_dhcp_option_dots_ri;        /* 147 */
637
static int hf_dhcp_option_dots_address;       /* 148 */
638
static int hf_dhcp_option_tftp_server_address;      /* 150 */
639
static int hf_dhcp_option_bulk_lease_status_code;     /* 151 */
640
static int hf_dhcp_option_bulk_lease_status_message;    /* 151 */
641
static int hf_dhcp_option_bulk_lease_base_time;     /* 152 */
642
static int hf_dhcp_option_bulk_lease_start_time_of_state;   /* 153 */
643
static int hf_dhcp_option_bulk_lease_query_start;     /* 154 */
644
static int hf_dhcp_option_bulk_lease_query_end;     /* 155 */
645
static int hf_dhcp_option_bulk_lease_dhcp_state;      /* 156 */
646
static int hf_dhcp_option_bulk_lease_data_source;     /* 157 */
647
static int hf_dhcp_option_pcp_list_length;        /* 158 */
648
static int hf_dhcp_option_pcp_server;       /* 158 */
649
static int hf_dhcp_option_portparams_offset;      /* 159 */
650
static int hf_dhcp_option_portparams_psid_length;     /* 159 */
651
static int hf_dhcp_option_portparams_psid;        /* 159 */
652
static int hf_dhcp_option_mudurl;         /* 161 */
653
static int hf_dhcp_dnr_instance;        /* 162 */
654
static int hf_dhcp_dnr_instance_len;        /* 162 */
655
static int hf_dhcp_dnr_svcpriority;       /* 162 */
656
static int hf_dhcp_dnr_auth_domain_name_len;      /* 162 */
657
static int hf_dhcp_dnr_auth_domain_name;      /* 162 */
658
static int hf_dhcp_dnr_addrs_len;       /* 162 */
659
static int hf_dhcp_dnr_addrs;         /* 162 */
660
static int hf_dhcp_dnr_addrs_ip;        /* 162 */
661
static int hf_dhcp_option_pxe_config_file;        /* 209 */
662
static int hf_dhcp_option_pxe_path_prefix;        /* 210 */
663
static int hf_dhcp_option_pxe_reboot_time;        /* 211 */
664
static int hf_dhcp_option_6RD_ipv4_mask_len;      /* 212 */
665
static int hf_dhcp_option_6RD_prefix_len;       /* 212 */
666
static int hf_dhcp_option_6RD_prefix;       /* 212 */
667
static int hf_dhcp_option_6RD_border_relay_ip;      /* 212 */
668
static int hf_dhcp_option242_avaya;       /* 242 */
669
static int hf_dhcp_option242_avaya_tlssrvr;     /* 242 */
670
static int hf_dhcp_option242_avaya_httpsrvr;      /* 242 */
671
static int hf_dhcp_option242_avaya_httpdir;     /* 242 */
672
static int hf_dhcp_option242_avaya_static;        /* 242 */
673
static int hf_dhcp_option242_avaya_mcipadd;     /* 242 */
674
static int hf_dhcp_option242_avaya_dot1x;       /* 242 */
675
static int hf_dhcp_option242_avaya_icmpdu;        /* 242 */
676
static int hf_dhcp_option242_avaya_icmpred;     /* 242 */
677
static int hf_dhcp_option242_avaya_l2q;       /* 242 */
678
static int hf_dhcp_option242_avaya_l2qvlan;     /* 242 */
679
static int hf_dhcp_option242_avaya_loglocal;      /* 242 */
680
static int hf_dhcp_option242_avaya_phy1stat;      /* 242 */
681
static int hf_dhcp_option242_avaya_phy2stat;      /* 242 */
682
static int hf_dhcp_option242_avaya_procpswd;      /* 242 */
683
static int hf_dhcp_option242_avaya_procstat;      /* 242 */
684
static int hf_dhcp_option242_avaya_snmpadd;     /* 242 */
685
static int hf_dhcp_option242_avaya_snmpstring;      /* 242 */
686
static int hf_dhcp_option242_avaya_vlantest;      /* 242 */
687
static int hf_dhcp_option_private_proxy_autodiscovery;    /* 252 */
688
static int hf_dhcp_option_end;          /* 255 */
689
static int hf_dhcp_option_end_overload;       /* 255 (with overload)*/
690
static int hf_dhcp_vendor_unknown_suboption;
691
static int hf_dhcp_suboption_data;
692
static int hf_dhcp_pc_ietf_ccc_suboption;
693
static int hf_dhcp_pc_i05_ccc_suboption;
694
695
static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout;
696
static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout;
697
static int hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries;
698
static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout;
699
static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout;
700
static int hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries;
701
702
static int ett_dhcp;
703
static int ett_dhcp_flags;
704
static int ett_dhcp_option;
705
static int ett_dhcp_option43_suboption;
706
static int ett_dhcp_option43_suboption_discovery;
707
static int ett_dhcp_option43_suboption_tree;
708
static int ett_dhcp_option63_suboption;
709
static int ett_dhcp_option77_instance;
710
static int ett_dhcp_option82_suboption;
711
static int ett_dhcp_option82_suboption9;
712
static int ett_dhcp_option82_suboption10;
713
static int ett_dhcp_option124_vendor_class_data_item;
714
static int ett_dhcp_option125_suboption;
715
static int ett_dhcp_option125_tr111_suboption;
716
static int ett_dhcp_option125_cl_suboption;
717
static int ett_dhcp_option242_suboption;
718
static int ett_dhcp_fqdn;
719
static int ett_dhcp_fqdn_flags;
720
static int ett_dhcp_filename_option;
721
static int ett_dhcp_server_hostname;
722
static int ett_dhcp_isns_functions;
723
static int ett_dhcp_isns_discovery_domain_access;
724
static int ett_dhcp_isns_administrative_flags;
725
static int ett_dhcp_isns_server_security_bitmap;
726
static int ett_dhcp_isns_secondary_server_addr;
727
static int ett_dhcp_o43_bsdp_boot_image;
728
static int ett_dhcp_o43_bsdp_attributes;
729
static int ett_dhcp_o43_bsdp_image_desc_list;
730
static int ett_dhcp_o43_bsdp_image_desc;
731
static int ett_dhcp_o43_bsdp_attributes_flags;
732
static int ett_dhcp_option158_pcp_list;
733
static int ett_dhcp_dnr_instance;
734
static int ett_dhcp_dnr_instance_addrs;
735
736
static expert_field ei_dhcp_bad_length;
737
static expert_field ei_dhcp_bad_bitfield;
738
static expert_field ei_dhcp_missing_subopt_length;
739
static expert_field ei_dhcp_missing_subopt_value;
740
static expert_field ei_dhcp_mal_duid;
741
static expert_field ei_dhcp_rfc3396_refer_last_option;
742
static expert_field ei_dhcp_opt_overload_wrong_field;
743
static expert_field ei_dhcp_opt_overload_file_end_missing;
744
static expert_field ei_dhcp_opt_overload_sname_end_missing;
745
static expert_field ei_dhcp_subopt_unknown_type;
746
static expert_field ei_dhcp_option_civic_location_bad_cattype;
747
static expert_field ei_dhcp_option_dhcp_name_service_invalid;
748
static expert_field ei_dhcp_option_sip_server_address_encoding;
749
static expert_field ei_dhcp_option_classless_static_route;
750
static expert_field ei_dhcp_option125_enterprise_malformed;
751
static expert_field ei_dhcp_option_6RD_malformed;
752
static expert_field ei_dhcp_option82_vi_cl_tag_unknown;
753
static expert_field ei_dhcp_option_parse_err;
754
static expert_field ei_dhcp_nonstd_option_data;
755
static expert_field ei_dhcp_suboption_invalid;
756
static expert_field ei_dhcp_secs_le;
757
static expert_field ei_dhcp_end_option_missing;
758
static expert_field ei_dhcp_client_address_not_given;
759
static expert_field ei_dhcp_server_name_overloaded_by_dhcp;
760
static expert_field ei_dhcp_boot_filename_overloaded_by_dhcp;
761
static expert_field ei_dhcp_option_isns_ignored_bitfield;
762
static expert_field ei_dhcp_option242_avaya_l2qvlan_invalid;
763
static expert_field ei_dhcp_option242_avaya_vlantest_invalid;
764
static expert_field ei_dhcp_option93_client_arch_ambiguous;
765
static expert_field ei_dhcp_option_dnr_adn_only_mode;
766
767
static dissector_table_t dhcp_option_table;
768
static dissector_table_t dhcp_enterprise_class_table;
769
static dissector_table_t dhcp_enterprise_specific_table;
770
static heur_dissector_list_t dhcp_vendor_id_subdissector;
771
static heur_dissector_list_t dhcp_vendor_info_subdissector;
772
static dissector_handle_t dhcp_handle;
773
static dissector_handle_t dhcpopt_basic_handle;
774
static dissector_handle_t svc_params_handle;
775
776
typedef struct dhcp_option_data
777
{
778
  unsigned char option;
779
  uint8_t *overload;
780
  const char *dhcp_type;
781
  const uint8_t *vendor_class_id;
782
} dhcp_option_data_t;
783
784
15
#define DHCP_HW_IS_ETHER(hwtype, length) ((hwtype == 1 || hwtype == 6) && length == 6)
785
786
/* RFC2937 The Name Service Search Option for DHCP */
787
439
#define RFC2937_LOCAL_NAMING_INFORMATION         0
788
88
#define RFC2937_DOMAIN_NAME_SERVER_OPTION        6
789
105
#define RFC2937_NETWORK_INFORMATION_SERVERS_OPTION      41
790
101
#define RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION      44
791
91
#define RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION   65
792
793
/* RFC3825decoder error codes of the conversion function */
794
22
#define RFC3825_NOERROR         0
795
2
#define RFC3825_LATITUDE_OUTOFRANGE     1
796
1
#define RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE   2
797
2
#define RFC3825_LONGITUDE_OUTOFRANGE      3
798
1
#define RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE  4
799
1
#define RFC3825_ALTITUDE_OUTOFRANGE     5
800
3
#define RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE   6
801
3
#define RFC3825_ALTITUDE_TYPE_OUTOFRANGE    7
802
7
#define RFC3825_DATUM_TYPE_OUTOFRANGE     8
803
804
12
#define DUID_LLT    1
805
3
#define DUID_EN     2
806
4
#define DUID_LL     3
807
808
struct rfc3825_location_fixpoint_t {
809
810
  int64_t latitude; /* latitude in degrees, allowed range from -90deg to 90deg.
811
           Fixpoint A(8,25) with 34 bits */
812
  uint8_t latitude_res; /* the resolution of the latitude in bits, allowed range is from 0 to 34.
813
           6 bits. */
814
  int64_t longitude;  /* longitude in degrees, range from -180deg to 180deg.
815
           Fixpoint A(8,25) with 34 bits */
816
  uint8_t longitude_res;  /* the resolution of the longitude in bits, allowed range is from 0 to 34.
817
           6 bits. */
818
  int32_t altitude; /* the altitude, 30 bits.
819
           Depending on alt_type this are meters or floors, no range limit.
820
           altitude_type==1: A(13,8) with 22 bits
821
           altitude_type==2: A(13,8) with 22 bits */
822
  uint8_t altitude_res; /* the resolution of the altitude in bits, allowed range is from 0 to 30.
823
           6 bits.
824
           altitude_type==1: any value between 0 and 30
825
           altitude_type==2: either 0 (floor unknown) or 30 */
826
  uint8_t altitude_type;  /* the type of the altitude, 4 bits. allowed values are:
827
           0: unknown
828
           1: altitude in meters
829
           2: altitude in floors */
830
  uint8_t datum_type; /* the map datum used for the coordinates. 8 bits.
831
           All values are allowed although currently only the
832
           following ones are defined:
833
           1: WGS84
834
           2: NAD83/NAVD88
835
           3: NAD83/MLLW */
836
};
837
838
/* The rfc3825_location_decimal_t structure holds the location parameters
839
 * in decimal (floating point) format.
840
 */
841
struct rfc3825_location_decimal_t {
842
843
  double latitude;  /* latitude in degrees, allowed range from -90deg to 90deg */
844
  double latitude_res;  /* the uncertainty of the latitude in grad, "0.01" means +-0.01deg
845
           from the altitude. During conversion this will be rounded to
846
           next smaller value which can be represented in fixpoint arithmetic */
847
  double longitude; /* longitude in degrees, range from -180deg to 180deg */
848
  double longitude_res; /* the uncertainty of the longitude in grad, "0.01" means +-0.01deg
849
           from the longitude. During conversion this will be rounded to
850
           next smaller value which can be represented in fixpoint arithmetic */
851
  double altitude;  /* the altitude, depending on alt_type this are meters or floors, no range limit */
852
  double altitude_res;  /* the uncertainty of the altitude in either:
853
           - altitude-type=meters: "10" means 10 meters which means +-10 meters from the altitude
854
           - altitude-type=floors: either 0 (unknown) or 30 (exact) */
855
  int altitude_type;  /* the type of the altitude, allowed values are
856
           0: unknown
857
           1: altitude in meters
858
           2: altitude in floors */
859
  int datum_type;    /* the map datum used for the coordinates.
860
            All values are allowed although currently only the
861
            following ones are defined:
862
            1: WGS84
863
            2: NAD83/NAVD88
864
            3: NAD83/MLLW */
865
};
866
867
/* For managing split options with RFC 3396 */
868
struct rfc3396_for_option_t {
869
  unsigned int total_number_of_block;
870
  unsigned int index_current_block;
871
  tvbuff_t* tvb_composite;
872
};
873
874
enum {
875
  RFC_3361_ENC_FQDN,
876
  RFC_3361_ENC_IPADDR
877
};
878
879
static void dissect_vendor_avaya_param(proto_tree *tree, packet_info *pinfo, proto_item *vti,
880
    tvbuff_t *tvb, unsigned optoff, wmem_strbuf_t *avaya_param_buf);
881
882
/* converts fixpoint presentation into decimal presentation
883
   also converts values which are out of range to allow decoding of received data */
884
static int rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal);
885
886
/* decodes the LCI string received from DHCP into the fixpoint values */
887
static void rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint);
888
889
890
/* Map Datum Types used for the coordinates (RFC 3825) */
891
static const value_string map_datum_type_values[] = {
892
  { 1,  "WGS 84" },
893
  { 2,  "NAD83 (NAVD88)" },
894
  { 3,  "NAD83 (MLLW)" },
895
  { 0,  NULL }
896
};
897
898
899
/* Altitude Types used for the coordinates (RFC 3825) */
900
static const value_string altitude_type_values[] = {
901
  { 1,  "Meters" },
902
  { 2,  "Floors" },
903
  { 0,  NULL }
904
};
905
906
/* AutoConfigure (RFC 2563) */
907
static const value_string dhcp_autoconfig[] = {
908
  { 0,  "DoNotAutoConfigure"},
909
  { 1,  "AutoConfigure"},
910
  { 0,  NULL }
911
};
912
913
/* Error Types for RFC 3825 coordinate location decoding */
914
static const value_string rfc3825_error_types[] = {
915
  { 1,  "Latitude is out of range [-90,90]"},
916
  { 2,  "Latitude Uncertainty is out of range [0,90]"},
917
  { 3,  "Longitude is out of range [-180,180]"},
918
  { 4,  "Longitude Uncertainty is out of range [0,180]"},
919
  { 5,  "Altitude is out of range [-(2^21),(2^21)-1]"},
920
  { 6,  "Altitude Uncertainty is out of range [0,2^20]"},
921
  { 7,  "Altitude Type is out of range [0,2]"},
922
  { 8,  "Datum is out of range [1,3]"},
923
  { 0,  NULL }
924
};
925
926
927
928
/* Civic Address What field (RFC 4776) */
929
static const value_string civic_address_what_values[] = {
930
  { 0,  "Location of the DHCP server" },
931
  { 1,  "Location of the network element believed to be closest to the client" },
932
  { 2,  "Location of the client"},
933
  { 0, NULL}
934
};
935
936
/* Civic Address Type field (RFC 4119, RFC 4776, RFC 5139) */
937
static const value_string civic_address_type_values[] = {
938
  {   0,  "Language" },
939
  {   1,  "A1" },
940
  {   2,  "A2" },
941
  {   3,  "A3" },
942
  {   4,  "A4" },
943
  {   5,  "A5" },
944
  {   6,  "A6" },
945
  {  16,  "PRD (Leading street direction)" },
946
  {  17,  "POD (Trailing street suffix)" },
947
  {  18,  "STS (Street suffix)" },
948
  {  19,  "HNO (House number)" },
949
  {  20,  "HNS (House number suffix)" },
950
  {  21,  "LMK (Landmark or vanity address)" },
951
  {  22,  "LOC (Additional location information)" },
952
  {  23,  "NAM" },
953
  {  24,  "PC (Postal/ZIP code)" },
954
  {  25,  "BLD (Building)" },
955
  {  26,  "UNIT" },
956
  {  27,  "FLR (Floor)" },
957
  {  28,  "ROOM" },
958
  {  29,  "PLC (Place-type)" },
959
  {  30,  "PCN (Postal community name)" },
960
  {  31,  "POBOX" },
961
  {  32,  "ADDCODE (Additional Code)" },
962
  {  33,  "SEAT" },
963
  {  34,  "RD (Primary road or street)" },
964
  {  35,  "RDSEC (Road section)" },
965
  {  36,  "RDBR (Road branch)" },
966
  {  37,  "RDSUBBR (Road sub-branch)" },
967
  {  38,  "PRM (Road pre-modifier)" },
968
  {  39,  "POM (Road post-modifier" },
969
  { 128,  "Script" },
970
  { 0, NULL }
971
};
972
973
static const value_string cablelab_ipaddr_mode_vals[] = {
974
  { 1, "IPv4" },
975
  { 2, "IPv6" },
976
  { 0, NULL }
977
};
978
979
static const value_string duidtype_vals[] =
980
{
981
  { DUID_LLT, "link-layer address plus time" },
982
  { DUID_EN,  "assigned by vendor based on Enterprise number" },
983
  { DUID_LL,  "link-layer address" },
984
  { 0, NULL }
985
};
986
987
static const value_string forcerenew_nonce_algo_vals[] = {
988
  { 1, "HMAC-MD5" },
989
  { 0, NULL },
990
};
991
992
static const value_string rdnss_pref_vals[] = {
993
  { 0, "Medium" },
994
  { 1, "High" },
995
  { 2, "Reserved" },
996
  { 3, "Low" },
997
  { 0, NULL },
998
};
999
1000
static const value_string bulk_lease_dhcp_status_code_vals[] = {
1001
  { 0, "Success" },
1002
  { 1, "UpsecFail" },
1003
  { 2, "QueryTerminated" },
1004
  { 3, "MalformedQuery" },
1005
  { 4, "NotAllowed" },
1006
  { 5, "DataMissing" },
1007
  { 6, "ConnectionActive" },
1008
  { 7, "CatchUpComplete" },
1009
  { 8, "TLSConnectionRefused" },
1010
  { 0, NULL },
1011
};
1012
1013
static const value_string bulk_lease_dhcp_state_vals[] = {
1014
  { 1, "Available" },
1015
  { 2, "Active" },
1016
  { 3, "Expired" },
1017
  { 4, "Released" },
1018
  { 5, "Abandoned" },
1019
  { 6, "Reset" },
1020
  { 7, "Remote" },
1021
  { 8, "Transitioning" },
1022
  { 0, NULL },
1023
};
1024
1025
static const value_string o43pxeclient_boot_server_types[] = {
1026
  {  0, "PXE bootstrap server" },
1027
  {  1, "Microsoft Windows NT Boot Server" },
1028
  {  2, "Intel LCM Boot Server" },
1029
  {  3, "DOS/UNDI Boot Server" },
1030
  {  4, "NEC ESMPRO Boot Server" },
1031
  {  5, "IBM WSoD Boot Server" },
1032
  {  6, "IBM LCCM Boot Server" },
1033
  {  7, "CA Unicenter TNG Boot Server" },
1034
  {  8, "HP OpenView Boot Server" },
1035
  {  65535, "PXE API Test server" },
1036
  {  0, NULL },
1037
};
1038
1039
static const value_string o43pxeclient_boot_menu_types[] = {
1040
  {  0, "Local boot" },
1041
  {  0, NULL },
1042
};
1043
1044
static bool novell_string;
1045
1046
static int dhcp_uuid_endian = ENC_LITTLE_ENDIAN;
1047
1048
static const enum_val_t dhcp_uuid_endian_vals[] = {
1049
  { "LE", "Little Endian",  ENC_LITTLE_ENDIAN},
1050
  { "BE", "Big Endian", ENC_BIG_ENDIAN },
1051
  { NULL, NULL, 0 }
1052
};
1053
1054
24.4k
#define DHCP_SECS_ENDIAN_AUTODETECT -1
1055
1056
static int dhcp_secs_endian = DHCP_SECS_ENDIAN_AUTODETECT;
1057
1058
static const enum_val_t dhcp_secs_endian_vals[] = {
1059
  { "Autodetect", "Autodetect", DHCP_SECS_ENDIAN_AUTODETECT},
1060
  { "LE", "Little Endian", ENC_LITTLE_ENDIAN},
1061
  { "BE", "Big Endian", ENC_BIG_ENDIAN },
1062
  { NULL, NULL, 0 }
1063
};
1064
1065
16
#define DHCP_UDP_PORT_RANGE  "67-68,4011"
1066
73.3k
#define PROXYDHCP_UDP_PORT   4011
1067
1068
24.4k
#define BOOTP_BC  0x8000
1069
16
#define BOOTP_MBZ 0x7FFF
1070
1071
/* FQDN stuff */
1072
16
#define F_FQDN_S  0x01
1073
16
#define F_FQDN_O  0x02
1074
40
#define F_FQDN_E  0x04
1075
16
#define F_FQDN_N  0x08
1076
16
#define F_FQDN_MBZ  0xf0
1077
1078
#define ISNS_BITFIELD_NZ_MUST_BE_IGNORED(mask, ena_flag)    \
1079
452
  ((mask) && !((mask) & (ena_flag)))
1080
1081
/* iSNS bit fields */
1082
16
#define F_ISNS_FUNCTIONS_ENABLED  0x0001
1083
16
#define F_ISNS_FUNCTIONS_DD_AUTH  0x0002
1084
16
#define F_ISNS_FUNCTIONS_SEC_POLICY 0x0004
1085
16
#define F_ISNS_FUNCTIONS_RESERVED 0xFFF8
1086
1087
16
#define F_ISNS_DD_ACCESS_ENABLED    0x0001
1088
16
#define F_ISNS_DD_ACCESS_CTRL_NODE    0x0002
1089
16
#define F_ISNS_DD_ACCESS_ISCSI_TARGET   0x0004
1090
16
#define F_ISNS_DD_ACCESS_ISCSI_INITIATOR  0x0008
1091
16
#define F_ISNS_DD_ACCESS_IFCP_TARGET_PORT 0x0010
1092
16
#define F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT  0x0020
1093
16
#define F_ISNS_DD_ACCESS_RESERVED   0xFFC0
1094
1095
130
#define F_ISNS_ADMIN_FLAGS_ENABLED    0x0001
1096
70
#define F_ISNS_ADMIN_FLAGS_HEARTBEAT    0x0002
1097
16
#define F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS  0x0004
1098
16
#define F_ISNS_ADMIN_FLAGS_DEFAULT_DD   0x0008
1099
16
#define F_ISNS_ADMIN_FLAGS_RESERVED   0xFFF0
1100
1101
16
#define F_ISNS_SRV_SEC_BITMAP_ENABLED   0x0001
1102
16
#define F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC   0x0002
1103
16
#define F_ISNS_SRV_SEC_BITMAP_MAIN_MODE   0x0004
1104
16
#define F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE  0x0008
1105
16
#define F_ISNS_SRV_SEC_BITMAP_PFS   0x0010
1106
16
#define F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE 0x0020
1107
16
#define F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE 0x0040
1108
16
#define F_ISNS_SRV_SEC_BITMAP_RESERVED    0xFF80
1109
1110
1111
static const true_false_string tfs_fqdn_o = {
1112
  "Override",
1113
  "No override"
1114
};
1115
1116
static const true_false_string tfs_fqdn_e = {
1117
  "Binary encoding",
1118
  "ASCII encoding"
1119
};
1120
1121
static const true_false_string tfs_fqdn_n = {
1122
  "No server updates",
1123
  "Some server updates"
1124
};
1125
1126
static const true_false_string tfs_isns_function_dd_based_auth = {
1127
  "Automatically allowed access",
1128
  "Explicitly performed",
1129
};
1130
1131
static const true_false_string tfs_isns_functions_sec_distrib = {
1132
  "Download from iSNS server",
1133
  "By other means",
1134
};
1135
1136
static const true_false_string tfs_bulk_lease_data_source = {
1137
  "Remote",
1138
  "Local"
1139
};
1140
1141
enum field_type {
1142
  special,
1143
  none,
1144
  presence,
1145
  ipv4,     /* single IPv4 address */
1146
  ipv4_list,    /* list of IPv4 addresses */
1147
  string,
1148
  bytes,
1149
  opaque,
1150
  val_boolean,
1151
  val_u_byte,
1152
  val_u_short,
1153
  val_u_short_list,
1154
  val_u_le_short,
1155
  val_u_long,
1156
  time_in_s_secs,   /* Signed */
1157
  time_in_u_secs,   /* Unsigned (not micro) */
1158
  fqdn,
1159
  ipv4_or_fqdn,
1160
  oui
1161
};
1162
1163
struct opt_info {
1164
  const char  *text;
1165
  enum field_type ftype;
1166
  int* phf;
1167
};
1168
1169
static const true_false_string flag_set_broadcast = {
1170
  "Broadcast",
1171
  "Unicast"
1172
};
1173
1174
static const true_false_string flag_set_unicast = {
1175
  "Unicast",
1176
  "Broadcast"
1177
};
1178
1179
#define BOOTP_MAX_NO_CHAR 64
1180
1181
/* PacketCable/DOCSIS definitions */
1182
1.19k
#define PACKETCABLE_MTA_CAP10 "pktc1.0:"
1183
1.15k
#define PACKETCABLE_MTA_CAP15 "pktc1.5:"
1184
1.07k
#define PACKETCABLE_MTA_CAP20 "pktc2.0:"
1185
1.05k
#define PACKETCABLE_CM_CAP11  "docsis1.1:"
1186
1.02k
#define PACKETCABLE_CM_CAP20  "docsis2.0:"
1187
982
#define PACKETCABLE_CM_CAP30  "docsis3.0:"
1188
1189
0
#define PACKETCABLE_CCC_I05  1
1190
269
#define PACKETCABLE_CCC_DRAFT5   2
1191
4.39k
#define PACKETCABLE_CCC_RFC_3495 3
1192
1193
static const enum_val_t pkt_ccc_protocol_versions[] = {
1194
  { "ccc_i05",   "PKT-SP-PROV-I05-021127", PACKETCABLE_CCC_I05 },
1195
  { "ccc_draft_5", "IETF Draft 5",     PACKETCABLE_CCC_DRAFT5 },
1196
  { "rfc_3495",  "RFC 3495",       PACKETCABLE_CCC_RFC_3495 },
1197
  { NULL, NULL, 0 }
1198
};
1199
1200
1.50k
#define APPLE_BSDP_SERVER "AAPLBSDPC"
1201
2.38k
#define APPLE_BSDP_CLIENT "AAPLBSDPC/"
1202
1203
1.26k
#define CISCO_VCID "cisco"
1204
1205
1.20k
#define AEROHIVE_VCID "AEROHIVE"
1206
1207
static int pkt_ccc_protocol_version = PACKETCABLE_CCC_RFC_3495;
1208
static unsigned pkt_ccc_option = 122;
1209
1210
static void dissect_docsis_cm_cap(packet_info *pinfo, proto_tree *v_tree, tvbuff_t *tvb,
1211
          int voff, int len, bool opt125);
1212
1213
1.11k
#define ARUBA_INSTANT_AP "ArubaInstantAP"
1214
1.09k
#define ARUBA_AP "ArubaAP"
1215
1216
3
#define OPT53_DISCOVER "Discover"
1217
/* https://www.iana.org/assignments/bootp-dhcp-parameters */
1218
static const value_string opt53_text[] = {
1219
  {  1, OPT53_DISCOVER },
1220
  {  2, "Offer" },
1221
  {  3, "Request" },
1222
  {  4, "Decline" },
1223
  {  5, "ACK" },
1224
  {  6, "NAK" },
1225
  {  7, "Release" },
1226
  {  8, "Inform" },
1227
  {  9, "Force Renew" },
1228
  { 10, "Lease query" },    /* RFC4388 */
1229
  { 11, "Lease Unassigned" },   /* RFC4388 */
1230
  { 12, "Lease Unknown" },    /* RFC4388 */
1231
  { 13, "Lease Active" },   /* RFC4388 */
1232
  { 14, "Bulk Lease Query" },   /* RFC6926 */
1233
  { 15, "Lease Query Done" },   /* RFC6926 */
1234
  { 16, "Active LeaseQuery" },    /* RFC7724 */
1235
  { 17, "Lease Query Status" },   /* RFC7724 */
1236
  { 18, "TLS" },      /* RFC7724 */
1237
  { 0,  NULL }
1238
};
1239
1240
/* DHCP Authentication protocols */
1241
#define AUTHEN_PROTO_CONFIG_TOKEN 0
1242
16
#define AUTHEN_PROTO_DELAYED_AUTHEN 1
1243
1244
/* DHCP Authentication algorithms for delayed authentication */
1245
4
#define AUTHEN_DELAYED_ALGO_HMAC_MD5  1
1246
1247
/* DHCP Authentication Replay Detection Methods */
1248
5
#define AUTHEN_RDM_MONOTONIC_COUNTER  0x00
1249
1250
/* DHCP Option Overload (option code 52) */
1251
48.8k
#define OPT_OVERLOAD_FILE   1
1252
48.8k
#define OPT_OVERLOAD_SNAME    2
1253
#define OPT_OVERLOAD_BOTH   3
1254
1255
/* Server name and boot file offsets and lengths */
1256
142k
#define SERVER_NAME_OFFSET    44
1257
94.7k
#define SERVER_NAME_LEN     64
1258
116k
#define FILE_NAME_OFFSET    108
1259
75.4k
#define FILE_NAME_LEN     128
1260
48.8k
#define VENDOR_INFO_OFFSET    236
1261
1262
static const value_string dhcp_nbnt_vals[] = {
1263
  {0x1, "B-node" },
1264
  {0x2, "P-node" },
1265
  {0x4, "M-node" },
1266
  {0x8, "H-node" },
1267
  {0, NULL   }
1268
};
1269
1270
/*
1271
 * There is confusion around some Client Architecture IDs: RFC 4578 section 2.1
1272
 * lists *requested* architecture IDs, however the actual assigned IDs
1273
 * (https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#processor-architecture)
1274
 * differ.  Specifically,
1275
 *
1276
 *    EFI Byte Code (EFI BC, EBC) was 7 in RFC 4578, but is assigned 9 by IETF.
1277
 *    EFI x64 was 9 in RFC 4578, but is assigned 7 by IETF.
1278
 *
1279
 * For confirmation, refer to RFC erratum 4624:
1280
 *    https://www.rfc-editor.org/errata/eid4624
1281
 */
1282
static const value_string dhcp_client_arch[] = {
1283
  { 0x0000, "IA x86 PC" },
1284
  { 0x0001, "NEC/PC98" },
1285
  { 0x0002, "IA64 PC" },
1286
  { 0x0003, "DEC Alpha" },
1287
  { 0x0004, "ArcX86" },
1288
  { 0x0005, "Intel Lean Client" },
1289
  { 0x0006, "EFI IA32" },
1290
  { 0x0007, "EFI x64" }, /* *Not* EFI BC.  See comment above. */
1291
  { 0x0008, "EFI Xscale" },
1292
  { 0x0009, "EFI BC" },  /* *Not* EFI x64.  See comment above. */
1293
  { 0x000a, "ARM 32-bit UEFI" },
1294
  { 0x000b, "ARM 64-bit UEFI" },
1295
  { 0x000c, "PowerPC Open Firmware" },
1296
  { 0x000d, "PowerPC ePAPR" },
1297
  { 0x000e, "POWER OPAL v3" },
1298
  { 0x000f, "x86 UEFI HTTP" },
1299
  { 0x0010, "x64 UEFI HTTP" },
1300
  { 0x0011, "EBC UEFI HTTP" },
1301
  { 0x0012, "ARM 32-bit UEFI HTTP" },
1302
  { 0x0013, "ARM 64-bit UEFI HTTP" },
1303
  { 0x0014, "PC/AT HTTP" },
1304
  { 0x0015, "ARM 32-bit uboot" },
1305
  { 0x0016, "ARM 64-bit uboot" },
1306
  { 0x0017, "ARM 32-bit uboot HTTP" },
1307
  { 0x0018, "ARM 64-bit uboot HTTP" },
1308
  { 0x0019, "RISC-V 32-bit UEFI" },
1309
  { 0x001a, "RISC-V 32-bit UEFI HTTP" },
1310
  { 0x001b, "RISC-V 64-bit UEFI" },
1311
  { 0x001c, "RISC-V 64-bit UEFI HTTP" },
1312
  { 0x001d, "RISC-V 128-bit UEFI" },
1313
  { 0x001e, "RISC-V 128-bit UEFI HTTP" },
1314
  { 0x001f, "s390 Basic" },
1315
  { 0x0020, "s390 Extended" },
1316
  { 0x0021, "MIPS 32-bit UEFI" },
1317
  { 0x0022, "MIPS 64-bit UEFI" },
1318
  { 0x0023, "Sunway 32-bit UEFI" },
1319
  { 0x0024, "Sunway 64-bit UEFI" },
1320
  { 0x0025, "LoongArch 32-bit UEFI" },
1321
  { 0x0026, "LoongArch 32-bit UEFI HTTP" },
1322
  { 0x0027, "LoongArch 64-bit UEFI" },
1323
  { 0x0028, "LoongArch 64-bit UEFI HTTP" },
1324
  { 0x0029, "ARM rpiboot" },
1325
  { 0,    NULL }
1326
};
1327
1328
static const value_string opt_overload_vals[] = {
1329
  { OPT_OVERLOAD_FILE,  "Boot file name holds options",        },
1330
  { OPT_OVERLOAD_SNAME, "Server host name holds options",        },
1331
  { OPT_OVERLOAD_BOTH,  "Boot file and server host names hold options" },
1332
  { 0,          NULL               } };
1333
1334
static const value_string slpda_vals[] = {
1335
  {0x00,   "Dynamic Discovery" },
1336
  {0x01,   "Static Discovery" },
1337
  {0x80,   "Backwards compatibility" },
1338
  {0, NULL   } };
1339
1340
static const value_string slp_scope_vals[] = {
1341
  {0x00,   "Preferred Scope" },
1342
  {0x01,   "Mandatory Scope" },
1343
  {0, NULL   } };
1344
1345
static const value_string authen_protocol_vals[] = {
1346
  {AUTHEN_PROTO_CONFIG_TOKEN,   "configuration token" },
1347
  {AUTHEN_PROTO_DELAYED_AUTHEN, "delayed authentication" },
1348
  {0,           NULL     } };
1349
1350
static const value_string authen_da_algo_vals[] = {
1351
  {AUTHEN_DELAYED_ALGO_HMAC_MD5, "HMAC_MD5" },
1352
  {0,            NULL } };
1353
1354
static const value_string authen_rdm_vals[] = {
1355
  {AUTHEN_RDM_MONOTONIC_COUNTER, "Monotonically-increasing counter" },
1356
  {0,            NULL } };
1357
1358
static const value_string cl_dss_id_type_vals[] = {
1359
  {1, "Primary DSS_ID" },
1360
  {2, "Secondary DSS_ID" },
1361
  {0, NULL }
1362
};
1363
1364
static const value_string sip_server_enc_vals[] = {
1365
  {0, "Fully Qualified Domain Name" },
1366
  {1, "IPv4 Address" },
1367
  {0, NULL }
1368
};
1369
1370
static const value_string o43_bsdp_boot_image_install_vals[] = {
1371
  { 0, "non-install" },
1372
  { 1, "install" },
1373
  { 0, NULL }
1374
};
1375
1376
static const value_string o43_bsdp_boot_image_kind_vals[] = {
1377
  { 0, "Mac OS 9" },
1378
  { 1, "Mac OS X" },
1379
  { 2, "Mac OS X Server" },
1380
  { 3, "Hardware Diagnostics" },
1381
  { 0, NULL }
1382
};
1383
1384
static const value_string o43_bsdp_message_type_vals[] = {
1385
  { 1, "LIST" },
1386
  { 2, "SELECT" },
1387
  { 3, "FAILED" },
1388
  { 0, NULL }
1389
};
1390
1391
static const string_string option242_avaya_phystat_vals[] = {
1392
  { "0", "Disabled" },
1393
  { "1", "Auto" },
1394
  { "2", "10Mbps half" },
1395
  { "3", "10Mbps full" },
1396
  { "4", "100Mbps half" },
1397
  { "5", "100Mbps full" },
1398
  { "6", "1000Mbps full" },
1399
  { NULL, NULL }
1400
};
1401
1402
static const string_string option242_avaya_l2q_vals[] = {
1403
  { "0", "Auto" },
1404
  { "1", "Enabled" },
1405
  { "2", "Disabled" },
1406
  { NULL, NULL }
1407
};
1408
1409
static const string_string option242_avaya_dot1x_vals[] = {
1410
  { "0", "With PAE pass-through" },
1411
  { "1", "With PAE pass-through and proxy Logoff" },
1412
  { "2", "Without PAE pass-through or proxy Logoff" },
1413
  { NULL, NULL }
1414
};
1415
1416
static const string_string option242_avaya_icmpdu_vals[] = {
1417
  { "0", "No ICMP Destination Unreachable messages" },
1418
  { "1", "Send limited Port Unreachable messages" },
1419
  { "2", "Send Protocol and Port Unreachable messages" },
1420
  { NULL, NULL }
1421
};
1422
1423
static const string_string option242_avaya_icmpred_vals[] = {
1424
  { "0", "Ignore ICMP Redirect messages" },
1425
  { "1", "Process ICMP Redirect messages" },
1426
  { NULL, NULL }
1427
};
1428
1429
static const string_string option242_avaya_loglocal_vals[] = {
1430
  { "0", "Disabled" },
1431
  { "1", "Emergency" },
1432
  { "2", "Alerts" },
1433
  { "3", "Critical" },
1434
  { "4", "Errors" },
1435
  { "5", "Warnings" },
1436
  { "6", "Notices" },
1437
  { "7", "Information" },
1438
  { "8", "Debug" },
1439
  { NULL, NULL }
1440
};
1441
1442
static const string_string option242_avaya_procstat_vals[] = {
1443
  { "0", "All administrative options" },
1444
  { "1", "Only view administrative options" },
1445
  { NULL, NULL }
1446
};
1447
1448
static const string_string option242_avaya_static_vals[] = {
1449
  { "0", "Static programming never overrides call server (DHCP) or call server administered data" },
1450
  { "1", "Static programming overrides only file server administered data" },
1451
  { "2", "Static programming overrides only call server administered data" },
1452
  { "3", "Static programming overrides both file server- and call server-administered data" },
1453
  { NULL, NULL }
1454
};
1455
1456
/* dhcp options administration */
1457
189k
#define DHCP_OPT_NUM  256
1458
1459
/* All of the options that have a "basic" type that can be handled by dissect_dhcpopt_basic_type() */
1460
16
#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"
1461
1462
/* Re-define structure.  Values to be updated by dhcp_init_protocol */
1463
static struct opt_info dhcp_opt[DHCP_OPT_NUM];
1464
1465
static const struct opt_info default_dhcp_opt[DHCP_OPT_NUM] = {
1466
/*   0 */ { "Padding",          none, &hf_dhcp_option_padding },
1467
/*   1 */ { "Subnet Mask",        ipv4, &hf_dhcp_option_subnet_mask },
1468
/*   2 */ { "Time Offset",        time_in_s_secs, &hf_dhcp_option_time_offset },
1469
/*   3 */ { "Router",         ipv4_list, &hf_dhcp_option_router },
1470
/*   4 */ { "Time Server",        ipv4_list, &hf_dhcp_option_time_server },
1471
/*   5 */ { "Name Server",        ipv4_list, &hf_dhcp_option_name_server },
1472
/*   6 */ { "Domain Name Server",     ipv4_list, &hf_dhcp_option_domain_name_server },
1473
/*   7 */ { "Log Server",       ipv4_list, &hf_dhcp_option_log_server },
1474
/*   8 */ { "Quotes Server",        ipv4_list, &hf_dhcp_option_quotes_server },
1475
/*   9 */ { "LPR Server",       ipv4_list, &hf_dhcp_option_lpr_server },
1476
/*  10 */ { "Impress Server",       ipv4_list, &hf_dhcp_option_impress_server },
1477
/*  11 */ { "Resource Location Server",     ipv4_list, &hf_dhcp_option_resource_location_server },
1478
/*  12 */ { "Host Name",        string, &hf_dhcp_option_hostname },
1479
/*  13 */ { "Boot File Size",       val_u_short, &hf_dhcp_option_boot_file_size },
1480
/*  14 */ { "Merit Dump File",        string, &hf_dhcp_option_merit_dump_file },
1481
/*  15 */ { "Domain Name",        string, &hf_dhcp_option_domain_name },
1482
/*  16 */ { "Swap Server",        ipv4, &hf_dhcp_option_swap_server },
1483
/*  17 */ { "Root Path",        string, &hf_dhcp_option_root_path },
1484
/*  18 */ { "Extensions Path",        string, &hf_dhcp_option_extension_path },
1485
/*  19 */ { "IP Forwarding",        val_boolean, &hf_dhcp_option_ip_forwarding },
1486
/*  20 */ { "Non-Local Source Routing",     val_boolean, &hf_dhcp_option_non_local_source_routing },
1487
/*  21 */ { "Policy Filter",        special, NULL },
1488
/*  22 */ { "Maximum Datagram Reassembly Size",   val_u_short, &hf_dhcp_option_max_datagram_reassembly_size },
1489
/*  23 */ { "Default IP Time-to-Live",      val_u_byte, &hf_dhcp_option_default_ip_ttl },
1490
/*  24 */ { "Path MTU Aging Timeout",     time_in_u_secs, &hf_dhcp_option_path_mtu_aging_timeout },
1491
/*  25 */ { "Path MTU Plateau Table",     val_u_short_list, &hf_dhcp_option_path_mtu_plateau_table_item },
1492
/*  26 */ { "Interface MTU",        val_u_short, &hf_dhcp_option_interface_mtu },
1493
/*  27 */ { "All Subnets are Local",      val_boolean, &hf_dhcp_option_all_subnets_are_local },
1494
/*  28 */ { "Broadcast Address",      ipv4, &hf_dhcp_option_broadcast_address },
1495
/*  29 */ { "Perform Mask Discovery",     val_boolean, &hf_dhcp_option_perform_mask_discovery },
1496
/*  30 */ { "Mask Supplier",        val_boolean, &hf_dhcp_option_mask_supplier },
1497
/*  31 */ { "Perform Router Discover",      val_boolean, &hf_dhcp_option_perform_router_discover },
1498
/*  32 */ { "Router Solicitation Address",    ipv4, &hf_dhcp_option_router_solicitation_address },
1499
/*  33 */ { "Static Route",       special, NULL },
1500
/*  34 */ { "Trailer Encapsulation",      val_boolean, &hf_dhcp_option_trailer_encapsulation },
1501
/*  35 */ { "ARP Cache Timeout",      time_in_u_secs, &hf_dhcp_option_arp_cache_timeout },
1502
/*  36 */ { "Ethernet Encapsulation",     val_boolean, &hf_dhcp_option_ethernet_encapsulation },
1503
/*  37 */ { "TCP Default TTL",        val_u_byte, &hf_dhcp_option_tcp_default_ttl },
1504
/*  38 */ { "TCP Keepalive Interval",     time_in_u_secs, &hf_dhcp_option_tcp_keepalive_interval },
1505
/*  39 */ { "TCP Keepalive Garbage",      val_boolean, &hf_dhcp_option_tcp_keepalive_garbage },
1506
/*  40 */ { "Network Information Service Domain", string, &hf_dhcp_option_nis_domain },
1507
/*  41 */ { "Network Information Service Servers",  ipv4_list, &hf_dhcp_option_nis_server },
1508
/*  42 */ { "Network Time Protocol Servers",    ipv4_list, &hf_dhcp_option_ntp_server },
1509
/*  43 */ { "Vendor-Specific Information",    special, NULL },
1510
/*  44 */ { "NetBIOS over TCP/IP Name Server",    ipv4_list, &hf_dhcp_option_netbios_over_tcpip_name_server },
1511
/*  45 */ { "NetBIOS over TCP/IP Datagram Distribution Name Server", ipv4_list, &hf_dhcp_option_netbios_over_tcpip_dd_name_server },
1512
/*  46 */ { "NetBIOS over TCP/IP Node Type",    val_u_byte, &hf_dhcp_option_netbios_over_tcpip_node_type },
1513
/*  47 */ { "NetBIOS over TCP/IP Scope",    string, &hf_dhcp_option_netbios_over_tcpip_scope },
1514
/*  48 */ { "X Window System Font Server",    ipv4_list, &hf_dhcp_option_xwindows_system_font_server },
1515
/*  49 */ { "X Window System Display Manager",    ipv4_list, &hf_dhcp_option_xwindows_system_display_manager },
1516
/*  50 */ { "Requested IP Address",     ipv4, &hf_dhcp_option_requested_ip_address },
1517
/*  51 */ { "IP Address Lease Time",      time_in_u_secs, &hf_dhcp_option_ip_address_lease_time },
1518
/*  52 */ { "Option Overload",        special, &hf_dhcp_option_option_overload },
1519
/*  53 */ { "DHCP Message Type",      val_u_byte, &hf_dhcp_option_dhcp },
1520
/*  54 */ { "DHCP Server Identifier",     ipv4, &hf_dhcp_option_dhcp_server_id },
1521
/*  55 */ { "Parameter Request List",     special, &hf_dhcp_option_parameter_request_list_item },
1522
/*  56 */ { "Message",          string, &hf_dhcp_option_message },
1523
/*  57 */ { "Maximum DHCP Message Size",    val_u_short, &hf_dhcp_option_dhcp_max_message_size },
1524
/*  58 */ { "Renewal Time Value",     time_in_u_secs, &hf_dhcp_option_renewal_time_value },
1525
/*  59 */ { "Rebinding Time Value",     time_in_u_secs, &hf_dhcp_option_rebinding_time_value },
1526
/*  60 */ { "Vendor class identifier",      special, NULL },
1527
/*  61 */ { "Client identifier",      special, NULL },
1528
/*  62 */ { "Novell/Netware IP domain",     string, &hf_dhcp_option_novell_netware_ip_domain },
1529
/*  63 */ { "Novell Options",       special, NULL },
1530
/*  64 */ { "Network Information Service+ Domain",  string, &hf_dhcp_option_nis_plus_domain },
1531
/*  65 */ { "Network Information Service+ Servers", ipv4_list, &hf_dhcp_option_nis_plus_server },
1532
/*  66 */ { "TFTP Server Name",       string, &hf_dhcp_option_tftp_server_name },
1533
/*  67 */ { "Bootfile name",        string, &hf_dhcp_option_bootfile_name },
1534
/*  68 */ { "Mobile IP Home Agent",     ipv4_list, &hf_dhcp_option_mobile_ip_home_agent  },
1535
/*  69 */ { "SMTP Server",        ipv4_list, &hf_dhcp_option_smtp_server },
1536
/*  70 */ { "POP3 Server",        ipv4_list, &hf_dhcp_option_pop3_server },
1537
/*  71 */ { "NNTP Server",        ipv4_list, &hf_dhcp_option_nntp_server },
1538
/*  72 */ { "Default WWW Server",     ipv4_list, &hf_dhcp_option_default_www_server },
1539
/*  73 */ { "Default Finger Server",      ipv4_list, &hf_dhcp_option_default_finger_server },
1540
/*  74 */ { "Default IRC Server",     ipv4_list, &hf_dhcp_option_default_irc_server },
1541
/*  75 */ { "StreetTalk Server",      ipv4_list, &hf_dhcp_option_streettalk_server },
1542
/*  76 */ { "StreetTalk Directory Assistance Server", ipv4_list, &hf_dhcp_option_streettalk_da_server },
1543
/*  77 */ { "User Class Information",     special, NULL },
1544
/*  78 */ { "Directory Agent Information",    special, NULL },
1545
/*  79 */ { "Service Location Agent Scope",   special, NULL },
1546
/*  80 */ { "Rapid commit",       opaque, NULL },
1547
/*  81 */ { "Client Fully Qualified Domain Name", special, NULL},
1548
/*  82 */ { "Agent Information Option",     special, NULL},
1549
/*  83 */ { "iSNS",         opaque, NULL },
1550
/*  84 */ { "Removed/Unassigned",     opaque, NULL },
1551
/*  85 */ { "Novell Directory Services Servers",  special, NULL},
1552
/*  86 */ { "Novell Directory Services Tree Name",  string, &hf_dhcp_option_novell_ds_tree_name },
1553
/*  87 */ { "Novell Directory Services Context",  string, &hf_dhcp_option_novell_ds_context },
1554
/*  88 */ { "BCMCS Controller Domain Name [TODO:RFC4280]",  opaque, NULL },
1555
/*  89 */ { "BCMCS Controller IPv4 address [TODO:RFC4280]", opaque, NULL },
1556
/*  90 */ { "Authentication",       special, NULL},
1557
/*  91 */ { "Client last transaction time",   time_in_u_secs, &hf_dhcp_option_client_last_transaction_time },
1558
/*  92 */ { "Associated IP option",     ipv4_list, &hf_dhcp_option_associated_ip_option },
1559
/*  93 */ { "Client System Architecture",   special, NULL},
1560
/*  94 */ { "Client Network Device Interface",    special, NULL},
1561
/*  95 */ { "LDAP [TODO:RFC3679]",      opaque, NULL },
1562
/*  96 */ { "Removed/Unassigned",     opaque, NULL },
1563
/*  97 */ { "UUID/GUID-based Client Identifier",  special, NULL},
1564
/*  98 */ { "Open Group's User Authentication [TODO:RFC2485]",  opaque, NULL },
1565
/*  99 */ { "Civic Addresses Configuration",    special, NULL},
1566
/* 100 */ { "PCode",          string, &hf_dhcp_option_tz_pcode },
1567
/* 101 */ { "TCode",          string, &hf_dhcp_option_tz_tcode },
1568
/* 102 */ { "Removed/unassigned",     opaque, NULL },
1569
/* 103 */ { "Removed/unassigned",     opaque, NULL },
1570
/* 104 */ { "Removed/unassigned",     opaque, NULL },
1571
/* 105 */ { "Removed/unassigned",     opaque, NULL },
1572
/* 106 */ { "Removed/unassigned",     opaque, NULL },
1573
/* 107 */ { "Removed/unassigned",     opaque, NULL },
1574
/* 108 */ { "IPv6-Only Preferred",      time_in_u_secs, &hf_dhcp_option_ipv6_only_preferred_wait_time },
1575
/* 109 */ { "Unassigned",       opaque, NULL },
1576
/* 110 */ { "Removed/Unassigned",     opaque, NULL },
1577
/* 111 */ { "Unassigned",       opaque, NULL },
1578
/* 112 */ { "NetInfo Parent Server Address",    ipv4_list, &hf_dhcp_option_netinfo_parent_server_address },
1579
/* 113 */ { "NetInfo Parent Server Tag",    string, &hf_dhcp_option_netinfo_parent_server_tag },
1580
/* 114 */ { "DHCP Captive-Portal",      special, NULL },
1581
/* 115 */ { "Removed/Unassigned",     opaque, NULL },
1582
/* 116 */ { "DHCP Auto-Configuration",      val_u_byte, &hf_dhcp_option_dhcp_auto_configuration },
1583
/* 117 */ { "Name Service Search",      special, NULL },
1584
/* 118 */ { "Subnet Selection Option",      ipv4_list, &hf_dhcp_option_subnet_selection_option },
1585
/* 119 */ { "Domain Search",        special, NULL },
1586
/* 120 */ { "SIP Servers",        special, NULL },
1587
/* 121 */ { "Classless Static Route",     special, NULL},
1588
/* 122 */ { "CableLabs Client Configuration [TODO:RFC3495]",  opaque, NULL },
1589
/* 123 */ { "Coordinate-based Location Configuration",  special, NULL},
1590
/* 124 */ { "V-I Vendor Class",       special, NULL},
1591
/* 125 */ { "V-I Vendor-specific Information",    special, NULL},
1592
/* 126 */ { "Removed/Unassigned",     opaque, NULL },
1593
/* 127 */ { "Removed/Unassigned",     opaque, NULL },
1594
/* 128 */ { "DOCSIS full security server IP [TODO]",  opaque, NULL },
1595
/* 129 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1596
/* 130 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1597
/* 131 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1598
/* 132 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1599
/* 133 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1600
/* 134 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1601
/* 135 */ { "PXE - undefined (vendor specific)",  opaque, NULL },
1602
/* 136 */ { "PANA Authentication Agent",    ipv4_list, &hf_dhcp_option_pana_agent },
1603
/* 137 */ { "LoST Server Domain Name",      string, &hf_dhcp_option_lost_server_domain_name },
1604
/* 138 */ { "CAPWAP Access Controllers",    ipv4_list, &hf_dhcp_option_capwap_access_controller },
1605
/* 139 */ { "IPv4 Address-MoS",       opaque, NULL },
1606
/* 140 */ { "IPv4 FQDN-MoS",        opaque, NULL },
1607
/* 141 */ { "SIP UA Configuration Domains",   opaque, NULL },
1608
/* 142 */ { "IPv4 Address ANDSF",     ipv4_list, &hf_dhcp_option_andsf_server },
1609
/* 143 */ { "Zerotouch Redirect [TODO: draft-ietf-netconf-zerotouch]",  opaque, NULL },
1610
/* 144 */ { "Geospatial Location [TODO:RFC6225]", opaque, NULL },
1611
/* 145 */ { "Forcerenew Nonce Capable",     special, NULL },
1612
/* 146 */ { "RDNSS Selection",        special, NULL },
1613
/* 147 */ { "DOTS Reference Identifier",    string, &hf_dhcp_option_dots_ri },
1614
/* 148 */ { "DOTS Address",       ipv4_list, &hf_dhcp_option_dots_address },
1615
/* 149 */ { "Unassigned",       opaque, NULL },
1616
/* 150 */ { "TFTP Server Address",      ipv4_list, &hf_dhcp_option_tftp_server_address },
1617
/* 151 */ { "Leasequery Status code",     special, NULL },
1618
/* 152 */ { "Leasequery Base Time",     special, NULL },
1619
/* 153 */ { "Leasequery Start Time of State",   time_in_u_secs, &hf_dhcp_option_bulk_lease_start_time_of_state },
1620
/* 154 */ { "Leasequery Query Start Time",    special, NULL },
1621
/* 155 */ { "Leasequery Query End Time",    special, NULL },
1622
/* 156 */ { "Leasequery Dhcp State",      val_u_byte, &hf_dhcp_option_bulk_lease_dhcp_state },
1623
/* 157 */ { "Leasequery Data Source",     val_boolean, &hf_dhcp_option_bulk_lease_data_source },
1624
/* 158 */ { "PCP Server",       special, NULL },
1625
/* 159 */ { "Portparams",       special, NULL },
1626
/* 160 */ { "Unassigned (ex DHCP Captive-Portal)",  special, NULL }, /* Previously assigned by [RFC7710]; known to also be used by Polycom. */
1627
/* 161 */ { "Manufacturer Usage Description",   string, &hf_dhcp_option_mudurl},
1628
/* 162 */ { "Discovery of Network DNS Resolvers", special, NULL },
1629
/* 163 */ { "Unassigned",       opaque, NULL },
1630
/* 164 */ { "Unassigned",       opaque, NULL },
1631
/* 165 */ { "Unassigned",       opaque, NULL },
1632
/* 166 */ { "Unassigned",       opaque, NULL },
1633
/* 167 */ { "Unassigned",       opaque, NULL },
1634
/* 168 */ { "Unassigned",       opaque, NULL },
1635
/* 169 */ { "Unassigned",       opaque, NULL },
1636
/* 170 */ { "Unassigned",       opaque, NULL },
1637
/* 171 */ { "Unassigned",       opaque, NULL },
1638
/* 172 */ { "Unassigned",       opaque, NULL },
1639
/* 173 */ { "Unassigned",       opaque, NULL },
1640
/* 174 */ { "Unassigned",       opaque, NULL },
1641
/* 175 */ { "Etherboot",        opaque, NULL },
1642
/* 176 */ { "IP Telephone",       opaque, NULL },
1643
/* 177 */ { "Etherboot",        opaque, NULL },
1644
/* 178 */ { "Unassigned",       opaque, NULL },
1645
/* 179 */ { "Unassigned",       opaque, NULL },
1646
/* 180 */ { "Unassigned",       opaque, NULL },
1647
/* 181 */ { "Unassigned",       opaque, NULL },
1648
/* 182 */ { "Unassigned",       opaque, NULL },
1649
/* 183 */ { "Unassigned",       opaque, NULL },
1650
/* 184 */ { "Unassigned",       opaque, NULL },
1651
/* 185 */ { "Unassigned",       opaque, NULL },
1652
/* 186 */ { "Unassigned",       opaque, NULL },
1653
/* 187 */ { "Unassigned",       opaque, NULL },
1654
/* 188 */ { "Unassigned",       opaque, NULL },
1655
/* 189 */ { "Unassigned",       opaque, NULL },
1656
/* 190 */ { "Unassigned",       opaque, NULL },
1657
/* 191 */ { "Unassigned",       opaque, NULL },
1658
/* 192 */ { "Unassigned",       opaque, NULL },
1659
/* 193 */ { "Unassigned",       opaque, NULL },
1660
/* 194 */ { "Unassigned",       opaque, NULL },
1661
/* 195 */ { "Unassigned",       opaque, NULL },
1662
/* 196 */ { "Unassigned",       opaque, NULL },
1663
/* 197 */ { "Unassigned",       opaque, NULL },
1664
/* 198 */ { "Unassigned",       opaque, NULL },
1665
/* 199 */ { "Unassigned",       opaque, NULL },
1666
/* 200 */ { "Unassigned",       opaque, NULL },
1667
/* 201 */ { "Unassigned",       opaque, NULL },
1668
/* 202 */ { "Unassigned",       opaque, NULL },
1669
/* 203 */ { "Unassigned",       opaque, NULL },
1670
/* 204 */ { "Unassigned",       opaque, NULL },
1671
/* 205 */ { "Unassigned",       opaque, NULL },
1672
/* 206 */ { "Unassigned",       opaque, NULL },
1673
/* 207 */ { "Unassigned",       opaque, NULL },
1674
/* 208 */ { "PXELINUX Magic",       opaque, NULL },
1675
/* 209 */ { "PXE Configuration file",     string, &hf_dhcp_option_pxe_config_file },
1676
/* 210 */ { "PXE Path Prefix",        string, &hf_dhcp_option_pxe_path_prefix },
1677
/* 211 */ { "Reboot Time",        time_in_u_secs, &hf_dhcp_option_pxe_reboot_time },
1678
/* 212 */ { "6RD",          opaque, NULL },
1679
/* 213 */ { "V4 Access Domain",       opaque, NULL },
1680
/* 214 */ { "Unassigned",       opaque, NULL },
1681
/* 215 */ { "Unassigned",       opaque, NULL },
1682
/* 216 */ { "Unassigned",       opaque, NULL },
1683
/* 217 */ { "Unassigned",       opaque, NULL },
1684
/* 218 */ { "Unassigned",       opaque, NULL },
1685
/* 219 */ { "Unassigned",       opaque, NULL },
1686
/* 220 */ { "Subnet Allocation",      opaque, NULL },
1687
/* 221 */ { "Virtual Subnet Selection",     opaque, NULL },
1688
/* 222 */ { "Unassigned",       opaque, NULL },
1689
/* 223 */ { "Unassigned",       opaque, NULL },
1690
/* 224 */ { "Private",          opaque, NULL },
1691
/* 225 */ { "Private",          opaque, NULL },
1692
/* 226 */ { "Private",          opaque, NULL },
1693
/* 227 */ { "Private",          opaque, NULL },
1694
/* 228 */ { "Private",          opaque, NULL },
1695
/* 229 */ { "Private",          opaque, NULL },
1696
/* 230 */ { "Private",          opaque, NULL },
1697
/* 231 */ { "Private",          opaque, NULL },
1698
/* 232 */ { "Private",          opaque, NULL },
1699
/* 233 */ { "Private",          opaque, NULL },
1700
/* 234 */ { "Private",          opaque, NULL },
1701
/* 235 */ { "Private",          opaque, NULL },
1702
/* 236 */ { "Private",          opaque, NULL },
1703
/* 237 */ { "Private",          opaque, NULL },
1704
/* 238 */ { "Private",          opaque, NULL },
1705
/* 239 */ { "Private",          opaque, NULL },
1706
/* 240 */ { "Private",          opaque, NULL },
1707
/* 241 */ { "Private",          opaque, NULL },
1708
/* 242 */ { "Private/Avaya IP Telephone",   special, NULL },
1709
/* 243 */ { "Private",          opaque, NULL },
1710
/* 244 */ { "Private",          opaque, NULL },
1711
/* 245 */ { "Private",          opaque, NULL },
1712
/* 246 */ { "Private",          opaque, NULL },
1713
/* 247 */ { "Private",          opaque, NULL },
1714
/* 248 */ { "Private",          opaque, NULL },
1715
/* 249 */ { "Private/Classless Static Route (Microsoft)", special, NULL},
1716
/* 250 */ { "Private",          opaque, NULL },
1717
/* 251 */ { "Private",          opaque, NULL },
1718
/* 252 */ { "Private/Proxy autodiscovery",    string, &hf_dhcp_option_private_proxy_autodiscovery },
1719
/* 253 */ { "Private",          opaque, NULL },
1720
/* 254 */ { "Private",          opaque, NULL },
1721
/* 255 */ { "End",          opaque, NULL }
1722
};
1723
1724
static void
1725
dhcp_time_in_s_secs_fmt(char *s, uint32_t v)
1726
0
{
1727
  /* Only used by option 2 Time Offset, which is deprecated. */
1728
0
  char* secs_str = signed_time_secs_to_str(NULL, (int32_t)v);
1729
0
  snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", secs_str, (int32_t)v);
1730
0
  wmem_free(NULL, secs_str);
1731
0
}
1732
1733
static void
1734
dhcp_time_in_u_secs_fmt(char *s, uint32_t v)
1735
0
{
1736
  /* RFC 2131: 3.3 Interpretation and representation of time values */
1737
0
  if (v != 0xffffffff) {
1738
0
    char* secs_str = unsigned_time_secs_to_str(NULL, v);
1739
0
    snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", secs_str, v);
1740
0
    wmem_free(NULL, secs_str);
1741
0
  } else {
1742
0
    snprintf(s, ITEM_LABEL_LENGTH, "infinity (%d)", v);
1743
0
  }
1744
0
}
1745
1746
/*-------------------------------------
1747
 * UAT for BOOTP
1748
 *-------------------------------------
1749
 */
1750
/* UAT entry structure. */
1751
typedef struct {
1752
  unsigned  opt;
1753
  char *text;
1754
  enum field_type ftype;
1755
1756
} uat_dhcp_record_t;
1757
1758
static uat_dhcp_record_t *uat_dhcp_records;
1759
static uat_t *dhcp_uat;
1760
static unsigned num_dhcp_records_uat;
1761
static wmem_list_t *saved_uat_opts; /* List of previous options from UAT to "free" from dissection */
1762
1763
0
static void* uat_dhcp_record_copy_cb(void* n, const void* o, size_t siz _U_) {
1764
0
  uat_dhcp_record_t* new_record = (uat_dhcp_record_t *)n;
1765
0
  const uat_dhcp_record_t* old_record = (const uat_dhcp_record_t *)o;
1766
1767
0
  new_record->text = g_strdup(old_record->text);
1768
1769
0
  return new_record;
1770
0
}
1771
1772
0
static bool uat_dhcp_record_update_cb(void* r, char** err) {
1773
0
  uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
1774
1775
0
  if ((rec->opt == 0) || (rec->opt >=DHCP_OPT_NUM-1)) {
1776
0
    *err = ws_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2);
1777
0
    return false;
1778
0
  }
1779
0
  return true;
1780
0
}
1781
1782
0
static void uat_dhcp_record_free_cb(void*r) {
1783
0
  uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
1784
1785
0
  g_free(rec->text);
1786
0
}
1787
1788
0
UAT_DEC_CB_DEF(uat_dhcp_records, opt, uat_dhcp_record_t)
Unexecuted instantiation: packet-dhcp.c:uat_dhcp_records_opt_set_cb
Unexecuted instantiation: packet-dhcp.c:uat_dhcp_records_opt_tostr_cb
1789
0
UAT_CSTRING_CB_DEF(uat_dhcp_records, text, uat_dhcp_record_t)
1790
0
UAT_VS_DEF(uat_dhcp_records, ftype, uat_dhcp_record_t, enum field_type, special, "string")
Unexecuted instantiation: packet-dhcp.c:uat_dhcp_records_ftype_set_cb
Unexecuted instantiation: packet-dhcp.c:uat_dhcp_records_ftype_tostr_cb
1791
1792
1793
static const struct opt_info* dhcp_get_opt(unsigned int idx)
1794
176k
{
1795
176k
  if(idx>=DHCP_OPT_NUM)
1796
0
    return NULL;
1797
1798
176k
  return &dhcp_opt[idx];
1799
176k
}
1800
1801
static const char *
1802
dhcp_get_opt_text(unsigned int idx)
1803
13.2k
{
1804
13.2k
  if(idx>=DHCP_OPT_NUM)
1805
0
    return "unknown";
1806
13.2k
  return dhcp_opt[idx].text;
1807
13.2k
}
1808
1809
struct basic_types_hfs {
1810
  int* bytes;
1811
  int* ipv4;
1812
  int* ipv4_list;
1813
  int* string;
1814
  int* val_boolean;
1815
  int* val_u_byte;
1816
  int* val_u_short;
1817
  int* val_u_short_list;
1818
  int* val_u_long;
1819
  int* time_in_s_secs;
1820
  int* time_in_u_secs;
1821
};
1822
1823
/* Handle "basic" datatypes adding to a tree */
1824
static int
1825
dhcp_handle_basic_types(packet_info *pinfo, proto_tree *tree, proto_item *item, tvbuff_t *tvb,
1826
       enum field_type ftype, unsigned offset, int total_len,
1827
       int *hf, const struct basic_types_hfs* hf_default)
1828
58.2k
{
1829
58.2k
  int i, left;
1830
58.2k
  int consumed = 0;
1831
1832
58.2k
  switch (ftype) {
1833
5.98k
  case bytes:
1834
5.98k
    if (hf != NULL)
1835
5.98k
      proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1836
0
    else if (hf_default->bytes != NULL)
1837
0
      proto_tree_add_item(tree, *hf_default->bytes, tvb, offset, total_len, ENC_BIG_ENDIAN);
1838
5.98k
    consumed = total_len;
1839
5.98k
    break;
1840
1841
5.48k
  case ipv4:
1842
5.48k
    if (total_len != 4) {
1843
5.17k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1844
5.17k
      break;
1845
5.17k
    }
1846
1847
304
    if (hf != NULL)
1848
304
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1849
0
    else if (hf_default->ipv4 != NULL)
1850
0
      proto_tree_add_item(tree, *hf_default->ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1851
1852
    /* Show IP address in root of option */
1853
304
    proto_item_append_text(tree, " (%s)", tvb_ip_to_str(pinfo->pool, tvb, offset));
1854
304
    consumed = 4;
1855
304
    break;
1856
1857
21.0k
  case ipv4_list:
1858
278k
    for (i = offset, left = total_len; left > 0; i += 4, left -= 4) {
1859
269k
      if (left < 4) {
1860
11.5k
        expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
1861
11.5k
        break;
1862
11.5k
      }
1863
1864
257k
      if (hf != NULL)
1865
257k
        proto_tree_add_item(tree, *hf, tvb, i, 4, ENC_BIG_ENDIAN);
1866
0
      else if (hf_default->ipv4_list != NULL)
1867
0
        proto_tree_add_item(tree, *hf_default->ipv4_list, tvb, i, 4, ENC_BIG_ENDIAN);
1868
257k
      consumed += 4;
1869
257k
    }
1870
1871
21.0k
    break;
1872
1873
11.0k
  case string:
1874
11.0k
    if (hf != NULL)
1875
11.0k
      proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1876
0
    else if (hf_default->string != NULL)
1877
0
      proto_tree_add_item(tree, *hf_default->string, tvb, offset, total_len, ENC_BIG_ENDIAN);
1878
11.0k
    consumed = total_len;
1879
11.0k
    break;
1880
1881
1.40k
  case val_boolean:
1882
1.40k
    if (total_len != 1) {
1883
1.21k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1884
1.21k
      break;
1885
1.21k
    }
1886
1887
185
    if (hf != NULL)
1888
185
      proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1889
0
    else if (hf_default->val_boolean != NULL)
1890
0
      proto_tree_add_item(tree, *hf_default->val_boolean, tvb, offset, 1, ENC_BIG_ENDIAN);
1891
185
    consumed = 1;
1892
185
    break;
1893
1894
3.86k
  case val_u_byte:
1895
3.86k
    if (total_len != 1) {
1896
3.76k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1897
3.76k
      break;
1898
3.76k
    }
1899
1900
96
    if (hf != NULL)
1901
96
      proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1902
0
    else if (hf_default->val_u_byte != NULL)
1903
0
      proto_tree_add_item(tree, *hf_default->val_u_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
1904
96
    consumed = 1;
1905
96
    break;
1906
1907
855
  case val_u_short:
1908
855
    if (total_len != 2) {
1909
839
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1910
839
      break;
1911
839
    }
1912
1913
16
    if (hf != NULL)
1914
16
      proto_tree_add_item(tree, *hf, tvb, offset, 2, ENC_BIG_ENDIAN);
1915
0
    else if (hf_default->val_u_short != NULL)
1916
0
      proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, ENC_BIG_ENDIAN);
1917
16
    consumed = 2;
1918
16
    break;
1919
1920
470
  case val_u_le_short:
1921
470
    if (total_len != 2) {
1922
262
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1923
262
      break;
1924
262
    }
1925
1926
208
    if (hf != NULL)
1927
208
      proto_tree_add_item(tree, *hf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1928
0
    else if (hf_default->val_u_short != NULL)
1929
0
      proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1930
208
    consumed = 2;
1931
208
    break;
1932
1933
103
  case val_u_short_list:
1934
494
    for (i = offset, left = total_len; left > 0; i += 2, left -= 2) {
1935
401
      if (left < 2) {
1936
10
        expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
1937
10
        break;
1938
10
      }
1939
1940
391
      if (hf != NULL)
1941
391
        proto_tree_add_item(tree, *hf, tvb, i, 2, ENC_BIG_ENDIAN);
1942
0
      else if (hf_default->val_u_short_list != NULL)
1943
0
        proto_tree_add_item(tree, *hf_default->val_u_short_list, tvb, i, 2, ENC_BIG_ENDIAN);
1944
391
      consumed += 2;
1945
391
    }
1946
103
    break;
1947
1948
1.86k
  case val_u_long:
1949
1.86k
    if (total_len != 4) {
1950
1.71k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1951
1.71k
      break;
1952
1.71k
    }
1953
1954
156
    if (hf != NULL)
1955
156
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1956
0
    else if (hf_default->val_u_long != NULL)
1957
0
      proto_tree_add_item(tree, *hf_default->val_u_long, tvb, offset, 4, ENC_BIG_ENDIAN);
1958
156
    consumed = 4;
1959
156
    break;
1960
1961
1.03k
  case time_in_s_secs:
1962
1.03k
    if (total_len != 4) {
1963
806
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1964
806
      break;
1965
806
    }
1966
1967
227
    if (hf != NULL) {
1968
227
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1969
227
    }
1970
0
    else if (hf_default->time_in_s_secs != NULL)
1971
0
      proto_tree_add_item(tree, *hf_default->time_in_s_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1972
1973
227
    consumed = 4;
1974
227
    break;
1975
1976
1.46k
  case time_in_u_secs:
1977
1.46k
    if (total_len != 4) {
1978
1.27k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1979
1.27k
      break;
1980
1.27k
    }
1981
1982
182
    if (hf != NULL) {
1983
182
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1984
182
    }
1985
0
    else if (hf_default->time_in_u_secs != NULL)
1986
0
      proto_tree_add_item(tree, *hf_default->time_in_u_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1987
182
    consumed = 4;
1988
182
    break;
1989
3.56k
  default:
1990
    /* Ignore other field_types */
1991
3.56k
    break;
1992
58.2k
  }
1993
1994
58.2k
  return consumed;
1995
58.2k
}
1996
1997
static int
1998
dissect_dhcpopt_basic_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1999
40.4k
{
2000
40.4k
  const struct opt_info *opt;
2001
40.4k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2002
40.4k
  static const struct basic_types_hfs default_hfs = {
2003
40.4k
    &hf_dhcp_option_value,
2004
40.4k
    &hf_dhcp_option_value_ip_address,
2005
40.4k
    &hf_dhcp_option_value_ip_address,
2006
40.4k
    &hf_dhcp_option_value_stringz,
2007
40.4k
    &hf_dhcp_option_value_boolean,
2008
40.4k
    &hf_dhcp_option_value_8,
2009
40.4k
    &hf_dhcp_option_value_16,
2010
40.4k
    &hf_dhcp_option_value_16,
2011
40.4k
    &hf_dhcp_option_value_u32,
2012
40.4k
    &hf_dhcp_option_value_s_secs,
2013
40.4k
    &hf_dhcp_option_value_u_secs,
2014
40.4k
  };
2015
2016
40.4k
  opt = dhcp_get_opt(option_data->option);
2017
40.4k
  if (opt == NULL)
2018
0
    return 0;
2019
2020
40.4k
  return dhcp_handle_basic_types(pinfo, tree, tree, tvb, opt->ftype,
2021
40.4k
                  0, tvb_reported_length(tvb), opt->phf, &default_hfs);
2022
40.4k
}
2023
2024
/* Returns the number of bytes consumed by this option. */
2025
static int
2026
dhcp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
2027
       int eoff, bool first_pass, bool *at_end, const char **dhcp_type_p,
2028
       const uint8_t **vendor_class_id_p, uint8_t *overload_p,
2029
       wmem_map_t *rfc3396_map)
2030
360k
{
2031
360k
  const struct opt_info *opt;
2032
360k
  unsigned char    code = tvb_get_uint8(tvb, voff);
2033
360k
  int    optlen;
2034
360k
  int    i, consumed;
2035
360k
  proto_tree  *v_tree;
2036
360k
  proto_item  *vti, *ti_value;
2037
360k
  tvbuff_t *option_tvb;
2038
360k
  dhcp_option_data_t option_data;
2039
2040
  /* Note overload_p is NULL inside the overloaded areas; it makes no
2041
   * sense to set it again. */
2042
  /* Options whose length isn't "optlen + 2". */
2043
360k
  switch (code) {
2044
2045
80.3k
  case 0:   /* Padding */
2046
    /* check how much padding we have */
2047
195k
    for (i = voff + 1; i < eoff; i++ ) {
2048
194k
      if (tvb_get_uint8(tvb, i) != 0) {
2049
79.6k
        break;
2050
79.6k
      }
2051
194k
    }
2052
80.3k
    i = i - voff;
2053
80.3k
    if (!first_pass) {
2054
39.9k
      if (bp_tree != NULL) {
2055
39.9k
        vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2056
39.9k
            tvb, voff, 1, 0, "(0) Padding");
2057
39.9k
        v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2058
39.9k
        proto_tree_add_item(v_tree, hf_dhcp_option_padding, tvb, voff, i, ENC_NA);
2059
39.9k
      }
2060
39.9k
    }
2061
80.3k
    consumed = i;
2062
80.3k
    return consumed;
2063
2064
6.71k
  case 255: /* End Option */
2065
6.71k
    if (!first_pass) {
2066
3.33k
      if (bp_tree != NULL) {
2067
3.33k
        vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2068
3.33k
            tvb, voff, 1, 0, "(255) End");
2069
3.33k
        v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2070
3.33k
        if (overload_p == NULL)
2071
2.88k
          proto_tree_add_item(v_tree, hf_dhcp_option_end_overload, tvb, voff, 1, ENC_BIG_ENDIAN);
2072
451
        else
2073
451
          proto_tree_add_item(v_tree, hf_dhcp_option_end, tvb, voff, 1, ENC_BIG_ENDIAN);
2074
3.33k
      }
2075
3.33k
    }
2076
6.71k
    *at_end = true;
2077
6.71k
    consumed = 1;
2078
6.71k
    return consumed;
2079
360k
  }
2080
2081
  /*
2082
   * Get the length of the option, and the number of bytes it
2083
   * consumes (the length doesn't include the option code or
2084
   * length bytes).
2085
   *
2086
   * On the first pass, check first whether we have the length
2087
   * byte, so that we don't throw an exception; if we throw an
2088
   * exception in the first pass, which is only checking for options
2089
   * whose values we need in order to properly dissect the packet
2090
   * on the second pass, we won't actually dissect the options, so
2091
   * you won't be able to see which option had the problem.
2092
   */
2093
273k
  if (first_pass) {
2094
137k
    if (!tvb_bytes_exist(tvb, voff+1, 1)) {
2095
      /*
2096
       * We don't have the length byte; just return 1
2097
       * as the number of bytes we consumed, to count
2098
       * the code byte.
2099
       */
2100
23
      return 1;
2101
23
    }
2102
137k
  }
2103
273k
  optlen = tvb_get_uint8(tvb, voff+1);
2104
273k
  consumed = optlen + 2;
2105
2106
273k
  struct rfc3396_for_option_t *rfc3396_data = wmem_map_lookup(rfc3396_map, GUINT_TO_POINTER(code));
2107
273k
  if (rfc3396_data == NULL) {
2108
112k
    rfc3396_data = wmem_new0(pinfo->pool, struct rfc3396_for_option_t);
2109
112k
    wmem_map_insert(rfc3396_map, GUINT_TO_POINTER(code), rfc3396_data);
2110
112k
  }
2111
2112
  /*
2113
   * In the first pass, we don't put anything into the protocol
2114
   * tree; we just check for some options we have to look at
2115
   * in order to properly process the packet:
2116
   *
2117
   *  52 (Overload) - we need this to properly dissect the
2118
   *     file and sname fields
2119
   *
2120
   *  53 (DHCP message type) - if this is present, this is DHCP
2121
   *
2122
   *  60 (Vendor class identifier) - we need this in order to
2123
   *     interpret the vendor-specific info
2124
   *
2125
   * We also check, before fetching anything, to make sure we
2126
   * have the entire item we're fetching, so that we don't throw
2127
   * an exception.
2128
   */
2129
273k
  if (first_pass) {
2130
137k
    if (tvb_bytes_exist(tvb, voff+2, consumed-2)) {
2131
137k
      switch (code) {
2132
2133
24.7k
      case 52:
2134
24.7k
        if (overload_p != NULL) {
2135
24.1k
          *overload_p = tvb_get_uint8(tvb, voff+2);
2136
24.1k
        }
2137
24.7k
        break;
2138
2139
436
      case 53:
2140
436
        *dhcp_type_p =
2141
436
            val_to_str(pinfo->pool, tvb_get_uint8(tvb, voff+2),
2142
436
          opt53_text,
2143
436
          "Unknown Message Type (0x%02x)");
2144
436
        break;
2145
2146
2.30k
      case 60:
2147
2.30k
        *vendor_class_id_p =
2148
2.30k
          tvb_get_string_enc(pinfo->pool,
2149
2.30k
          tvb, voff+2, consumed-2, ENC_ASCII);
2150
2.30k
        break;
2151
137k
      }
2152
137k
    }
2153
2154
137k
    rfc3396_data->total_number_of_block++;
2155
2156
    /*
2157
     * We don't do anything else here.
2158
     */
2159
137k
    return consumed;
2160
137k
  }
2161
2162
  /* Normal cases */
2163
136k
  opt = dhcp_get_opt(code);
2164
136k
  if (opt == NULL)
2165
0
  {
2166
    /* THIS SHOULD NEVER HAPPEN!!! */
2167
0
    return consumed;
2168
0
  }
2169
2170
136k
  vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2171
136k
    tvb, voff, consumed, code, "(%d) %s", code, opt->text);
2172
136k
  v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2173
136k
  proto_tree_add_item(v_tree, hf_dhcp_option_length, tvb, voff+1, 1, ENC_BIG_ENDIAN);
2174
2175
136k
  ti_value = proto_tree_add_item(v_tree, hf_dhcp_option_value, tvb, voff+2, optlen, ENC_NA);
2176
136k
  proto_item_set_hidden(ti_value);
2177
2178
  /* prepare data for dissector table */
2179
136k
  option_tvb = tvb_new_subset_length(tvb, voff+2, optlen);
2180
136k
  option_data.option = code;
2181
136k
  option_data.overload = overload_p;
2182
136k
  option_data.dhcp_type = *dhcp_type_p;
2183
136k
  option_data.vendor_class_id = *vendor_class_id_p;
2184
2185
  /* RFC 3396 4 Applicability and 7 Decoding Agent Behavior both clearly
2186
   * state that decoding agents MUST consider any case where an option
2187
   * code is repeated as a split option and reassemble it, even for
2188
   * options that are not "concatenation-requiring."
2189
   *
2190
   * However, cf.
2191
   * https://www.ietf.org/archive/id/draft-tojens-dhcp-option-concat-considerations-00.html
2192
   * which notes that real world DHCP implementations do not do this, and
2193
   * that, especially in the case of fixed length option types, this is
2194
   * less robust than actually used approaches of interpreting the options
2195
   * separately, and choosing one option while discarding others.
2196
   *
2197
   * XXX - Perhaps we want a preference of which options to concatenate?
2198
   */
2199
136k
  if (rfc3396_data->total_number_of_block == 1) {
2200
100k
    if (!dissector_try_uint_with_data(dhcp_option_table, code, option_tvb, pinfo, v_tree, false, &option_data)) {
2201
      /* hf_dhcp_option_value is already in tree, just make it visible */
2202
30.3k
      proto_item_set_visible(ti_value);
2203
30.3k
    }
2204
100k
  } else {
2205
35.5k
    proto_item *ti;
2206
35.5k
    rfc3396_data->index_current_block++;
2207
35.5k
    ti = proto_tree_add_string(v_tree, hf_dhcp_option_rfc_3396_detected, tvb, voff+2, optlen,
2208
35.5k
                wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_data->index_current_block, rfc3396_data->total_number_of_block));
2209
35.5k
    if (optlen) {
2210
17.9k
      if (rfc3396_data->tvb_composite == NULL) {
2211
7.99k
        rfc3396_data->tvb_composite = tvb_new_composite();
2212
7.99k
      }
2213
17.9k
      tvb_composite_append(rfc3396_data->tvb_composite, option_tvb);
2214
17.9k
    }
2215
35.5k
    if (rfc3396_data->index_current_block != rfc3396_data->total_number_of_block) {
2216
24.7k
      expert_add_info_format(pinfo, ti, &ei_dhcp_rfc3396_refer_last_option, "For the data, please refer to the last option %u, %u/%u", code, rfc3396_data->total_number_of_block, rfc3396_data->total_number_of_block);
2217
24.7k
    } else if (rfc3396_data->tvb_composite != NULL) {
2218
7.94k
      tvb_composite_finalize(rfc3396_data->tvb_composite);
2219
7.94k
      add_new_data_source(pinfo, rfc3396_data->tvb_composite, "RFC 3396 Long Option");
2220
7.94k
      if (!dissector_try_uint_with_data(dhcp_option_table, code, rfc3396_data->tvb_composite, pinfo, v_tree, false, &option_data)) {
2221
1.23k
        proto_tree_add_item(v_tree, hf_dhcp_option_value, rfc3396_data->tvb_composite, 0, tvb_reported_length(rfc3396_data->tvb_composite), ENC_NA);
2222
1.23k
      }
2223
7.94k
    } else {
2224
2.85k
      expert_add_info_format(pinfo, ti, &ei_dhcp_bad_length, "RFC 3396 Long Option with combined length 0");
2225
2.85k
    }
2226
35.5k
  }
2227
2228
136k
  return consumed;
2229
136k
}
2230
2231
static int
2232
dissect_dhcpopt_policy_filter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2233
199
{
2234
199
  unsigned offset = 0;
2235
2236
429
  while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2237
230
    proto_tree_add_item(tree, hf_dhcp_option_policy_filter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2238
230
    offset += 4;
2239
230
    proto_tree_add_item(tree, hf_dhcp_option_policy_filter_subnet_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2240
230
    offset += 4;
2241
230
  }
2242
2243
199
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2244
55
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2245
55
  }
2246
2247
199
  return tvb_captured_length(tvb);
2248
199
}
2249
2250
static int
2251
dissect_dhcpopt_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2252
214
{
2253
214
  unsigned offset = 0;
2254
2255
360
  while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2256
146
    proto_tree_add_item(tree, hf_dhcp_option_static_route_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2257
146
    offset += 4;
2258
146
    proto_tree_add_item(tree, hf_dhcp_option_static_route_router, tvb, offset, 4, ENC_BIG_ENDIAN);
2259
146
    offset += 4;
2260
146
  }
2261
2262
214
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2263
53
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2264
53
  }
2265
2266
214
  return tvb_captured_length(tvb);
2267
214
}
2268
2269
typedef unsigned(*test_option_len_t)(unsigned);
2270
2271
/* Look for 'encapsulated vendor-specific options' */
2272
static bool
2273
test_encapsulated_vendor_options(tvbuff_t *tvb, unsigned optoff, unsigned optend, test_option_len_t test_len)
2274
1.24k
{
2275
1.24k
  uint8_t subopt;
2276
1.24k
  uint8_t subopt_len;
2277
2278
12.3k
  while (optoff < optend) {
2279
11.8k
    subopt = tvb_get_uint8(tvb, optoff);
2280
11.8k
    optoff++;
2281
2282
    /* Skip padding */
2283
11.8k
    if (subopt == 0)
2284
5.67k
      continue;
2285
    /* We are done, skip any remaining bytes */
2286
6.14k
    if (subopt == 255)
2287
178
      break;
2288
2289
    /* We expect a length byte next */
2290
5.96k
    if (optoff >= optend)
2291
40
      return false;
2292
5.92k
    subopt_len = tvb_get_uint8(tvb, optoff);
2293
2294
5.92k
    if (test_len) {
2295
978
      unsigned expected_subopt_len = test_len(subopt);
2296
978
      if (expected_subopt_len && expected_subopt_len != subopt_len)
2297
95
        return false;
2298
978
    }
2299
5.83k
    optoff++;
2300
2301
    /* Check remaining room for suboption in option */
2302
5.83k
    if (optoff + subopt_len > optend)
2303
421
      return false;
2304
5.41k
    optoff += subopt_len;
2305
5.41k
  }
2306
689
  return true;
2307
1.24k
}
2308
2309
/* Note that Option 43 encapsulated vendor-specific options (RFC 2132 8.4)
2310
 * treat option 0 as padding and option 255 as end of suboptions, unlike
2311
 * Option 125 which does not treat them specially (RFC 3925 4).
2312
 */
2313
static int
2314
dissect_option43_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
2315
         tvbuff_t *tvb)
2316
3.16k
{
2317
3.16k
  unsigned    suboptoff = 0;
2318
3.16k
  unsigned    optend = tvb_reported_length(tvb);
2319
3.16k
  uint8_t     subopt;
2320
3.16k
  uint32_t      subopt_len;
2321
3.16k
  proto_item *item;
2322
3.16k
  proto_tree *sub_tree;
2323
2324
3.16k
  item = proto_tree_add_item_ret_uint8(v_tree, hf_dhcp_option43_suboption, tvb, suboptoff, 1, ENC_NA, &subopt);
2325
2326
3.16k
  suboptoff+=1;
2327
2328
3.16k
  if (subopt == 0) {
2329
    /* Padding */
2330
1.59k
    return suboptoff;
2331
1.59k
  }
2332
2333
1.57k
  if (subopt == 255) {
2334
    /* END */
2335
    /* XXX - Should there be expert info if there are more bytes? */
2336
172
    return optend;
2337
172
  }
2338
2339
1.40k
  if (suboptoff >= optend) {
2340
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
2341
0
                  "Suboption %d: no room left in option for suboption length", subopt);
2342
0
    return optend;
2343
0
  }
2344
2345
1.40k
  sub_tree = proto_item_add_subtree(item, ett_dhcp_option43_suboption);
2346
1.40k
  proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
2347
1.40k
  suboptoff++;
2348
2349
1.40k
  if (suboptoff+subopt_len > optend) {
2350
0
    expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
2351
0
            "Suboption %d: no room left in option for suboption value", subopt);
2352
0
    return optend;
2353
0
  }
2354
2355
1.40k
  proto_tree_add_item(sub_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2356
1.40k
  suboptoff+= subopt_len;
2357
2358
1.40k
  return suboptoff;
2359
2360
1.40k
}
2361
2362
static int
2363
dissect_dhcpopt_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2364
1.42k
{
2365
1.42k
  heur_dtbl_entry_t *hdtbl_entry;
2366
2367
1.42k
  if (!dissector_try_heuristic(dhcp_vendor_info_subdissector, tvb, pinfo, tree, &hdtbl_entry, data)) {
2368
1.09k
    unsigned offset = 0;
2369
1.09k
    if (test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), NULL)) {
2370
      /* Generic encapsulated options per RFC 2132 8.4 */
2371
3.81k
      while (tvb_reported_length_remaining(tvb, offset)) {
2372
3.16k
        offset += dissect_option43_generic_suboption(pinfo, proto_tree_get_parent(tree), tree, tvb_new_subset_remaining(tvb, offset));
2373
3.16k
      }
2374
652
    } else {
2375
      /* Default Vendor-Specific Info.. display in bytes */
2376
441
      proto_tree_add_item(tree, hf_dhcp_option43_value, tvb, offset, tvb_reported_length(tvb), ENC_NA);
2377
441
    }
2378
1.09k
  }
2379
2380
1.42k
  return tvb_captured_length(tvb);
2381
1.42k
}
2382
2383
static int
2384
dissect_dhcpopt_option_overload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2385
23.6k
{
2386
23.6k
  unsigned offset = 0;
2387
23.6k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2388
2389
23.6k
  if (tvb_reported_length(tvb) < 1) {
2390
211
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2391
211
    return 1;
2392
211
  }
2393
2394
23.4k
  proto_tree_add_item(tree, hf_dhcp_option_option_overload, tvb, offset, 1, ENC_BIG_ENDIAN);
2395
23.4k
  if (option_data->overload == NULL) {
2396
    // Option Overload inside the overloaded fields is nonsensical
2397
396
    expert_add_info(pinfo, tree, &ei_dhcp_opt_overload_wrong_field);
2398
396
  }
2399
2400
23.4k
  return tvb_captured_length(tvb);
2401
23.6k
}
2402
2403
static int
2404
dissect_dhcpopt_dhcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2405
212
{
2406
212
  uint32_t type;
2407
212
  char* str_type;
2408
2409
212
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp, tvb, 0, 1, ENC_NA, &type);
2410
  /* Show the message type name on the Message Type option, and in the protocol root */
2411
212
  str_type = val_to_str(pinfo->pool, type, opt53_text, "Unknown Message Type (0x%02x)");
2412
212
  proto_item_append_text(tree, " (%s)", str_type);
2413
212
  proto_item_append_text(proto_item_get_parent(tree), " (%s)", str_type);
2414
2415
212
  return tvb_captured_length(tvb);
2416
212
}
2417
2418
static int
2419
dissect_dhcpopt_param_request_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2420
539
{
2421
539
  unsigned offset = 0;
2422
539
  uint8_t byte;
2423
2424
13.8k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
2425
13.2k
    byte = tvb_get_uint8(tvb, offset);
2426
13.2k
    proto_tree_add_uint_format_value(tree, hf_dhcp_option_parameter_request_list_item,
2427
13.2k
        tvb, offset, 1, byte, "(%d) %s", byte, dhcp_get_opt_text(byte));
2428
13.2k
    offset++;
2429
13.2k
  }
2430
2431
539
  return tvb_captured_length(tvb);
2432
539
}
2433
2434
static int
2435
dissect_dhcpopt_vendor_class_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2436
1.34k
{
2437
1.34k
  heur_dtbl_entry_t *hdtbl_entry;
2438
2439
  /*
2440
   * XXX - RFC 2132 says this is a string of octets;
2441
   * should we check for non-printables?
2442
   */
2443
1.34k
  proto_tree_add_item(tree, hf_dhcp_option_vendor_class_id, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
2444
1.34k
  (void) dissector_try_heuristic(dhcp_vendor_id_subdissector, tvb, pinfo, tree, &hdtbl_entry, data);
2445
2446
1.34k
  return tvb_captured_length(tvb);
2447
1.34k
}
2448
2449
static int
2450
dissect_dhcpopt_client_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2451
139
{
2452
139
  unsigned offset = 0;
2453
139
  int length = tvb_reported_length(tvb);
2454
139
  unsigned char byte;
2455
2456
139
  if (length > 0)
2457
105
    byte = tvb_get_uint8(tvb, offset);
2458
34
  else
2459
34
    byte = 0;
2460
2461
  /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2462
    guess that the first is the hwtype, and the last 6
2463
    are the hw addr */
2464
  /* See https://www.iana.org/assignments/arp-parameters */
2465
  /* RFC2132 9.14 Client-identifier has the following to say:
2466
    A hardware type of 0 (zero) should be used when the value
2467
    field contains an identifier other than a hardware address
2468
    (e.g. a fully qualified domain name). */
2469
2470
139
  if (length == 7 && byte > 0 && byte < 48) {
2471
4
    proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2472
2473
4
    if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2474
2
      proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2475
2
    else
2476
2
      proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2477
2
        tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2478
135
  } else if (length == 17 && byte == 0) {
2479
    /* Identifier is a UUID */
2480
2
    proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2481
2482
  /* From RFC 4361 paragraph 6.1 DHCPv4 Client Behavior:
2483
    To send an RFC 3315-style binding identifier in a DHCPv4 'client
2484
    identifier' option, the type of the 'client identifier' option is set
2485
    to 255. */
2486
133
  } else if (byte == 255) {
2487
32
    uint16_t  duidtype;
2488
32
    uint16_t  hwtype;
2489
2490
    /*  The type field is immediately followed by the IAID, which is
2491
      an opaque 32-bit quantity */
2492
32
    proto_tree_add_string(tree, hf_dhcp_client_id_iaid, tvb, offset+1, 4,
2493
32
      tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 4, byte));
2494
32
    offset += 5;
2495
32
    proto_tree_add_item_ret_uint16(tree, hf_dhcp_client_id_duid_type, tvb, offset, 2, ENC_BIG_ENDIAN, &duidtype);
2496
32
    switch (duidtype) {
2497
12
    case DUID_LLT:
2498
12
      if (length < 8) {
2499
1
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2500
1
        break;
2501
1
      }
2502
11
      hwtype=tvb_get_ntohs(tvb, offset + 2);
2503
11
      proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_llt_hw_type,
2504
11
          tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2505
2506
      /* XXX seconds since Jan 1 2000 */
2507
11
      proto_tree_add_item(tree, hf_dhcp_client_identifier_time, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2508
11
      if (length > 8) {
2509
11
        proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 8,
2510
11
          length - 13, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+8, length-13, hwtype));
2511
11
        if(DHCP_HW_IS_ETHER(hwtype, length-13)) {
2512
1
          proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2513
1
            tvb, offset+8, length-13, ENC_NA);
2514
1
        }
2515
11
      }
2516
11
      break;
2517
3
    case DUID_EN:
2518
3
      if (length < 6) {
2519
0
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2520
0
        break;
2521
0
      }
2522
3
      proto_tree_add_item(tree, hf_dhcp_client_identifier_enterprise_num, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
2523
3
      if (length > 6) {
2524
3
        proto_tree_add_item(tree, hf_dhcp_client_identifier, tvb, offset + 6, length - 11, ENC_NA);
2525
3
      }
2526
3
      break;
2527
4
    case DUID_LL:
2528
4
      if (length < 4) {
2529
0
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2530
0
        break;
2531
0
      }
2532
4
      hwtype=tvb_get_ntohs(tvb, offset + 2);
2533
4
      proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_ll_hw_type,
2534
4
          tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2535
2536
4
      if (length > 4) {
2537
4
        proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 4,
2538
4
          length - 9, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+4, length-9, hwtype));
2539
4
        if(DHCP_HW_IS_ETHER(hwtype, length-9)) {
2540
1
          proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2541
1
            tvb, offset+4, length-9, ENC_NA);
2542
1
        }
2543
4
      }
2544
4
      break;
2545
32
    }
2546
101
  } else if (byte == 0 && length > 1) {
2547
    /* identifier other than a hardware address (e.g. a fully qualified domain name) */
2548
12
    proto_tree_add_item(tree, hf_dhcp_client_identifier_type, tvb, offset, 1, ENC_NA);
2549
12
    proto_tree_add_item(tree, hf_dhcp_client_identifier_undef, tvb, offset+1, length-1, ENC_ASCII);
2550
89
  } else {
2551
    /* otherwise, it's opaque data */
2552
89
  }
2553
2554
139
  return tvb_captured_length(tvb);
2555
139
}
2556
2557
static int
2558
dissect_dhcpopt_user_class_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2559
98
{
2560
98
  unsigned char user_class_instance_index = 0;
2561
98
  unsigned offset = 0;
2562
98
  proto_item *vtix, *len_item;
2563
98
  proto_tree *o77_v_tree;
2564
98
  unsigned class_length, uci_len = tvb_reported_length(tvb);
2565
98
  if (uci_len < 2) {
2566
35
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2567
35
    return 1;
2568
35
  }
2569
2570
  /* First byte is the length of User Class data. If it is zero, then let's assume this
2571
   * is a Microsoft variant that has the two-byte length field with most-significant byte
2572
   * as zero.
2573
   */
2574
63
  uint32_t ms_data_length = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2575
63
  if (ms_data_length <= 0xff) {
2576
    /* MSB is zero, this is Microsoft */
2577
143
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
2578
      /* Create subtree for instance of User Class. */
2579
127
      vtix = proto_tree_add_uint_format_value(tree, hf_dhcp_option77_user_class,
2580
127
          tvb, offset, 1, user_class_instance_index, "[%d]", user_class_instance_index);
2581
127
      o77_v_tree = proto_item_add_subtree(vtix, ett_dhcp_option77_instance);
2582
127
      proto_tree_add_item_ret_uint(o77_v_tree, hf_dhcp_option77_user_class_binary_data_length, tvb, offset, 2, ENC_BIG_ENDIAN, &ms_data_length);
2583
127
      offset += 2;
2584
127
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_binary_data, tvb, offset, ms_data_length, ENC_NA);
2585
127
      offset += ms_data_length;
2586
      /* User Class Binary Data is padded to 4-byte boundary */
2587
127
      uint16_t padding_length = WS_PADDING_TO_4(ms_data_length);
2588
127
      if (padding_length > 0) {
2589
20
        proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_padding, tvb, offset, padding_length, ENC_NA);
2590
20
        offset += padding_length;
2591
20
      }
2592
127
      uint32_t len;
2593
127
      proto_tree_add_item_ret_uint(o77_v_tree, hf_dhcp_option77_user_class_name_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2594
127
      offset += 2;
2595
127
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_name, tvb, offset, len, ENC_UTF_16);
2596
127
      offset += len;
2597
127
      proto_tree_add_item_ret_uint(o77_v_tree, hf_dhcp_option77_user_class_description_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2598
127
      offset += 2;
2599
127
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_description, tvb, offset, len, ENC_UTF_16);
2600
127
      offset += len;
2601
127
      proto_item_set_end(vtix, tvb, offset);
2602
127
      user_class_instance_index++;
2603
127
    }
2604
16
    return tvb_captured_length(tvb);
2605
16
  }
2606
2607
299
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
2608
295
    class_length = tvb_get_uint8(tvb, offset);
2609
295
    if (class_length >= uci_len) {
2610
      /* Having the sum of the User Class data lengths exceed the total User Option Information length (uci_len)
2611
       * is a violation of RFC 3004. In that case the remaining data is treated as a non-conformant (text) option.
2612
       * This check will also catch the Microsoft 'variation' implementation (when Vendor class identifier contains
2613
       * "MSFT 5.0") such as "RRAS.Microsoft" and others like "iPXE".
2614
       * In the unlikely case that the first character can be interpreted as a valid length the next iteration
2615
       * of this while loop will catch that.
2616
       * https://gitlab.com/wireshark/wireshark/-/issues/16349
2617
       * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/fe8a2dd4-1e8c-4546-bacd-4ae10de02058
2618
       */
2619
39
      proto_item *expert_ti = proto_tree_add_item(tree, hf_dhcp_option77_user_class_text, tvb, offset, uci_len, ENC_ASCII);
2620
39
      expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
2621
39
      break;
2622
39
    }
2623
2624
    /* Create subtree for instance of User Class. */
2625
256
    vtix = proto_tree_add_uint_format_value(tree, hf_dhcp_option77_user_class,
2626
256
        tvb, offset, 1, user_class_instance_index, "[%d]", user_class_instance_index);
2627
256
    o77_v_tree = proto_item_add_subtree(vtix, ett_dhcp_option77_instance);
2628
2629
    /* Add length for instance of User Class. */
2630
256
    len_item = proto_tree_add_uint(o77_v_tree, hf_dhcp_option77_user_class_length, tvb, offset, 1, class_length);
2631
256
    proto_item_set_len(vtix, class_length+1);
2632
256
    offset++;
2633
2634
256
    if (class_length == 0) {
2635
4
      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);
2636
4
      break;
2637
4
    }
2638
2639
    /* Add data for instance of User Class. */
2640
252
    proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_data, tvb, offset, class_length, ENC_NA);
2641
2642
252
    offset += class_length;
2643
252
    uci_len -= class_length + 1;
2644
252
    user_class_instance_index++;
2645
252
  }
2646
2647
47
  return tvb_captured_length(tvb);
2648
63
}
2649
2650
static int
2651
dissect_dhcpopt_slp_directory_agent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2652
53
{
2653
53
  unsigned offset = 0;
2654
53
  uint32_t byte;
2655
2656
53
  if (tvb_reported_length(tvb) < 1) {
2657
6
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2658
6
    return 1;
2659
6
  }
2660
2661
47
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_slp_directory_agent_value, tvb, offset, 1, ENC_BIG_ENDIAN, &byte);
2662
47
  offset++;
2663
2664
47
  if (byte == 0x80) {
2665
2
    if (tvb_reported_length_remaining(tvb, offset) == 0)
2666
1
      return offset;
2667
2668
1
    offset++;
2669
1
  }
2670
2671
633
  while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2672
587
    proto_tree_add_item(tree, hf_dhcp_option_slp_directory_agent_slpda_address, tvb, offset, 4, ENC_BIG_ENDIAN);
2673
587
    offset += 4;
2674
587
  }
2675
2676
46
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2677
39
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2678
39
  }
2679
2680
46
  return tvb_captured_length(tvb);
2681
47
}
2682
2683
static int
2684
dissect_dhcpopt_slp_service_scope(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2685
241
{
2686
241
  unsigned offset = 0;
2687
2688
241
  proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2689
2690
241
  offset++;
2691
241
  proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_string, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2692
2693
241
  return tvb_captured_length(tvb);
2694
241
}
2695
2696
static int
2697
dissect_dhcpopt_client_full_domain_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2698
42
{
2699
42
  static int * const fqdn_hf_flags[] = {
2700
42
    &hf_dhcp_fqdn_mbz,
2701
42
    &hf_dhcp_fqdn_n,
2702
42
    &hf_dhcp_fqdn_e,
2703
42
    &hf_dhcp_fqdn_o,
2704
42
    &hf_dhcp_fqdn_s,
2705
42
    NULL
2706
42
  };
2707
42
  uint8_t fqdn_flags;
2708
42
  unsigned offset = 0, length = tvb_reported_length(tvb);
2709
42
  const char  *dns_name;
2710
42
  int   dns_name_len;
2711
2712
42
  if (length < 3) {
2713
16
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3");
2714
16
    return 1;
2715
16
  }
2716
2717
26
  fqdn_flags = tvb_get_uint8(tvb, offset);
2718
26
  proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_fqdn_flags,
2719
26
        ett_dhcp_fqdn_flags, fqdn_hf_flags, ENC_BIG_ENDIAN);
2720
2721
  /* XXX: use code from packet-dns for return code decoding */
2722
26
  proto_tree_add_item(tree, hf_dhcp_fqdn_rcode1, tvb, offset+1, 1, ENC_BIG_ENDIAN);
2723
  /* XXX: use code from packet-dns for return code decoding */
2724
26
  proto_tree_add_item(tree, hf_dhcp_fqdn_rcode2, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2725
2726
26
  if (length > 3) {
2727
24
    if (fqdn_flags & F_FQDN_E) {
2728
4
      get_dns_name(pinfo->pool, tvb, offset+3, length-3, offset+3, &dns_name, &dns_name_len);
2729
4
      proto_tree_add_string(tree, hf_dhcp_fqdn_name,
2730
4
        tvb, offset+3, length-3, format_text(pinfo->pool, dns_name, dns_name_len));
2731
20
    } else {
2732
20
      proto_tree_add_item(tree, hf_dhcp_fqdn_asciiname, tvb, offset+3, length-3, ENC_ASCII);
2733
20
    }
2734
24
  }
2735
2736
26
  return tvb_captured_length(tvb);
2737
42
}
2738
2739
static int
2740
dissect_dhcpopt_novell_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2741
106
{
2742
106
  unsigned offset = 0;
2743
2744
  /* Option 85 can be sent as a string */
2745
  /* Added by Greg Morris (gmorris[AT]novell.com) */
2746
106
  if (novell_string) {
2747
0
    proto_tree_add_item(tree, hf_dhcp_option_novell_dss_string, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
2748
106
  } else {
2749
    /* IP addresses */
2750
854
    while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2751
2752
748
      proto_tree_add_item(tree, hf_dhcp_option_novell_dss_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2753
748
      offset += 4;
2754
748
    }
2755
2756
106
    if (tvb_reported_length_remaining(tvb, offset) > 0) {
2757
91
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2758
91
    }
2759
106
  }
2760
2761
106
  return tvb_captured_length(tvb);
2762
106
}
2763
2764
static int
2765
dissect_dhcpopt_dhcp_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2766
34
{
2767
34
  unsigned offset = 0;
2768
34
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2769
34
  uint32_t protocol, rdm;
2770
34
  uint8_t algorithm;
2771
2772
34
  if (tvb_reported_length(tvb) < 11) {
2773
19
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 11");
2774
19
    return 1;
2775
19
  }
2776
2777
15
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_protocol, tvb, offset, 1, ENC_BIG_ENDIAN, &protocol);
2778
15
  offset++;
2779
2780
15
  algorithm = tvb_get_uint8(tvb, offset);
2781
15
  switch (protocol) {
2782
2783
8
  case AUTHEN_PROTO_DELAYED_AUTHEN:
2784
8
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_alg_delay, tvb, offset, 1, ENC_BIG_ENDIAN);
2785
8
    break;
2786
2787
7
  default:
2788
7
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN);
2789
7
    break;
2790
15
  }
2791
15
  offset++;
2792
2793
15
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_rdm, tvb, offset, 1, ENC_BIG_ENDIAN, &rdm);
2794
15
  offset++;
2795
2796
15
  switch (rdm) {
2797
2798
5
  case AUTHEN_RDM_MONOTONIC_COUNTER:
2799
5
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_replay_detection, tvb, offset, 8, ENC_BIG_ENDIAN);
2800
5
    break;
2801
2802
10
  default:
2803
10
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_rdv, tvb, offset, 8, ENC_ASCII);
2804
10
    break;
2805
15
  }
2806
15
  offset += 8;
2807
2808
15
  switch (protocol) {
2809
2810
8
  case AUTHEN_PROTO_DELAYED_AUTHEN:
2811
8
    switch (algorithm) {
2812
2813
4
    case AUTHEN_DELAYED_ALGO_HMAC_MD5:
2814
4
      if (option_data->dhcp_type && !strcmp(option_data->dhcp_type, OPT53_DISCOVER)) {
2815
        /* Discover has no Secret ID nor HMAC MD5 Hash */
2816
1
        break;
2817
3
      } else {
2818
3
        if (tvb_reported_length_remaining(tvb, offset) < 20) {
2819
2
          expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 20");
2820
2
          break;
2821
2
        }
2822
2823
1
        proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_secret_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2824
1
        offset += 4;
2825
1
        proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_hmac_md5_hash, tvb, offset, 16, ENC_NA);
2826
1
        break;
2827
3
      }
2828
2829
4
    default:
2830
4
      if (tvb_reported_length_remaining(tvb, offset) == 0)
2831
1
        break;
2832
2833
3
      proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2834
3
      break;
2835
8
    }
2836
8
    break;
2837
2838
8
  default:
2839
7
    if (tvb_reported_length_remaining(tvb, offset) == 0)
2840
1
      break;
2841
2842
6
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2843
6
    break;
2844
15
  }
2845
2846
15
  return tvb_captured_length(tvb);
2847
15
}
2848
2849
static int
2850
dissect_dhcpopt_client_architecture(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2851
235
{
2852
235
  unsigned offset = 0;
2853
2854
1.18k
  while (tvb_reported_length_remaining(tvb, offset) > 1) {
2855
954
    uint32_t architecture_id;
2856
954
    proto_item *pi;
2857
2858
954
    pi = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_client_system_architecture, tvb, offset, 2, ENC_BIG_ENDIAN, &architecture_id);
2859
954
    offset += 2;
2860
2861
    /*
2862
     * Some Client Architecture IDs are widely misused.  For
2863
     * details, refer to the comment at the definition of
2864
     * dhcp_client_arch.
2865
     *
2866
     * The most common problem is a client using architecture ID 9
2867
     * when performing an EFI x64 boot.  Windows Server 2008 WDS
2868
     * does not recognize ID 9, but most other DHCP servers
2869
     * (including newer versions of WDS) silently map architecture
2870
     * ID 9 to x64 in order to accommodate these clients.
2871
     */
2872
954
    if (architecture_id == 9) {
2873
80
      expert_add_info_format(pinfo, pi, &ei_dhcp_option93_client_arch_ambiguous, "Client Architecture ID 9 is often incorrectly used for EFI x64");
2874
80
    }
2875
2876
    /*
2877
     * Technically, architecture ID 7 is ambiguous for the same
2878
     * reason, but it's extremely unlikely to be a real world
2879
     * problem, so a warning would probably just be unwelcome
2880
     * noise.
2881
     */
2882
954
  }
2883
235
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2884
29
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
2885
29
  }
2886
2887
235
  return tvb_captured_length(tvb);
2888
235
}
2889
2890
static int
2891
dissect_dhcpopt_client_network_interface_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2892
38
{
2893
38
  unsigned offset = 0;
2894
38
  uint8_t id_type;
2895
2896
38
  id_type = tvb_get_uint8(tvb, offset);
2897
38
  offset++;
2898
2899
38
  if (id_type == 0x01) {
2900
17
    proto_tree_add_item(tree, hf_dhcp_option_client_network_id_major_ver,
2901
17
              tvb, offset, 1, ENC_LITTLE_ENDIAN);
2902
17
    offset++;
2903
17
    proto_tree_add_item(tree, hf_dhcp_option_client_network_id_minor_ver,
2904
17
              tvb, offset, 1, ENC_LITTLE_ENDIAN);
2905
17
  }
2906
2907
38
  return tvb_captured_length(tvb);
2908
38
}
2909
2910
static int
2911
dissect_dhcpopt_client_identifier_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2912
96
{
2913
96
  unsigned offset = 0, length = tvb_reported_length(tvb);
2914
96
  uint8_t byte;
2915
2916
96
  if (length > 0)
2917
88
    byte = tvb_get_uint8(tvb, offset);
2918
8
  else
2919
8
    byte = 0;
2920
2921
  /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2922
    guess that the first is the hwtype, and the last 6
2923
    are the hw addr */
2924
  /* See https://www.iana.org/assignments/arp-parameters */
2925
  /* RFC2132 9.14 Client-identifier has the following to say:
2926
    A hardware type of 0 (zero) should be used when the value
2927
    field contains an identifier other than a hardware address
2928
    (e.g. a fully qualified domain name). */
2929
2930
96
  if (length == 7 && byte > 0 && byte < 48) {
2931
8
    proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2932
8
    if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2933
4
      proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2934
4
    else
2935
4
      proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2936
4
        tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2937
88
  } else if (length == 17 && byte == 0) {
2938
    /* Identifier is a UUID */
2939
2
    proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2940
86
  } else {
2941
    /* otherwise, it's opaque data */
2942
86
  }
2943
2944
96
  return tvb_captured_length(tvb);
2945
96
}
2946
2947
static int
2948
dissect_dhcpopt_civic_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2949
6.08k
{
2950
6.08k
  unsigned offset = 0;
2951
2952
6.08k
  if (tvb_reported_length(tvb) >= 3)
2953
387
  {
2954
387
    proto_tree_add_item(tree, hf_dhcp_option_civic_location_what, tvb, offset, 1, ENC_BIG_ENDIAN);
2955
387
    offset++;
2956
387
    proto_tree_add_item(tree, hf_dhcp_option_civic_location_country, tvb, offset, 2, ENC_ASCII);
2957
387
    offset += 2;
2958
2959
1.30k
    while (tvb_reported_length_remaining(tvb, offset) >= 2)
2960
1.17k
    {
2961
1.17k
      uint32_t calength;
2962
1.17k
      proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2963
1.17k
      offset++;
2964
1.17k
      proto_tree_add_item_ret_uint(tree, hf_dhcp_option_civic_location_ca_length, tvb, offset, 1, ENC_BIG_ENDIAN, &calength);
2965
1.17k
      offset++;
2966
2967
1.17k
      if (calength == 0)
2968
548
        continue;
2969
2970
631
      if (tvb_reported_length_remaining(tvb, offset) >= calength)
2971
369
      {
2972
369
        proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_value, tvb, offset, calength, ENC_ASCII);
2973
369
        offset += calength;
2974
369
      }
2975
262
      else
2976
262
      {
2977
262
        expert_add_info(pinfo, tree, &ei_dhcp_option_civic_location_bad_cattype);
2978
262
        break;
2979
262
      }
2980
631
    }
2981
387
  }
2982
2983
6.08k
  return tvb_captured_length(tvb);
2984
6.08k
}
2985
2986
static int
2987
dissect_dhcpopt_name_server_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2988
81
{
2989
81
  unsigned offset = 0, length = tvb_reported_length(tvb);
2990
81
  uint16_t ns;
2991
2992
81
  if (length < 2) {
2993
31
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2994
31
    return 1;
2995
50
  } else if (length & 1) {
2996
5
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length (%u) isn't even number", length);
2997
5
    return 1;
2998
5
  }
2999
3000
2.48k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3001
2.44k
    ns = tvb_get_ntohs(tvb, offset);
3002
    /* XXX - Make this a value_string */
3003
2.44k
    switch (ns) {
3004
439
    case RFC2937_LOCAL_NAMING_INFORMATION:
3005
439
      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)");
3006
439
      break;
3007
88
    case RFC2937_DOMAIN_NAME_SERVER_OPTION:
3008
88
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Domain Name Server Option (6)");
3009
88
      break;
3010
105
    case RFC2937_NETWORK_INFORMATION_SERVERS_OPTION:
3011
105
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Servers Option (41)");
3012
105
      break;
3013
101
    case RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION:
3014
101
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "NetBIOS over TCP/IP Name Server Option (44)");
3015
101
      break;
3016
91
    case RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION:
3017
91
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Service+ Servers Option (65)");
3018
91
      break;
3019
1.61k
    default:
3020
1.61k
      expert_add_info_format(pinfo, tree, &ei_dhcp_option_dhcp_name_service_invalid,
3021
1.61k
            "Invalid Name Service (%u). RFC 2937 defines only 0, 6, 41, 44, and 65 as possible values.", ns);
3022
1.61k
      break;
3023
2.44k
    }
3024
2.44k
    offset += 2;
3025
2.44k
  }
3026
3027
45
  return tvb_captured_length(tvb);
3028
45
}
3029
3030
static int
3031
dissect_dhcpopt_dhcp_domain_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3032
309
{
3033
309
  int length = tvb_reported_length(tvb);
3034
309
  unsigned offset = 0;
3035
309
  char    *name_out;
3036
309
  const char  *dns_name;
3037
309
  int   dns_name_len;
3038
3039
  /* Domain Names - Implementation And Specification (RFC 1035) */
3040
3041
  /* We will display the information about fqdn */
3042
309
  int consumedx = 0;
3043
3044
9.32k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3045
    /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3046
9.01k
    consumedx = get_dns_name(pinfo->pool, tvb, offset,
3047
9.01k
      length, 0, &dns_name, &dns_name_len);
3048
9.01k
    name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3049
9.01k
    proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_fqdn, tvb, offset, consumedx, name_out);
3050
9.01k
    offset += consumedx;
3051
9.01k
  }
3052
3053
309
  return tvb_captured_length(tvb);
3054
309
}
3055
3056
static int
3057
dissect_dhcpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3058
57
{
3059
57
  int length = tvb_reported_length(tvb);
3060
57
  unsigned offset = 0;
3061
57
  const char  *dns_name;
3062
57
  int   dns_name_len;
3063
57
  char    *name_out;
3064
3065
  /* Domain Names - Implementation And Specification (RFC 1035) */
3066
  /* We will display the information about SIP server */
3067
57
  uint32_t enc;
3068
3069
57
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_sip_server_enc, tvb, offset, 1, ENC_NA, &enc);
3070
57
  offset += 1;
3071
3072
57
  switch (enc) {
3073
39
  case RFC_3361_ENC_FQDN: {
3074
39
    int consumedx = 0;
3075
39
    if (length < 3) {
3076
6
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3 (len = %u)", length);
3077
6
      break;
3078
6
    }
3079
3080
699
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
3081
      /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3082
666
      consumedx = get_dns_name(pinfo->pool, tvb, offset, length,
3083
666
        1 /* ignore enc */, &dns_name, &dns_name_len);
3084
666
      name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3085
3086
666
      proto_tree_add_string(tree, hf_dhcp_option_sip_server_name, tvb, offset, consumedx, name_out);
3087
666
      offset += consumedx;
3088
666
    }
3089
33
    break;
3090
39
  }
3091
11
  case RFC_3361_ENC_IPADDR:
3092
11
    if (length < 5) {
3093
2
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5 (len = %u)", length);
3094
2
      break;
3095
2
    }
3096
    /* x % 2^n == x & (2^n - 1) note : (assuming x is a positive integer) */
3097
9
    if ((length - 1) & 3) {
3098
1
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", length);
3099
1
      break;
3100
1
    }
3101
235
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
3102
227
      proto_tree_add_item(tree, hf_dhcp_option_sip_server_address, tvb, offset, 4, ENC_BIG_ENDIAN);
3103
227
      offset += 4;
3104
227
    }
3105
8
    break;
3106
7
  default:
3107
7
    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);
3108
7
    break;
3109
57
  }
3110
3111
26
  return tvb_captured_length(tvb);
3112
57
}
3113
3114
static int
3115
dissect_dhcpopt_classless_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3116
150
{
3117
150
  unsigned offset = 0;
3118
150
  unsigned i, mask_width, significant_octets;
3119
150
  proto_item* route_item;
3120
3121
  /* minimum length is 5 bytes */
3122
150
  if (tvb_reported_length(tvb) < 5) {
3123
81
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5");
3124
81
    return 1;
3125
81
  }
3126
904
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3127
892
    mask_width = tvb_get_uint8(tvb, offset);
3128
    /* mask_width <= 32 */
3129
892
    if (mask_width > 32) {
3130
57
      expert_add_info_format(pinfo, tree, &ei_dhcp_option_classless_static_route, "Mask width (%d) > 32", mask_width);
3131
57
      break;
3132
57
    }
3133
835
    significant_octets = (mask_width + 7) / 8;
3134
835
    route_item = proto_tree_add_bytes_format(tree, hf_dhcp_option_classless_static_route, tvb, offset,
3135
835
      1 + significant_octets + 4, NULL, " ");
3136
835
    offset++;
3137
    /* significant octets + router(4) */
3138
835
    if (tvb_reported_length_remaining(tvb, offset) < significant_octets + 4) {
3139
0
      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);
3140
0
      break;
3141
0
    }
3142
835
    if(mask_width == 0)
3143
352
      proto_item_append_text(route_item, "default");
3144
483
    else {
3145
1.44k
      for(i = 0 ; i < significant_octets ; i++) {
3146
959
        if (i > 0)
3147
484
          proto_item_append_text(route_item, ".");
3148
959
        proto_item_append_text(route_item, "%d", tvb_get_uint8(tvb, offset++));
3149
959
      }
3150
1.42k
      for(i = significant_octets ; i < 4 ; i++)
3151
941
        proto_item_append_text(route_item, ".0");
3152
483
      proto_item_append_text(route_item, "/%d", mask_width);
3153
483
    }
3154
835
    proto_item_append_text(route_item, "-%s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3155
835
    offset += 4;
3156
835
  }
3157
3158
69
  return tvb_captured_length(tvb);
3159
150
}
3160
3161
static int
3162
dissect_dhcpopt_coordinate_based_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3163
27
{
3164
27
  unsigned offset = 0, length = tvb_reported_length(tvb);
3165
27
  proto_item* ti;
3166
3167
27
  if (length == 16) {
3168
21
    int ret;
3169
21
    unsigned char lci[16];
3170
21
    struct rfc3825_location_fixpoint_t location_fp;
3171
21
    struct rfc3825_location_decimal_t location;
3172
3173
21
    tvb_memcpy(tvb, lci, offset, 16);
3174
3175
    /* convert lci encoding into fixpoint location */
3176
21
    rfc3825_lci_to_fixpoint(lci, &location_fp);
3177
3178
    /* convert location from decimal to fixpoint */
3179
21
    ret = rfc3825_fixpoint_to_decimal(&location_fp, &location);
3180
3181
21
    if (ret != RFC3825_NOERROR) {
3182
20
      ti = proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_error, tvb, offset, 1, ret);
3183
20
      proto_item_set_len(ti, length);
3184
20
    } else {
3185
1
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude, tvb, offset, 5, location.latitude, "%15.10f", location.latitude);
3186
1
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_longitude, tvb, offset+5, 5, location.longitude, "%15.10f", location.longitude);
3187
1
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude_res, tvb, offset, 1, location.latitude_res, "%15.10f", location.latitude_res);
3188
1
      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);
3189
1
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_altitude, tvb, offset+12, 4, location.altitude, "%15.10f", location.altitude);
3190
1
      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);
3191
1
      proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_altitude_type, tvb, offset+10, 1, location.altitude_type);
3192
1
      proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_map_datum, tvb, offset+15, 1, location.datum_type);
3193
1
    }
3194
21
  } else if (length < 69) { /* CableLabs DSS_ID */
3195
4
    unsigned s_len;
3196
3197
4
    proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset, 1, ENC_BIG_ENDIAN);
3198
4
    proto_tree_add_item_ret_uint(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1, 1, ENC_BIG_ENDIAN, &s_len);
3199
4
    proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2, s_len, ENC_ASCII);
3200
3201
4
    if (length > s_len+2) { /* Second DSS_ID*/
3202
3203
3
      proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset+2+s_len, 1, ENC_BIG_ENDIAN);
3204
3
      proto_tree_add_item_ret_uint(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1+2+s_len, 1, ENC_BIG_ENDIAN, &s_len);
3205
3
      proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2+2+s_len, s_len, ENC_ASCII);
3206
3
    }
3207
4
  } else {
3208
2
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Invalid length of DHCP option!");
3209
2
  }
3210
3211
27
  return tvb_captured_length(tvb);
3212
27
}
3213
3214
static int
3215
dissect_dhcpopt_vi_vendor_class(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3216
146
{
3217
146
  unsigned offset = 0;
3218
146
  uint32_t enterprise = 0;
3219
146
  uint32_t option_data_len = 0;
3220
146
  unsigned data_len = 0;
3221
146
  unsigned s_end;
3222
146
  proto_item *eti, *expert_ti;
3223
146
  proto_tree *e_tree;
3224
146
  proto_tree *vcdi_tree;
3225
3226
146
  if (tvb_reported_length(tvb) == 1) {
3227
    /* CableLab specific */
3228
1
    proto_tree_add_item(tree, hf_dhcp_option_vi_class_cl_address_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
3229
1
    return 1;
3230
1
  }
3231
3232
1.06k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3233
3234
1.01k
    eti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_vi_class_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
3235
1.01k
    e_tree = proto_item_add_subtree(eti, ett_dhcp_option);
3236
1.01k
    offset += 4;
3237
1.01k
    proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option_vi_class_data_length, tvb, offset, 1, ENC_BIG_ENDIAN, &option_data_len);
3238
1.01k
    offset += 1;
3239
3240
1.01k
    s_end = offset + option_data_len;
3241
1.01k
    if ( tvb_reported_length_remaining(tvb, offset) < option_data_len) {
3242
99
      break;
3243
99
    }
3244
3245
1.53k
    while (offset < s_end) {
3246
923
      tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
3247
      /* XXX - Do we really want to try the dissector table for *each*
3248
       * vendor-class-data for the same enterprise? This tvb is too long on
3249
       * subsequent iterations. Only giving the table dissector one attempt
3250
       * (and skipping past bytes it doesn't dissect to s_end) might be simpler.
3251
       */
3252
923
      int bytes_dissected = dissector_try_uint(dhcp_enterprise_class_table, enterprise, enterprise_tvb, pinfo, e_tree);
3253
923
      if (bytes_dissected == 0) {
3254
923
        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");
3255
        /* According to RFC 3925, *each* vendor-class-data instance has
3256
         * its own length, but in practice some vendors have only included
3257
         * the overall per-enterprise option length. See the dhcwg m-l:
3258
         * https://mailarchive.ietf.org/arch/msg/dhcwg/B4fNsvUR0EHxcrKDsKCf7lBrc3s/
3259
         */
3260
923
        data_len = tvb_get_uint8(tvb, offset);
3261
923
        if (offset + data_len >= s_end) {
3262
300
          expert_ti = proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, s_end - offset, ENC_NA);
3263
300
          expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
3264
300
          offset = s_end;
3265
300
          break;
3266
300
        }
3267
623
        proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_length, tvb, offset, 1, ENC_NA);
3268
623
        offset += 1;
3269
623
        proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, data_len, ENC_NA);
3270
3271
        /* look for next vendor-class-data-item */
3272
623
        offset += data_len;
3273
623
      } else {
3274
0
        offset += bytes_dissected;
3275
0
      }
3276
923
    }
3277
3278
    /* loop for the next Enterprise number */
3279
915
  }
3280
3281
145
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
3282
125
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
3283
125
  }
3284
3285
145
  return tvb_captured_length(tvb);
3286
146
}
3287
3288
static int
3289
dissect_dhcpopt_forcerenew_nonce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3290
50
{
3291
50
  unsigned offset = 0;
3292
1.13k
  while ( tvb_reported_length_remaining(tvb, offset) > 0) {
3293
1.08k
    proto_tree_add_item(tree, hf_dhcp_option_forcerenew_nonce_algo, tvb, offset, 1, ENC_BIG_ENDIAN);
3294
1.08k
    offset += 1;
3295
1.08k
    }
3296
3297
50
  return tvb_captured_length(tvb);
3298
50
}
3299
3300
static int
3301
dissect_dhcpopt_rdnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3302
16
{
3303
16
  unsigned offset = 0;
3304
16
  const char *dns_name;
3305
16
  int dns_name_len;
3306
3307
16
  if (tvb_reported_length(tvb) < 10) {
3308
14
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 10");
3309
14
    return 1;
3310
14
  }
3311
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3312
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_pref, tvb, offset, 1, ENC_BIG_ENDIAN);
3313
2
  offset += 1;
3314
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_prim_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3315
2
  offset += 4;
3316
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_sec_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3317
2
  offset += 4;
3318
3319
2
  get_dns_name(pinfo->pool, tvb, offset, tvb_reported_length_remaining(tvb,offset), offset, &dns_name, &dns_name_len);
3320
2
  proto_tree_add_string(tree, hf_dhcp_option_rdnss_domain, tvb, offset,
3321
2
      tvb_reported_length_remaining(tvb,offset), format_text(pinfo->pool, dns_name, dns_name_len));
3322
3323
2
  return tvb_captured_length(tvb);
3324
16
}
3325
3326
static int
3327
dissect_dhcpopt_dhcp_captive_portal(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3328
121
{
3329
121
  proto_item *ti_cp;
3330
121
  ti_cp = proto_tree_add_item(tree, hf_dhcp_option_captive_portal, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
3331
121
  proto_item_set_url(ti_cp);
3332
3333
121
  return tvb_captured_length(tvb);
3334
121
}
3335
3336
static int
3337
dissect_dhcpopt_dnr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3338
691
{
3339
691
  unsigned offset = 0;
3340
691
  unsigned offset_end = tvb_captured_length(tvb);
3341
691
  int instance_id = 0;
3342
691
  uint32_t instance_offset = 0;
3343
691
  uint32_t instance_len;
3344
691
  uint32_t adn_len;
3345
691
  int adn_parsed_len;
3346
691
  const char *adn;
3347
691
  uint32_t addrs_len;
3348
691
  proto_item *dnr_instance_ti;
3349
691
  proto_tree *dnr_instance_tree;
3350
691
  proto_item *dnr_instance_addrs_ti;
3351
691
  proto_tree *dnr_instance_addrs_tree;
3352
691
  tvbuff_t *next_tvb;
3353
3354
691
  if (offset + 2 >= offset_end) {
3355
15
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "DNR: truncated option (no DNR instance present)");
3356
15
    return offset_end;
3357
15
  }
3358
3359
6.85k
  while (offset + 2 <= offset_end) {
3360
    // Handling a single DNR Instance
3361
6.76k
    instance_id++;
3362
3363
6.76k
    dnr_instance_ti = proto_tree_add_item(tree, hf_dhcp_dnr_instance, tvb, offset, -1, ENC_NA);
3364
6.76k
    dnr_instance_tree = proto_item_add_subtree(dnr_instance_ti, ett_dhcp_dnr_instance);
3365
3366
6.76k
    proto_tree_add_item_ret_uint(dnr_instance_tree, hf_dhcp_dnr_instance_len, tvb, offset, 2, ENC_BIG_ENDIAN, &instance_len);
3367
6.76k
    offset += 2;
3368
6.76k
    instance_offset = 0;
3369
3370
6.76k
    if (instance_len < 3) {
3371
72
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (instance length %d too short)", instance_len);
3372
72
      break;
3373
72
    }
3374
3375
6.69k
    if (offset + (int)instance_len > offset_end) {
3376
336
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (instance length %d larger than option)", instance_len);
3377
336
      break;
3378
336
    }
3379
3380
6.36k
    proto_item_append_text(dnr_instance_ti, " %d", instance_id);
3381
6.36k
    proto_item_set_len(dnr_instance_ti, (int)instance_len + 2);
3382
3383
6.36k
    proto_tree_add_item(dnr_instance_tree, hf_dhcp_dnr_svcpriority, tvb, offset + instance_offset, 2, ENC_BIG_ENDIAN);
3384
6.36k
    instance_offset += 2;
3385
3386
6.36k
    proto_tree_add_item_ret_uint(dnr_instance_tree, hf_dhcp_dnr_auth_domain_name_len, tvb, offset + instance_offset, 1, ENC_BIG_ENDIAN, &adn_len);
3387
6.36k
    instance_offset++;
3388
3389
6.36k
    if (instance_offset + adn_len > instance_len) {
3390
45
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (adn_len %d larger than option)", adn_len);
3391
45
      break;
3392
45
    }
3393
3394
6.31k
    get_dns_name(pinfo->pool, tvb, offset + instance_offset, adn_len,
3395
6.31k
        offset + instance_offset, &adn, &adn_parsed_len);
3396
6.31k
    proto_tree_add_string(dnr_instance_tree, hf_dhcp_dnr_auth_domain_name, tvb, offset + instance_offset,
3397
6.31k
        adn_len, format_text(pinfo->pool, adn, adn_parsed_len));
3398
3399
6.31k
    instance_offset += adn_len;
3400
3401
6.31k
    if (instance_offset == instance_len) {
3402
      // A DNR instance with only a service priority and authentication-domain-name (ADN) is in ADN-only mode,
3403
      // see RFC9463, Section 3.1.6.
3404
123
      proto_tree_add_expert(dnr_instance_tree, pinfo, &ei_dhcp_option_dnr_adn_only_mode, tvb, offset, instance_len);
3405
3406
123
      offset += instance_len;
3407
123
      continue;
3408
123
    }
3409
3410
6.19k
    proto_tree_add_item_ret_uint(dnr_instance_tree, hf_dhcp_dnr_addrs_len, tvb, offset + instance_offset, 1, ENC_BIG_ENDIAN, &addrs_len);
3411
6.19k
    instance_offset++;
3412
3413
6.19k
    if (addrs_len == 0 || addrs_len % 4 != 0) {
3414
136
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: invalid addrs_len %d (not divisible by 4)", addrs_len);
3415
136
      break;
3416
136
    }
3417
3418
6.05k
    dnr_instance_addrs_ti = proto_tree_add_item(dnr_instance_tree, hf_dhcp_dnr_addrs, tvb, offset + instance_offset, addrs_len, ENC_NA);
3419
6.05k
    dnr_instance_addrs_tree = proto_item_add_subtree(dnr_instance_addrs_ti, ett_dhcp_dnr_instance_addrs);
3420
3421
6.05k
    proto_item_append_text(dnr_instance_addrs_ti, ":");
3422
3423
13.4k
    for (uint32_t i = 0; i < addrs_len; i += 4) {
3424
7.35k
      proto_tree_add_item(dnr_instance_addrs_tree, hf_dhcp_dnr_addrs_ip, tvb, offset + instance_offset + i, 4, ENC_BIG_ENDIAN);
3425
7.35k
      proto_item_append_text(dnr_instance_addrs_ti, "%c%s", (i == 0 ? ' ' : ','), tvb_ip_to_str(pinfo->pool, tvb, offset + instance_offset + i));
3426
7.35k
    }
3427
3428
6.05k
    instance_offset += addrs_len;
3429
3430
    // Parse the service parameters
3431
6.05k
    next_tvb = tvb_new_subset_length(tvb, offset + instance_offset, instance_len - instance_offset);
3432
6.05k
    call_dissector(svc_params_handle, next_tvb, pinfo, dnr_instance_tree);
3433
3434
6.05k
    offset += instance_len;
3435
6.05k
  }
3436
3437
676
  return offset_end;
3438
691
}
3439
3440
static int
3441
dissect_dhcpopt_bulk_lease_query_start(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3442
14
{
3443
14
  if (tvb_reported_length(tvb) != 4) {
3444
11
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3445
11
    return 1;
3446
11
  }
3447
3
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_start, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3448
3449
3
  return tvb_captured_length(tvb);
3450
14
}
3451
3452
static int
3453
dissect_dhcpopt_bulk_lease_query_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3454
33
{
3455
33
  if (tvb_reported_length(tvb) != 4) {
3456
30
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3457
30
    return 1;
3458
30
  }
3459
3
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_end, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3460
3461
3
  return tvb_captured_length(tvb);
3462
33
}
3463
3464
static int
3465
dissect_dhcpopt_bulk_lease_base_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3466
23
{
3467
23
  if (tvb_reported_length(tvb) != 4) {
3468
22
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3469
22
    return 1;
3470
22
  }
3471
1
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_base_time, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3472
3473
1
  return tvb_captured_length(tvb);
3474
23
}
3475
3476
static int
3477
dissect_dhcpopt_bulk_lease_status_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3478
58
{
3479
58
  if (tvb_reported_length(tvb) < 1) {
3480
23
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 1");
3481
23
    return 1;
3482
23
  }
3483
35
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_code, tvb, 0, 1, ENC_BIG_ENDIAN);
3484
35
  if ( tvb_reported_length_remaining(tvb, 1) > 0) {
3485
6
    proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_message, tvb, 1, tvb_reported_length_remaining(tvb, 1), ENC_UTF_8);
3486
6
    }
3487
3488
35
  return tvb_captured_length(tvb);
3489
58
}
3490
3491
static int
3492
dissect_dhcpopt_pcp_server(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3493
48
{
3494
48
  proto_tree *tree_pcp;
3495
48
  unsigned offset = 0;
3496
48
  uint8_t list_length;
3497
48
  uint8_t ip_list_length;
3498
48
  proto_item *ti_pcp;
3499
3500
48
  if (tvb_reported_length(tvb) < 5) {
3501
13
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 5");
3502
13
    return 1;
3503
13
  }
3504
1.31k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3505
1.27k
    ip_list_length = 0;
3506
1.27k
    list_length = tvb_get_uint8(tvb, offset);
3507
1.27k
    tree_pcp = proto_tree_add_subtree(tree, tvb, offset, list_length, ett_dhcp_option158_pcp_list,
3508
1.27k
            &ti_pcp, "PCP server list");
3509
1.27k
    proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_list_length, tvb, offset, 1, ENC_NA);
3510
1.27k
    offset += 1;
3511
1.27k
    ip_list_length += 1;
3512
1.79k
    while (((list_length - 1)%4 == 0) && (ip_list_length < list_length) && tvb_reported_length_remaining(tvb,offset) >= 4) {
3513
517
      proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3514
517
      offset += 4;
3515
517
      ip_list_length += 4;
3516
517
    }
3517
1.27k
  }
3518
3519
35
  return tvb_captured_length(tvb);
3520
48
}
3521
3522
static int
3523
dissect_dhcpopt_portparams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3524
22
{
3525
22
  if (tvb_reported_length(tvb) != 4) {
3526
20
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3527
20
    return 1;
3528
20
  }
3529
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_offset, tvb, 0, 1, ENC_NA);
3530
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_psid_length, tvb, 1, 1, ENC_NA);
3531
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_psid, tvb, 2, 2, ENC_NA);
3532
3533
2
  return tvb_captured_length(tvb);
3534
22
}
3535
3536
static int
3537
dissect_dhcpopt_6RD_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3538
54
{
3539
54
  unsigned offset = 0;
3540
3541
54
  if (tvb_reported_length(tvb) < 22) {
3542
23
    expert_add_info(pinfo, tree, &ei_dhcp_option_6RD_malformed);
3543
23
    return 1;
3544
23
  }
3545
3546
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_ipv4_mask_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3547
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix_len, tvb, offset+1, 1, ENC_BIG_ENDIAN);
3548
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix, tvb, offset+2, 16, ENC_NA);
3549
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset+18, 4, ENC_BIG_ENDIAN);
3550
3551
  /* More Border Relay IPv4 addresses included */
3552
31
  if (tvb_reported_length(tvb) > 22) {
3553
30
    offset += 22;
3554
740
    while (tvb_reported_length_remaining(tvb, offset) >= 4) {
3555
710
      proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
3556
710
      offset += 4;
3557
710
    }
3558
30
    if (tvb_reported_length_remaining(tvb, offset) > 0) {
3559
20
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
3560
20
    }
3561
30
  }
3562
3563
31
  return tvb_captured_length(tvb);
3564
54
}
3565
3566
static int
3567
dissect_dhcpopt_avaya_ip_telephone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3568
647
{
3569
647
  unsigned offset = 0;
3570
647
  proto_tree *o242avaya_v_tree;
3571
647
  proto_item *avaya_ti;
3572
647
  const char *avaya_option = NULL;
3573
647
  wmem_strbuf_t *avaya_param_buf = NULL;
3574
3575
  /* minimum length is 5 bytes */
3576
647
  if (tvb_reported_length(tvb) < 5) {
3577
104
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Avaya IP Telephone option length isn't >= 5");
3578
104
    return 1;
3579
104
  }
3580
543
  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);
3581
543
  o242avaya_v_tree = proto_item_add_subtree(avaya_ti, ett_dhcp_option242_suboption);
3582
543
  avaya_param_buf = wmem_strbuf_new(pinfo->pool, "");
3583
543
  char **fields = wmem_strsplit(pinfo->pool, avaya_option, ",", -1);
3584
10.2k
  for (int i = 0; fields[i]; i++) {
3585
9.68k
    const char *field = fields[i];
3586
9.68k
    if (!strchr(field, '=')) {
3587
2.06k
      if (wmem_strbuf_get_len(avaya_param_buf) == 0) {
3588
12
        expert_add_info_format(pinfo, avaya_ti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown parameter %s", field);
3589
12
        offset += (int)strlen(field);
3590
12
        break;
3591
12
      }
3592
2.05k
      wmem_strbuf_append_printf(avaya_param_buf,",%s", field);
3593
2.05k
    }
3594
7.61k
    else {
3595
7.61k
      if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3596
7.09k
        dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3597
7.09k
        offset += (int)wmem_strbuf_get_len(avaya_param_buf) + 1;
3598
7.09k
        wmem_strbuf_truncate(avaya_param_buf, 0);
3599
7.09k
      }
3600
7.61k
      wmem_strbuf_append(avaya_param_buf, field);
3601
7.61k
    }
3602
9.68k
  }
3603
543
  if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3604
467
    dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3605
467
  }
3606
3607
543
  return tvb_captured_length(tvb);
3608
647
}
3609
3610
static const value_string option82_suboption_vals[] = {
3611
  {  0, "Padding" },
3612
  {  1, "Agent Circuit ID" },
3613
  {  2, "Agent Remote ID" },
3614
  {  3, "Reserved" },
3615
  {  4, "DOCSIS Device Class" },
3616
  {  5, "Link selection" },
3617
  {  6, "Subscriber ID" },
3618
  {  7, "RADIUS Attributes" },
3619
  {  8, "Authentication" },
3620
  {  9, "Vendor-Specific Information" },
3621
  { 10, "Flags" },
3622
  { 11, "Server ID Override" },
3623
  { 12, "Relay Agent Identifier" },
3624
  { 13, "Access Technology Type" },
3625
  { 14, "Access Network Name" },
3626
  { 15, "Access Point Name" },
3627
  { 16, "Access Point BSSID" },
3628
  { 17, "Access Network Operator ID" },
3629
  { 18, "Access Network Operator Realm" },
3630
  { 19, "Source Port" },
3631
  { 150, "Link selection (Cisco proprietary)" },
3632
  { 151, "VRF name/VPN ID" },
3633
  { 152, "Server ID Override (Cisco proprietary)" },
3634
  { 0, NULL }
3635
};
3636
3637
12.3k
#define CL_AI_OPTION_DOCSIS_VERSION     1  /* 82:9:4491:1 */
3638
280
#define CL_AI_OPTION_DPOE_SYSTEM_VERSION    2  /* 82:9:4491:2 */
3639
592
#define CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE 4  /* 82:9:4491:4 */
3640
509
#define CL_AI_OPTION_CMTS_CM_SERVICE_CLASS    5  /* 82:9:4491:5 */
3641
177
#define CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT    6  /* 82:9:4491:6 */
3642
472
#define CL_AI_OPTION_SECURE_FILE_TRANSFER_URI   7  /* 82:9:4491:7 */
3643
3644
static const value_string option82_cl_tag_vals[] = {
3645
  { CL_AI_OPTION_DOCSIS_VERSION, "CMTS DOCSIS version number" },
3646
  { CL_AI_OPTION_DPOE_SYSTEM_VERSION, "DPOE System version number" },
3647
  { CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE, "DPOE System DHCPv4 PBB service option" },
3648
  { CL_AI_OPTION_CMTS_CM_SERVICE_CLASS, "Service Class or QoS Profile Name" },
3649
  { CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT, "MSO Defined Text" },
3650
  { CL_AI_OPTION_SECURE_FILE_TRANSFER_URI, "Secure File Transfer URI" },
3651
  { 0, NULL }
3652
};
3653
3654
static int
3655
dhcp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree, tvbuff_t *tvb, unsigned optoff,
3656
           unsigned optend)
3657
84.6k
{
3658
84.6k
  unsigned    suboptoff = optoff;
3659
84.6k
  uint8_t     subopt, vs_opt, vs_len;
3660
84.6k
  size_t      idx;
3661
84.6k
  unsigned    subopt_len, subopt_end, datalen;
3662
84.6k
  uint32_t    enterprise;
3663
84.6k
  proto_item *vti, *ti;
3664
84.6k
  proto_tree *o82_v_tree, *o82_sub_tree;
3665
84.6k
  unsigned    clsuboptoff, clsubopt_end;
3666
3667
84.6k
  static const struct basic_types_hfs default_hfs = {
3668
84.6k
    &hf_dhcp_option82_value,
3669
84.6k
    &hf_dhcp_option82_value_ip_address,
3670
84.6k
    &hf_dhcp_option82_value_ip_address,
3671
84.6k
    &hf_dhcp_option82_value_stringz,
3672
84.6k
    NULL,
3673
84.6k
    &hf_dhcp_option82_value_8,
3674
84.6k
    &hf_dhcp_option82_value_16,
3675
84.6k
    NULL,
3676
84.6k
    &hf_dhcp_option82_value_32,
3677
84.6k
    NULL,
3678
84.6k
    NULL
3679
84.6k
  };
3680
3681
84.6k
  struct opt82_info {
3682
84.6k
    int id;
3683
84.6k
    struct opt_info info;
3684
84.6k
  };
3685
84.6k
  static const struct opt82_info o82_opt[]= {
3686
84.6k
    {0, {"nop", bytes, &hf_dhcp_option82_padding}}, /* dummy */
3687
84.6k
    {1, {"Agent Circuit ID", bytes, &hf_dhcp_option82_agent_circuit_id}}, /* [RFC3046] */
3688
84.6k
    {2, {"Agent Remote ID", bytes, &hf_dhcp_option82_agent_remote_id}}, /* [RFC3046] */
3689
84.6k
    {3, {"Reserved", bytes, &hf_dhcp_option82_reserved}},
3690
84.6k
    {4, {"DOCSIS Device Class", val_u_long, &hf_dhcp_option82_docsis_device_class}}, /* [RFC3256] */
3691
84.6k
    {5, {"Link selection", ipv4, &hf_dhcp_option82_link_selection}}, /* [RFC3527] */
3692
84.6k
    {6, {"Subscriber ID", string, &hf_dhcp_option82_subscriber_id}},  /* [RFC3993] */ /***** CHECK STRING TYPE */
3693
84.6k
    {7, {"RADIUS Attributes", special, &hf_dhcp_option82_radius_attributes}}, /* [RFC4014] */
3694
84.6k
    {8, {"Authentication", bytes, &hf_dhcp_option82_authentication}}, /* [RFC4030] */
3695
84.6k
    {9, {"Vendor-Specific Information", special, &hf_dhcp_option82_vi}}, /* [RFC 4243] */
3696
84.6k
    {10, {"Flags", special, &hf_dhcp_option82_flags}}, /* [RFC5010] */
3697
84.6k
    {11, {"Server ID Override", ipv4, &hf_dhcp_option82_server_id_override}}, /* [RFC 5107] */
3698
84.6k
    {12, {"Relay Agent Identifier", bytes, &hf_dhcp_option82_relay_agent_id}}, /* [RFC 6925] */
3699
84.6k
    {13, {"Access Technology Type", bytes, &hf_dhcp_option82_option_ani_att}}, /* [RFC7839] */
3700
84.6k
    {14, {"Access Network Name", string, &hf_dhcp_option82_option_ani_network_name}}, /* [RFC7839] */
3701
84.6k
    {15, {"Access Point Name", string, &hf_dhcp_option82_option_ani_ap_name}}, /* [RFC7839] */
3702
84.6k
    {16, {"Access Point BSSID", special, &hf_dhcp_option82_option_ani_ap_bssid}}, /* [RFC7839] */
3703
84.6k
    {17, {"Access Network Operator ID", bytes, &hf_dhcp_option82_option_ani_operator_id}}, /* [RFC7839] */
3704
84.6k
    {18, {"Access Network Operator Realm", string, &hf_dhcp_option82_option_ani_operator_realm}}, /* [RFC7839] */
3705
84.6k
    {19, {"Source Port", presence, &hf_dhcp_option82_option_source_port}}, /* [RFC8357] */
3706
84.6k
    {150, {"Link selection (Cisco proprietary)", ipv4, &hf_dhcp_option82_link_selection_cisco}}, /* [RFC3527] */
3707
84.6k
    {151, {"VRF name/VPN ID", special, &hf_dhcp_option82_vrf_name_vpn_id}}, /* [RFC2685] */
3708
84.6k
    {152, {"Server ID Override (Cisco proprietary)", ipv4, &hf_dhcp_option82_server_id_override_cisco}} /* [RFC 5107] */
3709
84.6k
  };
3710
3711
84.6k
  subopt = tvb_get_uint8(tvb, optoff);
3712
84.6k
  suboptoff++;
3713
3714
84.6k
  if (suboptoff >= optend) {
3715
467
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
3716
467
                  "Suboption %d: no room left in option for suboption length", subopt);
3717
467
    return (optend);
3718
467
  }
3719
3720
84.1k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
3721
84.1k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option82_suboption,
3722
84.1k
    tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str_const(subopt, option82_suboption_vals, "Unknown"));
3723
3724
84.1k
  o82_v_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption);
3725
84.1k
  proto_tree_add_item(o82_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3726
84.1k
  suboptoff++;
3727
3728
84.1k
  subopt_end = suboptoff+subopt_len;
3729
84.1k
  if (subopt_end > optend) {
3730
2.49k
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
3731
2.49k
            "Suboption %d: no room left in option for suboption value", subopt);
3732
2.49k
    return (optend);
3733
2.49k
  }
3734
3735
688k
  for (idx = 0; idx < array_length(o82_opt); idx++) {
3736
676k
    if (o82_opt[idx].id == subopt) {
3737
70.1k
      break;
3738
70.1k
    }
3739
676k
  }
3740
3741
81.6k
  ti = proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3742
3743
81.6k
  if ( (idx >= 1 ) && (idx < array_length(o82_opt)) ) {
3744
46.7k
    proto_item_set_hidden(ti);
3745
46.7k
    if (o82_opt[idx].info.ftype == special) {
3746
35.9k
      switch(subopt)
3747
35.9k
      {
3748
33.1k
      case 7:
3749
33.1k
        dissect_attribute_value_pairs(o82_v_tree, pinfo, tvb, suboptoff, subopt_len, NULL);
3750
33.1k
        break;
3751
1.62k
      case 9:
3752
2.60k
        while (suboptoff < subopt_end) {
3753
1.00k
          vti = proto_tree_add_item_ret_uint(o82_v_tree, hf_dhcp_option82_vi_enterprise, tvb, suboptoff, 4, ENC_BIG_ENDIAN, &enterprise);
3754
1.00k
          suboptoff += 4;
3755
3756
1.00k
          o82_sub_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption9);
3757
1.00k
          proto_tree_add_item_ret_uint(o82_sub_tree, hf_dhcp_option82_vi_data_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN, &datalen);
3758
1.00k
          suboptoff++;
3759
3760
1.00k
          switch (enterprise) {
3761
345
          case VENDOR_CABLELABS: /* CableLabs */
3762
            /* Compare CL-SP-CANN-DHCP-Reg-I06-110210 (2011) and
3763
             * CL-SP-CANN-DHCP-Reg-I13-160317 (2016) */
3764
345
            clsuboptoff = suboptoff;
3765
345
            clsubopt_end = clsuboptoff + datalen;
3766
6.33k
            while (clsuboptoff < clsubopt_end) {
3767
5.98k
              vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3768
5.98k
              vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3769
5.98k
              if (vs_opt == CL_AI_OPTION_DOCSIS_VERSION &&
3770
593
                vs_len == 4) {
3771
3772
                /* Superseded version with a redundant option code and option-length */
3773
262
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3774
262
                clsuboptoff++;
3775
262
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3776
262
                clsuboptoff++;
3777
3778
262
                vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3779
262
                vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3780
262
              }
3781
5.98k
              proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3782
5.98k
              clsuboptoff++;
3783
5.98k
              proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3784
5.98k
              clsuboptoff++;
3785
5.98k
              switch (vs_opt) {
3786
418
              case CL_AI_OPTION_DOCSIS_VERSION:
3787
418
                proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_docsis_version,
3788
418
                      tvb, clsuboptoff, 2, 0, "%d.%d",
3789
418
                      tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3790
418
                clsuboptoff+=2;
3791
418
                break;
3792
280
              case CL_AI_OPTION_DPOE_SYSTEM_VERSION:
3793
280
                proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_version,
3794
280
                      tvb, clsuboptoff, 2, 0, "%d.%d",
3795
280
                      tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3796
280
                clsuboptoff+=2;
3797
280
                break;
3798
592
              case CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE:
3799
592
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_pbb_service, tvb, clsuboptoff, vs_len, ENC_NA);
3800
592
                break;
3801
509
              case CL_AI_OPTION_CMTS_CM_SERVICE_CLASS:
3802
509
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_service_class_name, tvb, clsuboptoff, vs_len, ENC_ASCII);
3803
509
                clsuboptoff += vs_len;
3804
509
                break;
3805
177
              case CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT:
3806
177
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_mso_defined_text, tvb, clsuboptoff, vs_len, ENC_ASCII);
3807
177
                clsuboptoff += vs_len;
3808
177
                break;
3809
472
              case CL_AI_OPTION_SECURE_FILE_TRANSFER_URI:
3810
472
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_secure_file_transfer_uri, tvb, clsuboptoff, vs_len, ENC_ASCII);
3811
472
                clsuboptoff += vs_len;
3812
472
                break;
3813
3.53k
              default:
3814
3.53k
                expert_add_info_format(pinfo, vti, &ei_dhcp_option82_vi_cl_tag_unknown, "Unknown tag %d (%d bytes)", vs_opt, vs_len);
3815
3.53k
                clsuboptoff += vs_len;
3816
3.53k
                break;
3817
5.98k
              }
3818
5.98k
            }
3819
341
            suboptoff = clsuboptoff;
3820
341
            break;
3821
656
          default:
3822
656
            proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, datalen, ENC_NA);
3823
656
            suboptoff += datalen;
3824
656
            break;
3825
1.00k
          }
3826
1.00k
        }
3827
1.60k
        break;
3828
1.60k
      case 10: /* Relay Agent Flags Suboption */
3829
606
        {
3830
606
          static int * const dhcp_option82_flags[] = {
3831
606
            &hf_dhcp_option82_flags_unicast,
3832
606
            &hf_dhcp_option82_flags_reserved,
3833
606
            NULL
3834
606
          };
3835
3836
606
          proto_tree_add_bitmask_with_flags(o82_v_tree, tvb, suboptoff, hf_dhcp_option82_flags,
3837
606
            ett_dhcp_option82_suboption10, dhcp_option82_flags, ENC_BIG_ENDIAN, BMT_NO_INT);
3838
606
        }
3839
606
        break;
3840
0
      case 13: /* Access Technology Type */
3841
0
        if (subopt_len != 2) {
3842
0
          expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 2");
3843
0
          break;
3844
0
        }
3845
0
        proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_res, tvb, suboptoff, 1, ENC_NA);
3846
0
        proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_att, tvb, suboptoff+1, 1, ENC_NA);
3847
0
        break;
3848
196
      case 151:
3849
196
        if (subopt_len == 1) {
3850
85
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_global, tvb, suboptoff, 1, ENC_NA);
3851
85
        }
3852
111
        else if (subopt_len != 7) {
3853
67
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name, tvb, suboptoff, subopt_len, ENC_ASCII);
3854
67
        } else {
3855
44
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_oui, tvb, suboptoff, 3, ENC_BIG_ENDIAN);
3856
44
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_index, tvb, suboptoff+3, 4, ENC_BIG_ENDIAN);
3857
44
        }
3858
196
        break;
3859
336
      default:
3860
336
        if (o82_opt[idx].info.phf != NULL)
3861
336
          proto_tree_add_item(o82_v_tree, *o82_opt[idx].info.phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
3862
0
        else
3863
0
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3864
336
        break;
3865
35.9k
      }
3866
35.9k
    }
3867
10.7k
    else {
3868
10.7k
      dhcp_handle_basic_types(pinfo, o82_v_tree, vti, tvb, o82_opt[idx].info.ftype,
3869
10.7k
                 suboptoff, subopt_len, o82_opt[idx].info.phf, &default_hfs);
3870
10.7k
    }
3871
46.7k
  }
3872
3873
63.9k
  optoff += (subopt_len + 2);
3874
63.9k
  return optoff;
3875
81.6k
}
3876
3877
static int
3878
dissect_dhcpopt_relay_agent_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3879
21.1k
{
3880
21.1k
  unsigned offset = 0;
3881
3882
105k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3883
84.6k
    offset = dhcp_dhcp_decode_agent_info(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
3884
84.6k
  }
3885
3886
21.1k
  return tvb_captured_length(tvb);
3887
21.1k
}
3888
3889
339
# define O43PXE_DISCOVERY 6
3890
171
# define O43PXE_BOOT_SERVER 8
3891
129
# define O43PXE_BOOT_MENU 9
3892
204
# define O43PXE_MENU_PROMPT 10
3893
39
# define O43PXE_BOOT_ITEM 71
3894
3895
static const value_string option43_pxeclient_suboption_vals[] = {
3896
  {  0, "Padding" },
3897
  {  1, "PXE mtftp IP" },
3898
  {  2, "PXE mtftp client port" },
3899
  {  3, "PXE mtftp server port" },
3900
  {  4, "PXE mtftp timeout" },
3901
  {  5, "PXE mtftp delay" },
3902
  { O43PXE_DISCOVERY, "PXE discovery control" },
3903
  {  7, "PXE multicast address" },
3904
  { O43PXE_BOOT_SERVER, "PXE boot servers" },
3905
  { O43PXE_BOOT_MENU, "PXE boot menu" },
3906
  { O43PXE_MENU_PROMPT, "PXE menu prompt" },
3907
  { 11, "PXE multicast address alloc", },
3908
  { 12, "PXE credential types" },
3909
  { O43PXE_BOOT_ITEM, "PXE boot item" },
3910
  { 179, "PXE LCM Server" },
3911
  { 180, "PXE LCM Domain" },
3912
  { 181, "PXE LCM NIC option 0" },
3913
  { 190, "PXE LCM Workgroup" },
3914
  { 191, "PXE Discovery" },
3915
  { 192, "PXE Configured" },
3916
  { 193, "PXE LCM version" },
3917
  { 194, "PXE LCM Serial Number" },
3918
  { 255, "PXE End" },
3919
  { 0, NULL}
3920
};
3921
3922
static int
3923
dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3924
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
3925
4.74k
{
3926
4.74k
  unsigned    suboptoff = optoff;
3927
4.74k
  unsigned    suboptoff_start;
3928
4.74k
  uint8_t     subopt;
3929
4.74k
  uint8_t     subopt_len;
3930
4.74k
  proto_tree *o43pxeclient_v_tree, *o43pxeclient_suboption_tree;
3931
4.74k
  proto_item *vti, *ti;
3932
4.74k
  uint32_t    boot_server_ip_count;
3933
4.74k
  uint32_t    boot_menu_length;
3934
3935
4.74k
  static const struct basic_types_hfs default_hfs = {
3936
4.74k
    NULL,
3937
4.74k
    &hf_dhcp_option43_value_ip_address,
3938
4.74k
    &hf_dhcp_option43_value_ip_address,
3939
4.74k
    NULL,
3940
4.74k
    NULL,
3941
4.74k
    &hf_dhcp_option43_value_8,
3942
4.74k
    NULL,
3943
4.74k
    NULL,
3944
4.74k
    NULL,
3945
4.74k
    NULL,
3946
4.74k
    NULL
3947
4.74k
  };
3948
3949
4.74k
  static int * const o43pxe_discovery_hf_flags[] = {
3950
4.74k
    &hf_dhcp_option43_pxeclient_discovery_control_bc,
3951
4.74k
    &hf_dhcp_option43_pxeclient_discovery_control_mc,
3952
4.74k
    &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
3953
4.74k
    &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
3954
4.74k
    NULL
3955
4.74k
  };
3956
3957
4.74k
  static const struct opt_info o43pxeclient_opt[]= {
3958
4.74k
    /* 0 */ {"nop", special, &hf_dhcp_option43_pxeclient_padding},  /* dummy */
3959
4.74k
    /* 1 */ {"PXE mtftp IP", ipv4_list, &hf_dhcp_option43_pxeclient_mtftp_ip},
3960
4.74k
    /* 2 */ {"PXE mtftp client port", val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_client_port},
3961
4.74k
    /* 3 */ {"PXE mtftp server port",val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_server_port},
3962
4.74k
    /* 4 */ {"PXE mtftp timeout", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_timeout},
3963
4.74k
    /* 5 */ {"PXE mtftp delay", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_delay},
3964
4.74k
    /* 6 */ {"PXE discovery control", special, NULL},
3965
4.74k
    /* 7 */ {"PXE multicast address", ipv4_list, &hf_dhcp_option43_pxeclient_multicast_address},
3966
4.74k
    /* 8 */ {"PXE boot servers", special, NULL},
3967
4.74k
    /* 9 */ {"PXE boot menu", special, NULL},
3968
4.74k
    /* 10 */ {"PXE menu prompt", special, NULL},
3969
4.74k
    /* 11 */ {"PXE multicast address alloc", special, &hf_dhcp_option43_pxeclient_multicast_address_alloc},
3970
4.74k
    /* 12 */ {"PXE credential types", special, &hf_dhcp_option43_pxeclient_credential_types},
3971
4.74k
    /* 13 */ {"Unassigned", opaque, NULL},
3972
4.74k
    /* 14 */ {"Unassigned", opaque, NULL},
3973
4.74k
    /* 15 */ {"Unassigned", opaque, NULL},
3974
4.74k
    /* 16 */ {"Unassigned", opaque, NULL},
3975
4.74k
    /* 17 */ {"Unassigned", opaque, NULL},
3976
4.74k
    /* 18 */ {"Unassigned", opaque, NULL},
3977
4.74k
    /* 19 */ {"Unassigned", opaque, NULL},
3978
4.74k
    /* 20 */ {"Unassigned", opaque, NULL},
3979
4.74k
    /* 21 */ {"Unassigned", opaque, NULL},
3980
4.74k
    /* 22 */ {"Unassigned", opaque, NULL},
3981
4.74k
    /* 23 */ {"Unassigned", opaque, NULL},
3982
4.74k
    /* 24 */ {"Unassigned", opaque, NULL},
3983
4.74k
    /* 25 */ {"Unassigned", opaque, NULL},
3984
4.74k
    /* 26 */ {"Unassigned", opaque, NULL},
3985
4.74k
    /* 27 */ {"Unassigned", opaque, NULL},
3986
4.74k
    /* 28 */ {"Unassigned", opaque, NULL},
3987
4.74k
    /* 29 */ {"Unassigned", opaque, NULL},
3988
4.74k
    /* 30 */ {"Unassigned", opaque, NULL},
3989
4.74k
    /* 31 */ {"Unassigned", opaque, NULL},
3990
4.74k
    /* 32 */ {"Unassigned", opaque, NULL},
3991
4.74k
    /* 33 */ {"Unassigned", opaque, NULL},
3992
4.74k
    /* 34 */ {"Unassigned", opaque, NULL},
3993
4.74k
    /* 35 */ {"Unassigned", opaque, NULL},
3994
4.74k
    /* 36 */ {"Unassigned", opaque, NULL},
3995
4.74k
    /* 37 */ {"Unassigned", opaque, NULL},
3996
4.74k
    /* 38 */ {"Unassigned", opaque, NULL},
3997
4.74k
    /* 39 */ {"Unassigned", opaque, NULL},
3998
4.74k
    /* 40 */ {"Unassigned", opaque, NULL},
3999
4.74k
    /* 41 */ {"Unassigned", opaque, NULL},
4000
4.74k
    /* 42 */ {"Unassigned", opaque, NULL},
4001
4.74k
    /* 43 */ {"Unassigned", opaque, NULL},
4002
4.74k
    /* 44 */ {"Unassigned", opaque, NULL},
4003
4.74k
    /* 45 */ {"Unassigned", opaque, NULL},
4004
4.74k
    /* 46 */ {"Unassigned", opaque, NULL},
4005
4.74k
    /* 47 */ {"Unassigned", opaque, NULL},
4006
4.74k
    /* 48 */ {"Unassigned", opaque, NULL},
4007
4.74k
    /* 49 */ {"Unassigned", opaque, NULL},
4008
4.74k
    /* 50 */ {"Unassigned", opaque, NULL},
4009
4.74k
    /* 51 */ {"Unassigned", opaque, NULL},
4010
4.74k
    /* 52 */ {"Unassigned", opaque, NULL},
4011
4.74k
    /* 53 */ {"Unassigned", opaque, NULL},
4012
4.74k
    /* 54 */ {"Unassigned", opaque, NULL},
4013
4.74k
    /* 55 */ {"Unassigned", opaque, NULL},
4014
4.74k
    /* 56 */ {"Unassigned", opaque, NULL},
4015
4.74k
    /* 57 */ {"Unassigned", opaque, NULL},
4016
4.74k
    /* 58 */ {"Unassigned", opaque, NULL},
4017
4.74k
    /* 59 */ {"Unassigned", opaque, NULL},
4018
4.74k
    /* 60 */ {"Unassigned", opaque, NULL},
4019
4.74k
    /* 61 */ {"Unassigned", opaque, NULL},
4020
4.74k
    /* 62 */ {"Unassigned", opaque, NULL},
4021
4.74k
    /* 63 */ {"Unassigned", opaque, NULL},
4022
4.74k
    /* 64 */ {"Unassigned", opaque, NULL},
4023
4.74k
    /* 65 */ {"Unassigned", opaque, NULL},
4024
4.74k
    /* 66 */ {"Unassigned", opaque, NULL},
4025
4.74k
    /* 67 */ {"Unassigned", opaque, NULL},
4026
4.74k
    /* 68 */ {"Unassigned", opaque, NULL},
4027
4.74k
    /* 69 */ {"Unassigned", opaque, NULL},
4028
4.74k
    /* 70 */ {"Unassigned", opaque, NULL},
4029
4.74k
    /* 71 */ {"PXE boot item", special, NULL},
4030
4.74k
    /* 72 */ {"Unassigned", opaque, NULL},
4031
4.74k
    /* 73 */ {"Unassigned", opaque, NULL},
4032
4.74k
    /* 74 */ {"Unassigned", opaque, NULL},
4033
4.74k
    /* 75 */ {"Unassigned", opaque, NULL},
4034
4.74k
    /* 76 */ {"Unassigned", opaque, NULL},
4035
4.74k
    /* 77 */ {"Unassigned", opaque, NULL},
4036
4.74k
    /* 78 */ {"Unassigned", opaque, NULL},
4037
4.74k
    /* 79 */ {"Unassigned", opaque, NULL},
4038
4.74k
    /* 80 */ {"Unassigned", opaque, NULL},
4039
4.74k
    /* 81 */ {"Unassigned", opaque, NULL},
4040
4.74k
    /* 82 */ {"Unassigned", opaque, NULL},
4041
4.74k
    /* 83 */ {"Unassigned", opaque, NULL},
4042
4.74k
    /* 84 */ {"Unassigned", opaque, NULL},
4043
4.74k
    /* 85 */ {"Unassigned", opaque, NULL},
4044
4.74k
    /* 86 */ {"Unassigned", opaque, NULL},
4045
4.74k
    /* 87 */ {"Unassigned", opaque, NULL},
4046
4.74k
    /* 88 */ {"Unassigned", opaque, NULL},
4047
4.74k
    /* 89 */ {"Unassigned", opaque, NULL},
4048
4.74k
    /* 90 */ {"Unassigned", opaque, NULL},
4049
4.74k
    /* 91 */ {"Unassigned", opaque, NULL},
4050
4.74k
    /* 92 */ {"Unassigned", opaque, NULL},
4051
4.74k
    /* 93 */ {"Unassigned", opaque, NULL},
4052
4.74k
    /* 94 */ {"Unassigned", opaque, NULL},
4053
4.74k
    /* 95 */ {"Unassigned", opaque, NULL},
4054
4.74k
    /* 96 */ {"Unassigned", opaque, NULL},
4055
4.74k
    /* 97 */ {"Unassigned", opaque, NULL},
4056
4.74k
    /* 98 */ {"Unassigned", opaque, NULL},
4057
4.74k
    /* 99 */ {"Unassigned", opaque, NULL},
4058
4.74k
    /* 100 */ {"Unassigned", opaque, NULL},
4059
4.74k
    /* 101 */ {"Unassigned", opaque, NULL},
4060
4.74k
    /* 102 */ {"Unassigned", opaque, NULL},
4061
4.74k
    /* 103 */ {"Unassigned", opaque, NULL},
4062
4.74k
    /* 104 */ {"Unassigned", opaque, NULL},
4063
4.74k
    /* 105 */ {"Unassigned", opaque, NULL},
4064
4.74k
    /* 106 */ {"Unassigned", opaque, NULL},
4065
4.74k
    /* 107 */ {"Unassigned", opaque, NULL},
4066
4.74k
    /* 108 */ {"Unassigned", opaque, NULL},
4067
4.74k
    /* 109 */ {"Unassigned", opaque, NULL},
4068
4.74k
    /* 110 */ {"Unassigned", opaque, NULL},
4069
4.74k
    /* 111 */ {"Unassigned", opaque, NULL},
4070
4.74k
    /* 112 */ {"Unassigned", opaque, NULL},
4071
4.74k
    /* 113 */ {"Unassigned", opaque, NULL},
4072
4.74k
    /* 114 */ {"Unassigned", opaque, NULL},
4073
4.74k
    /* 115 */ {"Unassigned", opaque, NULL},
4074
4.74k
    /* 116 */ {"Unassigned", opaque, NULL},
4075
4.74k
    /* 117 */ {"Unassigned", opaque, NULL},
4076
4.74k
    /* 118 */ {"Unassigned", opaque, NULL},
4077
4.74k
    /* 119 */ {"Unassigned", opaque, NULL},
4078
4.74k
    /* 120 */ {"Unassigned", opaque, NULL},
4079
4.74k
    /* 121 */ {"Unassigned", opaque, NULL},
4080
4.74k
    /* 122 */ {"Unassigned", opaque, NULL},
4081
4.74k
    /* 123 */ {"Unassigned", opaque, NULL},
4082
4.74k
    /* 124 */ {"Unassigned", opaque, NULL},
4083
4.74k
    /* 125 */ {"Unassigned", opaque, NULL},
4084
4.74k
    /* 126 */ {"Unassigned", opaque, NULL},
4085
4.74k
    /* 127 */ {"Unassigned", opaque, NULL},
4086
4.74k
    /* 128 */ {"Unassigned", opaque, NULL},
4087
4.74k
    /* 129 */ {"Unassigned", opaque, NULL},
4088
4.74k
    /* 130 */ {"Unassigned", opaque, NULL},
4089
4.74k
    /* 131 */ {"Unassigned", opaque, NULL},
4090
4.74k
    /* 132 */ {"Unassigned", opaque, NULL},
4091
4.74k
    /* 133 */ {"Unassigned", opaque, NULL},
4092
4.74k
    /* 134 */ {"Unassigned", opaque, NULL},
4093
4.74k
    /* 135 */ {"Unassigned", opaque, NULL},
4094
4.74k
    /* 136 */ {"Unassigned", opaque, NULL},
4095
4.74k
    /* 137 */ {"Unassigned", opaque, NULL},
4096
4.74k
    /* 138 */ {"Unassigned", opaque, NULL},
4097
4.74k
    /* 139 */ {"Unassigned", opaque, NULL},
4098
4.74k
    /* 140 */ {"Unassigned", opaque, NULL},
4099
4.74k
    /* 141 */ {"Unassigned", opaque, NULL},
4100
4.74k
    /* 142 */ {"Unassigned", opaque, NULL},
4101
4.74k
    /* 143 */ {"Unassigned", opaque, NULL},
4102
4.74k
    /* 144 */ {"Unassigned", opaque, NULL},
4103
4.74k
    /* 145 */ {"Unassigned", opaque, NULL},
4104
4.74k
    /* 146 */ {"Unassigned", opaque, NULL},
4105
4.74k
    /* 147 */ {"Unassigned", opaque, NULL},
4106
4.74k
    /* 148 */ {"Unassigned", opaque, NULL},
4107
4.74k
    /* 149 */ {"Unassigned", opaque, NULL},
4108
4.74k
    /* 150 */ {"Unassigned", opaque, NULL},
4109
4.74k
    /* 151 */ {"Unassigned", opaque, NULL},
4110
4.74k
    /* 152 */ {"Unassigned", opaque, NULL},
4111
4.74k
    /* 153 */ {"Unassigned", opaque, NULL},
4112
4.74k
    /* 154 */ {"Unassigned", opaque, NULL},
4113
4.74k
    /* 155 */ {"Unassigned", opaque, NULL},
4114
4.74k
    /* 156 */ {"Unassigned", opaque, NULL},
4115
4.74k
    /* 157 */ {"Unassigned", opaque, NULL},
4116
4.74k
    /* 158 */ {"Unassigned", opaque, NULL},
4117
4.74k
    /* 159 */ {"Unassigned", opaque, NULL},
4118
4.74k
    /* 160 */ {"Unassigned", opaque, NULL},
4119
4.74k
    /* 161 */ {"Unassigned", opaque, NULL},
4120
4.74k
    /* 162 */ {"Unassigned", opaque, NULL},
4121
4.74k
    /* 163 */ {"Unassigned", opaque, NULL},
4122
4.74k
    /* 164 */ {"Unassigned", opaque, NULL},
4123
4.74k
    /* 165 */ {"Unassigned", opaque, NULL},
4124
4.74k
    /* 166 */ {"Unassigned", opaque, NULL},
4125
4.74k
    /* 167 */ {"Unassigned", opaque, NULL},
4126
4.74k
    /* 168 */ {"Unassigned", opaque, NULL},
4127
4.74k
    /* 169 */ {"Unassigned", opaque, NULL},
4128
4.74k
    /* 170 */ {"Unassigned", opaque, NULL},
4129
4.74k
    /* 171 */ {"Unassigned", opaque, NULL},
4130
4.74k
    /* 172 */ {"Unassigned", opaque, NULL},
4131
4.74k
    /* 173 */ {"Unassigned", opaque, NULL},
4132
4.74k
    /* 174 */ {"Unassigned", opaque, NULL},
4133
4.74k
    /* 175 */ {"Unassigned", opaque, NULL},
4134
4.74k
    /* 176 */ {"Unassigned", opaque, NULL},
4135
4.74k
    /* 177 */ {"Unassigned", opaque, NULL},
4136
4.74k
    /* 178 */ {"Unassigned", opaque, NULL},
4137
4.74k
    /* 179 */ {"LCM Server", string, &hf_dhcp_option43_pxeclient_lcm_server},
4138
4.74k
    /* 180 */ {"LCM Domain", string, &hf_dhcp_option43_pxeclient_lcm_domain},
4139
4.74k
    /* 181 */ {"LCM NIC Option 0", bytes, &hf_dhcp_option43_pxeclient_lcm_nic_option},
4140
4.74k
    /* 182 */ {"Unassigned", opaque, NULL},
4141
4.74k
    /* 183 */ {"Unassigned", opaque, NULL},
4142
4.74k
    /* 184 */ {"Unassigned", opaque, NULL},
4143
4.74k
    /* 185 */ {"Unassigned", opaque, NULL},
4144
4.74k
    /* 186 */ {"Unassigned", opaque, NULL},
4145
4.74k
    /* 187 */ {"Unassigned", opaque, NULL},
4146
4.74k
    /* 188 */ {"Unassigned", opaque, NULL},
4147
4.74k
    /* 189 */ {"Unassigned", opaque, NULL},
4148
4.74k
    /* 190 */ {"LCM Workgroup", string, &hf_dhcp_option43_pxeclient_lcm_workgroup},
4149
4.74k
    /* 191 */ {"Discovery", val_boolean, &hf_dhcp_option43_pxeclient_discovery},
4150
4.74k
    /* 192 */ {"Configured", val_boolean, &hf_dhcp_option43_pxeclient_configured},
4151
4.74k
    /* 193 */ {"LCM Version", val_u_long, &hf_dhcp_option43_pxeclient_lcm_version},
4152
4.74k
    /* 194 */ {"LCM Serial Number", string, &hf_dhcp_option43_pxeclient_lcm_serial},
4153
    /* 255 {"PXE end options", special, &hf_dhcp_option43_pxeclient_end} */
4154
4.74k
  };
4155
4156
4.74k
  subopt = tvb_get_uint8(tvb, optoff);
4157
4.74k
  suboptoff++;
4158
4159
4.74k
  if (subopt == 0) {
4160
1.79k
    proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4161
1.79k
    return (suboptoff);
4162
2.95k
  } else if (subopt == 255) { /* End Option */
4163
1
    proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4164
    /* Make sure we skip any junk left this option */
4165
1
    return (optend);
4166
1
  }
4167
4168
2.95k
  if (suboptoff >= optend) {
4169
6
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4170
6
                  "Suboption %d: no room left in option for suboption length", subopt);
4171
6
    return (optend);
4172
6
  }
4173
4174
2.94k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
4175
2.94k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_pxeclient_suboption,
4176
2.94k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4177
2.94k
        subopt, val_to_str_const(subopt, option43_pxeclient_suboption_vals, "Unknown"));
4178
4179
2.94k
  o43pxeclient_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4180
2.94k
  proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4181
2.94k
  suboptoff++;
4182
4183
2.94k
  ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4184
2.94k
  proto_item_set_hidden(ti);
4185
4186
2.94k
  if ((subopt < 1) || (subopt >= array_length(o43pxeclient_opt))) {
4187
386
    expert_add_info_format(pinfo, vti, &ei_dhcp_suboption_invalid, "Unknown suboption %d (%d bytes)", subopt, subopt_len);
4188
2.56k
  } else if (o43pxeclient_opt[subopt].ftype == special) {
4189
    /* I may need to decode that properly one day */
4190
1.01k
    if (o43pxeclient_opt[subopt].phf != NULL)
4191
134
      proto_tree_add_item(o43pxeclient_v_tree, *o43pxeclient_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4192
882
    else {
4193
882
      switch(subopt)
4194
882
      {
4195
339
      case O43PXE_DISCOVERY:
4196
339
        proto_tree_add_bitmask(o43pxeclient_v_tree, tvb, suboptoff, hf_dhcp_option43_pxeclient_discovery_control,
4197
339
                  ett_dhcp_option43_suboption_discovery, o43pxe_discovery_hf_flags, ENC_BIG_ENDIAN);
4198
339
        break;
4199
171
      case O43PXE_BOOT_SERVER:
4200
171
        suboptoff_start = suboptoff;
4201
171
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_servers, tvb, suboptoff, subopt_len, ENC_NA);
4202
171
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4203
676
        while((suboptoff - suboptoff_start) < (unsigned)(subopt_len - 1)) {
4204
505
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4205
505
          suboptoff += 2;
4206
505
          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);
4207
505
          suboptoff += 1;
4208
1.76k
          while(boot_server_ip_count > 0) {
4209
1.25k
            proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_ip, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
4210
1.25k
            suboptoff += 4;
4211
1.25k
            boot_server_ip_count -=1;
4212
1.25k
          }
4213
505
        }
4214
171
        break;
4215
129
      case O43PXE_BOOT_MENU:
4216
129
        suboptoff_start = suboptoff;
4217
129
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_menu, tvb, suboptoff, subopt_len, ENC_NA);
4218
129
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4219
416
        while((suboptoff - suboptoff_start) < (unsigned)(subopt_len - 1)) {
4220
287
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4221
287
          suboptoff += 2;
4222
287
          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);
4223
287
          suboptoff += 1;
4224
287
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_desc, tvb, suboptoff, boot_menu_length, ENC_ASCII);
4225
287
          suboptoff += boot_menu_length;
4226
287
        }
4227
129
        break;
4228
204
      case O43PXE_MENU_PROMPT:
4229
204
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_menu_prompt, tvb, suboptoff, subopt_len, ENC_NA);
4230
204
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4231
204
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_timeout, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4232
204
        suboptoff += 1;
4233
204
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_prompt, tvb, suboptoff, subopt_len - 1, ENC_ASCII);
4234
204
        break;
4235
39
      case O43PXE_BOOT_ITEM:
4236
39
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_item, tvb, suboptoff, subopt_len, ENC_NA);
4237
39
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4238
39
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4239
39
        suboptoff += 2;
4240
39
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_layer, tvb, suboptoff, 2, ENC_NA);
4241
39
        break;
4242
0
      default:
4243
0
        proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4244
0
        break;
4245
882
      }
4246
882
    }
4247
1.54k
  } else {
4248
1.54k
    if (dhcp_handle_basic_types(pinfo, o43pxeclient_v_tree, vti, tvb, o43pxeclient_opt[subopt].ftype,
4249
1.54k
              suboptoff, subopt_len, o43pxeclient_opt[subopt].phf, &default_hfs) == 0)
4250
1.23k
    {
4251
1.23k
      expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4252
1.23k
    }
4253
1.54k
  }
4254
4255
2.92k
  optoff += (subopt_len + 2);
4256
2.92k
  return optoff;
4257
2.94k
}
4258
4259
static bool
4260
dissect_pxeclient_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4261
1.23k
{
4262
1.23k
  unsigned offset = 0;
4263
1.23k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4264
1.23k
  proto_tree* vendor_tree;
4265
4266
  /* PXE protocol 2.1 as described in the Intel specs */
4267
1.23k
  if ((option_data->vendor_class_id == NULL) ||
4268
654
    (strncmp((const char*)option_data->vendor_class_id, "PXEClient", strlen("PXEClient")) != 0))
4269
1.15k
    return false;
4270
4271
73
  proto_item_append_text(tree, " (PXEClient)");
4272
73
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4273
4274
4.81k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
4275
4.74k
    offset = dissect_vendor_pxeclient_suboption(pinfo, tree, vendor_tree,
4276
4.74k
      tvb, offset, tvb_reported_length(tvb));
4277
4.74k
  }
4278
4279
73
  return true;
4280
1.23k
}
4281
4282
static void
4283
dissect_vendor_avaya_param(proto_tree *tree, packet_info *pinfo, proto_item *vti,
4284
    tvbuff_t *tvb, unsigned optoff, wmem_strbuf_t *avaya_param_buf)
4285
7.55k
{
4286
7.55k
  const char *field;
4287
7.55k
  int len;
4288
4289
7.55k
  field = wmem_strbuf_get_str(avaya_param_buf);
4290
7.55k
  len = (int)wmem_strbuf_get_len(avaya_param_buf);
4291
4292
7.55k
  if((strncmp(field, "TLSSRVR=", 8) == 0) && ( len > 8 )) {
4293
17
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_tlssrvr, tvb, optoff, len, field + 8);
4294
17
  }
4295
7.54k
  else if((strncmp(field, "HTTPSRVR=", 9) == 0) && ( len > 9)) {
4296
26
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpsrvr, tvb, optoff, len, field + 9);
4297
26
  }
4298
7.51k
  else if((strncmp(field, "HTTPDIR=", 8) == 0) && ( len > 8)) {
4299
40
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpdir, tvb, optoff, len, field + 8);
4300
40
  }
4301
7.47k
  else if((strncmp(field, "STATIC=", 7) == 0) && ( len > 7)) {
4302
52
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_static, tvb, optoff, len, field + 7, "%s (%s)", field + 7, str_to_str_wmem(pinfo->pool, field + 7, option242_avaya_static_vals, "Unknown (%s)"));
4303
52
  }
4304
7.42k
  else if((strncmp(field, "MCIPADD=", 8) == 0) && ( len > 8)) {
4305
55
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_mcipadd, tvb, optoff, len, field + 8);
4306
55
  }
4307
7.36k
  else if((strncmp(field, "DOT1X=", 6) == 0) && ( len > 6)) {
4308
41
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_dot1x, tvb, optoff, len, field + 6, "%s (%s)", field + 6, str_to_str_wmem(pinfo->pool, field + 6, option242_avaya_dot1x_vals, "Unknown (%s)"));
4309
41
  }
4310
7.32k
  else if((strncmp(field, "ICMPDU=", 7) == 0) && ( len > 7)) {
4311
56
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_icmpdu, tvb, optoff, len, field + 7, "%s (%s)", field + 7, str_to_str_wmem(pinfo->pool, field + 7, option242_avaya_icmpdu_vals, "Unknown (%s)"));
4312
56
  }
4313
7.27k
  else if((strncmp(field, "ICMPRED=", 8) == 0) && ( len > 8)) {
4314
50
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_icmpred, tvb, optoff, len, field + 8, "%s (%s)", field + 8, str_to_str_wmem(pinfo->pool, field + 8, option242_avaya_icmpred_vals, "Unknown (%s)"));
4315
50
  }
4316
7.22k
  else if((strncmp(field, "L2Q=", 4) == 0) && ( len > 4)) {
4317
109
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_l2q, tvb, optoff, len, field + 4, "%s (%s)", field + 4, str_to_str_wmem(pinfo->pool, field + 4, option242_avaya_l2q_vals, "Unknown (%s)"));
4318
109
  }
4319
7.11k
  else if((strncmp(field, "L2QVLAN=", 8) == 0) && ( len > 8)) {
4320
280
    int32_t val = -1;
4321
280
    bool val_valid;
4322
280
    proto_item* pi;
4323
4324
280
    val_valid = ws_strtoi32(field + 8, NULL, &val);
4325
280
    pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_l2qvlan, tvb, optoff, len, val);
4326
280
    if (val_valid)
4327
30
      expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_l2qvlan_invalid);
4328
280
  }
4329
6.83k
  else if((strncmp(field, "LOGLOCAL=", 9) == 0) && ( len > 9)) {
4330
33
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_loglocal, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str_wmem(pinfo->pool, field + 9, option242_avaya_loglocal_vals, "Unknown (%s)"));
4331
33
  }
4332
6.79k
  else if((strncmp(field, "PHY1STAT=", 9) == 0) && ( len > 9)) {
4333
38
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_phy1stat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str_wmem(pinfo->pool, field + 9, option242_avaya_phystat_vals, "Unknown (%s)"));
4334
38
  }
4335
6.76k
  else if((strncmp(field, "PHY2STAT=", 9) == 0) && ( len > 9)) {
4336
36
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_phy2stat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str_wmem(pinfo->pool, field + 9, option242_avaya_phystat_vals, "Unknown (%s)"));
4337
36
  }
4338
6.72k
  else if((strncmp(field, "PROCPSWD=", 9) == 0) && ( len > 9)) {
4339
41
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_procpswd, tvb, optoff, len, field + 9);
4340
41
  }
4341
6.68k
  else if((strncmp(field, "PROCSTAT=", 9) == 0) && ( len > 9)) {
4342
60
    proto_tree_add_string_format_value(tree, hf_dhcp_option242_avaya_procstat, tvb, optoff, len, field + 9, "%s (%s)", field + 9, str_to_str_wmem(pinfo->pool, field + 9, option242_avaya_procstat_vals, "Unknown (%s)"));
4343
60
  }
4344
6.62k
  else if((strncmp(field, "SNMPADD=", 8) == 0) && ( len > 8)) {
4345
27
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpadd, tvb, optoff, len, field + 8);
4346
27
  }
4347
6.59k
  else if((strncmp(field, "SNMPSTRING=", 11) == 0) && ( len > 11)) {
4348
28
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpstring, tvb, optoff, len, field + 11);
4349
28
  }
4350
6.56k
  else if((strncmp(field, "VLANTEST=", 9) == 0) && ( len > 9)) {
4351
475
    int32_t val = -1;
4352
475
    bool val_valid;
4353
475
    proto_item* pi;
4354
4355
475
    val_valid = ws_strtoi32(field + 9, NULL, &val);
4356
475
    pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_vlantest, tvb, optoff, len, val);
4357
475
    if (!val_valid)
4358
371
      expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_vlantest_invalid);
4359
475
  }
4360
6.09k
  else {
4361
6.09k
    expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown Avaya IP Telephone parameter %s", field);
4362
6.09k
  }
4363
7.55k
}
4364
4365
/* RFC3825Decoder:
4366
 *
4367
 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4368
 *
4369
 * The code is no longer available.
4370
 */
4371
static void
4372
rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint)
4373
21
{
4374
21
  fixpoint->latitude_res = (lci[0]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
4375
21
  if (lci[0] & 2) { /* LSB<<1 contains the sign of the latitude */
4376
    /* Latitude is negative, expand two's complement */
4377
5
    fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4378
5
             ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8)  |
4379
5
              (int64_t)lci[4] | ((int64_t)0x3FFFFFFF<<34);
4380
4381
16
  } else {
4382
    /* Latitude is positive */
4383
16
    fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4384
16
             ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8)  |
4385
16
              (int64_t)lci[4];
4386
16
  }
4387
21
  fixpoint->longitude_res = (lci[5]>>2) & 0x3F;  /* make sure that right-shift does not copy sign bit */
4388
21
  if (lci[5] & 2) { /* LSB<<1 contains the sign of the latitude */
4389
    /* Longitude is negative, expand two's complement */
4390
4
    fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4391
4
              ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8)  |
4392
4
               (int64_t)lci[9]   | ((int64_t)0x3FFFFFFF<<34);
4393
4394
17
  } else {
4395
    /* Longitude is positive */
4396
17
    fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4397
17
              ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8)  |
4398
17
               (int64_t)lci[9];
4399
17
  }
4400
21
  fixpoint->altitude_type = (lci[10]>>4) & 0x0F;  /* make sure that right-shift does not copy sign bit */
4401
21
  fixpoint->altitude_res  = ((lci[10] & 0x0F) << 2) | ((lci[11]>>6) & 0x03);
4402
21
  if (lci[11] & 0x20) { /* LSB<<1 contains the sign of the latitude */
4403
    /* Altitude is negative, expand two's complement */
4404
6
    fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4405
6
             ((int32_t)lci[13]<<8) | ((int32_t)lci[14]) |
4406
6
              ((int32_t)0x03<<30);
4407
4408
15
  } else {
4409
    /* Altitude is positive */
4410
15
    fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4411
15
             ((int32_t)lci[13]<<8) | ((int32_t)lci[14]);
4412
15
  }
4413
4414
21
  fixpoint->datum_type = lci[15];
4415
4416
21
}
4417
4418
/* RFC3825Decoder:
4419
 *
4420
 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4421
 *
4422
 * The code is no longer available.
4423
 */
4424
static int
4425
rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal)
4426
21
{
4427
  /* Latitude */
4428
21
  decimal->latitude = (double) fixpoint->latitude / (1 << 25);
4429
21
  if ((decimal->latitude > 90) || (decimal->latitude < -90)) {
4430
2
    return RFC3825_LATITUDE_OUTOFRANGE;
4431
2
  }
4432
4433
  /* Latitude Uncertainty */
4434
19
  if (fixpoint->latitude_res > 34) {
4435
1
    return RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE;
4436
1
  }
4437
18
  if (fixpoint->latitude_res > 8 ) {
4438
11
    decimal->latitude_res = (double) 1  / (UINT64_C(1) << (fixpoint->latitude_res - 8));
4439
11
  } else {
4440
7
    decimal->latitude_res = (double) (UINT64_C(1) << (8 - fixpoint->latitude_res));
4441
7
  }
4442
4443
  /* Longitude */
4444
18
  decimal->longitude = (double) fixpoint->longitude / (1 << 25);
4445
18
  if ((decimal->longitude > 180) || (decimal->longitude < -180)) {
4446
2
    return RFC3825_LONGITUDE_OUTOFRANGE;
4447
2
  }
4448
4449
  /* Longitude Uncertainty */
4450
16
  if (fixpoint->longitude_res > 34) {
4451
1
    return RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE;
4452
1
  }
4453
15
  if (fixpoint->longitude_res > 8 ) {
4454
4
    decimal->longitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->longitude_res - 8));
4455
11
  } else {
4456
11
    decimal->longitude_res = (double) (UINT64_C(1) << (8 - fixpoint->longitude_res));
4457
11
  }
4458
4459
  /* Altitude Type */
4460
15
  decimal->altitude_type = fixpoint->altitude_type;
4461
15
  decimal->altitude = 0;
4462
15
  decimal->altitude_res = 0;
4463
4464
15
  if (decimal->altitude_type == 0) { /* Unknown */
4465
11
  } else if (decimal->altitude_type == 1) { /* Meters */
4466
    /* Altitude */
4467
5
    decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4468
5
    if ((decimal->altitude > ((int32_t) 1<<21)-1) || (decimal->altitude < ((int32_t) -(1<<21))))
4469
1
      return RFC3825_ALTITUDE_OUTOFRANGE;
4470
4471
    /* Altitude Uncertainty */
4472
4
    if (fixpoint->altitude_res > 30) {
4473
1
      return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4474
1
    }
4475
3
    if (fixpoint->altitude_res > 21 ) {
4476
1
      decimal->altitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->altitude_res - 21));
4477
2
    } else {
4478
2
      decimal->altitude_res = (double) (UINT64_C(1) << (21 - fixpoint->altitude_res));
4479
2
    }
4480
6
  } else if (decimal->altitude_type == 2) { /* Floors */
4481
    /* Altitude */
4482
3
    if ((fixpoint->altitude_res != 30) && (fixpoint->altitude_res != 0)) {
4483
2
      return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4484
2
    }
4485
1
    decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4486
3
  } else { /* invalid type */
4487
3
    return RFC3825_ALTITUDE_TYPE_OUTOFRANGE;
4488
3
  }
4489
4490
  /* Datum Type */
4491
8
  decimal->datum_type = 0;
4492
8
  if ((fixpoint->datum_type > 3) || (fixpoint->datum_type < 1)) {
4493
7
    return RFC3825_DATUM_TYPE_OUTOFRANGE;
4494
7
  }
4495
1
  decimal->datum_type = fixpoint->datum_type;
4496
4497
1
  return RFC3825_NOERROR;
4498
8
}
4499
4500
static int
4501
dissect_dhcpopt_isns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4502
135
{
4503
135
  static int * const isns_functions_hf_flags[] = {
4504
135
    &hf_dhcp_option_isns_functions_enabled,
4505
135
    &hf_dhcp_option_isns_functions_dd_authorization,
4506
135
    &hf_dhcp_option_isns_functions_sec_policy_distibution,
4507
135
    &hf_dhcp_option_isns_functions_reserved,
4508
135
    NULL
4509
135
  };
4510
4511
135
  static int * const isns_dda_hf_flags[] = {
4512
135
    &hf_dhcp_option_isns_discovery_domain_access_enabled,
4513
135
    &hf_dhcp_option_isns_discovery_domain_access_control_node,
4514
135
    &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
4515
135
    &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
4516
135
    &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
4517
135
    &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
4518
135
    &hf_dhcp_option_isns_discovery_domain_access_reserved,
4519
135
    NULL
4520
135
  };
4521
4522
135
  static int * const isns_administrative_flags[] = {
4523
135
    &hf_dhcp_option_isns_administrative_flags_enabled,
4524
135
    &hf_dhcp_option_isns_administrative_flags_heartbeat,
4525
135
    &hf_dhcp_option_isns_administrative_flags_management_scns,
4526
135
    &hf_dhcp_option_isns_administrative_flags_default_dd,
4527
135
    &hf_dhcp_option_isns_administrative_flags_reserved,
4528
135
    NULL
4529
135
  };
4530
4531
135
  static int * const isns_server_security_flags[] = {
4532
135
    &hf_dhcp_option_isns_server_security_bitmap_enabled,
4533
135
    &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
4534
135
    &hf_dhcp_option_isns_server_security_bitmap_main_mode,
4535
135
    &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
4536
135
    &hf_dhcp_option_isns_server_security_bitmap_pfs,
4537
135
    &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
4538
135
    &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
4539
135
    &hf_dhcp_option_isns_server_security_bitmap_reserved,
4540
135
    NULL
4541
135
  };
4542
4543
135
  uint16_t function_flags, dd_access_flags, administrative_flags;
4544
135
  uint32_t server_security_flags;
4545
135
  proto_tree *server_tree;
4546
135
  proto_item *item;
4547
135
  int length = tvb_reported_length(tvb);
4548
135
  unsigned offset = 0, heartbeat_set = 0;
4549
4550
135
  if (length < 14) {
4551
21
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 14");
4552
21
    return 1;
4553
21
  }
4554
4555
114
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_functions,
4556
114
              ett_dhcp_isns_functions, isns_functions_hf_flags, ENC_BIG_ENDIAN);
4557
114
  function_flags = tvb_get_ntohs(tvb, offset);
4558
  /* RFC 4174, section "2.1. iSNS Functions Field" specifies that if
4559
   * the field "Function Fields Enabled" is set to 0, then "the contents
4560
   * of all other iSNS Function fields MUST be ignored. We will display
4561
   * the fields but add an informational expert info. This goes for all
4562
   * the bitmasks: iSNS Functions, DD Access, Administrative Flags, iSNS
4563
   * Server Security Bitmap */
4564
114
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(function_flags, F_ISNS_FUNCTIONS_ENABLED))
4565
76
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4566
4567
114
  offset += 2;
4568
114
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_discovery_domain_access,
4569
114
              ett_dhcp_isns_discovery_domain_access, isns_dda_hf_flags, ENC_BIG_ENDIAN);
4570
114
  dd_access_flags = tvb_get_ntohs(tvb, offset);
4571
114
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(dd_access_flags, F_ISNS_DD_ACCESS_ENABLED))
4572
58
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4573
4574
114
  offset += 2;
4575
114
  administrative_flags = tvb_get_ntohs(tvb, offset);
4576
114
  if (administrative_flags & F_ISNS_ADMIN_FLAGS_ENABLED) {
4577
54
    if ((administrative_flags & F_ISNS_ADMIN_FLAGS_HEARTBEAT)) {
4578
31
      if (length < 18) {
4579
2
        expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 18");
4580
2
        return offset;
4581
2
      }
4582
29
      heartbeat_set = 1;
4583
29
    }
4584
54
  }
4585
112
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_administrative_flags,
4586
112
              ett_dhcp_isns_administrative_flags, isns_administrative_flags, ENC_BIG_ENDIAN);
4587
112
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(administrative_flags, F_ISNS_ADMIN_FLAGS_ENABLED))
4588
54
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4589
4590
112
  offset += 2;
4591
112
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_server_security_bitmap,
4592
112
              ett_dhcp_isns_server_security_bitmap, isns_server_security_flags, ENC_BIG_ENDIAN);
4593
112
  server_security_flags = tvb_get_ntohl(tvb, offset);
4594
112
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(server_security_flags, F_ISNS_SRV_SEC_BITMAP_ENABLED))
4595
55
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4596
4597
112
  offset += 4;
4598
112
  if (heartbeat_set) {
4599
29
    proto_tree_add_item(tree, hf_dhcp_option_isns_heartbeat_originator_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4600
29
    offset += 4;
4601
29
  }
4602
4603
112
  proto_tree_add_item(tree, hf_dhcp_option_isns_primary_server_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4604
4605
112
  offset += 4;
4606
112
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
4607
111
    server_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_dhcp_isns_secondary_server_addr,
4608
111
            &item, "Secondary iSNS Servers");
4609
111
    dhcp_handle_basic_types(pinfo, server_tree, item, tvb, ipv4_list, offset, tvb_reported_length_remaining(tvb, offset),
4610
111
               &hf_dhcp_option_isns_secondary_server_addr_list, NULL);
4611
111
  }
4612
4613
112
  return tvb_captured_length(tvb);
4614
114
}
4615
4616
static const value_string option43_cl_suboption_vals[] = {
4617
  {  0, "Padding" },
4618
  {  1, "Suboption Request List" },
4619
  {  2, "Device Type" },
4620
  {  3, "eSAFE Types" },
4621
  {  4, "Serial Number" },
4622
  {  5, "Hardware Version" },
4623
  {  6, "Software Version" },
4624
  {  7, "Boot ROM version" },
4625
  {  8, "Organizationally Unique Identifier" },
4626
  {  9, "Model Number" },
4627
  { 10, "Vendor Name" },
4628
  { 11, "Address Realm" },
4629
  { 12, "CM/PS System Description" },
4630
  { 13, "CM/PS Firmware Revision" },
4631
  { 14, "Firewall Policy File Version" },
4632
  { 15, "eSafe Config File Devices" },
4633
  { 18, "Video Security Type" },
4634
  { 31, "MTA MAC Address" },
4635
  { 32, "Correlation ID" },
4636
  { 51, "Vendor Name" },
4637
  { 52, "CableCARD Capability" },
4638
  { 53, "Device Identification (CA)" },
4639
  { 54, "Device Identification (X.509)" },
4640
  { 179, "LCM Server" },
4641
  { 180, "LCM Domain" },
4642
  { 181, "LCM NIC option 0" },
4643
  { 190, "LCM Workgroup" },
4644
  { 191, "Discovery" },
4645
  { 192, "HH Configured" },
4646
  { 193, "LCM Version" },
4647
  { 194, "LCM Serial Number" },
4648
  { 255, "CL End" },
4649
  { 0, NULL}
4650
};
4651
4652
static const value_string cablehome_subopt11_vals[] = {
4653
  { 1, "PS WAN-Man" },
4654
  { 2, "PS WAN-Data" },
4655
  { 0, NULL }
4656
};
4657
4658
static int
4659
dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4660
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
4661
4.21k
{
4662
4.21k
  unsigned    suboptoff = optoff;
4663
4.21k
  uint8_t     subopt;
4664
4.21k
  uint8_t     subopt_len;
4665
4.21k
  proto_tree *o43cl_v_tree;
4666
4.21k
  proto_item *vti;
4667
4668
4.21k
  static const struct basic_types_hfs default_hfs = {
4669
4.21k
    &hf_dhcp_option43_value,
4670
4.21k
    NULL,
4671
4.21k
    NULL,
4672
4.21k
    &hf_dhcp_option43_value_stringz,
4673
4.21k
    NULL,
4674
4.21k
    &hf_dhcp_option43_value_8,
4675
4.21k
    NULL,
4676
4.21k
    NULL,
4677
4.21k
    &hf_dhcp_option43_value_32,
4678
4.21k
    NULL,
4679
4.21k
    NULL
4680
4.21k
  };
4681
4682
4.21k
  static const struct opt_info o43cablelabs_opt[]= {
4683
4.21k
    /*  0 */ {"nop", special, &hf_dhcp_option43_cl_padding},  /* dummy */
4684
4.21k
    /*  1 */ {"Suboption Request List", string, &hf_dhcp_option43_cl_suboption_request_list},
4685
4.21k
    /*  2 */ {"Device Type", string, &hf_dhcp_option43_cl_device_type},
4686
4.21k
    /*  3 */ {"eSAFE Types", string, &hf_dhcp_option43_cl_esafe_type},
4687
4.21k
    /*  4 */ {"Serial Number", string, &hf_dhcp_option43_cl_serial_number},
4688
4.21k
    /*  5 */ {"Hardware Version", string, &hf_dhcp_option43_cl_hardware_version},
4689
4.21k
    /*  6 */ {"Software Version", string, &hf_dhcp_option43_cl_software_version},
4690
4.21k
    /*  7 */ {"Boot ROM version", string, &hf_dhcp_option43_cl_boot_rom_version},
4691
4.21k
    /*  8 */ {"Organizationally Unique Identifier", special, &hf_dhcp_option43_cl_oui_bytes},
4692
4.21k
    /*  9 */ {"Model Number", string, &hf_dhcp_option43_cl_model_number},
4693
4.21k
    /* 10 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name10},
4694
    /* *** 11-30: CableHome *** */
4695
4.21k
    /* 11 */ {"Address Realm", val_u_byte, &hf_dhcp_option43_cl_address_realm},
4696
4.21k
    /* 12 */ {"CM/PS System Description", string, &hf_dhcp_option43_cl_cm_ps_system_desc},
4697
4.21k
    /* 13 */ {"CM/PS Firmware Revision", string, &hf_dhcp_option43_cl_cm_ps_firmware_revision},
4698
4.21k
    /* 14 */ {"Firewall Policy File Version", string, &hf_dhcp_option43_cl_firewall_policy_file_version},
4699
4.21k
    /* 15 */ {"eSafe Config File Devices", string, &hf_dhcp_option43_cl_esafe_config_file_devices},
4700
4.21k
    /* 16 */ {"Unassigned (CableHome)", special, NULL},
4701
4.21k
    /* 17 */ {"Unassigned (CableHome)", special, NULL},
4702
4.21k
    /* 18 */ {"Video Security Type", string, &hf_dhcp_option43_cl_video_security_tape},
4703
4.21k
    /* 19 */ {"Unassigned (CableHome)", special, NULL},
4704
4.21k
    /* 20 */ {"Unassigned (CableHome)", special, NULL},
4705
4.21k
    /* 21 */ {"Unassigned (CableHome)", special, NULL},
4706
4.21k
    /* 22 */ {"Unassigned (CableHome)", special, NULL},
4707
4.21k
    /* 23 */ {"Unassigned (CableHome)", special, NULL},
4708
4.21k
    /* 24 */ {"Unassigned (CableHome)", special, NULL},
4709
4.21k
    /* 25 */ {"Unassigned (CableHome)", special, NULL},
4710
4.21k
    /* 26 */ {"Unassigned (CableHome)", special, NULL},
4711
4.21k
    /* 27 */ {"Unassigned (CableHome)", special, NULL},
4712
4.21k
    /* 28 */ {"Unassigned (CableHome)", special, NULL},
4713
4.21k
    /* 29 */ {"Unassigned (CableHome)", special, NULL},
4714
4.21k
    /* 30 */ {"Unassigned (CableHome)", special, NULL},
4715
    /* *** 31-50: PacketCable *** */
4716
4.21k
    /* 31 */ {"MTA MAC Address", special, &hf_dhcp_option43_cl_mta_mac_address},
4717
4.21k
    /* 32 */ {"Correlation ID", val_u_long, &hf_dhcp_option43_cl_correlation_ID},
4718
4.21k
    /* 33 */ {"Unassigned (PacketCable)", special, NULL},
4719
4.21k
    /* 34 */ {"Unassigned (PacketCable)", special, NULL},
4720
4.21k
    /* 35 */ {"Unassigned (PacketCable)", special, NULL},
4721
4.21k
    /* 36 */ {"Unassigned (PacketCable)", special, NULL},
4722
4.21k
    /* 37 */ {"Unassigned (PacketCable)", special, NULL},
4723
4.21k
    /* 38 */ {"Unassigned (PacketCable)", special, NULL},
4724
4.21k
    /* 39 */ {"Unassigned (PacketCable)", special, NULL},
4725
4.21k
    /* 40 */ {"Unassigned (PacketCable)", special, NULL},
4726
4.21k
    /* 41 */ {"Unassigned (PacketCable)", special, NULL},
4727
4.21k
    /* 42 */ {"Unassigned (PacketCable)", special, NULL},
4728
4.21k
    /* 43 */ {"Unassigned (PacketCable)", special, NULL},
4729
4.21k
    /* 44 */ {"Unassigned (PacketCable)", special, NULL},
4730
4.21k
    /* 45 */ {"Unassigned (PacketCable)", special, NULL},
4731
4.21k
    /* 46 */ {"Unassigned (PacketCable)", special, NULL},
4732
4.21k
    /* 47 */ {"Unassigned (PacketCable)", special, NULL},
4733
4.21k
    /* 48 */ {"Unassigned (PacketCable)", special, NULL},
4734
4.21k
    /* 49 */ {"Unassigned (PacketCable)", special, NULL},
4735
4.21k
    /* 50 */ {"Unassigned (PacketCable)", special, NULL},
4736
    /* *** 51-127: CableLabs *** */
4737
4.21k
    /* 51 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name51},
4738
4.21k
    /* 52 */ {"CableCARD Capability", special, &hf_dhcp_option43_cl_cablecard_capability},
4739
4.21k
    /* 53 */ {"Device Identification (CA)", special, &hf_dhcp_option43_cl_device_id_ca},
4740
4.21k
    /* 54 */ {"Device Identification (X.509)", string, &hf_dhcp_option43_cl_device_id_x509},
4741
4.21k
    /* 55 */ {"Unassigned (CableLabs)", special, NULL},
4742
    /* *** 128-254: Vendors *** */
4743
    /* 128-254 {"Unassigned (Vendors)", special, NULL}, */
4744
    /* 255 {"end options", special, &hf_dhcp_option43_cl_end} */
4745
4.21k
  };
4746
4747
4.21k
  subopt = tvb_get_uint8(tvb, optoff);
4748
4.21k
  suboptoff++;
4749
4750
4.21k
  if (subopt == 0) {
4751
1.34k
    proto_tree_add_item(v_tree, hf_dhcp_option43_cl_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4752
1.34k
    return (suboptoff);
4753
2.87k
  } else if (subopt == 255) { /* End Option */
4754
7
    proto_tree_add_item(v_tree, hf_dhcp_option43_cl_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4755
    /* Make sure we skip any junk left this option */
4756
7
    return (optend);
4757
7
  }
4758
4759
2.86k
  if (suboptoff >= optend) {
4760
12
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4761
12
                  "Suboption %d: no room left in option for suboption length", subopt);
4762
12
    return (optend);
4763
12
  }
4764
4765
2.85k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
4766
2.85k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cl_suboption,
4767
2.85k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4768
2.85k
        subopt, val_to_str_const(subopt, option43_cl_suboption_vals, "Unknown"));
4769
4770
2.85k
  o43cl_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4771
2.85k
  proto_tree_add_item(o43cl_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4772
2.85k
  suboptoff++;
4773
4774
2.85k
  if (suboptoff+subopt_len > optend) {
4775
62
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4776
62
            "Suboption %d: no room left in option for suboption value", subopt);
4777
62
    return (optend);
4778
62
  }
4779
4780
2.78k
  if ( (subopt < 1 ) || (subopt >= array_length(o43cablelabs_opt)) ) {
4781
551
    proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4782
2.23k
  } else if (o43cablelabs_opt[subopt].ftype == special) {
4783
1.30k
    switch(subopt)
4784
1.30k
    {
4785
464
    case 8:/* OUI */
4786
      /* CableLabs specs treat 43.8 inconsistently
4787
       * as either binary (3b) or string (6b) */
4788
464
      if (subopt_len == 3) {
4789
52
        proto_tree_add_bytes_format_value(o43cl_v_tree, hf_dhcp_option43_cl_oui_bytes, tvb, suboptoff, subopt_len, NULL,
4790
52
          "%02x:%02x:%02x", tvb_get_uint8(tvb, suboptoff), tvb_get_uint8(tvb, suboptoff+1), tvb_get_uint8(tvb, suboptoff+2));
4791
412
      } else if (subopt_len == 6) {
4792
69
        proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_oui_string, tvb, suboptoff, subopt_len, ENC_ASCII);
4793
343
      } else {
4794
343
        expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 3 or 6");
4795
343
      }
4796
464
      break;
4797
173
    case 31: /* MTA MAC address */
4798
173
      if (subopt_len != 6) {
4799
105
        expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 6");
4800
105
        break;
4801
105
      }
4802
4803
68
      proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_mta_mac_address, tvb, suboptoff, 6, ENC_NA);
4804
68
      break;
4805
665
    default:
4806
665
      if (o43cablelabs_opt[subopt].phf != NULL)
4807
280
        proto_tree_add_item(o43cl_v_tree, *o43cablelabs_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4808
385
      else
4809
385
        proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4810
1.30k
    }
4811
1.30k
  }
4812
936
  else {
4813
936
    if (dhcp_handle_basic_types(pinfo, o43cl_v_tree, vti, tvb, o43cablelabs_opt[subopt].ftype,
4814
936
              suboptoff, subopt_len, o43cablelabs_opt[subopt].phf, &default_hfs) == 0) {
4815
556
      expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4816
556
    }
4817
936
  }
4818
4819
2.78k
  optoff += (subopt_len + 2);
4820
2.78k
  return optoff;
4821
2.78k
}
4822
4823
static bool
4824
dissect_cablelabs_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4825
1.36k
{
4826
1.36k
  unsigned offset = 0;
4827
1.36k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4828
1.36k
  proto_tree* vendor_tree;
4829
4830
  /* Vendor Class IDs
4831
   * DOCSIS - docsis
4832
   * CableHome - CableHome
4833
   * OpenCable2.0 - OpenCable2.0
4834
   * PacketCable - pktc
4835
   * DEMARC - DEMARC
4836
   * sRouter - SROUTER
4837
   * Remote PHY - RPD
4838
   * eDOCSIS - PTA or ECM
4839
   * OpenCable TRIF - TR
4840
   */
4841
4842
1.36k
  if ((option_data->vendor_class_id != NULL) &&
4843
770
    ((strncmp((const char*)option_data->vendor_class_id, "pktc", strlen("pktc")) == 0) ||
4844
732
     (strncmp((const char*)option_data->vendor_class_id, "docsis", strlen("docsis")) == 0) ||
4845
701
     (strncmp((const char*)option_data->vendor_class_id, "OpenCable2.0", strlen("OpenCable2.0")) == 0) ||
4846
700
     (strncmp((const char*)option_data->vendor_class_id, "CableHome", strlen("CableHome")) == 0) ||
4847
699
     (strncmp((const char*)option_data->vendor_class_id, "RPD", strlen("RPD")) == 0) ||
4848
697
     (strncmp((const char*)option_data->vendor_class_id, "RMD", strlen("RMD")) == 0) ||
4849
694
     (strncmp((const char*)option_data->vendor_class_id, "ECM", strlen("ECM")) == 0) ||
4850
691
     (strncmp((const char*)option_data->vendor_class_id, "PTA", strlen("PTA")) == 0) ||
4851
687
     (strncmp((const char*)option_data->vendor_class_id, "DEMARC", strlen("DEMARC")) == 0) ||
4852
686
     (strncmp((const char*)option_data->vendor_class_id, "TR", strlen("TR")) == 0) ||
4853
681
     (strncmp((const char*)option_data->vendor_class_id, "SROUTER", strlen("SROUTER")) == 0))) {
4854
    /* CableLabs standard - see www.cablelabs.com/projects */
4855
90
    proto_item_append_text(tree, " (CableLabs)");
4856
90
    vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4857
4858
4.30k
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
4859
4.21k
      offset = dissect_vendor_cablelabs_suboption(pinfo, tree, vendor_tree,
4860
4.21k
        tvb, offset, tvb_reported_length(tvb));
4861
4.21k
    }
4862
90
    return true;
4863
90
  }
4864
4865
1.27k
  return false;
4866
1.36k
}
4867
4868
static bool
4869
dissect_aruba_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4870
1.10k
{
4871
1.10k
  unsigned offset = 0;
4872
1.10k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4873
1.10k
  proto_tree* vendor_tree;
4874
4875
1.10k
  if ((option_data->vendor_class_id == NULL) ||
4876
540
    (strncmp((const char*)option_data->vendor_class_id, ARUBA_AP, strlen(ARUBA_AP)) != 0))
4877
1.10k
    return false;
4878
4879
1
  proto_item_append_text(tree, " (Aruba AP)");
4880
1
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4881
4882
1
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaap_controllerip, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
4883
1
  return true;
4884
1.10k
}
4885
4886
static bool
4887
dissect_aruba_instant_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4888
1.11k
{
4889
1.11k
  unsigned offset = 0;
4890
1.11k
  unsigned reported_len = tvb_reported_length(tvb);
4891
1.11k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4892
1.11k
  proto_tree* vendor_tree;
4893
1.11k
  proto_item* vendor_item;
4894
1.11k
  uint32_t nameorglen, ampiplen;
4895
4896
  /* Aruba  Instant AP */
4897
1.11k
  if ((option_data->vendor_class_id == NULL) ||
4898
547
    (strncmp((const char*)option_data->vendor_class_id, ARUBA_INSTANT_AP, strlen(ARUBA_INSTANT_AP)) != 0))
4899
1.11k
    return false;
4900
4901
5
  proto_item_append_text(tree, " (Aruba Instant AP)");
4902
4903
5
  vendor_item = proto_tree_add_item(tree, hf_dhcp_option43_arubaiap, tvb, offset, reported_len, ENC_ASCII);
4904
5
  vendor_tree = proto_item_add_subtree(vendor_item, ett_dhcp_option43_suboption);
4905
5
  tvb_find_uint8_length(tvb, offset, tvb_reported_length(tvb), ',', &nameorglen);
4906
5
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_nameorg, tvb, offset, nameorglen, ENC_ASCII);
4907
5
  offset += (nameorglen+1);
4908
5
  tvb_find_uint8_length(tvb, offset, reported_len - nameorglen - 1, ',', &ampiplen);
4909
5
  ampiplen = ampiplen -offset;
4910
5
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_ampip, tvb, offset, ampiplen, ENC_ASCII);
4911
5
  offset += (ampiplen+1);
4912
5
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_password, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
4913
4914
5
  return true;
4915
1.11k
}
4916
4917
static const value_string option43_bsdp_suboption_vals[] = {
4918
  {  0, "Pad" },
4919
  {  1, "Message Type" },
4920
  {  2, "Version" },
4921
  {  3, "Server Identifier" },
4922
  {  4, "Server Priority" },
4923
  {  5, "Reply Port" },
4924
  {  6, "Boot Image List Path" },
4925
  {  7, "Default Boot Image" },
4926
  {  8, "Selected Boot Image" },
4927
  {  9, "Boot Image List" },
4928
  { 10, "NetBoot 1.0 Firmware" },
4929
  { 11, "Boot Image Attributes Filter List" },
4930
  { 12, "Maximum Message Size" },
4931
  { 255, "End" },
4932
  { 0, NULL}
4933
};
4934
4935
static void
4936
dissect_vendor_bsdp_boot_image(proto_tree *v_tree, tvbuff_t *tvb, unsigned optoff)
4937
1.45k
{
4938
1.45k
  static int * const dhcp_o43_bsdp_attributes_flags[] = {
4939
1.45k
    &hf_dhcp_option43_bsdp_boot_image_attribute_install,
4940
1.45k
    &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
4941
1.45k
    &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
4942
1.45k
    NULL
4943
1.45k
  };
4944
4945
1.45k
  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_BIG_ENDIAN);
4946
1.45k
}
4947
4948
static unsigned
4949
dissect_vendor_bsdp_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4950
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
4951
5.75k
{
4952
5.75k
  unsigned    suboptoff = optoff;
4953
5.75k
  unsigned    attributes_off;
4954
5.75k
  uint8_t     subopt, string_len;
4955
5.75k
  uint8_t     subopt_len, attributes_len;
4956
5.75k
  unsigned    item_len;
4957
5.75k
  proto_tree *o43bsdp_v_tree, *o43bsdp_va_tree, *o43bsdp_vb_tree, *o43bsdp_vc_tree, *o43bsdp_vd_tree;
4958
5.75k
  proto_item *vti, *ti, *tj;
4959
4960
5.75k
  subopt = tvb_get_uint8(tvb, optoff);
4961
5.75k
  suboptoff++;
4962
4963
5.75k
  if (subopt == 0 || subopt == 255) {
4964
    /* Pad (0) and End (255) have implicit length of 1. */
4965
2.60k
    item_len = 1;
4966
3.14k
  } else if (suboptoff >= optend) {
4967
7
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4968
7
                  "Suboption %d: no room left in option for suboption length", subopt);
4969
7
    return (optend);
4970
3.13k
  } else {
4971
3.13k
    subopt_len = tvb_get_uint8(tvb, suboptoff);
4972
3.13k
    item_len = subopt_len + 2;
4973
3.13k
  }
4974
4975
5.74k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_bsdp_suboption,
4976
5.74k
        tvb, optoff, item_len, subopt, "(%d) %s",
4977
5.74k
        subopt, val_to_str_const(subopt, option43_bsdp_suboption_vals, "Unknown"));
4978
5.74k
  if (item_len == 1) {
4979
2.60k
    return (optoff + 1);
4980
2.60k
  }
4981
4982
3.13k
  o43bsdp_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4983
3.13k
  proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4984
3.13k
  suboptoff++;
4985
4986
3.13k
  if (suboptoff+subopt_len > optend) {
4987
52
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4988
52
            "Suboption %d: no room left in option for suboption value", subopt);
4989
52
    return (optend);
4990
52
  }
4991
4992
3.08k
  switch(subopt)
4993
3.08k
  {
4994
282
    case 1:
4995
282
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_type, tvb, suboptoff, subopt_len, ENC_NA);
4996
282
      break;
4997
237
    case 2:
4998
237
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_version, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4999
237
      break;
5000
112
    case 3:
5001
112
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_identifier, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5002
112
      break;
5003
382
    case 4:
5004
382
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_priority, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5005
382
      break;
5006
100
    case 5:
5007
100
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_reply_port, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5008
100
      break;
5009
205
    case 6:
5010
205
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list_path, tvb, suboptoff, subopt_len, ENC_ASCII);
5011
205
      break;
5012
98
    case 7:
5013
98
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_default_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5014
98
      o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
5015
98
      dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, suboptoff);
5016
98
      proto_tree_add_item(o43bsdp_va_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN);
5017
98
      break;
5018
95
    case 8:
5019
95
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_selected_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5020
95
      o43bsdp_vc_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
5021
95
      dissect_vendor_bsdp_boot_image(o43bsdp_vc_tree, tvb, suboptoff);
5022
95
      proto_tree_add_item(o43bsdp_vc_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN);
5023
95
      break;
5024
238
    case 9:
5025
238
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list, tvb, suboptoff, subopt_len, ENC_NA);
5026
238
      attributes_len = subopt_len;
5027
238
      attributes_off = suboptoff;
5028
238
      o43bsdp_vd_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_image_desc_list);
5029
880
      while (attributes_len >= 5) {
5030
642
        string_len = tvb_get_uint8(tvb, attributes_off+4);
5031
642
        if (string_len > 0) {
5032
326
          tj = proto_tree_add_item(o43bsdp_vd_tree, hf_dhcp_option43_bsdp_image_desc, tvb, attributes_off, string_len+5, ENC_NA);
5033
326
          o43bsdp_vb_tree = proto_item_add_subtree(tj, ett_dhcp_o43_bsdp_image_desc);
5034
326
          dissect_vendor_bsdp_boot_image(o43bsdp_vb_tree, tvb, attributes_off);
5035
326
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, attributes_off+2, 2, ENC_BIG_ENDIAN);
5036
326
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name_len, tvb, attributes_off+4, 1, ENC_BIG_ENDIAN);
5037
326
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name, tvb, attributes_off+5, string_len, ENC_UTF_8);
5038
326
        }
5039
642
        attributes_off += 5 + string_len;
5040
642
        attributes_len -= 5 + string_len;
5041
642
      }
5042
238
      break;
5043
249
    case 10:
5044
249
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_netboot_firmware, tvb, suboptoff, subopt_len, ENC_NA);
5045
249
      break;
5046
202
    case 11:
5047
202
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_attributes_filter_list, tvb, suboptoff, subopt_len, ENC_NA);
5048
202
      attributes_len = subopt_len;
5049
202
      attributes_off = suboptoff;
5050
202
      o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_attributes);
5051
1.14k
      while (attributes_len >= 2) {
5052
946
        dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, attributes_off);
5053
946
        attributes_off+=2;
5054
946
        attributes_len-=2;
5055
946
      }
5056
202
      break;
5057
91
    case 12:
5058
91
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_size, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5059
91
      break;
5060
3.08k
  }
5061
5062
3.06k
  optoff += item_len;
5063
3.06k
  return optoff;
5064
3.08k
}
5065
5066
static bool
5067
dissect_apple_bsdp_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5068
1.34k
{
5069
1.34k
  unsigned offset = 0;
5070
1.34k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5071
1.34k
  proto_tree* vendor_tree;
5072
5073
1.34k
  if ((option_data->vendor_class_id == NULL) ||
5074
754
    (strncmp((const char*)option_data->vendor_class_id, APPLE_BSDP_SERVER, strlen(APPLE_BSDP_SERVER)) != 0))
5075
1.24k
    return false;
5076
5077
  /* Apple BSDP */
5078
94
  proto_item_append_text(tree, " (Boot Server Discovery Protocol (BSDP))");
5079
94
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5080
5081
5.84k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5082
5.75k
    offset = dissect_vendor_bsdp_suboption(pinfo, tree, vendor_tree,
5083
5.75k
      tvb, offset, tvb_reported_length(tvb));
5084
5.75k
  }
5085
5086
94
  return true;
5087
1.34k
}
5088
5089
/* Cisco Vendor Specific Information */
5090
5091
/*
5092
        {  1, "1" },            * D,R: 03 *
5093
        {  2, "2" },            * D,R: 01 *
5094
        {  3, "3" },            * D,R: 00 01 # O,A: 00 02 *
5095
        {  4, "Node ID" },      * O,A: 00 00 00 ca *
5096
        {  5, "5" },            * O,A: 01 *
5097
        {  6, "6" },            * D,R: 01 # O,A: 01 *
5098
        {  7, "Model" },        * D,R: N9K-C9336PQ *
5099
        {  8, "APIC UUID" },    * O,A: 09bced36-69f1-11e6-96ce-8baf09371338 *
5100
        {  9, "Fabricname" },   * O,A: ams-fab1 *
5101
        { 10, "10" },           * D,R: 00 00 00 01 *
5102
        { 11, "SerialNo" },     * D,R: SAL1926J4QW *
5103
        { 12, "Client Int" },   * D,O: eth1/20.20 # R,A: eth1/20.20 *
5104
*/
5105
static const value_string option43_cisco_suboption_vals[] = {
5106
  {  1, "Unk-1 (Node role?)" },   /* uint8 */
5107
  {  2, "Unk-2 (Spine level?)" },   /* uint8 */
5108
  {  3, "Unk-3 (Pod ID?)" },    /* uint16 */
5109
  {  4, "Node ID" },      /* uint32 */
5110
  {  5, "Unk-5" },      /* uint8 */
5111
  {  6, "Unk-6" },      /* uint8 */
5112
  {  7, "Model" },      /* String */
5113
  {  8, "APIC UUID" },      /* String */
5114
  {  9, "Fabricname" },     /* String */
5115
  { 10, "Unk-10" },     /* uint32 */
5116
  { 11, "SerialNo" },     /* String */
5117
  { 12, "Interfacename" },    /* String */
5118
5119
  { 0, NULL}
5120
};
5121
5122
static unsigned
5123
dissect_vendor_cisco_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5124
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5125
580
{
5126
580
  unsigned    suboptoff = optoff;
5127
580
  uint8_t     subopt;
5128
580
  uint8_t     subopt_len;
5129
580
  unsigned    item_len;
5130
580
  proto_tree *o43cisco_v_tree;
5131
580
  proto_item *vti;
5132
5133
580
  subopt = tvb_get_uint8(tvb, optoff);
5134
580
  suboptoff++;
5135
5136
580
  if (suboptoff >= optend) {
5137
1
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5138
1
                  "Suboption %d: No room left in option for suboption length", subopt);
5139
1
    return (optend);
5140
579
  } else {
5141
579
    subopt_len = tvb_get_uint8(tvb, suboptoff);
5142
579
    item_len = subopt_len + 2;
5143
579
  }
5144
5145
579
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cisco_suboption,
5146
579
        tvb, optoff, item_len, subopt, "(%d) %s",
5147
579
        subopt, val_to_str_const(subopt, option43_cisco_suboption_vals, "Unknown"));
5148
5149
579
  o43cisco_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5150
579
  proto_tree_add_item(o43cisco_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5151
579
  suboptoff++;
5152
5153
579
  if (suboptoff+subopt_len > optend) {
5154
17
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5155
17
            "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5156
17
    return (optend);
5157
17
  }
5158
5159
562
  switch(subopt)
5160
562
  {
5161
12
    case 1:
5162
12
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown1, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5163
12
      break;
5164
4
    case 2:
5165
4
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown2, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5166
4
      break;
5167
16
    case 3:
5168
16
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown3, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5169
16
      break;
5170
122
    case 4:
5171
122
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_nodeid, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5172
122
      break;
5173
0
    case 5:
5174
0
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown5, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5175
0
      break;
5176
17
    case 6:
5177
17
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown6, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5178
17
      break;
5179
0
    case 7:
5180
0
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_model, tvb, suboptoff, subopt_len, ENC_ASCII);
5181
0
      break;
5182
7
    case 8:
5183
7
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_apicuuid, tvb, suboptoff, subopt_len, ENC_ASCII);
5184
7
      break;
5185
2
    case 9:
5186
2
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_fabricname, tvb, suboptoff, subopt_len, ENC_ASCII);
5187
2
      break;
5188
30
    case 10:
5189
30
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown10, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5190
30
      break;
5191
6
    case 11:
5192
6
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_serialno, tvb, suboptoff, subopt_len, ENC_ASCII);
5193
6
      break;
5194
2
    case 12:
5195
2
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_clientint, tvb, suboptoff, subopt_len, ENC_ASCII);
5196
2
      break;
5197
344
    default:
5198
344
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5199
562
  }
5200
5201
562
  optoff += item_len;
5202
562
  return optoff;
5203
562
}
5204
5205
static bool
5206
dissect_cisco_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5207
1.20k
{
5208
1.20k
  unsigned offset = 0;
5209
1.20k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5210
1.20k
  proto_tree* vendor_tree;
5211
5212
1.20k
  if ((option_data->vendor_class_id == NULL) ||
5213
632
    (strncmp((const char*)option_data->vendor_class_id, CISCO_VCID, strlen(CISCO_VCID)) != 0))
5214
1.18k
    return false;
5215
5216
  /* Cisco ACI Fabric*/
5217
20
  proto_item_append_text(tree, " (Cisco ACI Fabric)");
5218
20
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5219
5220
600
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5221
580
    offset = dissect_vendor_cisco_suboption(pinfo, tree, vendor_tree,
5222
580
      tvb, offset, tvb_reported_length(tvb));
5223
580
  }
5224
5225
20
  return true;
5226
1.20k
}
5227
5228
/* Aerohive (Extremenetworks) Vendor Specific Information */
5229
5230
static const value_string option43_aerohive_suboption_vals[] = {
5231
  {  225, "XiqHostname" },  /* String */
5232
  {  226, "XiqIpAddress" }, /* Ipv4address */
5233
5234
  { 0, NULL}
5235
};
5236
5237
static unsigned
5238
dissect_vendor_aerohive_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5239
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5240
244
{
5241
244
  unsigned    suboptoff = optoff;
5242
244
  uint8_t     subopt;
5243
244
  uint8_t     subopt_len;
5244
244
  unsigned    item_len;
5245
244
  proto_tree *o43aerohive_v_tree;
5246
244
  proto_item *vti;
5247
5248
244
  subopt = tvb_get_uint8(tvb, optoff);
5249
244
  suboptoff++;
5250
5251
244
  if (suboptoff >= optend) {
5252
1
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5253
1
                  "Suboption %d: No room left in option for suboption length", subopt);
5254
1
    return (optend);
5255
243
  } else {
5256
243
    subopt_len = tvb_get_uint8(tvb, suboptoff);
5257
243
    item_len = subopt_len + 2;
5258
243
  }
5259
5260
243
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_aerohive_suboption,
5261
243
        tvb, optoff, item_len, subopt, "(%d) %s",
5262
243
        subopt, val_to_str_const(subopt, option43_aerohive_suboption_vals, "Unknown"));
5263
5264
243
  o43aerohive_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5265
243
  proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5266
243
  suboptoff++;
5267
5268
243
  if (suboptoff+subopt_len > optend) {
5269
10
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5270
10
            "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5271
10
    return (optend);
5272
10
  }
5273
5274
233
  switch(subopt)
5275
233
  {
5276
0
    case 225:
5277
0
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqhostname, tvb, suboptoff, subopt_len, ENC_ASCII);
5278
0
      break;
5279
0
    case 226:
5280
0
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqipaddress, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5281
0
      break;
5282
233
    default:
5283
233
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5284
233
  }
5285
5286
233
  optoff += item_len;
5287
233
  return optoff;
5288
233
}
5289
5290
static bool
5291
dissect_aerohive_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5292
1.17k
{
5293
1.17k
  unsigned offset = 0;
5294
1.17k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5295
1.17k
  proto_tree* vendor_tree;
5296
5297
1.17k
  if ((option_data->vendor_class_id == NULL) ||
5298
604
    (strncmp((const char*)option_data->vendor_class_id, AEROHIVE_VCID, strlen(AEROHIVE_VCID)) != 0))
5299
1.16k
    return false;
5300
5301
  /* Cisco ACI Fabric*/
5302
12
  proto_item_append_text(tree, " (Aerohive)");
5303
12
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5304
5305
256
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5306
244
    offset = dissect_vendor_aerohive_suboption(pinfo, tree, vendor_tree,
5307
244
      tvb, offset, tvb_reported_length(tvb));
5308
244
  }
5309
5310
12
  return true;
5311
1.17k
}
5312
5313
static unsigned
5314
dissect_vendor_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5315
         tvbuff_t *tvb, uint32_t optoff, uint32_t optend)
5316
636
{
5317
636
  uint32_t    suboptoff = optoff;
5318
636
  uint8_t     subopt;
5319
636
  uint32_t    subopt_len;
5320
636
  proto_item *item;
5321
636
  proto_tree *sub_tree;
5322
5323
636
  item = proto_tree_add_item_ret_uint8(v_tree, hf_dhcp_vendor_unknown_suboption, tvb, optoff, 1, ENC_NA, &subopt);
5324
5325
636
  suboptoff+=1;
5326
5327
636
  if (suboptoff >= optend) {
5328
148
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5329
148
                  "Suboption %d: no room left in option for suboption length", subopt);
5330
148
    return (optend);
5331
148
  }
5332
5333
488
  sub_tree = proto_item_add_subtree(item, ett_dhcp_option125_suboption);
5334
488
  proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
5335
488
  suboptoff++;
5336
5337
488
  if (suboptoff+subopt_len > optend) {
5338
154
    expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
5339
154
            "Suboption %d: no room left in option for suboption value", subopt);
5340
154
    return (optend);
5341
154
  }
5342
5343
334
  proto_tree_add_item(sub_tree, hf_dhcp_suboption_data, tvb, suboptoff, subopt_len, ENC_NA);
5344
334
  suboptoff+= subopt_len;
5345
5346
334
  return suboptoff;
5347
5348
488
}
5349
5350
static int
5351
dissect_dhcpopt_vi_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5352
422
{
5353
422
  uint32_t offset = 0;
5354
422
  uint32_t enterprise = 0;
5355
422
  uint32_t s_end = 0;
5356
422
  uint32_t option_data_len = 0;
5357
422
  proto_item *vti;
5358
422
  proto_tree *e_tree;
5359
5360
2.32k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
5361
5362
2.02k
    vti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option125_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
5363
2.02k
    e_tree = proto_item_add_subtree(vti, ett_dhcp_option);
5364
2.02k
    offset += 4;
5365
5366
2.02k
    proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option125_length, tvb, offset, 1, ENC_NA, &option_data_len);
5367
2.02k
    offset += 1;
5368
5369
2.02k
    s_end = offset + option_data_len;
5370
2.02k
    if ( tvb_reported_length_remaining(tvb, offset) < option_data_len ) {
5371
117
      expert_add_info_format(pinfo, vti, &ei_dhcp_option125_enterprise_malformed, "no room left in option for enterprise %u data", enterprise);
5372
117
      break;
5373
117
    }
5374
5375
7.84k
    while (offset < s_end) {
5376
5.93k
      tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
5377
5.93k
      int bytes_dissected = dissector_try_uint(dhcp_enterprise_specific_table, enterprise, enterprise_tvb, pinfo, e_tree);
5378
5.93k
      if (bytes_dissected == 0) {
5379
636
        offset = dissect_vendor_generic_suboption(pinfo, vti, e_tree, tvb, offset, s_end);
5380
5.29k
      } else{
5381
5.29k
        offset += bytes_dissected;
5382
5.29k
      }
5383
5.93k
    }
5384
1.90k
  }
5385
5386
422
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
5387
149
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
5388
149
  }
5389
5390
422
  return tvb_captured_length(tvb);
5391
422
}
5392
5393
static const value_string option43_alcatel_suboption_vals[] = {
5394
  {  0, "Padding" },
5395
  { 58, "Voice VLAN ID" },
5396
  { 64, "Spatial Redundancy TFTP1" },
5397
  { 65, "Spatial Redundancy TFTP2" },
5398
  { 66, "Application Type" },
5399
  { 67, "SIP URL" },
5400
  { 255, "Alcatel-Lucent End" },
5401
  { 0, NULL}
5402
};
5403
5404
static const value_string option43_alcatel_app_type_vals[] = {
5405
  { 0, "NOE" },
5406
  { 1, "SIP" },
5407
  { 0, NULL}
5408
};
5409
5410
/* If an Alcatel-Lucent Option 43 suboption has a known fixed length,
5411
 * return that length. Returns 0 for variable length options and unknown
5412
 * options.
5413
 */
5414
static unsigned
5415
get_alcatel_suboption_len(unsigned subopt)
5416
1.38k
{
5417
1.38k
  switch(subopt) {
5418
192
  case 58:  /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5419
192
    return 2;
5420
194
  case 64:  /* 0x40 - Alcatel-Lucent TFTP1 */
5421
194
    return 4;
5422
231
  case 65:  /* 0x41 - Alcatel-Lucent TFTP2 */
5423
231
    return 4;
5424
156
  case 66:  /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5425
156
    return 1;
5426
0
  case 0:   /* Alcatel-Lucent Padding */
5427
207
  case 67:  /* 0x43 - Alcatel-Lucent SIP URL */
5428
207
  case 255: /* Alcatel-Lucent End */
5429
614
  default:
5430
614
    return 0;
5431
1.38k
  }
5432
1.38k
}
5433
5434
static unsigned
5435
dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5436
         tvbuff_t *tvb, unsigned optoff, unsigned optend)
5437
1.19k
{
5438
1.19k
  unsigned    suboptoff = optoff;
5439
1.19k
  uint8_t     subopt;
5440
1.19k
  uint8_t     subopt_len;
5441
1.19k
  proto_item *vti;
5442
1.19k
  proto_tree *o43alcatel_v_tree;
5443
5444
1.19k
  subopt = tvb_get_uint8(tvb, optoff);
5445
1.19k
  suboptoff++;
5446
5447
1.19k
  if (subopt == 0) {
5448
783
    proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
5449
783
    return (suboptoff);
5450
783
  } else if (subopt == 255) { /* End Option */
5451
2
    proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
5452
    /* Make sure we skip any junk left this option */
5453
2
    return (optend);
5454
2
  }
5455
5456
409
  if (suboptoff >= optend) {
5457
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5458
0
                  "Suboption %d: no room left in option for suboption length", subopt);
5459
0
    return (optend);
5460
0
  }
5461
5462
409
  subopt_len = tvb_get_uint8(tvb, suboptoff);
5463
409
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_alcatel_suboption,
5464
409
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5465
409
        subopt, val_to_str_const(subopt, option43_alcatel_suboption_vals, "Unknown"));
5466
5467
409
  o43alcatel_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5468
409
  proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5469
409
  suboptoff++;
5470
5471
409
  if (suboptoff+subopt_len > optend) {
5472
0
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5473
0
            "Suboption %d: no room left in option for suboption value", subopt);
5474
0
    return (optend);
5475
0
  }
5476
5477
409
  unsigned subopt_len_expected = get_alcatel_suboption_len(subopt);
5478
409
  if (subopt_len_expected && subopt_len_expected != subopt_len) {
5479
0
    expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't %u", subopt_len_expected);
5480
0
    return optend;
5481
0
  }
5482
409
  switch (subopt)
5483
409
  {
5484
83
  case 58: /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5485
83
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_vlan_id, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
5486
83
    break;
5487
58
  case 64: /* 0x40 - Alcatel-Lucent TFTP1 */
5488
58
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp1, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5489
58
    break;
5490
88
  case 65: /* 0x41 - Alcatel-Lucent TFTP2 */
5491
88
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp2, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5492
88
    break;
5493
68
  case 66: /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5494
68
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_app_type, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5495
68
    break;
5496
95
  case 67: /* 0x43 - Alcatel-Lucent SIP URL */
5497
95
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_sip_url, tvb, suboptoff, subopt_len, ENC_ASCII);
5498
95
    break;
5499
17
  default:
5500
17
    expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
5501
17
    return optend;
5502
409
  }
5503
5504
392
  optoff += (subopt_len + 2);
5505
392
  return optoff;
5506
409
}
5507
5508
static bool
5509
dissect_alcatel_lucent_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
5510
1.26k
{
5511
1.26k
  unsigned offset = 0;
5512
1.26k
  uint8_t s_option;
5513
1.26k
  proto_tree* vendor_tree;
5514
5515
1.26k
  if (tvb_reported_length(tvb) < 1)
5516
437
    return false;
5517
5518
828
  s_option = tvb_get_uint8(tvb, offset);
5519
828
  if ((s_option==58 || s_option==64 || s_option==65
5520
733
    || s_option==66 || s_option==67)
5521
152
    && test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), get_alcatel_suboption_len)) {
5522
5523
    /* Alcatel-Lucent DHCP Extensions */
5524
37
    proto_item_append_text(tree, " (Alcatel-Lucent)");
5525
37
    vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5526
5527
1.23k
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
5528
1.19k
      offset = dissect_vendor_alcatel_suboption(pinfo, tree, vendor_tree,
5529
1.19k
        tvb, offset, tvb_reported_length(tvb));
5530
1.19k
    }
5531
37
    return true;
5532
37
  }
5533
5534
791
  return false;
5535
828
}
5536
5537
static const value_string option63_suboption_vals[] = {
5538
  { 1, "NWIP does not exist on subnet" },
5539
  { 2, "NWIP exists in options area" },
5540
  { 3, "NWIP exists in sname/file" },
5541
  { 4, "NWIP exists, but too big" },
5542
  { 5, "Broadcast for nearest Netware server" },
5543
  { 6, "Preferred DSS server" },
5544
  { 7, "Nearest NWIP server" },
5545
  { 8, "Autoretries" },
5546
  { 9, "Autoretry delay, secs" },
5547
  { 10, "Support NetWare/IP v1.1" },
5548
  { 11, "Primary DSS" },
5549
  { 0, NULL }
5550
};
5551
5552
static unsigned
5553
dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5554
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5555
1.81k
{
5556
1.81k
  unsigned    suboptoff = optoff;
5557
1.81k
  uint8_t     subopt, subopt_len;
5558
1.81k
  proto_tree *o63_v_tree;
5559
1.81k
  proto_item *vti, *ti;
5560
5561
1.81k
  static const struct basic_types_hfs default_hfs = {
5562
1.81k
    NULL,
5563
1.81k
    &hf_dhcp_option63_value_ip_address,
5564
1.81k
    &hf_dhcp_option63_value_ip_address,
5565
1.81k
    NULL,
5566
1.81k
    &hf_dhcp_option63_value_boolean,
5567
1.81k
    &hf_dhcp_option63_value_8,
5568
1.81k
    NULL,
5569
1.81k
    NULL,
5570
1.81k
    NULL,
5571
1.81k
    NULL,
5572
1.81k
    NULL
5573
1.81k
  };
5574
5575
1.81k
  static const struct opt_info o63_opt[]= {
5576
1.81k
    /* 0 */ {"",none,NULL},
5577
1.81k
    /* 1 */ {"NWIP does not exist on subnet",presence,NULL},
5578
1.81k
    /* 2 */ {"NWIP exists in options area",presence,NULL},
5579
1.81k
    /* 3 */ {"NWIP exists in sname/file",presence,NULL},
5580
1.81k
    /* 4 */ {"NWIP exists, but too big",presence,NULL},
5581
1.81k
    /* 5 */ {"Broadcast for nearest Netware server",val_boolean, &hf_dhcp_option63_broadcast},
5582
1.81k
    /* 6 */ {"Preferred DSS server",ipv4_list,&hf_dhcp_option63_preferred_dss_server},
5583
1.81k
    /* 7 */ {"Nearest NWIP server",ipv4_list,&hf_dhcp_option63_nearest_nwip_server},
5584
1.81k
    /* 8 */ {"Autoretries",val_u_byte,&hf_dhcp_option63_autoretries},
5585
1.81k
    /* 9 */ {"Autoretry delay, secs",val_u_byte,&hf_dhcp_option63_autoretry_delay},
5586
1.81k
    /* 10*/ {"Support NetWare/IP v1.1",val_boolean,&hf_dhcp_option63_support_netware_v1_1},
5587
1.81k
    /* 11*/ {"Primary DSS",ipv4,&hf_dhcp_option63_primary_dss}
5588
1.81k
  };
5589
5590
1.81k
  subopt = tvb_get_uint8(tvb, optoff);
5591
1.81k
  suboptoff++;
5592
5593
1.81k
  if (suboptoff >= optend) {
5594
18
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5595
18
                  "Suboption %d: no room left in option for suboption length", subopt);
5596
18
    return (optend);
5597
18
  }
5598
5599
1.79k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
5600
1.79k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option63_suboption,
5601
1.79k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5602
1.79k
        subopt, val_to_str_const(subopt, option63_suboption_vals, "Unknown"));
5603
5604
1.79k
  o63_v_tree = proto_item_add_subtree(vti, ett_dhcp_option63_suboption);
5605
1.79k
  proto_tree_add_item(o63_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5606
1.79k
  suboptoff++;
5607
5608
1.79k
  ti = proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5609
1.79k
  proto_item_set_hidden(ti);
5610
5611
1.79k
  if (subopt < array_length(o63_opt)) {
5612
1.53k
    if (dhcp_handle_basic_types(pinfo, o63_v_tree, vti, tvb, o63_opt[subopt].ftype,
5613
1.53k
              suboptoff, subopt_len, o63_opt[subopt].phf, &default_hfs) == 0) {
5614
1.40k
      switch(o63_opt[subopt].ftype)
5615
1.40k
      {
5616
479
      case presence:
5617
479
        if (subopt_len != 0) {
5618
237
          expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 0");
5619
237
        }
5620
479
        break;
5621
921
      default:
5622
921
        if (o63_opt[subopt].phf == NULL)
5623
428
          proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5624
921
        break;
5625
1.40k
      }
5626
1.40k
    }
5627
1.53k
  }
5628
1.79k
  optoff += (subopt_len + 2);
5629
1.79k
  return optoff;
5630
1.79k
}
5631
5632
static int
5633
dissect_dhcpopt_netware_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5634
276
{
5635
276
  unsigned offset = 0;
5636
5637
2.09k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5638
1.81k
    offset = dissect_netware_ip_suboption(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
5639
1.81k
  }
5640
5641
276
  return tvb_captured_length(tvb);
5642
276
}
5643
5644
static const value_string option125_tr111_suboption_vals[] = {
5645
  { 1, "DeviceManufacturerOUI" },
5646
  { 2, "DeviceSerialNumber" },
5647
  { 3, "DeviceProductClass" },
5648
  { 4, "GatewayManufacturerOUI" },
5649
  { 5, "GatewaySerialNumber" },
5650
  { 6, "GatewayProductClass" },
5651
  { 0, NULL }
5652
};
5653
5654
static int
5655
dissect_vendor_tr111_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5656
2.44k
{
5657
2.44k
  unsigned offset = 0;
5658
2.44k
  proto_tree *o125_v_tree;
5659
2.44k
  proto_item *vti, *ti;
5660
2.44k
  uint8_t subopt, subopt_len;
5661
5662
2.44k
  static const struct basic_types_hfs default_hfs = {
5663
2.44k
    NULL,
5664
2.44k
    NULL,
5665
2.44k
    NULL,
5666
2.44k
    &hf_dhcp_option125_value_stringz,
5667
2.44k
    NULL,
5668
2.44k
    NULL,
5669
2.44k
    NULL,
5670
2.44k
    NULL,
5671
2.44k
    NULL,
5672
2.44k
    NULL,
5673
2.44k
    NULL
5674
2.44k
  };
5675
5676
  /* Reference: TR-111 DHCP Option 125 Sub-Option Data Fields
5677
     Page 10.
5678
  */
5679
5680
2.44k
  static const struct opt_info o125_tr111_opt[]= {
5681
2.44k
    /* 0 */ {"nop", special, NULL},  /* dummy */
5682
2.44k
    /* 1 */ {"DeviceManufacturerOUI",  oui,    &hf_dhcp_option125_tr111_device_manufacturer_oui},
5683
2.44k
    /* 2 */ {"DeviceSerialNumber",     string, &hf_dhcp_option125_tr111_device_serial_number},
5684
2.44k
    /* 3 */ {"DeviceProductClass",     string, &hf_dhcp_option125_tr111_device_product_class},
5685
2.44k
    /* 4 */ {"GatewayManufacturerOUI", string, &hf_dhcp_option125_tr111_gateway_manufacturer_oui},
5686
2.44k
    /* 5 */ {"GatewaySerialNumber",    string, &hf_dhcp_option125_tr111_gateway_serial_number},
5687
2.44k
    /* 6 */ {"GatewayProductClass",    string, &hf_dhcp_option125_tr111_gateway_product_class},
5688
2.44k
  };
5689
5690
2.44k
  subopt = tvb_get_uint8(tvb, offset);
5691
2.44k
  offset++;
5692
5693
2.44k
  if (tvb_reported_length_remaining(tvb, offset) < 1) {
5694
21
    expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5695
21
               "Suboption %d: no room left in option for suboption length", subopt);
5696
21
    return offset;
5697
21
  }
5698
5699
2.41k
  subopt_len = tvb_get_uint8(tvb, offset);
5700
2.41k
  vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_tr111_suboption,
5701
2.41k
        tvb, offset, subopt_len+2, subopt, "(%d) %s",
5702
2.41k
        subopt, val_to_str_const(subopt, option125_tr111_suboption_vals, "Unknown"));
5703
5704
2.41k
  o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_tr111_suboption);
5705
2.41k
  proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5706
2.41k
  offset++;
5707
5708
2.41k
  if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5709
671
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5710
671
            "Suboption %d: no room left in option for suboption value", subopt);
5711
671
    return offset;
5712
671
  }
5713
5714
1.74k
  ti = proto_tree_add_item(tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5715
1.74k
  proto_item_set_hidden(ti);
5716
5717
1.74k
  if (subopt < array_length(o125_tr111_opt)) {
5718
1.28k
    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) {
5719
1.19k
      if (o125_tr111_opt[subopt].ftype == special) {
5720
517
        if (o125_tr111_opt[subopt].phf != NULL)
5721
0
           proto_tree_add_item(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5722
517
        else
5723
517
           proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5724
517
      }
5725
676
      else if (o125_tr111_opt[subopt].ftype == oui) {
5726
        /* Get hex OUI number.  Expecting 6 characters. */
5727
510
        uint32_t oui_number;
5728
510
        tvb_get_string_uint(tvb, offset, subopt_len, ENC_STR_HEX, &oui_number, NULL);
5729
        /* Add item using oui_vals */
5730
510
        proto_tree_add_uint(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, oui_number);
5731
510
      } else if (o125_tr111_opt[subopt].phf == NULL)
5732
0
        proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5733
1.19k
    }
5734
1.28k
  }
5735
5736
1.74k
  return subopt_len + 2;
5737
2.41k
}
5738
5739
static const value_string option125_cl_suboption_vals[] = {
5740
  { 1, "Option Request" },
5741
  { 2, "TFTP Server Addresses" },
5742
  { 3, "eRouter Container Option" },
5743
  { 4, "MIB Environment Indicator Option" },
5744
  { 5, "Modem Capabilities" },
5745
  { 0, NULL }
5746
};
5747
5748
static const value_string pkt_mib_env_ind_opt_vals[] = {
5749
  { 0x00, "Reserved" },
5750
  { 0x01, "CableLabs" },
5751
  { 0x02, "IETF" },
5752
  { 0x03, "EuroCableLabs" },
5753
  { 0, NULL }
5754
};
5755
5756
static int
5757
dissect_vendor_cl_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5758
2.85k
{
5759
2.85k
  unsigned offset = 0;
5760
2.85k
  uint8_t subopt, subopt_len;
5761
2.85k
  proto_tree *o125_v_tree;
5762
2.85k
  proto_item *vti;
5763
5764
2.85k
  static const struct basic_types_hfs default_hfs = {
5765
2.85k
    &hf_dhcp_option125_value,
5766
2.85k
    &hf_dhcp_option125_value_ip_address,
5767
2.85k
    &hf_dhcp_option125_value_ip_address,
5768
2.85k
    &hf_dhcp_option125_value_stringz,
5769
2.85k
    NULL,
5770
2.85k
    &hf_dhcp_option125_value_8,
5771
2.85k
    &hf_dhcp_option125_value_16,
5772
2.85k
    NULL,
5773
2.85k
    NULL,
5774
2.85k
    NULL,
5775
2.85k
    NULL
5776
2.85k
  };
5777
5778
2.85k
  static const struct opt_info o125_cl_opt[]= {
5779
2.85k
    /* 0 */ {"nop", special, NULL},  /* dummy */
5780
2.85k
    /* 1 */ {"Option Request = ", bytes, &hf_dhcp_option125_cl_option_request},
5781
2.85k
    /* 2 */ {"TFTP Server Addresses : ", ipv4_list, &hf_dhcp_option125_cl_tftp_server_addresses},
5782
2.85k
    /* 3 */ {"eRouter Container Option : ", bytes, &hf_dhcp_option125_cl_erouter_container_option},
5783
2.85k
    /* 4 */ {"MIB Environment Indicator Option = ", val_u_byte, &hf_dhcp_option125_cl_mib_environment_indicator_option},
5784
2.85k
    /* 5 */ {"Modem Capabilities : ", special, &hf_dhcp_option125_cl_modem_capabilities},
5785
2.85k
  };
5786
5787
2.85k
  subopt = tvb_get_uint8(tvb, offset);
5788
2.85k
  offset++;
5789
5790
2.85k
  if (tvb_reported_length_remaining(tvb, offset) < 1) {
5791
34
    expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5792
34
                  "Suboption %d: no room left in option for suboption length", subopt);
5793
34
    return offset;
5794
34
  }
5795
5796
2.82k
  subopt_len = tvb_get_uint8(tvb, offset);
5797
2.82k
  vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_cl_suboption,
5798
2.82k
        tvb, offset, subopt_len+2, subopt, "(%d) %s",
5799
2.82k
        subopt, val_to_str_const(subopt, option125_cl_suboption_vals, "Unknown"));
5800
5801
2.82k
  o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_cl_suboption);
5802
2.82k
  proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5803
2.82k
  offset++;
5804
5805
2.82k
  if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5806
662
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5807
662
            "Suboption %d: no room left in option for suboption value", subopt);
5808
662
    return offset;
5809
662
  }
5810
5811
2.16k
  if (subopt < array_length(o125_cl_opt)) {
5812
1.60k
    if (dhcp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_cl_opt[subopt].ftype,
5813
1.60k
              offset, subopt_len, o125_cl_opt[subopt].phf, &default_hfs) == 0) {
5814
5815
1.37k
      switch(o125_cl_opt[subopt].ftype) {
5816
1.12k
      case special:
5817
1.12k
        if (o125_cl_opt[subopt].phf != NULL)
5818
677
          proto_tree_add_item(o125_v_tree, *o125_cl_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5819
447
        else
5820
447
          proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5821
1.12k
        switch(subopt){
5822
674
          case 5: /* Modem Capabilities */
5823
674
            dissect_docsis_cm_cap(pinfo, o125_v_tree, tvb, offset-2, subopt_len+2, true);
5824
674
          break;
5825
1.12k
        }
5826
988
        break;
5827
988
      default:
5828
249
        if (o125_cl_opt[subopt].phf == NULL)
5829
0
          proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5830
249
        break;
5831
1.37k
      }
5832
1.37k
    }
5833
1.60k
  }
5834
5835
2.02k
  return subopt_len + 2;
5836
2.16k
}
5837
5838
/* PacketCable Multimedia Terminal Adapter device capabilities (option 60).
5839
   Ref: PKT-SP-I05-021127 sections 8.2 and 10 */
5840
5841
148
#define PKT_MDC_TLV_OFF 10
5842
5843
5844
/* These are ASCII-encoded hexadecimal digits.  We use the raw hex equivalent for
5845
   convenience. */
5846
33
#define PKT_MDC_VERSION     0x3031  /* "01" */
5847
31
#define PKT_MDC_TEL_END     0x3032  /* "02" */
5848
24
#define PKT_MDC_TGT     0x3033  /* "03" */
5849
57
#define PKT_MDC_HTTP_ACC    0x3034  /* "04" */
5850
71
#define PKT_MDC_SYSLOG      0x3035  /* "05" */
5851
97
#define PKT_MDC_NCS     0x3036  /* "06" */
5852
122
#define PKT_MDC_PRI_LINE    0x3037  /* "07" */
5853
0
#define PKT_MDC_VENDOR_TLV    0x3038  /* "08" */
5854
138
#define PKT_MDC_NVRAM_STOR    0x3039  /* "09" */
5855
162
#define PKT_MDC_PROV_REP    0x3041  /* "0A" */
5856
218
#define PKT_MDC_PROV_REP_LC   0x3061  /* "0a" */
5857
42
#define PKT_MDC_SUPP_CODECS   0x3042  /* "0B" */
5858
96
#define PKT_MDC_SUPP_CODECS_LC    0x3062  /* "0b" */
5859
246
#define PKT_MDC_SILENCE     0x3043  /* "0C" */
5860
325
#define PKT_MDC_SILENCE_LC    0x3063  /* "0c" */
5861
409
#define PKT_MDC_ECHO_CANCEL   0x3044  /* "0D" */
5862
434
#define PKT_MDC_ECHO_CANCEL_LC    0x3064  /* "0d" */
5863
472
#define PKT_MDC_RSVP      0x3045  /* "0E" */
5864
529
#define PKT_MDC_RSVP_LC     0x3065  /* "0e" */
5865
554
#define PKT_MDC_UGS_AD      0x3046  /* "0F" */
5866
667
#define PKT_MDC_UGS_AD_LC   0x3066  /* "0f" */
5867
46
#define PKT_MDC_IF_INDEX    0x3130  /* "10" */
5868
703
#define PKT_MDC_FLOW_LOG    0x3131  /* "11" */
5869
2.22k
#define PKT_MDC_PROV_FLOWS    0x3132  /* "12" */
5870
/* PacketCable 1.5: */
5871
28
#define PKT_MDC_T38_VERSION   0x3133  /* "13" */
5872
40
#define PKT_MDC_T38_EC      0x3134  /* "14" */
5873
746
#define PKT_MDC_RFC2833_DTMF    0x3135  /* "15" */
5874
790
#define PKT_MDC_VOICE_METRICS   0x3136  /* "16" */
5875
1.94k
#define PKT_MDC_MIBS      0x3137  /* "17" */
5876
810
#define PKT_MDC_MGPI      0x3138  /* "18" */
5877
859
#define PKT_MDC_V152      0x3139  /* "19" */
5878
898
#define PKT_MDC_CBS     0x3141  /* "1A" */
5879
926
#define PKT_MDC_CBS_LC      0x3161  /* "1a" */
5880
5881
static const value_string pkt_mdc_type_vals[] = {
5882
  { PKT_MDC_VERSION,    "PacketCable Version" },
5883
  { PKT_MDC_TEL_END,    "Number Of Telephony Endpoints" },
5884
  { PKT_MDC_TGT,      "TGT Support" },
5885
  { PKT_MDC_HTTP_ACC,   "HTTP Download File Access Method Support" },
5886
  { PKT_MDC_SYSLOG,   "MTA-24 Event SYSLOG Notification Support" },
5887
  { PKT_MDC_NCS,      "NCS Service Flow Support" },
5888
  { PKT_MDC_PRI_LINE,   "Primary Line Support" },
5889
  { PKT_MDC_VENDOR_TLV,   "Vendor Specific TLV Type(s)" },
5890
  { PKT_MDC_NVRAM_STOR,   "NVRAM Ticket/Session Keys Storage Support" },
5891
  { PKT_MDC_PROV_REP,   "Provisioning Event Reporting Support" },
5892
  { PKT_MDC_PROV_REP_LC,    "Provisioning Event Reporting Support" },
5893
  { PKT_MDC_SUPP_CODECS,    "Supported CODEC(s)" },
5894
  { PKT_MDC_SUPP_CODECS_LC, "Supported CODEC(s)" },
5895
  { PKT_MDC_SILENCE,    "Silence Suppression Support" },
5896
  { PKT_MDC_SILENCE_LC,   "Silence Suppression Support" },
5897
  { PKT_MDC_ECHO_CANCEL,    "Echo Cancellation Support" },
5898
  { PKT_MDC_ECHO_CANCEL_LC, "Echo Cancellation Support" },
5899
  { PKT_MDC_RSVP,     "RSVP Support/ Reserved" },
5900
  { PKT_MDC_RSVP_LC,    "RSVP Support/ Reserved" },
5901
  { PKT_MDC_UGS_AD,   "UGS-AD Support" },
5902
  { PKT_MDC_UGS_AD_LC,    "UGS-AD Support" },
5903
  { PKT_MDC_IF_INDEX,   "MTA's \"ifIndex\" starting number in \"ifTable\"" },
5904
  { PKT_MDC_FLOW_LOG,   "Provisioning Flow Logging Support" },
5905
  { PKT_MDC_PROV_FLOWS,   "Supported Provisioning Flows" },
5906
  /* PacketCable 1.5: */
5907
  { PKT_MDC_T38_VERSION,    "T38 Version Support" },
5908
  { PKT_MDC_T38_EC,   "T38 Error Correction Support" },
5909
  { PKT_MDC_RFC2833_DTMF,   "RFC 2833 DTMF Support" },
5910
  { PKT_MDC_VOICE_METRICS,  "Voice Metrics Support" },
5911
  { PKT_MDC_MIBS,     "MIB Support" },
5912
  { PKT_MDC_MGPI,     "Multiple Grants Per Interval Support" },
5913
  { PKT_MDC_V152,     "V.152 Support" },
5914
  /* PacketCable 2.0: */
5915
  { PKT_MDC_CBS,      "Certificate Bootstrapping Support" },
5916
  { PKT_MDC_CBS_LC,   "Certificate Bootstrapping Support" },
5917
  { 0,        NULL }
5918
};
5919
5920
static const value_string pkt_mdc_version_vals[] = {
5921
  { 0x3030, "PacketCable 1.0" },
5922
  { 0x3031, "PacketCable 1.1/1.5" }, /* 1.5 replaces 1.1-1.3 */
5923
  { 0x3032, "PacketCable 2.0" },
5924
  { 0,    NULL }
5925
};
5926
5927
static const value_string pkt_mdc_boolean_vals[] = {
5928
  { 0x3030, "No" },
5929
  { 0x3031, "Yes" },
5930
  { 0,    NULL }
5931
};
5932
5933
static const value_string pkt_mdc_codec_vals[] = {
5934
  { 0x3031, "other" },       /* "01" */
5935
  { 0x3032, "unknown" },
5936
  { 0x3033, "G.729" },
5937
  { 0x3034, "reserved" },
5938
  { 0x3035, "G.729E" },
5939
  { 0x3036, "PCMU" },
5940
  { 0x3037, "G.726-32" },
5941
  { 0x3038, "G.728" },
5942
  { 0x3039, "PCMA" },      /* "09" */
5943
  { 0x3041, "G.726-16" },      /* "0A" */
5944
  { 0x3042, "G.726-24" },
5945
  { 0x3043, "G.726-40" },
5946
  { 0x3044, "iLBC" },
5947
  { 0x3045, "BV16" },
5948
  { 0x3046, "telephone-event" }, /* "0F" */
5949
  { 0,    NULL }
5950
};
5951
5952
static const value_string pkt_mdc_t38_version_vals[] = {
5953
  { 0x3030, "Unsupported" },
5954
  { 0x3031, "T.38 Version Zero" }, /* default */
5955
  { 0x3032, "T.38 Version One" },
5956
  { 0x3033, "T.38 Version Two" },
5957
  { 0x3035, "T.38 Version Three" },
5958
  { 0,    NULL }
5959
};
5960
5961
static const value_string pkt_mdc_t38_ec_vals[] = {
5962
  { 0x3030, "None" },
5963
  { 0x3031, "Redundancy" }, /* default */
5964
  { 0x3032, "FEC" },
5965
  { 0,    NULL }
5966
};
5967
5968
static const value_string pkt_mdc_mib_orgs[] = {
5969
  { 0x3030, "CableLabs" },
5970
  { 0x3031, "IETF" },
5971
  { 0x3032, "EuroCableLabs" },
5972
  { 0x3033, "Reserved" },
5973
  { 0x3034, "Reserved" },
5974
  { 0x3035, "Reserved" },
5975
  { 0x3036, "Reserved" },
5976
  { 0x3037, "Reserved" },
5977
  { 0x3038, "Reserved" },
5978
  { 0x3039, "Reserved" },
5979
  { 0,    NULL }
5980
};
5981
5982
static int hf_dhcp_pkt_mdc_supp_flow_secure;
5983
static int hf_dhcp_pkt_mdc_supp_flow_hybrid;
5984
static int hf_dhcp_pkt_mdc_supp_flow_basic;
5985
5986
5
#define PKT_MDC_MIB_CL 0x3030
5987
static int hf_dhcp_pkt_mdc_mib_cl_mta;
5988
static int hf_dhcp_pkt_mdc_mib_cl_signaling;
5989
static int hf_dhcp_pkt_mdc_mib_cl_management_event;
5990
static int hf_dhcp_pkt_mdc_mib_cl_mta_extension;
5991
static int hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension;
5992
static int hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension;
5993
static int hf_dhcp_pkt_mdc_mib_cl_reserved;
5994
5995
19
#define PKT_MDC_MIB_IETF 0x3031
5996
static int hf_dhcp_pkt_mdc_mib_ietf_mta;
5997
static int hf_dhcp_pkt_mdc_mib_ietf_signaling;
5998
static int hf_dhcp_pkt_mdc_mib_ietf_management_event;
5999
static int hf_dhcp_pkt_mdc_mib_ietf_reserved;
6000
6001
7
#define PKT_MDC_MIB_EURO 0x3032
6002
static int hf_dhcp_pkt_mdc_mib_euro_mta;
6003
static int hf_dhcp_pkt_mdc_mib_euro_signaling;
6004
static int hf_dhcp_pkt_mdc_mib_euro_management_event;
6005
static int hf_dhcp_pkt_mdc_mib_euro_mta_extension;
6006
static int hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension;
6007
static int hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension;
6008
static int hf_dhcp_pkt_mdc_mib_euro_reserved;
6009
6010
6011
static void
6012
dissect_packetcable_mta_cap(proto_tree *v_tree, packet_info *pinfo, tvbuff_t *tvb, unsigned voff, unsigned len)
6013
148
{
6014
148
  uint16_t  raw_val;
6015
148
  uint32_t  flow_val    = 0;
6016
148
  unsigned  off   = PKT_MDC_TLV_OFF + voff;
6017
148
  unsigned  subopt_off, max_len;
6018
148
  unsigned  tlv_len, i, mib_val;
6019
148
  const char    *asc_val;
6020
148
  proto_item    *ti, *mib_ti;
6021
148
  proto_tree    *subtree, *subtree2;
6022
6023
148
  asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, off, 2, ENC_ASCII);
6024
148
  if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len > 0xff) {
6025
12
    proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
6026
12
      "Bogus length: %s",
6027
12
      format_text_string(pinfo->pool, asc_val));
6028
12
    return;
6029
136
  } else {
6030
136
    proto_tree_add_uint(v_tree, hf_dhcp_pkt_mta_cap_len, tvb, off, 2, tlv_len);
6031
136
    off += 2;
6032
6033
2.25k
    while (off - voff < len) {
6034
      /* Type */
6035
2.23k
      raw_val = tvb_get_ntohs (tvb, off);
6036
6037
      /* Length */
6038
2.23k
      asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, off + 2, 2, ENC_ASCII);
6039
2.23k
      if (sscanf(asc_val, "%x", &tlv_len) != 1
6040
2.19k
          || tlv_len < 1 || tlv_len > UINT16_MAX) {
6041
42
        proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
6042
42
          "Bogus length: %s",
6043
42
          format_text_string(pinfo->pool, asc_val));
6044
42
        return;
6045
2.19k
      } else {
6046
        /* Value(s) */
6047
6048
2.19k
        ti = proto_tree_add_uint_format(v_tree, hf_dhcp_pkt_mta_cap_type,
6049
2.19k
            tvb, off, 2, raw_val, "0x%s: %s = ",
6050
2.19k
            tvb_format_text(pinfo->pool, tvb, off, 2),
6051
2.19k
            val_to_str_const(raw_val, pkt_mdc_type_vals, "unknown"));
6052
2.19k
        proto_item_set_len(ti, (tlv_len * 2) + 4);
6053
2.19k
        switch (raw_val) {
6054
6055
33
        case PKT_MDC_VERSION:
6056
33
          raw_val = tvb_get_ntohs(tvb, off + 4);
6057
33
          proto_item_append_text(ti,
6058
33
                     "%s (%s)",
6059
33
                     val_to_str_const(raw_val, pkt_mdc_version_vals, "Reserved"),
6060
33
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6061
33
          break;
6062
6063
31
        case PKT_MDC_TEL_END:
6064
46
        case PKT_MDC_IF_INDEX:
6065
46
          proto_item_append_text(ti,
6066
46
                     "%s",
6067
46
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6068
46
          break;
6069
6070
24
        case PKT_MDC_TGT:
6071
57
        case PKT_MDC_HTTP_ACC:
6072
71
        case PKT_MDC_SYSLOG:
6073
97
        case PKT_MDC_NCS:
6074
122
        case PKT_MDC_PRI_LINE:
6075
138
        case PKT_MDC_NVRAM_STOR:
6076
162
        case PKT_MDC_PROV_REP:
6077
218
        case PKT_MDC_PROV_REP_LC:
6078
246
        case PKT_MDC_SILENCE:
6079
325
        case PKT_MDC_SILENCE_LC:
6080
409
        case PKT_MDC_ECHO_CANCEL:
6081
434
        case PKT_MDC_ECHO_CANCEL_LC:
6082
472
        case PKT_MDC_RSVP:
6083
529
        case PKT_MDC_RSVP_LC:
6084
554
        case PKT_MDC_UGS_AD:
6085
667
        case PKT_MDC_UGS_AD_LC:
6086
703
        case PKT_MDC_FLOW_LOG:
6087
746
        case PKT_MDC_RFC2833_DTMF:
6088
790
        case PKT_MDC_VOICE_METRICS:
6089
810
        case PKT_MDC_MGPI:
6090
859
        case PKT_MDC_V152:
6091
898
        case PKT_MDC_CBS:
6092
926
        case PKT_MDC_CBS_LC:
6093
926
          raw_val = tvb_get_ntohs(tvb, off + 4);
6094
926
          proto_item_append_text(ti,
6095
926
                     "%s (%s)",
6096
926
                     val_to_str_const(raw_val, pkt_mdc_boolean_vals, "unknown"),
6097
926
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6098
926
          break;
6099
6100
42
        case PKT_MDC_SUPP_CODECS:
6101
96
        case PKT_MDC_SUPP_CODECS_LC:
6102
1.12k
          for (i = 0; i < tlv_len; i++) {
6103
1.02k
            raw_val = tvb_get_ntohs(tvb, off + 4 + (i * 2) );
6104
1.02k
            proto_item_append_text(ti,
6105
1.02k
                       "%s%s (%s)",
6106
1.02k
                       plurality(i + 1, "", ", "),
6107
1.02k
                       val_to_str_const(raw_val, pkt_mdc_codec_vals, "unknown"),
6108
1.02k
                       tvb_format_stringzpad(pinfo->pool, tvb, off + 4 + (i * 2), 2) );
6109
1.02k
          }
6110
96
          break;
6111
6112
89
        case PKT_MDC_PROV_FLOWS:
6113
          /* We are only reading 4 digits which should fit in 32 bits */
6114
89
          tvb_get_string_uint(tvb, off + 4, 4, ENC_STR_HEX, &flow_val, NULL);
6115
89
          proto_item_append_text(ti,
6116
89
                     "0x%04x", flow_val);
6117
89
          break;
6118
6119
28
        case PKT_MDC_T38_VERSION:
6120
28
          raw_val = tvb_get_ntohs(tvb, off + 4);
6121
28
          proto_item_append_text(ti,
6122
28
                     "%s (%s)",
6123
28
                     val_to_str_const(raw_val, pkt_mdc_t38_version_vals, "unknown"),
6124
28
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6125
28
          break;
6126
6127
40
        case PKT_MDC_T38_EC:
6128
40
          raw_val = tvb_get_ntohs(tvb, off + 4);
6129
40
          proto_item_append_text(ti,
6130
40
                     "%s (%s)",
6131
40
                     val_to_str_const(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
6132
40
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6133
40
          break;
6134
6135
30
        case PKT_MDC_MIBS:
6136
30
          break;
6137
6138
0
        case PKT_MDC_VENDOR_TLV:
6139
894
        default:
6140
894
          proto_item_append_text(ti,
6141
894
                     "%s",
6142
894
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, tlv_len * 2) );
6143
894
          break;
6144
2.19k
        }
6145
2.19k
      }
6146
2.13k
      subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6147
2.13k
      if (raw_val == PKT_MDC_PROV_FLOWS) {
6148
223
        static int * const flows[] = {
6149
223
          &hf_dhcp_pkt_mdc_supp_flow_secure,
6150
223
          &hf_dhcp_pkt_mdc_supp_flow_hybrid,
6151
223
          &hf_dhcp_pkt_mdc_supp_flow_basic,
6152
223
          NULL
6153
223
        };
6154
6155
223
        proto_tree_add_bitmask_list_value(subtree, tvb, off + 4, 4, flows, flow_val);
6156
1.91k
      } else if (raw_val == PKT_MDC_MIBS) {
6157
      /* 17 06 02 00 38 02 01 07 */
6158
30
        subopt_off = off + 4;
6159
30
        max_len = subopt_off + (tlv_len * 2);
6160
188
        while (subopt_off < max_len) {
6161
171
          raw_val = tvb_get_ntohs(tvb, subopt_off);
6162
171
          if (raw_val != 0x3032) { /* We only know how to handle a length of 2 */
6163
10
            asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6164
10
            proto_tree_add_expert_format(subtree, pinfo, &ei_dhcp_bad_length, tvb, subopt_off, 2,
6165
10
              "Bogus length: %s",
6166
10
              format_text_string(pinfo->pool, asc_val));
6167
10
            return;
6168
10
          }
6169
6170
161
          subopt_off += 2;
6171
161
          raw_val = tvb_get_ntohs(tvb, subopt_off);
6172
161
          asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6173
161
          subtree2 = proto_tree_add_subtree_format(subtree, tvb, subopt_off, 2,
6174
161
            ett_dhcp_option, &mib_ti, "%s (%s)",
6175
161
            val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"),
6176
161
            format_text_string(pinfo->pool, asc_val));
6177
161
          if (subopt_off > off + 4 + 2) {
6178
133
            proto_item_append_text(ti, ", ");
6179
133
          }
6180
161
          proto_item_append_text(ti, "%s", val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"));
6181
6182
161
          subopt_off += 2;
6183
161
          asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6184
161
          if (sscanf(asc_val, "%x", &mib_val) != 1) {
6185
1
            proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_bitfield, tvb, subopt_off, 2,
6186
1
              "Bogus bitfield: %s", format_text_string(pinfo->pool, asc_val));
6187
1
            return;
6188
1
          }
6189
160
          switch (raw_val) {
6190
6191
5
          case PKT_MDC_MIB_CL: {
6192
5
            static int * const cl_flags[] = {
6193
5
              &hf_dhcp_pkt_mdc_mib_cl_mta,
6194
5
              &hf_dhcp_pkt_mdc_mib_cl_signaling,
6195
5
              &hf_dhcp_pkt_mdc_mib_cl_management_event,
6196
5
              &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
6197
5
              &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
6198
5
              &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
6199
5
              &hf_dhcp_pkt_mdc_mib_cl_reserved,
6200
5
              NULL
6201
5
            };
6202
6203
5
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, cl_flags, mib_val);
6204
5
            }
6205
5
            break;
6206
6207
19
          case PKT_MDC_MIB_IETF: {
6208
19
            static int * const ietf_flags[] = {
6209
19
              &hf_dhcp_pkt_mdc_mib_ietf_mta,
6210
19
              &hf_dhcp_pkt_mdc_mib_ietf_signaling,
6211
19
              &hf_dhcp_pkt_mdc_mib_ietf_management_event,
6212
19
              &hf_dhcp_pkt_mdc_mib_ietf_reserved,
6213
19
              NULL
6214
19
            };
6215
6216
19
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, ietf_flags, mib_val);
6217
19
            }
6218
19
            break;
6219
6220
7
          case PKT_MDC_MIB_EURO: {
6221
7
            static int * const euro_flags[] = {
6222
7
              &hf_dhcp_pkt_mdc_mib_euro_mta,
6223
7
              &hf_dhcp_pkt_mdc_mib_euro_signaling,
6224
7
              &hf_dhcp_pkt_mdc_mib_euro_management_event,
6225
7
              &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
6226
7
              &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
6227
7
              &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
6228
7
              &hf_dhcp_pkt_mdc_mib_euro_reserved,
6229
7
              NULL
6230
7
            };
6231
6232
7
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, euro_flags, mib_val);
6233
7
            }
6234
7
            break;
6235
6236
127
          default:
6237
127
            break;
6238
160
          }
6239
158
          subopt_off += 2;
6240
158
        }
6241
6242
30
      }
6243
2.12k
      off += (tlv_len * 2) + 4;
6244
2.12k
    }
6245
136
  }
6246
148
}
6247
6248
static bool
6249
dissect_packetcable_mta_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6250
1.30k
{
6251
1.30k
  uint8_t* vendor_id;
6252
6253
1.30k
  if (tvb_reported_length(tvb) < 8) {
6254
111
    return false;
6255
111
  }
6256
6257
1.19k
  vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 8, ENC_ASCII|ENC_NA);
6258
1.19k
  if ((strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP10) == 0) ||
6259
1.15k
    (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP15) == 0) ||
6260
1.07k
    (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP20) == 0)) {
6261
148
    dissect_packetcable_mta_cap(tree, pinfo, tvb, 0, tvb_reported_length(tvb));
6262
148
    return true;
6263
148
  }
6264
6265
1.04k
  return false;
6266
1.19k
}
6267
6268
/* DOCSIS Cable Modem device capabilities (option 60/option 125). */
6269
70
#define DOCSIS_CM_CAP_TLV_OFF 12
6270
6271
495
#define DOCSIS_CM_CAP_CONCAT_SUP  0x01
6272
214
#define DOCSIS_CM_CAP_DOCSIS_VER  0x02
6273
844
#define DOCSIS_CM_CAP_FRAG_SUP    0x03
6274
1.40k
#define DOCSIS_CM_CAP_PHS_SUP   0x04
6275
1.81k
#define DOCSIS_CM_CAP_IGMP_SUP    0x05
6276
163
#define DOCSIS_CM_CAP_PRIV_SUP    0x06
6277
162
#define DOCSIS_CM_CAP_DSAID_SUP   0x07
6278
1.25k
#define DOCSIS_CM_CAP_USSF_SUP    0x08
6279
105
#define DOCSIS_CM_CAP_FILT_SUP    0x09
6280
382
#define DOCSIS_CM_CAP_TET_MI    0x0a
6281
343
#define DOCSIS_CM_CAP_TET   0x0b
6282
1.89k
#define DOCSIS_CM_CAP_DCC_SUP   0x0c
6283
271
#define DOCSIS_CM_CAP_IPFILT_SUP  0x0d
6284
462
#define DOCSIS_CM_CAP_LLCFILT_SUP 0x0e
6285
1.98k
#define DOCSIS_CM_CAP_EXPUNI_SPACE  0x0f
6286
30.4k
#define DOCSIS_CM_CAP_RNGHLDOFF_SUP 0x10
6287
124
#define DOCSIS_CM_CAP_L2VPN_SUP   0x11
6288
70
#define DOCSIS_CM_CAP_L2VPN_HOST_SUP  0x12
6289
2.14k
#define DOCSIS_CM_CAP_DUTFILT_SUP 0x13
6290
104
#define DOCSIS_CM_CAP_USFREQRNG_SUP 0x14
6291
15.2k
#define DOCSIS_CM_CAP_USSYMRATE_SUP 0x15
6292
2.26k
#define DOCSIS_CM_CAP_SACM2_SUP   0x16
6293
2.42k
#define DOCSIS_CM_CAP_SACM2HOP_SUP  0x17
6294
266
#define DOCSIS_CM_CAP_MULTTXCHAN_SUP  0x18
6295
446
#define DOCSIS_CM_CAP_512USTXCHAN_SUP 0x19
6296
583
#define DOCSIS_CM_CAP_256USTXCHAN_SUP 0x1a
6297
859
#define DOCSIS_CM_CAP_TOTALSIDCLU_SUP 0x1b
6298
529
#define DOCSIS_CM_CAP_SIDCLUPERSF_SUP 0x1c
6299
1.00k
#define DOCSIS_CM_CAP_MULTRXCHAN_SUP  0x1d
6300
595
#define DOCSIS_CM_CAP_TOTALDSID_SUP 0x1e
6301
177
#define DOCSIS_CM_CAP_RESEQDSID_SUP 0x1f
6302
471
#define DOCSIS_CM_CAP_MULTDSID_SUP  0x20
6303
131
#define DOCSIS_CM_CAP_MULTDSIDFW_SUP  0x21
6304
95
#define DOCSIS_CM_CAP_FCTF_SUP    0x22
6305
261
#define DOCSIS_CM_CAP_DPV_SUP   0x23
6306
1.07k
#define DOCSIS_CM_CAP_UGSPERUSFLOW_SUP  0x24
6307
366
#define DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP 0x25
6308
459
#define DOCSIS_CM_CAP_USDROPCLASSIF_SUP 0x26
6309
2.52k
#define DOCSIS_CM_CAP_IPV6_SUP    0x27
6310
592
#define DOCSIS_CM_CAP_ExUsTrPow   0x28
6311
30.5k
#define DOCSIS_CM_CAP_Opt802MPLSSup   0x29
6312
494
#define DOCSIS_CM_CAP_DounEnc   0x2a
6313
106
#define DOCSIS_CM_CAP_EnrgMang    0x2c
6314
6315
static const value_string docsis_cm_cap_type_vals[] = {
6316
  { DOCSIS_CM_CAP_CONCAT_SUP,   "Concatenation Support" },
6317
  { DOCSIS_CM_CAP_DOCSIS_VER,   "DOCSIS Version" },
6318
  { DOCSIS_CM_CAP_FRAG_SUP,   "Fragmentation Support" },
6319
  { DOCSIS_CM_CAP_PHS_SUP,    "Payload Header Suppression Support" },
6320
  { DOCSIS_CM_CAP_IGMP_SUP,   "IGMP Support" },
6321
  { DOCSIS_CM_CAP_PRIV_SUP,   "Privacy Support" },
6322
  { DOCSIS_CM_CAP_DSAID_SUP,    "Downstream SAID Support" },
6323
  { DOCSIS_CM_CAP_USSF_SUP,   "Upstream Service Flow Support" },
6324
  { DOCSIS_CM_CAP_FILT_SUP,   "Optional Filtering Support" },
6325
  { DOCSIS_CM_CAP_TET_MI,     "Transmit Equalizer Taps per Modulation Interval" },
6326
  { DOCSIS_CM_CAP_TET,      "Number of Transmit Equalizer Taps" },
6327
  { DOCSIS_CM_CAP_DCC_SUP,    "DCC Support" },
6328
  { DOCSIS_CM_CAP_IPFILT_SUP,   "IP Filters Support" },
6329
  { DOCSIS_CM_CAP_LLCFILT_SUP,    "LLC Filters Support" },
6330
  { DOCSIS_CM_CAP_EXPUNI_SPACE,   "Expanded Unicast SID Space" },
6331
  { DOCSIS_CM_CAP_RNGHLDOFF_SUP,    "Ranging Hold-Off Support" },
6332
  { DOCSIS_CM_CAP_L2VPN_SUP,    "L2VPN Capability" },
6333
  { DOCSIS_CM_CAP_L2VPN_HOST_SUP,   "L2VPN eSAFE Host Capability" },
6334
  { DOCSIS_CM_CAP_DUTFILT_SUP,    "Downstream Unencrypted Traffic (DUT) Filtering" },
6335
  { DOCSIS_CM_CAP_USFREQRNG_SUP,    "Upstream Frequency Range Support" },
6336
  { DOCSIS_CM_CAP_USSYMRATE_SUP,    "Upstream Symbol Rate Support" },
6337
  { DOCSIS_CM_CAP_SACM2_SUP,    "Selectable Active Code Mode 2 Support" },
6338
  { DOCSIS_CM_CAP_SACM2HOP_SUP,   "Code Hopping Mode 2 Support" },
6339
  { DOCSIS_CM_CAP_MULTTXCHAN_SUP,   "Multiple Transmit Channel Support" },
6340
  { DOCSIS_CM_CAP_512USTXCHAN_SUP,  "5.12 Msps Upstream Transmit Channel Support" },
6341
  { DOCSIS_CM_CAP_256USTXCHAN_SUP,  "2.56 Msps Upstream Transmit Channel Support" },
6342
  { DOCSIS_CM_CAP_TOTALSIDCLU_SUP,  "Total SID Cluster Support" },
6343
  { DOCSIS_CM_CAP_SIDCLUPERSF_SUP,  "SID Clusters per Service Flow Support" },
6344
  { DOCSIS_CM_CAP_MULTRXCHAN_SUP,   "Multiple Receive Channel Support" },
6345
  { DOCSIS_CM_CAP_TOTALDSID_SUP,    "Total Downstream Service ID (DSID) Support" },
6346
  { DOCSIS_CM_CAP_RESEQDSID_SUP,    "Resequencing Downstream Service ID (DSID) Support" },
6347
  { DOCSIS_CM_CAP_MULTDSID_SUP,   "Multicast Downstream Service ID (DSID) Support" },
6348
  { DOCSIS_CM_CAP_MULTDSIDFW_SUP,   "Multicast DSID Forwarding" },
6349
  { DOCSIS_CM_CAP_FCTF_SUP,   "Frame Control Type Forwarding Capability" },
6350
  { DOCSIS_CM_CAP_DPV_SUP,    "DPV Capability" },
6351
  { DOCSIS_CM_CAP_UGSPERUSFLOW_SUP, "Unsolicited Grant Service/Upstream Service Flow Support" },
6352
  { DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP,  "MAP and UCD Receipt Support" },
6353
  { DOCSIS_CM_CAP_USDROPCLASSIF_SUP,  "Upstream Drop Classifier Support" },
6354
  { DOCSIS_CM_CAP_IPV6_SUP,   "IPv6 Support" },
6355
  { DOCSIS_CM_CAP_ExUsTrPow,    "Extended Upstream Transmit Power Capability (1/4 dB)" },
6356
  { DOCSIS_CM_CAP_Opt802MPLSSup,    "Optional 802.1ad, 802.1ah, MPLS Classification Support" },
6357
  { DOCSIS_CM_CAP_DounEnc,    "D-ONU Capabilities Encoding" },
6358
  { DOCSIS_CM_CAP_EnrgMang,   "Energy Management Capabilities" },
6359
  { 0, NULL }
6360
};
6361
6362
static const value_string docsis_cm_cap_supported_vals[] = {
6363
  { 0x00, "Not Support" },
6364
  { 0x01, "Supported" },
6365
  { 0,    NULL }
6366
};
6367
6368
static const value_string docsis_cm_cap_version_vals[] = {
6369
  { 0x00, "DOCSIS 1.0" },
6370
  { 0x01, "DOCSIS 1.1" },
6371
  { 0x02, "DOCSIS 2.0" },
6372
  { 0x03, "DOCSIS 3.0" },
6373
  { 0,    NULL }
6374
};
6375
6376
static const value_string docsis_cm_cap_privacy_vals[] = {
6377
  { 0x00, "BPI Support" },
6378
  { 0x01, "BPI Plus Support" },
6379
  { 0,    NULL }
6380
};
6381
6382
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_cm;
6383
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_eps;
6384
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_emta;
6385
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg;
6386
6387
static const value_string docsis_cm_cap_l2vpn_vals[] = {
6388
  { 0x00, "CM not compliant with DOCSIS L2VPN Section 7 (default)" },
6389
  { 0x01, "CM compliant with DOCSIS L2VPN Section 7" },
6390
  { 0,    NULL }
6391
};
6392
6393
static const value_string docsis_cm_cap_filt_vals[] = {
6394
  { 0x00, "802.1P Filtering" },
6395
  { 0x01, "802.1Q Filtering" },
6396
  { 0,    NULL }
6397
};
6398
6399
static int hf_dhcp_docsis_cm_cap_mpls_stpid;
6400
static int hf_dhcp_docsis_cm_cap_mpls_svid;
6401
static int hf_dhcp_docsis_cm_cap_mpls_spcp;
6402
static int hf_dhcp_docsis_cm_cap_mpls_sdei;
6403
static int hf_dhcp_docsis_cm_cap_mpls_ctpid;
6404
static int hf_dhcp_docsis_cm_cap_mpls_cvid;
6405
static int hf_dhcp_docsis_cm_cap_mpls_cpcp;
6406
static int hf_dhcp_docsis_cm_cap_mpls_ccfi;
6407
static int hf_dhcp_docsis_cm_cap_mpls_stci;
6408
static int hf_dhcp_docsis_cm_cap_mpls_ctci;
6409
static int hf_dhcp_docsis_cm_cap_mpls_itpid;
6410
static int hf_dhcp_docsis_cm_cap_mpls_isid;
6411
static int hf_dhcp_docsis_cm_cap_mpls_itci;
6412
static int hf_dhcp_docsis_cm_cap_mpls_ipcp;
6413
static int hf_dhcp_docsis_cm_cap_mpls_idei;
6414
static int hf_dhcp_docsis_cm_cap_mpls_iuca;
6415
static int hf_dhcp_docsis_cm_cap_mpls_btpid;
6416
static int hf_dhcp_docsis_cm_cap_mpls_btci;
6417
static int hf_dhcp_docsis_cm_cap_mpls_bpcp;
6418
static int hf_dhcp_docsis_cm_cap_mpls_bdei;
6419
static int hf_dhcp_docsis_cm_cap_mpls_bvid;
6420
static int hf_dhcp_docsis_cm_cap_mpls_bda;
6421
static int hf_dhcp_docsis_cm_cap_mpls_bsa;
6422
static int hf_dhcp_docsis_cm_cap_mpls_tc;
6423
static int hf_dhcp_docsis_cm_cap_mpls_label;
6424
6425
static const value_string docsis_cm_cap_enrgmang_vals[] = {
6426
  { 0x00, "Energy Management 1x1 Feature" },
6427
  { 0,    NULL }
6428
};
6429
6430
static const value_string docsis_cm_cap_usfreqrng_vals[] = {
6431
  { 0x00, "Standard Upstream Frequency Range" },
6432
  { 0x01, "Standard Upstream Frequency Range and Extended Upstream Frequency Range" },
6433
  { 0,    NULL }
6434
};
6435
6436
static const value_string docsis_cm_cap_map_ucd_receipt_vals[] = {
6437
  { 0x00, "CM cannot support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6438
  { 0x01, "CM can support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6439
  { 0,    NULL }
6440
};
6441
6442
static const value_string docsis_cm_cap_map_dpv_support_vals[] = {
6443
  { 0x00, "U1 supported as a Start Reference Point for DPV per Path" },
6444
  { 0x01, "U1 supported as a Start Reference Point for DPV per Packet" },
6445
  { 0,    NULL }
6446
};
6447
6448
static const value_string docsis_cm_cap_map_multDsidForward_support_vals[] = {
6449
  { 0x00, "No support for multicast DSID forwarding" },
6450
  { 0x01, "Support for GMAC explicit multicast DSID forwarding" },
6451
  { 0x02, "Support for GMAC promiscuous multicast DSID forwarding" },
6452
  { 0,    NULL }
6453
};
6454
6455
static const value_string docsis_cm_cap_map_fctfc_support_vals[] = {
6456
  { 0x00, "Isolation Packet PDU MAC Header (FC_Type of 10) is not forwarded" },
6457
  { 0x01, "Isolation Packet PDU MAC Header (FC_Type of 10) is forwarded" },
6458
  { 0,    NULL }
6459
};
6460
6461
static const value_string docsis_cm_cap_map_l2vpn_esafe_index_support_vals[] = {
6462
  { 0x01, "ePs or eRouter" },
6463
  { 0x10, "eMTA" },
6464
  { 0x11, "eSTB-IP" },
6465
  { 0x12, "eSTB-DSG" },
6466
  { 0x13, "eTEA" },
6467
  { 0,    NULL }
6468
};
6469
6470
static int hf_dhcp_docsis_cm_cap_ussymrate_160;
6471
static int hf_dhcp_docsis_cm_cap_ussymrate_320;
6472
static int hf_dhcp_docsis_cm_cap_ussymrate_640;
6473
static int hf_dhcp_docsis_cm_cap_ussymrate_1280;
6474
static int hf_dhcp_docsis_cm_cap_ussymrate_2560;
6475
static int hf_dhcp_docsis_cm_cap_ussymrate_5120;
6476
6477
static void
6478
display_uint_with_range_checking(proto_item *ti, uint8_t val_byte, uint16_t val_uint16, int min_value, int max_value)
6479
4.58k
{
6480
4.58k
  uint16_t value;
6481
6482
4.58k
  if (0 != val_byte)
6483
1.54k
  {
6484
1.54k
    value = val_byte;
6485
1.54k
  }
6486
3.03k
  else
6487
3.03k
  {
6488
3.03k
    value = val_uint16;
6489
3.03k
  }
6490
4.58k
  proto_item_append_text(ti, "%i", value);
6491
4.58k
  if ((value < min_value) ||
6492
2.36k
      (value > max_value))
6493
2.76k
  {
6494
2.76k
    proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
6495
2.76k
  }
6496
4.58k
}
6497
6498
static void get_opt125_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6499
12.9k
{
6500
  /* Type */
6501
12.9k
  *tlvtype = tvb_get_uint8(tvb, off);
6502
  /* Length */
6503
12.9k
  *tlvlen  = tvb_get_uint8(tvb, off+1);
6504
  /* Value */
6505
12.9k
  *value = (uint8_t *)tvb_memdup(scope, tvb, off + 2, *tlvlen);
6506
12.9k
}
6507
6508
static void get_opt60_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6509
2.21k
{
6510
2.21k
  unsigned  i;
6511
6512
  /* Type */
6513
2.21k
  tvb_get_string_uint8(tvb, off, 2, ENC_STR_HEX, tlvtype, NULL);
6514
  /* Length */
6515
2.21k
  tvb_get_string_uint8(tvb, off + 2, 2, ENC_STR_HEX, tlvlen, NULL);
6516
  /* Value */
6517
2.21k
  *value = (uint8_t *)wmem_alloc0(scope, *tlvlen);
6518
5.57k
  for (i=0; i<*tlvlen; i++)
6519
3.35k
  {
6520
3.35k
    tvb_get_string_uint8(tvb, off + ((i*2) + 4), 2, ENC_STR_HEX, &((*value)[i]), NULL);
6521
3.35k
  }
6522
2.21k
}
6523
6524
static void
6525
dissect_docsis_cm_cap(packet_info *pinfo, proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, bool opt125)
6526
744
{
6527
744
  proto_item *ti;
6528
744
  proto_tree *subtree;
6529
744
  uint8_t     tlv_type;
6530
744
  uint8_t     tlv_len;
6531
744
  uint8_t     val_byte   = 0;
6532
744
  uint16_t      val_uint16 = 0;
6533
744
  uint8_t    *val_other  = NULL;
6534
744
  unsigned      off        = voff;
6535
6536
744
  if (opt125)
6537
674
  {
6538
    /* Option 125 is formatted as uint8's */
6539
    /* Type */
6540
674
    tlv_type = tvb_get_uint8(tvb, off);
6541
    /* Length */
6542
674
    tlv_len  = tvb_get_uint8(tvb, off+1);
6543
674
    proto_tree_add_uint(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+1, 1, tlv_len);
6544
674
  }
6545
70
  else
6546
70
  {
6547
    /* Option 60 is formatted as an ASCII string.
6548
       Since the capabilities are the same for both options
6549
       I am converting the Option 60 values from ASCII to
6550
       uint8s to allow the same parser to work for both */
6551
70
    off += DOCSIS_CM_CAP_TLV_OFF;
6552
70
    tvb_get_string_uint8(tvb, off, 2, ENC_STR_HEX, &tlv_len, NULL);
6553
70
    proto_tree_add_uint(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+2, 2, tlv_len);
6554
70
  }
6555
6556
744
  off+=2;
6557
6558
15.7k
  while (off - ((unsigned) voff) < ((unsigned) len))
6559
15.1k
  {
6560
15.1k
    tlv_type = 0;
6561
15.1k
    tlv_len = 0;
6562
15.1k
    val_byte = 0;
6563
15.1k
    val_uint16 = 0;
6564
6565
15.1k
    if (opt125)
6566
12.9k
    {
6567
12.9k
      get_opt125_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6568
12.9k
      ti =  proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6569
12.9k
               tlv_len + 2,
6570
12.9k
               tlv_type,
6571
12.9k
               "0x%02x: %s = ",
6572
12.9k
               tlv_type,
6573
12.9k
               val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6574
12.9k
    }
6575
2.21k
    else
6576
2.21k
    {
6577
      /* Option 60 is formatted as an ASCII string.  Since the capabilities
6578
         are the same for both options I am converting the Option 60 values
6579
         from ASCII to uint8s to allow the same parser to work for both */
6580
2.21k
      get_opt60_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6581
2.21k
      ti =  proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6582
2.21k
               (tlv_len * 2) + 4,
6583
2.21k
               tlv_type,
6584
2.21k
               "0x%02x: %s = ",
6585
2.21k
               tlv_type,
6586
2.21k
               val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6587
2.21k
    }
6588
6589
15.1k
    if (tlv_len == 1)
6590
3.04k
    {
6591
      /* The value refers to a byte. */
6592
3.04k
      val_byte = val_other[0];
6593
3.04k
    }
6594
12.1k
    else
6595
12.1k
    {
6596
12.1k
      if (tlv_len == 2)
6597
752
      {
6598
        /* The value refers to a uint16. */
6599
752
        val_uint16 = (val_other[0] << 8) + val_other[1];
6600
752
      }
6601
12.1k
    }
6602
6603
15.1k
    switch (tlv_type)
6604
15.1k
    {
6605
495
    case DOCSIS_CM_CAP_CONCAT_SUP:
6606
844
    case DOCSIS_CM_CAP_FRAG_SUP:
6607
1.40k
    case DOCSIS_CM_CAP_PHS_SUP:
6608
1.81k
    case DOCSIS_CM_CAP_IGMP_SUP:
6609
1.89k
    case DOCSIS_CM_CAP_DCC_SUP:
6610
1.98k
    case DOCSIS_CM_CAP_EXPUNI_SPACE:
6611
2.14k
    case DOCSIS_CM_CAP_DUTFILT_SUP:
6612
2.26k
    case DOCSIS_CM_CAP_SACM2_SUP:
6613
2.42k
    case DOCSIS_CM_CAP_SACM2HOP_SUP:
6614
2.52k
    case DOCSIS_CM_CAP_IPV6_SUP:
6615
2.52k
      proto_item_append_text(ti,
6616
2.52k
                 "%s",
6617
2.52k
                 val_to_str_const(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
6618
2.52k
      break;
6619
214
    case DOCSIS_CM_CAP_DOCSIS_VER:
6620
214
      proto_item_append_text(ti,
6621
214
                 "%s",
6622
214
                 val_to_str_const(val_byte, docsis_cm_cap_version_vals, "Reserved"));
6623
214
      break;
6624
163
    case DOCSIS_CM_CAP_PRIV_SUP:
6625
163
      proto_item_append_text(ti,
6626
163
                 "%s",
6627
163
                 val_to_str_const(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
6628
163
      break;
6629
105
    case DOCSIS_CM_CAP_FILT_SUP:
6630
105
      proto_item_append_text(ti,
6631
105
                 "%s",
6632
105
                 val_to_str_const(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
6633
105
      break;
6634
124
    case DOCSIS_CM_CAP_L2VPN_SUP:
6635
124
      proto_item_append_text(ti,
6636
124
                 "%s",
6637
124
                 val_to_str_const(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
6638
124
      break;
6639
70
    case DOCSIS_CM_CAP_L2VPN_HOST_SUP:
6640
70
      if (tlv_len == 7) {
6641
10
        proto_item_append_text(ti,
6642
10
                   "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
6643
10
                   val_to_str_const(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
6644
10
                   val_other[0],
6645
10
                   val_other[1],
6646
10
                   val_other[2],
6647
10
                   val_other[3],
6648
10
                   val_other[4],
6649
10
                   val_other[5],
6650
10
                   val_other[6]);
6651
60
      } else {
6652
60
        proto_item_append_text(ti,
6653
60
                   "Invalid (length should be 7, is %d)",
6654
60
                   tlv_len);
6655
60
      }
6656
70
      break;
6657
104
    case DOCSIS_CM_CAP_USFREQRNG_SUP:
6658
104
      proto_item_append_text(ti,
6659
104
                 "%s",
6660
104
                 val_to_str_const(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
6661
104
      break;
6662
366
    case DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP:
6663
366
      proto_item_append_text(ti,
6664
366
                 "%s",
6665
366
                 val_to_str_const(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
6666
366
      break;
6667
261
    case DOCSIS_CM_CAP_DPV_SUP:
6668
261
      proto_item_append_text(ti,
6669
261
                 "%s",
6670
261
                 val_to_str_const(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
6671
261
      break;
6672
162
    case DOCSIS_CM_CAP_DSAID_SUP:
6673
266
    case DOCSIS_CM_CAP_MULTTXCHAN_SUP:
6674
446
    case DOCSIS_CM_CAP_512USTXCHAN_SUP:
6675
583
    case DOCSIS_CM_CAP_256USTXCHAN_SUP:
6676
859
    case DOCSIS_CM_CAP_TOTALSIDCLU_SUP:
6677
1.00k
    case DOCSIS_CM_CAP_MULTRXCHAN_SUP:
6678
1.07k
    case DOCSIS_CM_CAP_UGSPERUSFLOW_SUP:
6679
1.25k
    case DOCSIS_CM_CAP_USSF_SUP:
6680
1.25k
      display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
6681
1.25k
      break;
6682
177
    case DOCSIS_CM_CAP_RESEQDSID_SUP:
6683
471
    case DOCSIS_CM_CAP_MULTDSID_SUP:
6684
471
      display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
6685
471
      break;
6686
529
    case DOCSIS_CM_CAP_SIDCLUPERSF_SUP:
6687
529
      display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
6688
529
      break;
6689
595
    case DOCSIS_CM_CAP_TOTALDSID_SUP:
6690
595
      display_uint_with_range_checking(ti, val_byte, val_uint16, 32, 255);
6691
595
      break;
6692
343
    case DOCSIS_CM_CAP_TET:
6693
343
      display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
6694
343
      break;
6695
382
    case DOCSIS_CM_CAP_TET_MI:
6696
382
      if ((val_byte == 1) ||
6697
302
          (val_byte == 2) ||
6698
226
          (val_byte == 4))
6699
207
      {
6700
207
        proto_item_append_text(ti,
6701
207
                   " %i",
6702
207
                   val_byte);
6703
207
      }
6704
175
      else
6705
175
      {
6706
175
        proto_item_append_text(ti,
6707
175
                   " (Invalid Value %i : Should be [1,2,4]",
6708
175
                   val_byte);
6709
175
      }
6710
382
      break;
6711
271
    case DOCSIS_CM_CAP_IPFILT_SUP:
6712
459
    case DOCSIS_CM_CAP_USDROPCLASSIF_SUP:
6713
459
      display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
6714
459
      break;
6715
462
    case DOCSIS_CM_CAP_LLCFILT_SUP:
6716
462
      display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
6717
462
      break;
6718
592
    case DOCSIS_CM_CAP_ExUsTrPow:
6719
592
      if (val_byte == 0)
6720
126
      {
6721
126
        proto_item_append_text(ti, "%i", val_byte);
6722
126
      }
6723
466
      else
6724
466
      {
6725
466
        display_uint_with_range_checking(ti, val_byte, val_uint16, 205, 244);
6726
466
      }
6727
592
      break;
6728
484
    case DOCSIS_CM_CAP_Opt802MPLSSup:
6729
484
      proto_item_append_text(ti,
6730
484
                 "0x%02x", val_byte);
6731
494
    case DOCSIS_CM_CAP_DounEnc:
6732
      /* TODO: add D-ONU Capabilities Encoding according DPoE-SP-MULPIv1.0-I02-120607 */
6733
494
      break;
6734
106
    case DOCSIS_CM_CAP_EnrgMang:
6735
106
      proto_item_append_text(ti,
6736
106
                 "%s",
6737
106
                 val_to_str_const(val_byte, docsis_cm_cap_enrgmang_vals, "Reserved"));
6738
106
      break;
6739
437
    case DOCSIS_CM_CAP_RNGHLDOFF_SUP:
6740
437
      proto_item_append_text(ti,
6741
437
                 "Ranging ID ");
6742
437
      if (tlv_len == 4)
6743
102
      {
6744
102
        proto_item_append_text(ti,
6745
102
            "(0x%04x)", (val_other[0] << sizeof(uint8_t)) + val_other[1]);
6746
102
        proto_item_append_text(ti,
6747
102
            " Component Bit Mask ");
6748
102
        proto_item_append_text(ti,
6749
102
            "(0x%04x)", (val_other[2] << sizeof(uint8_t)) + val_other[3]);
6750
102
      }
6751
335
      else
6752
335
      {
6753
335
        proto_item_append_text(ti,
6754
335
            " (Invalid Length %u : Should be 4",
6755
335
            tlv_len);
6756
335
      }
6757
437
      break;
6758
219
    case DOCSIS_CM_CAP_USSYMRATE_SUP:
6759
219
      proto_item_append_text(ti,
6760
219
                 "0x%02x", val_byte);
6761
219
      break;
6762
95
    case DOCSIS_CM_CAP_FCTF_SUP:
6763
95
      proto_item_append_text(ti,
6764
95
                 "%s",
6765
95
                 val_to_str_const(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
6766
95
      break;
6767
131
    case DOCSIS_CM_CAP_MULTDSIDFW_SUP:
6768
131
      proto_item_append_text(ti,
6769
131
                 "%s",
6770
131
                 val_to_str_const(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
6771
131
      break;
6772
15.1k
    }
6773
6774
15.0k
    subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6775
15.0k
    if (tlv_type == DOCSIS_CM_CAP_RNGHLDOFF_SUP && tlv_len >= 4)
6776
166
    {
6777
166
      static int * const flags[] = {
6778
166
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
6779
166
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
6780
166
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
6781
166
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
6782
166
        NULL
6783
166
      };
6784
166
      val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6785
6786
166
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6787
166
    }
6788
15.0k
    if (tlv_type == DOCSIS_CM_CAP_USSYMRATE_SUP)
6789
219
    {
6790
219
      static int * const flags[] = {
6791
219
        &hf_dhcp_docsis_cm_cap_ussymrate_160,
6792
219
        &hf_dhcp_docsis_cm_cap_ussymrate_320,
6793
219
        &hf_dhcp_docsis_cm_cap_ussymrate_640,
6794
219
        &hf_dhcp_docsis_cm_cap_ussymrate_1280,
6795
219
        &hf_dhcp_docsis_cm_cap_ussymrate_2560,
6796
219
        &hf_dhcp_docsis_cm_cap_ussymrate_5120,
6797
219
        NULL
6798
219
      };
6799
6800
219
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 1, flags, val_byte);
6801
219
    }
6802
15.0k
    if (tlv_type == DOCSIS_CM_CAP_Opt802MPLSSup && tlv_len >= 4)
6803
90
    {
6804
90
      static int * const flags[] = {
6805
90
        &hf_dhcp_docsis_cm_cap_mpls_stpid,
6806
90
        &hf_dhcp_docsis_cm_cap_mpls_svid,
6807
90
        &hf_dhcp_docsis_cm_cap_mpls_spcp,
6808
90
        &hf_dhcp_docsis_cm_cap_mpls_sdei,
6809
90
        &hf_dhcp_docsis_cm_cap_mpls_ctpid,
6810
90
        &hf_dhcp_docsis_cm_cap_mpls_cvid,
6811
90
        &hf_dhcp_docsis_cm_cap_mpls_cpcp,
6812
90
        &hf_dhcp_docsis_cm_cap_mpls_ccfi,
6813
90
        &hf_dhcp_docsis_cm_cap_mpls_stci,
6814
90
        &hf_dhcp_docsis_cm_cap_mpls_ctci,
6815
90
        &hf_dhcp_docsis_cm_cap_mpls_itpid,
6816
90
        &hf_dhcp_docsis_cm_cap_mpls_isid,
6817
90
        &hf_dhcp_docsis_cm_cap_mpls_itci,
6818
90
        &hf_dhcp_docsis_cm_cap_mpls_ipcp,
6819
90
        &hf_dhcp_docsis_cm_cap_mpls_idei,
6820
90
        &hf_dhcp_docsis_cm_cap_mpls_iuca,
6821
90
        &hf_dhcp_docsis_cm_cap_mpls_btpid,
6822
90
        &hf_dhcp_docsis_cm_cap_mpls_btci,
6823
90
        &hf_dhcp_docsis_cm_cap_mpls_bpcp,
6824
90
        &hf_dhcp_docsis_cm_cap_mpls_bdei,
6825
90
        &hf_dhcp_docsis_cm_cap_mpls_bvid,
6826
90
        &hf_dhcp_docsis_cm_cap_mpls_bda,
6827
90
        &hf_dhcp_docsis_cm_cap_mpls_bsa,
6828
90
        &hf_dhcp_docsis_cm_cap_mpls_tc,
6829
90
        &hf_dhcp_docsis_cm_cap_mpls_label,
6830
90
        NULL
6831
90
      };
6832
90
      val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6833
6834
90
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6835
90
    }
6836
15.0k
    if (opt125)
6837
12.8k
    {
6838
12.8k
      off += (tlv_len) + 2;
6839
12.8k
    }
6840
2.16k
    else
6841
2.16k
    {
6842
2.16k
      off += (tlv_len *2) + 4;
6843
2.16k
    }
6844
6845
15.0k
  }
6846
744
}
6847
6848
static bool
6849
dissect_packetcable_cm_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6850
1.16k
{
6851
1.16k
  uint8_t* vendor_id;
6852
6853
1.16k
  if (tvb_reported_length(tvb) < 10) {
6854
114
    return false;
6855
114
  }
6856
6857
1.05k
  vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 10, ENC_ASCII|ENC_NA);
6858
1.05k
  if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP11) == 0) ||
6859
1.02k
    (strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP20) == 0)) {
6860
70
    dissect_docsis_cm_cap(pinfo, tree, tvb, 0, tvb_reported_length(tvb), false);
6861
70
    return true;
6862
70
  }
6863
6864
982
  if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP30) == 0)) {
6865
1
    proto_tree_add_item(tree, hf_dhcp_option_vendor_class_data, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
6866
1
    return true;
6867
1
  }
6868
6869
981
  return false;
6870
982
}
6871
6872
static bool
6873
dissect_apple_bsdp_vendor_id_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6874
6875
1.25k
{
6876
1.25k
  int vendor_id_len = (int)strlen(APPLE_BSDP_CLIENT);
6877
1.25k
  if ((int)tvb_reported_length(tvb) < vendor_id_len) {
6878
115
    return false;
6879
115
  }
6880
6881
1.13k
  if (tvb_memeql(tvb, 0, (const uint8_t*)APPLE_BSDP_CLIENT, vendor_id_len) == 0) {
6882
67
    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);
6883
67
    return true;
6884
67
  }
6885
6886
1.06k
  return false;
6887
1.13k
}
6888
6889
6890
/* Definitions specific to PKT-SP-PROV-I05-021127 begin with "PKT_CCC_I05".
6891
   Definitions specific to IETF draft 5 and RFC 3495 begin with "PKT_CCC_IETF".
6892
   Shared definitions begin with "PKT_CCC".
6893
 */
6894
456
#define PKT_CCC_PRI_DHCP       1
6895
637
#define PKT_CCC_SEC_DHCP       2
6896
0
#define PKT_CCC_I05_SNMP       3
6897
319
#define PKT_CCC_IETF_PROV_SRV  3
6898
0
#define PKT_CCC_I05_PRI_DNS    4
6899
478
#define PKT_CCC_IETF_AS_KRB    4
6900
0
#define PKT_CCC_I05_SEC_DNS    5
6901
292
#define PKT_CCC_IETF_AP_KRB    5
6902
231
#define PKT_CCC_KRB_REALM      6
6903
405
#define PKT_CCC_TGT_FLAG       7
6904
272
#define PKT_CCC_PROV_TIMER     8
6905
0
#define PKT_CCC_CMS_FQDN       9
6906
155
#define PKT_CCC_IETF_SEC_TKT   9
6907
0
#define PKT_CCC_AS_KRB        10
6908
0
#define PKT_CCC_AP_KRB        11
6909
0
#define PKT_CCC_MTA_KRB_CLEAR 12
6910
6911
static const value_string pkt_i05_ccc_opt_vals[] = {
6912
  { PKT_CCC_PRI_DHCP,   "Primary DHCP Server" },
6913
  { PKT_CCC_SEC_DHCP,   "Secondary DHCP Server" },
6914
  { PKT_CCC_I05_SNMP,   "SNMP Entity" },
6915
  { PKT_CCC_I05_PRI_DNS,    "Primary DNS Server" },
6916
  { PKT_CCC_I05_SEC_DNS,    "Secondary DNS Server" },
6917
  { PKT_CCC_KRB_REALM,    "Kerberos Realm" },
6918
  { PKT_CCC_TGT_FLAG,   "MTA should fetch TGT?" },
6919
  { PKT_CCC_PROV_TIMER,   "Provisioning Timer" },
6920
  { PKT_CCC_CMS_FQDN,   "CMS FQDN" },
6921
  { PKT_CCC_AS_KRB,   "AS-REQ/AS-REP Backoff and Retry" },
6922
  { PKT_CCC_AP_KRB,   "AP-REQ/AP-REP Backoff and Retry" },
6923
  { PKT_CCC_MTA_KRB_CLEAR,  "MTA should clear Kerberos tickets?" },
6924
  { 0, NULL },
6925
};
6926
6927
static const value_string pkt_draft5_ccc_opt_vals[] = {
6928
  { PKT_CCC_PRI_DHCP,   "TSP's Primary DHCP Server" },
6929
  { PKT_CCC_SEC_DHCP,   "TSP's Secondary DHCP Server" },
6930
  { PKT_CCC_IETF_PROV_SRV,  "TSP's Provisioning Server" },
6931
  { PKT_CCC_IETF_AS_KRB,    "TSP's AS-REQ/AS-REP Backoff and Retry" },
6932
  { PKT_CCC_IETF_AP_KRB,    "TSP's AP-REQ/AP-REP Backoff and Retry" },
6933
  { PKT_CCC_KRB_REALM,    "TSP's Kerberos Realm Name" },
6934
  { PKT_CCC_TGT_FLAG,   "TSP's Ticket Granting Server Utilization" },
6935
  { PKT_CCC_PROV_TIMER,   "TSP's Provisioning Timer Value" },
6936
  { PKT_CCC_IETF_SEC_TKT,   "PacketCable Security Ticket Control" },
6937
  { 0, NULL },
6938
};
6939
6940
static const value_string pkt_i05_ccc_ticket_ctl_vals[] = {
6941
  { 1, "Invalidate Provisioning Application Server's ticket" },
6942
  { 2, "Invalidate all CMS Application Server tickets" },
6943
  { 3, "Invalidate all Application Server tickets" },
6944
  { 0, NULL },
6945
};
6946
6947
static unsigned
6948
dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
6949
          tvbuff_t *tvb, unsigned optoff, unsigned optend)
6950
0
{
6951
0
  unsigned    suboptoff = optoff;
6952
0
  uint8_t     subopt, subopt_len, fetch_tgt, timer_val, ticket_ctl;
6953
0
  proto_tree *pkt_s_tree;
6954
0
  proto_item *vti;
6955
6956
0
  subopt = tvb_get_uint8(tvb, optoff);
6957
0
  suboptoff++;
6958
6959
0
  if (suboptoff >= optend) {
6960
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
6961
0
                  "Suboption %d: no room left in option for suboption length", subopt);
6962
0
    return (optend);
6963
0
  }
6964
6965
0
  subopt_len = tvb_get_uint8(tvb, optoff);
6966
0
  suboptoff++;
6967
6968
0
  vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_i05_ccc_suboption, tvb, optoff, 1, subopt);
6969
0
  proto_item_set_len(vti, subopt_len + 2);
6970
0
  proto_item_append_text(vti, ": ");
6971
6972
0
  switch (subopt) {
6973
6974
0
  case PKT_CCC_PRI_DHCP: /* String values */
6975
0
  case PKT_CCC_SEC_DHCP:
6976
0
  case PKT_CCC_I05_SNMP:
6977
0
  case PKT_CCC_I05_PRI_DNS:
6978
0
  case PKT_CCC_I05_SEC_DNS:
6979
0
  case PKT_CCC_KRB_REALM:
6980
0
  case PKT_CCC_CMS_FQDN:
6981
0
    proto_item_append_text(vti, "%s (%u byte%s)",
6982
0
               tvb_format_stringzpad(pinfo->pool, tvb, suboptoff, subopt_len),
6983
0
               subopt_len,
6984
0
               plurality(subopt_len, "", "s") );
6985
0
    suboptoff += subopt_len;
6986
0
    break;
6987
6988
0
  case PKT_CCC_TGT_FLAG:
6989
0
    if (suboptoff+1 > optend) {
6990
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6991
0
      return (optend);
6992
0
    }
6993
0
    fetch_tgt = tvb_get_uint8(tvb, suboptoff);
6994
0
    proto_item_append_text(vti, "%s (%u byte%s%s)",
6995
0
               fetch_tgt ? "Yes" : "No",
6996
0
               subopt_len,
6997
0
               plurality(subopt_len, "", "s"),
6998
0
               subopt_len != 1 ? " [Invalid]" : "");
6999
0
    suboptoff += subopt_len;
7000
0
    break;
7001
7002
0
  case PKT_CCC_PROV_TIMER:
7003
0
    if (suboptoff+1 > optend) {
7004
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7005
0
      return (optend);
7006
0
    }
7007
0
    timer_val = tvb_get_uint8(tvb, suboptoff);
7008
0
    proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
7009
0
               timer_val > 30 ? " [Invalid]" : "",
7010
0
               subopt_len,
7011
0
               plurality(subopt_len, "", "s"),
7012
0
               subopt_len != 1 ? " [Invalid]" : "");
7013
0
    suboptoff += subopt_len;
7014
0
    break;
7015
7016
0
  case PKT_CCC_AS_KRB:
7017
0
    if (suboptoff+12 > optend) {
7018
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7019
0
      return (optend);
7020
0
    }
7021
0
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7022
0
               plurality(subopt_len, "", "s"),
7023
0
               subopt_len != 12 ? " [Invalid]" : "");
7024
0
    if (subopt_len == 12) {
7025
0
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7026
0
      proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7027
0
      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);
7028
0
      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);
7029
0
    }
7030
0
    suboptoff += subopt_len;
7031
0
    break;
7032
7033
0
  case PKT_CCC_AP_KRB:
7034
0
    if (suboptoff+12 > optend) {
7035
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7036
0
      return (optend);
7037
0
    }
7038
0
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7039
0
               plurality(subopt_len, "", "s"),
7040
0
               subopt_len != 12 ? " [Invalid]" : "");
7041
0
    if (subopt_len == 12) {
7042
0
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7043
0
      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);
7044
0
      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);
7045
0
      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);
7046
0
    }
7047
0
    suboptoff += subopt_len;
7048
0
    break;
7049
7050
0
  case PKT_CCC_MTA_KRB_CLEAR:
7051
0
    if (suboptoff+1 > optend) {
7052
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7053
0
      return (optend);
7054
0
    }
7055
0
    ticket_ctl = tvb_get_uint8(tvb, suboptoff);
7056
0
    proto_item_append_text(vti, "%s (%u) (%u byte%s%s)",
7057
0
               val_to_str_const (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
7058
0
               ticket_ctl,
7059
0
               subopt_len,
7060
0
               plurality(subopt_len, "", "s"),
7061
0
               subopt_len != 1 ? " [Invalid]" : "");
7062
0
    suboptoff += subopt_len;
7063
0
    break;
7064
7065
0
  default:
7066
0
    suboptoff += subopt_len;
7067
0
    break;
7068
7069
0
  }
7070
0
  return suboptoff;
7071
0
}
7072
7073
static int hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server;
7074
static int hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management;
7075
7076
static unsigned
7077
dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
7078
           tvbuff_t *tvb, unsigned optoff, unsigned optend, int revision)
7079
4.39k
{
7080
4.39k
  unsigned      suboptoff     = optoff;
7081
4.39k
  uint8_t       subopt, subopt_len;
7082
4.39k
  uint8_t       prov_type, fetch_tgt, timer_val;
7083
4.39k
  uint16_t        sec_tcm;
7084
4.39k
  proto_tree   *pkt_s_tree;
7085
4.39k
  proto_item   *vti;
7086
4.39k
  int       max_timer_val = 255;
7087
4.39k
  const char *dns_name;
7088
4.39k
  int      dns_name_len;
7089
7090
4.39k
  subopt = tvb_get_uint8(tvb, suboptoff);
7091
4.39k
  suboptoff++;
7092
7093
4.39k
  if (suboptoff >= optend) {
7094
7
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
7095
7
                  "Suboption %d: no room left in option for suboption length", subopt);
7096
7
    return (optend);
7097
7
  }
7098
4.39k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
7099
4.39k
  suboptoff++;
7100
7101
4.39k
  vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_ietf_ccc_suboption, tvb, optoff, 1, subopt);
7102
4.39k
  proto_item_set_len(vti, subopt_len + 2);
7103
4.39k
  proto_item_append_text(vti, ": ");
7104
7105
4.39k
  switch (subopt) {
7106
7107
456
  case PKT_CCC_PRI_DHCP: /* IPv4 values */
7108
637
  case PKT_CCC_SEC_DHCP:
7109
637
    if (suboptoff+4 > optend) {
7110
16
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7111
16
      return (optend);
7112
16
    }
7113
621
    proto_item_append_text(vti, "%s (%u byte%s%s)",
7114
621
               tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7115
621
               subopt_len,
7116
621
               plurality(subopt_len, "", "s"),
7117
621
               subopt_len != 4 ? " [Invalid]" : "");
7118
621
    suboptoff += subopt_len;
7119
621
    break;
7120
7121
319
  case PKT_CCC_IETF_PROV_SRV:
7122
319
    if (suboptoff+1 > optend) {
7123
1
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7124
1
      return (optend);
7125
1
    }
7126
318
    prov_type = tvb_get_uint8(tvb, suboptoff);
7127
318
    suboptoff += 1;
7128
318
    switch (prov_type) {
7129
7130
95
    case 0:
7131
95
      get_dns_name(pinfo->pool, tvb, suboptoff, subopt_len, suboptoff, (const char **)&dns_name, &dns_name_len);
7132
95
      proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7133
95
                 subopt_len - 1, plurality(subopt_len, "", "s") );
7134
95
      break;
7135
7136
90
    case 1:
7137
90
      if (suboptoff+4 > optend) {
7138
4
        expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7139
4
        return (optend);
7140
4
      }
7141
86
      proto_item_append_text(vti, "%s (%u byte%s%s)",
7142
86
                 tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7143
86
                 subopt_len,
7144
86
                 plurality(subopt_len, "", "s"),
7145
86
                 subopt_len != 5 ? " [Invalid]" : "");
7146
86
      break;
7147
7148
133
    default:
7149
133
      proto_item_append_text(vti, "Invalid type: %u (%u byte%s)",
7150
133
                 prov_type,
7151
133
                 subopt_len,
7152
133
                 plurality(subopt_len, "", "s") );
7153
133
      break;
7154
318
    }
7155
311
    suboptoff += subopt_len - 1;
7156
311
    break;
7157
7158
478
  case PKT_CCC_IETF_AS_KRB:
7159
478
    if (suboptoff+12 > optend) {
7160
7
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7161
7
      return (optend);
7162
7
    }
7163
471
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7164
471
               plurality(subopt_len, "", "s"),
7165
471
               subopt_len != 12 ? " [Invalid]" : "");
7166
471
    if (subopt_len == 12) {
7167
37
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7168
37
      proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7169
37
      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);
7170
37
      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);
7171
37
    }
7172
471
    suboptoff += subopt_len;
7173
471
    break;
7174
7175
292
  case PKT_CCC_IETF_AP_KRB:
7176
292
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7177
292
               plurality(subopt_len, "", "s"),
7178
292
               subopt_len != 12 ? " [Invalid]" : "");
7179
292
    if (subopt_len == 12) {
7180
37
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7181
37
      proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7182
37
      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);
7183
37
      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);
7184
37
    }
7185
292
    suboptoff += subopt_len;
7186
292
    break;
7187
7188
231
  case PKT_CCC_KRB_REALM: /* String values */
7189
231
    get_dns_name(pinfo->pool, tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
7190
231
    proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7191
231
               subopt_len, plurality(subopt_len, "", "s") );
7192
231
    suboptoff += subopt_len;
7193
231
    break;
7194
7195
405
  case PKT_CCC_TGT_FLAG:
7196
405
    if (suboptoff+1 > optend) {
7197
3
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7198
3
      return (optend);
7199
3
    }
7200
402
    fetch_tgt = tvb_get_uint8(tvb, suboptoff);
7201
402
    proto_item_append_text(vti, "%s (%u byte%s%s)",
7202
402
               fetch_tgt ? "Yes" : "No",
7203
402
               subopt_len,
7204
402
               plurality(subopt_len, "", "s"),
7205
402
               subopt_len != 1 ? " [Invalid]" : "");
7206
402
    suboptoff += 1;
7207
402
    break;
7208
7209
272
  case PKT_CCC_PROV_TIMER:
7210
272
    if (suboptoff+1 > optend) {
7211
3
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7212
3
      return (optend);
7213
3
    }
7214
269
    if (revision == PACKETCABLE_CCC_DRAFT5)
7215
0
      max_timer_val = 30;
7216
269
    timer_val = tvb_get_uint8(tvb, suboptoff);
7217
269
    proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
7218
269
               timer_val > max_timer_val ? " [Invalid]" : "",
7219
269
               subopt_len,
7220
269
               plurality(subopt_len, "", "s"),
7221
269
               subopt_len != 1 ? " [Invalid]" : "");
7222
269
    suboptoff += 1;
7223
269
    break;
7224
7225
155
  case PKT_CCC_IETF_SEC_TKT:
7226
155
    if (suboptoff+2 > optend) {
7227
2
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7228
2
      return (optend);
7229
2
    }
7230
153
    sec_tcm = tvb_get_ntohs(tvb, suboptoff);
7231
153
    proto_item_append_text(vti, "0x%04x (%u byte%s%s)", sec_tcm, subopt_len,
7232
153
               plurality(subopt_len, "", "s"),
7233
153
               subopt_len != 2 ? " [Invalid]" : "");
7234
153
    if (subopt_len == 2) {
7235
41
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7236
41
      proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server, tvb, suboptoff, 2, sec_tcm);
7237
41
      proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management, tvb, suboptoff, 2, sec_tcm);
7238
41
    }
7239
153
    suboptoff += subopt_len;
7240
153
    break;
7241
7242
1.60k
  default:
7243
1.60k
    suboptoff += subopt_len;
7244
1.60k
    break;
7245
4.39k
  }
7246
4.34k
  return suboptoff;
7247
4.39k
}
7248
7249
static int
7250
dissect_dhcpopt_packetcable_ccc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7251
235
{
7252
235
  unsigned offset = 0;
7253
7254
4.61k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
7255
4.39k
    switch (pkt_ccc_protocol_version) {
7256
7257
0
    case PACKETCABLE_CCC_I05:
7258
0
      offset = dissect_packetcable_i05_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
7259
0
      break;
7260
0
    case PACKETCABLE_CCC_DRAFT5:
7261
4.39k
    case PACKETCABLE_CCC_RFC_3495:
7262
4.39k
      offset = dissect_packetcable_ietf_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb), pkt_ccc_protocol_version);
7263
4.39k
      break;
7264
0
    default: /* XXX Should we do something here? */
7265
0
      break;
7266
4.39k
    }
7267
4.39k
  }
7268
7269
221
  return tvb_captured_length(tvb);
7270
235
}
7271
7272
739
#define BOOTREQUEST 1
7273
58
#define BOOTREPLY 2
7274
7275
static const value_string op_vals[] = {
7276
  { BOOTREQUEST,  "Boot Request" },
7277
  { BOOTREPLY,  "Boot Reply" },
7278
  { 0,    NULL }
7279
};
7280
7281
static int
7282
dissect_dhcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7283
24.4k
{
7284
24.4k
  proto_tree   *bp_tree;
7285
24.4k
  proto_item   *bp_ti, *ti;
7286
24.4k
  proto_item   *file_ti, *sname_ti;
7287
24.4k
  proto_item   *fi, *hidden_item;
7288
24.4k
  uint8_t       op;
7289
24.4k
  uint8_t       htype, hlen;
7290
24.4k
  unsigned      voff, eoff; /* vendor offset, end offset */
7291
24.4k
  unsigned      tmpvoff, tmpvoff_end;
7292
24.4k
  uint32_t        ip_addr;
7293
24.4k
  bool          at_end;
7294
24.4k
  bool          isProxyDhcp;
7295
24.4k
  const char   *dhcp_type            = NULL;
7296
24.4k
  const uint8_t *vendor_class_id           = NULL;
7297
24.4k
  uint16_t        flags, secs;
7298
24.4k
  unsigned      offset_delta;
7299
24.4k
  uint8_t       overload             = 0; /* DHCP option overload */
7300
24.4k
  static int * const dhcp_flags[] = {
7301
24.4k
    &hf_dhcp_flags_broadcast,
7302
24.4k
    &hf_dhcp_flags_reserved,
7303
24.4k
    NULL
7304
24.4k
  };
7305
7306
24.4k
  if (pinfo->srcport == PROXYDHCP_UDP_PORT ||
7307
24.4k
      pinfo->destport == PROXYDHCP_UDP_PORT) {
7308
    /* The "DHCP magic" is mandatory for proxyDHCP. Use it as a heuristic. */
7309
0
    if (!tvb_bytes_exist(tvb, VENDOR_INFO_OFFSET, 4) ||
7310
0
        tvb_get_ntohl(tvb, VENDOR_INFO_OFFSET) != 0x63825363) {
7311
   /* Not a DHCP packet at all. */
7312
0
      return 0;
7313
0
    }
7314
0
    isProxyDhcp = true;
7315
24.4k
  } else {
7316
24.4k
    isProxyDhcp = false;
7317
24.4k
  }
7318
7319
24.4k
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "BOOTP");
7320
  /*
7321
   * In case we throw an exception fetching the opcode, etc.
7322
   */
7323
24.4k
  col_clear(pinfo->cinfo, COL_INFO);
7324
7325
24.4k
  op = tvb_get_uint8(tvb, 0);
7326
24.4k
  htype = tvb_get_uint8(tvb, 1);
7327
24.4k
  hlen = tvb_get_uint8(tvb, 2);
7328
24.4k
  switch (op) {
7329
7330
739
  case BOOTREQUEST:
7331
739
    if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7332
287
        && hlen == 6) {
7333
186
      col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
7334
186
             tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype),
7335
186
             tvb_get_ether_name(tvb, 28));
7336
186
    }
7337
553
    else {
7338
553
      col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
7339
553
             tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7340
553
    }
7341
739
    break;
7342
7343
58
  case BOOTREPLY:
7344
58
    col_set_str(pinfo->cinfo, COL_INFO, "Boot Reply");
7345
58
    break;
7346
7347
23.6k
  default:
7348
23.6k
    col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)", op);
7349
23.6k
    break;
7350
24.4k
  }
7351
7352
24.4k
  voff = VENDOR_INFO_OFFSET;
7353
7354
  /* rfc2132 says it SHOULD exist, not that it MUST exist */
7355
24.4k
  if (tvb_bytes_exist(tvb, voff, 4) &&
7356
24.0k
      (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7357
8.99k
    voff += 4;
7358
15.4k
  } else {
7359
15.4k
    voff += 64;
7360
15.4k
  }
7361
24.4k
  eoff = tvb_reported_length(tvb);
7362
7363
24.4k
  bp_ti = proto_tree_add_item(tree, proto_dhcp, tvb, 0, -1, ENC_NA);
7364
24.4k
  bp_tree = proto_item_add_subtree(bp_ti, ett_dhcp);
7365
7366
24.4k
  wmem_map_t *rfc3396_map = wmem_map_new(pinfo->pool, g_direct_hash, g_direct_equal);
7367
  /*
7368
   * In the first pass, we just look for the overload, DHCP message type
7369
   * and Vendor class identifier options, and any repeated options for
7370
   * RFC 3396 long option concatenation.
7371
   */
7372
24.4k
  tmpvoff = voff;
7373
24.4k
  at_end = false;
7374
69.5k
  while (tmpvoff < eoff && !at_end) {
7375
45.1k
    offset_delta = dhcp_option(tvb, pinfo, NULL, tmpvoff, eoff, true, &at_end,
7376
45.1k
        &dhcp_type, &vendor_class_id, &overload, rfc3396_map);
7377
45.1k
    if (offset_delta <= 0) {
7378
0
      proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7379
0
          tvb, tmpvoff, eoff);
7380
0
      return tmpvoff;
7381
0
    }
7382
45.1k
    tmpvoff += offset_delta;
7383
45.1k
  }
7384
7385
  /*
7386
   * If there was a DHCP message type option, flag this packet
7387
   * as DHCP.
7388
   */
7389
24.4k
  if (dhcp_type != NULL) {
7390
    /*
7391
     * Yes, this is a DHCP packet, and "dhcp_type" is the
7392
     * packet type.
7393
     */
7394
94
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCP");
7395
7396
94
    col_add_fstr(pinfo->cinfo, COL_INFO, "%sDHCP %-8s - Transaction ID 0x%x",
7397
94
           isProxyDhcp ? "proxy" : "", dhcp_type, tvb_get_ntohl(tvb, 4));
7398
94
    tap_queue_packet( dhcp_bootp_tap, pinfo, dhcp_type);
7399
94
  }
7400
7401
  /*
7402
   * OK, now populate the protocol tree.
7403
   */
7404
7405
24.4k
  proto_tree_add_uint(bp_tree, hf_dhcp_type, tvb,
7406
24.4k
           0, 1,
7407
24.4k
           op);
7408
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_hw_type, tvb,
7409
24.4k
           1, 1, ENC_BIG_ENDIAN);
7410
24.4k
  proto_tree_add_uint(bp_tree, hf_dhcp_hw_len, tvb,
7411
24.4k
          2, 1, hlen);
7412
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_hops, tvb,
7413
24.4k
          3, 1, ENC_BIG_ENDIAN);
7414
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_id, tvb,
7415
24.4k
          4, 4, ENC_BIG_ENDIAN);
7416
  /*
7417
   * Windows (98, XP and Vista tested) sends the "secs" value on
7418
   * the wire formatted as little-endian. See if the LE value
7419
   * makes sense, if autodetect is used.
7420
   */
7421
24.4k
  if (dhcp_secs_endian == DHCP_SECS_ENDIAN_AUTODETECT) {
7422
24.3k
    secs = tvb_get_letohs(tvb, 8);
7423
24.3k
    if (secs > 0 && secs <= 0xff) {
7424
1.92k
      ti = proto_tree_add_uint(bp_tree, hf_dhcp_secs, tvb, 8, 2, secs);
7425
1.92k
      expert_add_info(pinfo, ti, &ei_dhcp_secs_le);
7426
22.4k
    } else {
7427
22.4k
      proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb,
7428
22.4k
          8, 2, ENC_BIG_ENDIAN);
7429
22.4k
    }
7430
24.3k
  }
7431
10
  else {
7432
    /* Use whatever endianness is configured */
7433
10
    proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb, 8, 2, dhcp_secs_endian);
7434
10
  }
7435
24.4k
  flags = tvb_get_ntohs(tvb, 10);
7436
24.4k
  fi = proto_tree_add_bitmask(bp_tree, tvb, 10, hf_dhcp_flags,
7437
24.4k
             ett_dhcp_flags, dhcp_flags, ENC_BIG_ENDIAN);
7438
24.4k
  proto_item_append_text(fi, " (%s)",
7439
24.4k
      (flags & BOOTP_BC) ? "Broadcast" : "Unicast");
7440
7441
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_client, tvb,
7442
24.4k
          12, 4, ENC_BIG_ENDIAN);
7443
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_your, tvb,
7444
24.4k
          16, 4, ENC_BIG_ENDIAN);
7445
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_server, tvb,
7446
24.4k
          20, 4, ENC_BIG_ENDIAN);
7447
24.4k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_relay, tvb,
7448
24.4k
          24, 4, ENC_BIG_ENDIAN);
7449
7450
24.4k
  if (hlen > 0 && hlen <= 16) {
7451
2.99k
    if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7452
301
        && hlen == 6)
7453
173
      proto_tree_add_item(bp_tree, hf_dhcp_hw_ether_addr, tvb, 28, 6, ENC_NA);
7454
2.82k
    else
7455
      /* The chaddr element is 16 bytes in length,
7456
         although only the first hlen bytes are used */
7457
2.82k
      proto_tree_add_bytes_format_value(bp_tree, hf_dhcp_hw_addr, tvb, 28, 16,
7458
2.82k
             NULL, "%s", tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7459
2.99k
    if ((16 - hlen) > 0)
7460
2.94k
      proto_tree_add_item(bp_tree, hf_dhcp_hw_addr_padding, tvb, 28+hlen, 16-hlen, ENC_NA);
7461
21.4k
  } else {
7462
21.4k
    proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_client_address_not_given, tvb, 28, 16);
7463
21.4k
  }
7464
7465
  /* RFC 3396 5: "The aggregate option buffer is made up of the optional
7466
   * parameters field, the file field, and the sname field, in that order.
7467
   * WARNING: This is not the physical ordering of these fields in the
7468
   * DHCP packet."
7469
   *
7470
   * RFC 3396 6: "[I]f an option were split into three parts and each
7471
   * part went into one of the possible option fields, the first part
7472
   * would go into the optional parameters field, the second part would
7473
   * go into the file field, and the third part would go into the sname
7474
   * field."
7475
   *
7476
   * So we process and reassemble the options in the order listed above,
7477
   * and move the items after processing so that they are generally in
7478
   * physical ordering in the tree. (Whichever ordering choice we make
7479
   * is bound to confused someone.)
7480
   */
7481
7482
24.4k
  if (overload & OPT_OVERLOAD_FILE) {
7483
17.0k
    file_ti = proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_boot_filename_overloaded_by_dhcp, tvb,
7484
17.0k
      FILE_NAME_OFFSET, FILE_NAME_LEN);
7485
17.0k
    tmpvoff = FILE_NAME_OFFSET;
7486
17.0k
    tmpvoff_end = FILE_NAME_OFFSET + FILE_NAME_LEN;
7487
17.0k
    at_end = false;
7488
98.7k
    while (tmpvoff < tmpvoff_end && !at_end) {
7489
81.7k
      tmpvoff += dhcp_option(tvb, pinfo, NULL, tmpvoff,
7490
81.7k
        tmpvoff_end, true, &at_end,
7491
81.7k
        &dhcp_type, &vendor_class_id,
7492
81.7k
        NULL, rfc3396_map);
7493
81.7k
    }
7494
17.0k
  } else {
7495
    /* Boot file is optional */
7496
7.39k
    if (tvb_get_uint8(tvb, FILE_NAME_OFFSET) != '\0') {
7497
2.37k
      file_ti = proto_tree_add_item(bp_tree, hf_dhcp_file, tvb,
7498
2.37k
             FILE_NAME_OFFSET,
7499
2.37k
             FILE_NAME_LEN, ENC_ASCII);
7500
5.02k
    } else {
7501
5.02k
      file_ti = proto_tree_add_string_format(bp_tree, hf_dhcp_file, tvb,
7502
5.02k
               FILE_NAME_OFFSET,
7503
5.02k
               FILE_NAME_LEN,
7504
5.02k
               "", "Boot file name not given");
7505
5.02k
    }
7506
7.39k
  }
7507
7508
7509
24.4k
  if (overload & OPT_OVERLOAD_SNAME) {
7510
23.6k
    sname_ti = proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_server_name_overloaded_by_dhcp, tvb,
7511
23.6k
      SERVER_NAME_OFFSET, SERVER_NAME_LEN);
7512
23.6k
    tmpvoff = SERVER_NAME_OFFSET;
7513
23.6k
    tmpvoff_end = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
7514
23.6k
    at_end = false;
7515
78.0k
    while (tmpvoff < tmpvoff_end && !at_end) {
7516
54.4k
      tmpvoff += dhcp_option(tvb, pinfo, NULL, tmpvoff,
7517
54.4k
        tmpvoff_end, true, &at_end,
7518
54.4k
        &dhcp_type, &vendor_class_id,
7519
54.4k
        NULL, rfc3396_map);
7520
54.4k
    }
7521
23.6k
  } else {
7522
    /* The server host name is optional */
7523
744
    if (tvb_get_uint8(tvb, SERVER_NAME_OFFSET) != '\0') {
7524
295
      sname_ti = proto_tree_add_item(bp_tree, hf_dhcp_server, tvb,
7525
295
             SERVER_NAME_OFFSET,
7526
295
             SERVER_NAME_LEN, ENC_ASCII);
7527
7528
449
    } else {
7529
449
      sname_ti = proto_tree_add_string_format(bp_tree, hf_dhcp_server, tvb,
7530
449
               SERVER_NAME_OFFSET,
7531
449
               SERVER_NAME_LEN,
7532
449
               "", "Server host name not given");
7533
449
    }
7534
744
  }
7535
7536
24.4k
  proto_tree_move_item(bp_tree, sname_ti, file_ti);
7537
7538
24.4k
  voff = VENDOR_INFO_OFFSET;
7539
24.4k
  if (dhcp_type == NULL) {
7540
23.8k
    hidden_item = proto_tree_add_boolean(bp_tree, hf_dhcp_bootp, tvb, 0, 0, 1);
7541
23.8k
    proto_item_set_hidden(hidden_item);
7542
23.8k
  }
7543
24.4k
  if (tvb_bytes_exist(tvb, voff, 4) &&
7544
24.0k
      (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7545
8.98k
    ip_addr = tvb_get_ipv4(tvb, voff);
7546
8.98k
    proto_tree_add_ipv4_format_value(bp_tree, hf_dhcp_cookie, tvb,
7547
8.98k
      voff, 4, ip_addr, "DHCP");
7548
8.98k
    voff += 4;
7549
15.4k
  } else {
7550
15.4k
    proto_tree_add_item(bp_tree, hf_dhcp_vendor_specific_options, tvb,
7551
15.4k
      voff, 64, ENC_NA);
7552
15.4k
    voff += 64;
7553
15.4k
  }
7554
7555
24.4k
  at_end = false;
7556
69.3k
  while (voff < eoff && !at_end) {
7557
44.9k
    offset_delta = dhcp_option(tvb, pinfo, bp_tree, voff, eoff, false, &at_end,
7558
44.9k
        &dhcp_type, &vendor_class_id, &overload, rfc3396_map);
7559
44.9k
    if (offset_delta <= 0) {
7560
0
      proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7561
0
          tvb, voff, eoff);
7562
0
      return voff;
7563
0
    }
7564
44.9k
    voff += offset_delta;
7565
44.9k
  }
7566
24.4k
  if ((dhcp_type != NULL) && (!at_end))
7567
208
  {
7568
208
    expert_add_info(pinfo, bp_ti, &ei_dhcp_end_option_missing);
7569
208
  }
7570
7571
24.4k
  if (overload & OPT_OVERLOAD_FILE) {
7572
17.0k
    proto_item *oti;
7573
17.0k
    proto_tree *overload_tree = proto_tree_add_subtree(bp_tree, tvb,
7574
17.0k
      FILE_NAME_OFFSET, FILE_NAME_LEN, ett_dhcp_filename_option, &oti,
7575
17.0k
      "Boot file name option overload");
7576
17.0k
    tmpvoff = FILE_NAME_OFFSET;
7577
17.0k
    tmpvoff_end = FILE_NAME_OFFSET + FILE_NAME_LEN;
7578
17.0k
    at_end = false;
7579
98.5k
    while (tmpvoff < tmpvoff_end && !at_end) {
7580
81.5k
      tmpvoff += dhcp_option(tvb, pinfo, overload_tree, tmpvoff,
7581
81.5k
        tmpvoff_end, false, &at_end,
7582
81.5k
        &dhcp_type, &vendor_class_id,
7583
81.5k
        NULL, rfc3396_map);
7584
81.5k
    }
7585
17.0k
    if (!at_end)
7586
13.8k
    {
7587
13.8k
      expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_file_end_missing);
7588
13.8k
    }
7589
17.0k
    proto_tree_move_item(bp_tree, file_ti, oti);
7590
17.0k
  }
7591
24.4k
  if (overload & OPT_OVERLOAD_SNAME) {
7592
23.3k
    proto_item *oti;
7593
23.3k
    proto_tree *overload_tree = proto_tree_add_subtree(bp_tree, tvb,
7594
23.3k
      SERVER_NAME_OFFSET, SERVER_NAME_LEN, ett_dhcp_server_hostname, &oti,
7595
23.3k
      "Server host name option overload");
7596
23.3k
    tmpvoff = SERVER_NAME_OFFSET;
7597
23.3k
    tmpvoff_end = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
7598
23.3k
    at_end = false;
7599
76.2k
    while (tmpvoff < tmpvoff_end && !at_end) {
7600
52.9k
      tmpvoff += dhcp_option(tvb, pinfo, overload_tree, tmpvoff,
7601
52.9k
        tmpvoff_end, false, &at_end,
7602
52.9k
        &dhcp_type, &vendor_class_id,
7603
52.9k
        NULL, rfc3396_map);
7604
52.9k
    }
7605
23.3k
    if (!at_end)
7606
5.04k
    {
7607
5.04k
      expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_sname_end_missing);
7608
5.04k
    }
7609
23.3k
    proto_tree_move_item(bp_tree, sname_ti, oti);
7610
23.3k
  }
7611
7612
24.4k
  if (voff < eoff) {
7613
    /*
7614
     * Padding after the end option.
7615
     */
7616
72
    proto_tree_add_item(bp_tree, hf_dhcp_option_padding, tvb, voff, eoff - voff, ENC_NA);
7617
72
  }
7618
7619
24.4k
  return tvb_captured_length(tvb);
7620
24.4k
}
7621
7622
static void
7623
dhcp_init_protocol(void)
7624
16
{
7625
16
  unsigned i;
7626
7627
  /* first copy default_dhcp_opt[] to dhcp_opt[].  This resets all values to default */
7628
16
  memcpy(dhcp_opt, default_dhcp_opt, sizeof(dhcp_opt));
7629
7630
16
  if ((num_dhcp_records_uat > 0) && (saved_uat_opts == NULL))
7631
0
  {
7632
0
    saved_uat_opts = wmem_list_new(NULL);
7633
0
  }
7634
7635
  /* Now apply the custom options */
7636
16
  for (i = 0; i < num_dhcp_records_uat; i++)
7637
0
  {
7638
0
    dhcp_opt[uat_dhcp_records[i].opt].text = wmem_strdup(wmem_file_scope(), uat_dhcp_records[i].text);
7639
0
    dhcp_opt[uat_dhcp_records[i].opt].ftype = uat_dhcp_records[i].ftype;
7640
0
    dhcp_opt[uat_dhcp_records[i].opt].phf = NULL;
7641
7642
    /* Apply the custom option to the dissection table*/
7643
0
    dissector_change_uint("dhcp.option", uat_dhcp_records[i].opt, dhcpopt_basic_handle);
7644
7645
    /* Save the option so it can be cleared later */
7646
0
    wmem_list_append(saved_uat_opts, GUINT_TO_POINTER(uat_dhcp_records[i].opt));
7647
0
  }
7648
16
}
7649
7650
static void
7651
dhcp_clear_uat_dhcpopt(void *data, void *user_data _U_)
7652
0
{
7653
0
  dissector_reset_uint("dhcp.option", GPOINTER_TO_UINT(data));
7654
0
}
7655
7656
static void
7657
dhcp_cleanup_protocol(void)
7658
0
{
7659
0
  if (saved_uat_opts != NULL) {
7660
0
    wmem_list_foreach(saved_uat_opts, dhcp_clear_uat_dhcpopt,
7661
0
        NULL);
7662
7663
0
    wmem_destroy_list(saved_uat_opts);
7664
0
    saved_uat_opts = NULL;
7665
0
  }
7666
0
}
7667
7668
7669
/* TAP STAT INFO */
7670
typedef enum
7671
{
7672
  MESSAGE_TYPE_COLUMN = 0,
7673
  PACKET_COLUMN
7674
} dhcp_stat_columns;
7675
7676
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"}};
7677
7678
static void dhcp_stat_init(stat_tap_table_ui* new_stat)
7679
0
{
7680
0
  const char *table_name = "DHCP Statistics";
7681
0
  int num_fields = array_length(dhcp_stat_fields);
7682
0
  stat_tap_table *table;
7683
0
  int i = 0;
7684
0
  stat_tap_table_item_type items[array_length(dhcp_stat_fields)];
7685
7686
0
  table = stat_tap_find_table(new_stat, table_name);
7687
0
  if (table) {
7688
0
    if (new_stat->stat_tap_reset_table_cb) {
7689
0
      new_stat->stat_tap_reset_table_cb(table);
7690
0
    }
7691
0
    return;
7692
0
  }
7693
7694
0
  table = stat_tap_init_table(table_name, num_fields, 0, NULL);
7695
0
  stat_tap_add_table(new_stat, table);
7696
7697
0
  memset(items, 0x0, sizeof(items));
7698
  /* Add a row for each value type */
7699
0
  while (opt53_text[i].strptr)
7700
0
  {
7701
0
    items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
7702
0
    items[MESSAGE_TYPE_COLUMN].value.string_value = opt53_text[i].strptr;
7703
0
    items[PACKET_COLUMN].type = TABLE_ITEM_UINT;
7704
0
    items[PACKET_COLUMN].value.uint_value = 0;
7705
7706
0
    stat_tap_init_table_row(table, i, num_fields, items);
7707
0
    i++;
7708
0
  }
7709
0
}
7710
7711
static tap_packet_status
7712
dhcp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_)
7713
0
{
7714
0
  stat_data_t* stat_data = (stat_data_t*)tapdata;
7715
0
  const char* value = (const char*)data;
7716
0
  stat_tap_table* table;
7717
0
  stat_tap_table_item_type* msg_data;
7718
0
  int idx;
7719
7720
0
  idx = str_to_val_idx(value, opt53_text);
7721
0
  if (idx < 0)
7722
0
    return TAP_PACKET_DONT_REDRAW;
7723
7724
0
  table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
7725
0
  msg_data = stat_tap_get_field_data(table, idx, PACKET_COLUMN);
7726
0
  msg_data->value.uint_value++;
7727
0
  stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data);
7728
7729
0
  return TAP_PACKET_REDRAW;
7730
0
}
7731
7732
static void
7733
dhcp_stat_reset(stat_tap_table* table)
7734
0
{
7735
0
  unsigned element;
7736
0
  stat_tap_table_item_type* item_data;
7737
7738
0
  for (element = 0; element < table->num_elements; element++)
7739
0
  {
7740
0
    item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN);
7741
0
    item_data->value.uint_value = 0;
7742
0
    stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
7743
0
  }
7744
0
}
7745
7746
void
7747
proto_register_dhcp(void)
7748
16
{
7749
16
  static const value_string dhcp_custom_type_vals[] = {
7750
16
    { ipv4,       "IP Address"},
7751
16
    { ipv4_list,      "IP Address List" },
7752
16
    { string,     "string" },
7753
16
    { bytes,      "bytes" },
7754
16
    { val_boolean,      "boolean" },
7755
16
    { val_u_byte,     "byte" },
7756
16
    { val_u_short,      "unsigned short" },
7757
16
    { val_u_short_list, "unsigned short list" },
7758
16
    { val_u_long,     "unsigned long" },
7759
16
    { time_in_s_secs,   "integer time in seconds" },
7760
16
    { time_in_u_secs,   "unsigned integer time in seconds" },
7761
16
    { 0x00, NULL }
7762
16
  };
7763
7764
16
  static hf_register_info hf[] = {
7765
16
    { &hf_dhcp_bootp,
7766
16
      { "Frame is BOOTP", "dhcp.bootp",
7767
16
        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
7768
16
        NULL, HFILL }},
7769
7770
16
    { &hf_dhcp_type,
7771
16
      { "Message type", "dhcp.type",
7772
16
        FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
7773
16
        NULL, HFILL }},
7774
7775
16
    { &hf_dhcp_hw_type,
7776
16
      { "Hardware type", "dhcp.hw.type",
7777
16
        FT_UINT8, BASE_HEX, VALS(arp_hrd_vals), 0x0,
7778
16
        NULL, HFILL }},
7779
7780
16
    { &hf_dhcp_hw_len,
7781
16
      { "Hardware address length", "dhcp.hw.len",
7782
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
7783
16
        NULL, HFILL }},
7784
7785
16
    { &hf_dhcp_hops,
7786
16
      { "Hops", "dhcp.hops",
7787
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
7788
16
        NULL, HFILL }},
7789
7790
16
    { &hf_dhcp_id,
7791
16
      { "Transaction ID", "dhcp.id",
7792
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
7793
16
        NULL, HFILL }},
7794
7795
16
    { &hf_dhcp_secs,
7796
16
      { "Seconds elapsed", "dhcp.secs",
7797
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
7798
16
        NULL, HFILL }},
7799
7800
16
    { &hf_dhcp_flags,
7801
16
      { "Bootp flags", "dhcp.flags",
7802
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
7803
16
        NULL, HFILL }},
7804
7805
16
    { &hf_dhcp_flags_broadcast,
7806
16
      { "Broadcast flag", "dhcp.flags.bc",
7807
16
        FT_BOOLEAN, 16, TFS(&flag_set_broadcast), BOOTP_BC,
7808
16
        NULL, HFILL }},
7809
7810
16
    { &hf_dhcp_flags_reserved,
7811
16
      { "Reserved flags", "dhcp.flags.reserved",
7812
16
        FT_UINT16, BASE_HEX, NULL, BOOTP_MBZ,
7813
16
        NULL, HFILL }},
7814
7815
16
    { &hf_dhcp_ip_client,
7816
16
      { "Client IP address", "dhcp.ip.client",
7817
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
7818
16
        NULL, HFILL }},
7819
7820
16
    { &hf_dhcp_ip_your,
7821
16
      { "Your (client) IP address", "dhcp.ip.your",
7822
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
7823
16
        NULL, HFILL }},
7824
7825
16
    { &hf_dhcp_ip_server,
7826
16
      { "Next server IP address", "dhcp.ip.server",
7827
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
7828
16
        NULL, HFILL }},
7829
7830
16
    { &hf_dhcp_ip_relay,
7831
16
      { "Relay agent IP address", "dhcp.ip.relay",
7832
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
7833
16
        NULL, HFILL }},
7834
7835
16
    { &hf_dhcp_hw_addr,
7836
16
      { "Client hardware address", "dhcp.hw.addr",
7837
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
7838
16
        NULL, HFILL }},
7839
7840
16
    { &hf_dhcp_hw_addr_padding,
7841
16
      { "Client hardware address padding", "dhcp.hw.addr_padding",
7842
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
7843
16
        NULL, HFILL }},
7844
7845
16
    { &hf_dhcp_hw_ether_addr,
7846
16
      { "Client MAC address", "dhcp.hw.mac_addr",
7847
16
        FT_ETHER, BASE_NONE, NULL, 0x0,
7848
16
        NULL, HFILL }},
7849
7850
16
    { &hf_dhcp_server,
7851
16
      { "Server host name", "dhcp.server",
7852
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7853
16
        NULL, HFILL }},
7854
7855
16
    { &hf_dhcp_file,
7856
16
      { "Boot file name", "dhcp.file",
7857
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7858
16
        NULL, HFILL }},
7859
7860
16
    { &hf_dhcp_cookie,
7861
16
      { "Magic cookie", "dhcp.cookie",
7862
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
7863
16
        NULL, HFILL }},
7864
7865
16
    { &hf_dhcp_vendor_specific_options,
7866
16
      { "Bootp vendor specific options", "dhcp.vendor_specific_options",
7867
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
7868
16
        NULL, HFILL }},
7869
7870
16
    { &hf_dhcp_fqdn_s,
7871
16
      { "Server", "dhcp.fqdn.s",
7872
16
      FT_BOOLEAN, 8, TFS(&tfs_server_client), F_FQDN_S,
7873
16
        "If true, server should do DDNS update", HFILL }},
7874
7875
16
    { &hf_dhcp_fqdn_o,
7876
16
      { "Server overrides", "dhcp.fqdn.o",
7877
16
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_o), F_FQDN_O,
7878
16
        "If true, server insists on doing DDNS update", HFILL }},
7879
7880
16
    { &hf_dhcp_fqdn_e,
7881
16
      { "Encoding", "dhcp.fqdn.e",
7882
16
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_e), F_FQDN_E,
7883
16
        "If true, name is binary encoded", HFILL }},
7884
7885
16
    { &hf_dhcp_fqdn_n,
7886
16
      { "Server DDNS", "dhcp.fqdn.n",
7887
16
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_n), F_FQDN_N,
7888
16
        "If true, server should not do any DDNS updates", HFILL }},
7889
7890
16
    { &hf_dhcp_fqdn_flags,
7891
16
      { "Flags", "dhcp.fqdn.flags",
7892
16
        FT_UINT8, BASE_HEX, NULL, 0,
7893
16
        NULL, HFILL }},
7894
7895
16
    { &hf_dhcp_fqdn_mbz,
7896
16
      { "Reserved flags", "dhcp.fqdn.mbz",
7897
16
        FT_UINT8, BASE_HEX, NULL, F_FQDN_MBZ,
7898
16
        NULL, HFILL }},
7899
7900
16
    { &hf_dhcp_fqdn_rcode1,
7901
16
      { "A-RR result", "dhcp.fqdn.rcode1",
7902
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
7903
16
        "Result code of A-RR update", HFILL }},
7904
7905
16
    { &hf_dhcp_fqdn_rcode2,
7906
16
      { "PTR-RR result", "dhcp.fqdn.rcode2",
7907
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
7908
16
        "Result code of PTR-RR update", HFILL }},
7909
7910
16
    { &hf_dhcp_fqdn_name,
7911
16
      { "Client name", "dhcp.fqdn.name",
7912
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7913
16
        "Name to register via DDNS", HFILL }},
7914
7915
16
    { &hf_dhcp_fqdn_asciiname,
7916
16
      { "Client name", "dhcp.fqdn.name",
7917
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7918
16
        "Name to register via DDNS", HFILL }},
7919
7920
16
    { &hf_dhcp_pkt_mta_cap_len,
7921
16
      { "MTA DC Length", "dhcp.vendor.pktc.mta_cap_len",
7922
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
7923
16
        "PacketCable MTA Device Capabilities Length", HFILL }},
7924
7925
16
    { &hf_dhcp_pkt_mta_cap_type,
7926
16
      { "Type", "dhcp.vendor.pktc.mta_cap_type",
7927
16
        FT_UINT16, BASE_DEC, VALS(pkt_mdc_type_vals), 0x0,
7928
16
        NULL, HFILL }},
7929
7930
16
    { &hf_dhcp_pkt_mdc_supp_flow_secure,
7931
16
      { "Secure Flow (Full Secure Provisioning Flow)", "dhcp.vendor.pktc.mdc.supp_flow.secure",
7932
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
7933
16
        NULL, HFILL }},
7934
7935
16
    { &hf_dhcp_pkt_mdc_supp_flow_hybrid,
7936
16
      { "Hybrid Flow", "dhcp.vendor.pktc.mdc.supp_flow.hybrid",
7937
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
7938
16
        NULL, HFILL }},
7939
7940
16
    { &hf_dhcp_pkt_mdc_supp_flow_basic,
7941
16
      { "Basic Flow", "dhcp.vendor.pktc.mdc.supp_flow.basic",
7942
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
7943
16
        NULL, HFILL }},
7944
7945
16
    { &hf_dhcp_pkt_mdc_mib_cl_mta,
7946
16
      { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta",
7947
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7948
16
        NULL, HFILL }},
7949
7950
16
    { &hf_dhcp_pkt_mdc_mib_cl_signaling,
7951
16
      { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling",
7952
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7953
16
        NULL, HFILL }},
7954
7955
16
    { &hf_dhcp_pkt_mdc_mib_cl_management_event,
7956
16
      { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_cl.mib.management_event",
7957
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7958
16
        NULL, HFILL }},
7959
7960
16
    { &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
7961
16
      { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta_extension",
7962
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
7963
16
        NULL, HFILL }},
7964
7965
16
    { &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
7966
16
      { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling_extension",
7967
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
7968
16
        NULL, HFILL }},
7969
7970
16
    { &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
7971
16
      { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mem_extension",
7972
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
7973
16
        NULL, HFILL }},
7974
7975
16
    { &hf_dhcp_pkt_mdc_mib_cl_reserved,
7976
16
      { "Reserved", "dhcp.vendor.pktc.mdc_cl.mib.reserved",
7977
16
        FT_UINT8, BASE_HEX, NULL, 0xC0,
7978
16
        NULL, HFILL }},
7979
7980
16
    { &hf_dhcp_pkt_mdc_mib_ietf_mta,
7981
16
      { "IETF MTA MIB", "dhcp.vendor.pktc.mdc_ietf.mib.mta",
7982
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7983
16
        NULL, HFILL }},
7984
7985
16
    { &hf_dhcp_pkt_mdc_mib_ietf_signaling,
7986
16
      { "IETF Signaling MIB", "dhcp.vendor.pktc.mdc_ietf.mib.signaling",
7987
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7988
16
        NULL, HFILL }},
7989
7990
16
    { &hf_dhcp_pkt_mdc_mib_ietf_management_event,
7991
16
      { "IETF Management Event MIB", "dhcp.vendor.pktc.mdc_ietf.mib.management_event",
7992
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7993
16
        NULL, HFILL }},
7994
7995
16
    { &hf_dhcp_pkt_mdc_mib_ietf_reserved,
7996
16
      { "Reserved", "dhcp.vendor.pktc.mdc_ietf.mib.reserved",
7997
16
        FT_UINT8, BASE_HEX, NULL, 0xF8,
7998
16
        NULL, HFILL }},
7999
8000
16
    { &hf_dhcp_pkt_mdc_mib_euro_mta,
8001
16
      { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta",
8002
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
8003
16
        NULL, HFILL }},
8004
8005
16
    { &hf_dhcp_pkt_mdc_mib_euro_signaling,
8006
16
      { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling",
8007
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
8008
16
        NULL, HFILL }},
8009
8010
16
    { &hf_dhcp_pkt_mdc_mib_euro_management_event,
8011
16
      { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_euro.mib.management_event",
8012
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
8013
16
        NULL, HFILL }},
8014
8015
16
    { &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
8016
16
      { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta_extension",
8017
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
8018
16
        NULL, HFILL }},
8019
8020
16
    { &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
8021
16
      { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling_extension",
8022
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
8023
16
        NULL, HFILL }},
8024
8025
16
    { &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
8026
16
      { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mem_extension",
8027
16
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
8028
16
        NULL, HFILL }},
8029
8030
16
    { &hf_dhcp_pkt_mdc_mib_euro_reserved,
8031
16
      { "Reserved", "dhcp.vendor.pktc.mdc_euro.mib.reserved",
8032
16
        FT_UINT8, BASE_HEX, NULL, 0xC0,
8033
16
        NULL, HFILL }},
8034
8035
16
    { &hf_dhcp_docsis_cm_cap_len,
8036
16
      { "CM DC Length", "dhcp.vendor.docsis.cm_cap_len",
8037
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8038
16
        "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
8039
8040
16
    { &hf_dhcp_docsis_cm_cap_type,
8041
16
      { "CM DC Type", "dhcp.docsis_cm_cap_type",
8042
16
        FT_UINT16, BASE_DEC, VALS(docsis_cm_cap_type_vals), 0x0,
8043
16
        "Docsis Cable Modem Device Capability type", HFILL }},
8044
8045
16
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
8046
16
      { "CM", "dhcp.docsis_cm_cap.ranging_hold_off.cm",
8047
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
8048
16
        NULL, HFILL }},
8049
8050
16
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
8051
16
      { "ePS or eRouter", "dhcp.docsis_cm_cap.ranging_hold_off.eps",
8052
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
8053
16
        NULL, HFILL }},
8054
8055
16
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
8056
16
      { "EMTA or EDVA", "dhcp.docsis_cm_cap.ranging_hold_off.emta",
8057
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
8058
16
        NULL, HFILL }},
8059
8060
16
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
8061
16
      { "DSG/eSTB", "dhcp.docsis_cm_cap.ranging_hold_off.dsg",
8062
16
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0008,
8063
16
        NULL, HFILL }},
8064
8065
8066
16
    { &hf_dhcp_docsis_cm_cap_mpls_stpid,
8067
16
      { "[IEEE 802.1ad] S-TPID", "dhcp.docsis_cm_cap.mpls.stpid",
8068
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8069
16
        NULL, HFILL }},
8070
8071
16
    { &hf_dhcp_docsis_cm_cap_mpls_svid,
8072
16
      { "[IEEE 802.1ad] S-VID", "dhcp.docsis_cm_cap.mpls.svid",
8073
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8074
16
        NULL, HFILL }},
8075
8076
16
    { &hf_dhcp_docsis_cm_cap_mpls_spcp,
8077
16
      { "[IEEE 802.1ad] S-PCP", "dhcp.docsis_cm_cap.mpls.spcp",
8078
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8079
16
        NULL, HFILL }},
8080
8081
16
    { &hf_dhcp_docsis_cm_cap_mpls_sdei,
8082
16
      { "[IEEE 802.1ad] S-DEI", "dhcp.docsis_cm_cap.mpls.sdei",
8083
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8084
16
        NULL, HFILL }},
8085
8086
16
    { &hf_dhcp_docsis_cm_cap_mpls_ctpid,
8087
16
      { "[IEEE 802.1ad] C-TPID", "dhcp.docsis_cm_cap.mpls.ctpid",
8088
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
8089
16
        NULL, HFILL }},
8090
8091
16
    { &hf_dhcp_docsis_cm_cap_mpls_cvid,
8092
16
      { "[IEEE 802.1ad] C-VID", "dhcp.docsis_cm_cap.mpls.cvid",
8093
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
8094
16
        NULL, HFILL }},
8095
8096
16
    { &hf_dhcp_docsis_cm_cap_mpls_cpcp,
8097
16
      { "[IEEE 802.1ad] C-PCP", "dhcp.docsis_cm_cap.mpls.cpcp",
8098
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
8099
16
        NULL, HFILL }},
8100
8101
16
    { &hf_dhcp_docsis_cm_cap_mpls_ccfi,
8102
16
      { "[IEEE 802.1ad] C-CFI", "dhcp.docsis_cm_cap.mpls.ccfi",
8103
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
8104
16
        NULL, HFILL }},
8105
8106
16
    { &hf_dhcp_docsis_cm_cap_mpls_stci,
8107
16
      { "[IEEE 802.1ad] S-TCI", "dhcp.docsis_cm_cap.mpls.stci",
8108
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
8109
16
        NULL, HFILL }},
8110
8111
16
    { &hf_dhcp_docsis_cm_cap_mpls_ctci,
8112
16
      { "[IEEE 802.1ad] C-TCI", "dhcp.docsis_cm_cap.mpls.ctci",
8113
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
8114
16
        NULL, HFILL }},
8115
8116
16
    { &hf_dhcp_docsis_cm_cap_mpls_itpid,
8117
16
      { "[IEEE 802.1ad] I-TPID", "dhcp.docsis_cm_cap.mpls.itpid",
8118
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
8119
16
        NULL, HFILL }},
8120
8121
16
    { &hf_dhcp_docsis_cm_cap_mpls_isid,
8122
16
      { "[IEEE 802.1ad] I-SID", "dhcp.docsis_cm_cap.mpls.isid",
8123
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
8124
16
        NULL, HFILL }},
8125
8126
16
    { &hf_dhcp_docsis_cm_cap_mpls_itci,
8127
16
      { "[IEEE 802.1ad] I-TCI", "dhcp.docsis_cm_cap.mpls.itci",
8128
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
8129
16
        NULL, HFILL }},
8130
8131
16
    { &hf_dhcp_docsis_cm_cap_mpls_ipcp,
8132
16
      { "[IEEE 802.1ad] I-PCP", "dhcp.docsis_cm_cap.mpls.ipcp",
8133
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
8134
16
        NULL, HFILL }},
8135
8136
16
    { &hf_dhcp_docsis_cm_cap_mpls_idei,
8137
16
      { "[IEEE 802.1ad] I-DEI", "dhcp.docsis_cm_cap.mpls.idei",
8138
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
8139
16
        NULL, HFILL }},
8140
8141
16
    { &hf_dhcp_docsis_cm_cap_mpls_iuca,
8142
16
      { "[IEEE 802.1ad] I-UCA", "dhcp.docsis_cm_cap.mpls.iuca",
8143
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
8144
16
        NULL, HFILL }},
8145
8146
16
    { &hf_dhcp_docsis_cm_cap_mpls_btpid,
8147
16
      { "[IEEE 802.1ad] B-TPID", "dhcp.docsis_cm_cap.mpls.btpid",
8148
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
8149
16
        NULL, HFILL }},
8150
8151
16
    { &hf_dhcp_docsis_cm_cap_mpls_btci,
8152
16
      { "[IEEE 802.1ad] B-TCI", "dhcp.docsis_cm_cap.mpls.btci",
8153
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
8154
16
        NULL, HFILL }},
8155
8156
16
    { &hf_dhcp_docsis_cm_cap_mpls_bpcp,
8157
16
      { "[IEEE 802.1ad] B-PCP", "dhcp.docsis_cm_cap.mpls.bpcp",
8158
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
8159
16
        NULL, HFILL }},
8160
8161
16
    { &hf_dhcp_docsis_cm_cap_mpls_bdei,
8162
16
      { "[IEEE 802.1ad] B-DEI", "dhcp.docsis_cm_cap.mpls.bdei",
8163
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
8164
16
        NULL, HFILL }},
8165
8166
16
    { &hf_dhcp_docsis_cm_cap_mpls_bvid,
8167
16
      { "[IEEE 802.1ad] B-VID", "dhcp.docsis_cm_cap.mpls.bvid",
8168
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
8169
16
        NULL, HFILL }},
8170
8171
16
    { &hf_dhcp_docsis_cm_cap_mpls_bda,
8172
16
      { "[IEEE 802.1ad] B-DA", "dhcp.docsis_cm_cap.mpls.bda",
8173
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
8174
16
        NULL, HFILL }},
8175
8176
16
    { &hf_dhcp_docsis_cm_cap_mpls_bsa,
8177
16
      { "[IEEE 802.1ad] B-SA", "dhcp.docsis_cm_cap.mpls.bsa",
8178
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
8179
16
        NULL, HFILL }},
8180
8181
16
    { &hf_dhcp_docsis_cm_cap_mpls_tc,
8182
16
      { "MPLS TC", "dhcp.docsis_cm_cap.mpls.tc",
8183
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
8184
16
        NULL, HFILL }},
8185
8186
16
    { &hf_dhcp_docsis_cm_cap_mpls_label,
8187
16
      { "MPLS Label", "dhcp.docsis_cm_cap.mpls.label",
8188
16
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
8189
16
        NULL, HFILL }},
8190
8191
8192
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_160,
8193
16
      { "160 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.160",
8194
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8195
16
        NULL, HFILL }},
8196
8197
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_320,
8198
16
      { "320 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.320",
8199
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8200
16
        NULL, HFILL }},
8201
8202
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_640,
8203
16
      { "640 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.640",
8204
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8205
16
        NULL, HFILL }},
8206
8207
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_1280,
8208
16
      { "1280 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.1280",
8209
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8210
16
        NULL, HFILL }},
8211
8212
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_2560,
8213
16
      { "2560 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.2560",
8214
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8215
16
        NULL, HFILL }},
8216
8217
16
    { &hf_dhcp_docsis_cm_cap_ussymrate_5120,
8218
16
      { "5120 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.5120",
8219
16
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8220
16
        NULL, HFILL }},
8221
8222
16
    { &hf_dhcp_client_identifier_uuid,
8223
16
      { "Client Identifier (UUID)", "dhcp.client_id.uuid",
8224
16
        FT_GUID, BASE_NONE, NULL, 0x0,
8225
16
        "Client Machine Identifier (UUID)", HFILL }},
8226
8227
16
    { &hf_dhcp_client_hardware_address,
8228
16
      { "Client hardware address", "dhcp.client_hardware_address",
8229
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8230
16
        NULL, HFILL }},
8231
8232
16
    { &hf_dhcp_client_id_iaid,
8233
16
      { "IAID", "dhcp.client_id.iaid",
8234
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8235
16
        NULL, HFILL }},
8236
8237
16
    { &hf_dhcp_client_id_duid_type,
8238
16
      { "DUID Type", "dhcp.client_id.duid_type",
8239
16
        FT_UINT16, BASE_DEC, VALS(duidtype_vals), 0x0,
8240
16
        NULL, HFILL }},
8241
8242
16
    { &hf_dhcp_client_identifier_duid_llt_hw_type,
8243
16
      { "Hardware type", "dhcp.client_id.duid_llt_hw_type",
8244
16
        FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8245
16
        "Client Identifier DUID LLT Hardware type", HFILL }},
8246
8247
16
    { &hf_dhcp_client_identifier_duid_ll_hw_type,
8248
16
      { "Hardware type", "dhcp.client_id.duid_ll_hw_type",
8249
16
        FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8250
16
        "Client Identifier DUID LL Hardware type", HFILL }},
8251
8252
16
    { &hf_dhcp_client_identifier_time,
8253
16
      { "Time", "dhcp.client_id.time",
8254
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
8255
16
        NULL, HFILL }},
8256
8257
16
    { &hf_dhcp_client_identifier_link_layer_address,
8258
16
      { "Link layer address", "dhcp.client_id.link_layer_address",
8259
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8260
16
        NULL, HFILL }},
8261
8262
16
    { &hf_dhcp_client_identifier_link_layer_address_ether,
8263
16
      { "Link layer address (Ethernet)", "dhcp.client_id.link_layer_address_ether",
8264
16
        FT_ETHER, BASE_NONE, NULL, 0x0,
8265
16
        NULL, HFILL }},
8266
8267
16
    { &hf_dhcp_client_identifier_enterprise_num,
8268
16
      { "Enterprise-number", "dhcp.client_id.enterprise_num",
8269
16
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
8270
16
        NULL, HFILL }},
8271
8272
16
    { &hf_dhcp_client_identifier,
8273
16
      { "Identifier", "dhcp.client_id",
8274
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8275
16
        NULL, HFILL }},
8276
8277
16
    { &hf_dhcp_client_identifier_type,
8278
16
      { "Type", "dhcp.client_id.type",
8279
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8280
16
        NULL, HFILL }},
8281
8282
16
    { &hf_dhcp_client_identifier_undef,
8283
16
      { "Client Identifier", "dhcp.client_id.undef",
8284
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8285
16
        NULL, HFILL }},
8286
8287
16
    { &hf_dhcp_option_type,
8288
16
      { "Option", "dhcp.option.type",
8289
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8290
16
        "DHCP/BOOTP option type", HFILL }},
8291
8292
16
    { &hf_dhcp_option_length,
8293
16
      { "Length", "dhcp.option.length",
8294
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8295
16
        "DHCP/BOOTP option length", HFILL }},
8296
8297
16
    { &hf_dhcp_suboption_length,
8298
16
      { "Length", "dhcp.option.suboption_length",
8299
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8300
16
        "Suboption length", HFILL }},
8301
8302
16
    { &hf_dhcp_option_value,
8303
16
      { "Value", "dhcp.option.value",
8304
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8305
16
        "DHCP/BOOTP option value", HFILL }},
8306
8307
16
    { &hf_dhcp_option_value_8,
8308
16
      { "Value", "dhcp.option.value.uint",
8309
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8310
16
        "8-bit DHCP/BOOTP option value", HFILL }},
8311
8312
16
    { &hf_dhcp_option_value_16,
8313
16
      { "Value", "dhcp.option.value.uint",
8314
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8315
16
        "16-bit DHCP/BOOTP option value", HFILL }},
8316
8317
16
    { &hf_dhcp_option_value_u32,
8318
16
      { "Value", "dhcp.option.value.uint",
8319
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
8320
16
        "32-bit DHCP/BOOTP option value", HFILL }},
8321
8322
16
    { &hf_dhcp_option_value_s_secs,
8323
16
      { "Value", "dhcp.option.value.secs",
8324
16
        FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8325
16
        "32-bit DHCP/BOOTP option value", HFILL }},
8326
8327
16
    { &hf_dhcp_option_value_u_secs,
8328
16
      { "Value", "dhcp.option.value.usecs",
8329
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8330
16
        "32-bit DHCP/BOOTP option value", HFILL }},
8331
8332
16
    { &hf_dhcp_option_value_stringz,
8333
16
      { "Value", "dhcp.option.value.string",
8334
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8335
16
        "Z-String DHCP/BOOTP option value", HFILL }},
8336
8337
16
    { &hf_dhcp_option_value_ip_address,
8338
16
      { "Value", "dhcp.option.value.address",
8339
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8340
16
        "IP address DHCP/BOOTP option value", HFILL }},
8341
8342
16
    { &hf_dhcp_option_value_boolean,
8343
16
      { "Value", "dhcp.option.value.bool",
8344
16
        FT_BOOLEAN, BASE_NONE, NULL, 0x00,
8345
16
        "Boolean DHCP/BOOTP option value", HFILL }},
8346
8347
16
    { &hf_dhcp_option_rfc_3396_detected,
8348
16
      { "Encoding Long Options detected (RFC 3396)", "dhcp.option.rfc_3396_detected",
8349
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8350
16
        NULL, HFILL }},
8351
8352
16
    { &hf_dhcp_option_padding,
8353
16
      { "Padding", "dhcp.option.padding",
8354
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8355
16
        "Option 0: Padding", HFILL }},
8356
8357
16
    { &hf_dhcp_option_subnet_mask,
8358
16
      { "Subnet Mask", "dhcp.option.subnet_mask",
8359
16
        FT_IPv4, BASE_NETMASK, NULL, 0x00,
8360
16
        "Option 1: Subnet Mask", HFILL }},
8361
8362
16
    { &hf_dhcp_option_time_offset,
8363
16
      { "Time Offset", "dhcp.option.time_offset",
8364
16
        FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8365
16
        "Option 2: Time Offset", HFILL }},
8366
8367
16
    { &hf_dhcp_option_router,
8368
16
      { "Router", "dhcp.option.router",
8369
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8370
16
        "Option 3: Router", HFILL }},
8371
8372
16
    { &hf_dhcp_option_time_server,
8373
16
      { "Time Server", "dhcp.option.time_server",
8374
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8375
16
        "Option 4: Time Server", HFILL }},
8376
8377
16
    { &hf_dhcp_option_name_server,
8378
16
      { "Name Server", "dhcp.option.name_server",
8379
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8380
16
        "Option 5: Name Server", HFILL }},
8381
8382
16
    { &hf_dhcp_option_domain_name_server,
8383
16
      { "Domain Name Server", "dhcp.option.domain_name_server",
8384
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8385
16
        "Option 6: Domain Name Server", HFILL }},
8386
8387
16
    { &hf_dhcp_option_log_server,
8388
16
      { "Log Server", "dhcp.option.log_server",
8389
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8390
16
        "Option 7: Log Server", HFILL }},
8391
8392
16
    { &hf_dhcp_option_quotes_server,
8393
16
      { "Quotes Server", "dhcp.option.quotes_server",
8394
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8395
16
        "Option 8: Quotes Server", HFILL }},
8396
8397
16
    { &hf_dhcp_option_lpr_server,
8398
16
      { "LPR Server", "dhcp.option.lpr_server",
8399
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8400
16
        "Option 9: LPR Server", HFILL }},
8401
8402
16
    { &hf_dhcp_option_impress_server,
8403
16
      { "Impress Server", "dhcp.option.impress_server",
8404
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8405
16
        "Option 10: Impress Server", HFILL }},
8406
8407
16
    { &hf_dhcp_option_resource_location_server,
8408
16
      { "Resource Location Server", "dhcp.option.resource_location_server",
8409
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8410
16
        "Option 11: Resource Location Server", HFILL }},
8411
8412
16
    { &hf_dhcp_option_hostname,
8413
16
      { "Host Name", "dhcp.option.hostname",
8414
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8415
16
        "Option 12: Host Name", HFILL }},
8416
8417
16
    { &hf_dhcp_option_boot_file_size,
8418
16
      { "Boot File Size", "dhcp.option.boot_file_size",
8419
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8420
16
        "Option 13: Boot File Size", HFILL }},
8421
8422
16
    { &hf_dhcp_option_merit_dump_file,
8423
16
      { "Merit Dump File", "dhcp.option.merit_dump_file",
8424
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8425
16
        "Option 14: Merit Dump File", HFILL }},
8426
8427
16
    { &hf_dhcp_option_domain_name,
8428
16
      { "Domain Name", "dhcp.option.domain_name",
8429
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8430
16
        "Option 15: Domain Name", HFILL }},
8431
8432
16
    { &hf_dhcp_option_swap_server,
8433
16
      { "Swap Server", "dhcp.option.swap_server",
8434
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8435
16
        "Option 16: Swap Server", HFILL }},
8436
8437
16
    { &hf_dhcp_option_root_path,
8438
16
      { "Root Path", "dhcp.option.root_path",
8439
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8440
16
        "Option 17: Root Path", HFILL }},
8441
8442
16
    { &hf_dhcp_option_extension_path,
8443
16
      { "Extensions Path", "dhcp.option.extension_path",
8444
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8445
16
        "Option 18: Extensions Path", HFILL }},
8446
8447
16
    { &hf_dhcp_option_ip_forwarding,
8448
16
      { "IP Forwarding", "dhcp.option.ip_forwarding",
8449
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8450
16
        "Option 19: IP Forwarding", HFILL }},
8451
8452
16
    { &hf_dhcp_option_policy_filter_ip,
8453
16
      { "IP Address", "dhcp.option.policy_filter.ip",
8454
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8455
16
        "Option 21: IP address", HFILL }},
8456
8457
16
    { &hf_dhcp_option_policy_filter_subnet_mask,
8458
16
      { "Subnet Mask", "dhcp.option.policy_filter.subnet_mask",
8459
16
        FT_IPv4, BASE_NETMASK, NULL, 0x00,
8460
16
        "Option 21: Subnet Mask", HFILL }},
8461
8462
16
    { &hf_dhcp_option_non_local_source_routing,
8463
16
      { "Non-Local Source Routing", "dhcp.option.non_local_source_routing",
8464
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8465
16
        "Option 20: Non-Local Source Routing", HFILL }},
8466
8467
16
    { &hf_dhcp_option_max_datagram_reassembly_size,
8468
16
      { "Maximum Datagram Reassembly Size", "dhcp.option.max_datagram_reassembly_size",
8469
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8470
16
        "Option 22: Maximum Datagram Reassembly Size", HFILL }},
8471
8472
16
    { &hf_dhcp_option_default_ip_ttl,
8473
16
      { "Default IP Time-to-Live", "dhcp.option.default_ip_ttl",
8474
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8475
16
        "Option 23: Default IP Time-to-Live", HFILL }},
8476
8477
16
    { &hf_dhcp_option_path_mtu_aging_timeout,
8478
16
      { "Path MTU Aging Timeout", "dhcp.option.path_mtu_aging_timeout",
8479
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8480
16
        "Option 24: Path MTU Aging Timeout", HFILL }},
8481
8482
16
    { &hf_dhcp_option_path_mtu_plateau_table_item,
8483
16
      { "Path MTU Plateau Table Item", "dhcp.option.path_mtu_plateau_table_item",
8484
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8485
16
        "Option 25: Path MTU Plateau Table Item", HFILL }},
8486
8487
16
    { &hf_dhcp_option_interface_mtu,
8488
16
      { "Interface MTU", "dhcp.option.interface_mtu",
8489
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8490
16
        "Option 26: Interface MTU", HFILL }},
8491
8492
16
    { &hf_dhcp_option_all_subnets_are_local,
8493
16
      { "All Subnets are Local", "dhcp.option.all_subnets_are_local",
8494
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8495
16
        "Option 27: All Subnets are Local", HFILL }},
8496
8497
16
    { &hf_dhcp_option_broadcast_address,
8498
16
      { "Broadcast Address", "dhcp.option.broadcast_address",
8499
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8500
16
        "Option 28: Broadcast Address", HFILL }},
8501
8502
16
    { &hf_dhcp_option_perform_mask_discovery,
8503
16
      { "Perform Mask Discovery", "dhcp.option.perform_mask_discovery",
8504
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8505
16
        "Option 29: Perform Mask Discovery", HFILL }},
8506
8507
16
    { &hf_dhcp_option_mask_supplier,
8508
16
      { "Mask Supplier", "dhcp.option.mask_supplier",
8509
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8510
16
        "Option 30: Mask Supplier", HFILL }},
8511
8512
16
    { &hf_dhcp_option_perform_router_discover,
8513
16
      { "Perform Router Discover", "dhcp.option.perform_router_discover",
8514
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8515
16
        "Option 31: Perform Router Discover", HFILL }},
8516
8517
16
    { &hf_dhcp_option_router_solicitation_address,
8518
16
      { "Router Solicitation Address", "dhcp.option.router_solicitation_address",
8519
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8520
16
        "Option 32: Router Solicitation Address", HFILL }},
8521
8522
16
    { &hf_dhcp_option_static_route_ip,
8523
16
      { "Destination IP Address", "dhcp.option.static_route.ip",
8524
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8525
16
        "Option 33: Destination IP address", HFILL }},
8526
8527
16
    { &hf_dhcp_option_static_route_router,
8528
16
      { "Destination Router", "dhcp.option.static_route.router",
8529
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8530
16
        "Option 33: Destination Router", HFILL }},
8531
8532
16
    { &hf_dhcp_option_trailer_encapsulation,
8533
16
      { "Trailer Encapsulation", "dhcp.option.trailer_encapsulation",
8534
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8535
16
        "Option 34: Trailer Encapsulation", HFILL }},
8536
8537
16
    { &hf_dhcp_option_arp_cache_timeout,
8538
16
      { "ARP Cache Timeout", "dhcp.option.arp_cache_timeout",
8539
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8540
16
        "Option 35: ARP Cache Timeout", HFILL }},
8541
8542
16
    { &hf_dhcp_option_ethernet_encapsulation,
8543
16
      { "Ethernet Encapsulation", "dhcp.option.ethernet_encapsulation",
8544
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8545
16
        "Option 36: Ethernet Encapsulation", HFILL }},
8546
8547
16
    { &hf_dhcp_option_tcp_default_ttl,
8548
16
      { "TCP Default TTL", "dhcp.option.tcp_default_ttl",
8549
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8550
16
        "Option 37: TCP Default TTL", HFILL }},
8551
8552
16
    { &hf_dhcp_option_tcp_keepalive_interval,
8553
16
      { "TCP Keepalive Interval", "dhcp.option.tcp_keepalive_interval",
8554
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8555
16
        "Option 38: TCP Keepalive Interval", HFILL }},
8556
8557
16
    { &hf_dhcp_option_tcp_keepalive_garbage,
8558
16
      { "TCP Keepalive Garbage", "dhcp.option.tcp_keepalive_garbage",
8559
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8560
16
        "Option 39: TCP Keepalive Garbage", HFILL }},
8561
8562
16
    { &hf_dhcp_option_nis_domain,
8563
16
      { "Network Information Service Domain", "dhcp.option.nis_domain",
8564
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8565
16
        "Option 40: Network Information Service Domain", HFILL }},
8566
8567
16
    { &hf_dhcp_option_nis_server,
8568
16
      { "Network Information Service Server", "dhcp.option.nis_server",
8569
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8570
16
        "Option 41: Network Information Service Server", HFILL }},
8571
8572
16
    { &hf_dhcp_option_ntp_server,
8573
16
      { "Network Time Protocol Server", "dhcp.option.ntp_server",
8574
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8575
16
        "Option 42: Network Time Protocol Server", HFILL }},
8576
8577
16
    { &hf_dhcp_option43_suboption,
8578
16
      { "Option 43 Suboption", "dhcp.option.vendor.suboption",
8579
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8580
16
        NULL, HFILL }},
8581
8582
16
    { &hf_dhcp_option43_value,
8583
16
      { "Value", "dhcp.option.vendor.value",
8584
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8585
16
        "Option 43: Suboption value", HFILL }},
8586
8587
16
    { &hf_dhcp_option43_value_8,
8588
16
      { "Value", "dhcp.option.vendor.value.uint",
8589
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8590
16
        "Option 43: Suboption 8-bit value", HFILL }},
8591
8592
16
    { &hf_dhcp_option43_value_32,
8593
16
      { "Value", "dhcp.option.vendor.value.uint",
8594
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
8595
16
        "Option 43: Suboption 32-bit value", HFILL }},
8596
8597
16
    { &hf_dhcp_option43_value_stringz,
8598
16
      { "Value", "dhcp.option.vendor.value.string",
8599
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8600
16
        "Option 43: Suboption Z-String value", HFILL }},
8601
8602
16
    { &hf_dhcp_option43_value_ip_address,
8603
16
      { "Value", "dhcp.option.vendor.value.address",
8604
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8605
16
        "Option 43: Suboption IP address", HFILL }},
8606
8607
8608
16
    { &hf_dhcp_option43_pxeclient_suboption,
8609
16
      { "Option 43 Suboption", "dhcp.option.vendor.pxeclient.suboption",
8610
16
        FT_UINT8, BASE_DEC, VALS(option43_pxeclient_suboption_vals), 0x0,
8611
16
        "Option 43:PXE Client Suboption", HFILL }},
8612
8613
16
    { &hf_dhcp_option43_pxeclient_padding,
8614
16
      { "Padding", "dhcp.option.vendor.pxeclient.padding",
8615
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8616
16
        "Option 43:PXE Client 0 Padding", HFILL }},
8617
8618
16
    { &hf_dhcp_option43_pxeclient_mtftp_ip,
8619
16
      { "mtftp IP", "dhcp.option.vendor.pxeclient.mtftp_ip",
8620
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8621
16
        "Option 43:PXE Client 1 mtftp IP", HFILL }},
8622
8623
16
    { &hf_dhcp_option43_pxeclient_mtftp_client_port,
8624
16
      { "mtftp client port", "dhcp.option.vendor.pxeclient.mtftp_client_port",
8625
16
        FT_UINT16, BASE_DEC, NULL, 0x00,
8626
16
        "Option 43:PXE Client 2 mtftp client port", HFILL }},
8627
8628
16
    { &hf_dhcp_option43_pxeclient_mtftp_server_port,
8629
16
      { "mtftp server port", "dhcp.option.vendor.pxeclient.mtftp_server_port",
8630
16
        FT_UINT16, BASE_DEC, NULL, 0x00,
8631
16
        "Option 43:PXE Client 3 mtftp server port", HFILL }},
8632
8633
16
    { &hf_dhcp_option43_pxeclient_mtftp_timeout,
8634
16
      { "mtftp timeout", "dhcp.option.vendor.pxeclient.mtftp_timeout",
8635
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8636
16
        "Option 43:PXE Client 4 mtftp timeout", HFILL }},
8637
8638
16
    { &hf_dhcp_option43_pxeclient_mtftp_delay,
8639
16
      { "mtftp delay", "dhcp.option.vendor.pxeclient.mtftp_delay",
8640
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8641
16
        "Option 43:PXE Client 5 mtftp delay", HFILL }},
8642
8643
16
    { &hf_dhcp_option43_pxeclient_discovery_control,
8644
16
      { "discovery control", "dhcp.option.vendor.pxeclient.discovery_control",
8645
16
        FT_UINT8, BASE_HEX, NULL, 0x0,
8646
16
        "Option 43:PXE Client 6 discovery control", HFILL }},
8647
8648
16
    { &hf_dhcp_option43_pxeclient_discovery_control_bc,
8649
16
      { "Disable Broadcast", "dhcp.option.vendor.pxeclient.discovery_control.broadcast",
8650
16
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
8651
16
        NULL, HFILL }},
8652
8653
16
    { &hf_dhcp_option43_pxeclient_discovery_control_mc,
8654
16
      { "Disable Multicast", "dhcp.option.vendor.pxeclient.discovery_control.multicast",
8655
16
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
8656
16
        NULL, HFILL }},
8657
8658
16
    { &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
8659
16
      { "Serverlist only", "dhcp.option.vendor.pxeclient.discovery_control.serverlist",
8660
16
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
8661
16
        NULL, HFILL }},
8662
8663
16
    { &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
8664
16
      { "Bootstrap override", "dhcp.option.vendor.pxeclient.discovery_control.bstrap",
8665
16
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
8666
16
        NULL, HFILL }},
8667
8668
16
    { &hf_dhcp_option43_pxeclient_multicast_address,
8669
16
      { "multicast address", "dhcp.option.vendor.pxeclient.multicast_address",
8670
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
8671
16
        "Option 43:PXE Client 7 multicast address", HFILL }},
8672
8673
16
    { &hf_dhcp_option43_pxeclient_boot_servers,
8674
16
      { "boot servers", "dhcp.option.vendor.pxeclient.boot_servers",
8675
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8676
16
        "Option 43:PXE Client 8 boot servers", HFILL }},
8677
8678
16
    { &hf_dhcp_option43_pxeclient_boot_server_type,
8679
16
      { "Type", "dhcp.option.vendor.pxeclient.boot_servers.type",
8680
16
        FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_server_types), 0x0,
8681
16
        NULL, HFILL }},
8682
8683
16
    { &hf_dhcp_option43_pxeclient_boot_server_count,
8684
16
      { "IP count", "dhcp.option.vendor.pxeclient.boot_servers.count",
8685
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8686
16
        NULL, HFILL }},
8687
8688
16
    { &hf_dhcp_option43_pxeclient_boot_server_ip,
8689
16
      { "IP", "dhcp.option.vendor.pxeclient.boot_servers.ip",
8690
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
8691
16
        NULL, HFILL }},
8692
8693
16
    { &hf_dhcp_option43_pxeclient_boot_menu,
8694
16
      { "boot menu", "dhcp.option.vendor.pxeclient.boot_menu",
8695
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8696
16
        "Option 43:PXE Client 9 boot menu", HFILL }},
8697
8698
16
    { &hf_dhcp_option43_pxeclient_boot_menu_type,
8699
16
      { "Type", "dhcp.option.vendor.pxeclient.boot_menu.type",
8700
16
        FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_menu_types), 0x0,
8701
16
        NULL, HFILL }},
8702
8703
16
    { &hf_dhcp_option43_pxeclient_boot_menu_length,
8704
16
      { "Length", "dhcp.option.vendor.pxeclient.boot_menu.length",
8705
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8706
16
        NULL, HFILL }},
8707
8708
16
    { &hf_dhcp_option43_pxeclient_boot_menu_desc,
8709
16
      { "Description", "dhcp.option.vendor.pxeclient.boot_menu.desc",
8710
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8711
16
        NULL, HFILL }},
8712
8713
16
    { &hf_dhcp_option43_pxeclient_menu_prompt,
8714
16
      { "menu prompt", "dhcp.option.vendor.pxeclient.menu_prompt",
8715
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8716
16
        "Option 43:PXE Client 10 menu prompt", HFILL }},
8717
8718
16
    { &hf_dhcp_option43_pxeclient_menu_prompt_timeout,
8719
16
      { "Timeout", "dhcp.option.vendor.pxeclient.menu_prompt.timeout",
8720
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8721
16
        NULL, HFILL }},
8722
8723
16
    { &hf_dhcp_option43_pxeclient_menu_prompt_prompt,
8724
16
      { "Prompt", "dhcp.option.vendor.pxeclient.menu_prompt.prompt",
8725
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8726
16
        NULL, HFILL }},
8727
8728
16
    { &hf_dhcp_option43_pxeclient_multicast_address_alloc,
8729
16
      { "multicast address alloc", "dhcp.option.vendor.pxeclient.multicast_address_alloc",
8730
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8731
16
        "Option 43:PXE Client 11 multicast address alloc", HFILL }},
8732
8733
16
    { &hf_dhcp_option43_pxeclient_credential_types,
8734
16
      { "credential types", "dhcp.option.vendor.pxeclient.credential_types",
8735
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8736
16
        "Option 43:PXE Client 12 credential types", HFILL }},
8737
8738
16
    { &hf_dhcp_option43_pxeclient_boot_item,
8739
16
      { "boot item", "dhcp.option.vendor.pxeclient.boot_item",
8740
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8741
16
        "Option 43:PXE Client 71 boot item", HFILL }},
8742
8743
16
    { &hf_dhcp_option43_pxeclient_boot_item_type,
8744
16
      { "Type", "dhcp.option.vendor.pxeclient.boot_item.type",
8745
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8746
16
        NULL, HFILL }},
8747
8748
16
    { &hf_dhcp_option43_pxeclient_boot_item_layer,
8749
16
      { "Layer", "dhcp.option.vendor.pxeclient.boot_item.layer",
8750
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8751
16
        NULL, HFILL }},
8752
8753
16
    { &hf_dhcp_option43_pxeclient_lcm_server,
8754
16
      { "LCM Server Name", "dhcp.option.vendor.pxeclient.lcm_server",
8755
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8756
16
        "Option 43:PXE Client 179 LCM Server", HFILL }},
8757
8758
16
    { &hf_dhcp_option43_pxeclient_lcm_domain,
8759
16
      { "LCM Domain", "dhcp.option.vendor.pxeclient.lcm_domain",
8760
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8761
16
        "Option 43:PXE Client 180 LCM Domain", HFILL }},
8762
8763
16
    { &hf_dhcp_option43_pxeclient_lcm_nic_option,
8764
16
      { "LCM NIC option", "dhcp.option.vendor.pxeclient.lcm_nic_option",
8765
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8766
16
        "Option 43:PXE Client 181 LCM NIC Option", HFILL }},
8767
8768
16
    { &hf_dhcp_option43_pxeclient_lcm_workgroup,
8769
16
      { "LCM Workgroup", "dhcp.option.vendor.pxeclient.lcm_workgroup",
8770
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8771
16
        "Option 43:PXE Client 190 LCM Workgroup", HFILL }},
8772
8773
16
    { &hf_dhcp_option43_pxeclient_discovery,
8774
16
      { "Discovery", "dhcp.option.vendor.pxeclient.discovery",
8775
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8776
16
        "Option 43:PXE Client 191 Discovery", HFILL }},
8777
8778
16
    { &hf_dhcp_option43_pxeclient_configured,
8779
16
      { "Configured", "dhcp.option.vendor.pxeclient.configured",
8780
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8781
16
        "Option 43:PXE Client 192 Configured", HFILL }},
8782
8783
16
    { &hf_dhcp_option43_pxeclient_lcm_version,
8784
16
      { "LCM Version", "dhcp.option.vendor.pxeclient.lcm_version",
8785
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
8786
16
        "Option 43:PXE Client 193 LCM Version", HFILL }},
8787
8788
16
    { &hf_dhcp_option43_pxeclient_lcm_serial,
8789
16
      { "LCM Serial Number", "dhcp.option.vendor.pxeclient.lcm_serial",
8790
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8791
16
        "Option 43:PXE Client 194 LCM Serial Number", HFILL }},
8792
8793
16
    { &hf_dhcp_option43_pxeclient_end,
8794
16
      { "PXE Client End", "dhcp.option.vendor.pxeclient.end",
8795
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8796
16
        "Option 43:PXE Client 255 End", HFILL }},
8797
8798
8799
         /* AEROHIVE (Extremenetworks) vendor suboptions */
8800
16
         { &hf_dhcp_option43_aerohive_suboption,
8801
16
     { "Option 43 Suboption", "dhcp.option.vendor.aerohive.suboption",
8802
16
       FT_UINT8, BASE_DEC, VALS(option43_aerohive_suboption_vals), 0x0,
8803
16
       "Option 43:AEROHIVE Suboption", HFILL }},
8804
8805
16
    { &hf_dhcp_option43_aerohive_unknown,
8806
16
      { "Unknown", "dhcp.option.vendor.aerohive.unknown",
8807
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8808
16
        NULL, HFILL }},
8809
8810
16
         { &hf_dhcp_option43_aerohive_xiqhostname,
8811
16
     { "HM FQDN", "dhcp.option.vendor.aerohive.xiqhostname",
8812
16
       FT_STRING, BASE_NONE, NULL, 0x0,
8813
16
       "Hive Manager NG FQDN", HFILL }},
8814
8815
16
         { &hf_dhcp_option43_aerohive_xiqipaddress,
8816
16
     { "HM IP", "dhcp.option.vendor.aerohive.xiqipaddress",
8817
16
       FT_IPv4, BASE_NONE, NULL, 0x0,
8818
16
       "Hive Manager NG IP address", HFILL }},
8819
8820
8821
16
    { &hf_dhcp_option43_cl_suboption,
8822
16
      { "Option 43 Suboption", "dhcp.option.vendor.cl.suboption",
8823
16
        FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
8824
16
        "Option 43:CL Suboption", HFILL }},
8825
8826
16
    { &hf_dhcp_option43_cl_padding,
8827
16
      { "Padding", "dhcp.option.vendor.cl.padding",
8828
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8829
16
        "Option 43:CL 0 Padding", HFILL }},
8830
8831
16
    { &hf_dhcp_option43_cl_suboption_request_list,
8832
16
      { "Suboption Request List", "dhcp.option.vendor.cl.suboption_request_list",
8833
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8834
16
        "Option 43:CL 1 Suboption Request List", HFILL }},
8835
8836
16
    { &hf_dhcp_option43_cl_device_type,
8837
16
      { "Device Type", "dhcp.option.vendor.cl.device_type",
8838
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8839
16
        "Option 43:CL 2 Device Type", HFILL }},
8840
8841
16
    { &hf_dhcp_option43_cl_esafe_type,
8842
16
      { "eSAFE Types", "dhcp.option.vendor.cl.esafe_type",
8843
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8844
16
        "Option 43:CL 3 eSAFE Types", HFILL }},
8845
8846
16
    { &hf_dhcp_option43_cl_serial_number,
8847
16
      { "Serial Number", "dhcp.option.vendor.cl.serial_number",
8848
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8849
16
        "Option 43:CL 4 Serial Number", HFILL }},
8850
8851
16
    { &hf_dhcp_option43_cl_hardware_version,
8852
16
      { "Hardware Version", "dhcp.option.vendor.cl.hardware_version",
8853
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8854
16
        "Option 43:CL 5 Hardware Version", HFILL }},
8855
8856
16
    { &hf_dhcp_option43_cl_software_version,
8857
16
      { "Software Version", "dhcp.option.vendor.cl.software_version",
8858
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8859
16
        "Option 43:CL 6 Software Version", HFILL }},
8860
8861
16
    { &hf_dhcp_option43_cl_boot_rom_version,
8862
16
      { "Boot ROM version", "dhcp.option.vendor.cl.boot_rom_version",
8863
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8864
16
        "Option 43:CL 7 Boot ROM version", HFILL }},
8865
8866
16
    { &hf_dhcp_option43_cl_oui_string,
8867
16
      { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_string",
8868
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8869
16
        "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8870
8871
16
    { &hf_dhcp_option43_cl_oui_bytes,
8872
16
      { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_bytes",
8873
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8874
16
        "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8875
8876
16
    { &hf_dhcp_option43_cl_model_number,
8877
16
      { "Model Number", "dhcp.option.vendor.cl.model_number",
8878
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8879
16
        "Option 43:CL 9 Model Number", HFILL }},
8880
8881
16
    { &hf_dhcp_option43_cl_vendor_name10,
8882
16
      { "Vendor Name", "dhcp.option.vendor.cl.vendor_name10",
8883
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8884
16
        "Option 43:CL 10 Vendor Name", HFILL }},
8885
8886
16
    { &hf_dhcp_option43_cl_address_realm,
8887
16
      { "Address Realm", "dhcp.option.vendor.cl.address_realm",
8888
16
        FT_UINT8, BASE_DEC, VALS(cablehome_subopt11_vals), 0x0,
8889
16
        "Option 43:CL 11 Address Realm", HFILL }},
8890
8891
16
    { &hf_dhcp_option43_cl_cm_ps_system_desc,
8892
16
      { "CM/PS System Description", "dhcp.option.vendor.cl.cm_ps_system_desc",
8893
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8894
16
        "Option 43:CL 12 CM/PS System Description", HFILL }},
8895
8896
16
    { &hf_dhcp_option43_cl_cm_ps_firmware_revision,
8897
16
      { "CM/PS Firmware Revision", "dhcp.option.vendor.cl.cm_ps_firmware_revision",
8898
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8899
16
        "Option 43:CL 13 CM/PS Firmware Revision", HFILL }},
8900
8901
16
    { &hf_dhcp_option43_cl_firewall_policy_file_version,
8902
16
      { "Firewall Policy File Version", "dhcp.option.vendor.cl.firewall_policy_file_version",
8903
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8904
16
        "Option 43:CL 14 Firewall Policy File Version", HFILL }},
8905
8906
16
    { &hf_dhcp_option43_cl_esafe_config_file_devices,
8907
16
      { "eSafe Config File Devices", "dhcp.option.vendor.cl.esafe_config_file_devices",
8908
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8909
16
        "Option 43:CL 15 eSafe Config File Devices", HFILL }},
8910
8911
16
    { &hf_dhcp_option43_cl_video_security_tape,
8912
16
      { "Video Security Type", "dhcp.option.vendor.cl.video_security_tape",
8913
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8914
16
        "Option 43:CL 18 Video Security Type", HFILL }},
8915
8916
16
    { &hf_dhcp_option43_cl_mta_mac_address,
8917
16
      { "MTA MAC Address", "dhcp.option.vendor.cl.mta_mac_address",
8918
16
        FT_ETHER, BASE_NONE, NULL, 0x0,
8919
16
        "Option 43:CL 31 MTA MAC Address", HFILL }},
8920
8921
16
    { &hf_dhcp_option43_cl_correlation_ID,
8922
16
      { "Correlation ID", "dhcp.option.vendor.cl.correlation_ID",
8923
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
8924
16
        "Option 43: CL 32 Correlation ID", HFILL }},
8925
8926
16
    { &hf_dhcp_option43_cl_vendor_name51,
8927
16
      { "Vendor Name", "dhcp.option.vendor.cl.vendor_name51",
8928
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8929
16
        "Option 43:CL 51 Vendor Name", HFILL }},
8930
8931
16
    { &hf_dhcp_option43_cl_cablecard_capability,
8932
16
      { "CableCARD Capability", "dhcp.option.vendor.cl.cablecard_capability",
8933
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8934
16
        "Option 43:CL 52 CableCARD Capability", HFILL }},
8935
8936
16
    { &hf_dhcp_option43_cl_device_id_ca,
8937
16
      { "Device Identification (CA)", "dhcp.option.vendor.cl.device_id_ca",
8938
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
8939
16
        "Option 43:CL 53 Device Identification (CA)", HFILL }},
8940
8941
16
    { &hf_dhcp_option43_cl_device_id_x509,
8942
16
      { "Device Identification (X.509)", "dhcp.option.vendor.cl.device_id_x509",
8943
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8944
16
        "Option 43:CL 54 Device Identification (X.509)", HFILL }},
8945
8946
16
    { &hf_dhcp_option43_cl_end,
8947
16
      { "CL End", "dhcp.option.vendor.cl.end",
8948
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8949
16
        "Option 43:CL 255 End", HFILL }},
8950
8951
8952
16
    { &hf_dhcp_option43_alcatel_suboption,
8953
16
      { "Option 43 Suboption", "dhcp.option.vendor.alu.suboption",
8954
16
        FT_UINT8, BASE_DEC, VALS(option43_alcatel_suboption_vals), 0x0,
8955
16
        "Option 43:Alcatel Suboption", HFILL }},
8956
8957
16
    { &hf_dhcp_option43_alcatel_padding,
8958
16
      { "Padding", "dhcp.option.vendor.alu.padding",
8959
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8960
16
        "Option 43:Alcatel 0 Padding", HFILL }},
8961
8962
16
    { &hf_dhcp_option43_alcatel_vlan_id,
8963
16
      { "Voice VLAN ID", "dhcp.option.vendor.alu.vid",
8964
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
8965
16
        "Option 43:Alcatel 58 Voice VLAN ID", HFILL }},
8966
8967
16
    { &hf_dhcp_option43_alcatel_tftp1,
8968
16
      { "Spatial Redundancy TFTP1", "dhcp.option.vendor.alu.tftp1",
8969
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
8970
16
        "Option 43:Alcatel 64 Spatial Redundancy TFTP1", HFILL }},
8971
8972
16
    { &hf_dhcp_option43_alcatel_tftp2,
8973
16
      { "Spatial Redundancy TFTP2", "dhcp.option.vendor.alu.tftp2",
8974
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
8975
16
        "Option 43:Alcatel 65 Spatial Redundancy TFTP2", HFILL }},
8976
8977
16
    { &hf_dhcp_option43_alcatel_app_type,
8978
16
      { "Application Type", "dhcp.option.vendor.alu.app_type",
8979
16
        FT_UINT8, BASE_DEC, VALS(option43_alcatel_app_type_vals), 0x0,
8980
16
        "Option 43:Alcatel 66 Application Type", HFILL }},
8981
8982
16
    { &hf_dhcp_option43_alcatel_sip_url,
8983
16
      { "SIP URL", "dhcp.option.vendor.alu.sip_url",
8984
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8985
16
        "Option 43:Alcatel 67 SIP URL", HFILL }},
8986
8987
16
    { &hf_dhcp_option43_alcatel_end,
8988
16
      { "Alcatel End", "dhcp.option.vendor.alu.end",
8989
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
8990
16
        "Option 43:Alcatel 255 End", HFILL }},
8991
8992
16
    { &hf_dhcp_option43_arubaap_controllerip,
8993
16
      { "Aruba Controller IP", "dhcp.option.vendor.arubaap.controllerip",
8994
16
        FT_STRING, BASE_NONE, NULL, 0x0,
8995
16
        "Address IP of Aruba controller", HFILL }},
8996
8997
16
    { &hf_dhcp_option43_arubaiap,
8998
16
      { "Aruba Instant AP", "dhcp.option.vendor.arubaiap",
8999
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9000
16
        "nameorg,amp-ip-address,password", HFILL }},
9001
9002
16
    { &hf_dhcp_option43_arubaiap_nameorg,
9003
16
      { "Name Organisation", "dhcp.option.vendor.arubaiap.name_org",
9004
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9005
16
        NULL, HFILL }},
9006
9007
16
    { &hf_dhcp_option43_arubaiap_ampip,
9008
16
      { "AMP IP Address", "dhcp.option.vendor.arubaiap.amp_ip",
9009
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9010
16
        "Address IP of Airwave server (AMP)", HFILL }},
9011
9012
16
    { &hf_dhcp_option43_arubaiap_password,
9013
16
      { "Password", "dhcp.option.vendor.arubaiap.password",
9014
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9015
16
        "Password for Instant AP Airwave server (AMP)", HFILL }},
9016
9017
9018
16
    { &hf_dhcp_option43_bsdp_suboption,
9019
16
      { "Option 43 Suboption", "dhcp.option.vendor.bsdp.suboption",
9020
16
        FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
9021
16
        "Option 43:BSDP Suboption", HFILL }},
9022
9023
16
    { &hf_dhcp_option43_bsdp_message_type,
9024
16
      { "Message Type", "dhcp.option.vendor.bsdp.message_type",
9025
16
        FT_UINT8, BASE_DEC, VALS(o43_bsdp_message_type_vals), 0x0,
9026
16
        NULL, HFILL }},
9027
9028
16
    { &hf_dhcp_option43_bsdp_version,
9029
16
      { "Version", "dhcp.option.vendor.bsdp.version",
9030
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
9031
16
        NULL, HFILL }},
9032
9033
16
    { &hf_dhcp_option43_bsdp_server_identifier,
9034
16
      { "Server Identifier", "dhcp.option.vendor.bsdp.server_identifier",
9035
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
9036
16
        NULL, HFILL }},
9037
9038
16
    { &hf_dhcp_option43_bsdp_server_priority,
9039
16
      { "Server Priority", "dhcp.option.vendor.bsdp.server_priority",
9040
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9041
16
        NULL, HFILL }},
9042
9043
16
    { &hf_dhcp_option43_bsdp_reply_port,
9044
16
      { "Reply Port", "dhcp.option.vendor.bsdp.reply_port",
9045
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9046
16
        NULL, HFILL }},
9047
9048
16
    { &hf_dhcp_option43_bsdp_boot_image_list_path,
9049
16
      { "Boot Image List Path", "dhcp.option.vendor.bsdp.boot_image_list_path",
9050
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9051
16
        NULL, HFILL }},
9052
9053
16
    { &hf_dhcp_option43_bsdp_boot_image_index,
9054
16
      { "Boot Image Index", "dhcp.option.vendor.bsdp.boot_image.index",
9055
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
9056
16
        NULL, HFILL }},
9057
9058
16
    { &hf_dhcp_option43_bsdp_default_boot_image_id,
9059
16
      { "Default Boot Image ID", "dhcp.option.vendor.bsdp.default_boot_image_id",
9060
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
9061
16
        NULL, HFILL }},
9062
9063
16
    { &hf_dhcp_option43_bsdp_selected_boot_image_id,
9064
16
      { "Selected Boot Image ID", "dhcp.option.vendor.bsdp.selected_boot_image_id",
9065
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
9066
16
        NULL, HFILL }},
9067
9068
16
    { &hf_dhcp_option43_bsdp_boot_image_list,
9069
16
      { "Boot Image List", "dhcp.option.vendor.bsdp.boot_image_list",
9070
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9071
16
        NULL, HFILL }},
9072
9073
16
    { &hf_dhcp_option43_bsdp_image_desc,
9074
16
      { "Boot Image Description", "dhcp.option.vendor.bsdp.boot_image.desc",
9075
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9076
16
        NULL, HFILL }},
9077
9078
16
    { &hf_dhcp_option43_bsdp_boot_image_name_len,
9079
16
      { "Boot Image Name Length", "dhcp.option.vendor.bsdp.boot_image.name_len",
9080
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9081
16
        NULL, HFILL }},
9082
9083
16
    { &hf_dhcp_option43_bsdp_boot_image_name,
9084
16
      { "Boot Image Name", "dhcp.option.vendor.bsdp.boot_image.name",
9085
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9086
16
        NULL, HFILL }},
9087
9088
16
    { &hf_dhcp_option43_bsdp_netboot_firmware,
9089
16
      { "NetBoot 1.0 Firmware", "dhcp.option.vendor.bsdp.netboot_firmware",
9090
16
        FT_NONE, BASE_NONE, NULL, 0x0,
9091
16
        NULL, HFILL }},
9092
9093
16
    { &hf_dhcp_option43_bsdp_attributes_filter_list,
9094
16
      { "Boot Image Attributes Filter List", "dhcp.option.vendor.bsdp.attributes_filter_list",
9095
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9096
16
        NULL, HFILL }},
9097
9098
16
    { &hf_dhcp_option43_bsdp_boot_image_attribute,
9099
16
      { "Boot Image Attribute", "dhcp.option.vendor.bsdp.boot_image.attribute",
9100
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
9101
16
        NULL, HFILL }},
9102
9103
16
    { &hf_dhcp_option43_bsdp_boot_image_attribute_install,
9104
16
      { "Install", "dhcp.option.vendor.bsdp.boot_image.attribute.install",
9105
16
        FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_install_vals), 0x8000,
9106
16
        "Boot Image Attribute Install", HFILL }},
9107
9108
16
    { &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
9109
16
      { "Kind", "dhcp.option.vendor.bsdp.boot_image.attribute.kind",
9110
16
        FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_kind_vals), 0x7f00,
9111
16
        "Boot Image Attribute Kind", HFILL }},
9112
9113
16
    { &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
9114
16
      { "Reserved", "dhcp.option.vendor.bsdp.boot_image.attribute.reserved",
9115
16
        FT_UINT16, BASE_HEX, NULL, 0x00ff,
9116
16
        "Boot Image Attribute Reserved", HFILL }},
9117
9118
16
    { &hf_dhcp_option43_bsdp_message_size,
9119
16
      { "Message Size", "dhcp.option.vendor.bsdp.message_size",
9120
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9121
16
        NULL, HFILL }},
9122
9123
9124
16
    { &hf_dhcp_option_netbios_over_tcpip_name_server,
9125
16
      { "NetBIOS over TCP/IP Name Server", "dhcp.option.netbios_over_tcpip_name_server",
9126
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9127
16
        "Option 44: NetBIOS over TCP/IP Name Server", HFILL }},
9128
9129
16
    { &hf_dhcp_option_netbios_over_tcpip_dd_name_server,
9130
16
      { "NetBIOS over TCP/IP Datagram Distribution Name Server", "dhcp.option.netbios_over_tcpip_dd_name_server",
9131
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9132
16
        "Option 45: NetBIOS over TCP/IP Datagram Distribution Name Server", HFILL }},
9133
9134
16
    { &hf_dhcp_option_netbios_over_tcpip_node_type,
9135
16
      { "NetBIOS over TCP/IP Node Type", "dhcp.option.netbios_over_tcpip_node_type",
9136
16
        FT_UINT8, BASE_DEC, VALS(dhcp_nbnt_vals), 0x0,
9137
16
        "Option 46: NetBIOS over TCP/IP Node Type", HFILL }},
9138
9139
16
    { &hf_dhcp_option_netbios_over_tcpip_scope,
9140
16
      { "NetBIOS over TCP/IP Scope", "dhcp.option.netbios_over_tcpip_scope",
9141
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9142
16
        "Option 47: NetBIOS over TCP/IP Scope", HFILL }},
9143
9144
16
    { &hf_dhcp_option_xwindows_system_font_server,
9145
16
      { "X Window System Font Server", "dhcp.option.xwindows_system_font_server",
9146
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9147
16
        "Option 48: X Window System Font Server", HFILL }},
9148
9149
16
    { &hf_dhcp_option_xwindows_system_display_manager,
9150
16
      { "X Window System Display Manager", "dhcp.option.xwindows_system_display_manager",
9151
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9152
16
        "Option 49: X Window System Display Manager", HFILL }},
9153
9154
16
    { &hf_dhcp_option_requested_ip_address,
9155
16
      { "Requested IP Address", "dhcp.option.requested_ip_address",
9156
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9157
16
        "Option 50: Requested IP Address", HFILL }},
9158
9159
16
    { &hf_dhcp_option_ip_address_lease_time,
9160
16
      { "IP Address Lease Time", "dhcp.option.ip_address_lease_time",
9161
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9162
16
        "Option 51: IP Address Lease Time", HFILL }},
9163
9164
16
    { &hf_dhcp_option_option_overload,
9165
16
      { "Option Overload", "dhcp.option.option_overload",
9166
16
        FT_UINT8, BASE_DEC, VALS(opt_overload_vals), 0x0,
9167
16
        "Option 52: Option Overload", HFILL }},
9168
9169
16
    { &hf_dhcp_option_dhcp,
9170
16
      { "DHCP", "dhcp.option.dhcp",
9171
16
        FT_UINT8, BASE_DEC, VALS(opt53_text), 0x0,
9172
16
        "Option 53: DHCP option", HFILL }},
9173
9174
16
    { &hf_dhcp_option_dhcp_server_id,
9175
16
      { "DHCP Server Identifier", "dhcp.option.dhcp_server_id",
9176
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9177
16
        "Option 54: DHCP Server Identifier", HFILL }},
9178
9179
16
    { &hf_dhcp_option_parameter_request_list_item,
9180
16
      { "Parameter Request List Item", "dhcp.option.request_list_item",
9181
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9182
16
        "Option 55: Parameter Request List Item", HFILL }},
9183
9184
16
    { &hf_dhcp_option_message,
9185
16
      { "Message", "dhcp.option.message",
9186
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9187
16
        "Option 56: Option message", HFILL }},
9188
9189
16
    { &hf_dhcp_option_dhcp_max_message_size,
9190
16
      { "Maximum DHCP Message Size", "dhcp.option.dhcp_max_message_size",
9191
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9192
16
        "Option 57: Maximum DHCP Message Size", HFILL }},
9193
9194
16
    { &hf_dhcp_option_renewal_time_value,
9195
16
      { "Renewal Time Value", "dhcp.option.renewal_time_value",
9196
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9197
16
        "Option 58: Renewal Time Value", HFILL }},
9198
9199
16
    { &hf_dhcp_option_rebinding_time_value,
9200
16
      { "Rebinding Time Value", "dhcp.option.rebinding_time_value",
9201
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9202
16
        "Option 59: Rebinding Time Value", HFILL }},
9203
9204
16
    { &hf_dhcp_option_vendor_class_id,
9205
16
      { "Vendor class identifier", "dhcp.option.vendor_class_id",
9206
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9207
16
        "Option 60: Vendor class identifier", HFILL }},
9208
9209
16
    { &hf_dhcp_option_vendor_class_data,
9210
16
      { "vendor-class-data", "dhcp.option.vendor_class_data",
9211
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9212
16
        "Option 60: Vendor class data", HFILL }},
9213
9214
16
    { &hf_dhcp_option_novell_netware_ip_domain,
9215
16
      { "Novell/Netware IP domain", "dhcp.option.novell_netware_ip_domain",
9216
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9217
16
        "Option 62: Novell/Netware IP domain", HFILL }},
9218
9219
16
    { &hf_dhcp_option63_suboption,
9220
16
      { "Option 63 Suboption", "dhcp.option.novell_options.suboption",
9221
16
        FT_UINT8, BASE_DEC, VALS(option63_suboption_vals), 0x0,
9222
16
        "Option 63: Suboption", HFILL }},
9223
9224
16
    { &hf_dhcp_option63_value,
9225
16
      { "Value", "dhcp.option.novell_options.value",
9226
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9227
16
        "Option 63: Suboption value", HFILL }},
9228
9229
16
    { &hf_dhcp_option63_value_8,
9230
16
      { "Value", "dhcp.option.novell_options.value.uint",
9231
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9232
16
        "Option 63: Suboption 8-bit value", HFILL }},
9233
9234
16
    { &hf_dhcp_option63_value_ip_address,
9235
16
      { "Value", "dhcp.option.novell_options.value.address",
9236
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9237
16
        "Option 63: Suboption IP address", HFILL }},
9238
9239
16
    { &hf_dhcp_option63_value_boolean,
9240
16
      { "Value", "dhcp.option.novell_options.value.bool",
9241
16
        FT_BOOLEAN, BASE_NONE, NULL, 0x00,
9242
16
        "Option 63: Suboption Boolean value", HFILL }},
9243
9244
16
    { &hf_dhcp_option63_broadcast,
9245
16
      { "Broadcast for nearest Netware server", "dhcp.option.novell_options.broadcast",
9246
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9247
16
        "Option 63:5 Broadcast for nearest Netware server", HFILL }},
9248
9249
16
    { &hf_dhcp_option63_preferred_dss_server,
9250
16
      { "Preferred DSS server", "dhcp.option.novell_options.preferred_dss_server",
9251
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9252
16
        "Option 63:6 Preferred DSS server", HFILL }},
9253
9254
16
    { &hf_dhcp_option63_nearest_nwip_server,
9255
16
      { "Nearest NWIP server", "dhcp.option.novell_options.nearest_nwip_server",
9256
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9257
16
        "Option 63:7 Nearest NWIP server", HFILL }},
9258
9259
16
    { &hf_dhcp_option63_autoretries,
9260
16
      { "Autoretries", "dhcp.option.novell_options.autoretries",
9261
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9262
16
        "Option 63:8 Autoretries", HFILL }},
9263
9264
16
    { &hf_dhcp_option63_autoretry_delay,
9265
16
      { "Autoretry delay, sec",
9266
16
        "dhcp.option.novell_options.autoretry_delay", FT_UINT8, BASE_DEC, NULL,
9267
16
        0x0, "Option 63:9 Autoretry delay, sec", HFILL }},
9268
9269
16
    { &hf_dhcp_option63_support_netware_v1_1,
9270
16
      { "Broadcast for nearest Netware server", "dhcp.option.novell_options.support_netware_v1_1",
9271
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9272
16
        "Option 63:10 Broadcast for nearest Netware server", HFILL }},
9273
9274
16
    { &hf_dhcp_option63_primary_dss,
9275
16
      { "Primary DSS", "dhcp.option.novell_options.primary_dss",
9276
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9277
16
        "Option 63:11 Primary DSS", HFILL }},
9278
9279
9280
16
    { &hf_dhcp_option_nis_plus_domain,
9281
16
      { "Network Information Service+ Domain", "dhcp.option.nis_plus_domain",
9282
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9283
16
        "Option 64: Network Information Service+ Domain", HFILL }},
9284
9285
16
    { &hf_dhcp_option_nis_plus_server,
9286
16
      { "Network Information Service+ Server", "dhcp.option.nis_plus_server",
9287
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9288
16
        "Option 65: Network Information Service+ Server", HFILL }},
9289
9290
16
    { &hf_dhcp_option_tftp_server_name,
9291
16
      { "TFTP Server Name", "dhcp.option.tftp_server_name",
9292
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9293
16
        "Option 66: TFTP Server Name", HFILL }},
9294
9295
16
    { &hf_dhcp_option_bootfile_name,
9296
16
      { "Bootfile name", "dhcp.option.bootfile_name",
9297
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9298
16
        "Option 67: Bootfile name", HFILL }},
9299
9300
16
    { &hf_dhcp_option_mobile_ip_home_agent,
9301
16
      { "Mobile IP Home Agent", "dhcp.option.mobile_ip_home_agent",
9302
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9303
16
        "Option 68: Mobile IP Home Agent", HFILL }},
9304
9305
16
    { &hf_dhcp_option_smtp_server,
9306
16
      { "SMTP Server", "dhcp.option.smtp_server",
9307
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9308
16
        "Option 69: SMTP Server", HFILL }},
9309
9310
16
    { &hf_dhcp_option_pop3_server,
9311
16
      { "POP3 Server", "dhcp.option.pop3_server",
9312
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9313
16
        "Option 70: POP3 Server", HFILL }},
9314
9315
16
    { &hf_dhcp_option_nntp_server,
9316
16
      { "NNTP Server", "dhcp.option.nntp_server",
9317
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9318
16
        "Option 71: NNTP Server", HFILL }},
9319
9320
16
    { &hf_dhcp_option_default_www_server,
9321
16
      { "Default WWW Server", "dhcp.option.default_www_server",
9322
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9323
16
        "Option 72: Default WWW Server", HFILL }},
9324
9325
16
    { &hf_dhcp_option_default_finger_server,
9326
16
      { "Default Finger Server", "dhcp.option.default_finger_server",
9327
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9328
16
        "Option 73: Default Finger Server", HFILL }},
9329
9330
16
    { &hf_dhcp_option_default_irc_server,
9331
16
      { "Default IRC Server", "dhcp.option.default_irc_server",
9332
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9333
16
        "Option 74: Default IRC Server", HFILL }},
9334
9335
16
    { &hf_dhcp_option_streettalk_server,
9336
16
      { "StreetTalk Server", "dhcp.option.streettalk_server",
9337
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9338
16
        "Option 75: StreetTalk Server", HFILL }},
9339
9340
16
    { &hf_dhcp_option_streettalk_da_server,
9341
16
      { "StreetTalk Directory Assistance Server", "dhcp.option.streettalk_da_server",
9342
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9343
16
        "Option 76: StreetTalk Directory Assistance Server", HFILL }},
9344
9345
16
    { &hf_dhcp_option77_user_class,
9346
16
      { "Instance of User Class", "dhcp.option.user_class",
9347
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9348
16
        NULL, HFILL }},
9349
9350
16
    { &hf_dhcp_option77_user_class_length,
9351
16
      { "User Class Length", "dhcp.option.user_class.length",
9352
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9353
16
        "Length of User Class Instance", HFILL }},
9354
9355
16
    { &hf_dhcp_option77_user_class_data,
9356
16
      { "User Class Data", "dhcp.option.user_class.data",
9357
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9358
16
        "Data of User Class Instance", HFILL }},
9359
9360
16
    { &hf_dhcp_option77_user_class_text,
9361
16
      { "User Class Data (Text)", "dhcp.option.user_class.text",
9362
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9363
16
        "Text of User Class Instance", HFILL }},
9364
9365
16
    { &hf_dhcp_option77_user_class_binary_data_length,
9366
16
      { "User Class Binary Data Length", "dhcp.option.user_class_binary_data_length",
9367
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9368
16
        "Length of User Class Binary Data (Microsoft)", HFILL }},
9369
9370
16
    { &hf_dhcp_option77_user_class_binary_data,
9371
16
      { "User Class Binary Data", "dhcp.option.user_class_binary_data",
9372
16
        FT_BYTES, BASE_SHOW_UTF_8_PRINTABLE, NULL, 0x0,
9373
16
        "User Class Binary Data (Microsoft)", HFILL }},
9374
9375
16
    { &hf_dhcp_option77_user_class_padding,
9376
16
      { "User Class padding", "dhcp.option.user_class_padding",
9377
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9378
16
        "User Class padding (Microsoft)", HFILL }},
9379
9380
16
    { &hf_dhcp_option77_user_class_name_length,
9381
16
      { "User Class Name Length", "dhcp.option.user_class_name_length",
9382
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9383
16
        "Length of User Class Name (Microsoft)", HFILL }},
9384
9385
16
    { &hf_dhcp_option77_user_class_name,
9386
16
      { "User Class Name", "dhcp.option.user_class_name",
9387
16
        FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9388
16
        "User Class Name (Microsoft)", HFILL }},
9389
9390
16
    { &hf_dhcp_option77_user_class_description_length,
9391
16
      { "User Class Description Length", "dhcp.option.user_class_description_length",
9392
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9393
16
        "Length of User Class Description (Microsoft)", HFILL }},
9394
9395
16
    { &hf_dhcp_option77_user_class_description,
9396
16
      { "User Class Description", "dhcp.option.user_class_description",
9397
16
        FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9398
16
        "User Class Description (Microsoft)", HFILL }},
9399
9400
16
    { &hf_dhcp_option_slp_directory_agent_value,
9401
16
      { "Value", "dhcp.option.slp_directory_agent.value",
9402
16
        FT_UINT8, BASE_DEC, VALS(slpda_vals), 0x0,
9403
16
        "Option 78: SLPDA Value", HFILL }},
9404
9405
16
    { &hf_dhcp_option_slp_directory_agent_slpda_address,
9406
16
      { "IP Address", "dhcp.option.slp_directory_agent.slpda_address",
9407
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9408
16
        "Option 78: SLPDA Address", HFILL }},
9409
9410
16
    { &hf_dhcp_option_slp_service_scope_value,
9411
16
      { "Value", "dhcp.option.slp_service_scope.value",
9412
16
        FT_UINT8, BASE_DEC, VALS(slp_scope_vals), 0x0,
9413
16
        "Option 79: SLP Service Scope Value", HFILL }},
9414
9415
16
    { &hf_dhcp_option_slp_service_scope_string,
9416
16
      { "SLP Service Scope", "dhcp.option.slp_service_scope.string",
9417
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9418
16
        "Option 79: SLP Service Scope", HFILL }},
9419
9420
9421
16
    { &hf_dhcp_option82_suboption,
9422
16
      { "Option 82 Suboption", "dhcp.option.agent_information_option.suboption",
9423
16
        FT_UINT8, BASE_DEC, VALS(option82_suboption_vals), 0x0,
9424
16
        "Option 82: Suboption", HFILL }},
9425
9426
16
    { &hf_dhcp_option82_value,
9427
16
      { "Value", "dhcp.option.agent_information_option.value",
9428
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9429
16
        "Option 82: Suboption value", HFILL }},
9430
9431
16
    { &hf_dhcp_option82_value_8,
9432
16
      { "Value", "dhcp.option.agent_information_option.value.uint",
9433
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9434
16
        "Option 82: Suboption 8-bit value", HFILL }},
9435
9436
16
    { &hf_dhcp_option82_value_16,
9437
16
      { "Value", "dhcp.option.agent_information_option.value.uint",
9438
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
9439
16
        "Option 162: Suboption 16-bit value", HFILL }},
9440
9441
16
    { &hf_dhcp_option82_value_32,
9442
16
      { "Value", "dhcp.option.agent_information_option.value.uint",
9443
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
9444
16
        "Option 82: Suboption 32-bit value", HFILL }},
9445
9446
16
    { &hf_dhcp_option82_value_ip_address,
9447
16
      { "Value", "dhcp.option.agent_information_option.value.address",
9448
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9449
16
        "Option 82: Suboption IP address", HFILL }},
9450
9451
16
    { &hf_dhcp_option82_value_stringz,
9452
16
      { "Value", "dhcp.option.agent_information_option.value.string",
9453
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9454
16
        "Option 82: Suboption Z-String value", HFILL }},
9455
9456
16
    { &hf_dhcp_option82_padding,
9457
16
      { "Padding", "dhcp.option.agent_information_option.padding",
9458
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9459
16
        "Option 82:0 Padding", HFILL }},
9460
9461
16
    { &hf_dhcp_option82_agent_circuit_id,
9462
16
      { "Agent Circuit ID", "dhcp.option.agent_information_option.agent_circuit_id",
9463
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9464
16
        "Option 82:1 Agent Circuit ID", HFILL }},
9465
9466
16
    { &hf_dhcp_option82_agent_remote_id,
9467
16
      { "Agent Remote ID", "dhcp.option.agent_information_option.agent_remote_id",
9468
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9469
16
        "Option 82:2 Agent Remote ID", HFILL }},
9470
9471
16
    { &hf_dhcp_option82_reserved,
9472
16
      { "Reserved", "dhcp.option.agent_information_option.reserved",
9473
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9474
16
        "Option 82:3 Reserved", HFILL }},
9475
9476
16
    { &hf_dhcp_option82_docsis_device_class,
9477
16
      { "DOCSIS Device Class", "dhcp.option.agent_information_option.docsis_device_class",
9478
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
9479
16
        "Option 82:4 DOCSIS Device Class", HFILL }},
9480
9481
16
    { &hf_dhcp_option82_link_selection,
9482
16
      { "Link selection", "dhcp.option.agent_information_option.link_selection",
9483
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9484
16
        "Option 82:5 Link selection", HFILL }},
9485
9486
16
    { &hf_dhcp_option82_subscriber_id,
9487
16
      { "Subscriber ID", "dhcp.option.agent_information_option.subscriber_id",
9488
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9489
16
        "Option 82:6 Subscriber ID", HFILL }},
9490
9491
16
    { &hf_dhcp_option82_radius_attributes,
9492
16
      { "RADIUS Attributes", "dhcp.option.agent_information_option.radius_attributes",
9493
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9494
16
        "Option 82:7 RADIUS Attributes", HFILL }},
9495
9496
16
    { &hf_dhcp_option82_authentication,
9497
16
      { "Authentication", "dhcp.option.agent_information_option.authentication",
9498
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9499
16
        "Option 82:8 Authentication", HFILL }},
9500
9501
16
    { &hf_dhcp_option82_vi,
9502
16
      { "Vendor-Specific Information", "dhcp.option.agent_information_option.vi",
9503
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9504
16
        "Option 82:9 Vendor-Specific Information", HFILL }},
9505
9506
16
    { &hf_dhcp_option82_vi_enterprise,
9507
16
      { "Enterprise", "dhcp.option.agent_information_option.vi.enterprise",
9508
16
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
9509
16
        "Option 82:9 VI Enterprise", HFILL }},
9510
9511
16
    { &hf_dhcp_option82_vi_data_length,
9512
16
      { "Data Length", "dhcp.option.agent_information_option.vi.data_length",
9513
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9514
16
        "Option 82:9 VI Data Length", HFILL }},
9515
9516
16
    { &hf_dhcp_option82_vi_cl_option,
9517
16
      { "Option", "dhcp.option.agent_information_option.vi.cl.option",
9518
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9519
16
        "Option 82:9 VI CL Option", HFILL }},
9520
9521
16
    { &hf_dhcp_option82_vi_cl_option_length,
9522
16
      { "Option Length", "dhcp.option.agent_information_option.vi.cl.option_length",
9523
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9524
16
        "Option 82:9 VI CL Option Length", HFILL }},
9525
9526
16
    { &hf_dhcp_option82_vi_cl_tag,
9527
16
      { "Tag", "dhcp.option.agent_information_option.vi.cl.tag",
9528
16
        FT_UINT8, BASE_DEC, VALS(option82_cl_tag_vals), 0x0,
9529
16
        "Option 82:9 VI CL Tag", HFILL }},
9530
9531
16
    { &hf_dhcp_option82_vi_cl_tag_length,
9532
16
      { "Tag Length", "dhcp.option.agent_information_option.vi.cl.tag_length",
9533
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9534
16
        "Option 82:9 VI CL Tag Length", HFILL }},
9535
9536
16
    { &hf_dhcp_option82_vi_cl_docsis_version,
9537
16
      { "DOCSIS Version Number", "dhcp.option.agent_information_option.vi.cl.docsis_version",
9538
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
9539
16
        "Option 82:9 VI CL DOCSIS Version Number", HFILL }},
9540
9541
16
    { &hf_dhcp_option82_vi_cl_dpoe_system_version,
9542
16
      { "DPoE System Version Number", "dhcp.option.agent_information_option.vi.cl.dpoe_system_version",
9543
16
        FT_UINT16, BASE_HEX, NULL, 0x0,
9544
16
        "Option 82:9 VI CL DPoE System Version Number", HFILL }},
9545
9546
16
    { &hf_dhcp_option82_vi_cl_dpoe_system_pbb_service,
9547
16
      { "DPoE System PBB Service", "dhcp.option.agent_information_option.vi.cl.dpoe_system_pbb_service",
9548
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9549
16
        "Option 82:9 VI CL DPoE System PBB Service", HFILL }},
9550
9551
16
    { &hf_dhcp_option82_vi_cl_service_class_name,
9552
16
      { "Service Class Name", "dhcp.option.agent_information_option.vi.cl.service_class_name",
9553
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9554
16
        "Option 82:9 VI CL Service Class Name", HFILL }},
9555
9556
16
    { &hf_dhcp_option82_vi_cl_mso_defined_text,
9557
16
      { "MSO Defined Text", "dhcp.option.agent_information_option.vi.cl.mso_defined_text",
9558
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9559
16
        "Option 82:9 VI CL MSO Defined Text", HFILL }},
9560
9561
16
    { &hf_dhcp_option82_vi_cl_secure_file_transfer_uri,
9562
16
      { "Secure File Transfer URI", "dhcp.option.agent_information_option.vi.cl.secure_file_transfer_uri",
9563
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9564
16
        "Option 82:9 VI CL Secure File Transfer URI", HFILL }},
9565
9566
16
    { &hf_dhcp_option82_flags,
9567
16
      { "Flags", "dhcp.option.agent_information_option.flags",
9568
16
        FT_UINT8, BASE_HEX, NULL, 0x0,
9569
16
        "Option 82:10 Flags", HFILL }},
9570
9571
16
    { &hf_dhcp_option82_flags_unicast,
9572
16
      { "Unicast flag", "dhcp.option.agent_information_option.flags.unicast",
9573
16
        FT_BOOLEAN, 8, TFS(&flag_set_unicast), 0x80,
9574
16
        "Option 82:10 Unicast flag", HFILL }},
9575
9576
16
    { &hf_dhcp_option82_flags_reserved,
9577
16
      { "Reserved flags", "dhcp.option.agent_information_option.flags.reserved",
9578
16
        FT_UINT8, BASE_HEX, NULL, 0x7F,
9579
16
        "Option 82:10 Reserved flags", HFILL }},
9580
9581
16
    { &hf_dhcp_option82_server_id_override,
9582
16
      { "Server ID Override", "dhcp.option.agent_information_option.server_id_override",
9583
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9584
16
        "Option 82:11 Server ID Override", HFILL }},
9585
9586
16
    { &hf_dhcp_option82_relay_agent_id,
9587
16
      { "Relay Agent Identifier", "dhcp.option.agent_information_option.relay_agent_id",
9588
16
        FT_BYTES, BASE_NONE, NULL, 0x00,
9589
16
        "Option 82:12 Relay Agent Identifier", HFILL }},
9590
9591
16
    { &hf_dhcp_option82_option_ani_att,
9592
16
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att",
9593
16
        FT_UINT8, BASE_DEC, NULL, 0x00,
9594
16
        "Option 82:13 Access Technology Type", HFILL }},
9595
9596
16
    { &hf_dhcp_option82_option_ani_att_res,
9597
16
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.res",
9598
16
        FT_UINT8, BASE_DEC, NULL, 0x00,
9599
16
        "Option 82:13 Access Technology Type Reserved", HFILL }},
9600
9601
16
    { &hf_dhcp_option82_option_ani_att_att,
9602
16
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.att",
9603
16
        FT_UINT8, BASE_DEC, NULL, 0x00,
9604
16
        "Option 82:13 Access Technology Type Value", HFILL }},
9605
9606
16
    { &hf_dhcp_option82_option_ani_network_name,
9607
16
      { "Access Network Name", "dhcp.option.agent_information_option.ani_network_name",
9608
16
        FT_STRING, BASE_NONE, NULL, 0x00,
9609
16
        "Option 82:14 Access Network Name", HFILL }},
9610
9611
16
    { &hf_dhcp_option82_option_ani_ap_name,
9612
16
      { "Access Point Name", "dhcp.option.agent_information_option.ani_ap_name",
9613
16
        FT_STRING, BASE_NONE, NULL, 0x00,
9614
16
        "Option 82:15 Access Point Name", HFILL }},
9615
9616
16
    { &hf_dhcp_option82_option_ani_ap_bssid,
9617
16
      { "Access Point BSSID", "dhcp.option.agent_information_option.ani_ap_bssid",
9618
16
        FT_ETHER, BASE_NONE, NULL, 0x0,
9619
16
        "Option 82:16 Access Point BSSID", HFILL }},
9620
9621
16
    { &hf_dhcp_option82_option_ani_operator_id,
9622
16
      { "Access Network Operator ID", "dhcp.option.agent_information_option.ani_operator_id",
9623
16
        FT_BYTES, BASE_NONE, NULL, 0x00,
9624
16
        "Option 82:17 Access Network Operator ID", HFILL }},
9625
9626
16
    { &hf_dhcp_option82_option_ani_operator_realm,
9627
16
      { "Access Network Operator Realm", "dhcp.option.agent_information_option.ani_operator_realm",
9628
16
        FT_STRING, BASE_NONE, NULL, 0x00,
9629
16
        "Option 82:18 Access Network Operator Realm", HFILL }},
9630
9631
16
    { &hf_dhcp_option82_option_source_port,
9632
16
      { "Source Port", "dhcp.option.agent_information_option.source_port",
9633
16
        FT_NONE, BASE_NONE, NULL, 0x00,
9634
16
        "Option 82:19 Source Port", HFILL }},
9635
9636
16
    { &hf_dhcp_option82_link_selection_cisco,
9637
16
      { "Link selection (Cisco proprietary)", "dhcp.option.agent_information_option.link_selection_cisco",
9638
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9639
16
        "Option 82:150 Link selection (Cisco proprietary)", HFILL }},
9640
9641
16
    { &hf_dhcp_option82_vrf_name_vpn_id,
9642
16
      { "VRF name/VPN ID", "dhcp.option.agent_information_option.vrf_name.vpn_id",
9643
16
        FT_BYTES, BASE_NONE, NULL, 0x00,
9644
16
        "Option 82:151 VRF name/VPN ID", HFILL }},
9645
9646
16
    { &hf_dhcp_option82_vrf_name_global,
9647
16
      { "Global, default VPN", "dhcp.option.agent_information_option.vrf_name.global",
9648
16
        FT_UINT8, BASE_DEC, NULL, 0x00,
9649
16
        "Option 82:151 Global, default VPN", HFILL }},
9650
9651
16
    { &hf_dhcp_option82_vrf_name,
9652
16
      { "VRF name", "dhcp.option.agent_information_option.vrf_name",
9653
16
        FT_STRING, BASE_NONE, NULL, 0x00,
9654
16
        "Option 82:151 VRF name", HFILL }},
9655
9656
16
    { &hf_dhcp_option82_vrf_name_vpn_id_oui,
9657
16
      { "VRF name/VPN ID OUI", "dhcp.option.agent_information_option.vrf_name.vpn_id.oui",
9658
16
        FT_UINT24, BASE_HEX, NULL, 0x00,
9659
16
        "Option 82:151 VRF name/VPN ID OUI", HFILL }},
9660
9661
16
    { &hf_dhcp_option82_vrf_name_vpn_id_index,
9662
16
      { "VRF name/VPN ID Index", "dhcp.option.agent_information_option.vrf_name.vpn_id.index",
9663
16
        FT_UINT32, BASE_HEX, NULL, 0x00,
9664
16
        "Option 82:151 VRF name/VPN ID Index", HFILL }},
9665
9666
16
    { &hf_dhcp_option82_server_id_override_cisco,
9667
16
      { "Server ID Override (Cisco proprietary)", "dhcp.option.agent_information_option.server_id_override_cisco",
9668
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9669
16
        "Option 82:152 Server ID Override (Cisco proprietary)", HFILL }},
9670
9671
9672
16
    { &hf_dhcp_option_isns_functions,
9673
16
      { "iSNS Functions", "dhcp.option.isns.functions",
9674
16
        FT_UINT16, BASE_HEX, NULL, 0x00,
9675
16
        "iSNS: the functions supported by the iSNS servers", HFILL }},
9676
9677
16
    { &hf_dhcp_option_isns_functions_enabled,
9678
16
      { "Function Fields Enabled", "dhcp.option.isns.functions.enabled",
9679
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_FUNCTIONS_ENABLED,
9680
16
        "If set to zero, then the contents of all other iSNS Function fields MUST be ignored", HFILL }},
9681
9682
16
    { &hf_dhcp_option_isns_functions_dd_authorization,
9683
16
      { "Discovery Domain based Authorization", "dhcp.option.isns.functions.dd_base_authorization",
9684
16
        FT_BOOLEAN, 16, TFS(&tfs_isns_function_dd_based_auth), F_ISNS_FUNCTIONS_DD_AUTH,
9685
16
        "If set to zero, then access authorization must be explicitly performed by each device", HFILL }},
9686
9687
16
    { &hf_dhcp_option_isns_functions_sec_policy_distibution,
9688
16
      { "Security Policy Distribution", "dhcp.option.isns.functions.sec_policy_distribution",
9689
16
        FT_BOOLEAN, 16, TFS(&tfs_isns_functions_sec_distrib), F_ISNS_FUNCTIONS_SEC_POLICY,
9690
16
        NULL, HFILL }},
9691
9692
16
    { &hf_dhcp_option_isns_functions_reserved,
9693
16
      { "Reserved flags", "dhcp.option.isns.functions.reserved",
9694
16
        FT_UINT16, BASE_HEX, NULL, F_ISNS_FUNCTIONS_RESERVED,
9695
16
        NULL, HFILL }},
9696
9697
16
    { &hf_dhcp_option_isns_discovery_domain_access,
9698
16
      { "Discovery Domain Access flags", "dhcp.option.isns.discovery_domain_access",
9699
16
        FT_UINT16, BASE_HEX, NULL, 0x00,
9700
16
        "iSNS: the types of iSNS clients that are allowed to modify Discovery Domains", HFILL }},
9701
9702
16
    { &hf_dhcp_option_isns_discovery_domain_access_enabled,
9703
16
      { "Discovery Domain Enabled", "dhcp.option.isns.discovery_domain_access.enabled",
9704
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ENABLED,
9705
16
        "If set to zero, then the contents of the remainder of this field MUST be ignored", HFILL }},
9706
9707
16
    { &hf_dhcp_option_isns_discovery_domain_access_control_node,
9708
16
      { "Control Node", "dhcp.option.isns.discovery_domain_access_control.node",
9709
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_CTRL_NODE,
9710
16
        NULL, HFILL }},
9711
9712
16
    { &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
9713
16
      { "iSCSI Target", "dhcp.option.isns.discovery_domain_access.iscsi_target",
9714
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_TARGET,
9715
16
        NULL, HFILL }},
9716
9717
16
    { &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
9718
16
      { "iSCSI Initiator", "dhcp.option.isns.discovery_domain_access.iscsi_initiator",
9719
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_INITIATOR,
9720
16
        NULL, HFILL }},
9721
9722
16
    { &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
9723
16
      { "iFCP Target Port", "dhcp.option.isns.discovery_domain_access.ifcp_target_port",
9724
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_TARGET_PORT,
9725
16
        NULL, HFILL }},
9726
9727
16
    { &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
9728
16
      { "iFCP Initiator Port", "dhcp.option.isns.discovery_domain_access.initiator_target_port",
9729
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT,
9730
16
        NULL, HFILL }},
9731
9732
16
    { &hf_dhcp_option_isns_discovery_domain_access_reserved,
9733
16
      { "Reserved Flags", "dhcp.option.isns.discovery_domain_access.reserved",
9734
16
        FT_UINT16, BASE_HEX, NULL, F_ISNS_DD_ACCESS_RESERVED,
9735
16
        NULL, HFILL }},
9736
9737
16
    { &hf_dhcp_option_isns_administrative_flags,
9738
16
      { "Administrative Flags", "dhcp.option.isns.administrative_flags",
9739
16
        FT_UINT16, BASE_HEX, NULL, 0x00,
9740
16
        "iSNS: administrative settings for the iSNS servers discovered through the DHCP query", HFILL }},
9741
9742
16
    { &hf_dhcp_option_isns_administrative_flags_enabled,
9743
16
      { "Administrative Flags Enabled", "dhcp.option.isns.administrative_flags.enabled",
9744
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_ENABLED,
9745
16
        NULL, HFILL }},
9746
9747
16
    { &hf_dhcp_option_isns_administrative_flags_heartbeat,
9748
16
      { "Heartbeat", "dhcp.option.isns.administrative_flags.heartbeat",
9749
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_HEARTBEAT,
9750
16
        NULL, HFILL }},
9751
9752
16
    { &hf_dhcp_option_isns_administrative_flags_management_scns,
9753
16
      { "Management SCNs", "dhcp.option.isns.administrative_flags.management_scns",
9754
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS,
9755
16
        NULL, HFILL }},
9756
9757
16
    { &hf_dhcp_option_isns_administrative_flags_default_dd,
9758
16
      { "Default Discovery Domain", "dhcp.option.isns.administrative_flags.default_discovery_domain",
9759
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_DEFAULT_DD,
9760
16
        NULL, HFILL }},
9761
9762
16
    { &hf_dhcp_option_isns_administrative_flags_reserved,
9763
16
      { "Reserved Flags", "dhcp.option.isns.administrative_flags.reserved",
9764
16
        FT_UINT16, BASE_HEX, NULL, F_ISNS_ADMIN_FLAGS_RESERVED,
9765
16
        NULL, HFILL }},
9766
9767
16
    { &hf_dhcp_option_isns_server_security_bitmap,
9768
16
      { "iSNS Server Security Bitmap", "dhcp.option.isns.server_security_bitmap",
9769
16
        FT_UINT32, BASE_HEX, NULL, 0x00,
9770
16
        "iSNS: server security settings", HFILL }},
9771
9772
16
    { &hf_dhcp_option_isns_server_security_bitmap_enabled,
9773
16
      { "Server Security Bitmap Enabled", "dhcp.option.isns.server_security_bitmap.enabled",
9774
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_SRV_SEC_BITMAP_ENABLED,
9775
16
        NULL, HFILL }},
9776
9777
16
    { &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
9778
16
      { "IKE/IPSec", "dhcp.option.isns.server_security_bitmap.ike_ipsec_enabled",
9779
16
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC,
9780
16
        NULL, HFILL }},
9781
9782
16
    { &hf_dhcp_option_isns_server_security_bitmap_main_mode,
9783
16
      { "Main Mode", "dhcp.option.isns.server_security_bitmap.main_mode",
9784
16
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_MAIN_MODE,
9785
16
        NULL, HFILL }},
9786
9787
16
    { &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
9788
16
      { "Aggressive Mode", "dhcp.option.isns.server_security_bitmap.aggressive_mode",
9789
16
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE,
9790
16
        NULL, HFILL }},
9791
9792
16
    { &hf_dhcp_option_isns_server_security_bitmap_pfs,
9793
16
      { "PFS", "dhcp.option.isns.server_security_bitmap.pfs",
9794
16
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_PFS,
9795
16
        NULL, HFILL }},
9796
9797
16
    { &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
9798
16
      { "Transport Mode", "dhcp.option.isns.server_security_bitmap.transport_mode",
9799
16
        FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE,
9800
16
        NULL, HFILL }},
9801
9802
16
    { &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
9803
16
      { "Tunnel Mode", "dhcp.option.isns.server_security_bitmap.tunnel_mode",
9804
16
        FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE,
9805
16
        NULL, HFILL }},
9806
9807
16
    { &hf_dhcp_option_isns_server_security_bitmap_reserved,
9808
16
      { "Reserved Flags", "dhcp.option.isns.server_security_bitmap.reserved",
9809
16
        FT_UINT16, BASE_HEX, NULL, F_ISNS_SRV_SEC_BITMAP_RESERVED,
9810
16
        NULL, HFILL }},
9811
9812
16
    { &hf_dhcp_option_isns_primary_server_addr,
9813
16
      { "Primary Server Address", "dhcp.option.isns.primary_server_addr",
9814
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9815
16
        "iSNS: IP address of the primary server", HFILL }},
9816
9817
16
    { &hf_dhcp_option_isns_heartbeat_originator_addr,
9818
16
      { "Heartbeat Originator Address", "dhcp.option.isns.heartbeat_originator_addr",
9819
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9820
16
        "iSNS: IP address from which the iSNS heartbeat originates", HFILL }},
9821
9822
16
    { &hf_dhcp_option_isns_secondary_server_addr_list,
9823
16
      { "Secondary Server Address", "dhcp.option.isns.secondary_server_addr",
9824
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9825
16
        "iSNS: a list of IP addresses of the secondary iSNS servers", HFILL }},
9826
9827
9828
16
    { &hf_dhcp_option_novell_dss_string,
9829
16
      { "Novell Directory Services Servers String", "dhcp.option.novell_dss.string",
9830
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9831
16
        "Option 85: Novell Directory Services Servers String", HFILL }},
9832
9833
16
    { &hf_dhcp_option_novell_dss_ip,
9834
16
      { "IP Address", "dhcp.option.novell_dss.ip",
9835
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9836
16
        "Option 85: Novell Directory Services Servers IP Address", HFILL }},
9837
9838
16
    { &hf_dhcp_option_novell_ds_tree_name,
9839
16
      { "Novell Directory Services Tree Name", "dhcp.option.novell_ds_tree_name",
9840
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9841
16
        "Option 86: Novell Directory Services Tree Name", HFILL }},
9842
9843
16
    { &hf_dhcp_option_novell_ds_context,
9844
16
      { "Novell Directory Services Context", "dhcp.option.novell_ds_context",
9845
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9846
16
        "Option 87: Novell Directory Services Context", HFILL }},
9847
9848
16
    { &hf_dhcp_option_dhcp_authentication_protocol,
9849
16
      { "Protocol", "dhcp.option.dhcp_authentication.protocol",
9850
16
        FT_UINT8, BASE_DEC, VALS(authen_protocol_vals), 0x0,
9851
16
        "Option 90: Authentication Protocol", HFILL }},
9852
9853
16
    { &hf_dhcp_option_dhcp_authentication_alg_delay,
9854
16
      { "Delay Algorithm", "dhcp.option.dhcp_authentication.alg_delay",
9855
16
        FT_UINT8, BASE_DEC, VALS(authen_da_algo_vals), 0x0,
9856
16
        "Option 90: Delayed Authentication Algorithm", HFILL }},
9857
9858
16
    { &hf_dhcp_option_dhcp_authentication_algorithm,
9859
16
      { "Algorithm", "dhcp.option.dhcp_authentication.algorithm",
9860
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9861
16
        "Option 90: Authentication Algorithm", HFILL }},
9862
9863
16
    { &hf_dhcp_option_dhcp_authentication_rdm,
9864
16
      { "Replay Detection Method", "dhcp.option.dhcp_authentication.rdm",
9865
16
        FT_UINT8, BASE_DEC, VALS(authen_rdm_vals), 0x0,
9866
16
        "Option 90: Replay Detection Method", HFILL }},
9867
9868
16
    { &hf_dhcp_option_dhcp_authentication_rdm_replay_detection,
9869
16
      { "RDM Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_replay_detection",
9870
16
        FT_UINT64, BASE_HEX, NULL, 0x0,
9871
16
        "Option 90: RDM Replay Detection Value", HFILL }},
9872
9873
16
    { &hf_dhcp_option_dhcp_authentication_rdm_rdv,
9874
16
      { "Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_rdv",
9875
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9876
16
        "Option 90: Replay Detection Value", HFILL }},
9877
9878
16
    { &hf_dhcp_option_dhcp_authentication_secret_id,
9879
16
      { "Secret ID", "dhcp.option.dhcp_authentication.secret_id",
9880
16
        FT_UINT32, BASE_HEX, NULL, 0x0,
9881
16
        "Option 90: Secret ID", HFILL }},
9882
9883
16
    { &hf_dhcp_option_dhcp_authentication_hmac_md5_hash,
9884
16
      { "HMAC MD5 Hash", "dhcp.option.dhcp_authentication.hmac_md5_hash",
9885
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
9886
16
        "Option 90: HMAC MD5 Hash", HFILL }},
9887
9888
16
    { &hf_dhcp_option_dhcp_authentication_information,
9889
16
      { "Authentication Information", "dhcp.option.dhcp_authentication.information",
9890
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9891
16
        "Option 90: Authentication Information", HFILL }},
9892
9893
16
    { &hf_dhcp_option_client_last_transaction_time,
9894
16
      { "Client last transaction time", "dhcp.option.client_last_transaction_time",
9895
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9896
16
        "Option 91: Client last transaction time", HFILL }},
9897
9898
16
    { &hf_dhcp_option_associated_ip_option,
9899
16
      { "Associated IP option", "dhcp.option.associated_ip_option",
9900
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9901
16
        "Option 92: Associated IP option", HFILL }},
9902
9903
16
    { &hf_dhcp_option_client_system_architecture,
9904
16
      { "Client System Architecture", "dhcp.option.client_system_architecture",
9905
16
        FT_UINT16, BASE_DEC, VALS(dhcp_client_arch), 0x0,
9906
16
        "Option 93: Client System Architecture", HFILL }},
9907
9908
16
    { &hf_dhcp_option_client_network_id_major_ver,
9909
16
      { "Major Version", "dhcp.client_network_id_major",
9910
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9911
16
        "Option 94: Major Version", HFILL }},
9912
9913
16
    { &hf_dhcp_option_client_network_id_minor_ver,
9914
16
      { "Minor Version", "dhcp.client_network_id_minor",
9915
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9916
16
        "Option 94: Minor Version", HFILL }},
9917
9918
16
    { &hf_dhcp_option_civic_location_what,
9919
16
      { "What", "dhcp.option.civic_location.what",
9920
16
        FT_UINT8, BASE_DEC, VALS(civic_address_what_values), 0x0,
9921
16
        "Option 99: What", HFILL }},
9922
9923
16
    { &hf_dhcp_option_civic_location_country,
9924
16
      { "Country", "dhcp.option.civic_location.country",
9925
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9926
16
        "Option 99: Country", HFILL }},
9927
9928
16
    { &hf_dhcp_option_civic_location_ca_type,
9929
16
      { "CA Type", "dhcp.option.civic_location.ca_type",
9930
16
        FT_UINT8, BASE_DEC, VALS(civic_address_type_values), 0x0,
9931
16
        "Option 99: CA Type", HFILL }},
9932
9933
16
    { &hf_dhcp_option_civic_location_ca_length,
9934
16
      { "CA Length", "dhcp.option.civic_location.ca_length",
9935
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
9936
16
        "Option 99: CA Length", HFILL }},
9937
9938
16
    { &hf_dhcp_option_civic_location_ca_value,
9939
16
      { "CA Value", "dhcp.option.civic_location.ca_value",
9940
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9941
16
        "Option 99: CA Value", HFILL }},
9942
9943
16
    { &hf_dhcp_option_tz_pcode,
9944
16
      { "TZ PCode", "dhcp.option.tz_pcode",
9945
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9946
16
        "Option 100: TZ PCode", HFILL  }},
9947
9948
16
    { &hf_dhcp_option_tz_tcode,
9949
16
      { "TZ TCode", "dhcp.option.tz_tcode",
9950
16
        FT_STRING, BASE_NONE, NULL, 0x0,
9951
16
        "Option 101: TZ TCode", HFILL  }},
9952
9953
16
    { &hf_dhcp_option_ipv6_only_preferred_wait_time,
9954
16
      { "IPv6-Only Preferred wait time", "dhcp.option.ipv6only_preferred_wait_time",
9955
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9956
16
        "Option 108: IPv6-Only Preferred wait time", HFILL }},
9957
9958
16
    { &hf_dhcp_option_netinfo_parent_server_address,
9959
16
      { "NetInfo Parent Server Address", "dhcp.option.netinfo_parent_server_address",
9960
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
9961
16
        "Option 112: NetInfo Parent Server Address", HFILL }},
9962
9963
16
    { &hf_dhcp_option_netinfo_parent_server_tag,
9964
16
      { "NetInfo Parent Server Tag", "dhcp.option.netinfo_parent_server_tag",
9965
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9966
16
        "Option 113: NetInfo Parent Server Tag", HFILL }},
9967
9968
16
    { &hf_dhcp_option_dhcp_auto_configuration,
9969
16
      { "DHCP Auto-Configuration", "dhcp.option.dhcp_auto_configuration",
9970
16
        FT_UINT8, BASE_DEC, VALS(dhcp_autoconfig), 0x0,
9971
16
        "Option 116: DHCP Auto-Configuration", HFILL }},
9972
9973
16
    { &hf_dhcp_option_dhcp_name_service_search_option,
9974
16
      { "Name Service", "dhcp.option.dhcp_name_service_search_option",
9975
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9976
16
        "Option 117: Name Service", HFILL }},
9977
9978
16
    { &hf_dhcp_option_dhcp_dns_domain_search_list_fqdn,
9979
16
      { "FQDN", "dhcp.option.dhcp_dns_domain_search_list_fqdn",
9980
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9981
16
        "Option 119: FQDN", HFILL }},
9982
9983
16
    { &hf_dhcp_option_sip_server_enc,
9984
16
      { "SIP Server Encoding", "dhcp.option.sip_server.encoding",
9985
16
        FT_UINT8, BASE_DEC, VALS(sip_server_enc_vals), 0x0,
9986
16
        "Option 120: SIP Server encoding", HFILL }},
9987
9988
16
    { &hf_dhcp_option_sip_server_name,
9989
16
      { "SIP Server Name", "dhcp.option.sip_server.name",
9990
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9991
16
        "Option 120: SIP Server Name", HFILL }},
9992
9993
16
    { &hf_dhcp_option_sip_server_address,
9994
16
      { "SIP Server Address", "dhcp.option.sip_server.address",
9995
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
9996
16
        "Option 120: SIP Server Address", HFILL }},
9997
9998
16
    { &hf_dhcp_option_classless_static_route,
9999
16
      { "Subnet/MaskWidth-Router", "dhcp.option.classless_static_route",
10000
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10001
16
        "Option 121: Subnet/MaskWidth-Router", HFILL }},
10002
10003
16
    { &hf_dhcp_option_rfc3825_error,
10004
16
      { "Error", "dhcp.option.rfc3825.error",
10005
16
        FT_UINT8, BASE_DEC, VALS(rfc3825_error_types), 0x0,
10006
16
        "Option 123: Error", HFILL }},
10007
10008
16
    { &hf_dhcp_option_rfc3825_latitude,
10009
16
      { "Latitude", "dhcp.option.rfc3825.latitude",
10010
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10011
16
        "Option 123: Latitude", HFILL }},
10012
10013
16
    { &hf_dhcp_option_rfc3825_longitude,
10014
16
      { "Longitude", "dhcp.option.rfc3825.longitude",
10015
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10016
16
        "Option 123: Longitude", HFILL }},
10017
10018
16
    { &hf_dhcp_option_rfc3825_latitude_res,
10019
16
      { "Latitude resolution", "dhcp.option.rfc3825.latitude_res",
10020
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10021
16
        "Option 123: Latitude resolution", HFILL }},
10022
10023
16
    { &hf_dhcp_option_rfc3825_longitude_res,
10024
16
      { "Longitude resolution", "dhcp.option.rfc3825.longitude_res",
10025
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10026
16
        "Option 123: Longitude resolution", HFILL }},
10027
10028
16
    { &hf_dhcp_option_rfc3825_altitude,
10029
16
      { "Altitude", "dhcp.option.rfc3825.altitude",
10030
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10031
16
        "Option 123: Altitude", HFILL }},
10032
10033
16
    { &hf_dhcp_option_rfc3825_altitude_res,
10034
16
      { "Altitude resolution", "dhcp.option.rfc3825.altitude_res",
10035
16
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10036
16
        "Option 123: Altitude resolution", HFILL }},
10037
10038
16
    { &hf_dhcp_option_rfc3825_altitude_type,
10039
16
      { "Altitude type", "dhcp.option.rfc3825.altitude_type",
10040
16
        FT_UINT8, BASE_DEC, VALS(altitude_type_values), 0x0,
10041
16
        "Option 123: Altitude type", HFILL }},
10042
10043
16
    { &hf_dhcp_option_rfc3825_map_datum,
10044
16
      { "Map Datum", "dhcp.option.rfc3825.map_datum",
10045
16
        FT_UINT8, BASE_DEC, VALS(map_datum_type_values), 0x0,
10046
16
        "Option 123: Map Datum", HFILL }},
10047
10048
16
    { &hf_dhcp_option_cl_dss_id_option,
10049
16
      { "DSS_ID Type", "dhcp.option.cl_dss_id.option",
10050
16
        FT_UINT8, BASE_DEC, VALS(cl_dss_id_type_vals), 0x0,
10051
16
        "Option 123:CL DSS_ID Type", HFILL }},
10052
10053
16
    { &hf_dhcp_option_cl_dss_id_len,
10054
16
      { "DSS_ID Length", "dhcp.option.cl_dss_id.len",
10055
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10056
16
        "Option 123:CL DSS_ID Length", HFILL }},
10057
10058
16
    { &hf_dhcp_option_cl_dss_id,
10059
16
      { "Country", "dhcp.option.cl_dss_id",
10060
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10061
16
        "Option 123:CL DSS_ID", HFILL }},
10062
10063
16
    { &hf_dhcp_option_vi_class_cl_address_mode,
10064
16
      { "CableLab Address Mode", "dhcp.option.vi_class.cl_address_mode",
10065
16
        FT_UINT8, BASE_DEC, VALS(cablelab_ipaddr_mode_vals), 0x0,
10066
16
        "Option 124: CableLab Address Mode", HFILL }},
10067
10068
16
    { &hf_dhcp_option_vi_class_enterprise,
10069
16
      { "Enterprise", "dhcp.option.vi_class.enterprise",
10070
16
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
10071
16
        "Option 124: Enterprise", HFILL }},
10072
10073
16
    { &hf_dhcp_option_vi_class_data_length,
10074
16
      { "Length", "dhcp.option.vi_class.length",
10075
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10076
16
        "Option 124: Length", HFILL }},
10077
10078
16
    { &hf_dhcp_option_vi_class_data_item_length,
10079
16
      { "Length", "dhcp.option.vi_class.vendor_class_data.item.length",
10080
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10081
16
        "Option 124: Length", HFILL }},
10082
10083
16
    { &hf_dhcp_option_vi_class_data_item_data,
10084
16
      { "Data", "dhcp.option.vi_class.vendor_class_data.item.data",
10085
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10086
16
        "Option 124: Data", HFILL }},
10087
10088
16
    { &hf_dhcp_option125_enterprise,
10089
16
      { "Enterprise", "dhcp.option.vi.enterprise",
10090
16
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
10091
16
        "Option 125: Enterprise", HFILL }},
10092
10093
16
    { &hf_dhcp_option125_length,
10094
16
      { "Length", "dhcp.option.vi.length",
10095
16
        FT_UINT8, BASE_DEC, NULL, 0x00,
10096
16
        "Option 125: Length", HFILL }},
10097
10098
16
    { &hf_dhcp_option125_value,
10099
16
      { "Value", "dhcp.option.vi.value",
10100
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10101
16
        "Option 125: Suboption value", HFILL }},
10102
10103
16
    { &hf_dhcp_option125_value_8,
10104
16
      { "Value", "dhcp.option.vi.value.uint",
10105
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10106
16
        "Option 125: Suboption 8-bit value", HFILL }},
10107
10108
16
    { &hf_dhcp_option125_value_16,
10109
16
      { "Value", "dhcp.option.vi.value.uint",
10110
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
10111
16
        "Option 125: Suboption 16-bit value", HFILL }},
10112
10113
16
    { &hf_dhcp_option125_value_ip_address,
10114
16
      { "Value", "dhcp.option.vi.value.address",
10115
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10116
16
        "Option 125: Suboption IP address value", HFILL }},
10117
10118
16
    { &hf_dhcp_option125_value_stringz,
10119
16
      { "Value", "dhcp.option.vi.value.string",
10120
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10121
16
        "Option 125: Suboption Z-String value", HFILL }},
10122
10123
16
    { &hf_dhcp_option125_tr111_suboption,
10124
16
      { "Option 125 Suboption", "dhcp.option.vi.tr111.suboption",
10125
16
        FT_UINT8, BASE_DEC, VALS(option125_tr111_suboption_vals), 0x0,
10126
16
        "Option 125:TR 111 Suboption", HFILL }},
10127
10128
16
    { &hf_dhcp_option125_tr111_device_manufacturer_oui,
10129
16
      { "DeviceManufacturerOUI", "dhcp.option.vi.tr111.device_manufacturer_oui",
10130
16
        FT_UINT24, BASE_OUI, NULL, 0x0,
10131
16
        "Option 125:TR 111 1 DeviceManufacturerOUI", HFILL }},
10132
10133
16
    { &hf_dhcp_option125_tr111_device_serial_number,
10134
16
      { "DeviceSerialNumber", "dhcp.option.vi.tr111.device_serial_number",
10135
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10136
16
        "Option 125:TR 111 2 DeviceSerialNumber", HFILL }},
10137
10138
16
    { &hf_dhcp_option125_tr111_device_product_class,
10139
16
      { "DeviceProductClass", "dhcp.option.vi.tr111.device_product_class",
10140
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10141
16
        "Option 125:TR 111 3 DeviceProductClass", HFILL }},
10142
10143
16
    { &hf_dhcp_option125_tr111_gateway_manufacturer_oui,
10144
16
      { "GatewayManufacturerOUI", "dhcp.option.vi.tr111.gateway_manufacturer_oui",
10145
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10146
16
        "Option 125:TR 111 4 GatewayManufacturerOUI", HFILL }},
10147
10148
16
    { &hf_dhcp_option125_tr111_gateway_serial_number,
10149
16
      { "GatewaySerialNumber", "dhcp.option.vi.tr111.gateway_serial_number",
10150
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10151
16
        "Option 125:TR 111 5 GatewaySerialNumber", HFILL }},
10152
10153
16
    { &hf_dhcp_option125_tr111_gateway_product_class,
10154
16
      { "GatewayProductClass", "dhcp.option.vi.tr111.gateway_product_class",
10155
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10156
16
        "Option 125:TR 111 6 GatewayProductClass", HFILL }},
10157
10158
16
    { &hf_dhcp_option125_cl_suboption,
10159
16
      { "Option 125 Suboption", "dhcp.option.vi.cl.suboption",
10160
16
        FT_UINT8, BASE_DEC, VALS(option125_cl_suboption_vals), 0x0,
10161
16
        "Option 125:CL Suboption", HFILL }},
10162
10163
16
    { &hf_dhcp_option125_cl_option_request,
10164
16
      { "Option Request", "dhcp.option.vi.cl.option_request",
10165
16
        FT_BYTES, SEP_SPACE, NULL, 0x0,
10166
16
        "Option 125:CL 1 Option Request", HFILL }},
10167
10168
16
    { &hf_dhcp_option125_cl_tftp_server_addresses,
10169
16
      { "TFTP Server Addresses", "dhcp.option.vi.cl.tftp_server_addresses",
10170
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10171
16
        "Option 125:CL 2 TFTP Server Addresses", HFILL }},
10172
10173
16
    { &hf_dhcp_option125_cl_erouter_container_option,
10174
16
      { "eRouter Container Option", "dhcp.option.vi.cl.erouter_container_option",
10175
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10176
16
        "Option 125:CL 3 eRouter Container Option", HFILL }},
10177
10178
16
    { &hf_dhcp_option125_cl_mib_environment_indicator_option,
10179
16
      { "MIB Environment Indicator Option", "dhcp.option.vi.cl.mib_environment_indicator_option",
10180
16
        FT_UINT8, BASE_DEC, VALS(pkt_mib_env_ind_opt_vals), 0x0,
10181
16
        "Option 125:CL 4 MIB Environment Indicator Option", HFILL }},
10182
10183
16
    { &hf_dhcp_option125_cl_modem_capabilities,
10184
16
      { "Modem Capabilities", "dhcp.option.vi.cl.modem_capabilities",
10185
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10186
16
        "Option 125:CL 5 Modem Capabilities", HFILL }},
10187
10188
16
    { &hf_dhcp_option_subnet_selection_option,
10189
16
      { "Subnet Selection Option", "dhcp.option.subnet_selection_option",
10190
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10191
16
        "Option 118: Subnet Selection Option", HFILL }},
10192
10193
16
    { &hf_dhcp_option_pana_agent,
10194
16
      { "PAA IPv4 Address", "dhcp.option.pana_agent",
10195
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
10196
16
        "Protocol for Carrying Authentication for Network Access (PANA) Authentication Agents IPv4 Address", HFILL }},
10197
10198
16
    { &hf_dhcp_option_lost_server_domain_name,
10199
16
      { "LoST Server Domain Name", "dhcp.option.lost_server_domain_name",
10200
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10201
16
        "Option 137: LoST Server Domain Name", HFILL }},
10202
10203
16
    { &hf_dhcp_option_capwap_access_controller,
10204
16
      { "CAPWAP Access Controllers", "dhcp.option.capwap_access_controller",
10205
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10206
16
        "Option 138: CAPWAP Access Controllers", HFILL }},
10207
10208
16
    { &hf_dhcp_option_andsf_server,
10209
16
      { "ANDSF Server", "dhcp.option.andsf_server",
10210
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10211
16
        "ANDSF (Access Network Discovery and Selection Function) Server", HFILL }},
10212
10213
16
    { &hf_dhcp_option_forcerenew_nonce_algo,
10214
16
      { "Algorithm", "dhcp.option.forcerenew_nonce.algorithm",
10215
16
        FT_UINT8, BASE_DEC, VALS(forcerenew_nonce_algo_vals), 0x00,
10216
16
        "Forcenew Nonce Algorithm", HFILL }},
10217
10218
16
    { &hf_dhcp_option_rdnss_reserved,
10219
16
      { "Reserved", "dhcp.option.rdnss.reserved",
10220
16
        FT_UINT8, BASE_HEX, NULL, 0xfc,
10221
16
        "RDNSS Reserved", HFILL }},
10222
10223
16
    { &hf_dhcp_option_rdnss_pref,
10224
16
      { "Preference", "dhcp.option.rdnss.preference",
10225
16
        FT_UINT8, BASE_DEC, VALS(rdnss_pref_vals), 0x03,
10226
16
        "RDNSS (Recursive DNS Server) Preference", HFILL }},
10227
10228
16
    { &hf_dhcp_option_rdnss_prim_dns_server,
10229
16
      { "Primary DNS", "dhcp.option.rdnss.primary_dns",
10230
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10231
16
        "RDNSS Primary DNS-recursive-name-server's IPv4 address", HFILL }},
10232
10233
16
    { &hf_dhcp_option_rdnss_sec_dns_server,
10234
16
      { "Secondary DNS", "dhcp.option.rdnss.secondary_dns",
10235
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10236
16
        "RDNSS Secondary DNS-recursive-name-server's IPv4 address", HFILL }},
10237
10238
16
    { &hf_dhcp_option_rdnss_domain,
10239
16
      { "Domains and networks", "dhcp.option.rdnss.domain",
10240
16
        FT_STRING, BASE_NONE, NULL, 0x00,
10241
16
        "RDNSS Domains and networks", HFILL }},
10242
10243
16
    { &hf_dhcp_option_dots_ri,
10244
16
      { "DOTS Reference Identifier", "dhcp.option.dots.ri",
10245
16
        FT_STRING, BASE_NONE, NULL, 0x00,
10246
16
        "Peer DOTS Agent name", HFILL }},
10247
10248
16
    { &hf_dhcp_option_dots_address,
10249
16
      { "DOTS Address", "dhcp.option.dots.address",
10250
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10251
16
        "Peer DOTS Agent Address", HFILL }},
10252
10253
16
    { &hf_dhcp_option_tftp_server_address,
10254
16
      { "TFTP Server Address", "dhcp.option.tftp_server_address",
10255
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10256
16
        "Option 150: TFTP Server Address", HFILL }},
10257
10258
16
    { &hf_dhcp_option_bulk_lease_status_code,
10259
16
      { "Status Code", "dhcp.option.bulk_lease.status_code",
10260
16
        FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_status_code_vals), 0x00,
10261
16
        "DHCPv4 Bulk Leasequery Status Code", HFILL }},
10262
10263
16
    { &hf_dhcp_option_bulk_lease_status_message,
10264
16
      { "Status Code Message", "dhcp.option.bulk_lease.status_code_message",
10265
16
        FT_STRING, BASE_NONE, NULL, 0x00,
10266
16
        "DHCPv4 Bulk Leasequery Status Code Message", HFILL }},
10267
10268
16
    { &hf_dhcp_option_bulk_lease_base_time,
10269
16
      { "Base Time", "dhcp.option.bulk_lease.base_time",
10270
16
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10271
16
        "DHCPv4 Bulk Leasequery Base Time", HFILL }},
10272
10273
16
    { &hf_dhcp_option_bulk_lease_start_time_of_state,
10274
16
      { "Start Time Of State", "dhcp.option.bulk_lease.start_time_of_state",
10275
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10276
16
        "DHCPv4 Bulk Leasequery Start Time Of State", HFILL }},
10277
10278
16
    { &hf_dhcp_option_bulk_lease_query_start,
10279
16
      { "Query Start Time", "dhcp.option.bulk_lease.query_start_time",
10280
16
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10281
16
        "DHCPv4 Bulk Leasequery Query Start Time", HFILL }},
10282
10283
16
    { &hf_dhcp_option_bulk_lease_query_end,
10284
16
      { "Query End Time", "dhcp.option.bulk_lease.query_end_time",
10285
16
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10286
16
        "DHCPv4 Bulk Leasequery Query End Time", HFILL }},
10287
10288
16
    { &hf_dhcp_option_bulk_lease_dhcp_state,
10289
16
      { "Dhcp State", "dhcp.option.bulk_lease.dhcp_state",
10290
16
        FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_state_vals), 0x00,
10291
16
        "DHCPv4 Bulk Leasequery Dhcp State", HFILL }},
10292
10293
16
    { &hf_dhcp_option_bulk_lease_data_source,
10294
16
      { "Data Source", "dhcp.option.bulk_lease.data_source",
10295
16
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_bulk_lease_data_source), 0x00,
10296
16
        "DHCPv4 Bulk Leasequery Data Source", HFILL }},
10297
10298
16
    { &hf_dhcp_option_pcp_list_length,
10299
16
      { "List-Length", "dhcp.option.pcp.list_length",
10300
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10301
16
        "Port Control Protocol (PCP) List Length", HFILL }},
10302
10303
16
    { &hf_dhcp_option_pcp_server,
10304
16
      { "PCP Server", "dhcp.option.pcp.server",
10305
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
10306
16
        "Port Control Protocol (PCP) Server", HFILL }},
10307
10308
16
    { &hf_dhcp_option_portparams_offset,
10309
16
      { "Offset", "dhcp.option.portparams.offset",
10310
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10311
16
        "Port Set ID (PSID) offset", HFILL }},
10312
10313
16
    { &hf_dhcp_option_portparams_psid_length,
10314
16
      { "PSID-Length", "dhcp.option.portparams.psid_length",
10315
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10316
16
        "Port Set ID (PSID) Length", HFILL }},
10317
10318
16
    { &hf_dhcp_option_portparams_psid,
10319
16
      { "PSID", "dhcp.option.portparams.psid",
10320
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10321
16
        "Port Set ID (PSID)", HFILL }},
10322
10323
16
    { &hf_dhcp_option_mudurl,
10324
16
      { "MUDURL", "dhcp.option.mudurl",
10325
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10326
16
        "Option 161: MUDURL", HFILL  }},
10327
10328
16
    { &hf_dhcp_dnr_instance,
10329
16
      { "Instance", "dhcp.option.dnr",
10330
16
        FT_NONE, BASE_NONE, NULL, 0x0,
10331
16
        "Option 162: DNR instance", HFILL }},
10332
10333
16
    { &hf_dhcp_dnr_instance_len,
10334
16
      { "Instance length", "dhcp.option.dnr.length",
10335
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
10336
16
        "Option 162: DNR instance length", HFILL }},
10337
10338
16
    { &hf_dhcp_dnr_svcpriority,
10339
16
      { "Service priority", "dhcp.option.dnr.svcpriority",
10340
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
10341
16
        "Option 162: DNR service priority", HFILL }},
10342
10343
16
    { &hf_dhcp_dnr_auth_domain_name_len,
10344
16
      { "Authentication domain name length", "dhcp.option.dnr.adn_len",
10345
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10346
16
        "Option 162: DNR authentication domain name length", HFILL }},
10347
10348
16
    { &hf_dhcp_dnr_auth_domain_name,
10349
16
      { "Authentication domain name", "dhcp.option.dnr.adn",
10350
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10351
16
        "Option 162: DNR authentication domain name", HFILL }},
10352
10353
16
    { &hf_dhcp_dnr_addrs_len,
10354
16
      { "Addresses length", "dhcp.option.dnr.addrs_len",
10355
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10356
16
        "Option 162: DNR addresses length", HFILL }},
10357
10358
16
    { &hf_dhcp_dnr_addrs,
10359
16
      { "Addresses", "dhcp.option.dnr.addrs",
10360
16
        FT_NONE, BASE_NONE, NULL, 0x0,
10361
16
        "Option 162: DNR addresses", HFILL }},
10362
10363
16
    { &hf_dhcp_dnr_addrs_ip,
10364
16
      { "Address", "dhcp.option.dnr.addrs.ip",
10365
16
        FT_IPv4, BASE_NONE, NULL, 0x0,
10366
16
        "Option 162: DNR address", HFILL }},
10367
10368
16
    { &hf_dhcp_option_pxe_config_file,
10369
16
      { "PXELINUX configuration file", "dhcp.option.pxe_config_file",
10370
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10371
16
        "Option 209: PXE Configuration File", HFILL }},
10372
10373
16
    { &hf_dhcp_option_pxe_path_prefix,
10374
16
      { "PXELINUX path prefix", "dhcp.option.pxe_path_prefix",
10375
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10376
16
        "Option 210: PXE Path Prefix", HFILL }},
10377
10378
16
    { &hf_dhcp_option_pxe_reboot_time,
10379
16
      { "PXELINUX Reboot Time", "dhcp.option.pxe_reboot_time",
10380
16
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10381
16
        "Option 211: PXE Reboot Time", HFILL }},
10382
10383
16
    { &hf_dhcp_option_captive_portal,
10384
16
      { "Captive Portal", "dhcp.option.captive_portal",
10385
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10386
16
        "The contact URI for the captive portal that the user should connect to", HFILL }},
10387
10388
16
    { &hf_dhcp_option_6RD_ipv4_mask_len,
10389
16
      { "6RD IPv4 Mask Length", "dhcp.option.6RD.ipv4_mask_len",
10390
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10391
16
        "Option 212: 6RD IPv4 Mask Length", HFILL }},
10392
10393
16
    { &hf_dhcp_option_6RD_prefix_len,
10394
16
      { "6RD Prefix Length", "dhcp.option.6RD.prefix_len",
10395
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10396
16
        "Option 212: 6RD Prefix Length", HFILL }},
10397
10398
16
    { &hf_dhcp_option_6RD_prefix,
10399
16
      { "6RD Prefix", "dhcp.option.6RD.prefix",
10400
16
        FT_IPv6, BASE_NONE, NULL, 0x00,
10401
16
        "Option 212: 6RD Prefix", HFILL }},
10402
10403
16
    { &hf_dhcp_option_6RD_border_relay_ip,
10404
16
      { "Border Relay IP", "dhcp.option.6RD.border_relay_ip",
10405
16
        FT_IPv4, BASE_NONE, NULL, 0x00,
10406
16
        "Option 212: Border Relay IP", HFILL }},
10407
10408
16
    { &hf_dhcp_option_private_proxy_autodiscovery,
10409
16
      { "Private/Proxy autodiscovery", "dhcp.option.private_proxy_autodiscovery",
10410
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10411
16
        "Option 252: Private/Proxy autodiscovery", HFILL }},
10412
10413
16
    { &hf_dhcp_option_end,
10414
16
      { "Option End", "dhcp.option.end",
10415
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10416
16
        "Option 255: End", HFILL }},
10417
10418
16
    { &hf_dhcp_option_end_overload,
10419
16
      { "Option End (Overload)", "dhcp.option.end",
10420
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10421
16
        "Option 255: End (Overload)", HFILL }},
10422
10423
16
    { &hf_dhcp_vendor_unknown_suboption,
10424
16
      { "Option 125 Suboption", "dhcp.vendor.suboption",
10425
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10426
16
        NULL, HFILL }},
10427
10428
16
    { &hf_dhcp_suboption_data,
10429
16
      { "Data", "dhcp.vendor.data",
10430
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10431
16
        NULL, HFILL }},
10432
10433
16
    { &hf_dhcp_pc_ietf_ccc_suboption,
10434
16
      { "Suboption", "dhcp.vendor.pc.ietf_ccc.suboption",
10435
16
        FT_UINT8, BASE_DEC, VALS(pkt_draft5_ccc_opt_vals), 0x0,
10436
16
        NULL, HFILL }},
10437
10438
16
    { &hf_dhcp_pc_i05_ccc_suboption,
10439
16
      { "Suboption", "dhcp.vendor.pc.i05_ccc.suboption",
10440
16
        FT_UINT8, BASE_DEC, VALS(pkt_i05_ccc_opt_vals), 0x0,
10441
16
        NULL, HFILL }},
10442
10443
16
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout,
10444
16
      { "pktcMtaDevRealmUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_nom_timeout",
10445
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10446
16
        NULL, HFILL }},
10447
10448
16
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout,
10449
16
      { "pktcMtaDevRealmUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_timeout",
10450
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10451
16
        NULL, HFILL }},
10452
10453
16
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries,
10454
16
      { "pktcMtaDevRealmUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_retries",
10455
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10456
16
        NULL, HFILL }},
10457
10458
16
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout,
10459
16
      { "pktcMtaDevProvUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_nom_timeout",
10460
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10461
16
        NULL, HFILL }},
10462
10463
16
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout,
10464
16
      { "pktcMtaDevProvUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_timeout",
10465
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10466
16
        NULL, HFILL }},
10467
10468
16
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries,
10469
16
      { "pktcMtaDevProvUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_retries",
10470
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10471
16
        NULL, HFILL }},
10472
10473
16
    { &hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server,
10474
16
      { "Invalidate PacketCable Provisioning Server", "dhcp.ccc.ietf.sec_tkt.pc_provision_server",
10475
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
10476
16
        NULL, HFILL }},
10477
10478
16
    { &hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management,
10479
16
      { "Invalidate All PacketCable Call Management Servers", "dhcp.ccc.ietf.sec_tkt.all_pc_call_management",
10480
16
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
10481
16
        NULL, HFILL }},
10482
10483
16
    { &hf_dhcp_option242_avaya,
10484
16
      { "Private/Avaya IP Telephone",  "dhcp.option.vendor.avaya",
10485
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10486
16
        "Option 242: Private/Avaya IP Telephone", HFILL }},
10487
10488
16
    { &hf_dhcp_option242_avaya_tlssrvr,
10489
16
      { "TLSSRVR",  "dhcp.option.vendor.avaya.tlssrvr",
10490
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10491
16
        "Option 242: TLSSRVR (HTTPS server(s) to download configuration)", HFILL }},
10492
10493
16
    { &hf_dhcp_option242_avaya_httpsrvr,
10494
16
      { "HTTPSRVR",  "dhcp.option.vendor.avaya.httpsrvr",
10495
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10496
16
        "Option 242: HTTPSRVR (HTTP server(s) to download configuration)", HFILL }},
10497
10498
16
    { &hf_dhcp_option242_avaya_httpdir,
10499
16
      { "HTTPDIR",  "dhcp.option.vendor.avaya.httpdir",
10500
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10501
16
        "Option 242: HTTPDIR (Path to configuration files)", HFILL }},
10502
10503
16
    { &hf_dhcp_option242_avaya_static,
10504
16
      { "STATIC",  "dhcp.option.vendor.avaya.static",
10505
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10506
16
        "Option 242: STATIC (Static programming override flag)", HFILL }},
10507
10508
16
    { &hf_dhcp_option242_avaya_mcipadd,
10509
16
      { "MCIPADD",  "dhcp.option.vendor.avaya.mcipadd",
10510
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10511
16
        "Option 242: MCIPADD (List of CM server(s))", HFILL }},
10512
10513
16
    { &hf_dhcp_option242_avaya_dot1x,
10514
16
      { "DOT1X",  "dhcp.option.vendor.avaya.dot1x",
10515
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10516
16
        "Option 242: DOT1X (802.1X Supplicant operation mode)", HFILL }},
10517
10518
16
    { &hf_dhcp_option242_avaya_icmpdu,
10519
16
      { "ICMPDU",  "dhcp.option.vendor.avaya.icmpdu",
10520
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10521
16
        "Option 242: ICMPDU (ICMP Destination Unreachable processing)", HFILL }},
10522
10523
16
    { &hf_dhcp_option242_avaya_icmpred,
10524
16
      { "ICMPRED",  "dhcp.option.vendor.avaya.icmpred",
10525
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10526
16
        "Option 242: ICMPRED (ICMP Redirect handling)", HFILL }},
10527
10528
16
    { &hf_dhcp_option242_avaya_l2q,
10529
16
      { "L2Q",  "dhcp.option.vendor.avaya.l2q",
10530
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10531
16
        "Option 242: L2Q (Controls 802.1Q tagging)", HFILL }},
10532
10533
16
    { &hf_dhcp_option242_avaya_l2qvlan,
10534
16
      { "L2QVLAN",  "dhcp.option.vendor.avaya.l2qvlan",
10535
16
        FT_INT32, BASE_DEC, NULL, 0x0,
10536
16
        "Option 242: L2QVLAN (VLAN ID)", HFILL }},
10537
10538
16
    { &hf_dhcp_option242_avaya_loglocal,
10539
16
      { "LOGLOCAL",  "dhcp.option.vendor.avaya.loglocal",
10540
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10541
16
        "Option 242: LOGLOCAL (Log level)", HFILL }},
10542
10543
16
    { &hf_dhcp_option242_avaya_phy1stat,
10544
16
      { "PHY1STAT",  "dhcp.option.vendor.avaya.phy1stat",
10545
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10546
16
        "Option 242: PHY1STAT (Interface configuration)", HFILL }},
10547
10548
16
    { &hf_dhcp_option242_avaya_phy2stat,
10549
16
      { "PHY2STAT",  "dhcp.option.vendor.avaya.phy2stat",
10550
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10551
16
        "Option 242: PHY2STAT (Interface configuration)", HFILL }},
10552
10553
16
    { &hf_dhcp_option242_avaya_procpswd,
10554
16
      { "PROCPSWD",  "dhcp.option.vendor.avaya.procpswd",
10555
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10556
16
        "Option 242: PROCPSWD (Security string used to access local procedures)", HFILL }},
10557
10558
16
    { &hf_dhcp_option242_avaya_procstat,
10559
16
      { "PROCSTAT",  "dhcp.option.vendor.avaya.procstat",
10560
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10561
16
        "Option 242: PROCSTAT (Local (dialpad) Administrative access)", HFILL }},
10562
10563
16
    { &hf_dhcp_option242_avaya_snmpadd,
10564
16
      { "SNMPADD",  "dhcp.option.vendor.avaya.snmpadd",
10565
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10566
16
        "Option 242: SNMPADD (Allowable source IP Address(es) for SNMP queries)", HFILL }},
10567
10568
16
    { &hf_dhcp_option242_avaya_snmpstring,
10569
16
      { "SNMPSTRING",  "dhcp.option.vendor.avaya.snmpstring",
10570
16
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10571
16
        "Option 242: SNMPSTRING (SNMP community string)", HFILL }},
10572
10573
16
    { &hf_dhcp_option242_avaya_vlantest,
10574
16
      { "VLANTEST",  "dhcp.option.vendor.avaya.vlantest",
10575
16
        FT_INT32, BASE_DEC, NULL, 0x0,
10576
16
        "Option 242: VLANTEST (Timeout in seconds)", HFILL }},
10577
10578
    /* Cisco vendor suboptions */
10579
16
    { &hf_dhcp_option43_cisco_suboption,
10580
16
      { "Option 43 Suboption", "dhcp.option.vendor.cisco.suboption",
10581
16
        FT_UINT8, BASE_DEC, VALS(option43_cisco_suboption_vals), 0x0,
10582
16
        "Option 43:Cisco Suboption", HFILL }},
10583
10584
16
    { &hf_dhcp_option43_cisco_unknown,
10585
16
      { "Unknown", "dhcp.option.vendor.cisco.unknown",
10586
16
        FT_BYTES, BASE_NONE, NULL, 0x0,
10587
16
        NULL, HFILL }},
10588
10589
16
    { &hf_dhcp_option43_cisco_unknown1,
10590
16
      { "Unknown1", "dhcp.option.vendor.cisco.unknown1",
10591
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10592
16
        NULL, HFILL }},
10593
10594
16
    { &hf_dhcp_option43_cisco_unknown2,
10595
16
      { "Unknown2", "dhcp.option.vendor.cisco.unknown2",
10596
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10597
16
        NULL, HFILL }},
10598
10599
16
    { &hf_dhcp_option43_cisco_unknown3,
10600
16
      { "Unknown3", "dhcp.option.vendor.cisco.unknown3",
10601
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
10602
16
        NULL, HFILL }},
10603
10604
16
    { &hf_dhcp_option43_cisco_nodeid,
10605
16
      { "Node ID", "dhcp.option.vendor.cisco.nodeid",
10606
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10607
16
        NULL, HFILL }},
10608
10609
16
    { &hf_dhcp_option43_cisco_unknown5,
10610
16
      { "Unknown5", "dhcp.option.vendor.cisco.unknown5",
10611
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10612
16
        NULL, HFILL }},
10613
10614
16
    { &hf_dhcp_option43_cisco_unknown6,
10615
16
      { "Unknown6", "dhcp.option.vendor.cisco.unknown6",
10616
16
        FT_UINT8, BASE_DEC, NULL, 0x0,
10617
16
        NULL, HFILL }},
10618
10619
16
    { &hf_dhcp_option43_cisco_model,
10620
16
      { "Model", "dhcp.option.vendor.cisco.model",
10621
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10622
16
        NULL, HFILL }},
10623
10624
16
    { &hf_dhcp_option43_cisco_apicuuid,
10625
16
      { "APIC UUID", "dhcp.option.vendor.cisco.apicuuid",
10626
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10627
16
        NULL, HFILL }},
10628
10629
16
    { &hf_dhcp_option43_cisco_fabricname,
10630
16
      { "Fabricname", "dhcp.option.vendor.cisco.fabricname",
10631
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10632
16
        NULL, HFILL }},
10633
10634
16
    { &hf_dhcp_option43_cisco_unknown10,
10635
16
      { "Unknown10", "dhcp.option.vendor.cisco.unknown10",
10636
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
10637
16
        NULL, HFILL }},
10638
10639
16
    { &hf_dhcp_option43_cisco_serialno,
10640
16
      { "SerialNo", "dhcp.option.vendor.cisco.serialno",
10641
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10642
16
        NULL, HFILL }},
10643
10644
16
    { &hf_dhcp_option43_cisco_clientint,
10645
16
      { "Client Int", "dhcp.option.vendor.cisco.clientint",
10646
16
        FT_STRING, BASE_NONE, NULL, 0x0,
10647
16
        NULL, HFILL }},
10648
16
  };
10649
10650
16
  static uat_field_t dhcp_uat_flds[] = {
10651
16
    UAT_FLD_DEC(uat_dhcp_records, opt, "Option number", "Custom Option Number"),
10652
16
    UAT_FLD_CSTRING(uat_dhcp_records, text, "Option Name", "Custom Option Name"),
10653
16
    UAT_FLD_VS(uat_dhcp_records, ftype, "Option type", dhcp_custom_type_vals, "Option datatype"),
10654
16
    UAT_END_FIELDS
10655
16
  };
10656
10657
16
  static int *ett[] = {
10658
16
    &ett_dhcp,
10659
16
    &ett_dhcp_flags,
10660
16
    &ett_dhcp_option,
10661
16
    &ett_dhcp_option43_suboption,
10662
16
    &ett_dhcp_option43_suboption_discovery,
10663
16
    &ett_dhcp_option43_suboption_tree,
10664
16
    &ett_dhcp_option63_suboption,
10665
16
    &ett_dhcp_option77_instance,
10666
16
    &ett_dhcp_option82_suboption,
10667
16
    &ett_dhcp_option82_suboption9,
10668
16
    &ett_dhcp_option82_suboption10,
10669
16
    &ett_dhcp_option124_vendor_class_data_item,
10670
16
    &ett_dhcp_option125_suboption,
10671
16
    &ett_dhcp_option125_tr111_suboption,
10672
16
    &ett_dhcp_option125_cl_suboption,
10673
16
    &ett_dhcp_option242_suboption,
10674
16
    &ett_dhcp_fqdn,
10675
16
    &ett_dhcp_filename_option,
10676
16
    &ett_dhcp_server_hostname,
10677
16
    &ett_dhcp_fqdn_flags,
10678
16
    &ett_dhcp_isns_functions,
10679
16
    &ett_dhcp_isns_discovery_domain_access,
10680
16
    &ett_dhcp_isns_administrative_flags,
10681
16
    &ett_dhcp_isns_server_security_bitmap,
10682
16
    &ett_dhcp_isns_secondary_server_addr,
10683
16
    &ett_dhcp_o43_bsdp_boot_image,
10684
16
    &ett_dhcp_o43_bsdp_attributes,
10685
16
    &ett_dhcp_o43_bsdp_image_desc_list,
10686
16
    &ett_dhcp_o43_bsdp_image_desc,
10687
16
    &ett_dhcp_o43_bsdp_attributes_flags,
10688
16
    &ett_dhcp_option158_pcp_list,
10689
16
    &ett_dhcp_dnr_instance,
10690
16
    &ett_dhcp_dnr_instance_addrs,
10691
16
  };
10692
10693
16
  static ei_register_info ei[] = {
10694
16
    { &ei_dhcp_bad_length, { "dhcp.bad_length", PI_PROTOCOL, PI_ERROR, "length isn't 0", EXPFILL }},
10695
16
    { &ei_dhcp_bad_bitfield, { "dhcp.bad_bitfield", PI_PROTOCOL, PI_ERROR, "Bogus bitfield", EXPFILL }},
10696
16
    { &ei_dhcp_missing_subopt_length, { "dhcp.missing_subopt_length", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption length", EXPFILL }},
10697
16
    { &ei_dhcp_missing_subopt_value, { "dhcp.missing_subopt_value", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value", EXPFILL }},
10698
16
    { &ei_dhcp_mal_duid, { "dhcp.malformed.duid", PI_PROTOCOL, PI_ERROR, "DUID: malformed option", EXPFILL }},
10699
16
    { &ei_dhcp_rfc3396_refer_last_option, { "dhcp.option.refer_last_option", PI_REASSEMBLE, PI_CHAT, "For the data, please refer to the last option of this type", EXPFILL }},
10700
16
    { &ei_dhcp_opt_overload_wrong_field, { "dhcp.option.option_overload.wrong_field", PI_PROTOCOL, PI_WARN, "overload option makes no sense in the file or sname field", EXPFILL }},
10701
16
    { &ei_dhcp_opt_overload_file_end_missing, { "dhcp.option.option_overload.file_end_missing", PI_PROTOCOL, PI_ERROR, "file overload end option missing", EXPFILL }},
10702
16
    { &ei_dhcp_opt_overload_sname_end_missing, { "dhcp.option.option_overload.sname_end_missing", PI_PROTOCOL, PI_ERROR, "sname overload end option missing", EXPFILL }},
10703
16
    { &ei_dhcp_subopt_unknown_type, { "dhcp.subopt.unknown_type", PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler", EXPFILL }},
10704
16
    { &ei_dhcp_option_civic_location_bad_cattype, { "dhcp.option.civic_location.bad_cattype", PI_PROTOCOL, PI_ERROR, "Error with CAType", EXPFILL }},
10705
16
    { &ei_dhcp_option_dhcp_name_service_invalid, { "dhcp.option.dhcp_name_service.invalid", PI_PROTOCOL, PI_ERROR, "Invalid Name Service", EXPFILL }},
10706
16
    { &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 }},
10707
16
    { &ei_dhcp_option_classless_static_route, { "dhcp.option.classless_static.route", PI_PROTOCOL, PI_ERROR, "Mask width > 32", EXPFILL }},
10708
16
    { &ei_dhcp_option125_enterprise_malformed, { "dhcp.option.enterprise.malformed", PI_PROTOCOL, PI_ERROR, "no room left in option for enterprise data", EXPFILL }},
10709
16
    { &ei_dhcp_option_6RD_malformed, { "dhcp.option.6RD.malformed", PI_PROTOCOL, PI_ERROR, "6RD: malformed option", EXPFILL }},
10710
16
    { &ei_dhcp_option82_vi_cl_tag_unknown, { "dhcp.option.option.vi.cl.tag_unknown", PI_PROTOCOL, PI_ERROR, "Unknown tag", EXPFILL }},
10711
16
    { &ei_dhcp_option_parse_err, { "dhcp.option.parse_err", PI_PROTOCOL, PI_ERROR, "Parse error", EXPFILL }},
10712
16
    { &ei_dhcp_nonstd_option_data, { "dhcp.option.nonstd_data", PI_PROTOCOL, PI_NOTE, "Non standard compliant option data", EXPFILL }},
10713
16
    { &ei_dhcp_suboption_invalid, { "dhcp.suboption_invalid", PI_PROTOCOL, PI_ERROR, "Invalid suboption", EXPFILL }},
10714
16
    { &ei_dhcp_secs_le, { "dhcp.secs_le", PI_PROTOCOL, PI_NOTE, "Seconds elapsed appears to be encoded as little-endian", EXPFILL }},
10715
16
    { &ei_dhcp_end_option_missing, { "dhcp.end_option_missing", PI_PROTOCOL, PI_ERROR, "End option missing", EXPFILL }},
10716
16
    { &ei_dhcp_client_address_not_given, { "dhcp.client_address_not_given", PI_PROTOCOL, PI_NOTE, "Client address not given", EXPFILL }},
10717
16
    { &ei_dhcp_server_name_overloaded_by_dhcp, { "dhcp.server_name_overloaded_by_dhcp", PI_PROTOCOL, PI_NOTE, "Server name option overloaded by DHCP", EXPFILL }},
10718
16
    { &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 }},
10719
16
    { &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 }},
10720
16
    { &ei_dhcp_option242_avaya_l2qvlan_invalid, { "dhcp.option.vendor.avaya.l2qvlan.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (L2QVLAN) invalid", EXPFILL }},
10721
16
    { &ei_dhcp_option242_avaya_vlantest_invalid, { "dhcp.option.vendor.avaya.vlantest.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (avaya vlantest) invalid", EXPFILL }},
10722
16
    { &ei_dhcp_option93_client_arch_ambiguous, { "dhcp.option.client_architecture.ambiguous", PI_PROTOCOL, PI_WARN, "Client Architecture ID may be ambiguous", EXPFILL }},
10723
16
    { &ei_dhcp_option_dnr_adn_only_mode, { "dhcp.option.dnr.adn_only_mode", PI_COMMENTS_GROUP, PI_CHAT, "This DNR instance is in ADN-only mode", EXPFILL }},
10724
16
  };
10725
10726
16
  static tap_param dhcp_stat_params[] = {
10727
16
    { PARAM_FILTER, "filter", "Filter", NULL, true }
10728
16
  };
10729
10730
16
  static stat_tap_table_ui dhcp_stat_table = {
10731
16
    REGISTER_PACKET_STAT_GROUP_UNSORTED,
10732
16
    "DHCP (BOOTP) Statistics",
10733
16
    "dhcp",
10734
16
    "dhcp,stat",
10735
16
    dhcp_stat_init,
10736
16
    dhcp_stat_packet,
10737
16
    dhcp_stat_reset,
10738
16
    NULL,
10739
16
    NULL,
10740
16
    array_length(dhcp_stat_fields), dhcp_stat_fields,
10741
16
    array_length(dhcp_stat_params), dhcp_stat_params,
10742
16
    NULL,
10743
16
    0
10744
16
  };
10745
10746
16
  module_t *dhcp_module;
10747
16
  expert_module_t* expert_dhcp;
10748
10749
16
  proto_dhcp = proto_register_protocol("Dynamic Host Configuration Protocol", "DHCP/BOOTP", "dhcp");
10750
16
  proto_register_field_array(proto_dhcp, hf, array_length(hf));
10751
16
  proto_register_alias(proto_dhcp, "bootp");
10752
16
  proto_register_subtree_array(ett, array_length(ett));
10753
16
  dhcp_bootp_tap = register_tap("dhcp");
10754
10755
16
  expert_dhcp = expert_register_protocol(proto_dhcp);
10756
16
  expert_register_field_array(expert_dhcp, ei, array_length(ei));
10757
10758
16
  dhcp_option_table = register_dissector_table("dhcp.option", "BOOTP Options", proto_dhcp, FT_UINT8, BASE_DEC);
10759
16
  dhcp_vendor_id_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_id", "DHCP Vendor ID", proto_dhcp);
10760
16
  dhcp_vendor_info_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_info", "DHCP Vendor Info", proto_dhcp);
10761
16
  dhcp_enterprise_class_table = register_dissector_table("dhcp.enterprise_class", "V-I Vendor Class Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10762
16
  dhcp_enterprise_specific_table = register_dissector_table("dhcp.enterprise", "V-I Vendor Specific Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10763
10764
  /* register init/cleanup routine to handle the custom dhcp options */
10765
16
  register_init_routine(&dhcp_init_protocol);
10766
16
  register_cleanup_routine(&dhcp_cleanup_protocol);
10767
10768
  /* Allow dissector to find be found by name. */
10769
16
  dhcp_handle = register_dissector("dhcp", dissect_dhcp, proto_dhcp);
10770
10771
16
  dhcp_module = prefs_register_protocol(proto_dhcp, NULL);
10772
10773
16
  prefs_register_bool_preference(dhcp_module, "novellserverstring",
10774
16
               "Decode Option 85 as String",
10775
16
               "Novell Servers option 85 can be configured as a string instead of address",
10776
16
               &novell_string);
10777
10778
16
  prefs_register_enum_preference(dhcp_module, "pkt.ccc.protocol_version",
10779
16
               "PacketCable CCC protocol version",
10780
16
               "The PacketCable CCC protocol version",
10781
16
               &pkt_ccc_protocol_version,
10782
16
               pkt_ccc_protocol_versions,
10783
16
               false);
10784
10785
16
  prefs_register_uint_preference(dhcp_module, "pkt.ccc.option",
10786
16
               "PacketCable CCC option",
10787
16
               "Option Number for PacketCable CableLabs Client Configuration",
10788
16
               10,
10789
16
               &pkt_ccc_option);
10790
10791
16
  prefs_register_enum_preference(dhcp_module, "uuid.endian",
10792
16
               "Endianness of UUID",
10793
16
               "Endianness applied to UUID fields",
10794
16
               &dhcp_uuid_endian,
10795
16
               dhcp_uuid_endian_vals,
10796
16
               false);
10797
10798
16
  prefs_register_enum_preference(dhcp_module, "secs.endian",
10799
16
               "Endianness of seconds elapsed field",
10800
16
               "Endianness applied to seconds elapsed field",
10801
16
               &dhcp_secs_endian,
10802
16
               dhcp_secs_endian_vals,
10803
16
               false);
10804
10805
16
  prefs_register_obsolete_preference(dhcp_module, "displayasstring");
10806
10807
16
  dhcp_uat = uat_new("Custom DHCP/BootP Options (Excl. suboptions)",
10808
16
      sizeof(uat_dhcp_record_t), /* record size      */
10809
16
      "custom_bootp",      /* filename         */
10810
16
      true,        /* from_profile       */
10811
16
      &uat_dhcp_records,     /* data_ptr         */
10812
16
      &num_dhcp_records_uat,     /* numitems_ptr       */
10813
16
      UAT_AFFECTS_DISSECTION,    /* affects dissection of packets, but not set of named fields */
10814
16
      NULL,        /* help         */
10815
16
      uat_dhcp_record_copy_cb,   /* copy callback      */
10816
16
      uat_dhcp_record_update_cb, /* update callback      */
10817
16
      uat_dhcp_record_free_cb,   /* free callback      */
10818
16
      NULL,        /* post update callback   */
10819
16
      NULL,        /* reset callback   */
10820
16
      dhcp_uat_flds);      /* UAT field definitions  */
10821
10822
16
  prefs_register_uat_preference(dhcp_module,
10823
16
              "custom_dhcp_table",
10824
16
              "Custom DHCP/BootP Options (Excl. suboptions)",
10825
16
              "Custom DHCP/BootP Options (Excl. suboptions)",
10826
16
              dhcp_uat);
10827
10828
16
  register_stat_tap_table_ui(&dhcp_stat_table);
10829
16
}
10830
10831
void
10832
proto_reg_handoff_dhcp(void)
10833
16
{
10834
16
  range_t *dhcpopt_basictype_range;
10835
10836
16
  dissector_add_uint_range_with_preference("udp.port", DHCP_UDP_PORT_RANGE, dhcp_handle);
10837
10838
  /* Create dissection function handles for all DHCP/BOOTP options */
10839
16
  dhcpopt_basic_handle = create_dissector_handle( dissect_dhcpopt_basic_type, proto_dhcp );
10840
16
  range_convert_str(wmem_epan_scope(), &dhcpopt_basictype_range, DHCP_OPTION_BASICTYPE_RANGE, 0xFF);
10841
16
  dissector_add_uint_range("dhcp.option", dhcpopt_basictype_range, dhcpopt_basic_handle);
10842
10843
16
  dissector_add_uint("dhcp.option", 21, create_dissector_handle( dissect_dhcpopt_policy_filter, proto_dhcp ));
10844
16
  dissector_add_uint("dhcp.option", 33, create_dissector_handle( dissect_dhcpopt_static_route, proto_dhcp ));
10845
16
  dissector_add_uint("dhcp.option", 43, create_dissector_handle( dissect_dhcpopt_vendor_specific_info, proto_dhcp ));
10846
16
  dissector_add_uint("dhcp.option", 52, create_dissector_handle( dissect_dhcpopt_option_overload, proto_dhcp ));
10847
16
  dissector_add_uint("dhcp.option", 53, create_dissector_handle( dissect_dhcpopt_dhcp, proto_dhcp ));
10848
16
  dissector_add_uint("dhcp.option", 55, create_dissector_handle( dissect_dhcpopt_param_request_list, proto_dhcp ));
10849
16
  dissector_add_uint("dhcp.option", 60, create_dissector_handle( dissect_dhcpopt_vendor_class_identifier, proto_dhcp ));
10850
16
  dissector_add_uint("dhcp.option", 61, create_dissector_handle( dissect_dhcpopt_client_identifier, proto_dhcp ));
10851
16
  dissector_add_uint("dhcp.option", 63, create_dissector_handle( dissect_dhcpopt_netware_ip, proto_dhcp ));
10852
16
  dissector_add_uint("dhcp.option", 77, create_dissector_handle( dissect_dhcpopt_user_class_information, proto_dhcp ));
10853
16
  dissector_add_uint("dhcp.option", 78, create_dissector_handle( dissect_dhcpopt_slp_directory_agent, proto_dhcp ));
10854
16
  dissector_add_uint("dhcp.option", 79, create_dissector_handle( dissect_dhcpopt_slp_service_scope, proto_dhcp ));
10855
16
  dissector_add_uint("dhcp.option", 81, create_dissector_handle( dissect_dhcpopt_client_full_domain_name, proto_dhcp ));
10856
16
  dissector_add_uint("dhcp.option", 82, create_dissector_handle( dissect_dhcpopt_relay_agent_info, proto_dhcp ));
10857
16
  dissector_add_uint("dhcp.option", 83, create_dissector_handle( dissect_dhcpopt_isns, proto_dhcp ));
10858
16
  dissector_add_uint("dhcp.option", 85, create_dissector_handle( dissect_dhcpopt_novell_servers, proto_dhcp ));
10859
16
  dissector_add_uint("dhcp.option", 90, create_dissector_handle( dissect_dhcpopt_dhcp_authentication, proto_dhcp ));
10860
16
  dissector_add_uint("dhcp.option", 93, create_dissector_handle( dissect_dhcpopt_client_architecture, proto_dhcp ));
10861
16
  dissector_add_uint("dhcp.option", 94, create_dissector_handle( dissect_dhcpopt_client_network_interface_id, proto_dhcp ));
10862
16
  dissector_add_uint("dhcp.option", 97, create_dissector_handle( dissect_dhcpopt_client_identifier_uuid, proto_dhcp ));
10863
16
  dissector_add_uint("dhcp.option", 99, create_dissector_handle( dissect_dhcpopt_civic_location, proto_dhcp ));
10864
16
  dissector_add_uint("dhcp.option", 114, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10865
16
  dissector_add_uint("dhcp.option", 117, create_dissector_handle( dissect_dhcpopt_name_server_search, proto_dhcp ));
10866
16
  dissector_add_uint("dhcp.option", 119, create_dissector_handle( dissect_dhcpopt_dhcp_domain_search, proto_dhcp ));
10867
16
  dissector_add_uint("dhcp.option", 120, create_dissector_handle( dissect_dhcpopt_sip_servers, proto_dhcp ));
10868
16
  dissector_add_uint("dhcp.option", 121, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10869
  /* The PacketCable CCC option number can vary. Still handled through preference */
10870
16
  dissector_add_uint("dhcp.option", 122, create_dissector_handle( dissect_dhcpopt_packetcable_ccc, proto_dhcp ));
10871
10872
16
  dissector_add_uint("dhcp.option", 123, create_dissector_handle( dissect_dhcpopt_coordinate_based_location, proto_dhcp ));
10873
16
  dissector_add_uint("dhcp.option", 124, create_dissector_handle( dissect_dhcpopt_vi_vendor_class, proto_dhcp ));
10874
16
  dissector_add_uint("dhcp.option", 125, create_dissector_handle( dissect_dhcpopt_vi_vendor_specific_info, proto_dhcp ));
10875
16
  dissector_add_uint("dhcp.option", 145, create_dissector_handle( dissect_dhcpopt_forcerenew_nonce, proto_dhcp ));
10876
16
  dissector_add_uint("dhcp.option", 146, create_dissector_handle( dissect_dhcpopt_rdnss, proto_dhcp ));
10877
16
  dissector_add_uint("dhcp.option", 151, create_dissector_handle( dissect_dhcpopt_bulk_lease_status_code, proto_dhcp ));
10878
16
  dissector_add_uint("dhcp.option", 152, create_dissector_handle( dissect_dhcpopt_bulk_lease_base_time, proto_dhcp ));
10879
16
  dissector_add_uint("dhcp.option", 154, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_start, proto_dhcp ));
10880
16
  dissector_add_uint("dhcp.option", 155, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_end, proto_dhcp ));
10881
16
  dissector_add_uint("dhcp.option", 158, create_dissector_handle( dissect_dhcpopt_pcp_server, proto_dhcp ));
10882
16
  dissector_add_uint("dhcp.option", 159, create_dissector_handle( dissect_dhcpopt_portparams, proto_dhcp ));
10883
16
  dissector_add_uint("dhcp.option", 160, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10884
16
  dissector_add_uint("dhcp.option", 162, create_dissector_handle( dissect_dhcpopt_dnr, proto_dhcp ));
10885
16
  dissector_add_uint("dhcp.option", 212, create_dissector_handle( dissect_dhcpopt_6RD_option, proto_dhcp ));
10886
16
  dissector_add_uint("dhcp.option", 242, create_dissector_handle( dissect_dhcpopt_avaya_ip_telephone, proto_dhcp ));
10887
16
  dissector_add_uint("dhcp.option", 249, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10888
10889
  /* Create heuristic dissection for DHCP vendor class id */
10890
16
  heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_mta_vendor_id_heur, "PacketCable MTA", "packetcable_mta_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10891
16
  heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_cm_vendor_id_heur, "PacketCable CM", "packetcable_cm_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10892
16
  heur_dissector_add( "dhcp.vendor_id", dissect_apple_bsdp_vendor_id_heur, "Apple BSDP", "apple_bsdp_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10893
10894
  /* Create heuristic dissection for DHCP vendor specific information */
10895
10896
  /* Note that this is a rather weak (permissive) heuristic,
10897
     it's put first so it ends up at the end of the list, I guess this is OK.
10898
     Add any stronger (less permissive) heuristics after this!
10899
     XXX - Should we just disable by default? */
10900
16
  heur_dissector_add( "dhcp.vendor_info", dissect_alcatel_lucent_vendor_info_heur, "Alcatel-Lucent", "alcatel_lucent_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10901
10902
16
  heur_dissector_add( "dhcp.vendor_info", dissect_pxeclient_vendor_info_heur, "PXEClient", "pxeclient_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10903
16
  heur_dissector_add( "dhcp.vendor_info", dissect_cablelabs_vendor_info_heur, "CableLabs", "cablelabs_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10904
16
  heur_dissector_add( "dhcp.vendor_info", dissect_aruba_ap_vendor_info_heur, ARUBA_AP, "aruba_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10905
16
  heur_dissector_add( "dhcp.vendor_info", dissect_aruba_instant_ap_vendor_info_heur, ARUBA_INSTANT_AP, "aruba_instant_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10906
16
  heur_dissector_add( "dhcp.vendor_info", dissect_apple_bsdp_vendor_info_heur, "Apple BSDP", "apple_bsdp_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10907
16
  heur_dissector_add( "dhcp.vendor_info", dissect_aerohive_vendor_info_heur, "AEROHIVE", "aerohive_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10908
16
  heur_dissector_add( "dhcp.vendor_info", dissect_cisco_vendor_info_heur, "Cisco", "cisco_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10909
10910
  /* Create dissection function handles for DHCP Enterprise dissection */
10911
16
  dissector_add_uint("dhcp.enterprise", 4491, create_dissector_handle( dissect_vendor_cl_suboption, proto_dhcp ));
10912
16
  dissector_add_uint("dhcp.enterprise", 3561, create_dissector_handle( dissect_vendor_tr111_suboption, proto_dhcp ));
10913
10914
16
  svc_params_handle = find_dissector("svc_params");
10915
16
}
10916
10917
/*
10918
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
10919
 *
10920
 * Local variables:
10921
 * c-basic-offset: 8
10922
 * tab-width: 8
10923
 * indent-tabs-mode: t
10924
 * End:
10925
 *
10926
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
10927
 * :indentSize=8:tabSize=8:noTabs=false:
10928
 */