Coverage Report

Created: 2026-07-12 07:10

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
35
#define DHCP_HW_IS_ETHER(hwtype, length) ((hwtype == 1 || hwtype == 6) && length == 6)
785
786
/* RFC2937 The Name Service Search Option for DHCP */
787
532
#define RFC2937_LOCAL_NAMING_INFORMATION         0
788
97
#define RFC2937_DOMAIN_NAME_SERVER_OPTION        6
789
111
#define RFC2937_NETWORK_INFORMATION_SERVERS_OPTION      41
790
120
#define RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION      44
791
122
#define RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION   65
792
793
/* RFC3825decoder error codes of the conversion function */
794
31
#define RFC3825_NOERROR         0
795
3
#define RFC3825_LATITUDE_OUTOFRANGE     1
796
2
#define RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE   2
797
2
#define RFC3825_LONGITUDE_OUTOFRANGE      3
798
2
#define RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE  4
799
1
#define RFC3825_ALTITUDE_OUTOFRANGE     5
800
5
#define RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE   6
801
3
#define RFC3825_ALTITUDE_TYPE_OUTOFRANGE    7
802
9
#define RFC3825_DATUM_TYPE_OUTOFRANGE     8
803
804
21
#define DUID_LLT    1
805
3
#define DUID_EN     2
806
17
#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
12.7k
#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
15
#define DHCP_UDP_PORT_RANGE  "67-68,4011"
1066
38.4k
#define PROXYDHCP_UDP_PORT   4011
1067
1068
12.7k
#define BOOTP_BC  0x8000
1069
15
#define BOOTP_MBZ 0x7FFF
1070
1071
/* FQDN stuff */
1072
15
#define F_FQDN_S  0x01
1073
15
#define F_FQDN_O  0x02
1074
204
#define F_FQDN_E  0x04
1075
15
#define F_FQDN_N  0x08
1076
15
#define F_FQDN_MBZ  0xf0
1077
1078
#define ISNS_BITFIELD_NZ_MUST_BE_IGNORED(mask, ena_flag)    \
1079
750
  ((mask) && !((mask) & (ena_flag)))
1080
1081
/* iSNS bit fields */
1082
15
#define F_ISNS_FUNCTIONS_ENABLED  0x0001
1083
15
#define F_ISNS_FUNCTIONS_DD_AUTH  0x0002
1084
15
#define F_ISNS_FUNCTIONS_SEC_POLICY 0x0004
1085
15
#define F_ISNS_FUNCTIONS_RESERVED 0xFFF8
1086
1087
15
#define F_ISNS_DD_ACCESS_ENABLED    0x0001
1088
15
#define F_ISNS_DD_ACCESS_CTRL_NODE    0x0002
1089
15
#define F_ISNS_DD_ACCESS_ISCSI_TARGET   0x0004
1090
15
#define F_ISNS_DD_ACCESS_ISCSI_INITIATOR  0x0008
1091
15
#define F_ISNS_DD_ACCESS_IFCP_TARGET_PORT 0x0010
1092
15
#define F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT  0x0020
1093
15
#define F_ISNS_DD_ACCESS_RESERVED   0xFFC0
1094
1095
204
#define F_ISNS_ADMIN_FLAGS_ENABLED    0x0001
1096
95
#define F_ISNS_ADMIN_FLAGS_HEARTBEAT    0x0002
1097
15
#define F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS  0x0004
1098
15
#define F_ISNS_ADMIN_FLAGS_DEFAULT_DD   0x0008
1099
15
#define F_ISNS_ADMIN_FLAGS_RESERVED   0xFFF0
1100
1101
15
#define F_ISNS_SRV_SEC_BITMAP_ENABLED   0x0001
1102
15
#define F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC   0x0002
1103
15
#define F_ISNS_SRV_SEC_BITMAP_MAIN_MODE   0x0004
1104
15
#define F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE  0x0008
1105
15
#define F_ISNS_SRV_SEC_BITMAP_PFS   0x0010
1106
15
#define F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE 0x0020
1107
15
#define F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE 0x0040
1108
15
#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.48k
#define PACKETCABLE_MTA_CAP10 "pktc1.0:"
1183
1.42k
#define PACKETCABLE_MTA_CAP15 "pktc1.5:"
1184
1.33k
#define PACKETCABLE_MTA_CAP20 "pktc2.0:"
1185
1.30k
#define PACKETCABLE_CM_CAP11  "docsis1.1:"
1186
1.24k
#define PACKETCABLE_CM_CAP20  "docsis2.0:"
1187
1.18k
#define PACKETCABLE_CM_CAP30  "docsis3.0:"
1188
1189
0
#define PACKETCABLE_CCC_I05  1
1190
307
#define PACKETCABLE_CCC_DRAFT5   2
1191
5.54k
#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.97k
#define APPLE_BSDP_SERVER "AAPLBSDPC"
1201
2.92k
#define APPLE_BSDP_CLIENT "AAPLBSDPC/"
1202
1203
1.61k
#define CISCO_VCID "cisco"
1204
1205
1.59k
#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.44k
#define ARUBA_INSTANT_AP "ArubaInstantAP"
1214
1.36k
#define ARUBA_AP "ArubaAP"
1215
1216
5
#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
18
#define AUTHEN_PROTO_DELAYED_AUTHEN 1
1243
1244
/* DHCP Authentication algorithms for delayed authentication */
1245
7
#define AUTHEN_DELAYED_ALGO_HMAC_MD5  1
1246
1247
/* DHCP Authentication Replay Detection Methods */
1248
4
#define AUTHEN_RDM_MONOTONIC_COUNTER  0x00
1249
1250
/* DHCP Option Overload (option code 52) */
1251
25.5k
#define OPT_OVERLOAD_FILE   1
1252
25.5k
#define OPT_OVERLOAD_SNAME    2
1253
#define OPT_OVERLOAD_BOTH   3
1254
1255
/* Server name and boot file offsets and lengths */
1256
70.2k
#define SERVER_NAME_OFFSET    44
1257
46.4k
#define SERVER_NAME_LEN     64
1258
70.7k
#define FILE_NAME_OFFSET    108
1259
46.6k
#define FILE_NAME_LEN     128
1260
25.5k
#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
144k
#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
15
#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
138k
{
1795
138k
  if(idx>=DHCP_OPT_NUM)
1796
0
    return NULL;
1797
1798
138k
  return &dhcp_opt[idx];
1799
138k
}
1800
1801
static const char *
1802
dhcp_get_opt_text(unsigned int idx)
1803
5.51k
{
1804
5.51k
  if(idx>=DHCP_OPT_NUM)
1805
0
    return "unknown";
1806
5.51k
  return dhcp_opt[idx].text;
1807
5.51k
}
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
57.7k
{
1829
57.7k
  int i, left;
1830
57.7k
  int consumed = 0;
1831
1832
57.7k
  switch (ftype) {
1833
6.71k
  case bytes:
1834
6.71k
    if (hf != NULL)
1835
6.71k
      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
6.71k
    consumed = total_len;
1839
6.71k
    break;
1840
1841
5.64k
  case ipv4:
1842
5.64k
    if (total_len != 4) {
1843
5.35k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1844
5.35k
      break;
1845
5.35k
    }
1846
1847
293
    if (hf != NULL)
1848
293
      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
293
    proto_item_append_text(tree, " (%s)", tvb_ip_to_str(pinfo->pool, tvb, offset));
1854
293
    consumed = 4;
1855
293
    break;
1856
1857
15.7k
  case ipv4_list:
1858
84.0k
    for (i = offset, left = total_len; left > 0; i += 4, left -= 4) {
1859
73.9k
      if (left < 4) {
1860
5.64k
        expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
1861
5.64k
        break;
1862
5.64k
      }
1863
1864
68.2k
      if (hf != NULL)
1865
68.2k
        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
68.2k
      consumed += 4;
1869
68.2k
    }
1870
1871
15.7k
    break;
1872
1873
9.15k
  case string:
1874
9.15k
    if (hf != NULL)
1875
9.15k
      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
9.15k
    consumed = total_len;
1879
9.15k
    break;
1880
1881
1.61k
  case val_boolean:
1882
1.61k
    if (total_len != 1) {
1883
1.45k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1884
1.45k
      break;
1885
1.45k
    }
1886
1887
163
    if (hf != NULL)
1888
163
      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
163
    consumed = 1;
1892
163
    break;
1893
1894
3.78k
  case val_u_byte:
1895
3.78k
    if (total_len != 1) {
1896
3.63k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 1");
1897
3.63k
      break;
1898
3.63k
    }
1899
1900
155
    if (hf != NULL)
1901
155
      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
155
    consumed = 1;
1905
155
    break;
1906
1907
790
  case val_u_short:
1908
790
    if (total_len != 2) {
1909
767
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1910
767
      break;
1911
767
    }
1912
1913
23
    if (hf != NULL)
1914
23
      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
23
    consumed = 2;
1918
23
    break;
1919
1920
731
  case val_u_le_short:
1921
731
    if (total_len != 2) {
1922
451
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 2");
1923
451
      break;
1924
451
    }
1925
1926
280
    if (hf != NULL)
1927
280
      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
280
    consumed = 2;
1931
280
    break;
1932
1933
200
  case val_u_short_list:
1934
1.13k
    for (i = offset, left = total_len; left > 0; i += 2, left -= 2) {
1935
959
      if (left < 2) {
1936
21
        expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
1937
21
        break;
1938
21
      }
1939
1940
938
      if (hf != NULL)
1941
938
        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
938
      consumed += 2;
1945
938
    }
1946
200
    break;
1947
1948
4.89k
  case val_u_long:
1949
4.89k
    if (total_len != 4) {
1950
4.46k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1951
4.46k
      break;
1952
4.46k
    }
1953
1954
425
    if (hf != NULL)
1955
425
      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
425
    consumed = 4;
1959
425
    break;
1960
1961
994
  case time_in_s_secs:
1962
994
    if (total_len != 4) {
1963
960
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1964
960
      break;
1965
960
    }
1966
1967
34
    if (hf != NULL) {
1968
34
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1969
34
    }
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
34
    consumed = 4;
1974
34
    break;
1975
1976
1.16k
  case time_in_u_secs:
1977
1.16k
    if (total_len != 4) {
1978
1.10k
      expert_add_info_format(pinfo, item, &ei_dhcp_bad_length, "length isn't 4");
1979
1.10k
      break;
1980
1.10k
    }
1981
1982
63
    if (hf != NULL) {
1983
63
      proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1984
63
    }
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
63
    consumed = 4;
1988
63
    break;
1989
6.33k
  default:
1990
    /* Ignore other field_types */
1991
6.33k
    break;
1992
57.7k
  }
1993
1994
57.7k
  return consumed;
1995
57.7k
}
1996
1997
static int
1998
dissect_dhcpopt_basic_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1999
30.0k
{
2000
30.0k
  const struct opt_info *opt;
2001
30.0k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2002
30.0k
  static const struct basic_types_hfs default_hfs = {
2003
30.0k
    &hf_dhcp_option_value,
2004
30.0k
    &hf_dhcp_option_value_ip_address,
2005
30.0k
    &hf_dhcp_option_value_ip_address,
2006
30.0k
    &hf_dhcp_option_value_stringz,
2007
30.0k
    &hf_dhcp_option_value_boolean,
2008
30.0k
    &hf_dhcp_option_value_8,
2009
30.0k
    &hf_dhcp_option_value_16,
2010
30.0k
    &hf_dhcp_option_value_16,
2011
30.0k
    &hf_dhcp_option_value_u32,
2012
30.0k
    &hf_dhcp_option_value_s_secs,
2013
30.0k
    &hf_dhcp_option_value_u_secs,
2014
30.0k
  };
2015
2016
30.0k
  opt = dhcp_get_opt(option_data->option);
2017
30.0k
  if (opt == NULL)
2018
0
    return 0;
2019
2020
30.0k
  return dhcp_handle_basic_types(pinfo, tree, tree, tvb, opt->ftype,
2021
30.0k
                  0, tvb_reported_length(tvb), opt->phf, &default_hfs);
2022
30.0k
}
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
290k
{
2031
290k
  const struct opt_info *opt;
2032
290k
  unsigned char    code = tvb_get_uint8(tvb, voff);
2033
290k
  int    optlen;
2034
290k
  int    i, consumed;
2035
290k
  proto_tree  *v_tree;
2036
290k
  proto_item  *vti, *ti_value;
2037
290k
  tvbuff_t *option_tvb;
2038
290k
  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
290k
  switch (code) {
2044
2045
64.9k
  case 0:   /* Padding */
2046
    /* check how much padding we have */
2047
203k
    for (i = voff + 1; i < eoff; i++ ) {
2048
201k
      if (tvb_get_uint8(tvb, i) != 0) {
2049
63.7k
        break;
2050
63.7k
      }
2051
201k
    }
2052
64.9k
    i = i - voff;
2053
64.9k
    if (!first_pass) {
2054
32.1k
      if (bp_tree != NULL) {
2055
32.1k
        vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2056
32.1k
            tvb, voff, 1, 0, "(0) Padding");
2057
32.1k
        v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2058
32.1k
        proto_tree_add_item(v_tree, hf_dhcp_option_padding, tvb, voff, i, ENC_NA);
2059
32.1k
      }
2060
32.1k
    }
2061
64.9k
    consumed = i;
2062
64.9k
    return consumed;
2063
2064
5.33k
  case 255: /* End Option */
2065
5.33k
    if (!first_pass) {
2066
2.63k
      if (bp_tree != NULL) {
2067
2.63k
        vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2068
2.63k
            tvb, voff, 1, 0, "(255) End");
2069
2.63k
        v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2070
2.63k
        if (overload_p == NULL)
2071
2.39k
          proto_tree_add_item(v_tree, hf_dhcp_option_end_overload, tvb, voff, 1, ENC_BIG_ENDIAN);
2072
242
        else
2073
242
          proto_tree_add_item(v_tree, hf_dhcp_option_end, tvb, voff, 1, ENC_BIG_ENDIAN);
2074
2.63k
      }
2075
2.63k
    }
2076
5.33k
    *at_end = true;
2077
5.33k
    consumed = 1;
2078
5.33k
    return consumed;
2079
290k
  }
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
219k
  if (first_pass) {
2094
111k
    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
99
      return 1;
2101
99
    }
2102
111k
  }
2103
219k
  optlen = tvb_get_uint8(tvb, voff+1);
2104
219k
  consumed = optlen + 2;
2105
2106
219k
  struct rfc3396_for_option_t *rfc3396_data = wmem_map_lookup(rfc3396_map, GUINT_TO_POINTER(code));
2107
219k
  if (rfc3396_data == NULL) {
2108
72.8k
    rfc3396_data = wmem_new0(pinfo->pool, struct rfc3396_for_option_t);
2109
72.8k
    wmem_map_insert(rfc3396_map, GUINT_TO_POINTER(code), rfc3396_data);
2110
72.8k
  }
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
219k
  if (first_pass) {
2130
111k
    if (tvb_bytes_exist(tvb, voff+2, consumed-2)) {
2131
110k
      switch (code) {
2132
2133
12.4k
      case 52:
2134
12.4k
        if (overload_p != NULL) {
2135
12.0k
          *overload_p = tvb_get_uint8(tvb, voff+2);
2136
12.0k
        }
2137
12.4k
        break;
2138
2139
459
      case 53:
2140
459
        *dhcp_type_p =
2141
459
            val_to_str(pinfo->pool, tvb_get_uint8(tvb, voff+2),
2142
459
          opt53_text,
2143
459
          "Unknown Message Type (0x%02x)");
2144
459
        break;
2145
2146
3.12k
      case 60:
2147
3.12k
        *vendor_class_id_p =
2148
3.12k
          tvb_get_string_enc(pinfo->pool,
2149
3.12k
          tvb, voff+2, consumed-2, ENC_ASCII);
2150
3.12k
        break;
2151
110k
      }
2152
110k
    }
2153
2154
111k
    rfc3396_data->total_number_of_block++;
2155
2156
    /*
2157
     * We don't do anything else here.
2158
     */
2159
111k
    return consumed;
2160
111k
  }
2161
2162
  /* Normal cases */
2163
108k
  opt = dhcp_get_opt(code);
2164
108k
  if (opt == NULL)
2165
0
  {
2166
    /* THIS SHOULD NEVER HAPPEN!!! */
2167
0
    return consumed;
2168
0
  }
2169
2170
108k
  vti = proto_tree_add_uint_format_value(bp_tree, hf_dhcp_option_type,
2171
108k
    tvb, voff, consumed, code, "(%d) %s", code, opt->text);
2172
108k
  v_tree = proto_item_add_subtree(vti, ett_dhcp_option);
2173
108k
  proto_tree_add_item(v_tree, hf_dhcp_option_length, tvb, voff+1, 1, ENC_BIG_ENDIAN);
2174
2175
108k
  ti_value = proto_tree_add_item(v_tree, hf_dhcp_option_value, tvb, voff+2, optlen, ENC_NA);
2176
108k
  proto_item_set_hidden(ti_value);
2177
2178
  /* prepare data for dissector table */
2179
108k
  option_tvb = tvb_new_subset_length(tvb, voff+2, optlen);
2180
108k
  option_data.option = code;
2181
108k
  option_data.overload = overload_p;
2182
108k
  option_data.dhcp_type = *dhcp_type_p;
2183
108k
  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
108k
  if (rfc3396_data->total_number_of_block == 1) {
2200
57.2k
    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
27.6k
      proto_item_set_visible(ti_value);
2203
27.6k
    }
2204
57.2k
  } else {
2205
51.3k
    proto_item *ti;
2206
51.3k
    rfc3396_data->index_current_block++;
2207
51.3k
    ti = proto_tree_add_string(v_tree, hf_dhcp_option_rfc_3396_detected, tvb, voff+2, optlen,
2208
51.3k
                wmem_strdup_printf(pinfo->pool, "%u/%u", rfc3396_data->index_current_block, rfc3396_data->total_number_of_block));
2209
51.3k
    if (optlen) {
2210
22.2k
      if (rfc3396_data->tvb_composite == NULL) {
2211
9.27k
        rfc3396_data->tvb_composite = tvb_new_composite();
2212
9.27k
      }
2213
22.2k
      tvb_composite_append(rfc3396_data->tvb_composite, option_tvb);
2214
22.2k
    }
2215
51.3k
    if (rfc3396_data->index_current_block != rfc3396_data->total_number_of_block) {
2216
37.5k
      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
37.5k
    } else if (rfc3396_data->tvb_composite != NULL) {
2218
9.18k
      tvb_composite_finalize(rfc3396_data->tvb_composite);
2219
9.18k
      add_new_data_source(pinfo, rfc3396_data->tvb_composite, "RFC 3396 Long Option");
2220
9.18k
      if (!dissector_try_uint_with_data(dhcp_option_table, code, rfc3396_data->tvb_composite, pinfo, v_tree, false, &option_data)) {
2221
1.61k
        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.61k
      }
2223
9.18k
    } else {
2224
4.59k
      expert_add_info_format(pinfo, ti, &ei_dhcp_bad_length, "RFC 3396 Long Option with combined length 0");
2225
4.59k
    }
2226
51.3k
  }
2227
2228
108k
  return consumed;
2229
108k
}
2230
2231
static int
2232
dissect_dhcpopt_policy_filter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2233
119
{
2234
119
  unsigned offset = 0;
2235
2236
405
  while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2237
286
    proto_tree_add_item(tree, hf_dhcp_option_policy_filter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2238
286
    offset += 4;
2239
286
    proto_tree_add_item(tree, hf_dhcp_option_policy_filter_subnet_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2240
286
    offset += 4;
2241
286
  }
2242
2243
119
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2244
42
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2245
42
  }
2246
2247
119
  return tvb_captured_length(tvb);
2248
119
}
2249
2250
static int
2251
dissect_dhcpopt_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2252
178
{
2253
178
  unsigned offset = 0;
2254
2255
705
  while (tvb_reported_length_remaining(tvb, offset) >= 8) {
2256
527
    proto_tree_add_item(tree, hf_dhcp_option_static_route_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2257
527
    offset += 4;
2258
527
    proto_tree_add_item(tree, hf_dhcp_option_static_route_router, tvb, offset, 4, ENC_BIG_ENDIAN);
2259
527
    offset += 4;
2260
527
  }
2261
2262
178
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2263
118
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 8");
2264
118
  }
2265
2266
178
  return tvb_captured_length(tvb);
2267
178
}
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.22k
{
2275
1.22k
  uint8_t subopt;
2276
1.22k
  uint8_t subopt_len;
2277
2278
20.0k
  while (optoff < optend) {
2279
19.6k
    subopt = tvb_get_uint8(tvb, optoff);
2280
19.6k
    optoff++;
2281
2282
    /* Skip padding */
2283
19.6k
    if (subopt == 0)
2284
10.3k
      continue;
2285
    /* We are done, skip any remaining bytes */
2286
9.28k
    if (subopt == 255)
2287
146
      break;
2288
2289
    /* We expect a length byte next */
2290
9.13k
    if (optoff >= optend)
2291
63
      return false;
2292
9.07k
    subopt_len = tvb_get_uint8(tvb, optoff);
2293
2294
9.07k
    if (test_len) {
2295
1.38k
      unsigned expected_subopt_len = test_len(subopt);
2296
1.38k
      if (expected_subopt_len && expected_subopt_len != subopt_len)
2297
84
        return false;
2298
1.38k
    }
2299
8.98k
    optoff++;
2300
2301
    /* Check remaining room for suboption in option */
2302
8.98k
    if (optoff + subopt_len > optend)
2303
529
      return false;
2304
8.46k
    optoff += subopt_len;
2305
8.46k
  }
2306
551
  return true;
2307
1.22k
}
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
4.93k
{
2317
4.93k
  unsigned    suboptoff = 0;
2318
4.93k
  unsigned    optend = tvb_reported_length(tvb);
2319
4.93k
  uint8_t     subopt;
2320
4.93k
  uint32_t      subopt_len;
2321
4.93k
  proto_item *item;
2322
4.93k
  proto_tree *sub_tree;
2323
2324
4.93k
  item = proto_tree_add_item(v_tree, hf_dhcp_option43_suboption, tvb, suboptoff, 1, ENC_NA);
2325
4.93k
  subopt = tvb_get_uint8(tvb, suboptoff);
2326
2327
4.93k
  suboptoff+=1;
2328
2329
4.93k
  if (subopt == 0) {
2330
    /* Padding */
2331
2.94k
    return suboptoff;
2332
2.94k
  }
2333
2334
1.98k
  if (subopt == 255) {
2335
    /* END */
2336
    /* XXX - Should there be expert info if there are more bytes? */
2337
120
    return optend;
2338
120
  }
2339
2340
1.86k
  if (suboptoff >= optend) {
2341
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
2342
0
                  "Suboption %d: no room left in option for suboption length", subopt);
2343
0
    return optend;
2344
0
  }
2345
2346
1.86k
  sub_tree = proto_item_add_subtree(item, ett_dhcp_option43_suboption);
2347
1.86k
  proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
2348
1.86k
  suboptoff++;
2349
2350
1.86k
  if (suboptoff+subopt_len > optend) {
2351
0
    expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
2352
0
            "Suboption %d: no room left in option for suboption value", subopt);
2353
0
    return optend;
2354
0
  }
2355
2356
1.86k
  proto_tree_add_item(sub_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2357
1.86k
  suboptoff+= subopt_len;
2358
2359
1.86k
  return suboptoff;
2360
2361
1.86k
}
2362
2363
static int
2364
dissect_dhcpopt_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2365
1.53k
{
2366
1.53k
  heur_dtbl_entry_t *hdtbl_entry;
2367
2368
1.53k
  if (!dissector_try_heuristic(dhcp_vendor_info_subdissector, tvb, pinfo, tree, &hdtbl_entry, data)) {
2369
1.06k
    unsigned offset = 0;
2370
1.06k
    if (test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), NULL)) {
2371
      /* Generic encapsulated options per RFC 2132 8.4 */
2372
5.43k
      while (tvb_reported_length_remaining(tvb, offset)) {
2373
4.93k
        offset += dissect_option43_generic_suboption(pinfo, proto_tree_get_parent(tree), tree, tvb_new_subset_remaining(tvb, offset));
2374
4.93k
      }
2375
568
    } else {
2376
      /* Default Vendor-Specific Info.. display in bytes */
2377
568
      proto_tree_add_item(tree, hf_dhcp_option43_value, tvb, offset, tvb_reported_length(tvb), ENC_NA);
2378
568
    }
2379
1.06k
  }
2380
2381
1.53k
  return tvb_captured_length(tvb);
2382
1.53k
}
2383
2384
static int
2385
dissect_dhcpopt_option_overload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2386
11.5k
{
2387
11.5k
  unsigned offset = 0;
2388
11.5k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2389
2390
11.5k
  if (tvb_reported_length(tvb) < 1) {
2391
79
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2392
79
    return 1;
2393
79
  }
2394
2395
11.4k
  proto_tree_add_item(tree, hf_dhcp_option_option_overload, tvb, offset, 1, ENC_BIG_ENDIAN);
2396
11.4k
  if (option_data->overload == NULL) {
2397
    // Option Overload inside the overloaded fields is nonsensical
2398
227
    expert_add_info(pinfo, tree, &ei_dhcp_opt_overload_wrong_field);
2399
227
  }
2400
2401
11.4k
  return tvb_captured_length(tvb);
2402
11.5k
}
2403
2404
static int
2405
dissect_dhcpopt_dhcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2406
153
{
2407
153
  uint32_t type;
2408
153
  char* str_type;
2409
2410
153
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp, tvb, 0, 1, ENC_NA, &type);
2411
  /* Show the message type name on the Message Type option, and in the protocol root */
2412
153
  str_type = val_to_str(pinfo->pool, type, opt53_text, "Unknown Message Type (0x%02x)");
2413
153
  proto_item_append_text(tree, " (%s)", str_type);
2414
153
  proto_item_append_text(proto_item_get_parent(tree), " (%s)", str_type);
2415
2416
153
  return tvb_captured_length(tvb);
2417
153
}
2418
2419
static int
2420
dissect_dhcpopt_param_request_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2421
168
{
2422
168
  unsigned offset = 0;
2423
168
  uint8_t byte;
2424
2425
5.68k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
2426
5.51k
    byte = tvb_get_uint8(tvb, offset);
2427
5.51k
    proto_tree_add_uint_format_value(tree, hf_dhcp_option_parameter_request_list_item,
2428
5.51k
        tvb, offset, 1, byte, "(%d) %s", byte, dhcp_get_opt_text(byte));
2429
5.51k
    offset++;
2430
5.51k
  }
2431
2432
168
  return tvb_captured_length(tvb);
2433
168
}
2434
2435
static int
2436
dissect_dhcpopt_vendor_class_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2437
1.70k
{
2438
1.70k
  heur_dtbl_entry_t *hdtbl_entry;
2439
2440
  /*
2441
   * XXX - RFC 2132 says this is a string of octets;
2442
   * should we check for non-printables?
2443
   */
2444
1.70k
  proto_tree_add_item(tree, hf_dhcp_option_vendor_class_id, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
2445
1.70k
  (void) dissector_try_heuristic(dhcp_vendor_id_subdissector, tvb, pinfo, tree, &hdtbl_entry, data);
2446
2447
1.70k
  return tvb_captured_length(tvb);
2448
1.70k
}
2449
2450
static int
2451
dissect_dhcpopt_client_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2452
212
{
2453
212
  unsigned offset = 0;
2454
212
  int length = tvb_reported_length(tvb);
2455
212
  unsigned char byte;
2456
2457
212
  if (length > 0)
2458
160
    byte = tvb_get_uint8(tvb, offset);
2459
52
  else
2460
52
    byte = 0;
2461
2462
  /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2463
    guess that the first is the hwtype, and the last 6
2464
    are the hw addr */
2465
  /* See https://www.iana.org/assignments/arp-parameters */
2466
  /* RFC2132 9.14 Client-identifier has the following to say:
2467
    A hardware type of 0 (zero) should be used when the value
2468
    field contains an identifier other than a hardware address
2469
    (e.g. a fully qualified domain name). */
2470
2471
212
  if (length == 7 && byte > 0 && byte < 48) {
2472
11
    proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2473
2474
11
    if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2475
7
      proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2476
4
    else
2477
4
      proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2478
4
        tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2479
201
  } else if (length == 17 && byte == 0) {
2480
    /* Identifier is a UUID */
2481
2
    proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2482
2483
  /* From RFC 4361 paragraph 6.1 DHCPv4 Client Behavior:
2484
    To send an RFC 3315-style binding identifier in a DHCPv4 'client
2485
    identifier' option, the type of the 'client identifier' option is set
2486
    to 255. */
2487
199
  } else if (byte == 255) {
2488
46
    uint16_t  duidtype;
2489
46
    uint16_t  hwtype;
2490
2491
    /*  The type field is immediately followed by the IAID, which is
2492
      an opaque 32-bit quantity */
2493
46
    proto_tree_add_string(tree, hf_dhcp_client_id_iaid, tvb, offset+1, 4,
2494
46
      tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 4, byte));
2495
46
    offset += 5;
2496
46
    duidtype = tvb_get_ntohs(tvb, offset);
2497
46
    proto_tree_add_item(tree, hf_dhcp_client_id_duid_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2498
46
    switch (duidtype) {
2499
21
    case DUID_LLT:
2500
21
      if (length < 8) {
2501
2
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2502
2
        break;
2503
2
      }
2504
19
      hwtype=tvb_get_ntohs(tvb, offset + 2);
2505
19
      proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_llt_hw_type,
2506
19
          tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2507
2508
      /* XXX seconds since Jan 1 2000 */
2509
19
      proto_tree_add_item(tree, hf_dhcp_client_identifier_time, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2510
19
      if (length > 8) {
2511
18
        proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 8,
2512
18
          length - 13, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+8, length-13, hwtype));
2513
18
        if(DHCP_HW_IS_ETHER(hwtype, length-13)) {
2514
1
          proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2515
1
            tvb, offset+8, length-13, ENC_NA);
2516
1
        }
2517
18
      }
2518
19
      break;
2519
3
    case DUID_EN:
2520
3
      if (length < 6) {
2521
0
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2522
0
        break;
2523
0
      }
2524
3
      proto_tree_add_item(tree, hf_dhcp_client_identifier_enterprise_num, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
2525
3
      if (length > 6) {
2526
3
        proto_tree_add_item(tree, hf_dhcp_client_identifier, tvb, offset + 6, length - 11, ENC_NA);
2527
3
      }
2528
3
      break;
2529
17
    case DUID_LL:
2530
17
      if (length < 4) {
2531
0
        expert_add_info(pinfo, tree, &ei_dhcp_mal_duid);
2532
0
        break;
2533
0
      }
2534
17
      hwtype=tvb_get_ntohs(tvb, offset + 2);
2535
17
      proto_tree_add_item(tree, hf_dhcp_client_identifier_duid_ll_hw_type,
2536
17
          tvb, offset + 2, 2, ENC_BIG_ENDIAN);
2537
2538
17
      if (length > 4) {
2539
17
        proto_tree_add_string(tree, hf_dhcp_client_identifier_link_layer_address, tvb, offset + 4,
2540
17
          length - 9, tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+4, length-9, hwtype));
2541
17
        if(DHCP_HW_IS_ETHER(hwtype, length-9)) {
2542
1
          proto_tree_add_item(tree, hf_dhcp_client_identifier_link_layer_address_ether,
2543
1
            tvb, offset+4, length-9, ENC_NA);
2544
1
        }
2545
17
      }
2546
17
      break;
2547
46
    }
2548
153
  } else if (byte == 0 && length > 1) {
2549
    /* identifier other than a hardware address (e.g. a fully qualified domain name) */
2550
13
    proto_tree_add_item(tree, hf_dhcp_client_identifier_type, tvb, offset, 1, ENC_NA);
2551
13
    proto_tree_add_item(tree, hf_dhcp_client_identifier_undef, tvb, offset+1, length-1, ENC_ASCII);
2552
140
  } else {
2553
    /* otherwise, it's opaque data */
2554
140
  }
2555
2556
211
  return tvb_captured_length(tvb);
2557
212
}
2558
2559
static int
2560
dissect_dhcpopt_user_class_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2561
146
{
2562
146
  unsigned char user_class_instance_index = 0;
2563
146
  unsigned offset = 0;
2564
146
  proto_item *vtix, *len_item;
2565
146
  proto_tree *o77_v_tree;
2566
146
  unsigned class_length, uci_len = tvb_reported_length(tvb);
2567
146
  if (uci_len < 2) {
2568
34
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2569
34
    return 1;
2570
34
  }
2571
2572
  /* First byte is the length of User Class data. If it is zero, then let's assume this
2573
   * is a Microsoft variant that has the two-byte length field with most-significant byte
2574
   * as zero.
2575
   */
2576
112
  uint32_t ms_data_length = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2577
112
  if (ms_data_length <= 0xff) {
2578
    /* MSB is zero, this is Microsoft */
2579
191
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
2580
      /* Create subtree for instance of User Class. */
2581
168
      vtix = proto_tree_add_uint_format_value(tree, hf_dhcp_option77_user_class,
2582
168
          tvb, offset, 1, user_class_instance_index, "[%d]", user_class_instance_index);
2583
168
      o77_v_tree = proto_item_add_subtree(vtix, ett_dhcp_option77_instance);
2584
168
      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);
2585
168
      offset += 2;
2586
168
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_binary_data, tvb, offset, ms_data_length, ENC_NA);
2587
168
      offset += ms_data_length;
2588
      /* User Class Binary Data is padded to 4-byte boundary */
2589
168
      uint16_t padding_length = WS_PADDING_TO_4(ms_data_length);
2590
168
      if (padding_length > 0) {
2591
39
        proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_padding, tvb, offset, padding_length, ENC_NA);
2592
39
        offset += padding_length;
2593
39
      }
2594
168
      uint32_t len;
2595
168
      proto_tree_add_item_ret_uint(o77_v_tree, hf_dhcp_option77_user_class_name_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2596
168
      offset += 2;
2597
168
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_name, tvb, offset, len, ENC_UTF_16);
2598
168
      offset += len;
2599
168
      proto_tree_add_item_ret_uint(o77_v_tree, hf_dhcp_option77_user_class_description_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
2600
168
      offset += 2;
2601
168
      proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_description, tvb, offset, len, ENC_UTF_16);
2602
168
      offset += len;
2603
168
      proto_item_set_end(vtix, tvb, offset);
2604
168
      user_class_instance_index++;
2605
168
    }
2606
23
    return tvb_captured_length(tvb);
2607
23
  }
2608
2609
488
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
2610
481
    class_length = tvb_get_uint8(tvb, offset);
2611
481
    if (class_length >= uci_len) {
2612
      /* Having the sum of the User Class data lengths exceed the total User Option Information length (uci_len)
2613
       * is a violation of RFC 3004. In that case the remaining data is treated as a non-conformant (text) option.
2614
       * This check will also catch the Microsoft 'variation' implementation (when Vendor class identifier contains
2615
       * "MSFT 5.0") such as "RRAS.Microsoft" and others like "iPXE".
2616
       * In the unlikely case that the first character can be interpreted as a valid length the next iteration
2617
       * of this while loop will catch that.
2618
       * https://gitlab.com/wireshark/wireshark/-/issues/16349
2619
       * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/fe8a2dd4-1e8c-4546-bacd-4ae10de02058
2620
       */
2621
51
      proto_item *expert_ti = proto_tree_add_item(tree, hf_dhcp_option77_user_class_text, tvb, offset, uci_len, ENC_ASCII);
2622
51
      expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
2623
51
      break;
2624
51
    }
2625
2626
    /* Create subtree for instance of User Class. */
2627
430
    vtix = proto_tree_add_uint_format_value(tree, hf_dhcp_option77_user_class,
2628
430
        tvb, offset, 1, user_class_instance_index, "[%d]", user_class_instance_index);
2629
430
    o77_v_tree = proto_item_add_subtree(vtix, ett_dhcp_option77_instance);
2630
2631
    /* Add length for instance of User Class. */
2632
430
    len_item = proto_tree_add_uint(o77_v_tree, hf_dhcp_option77_user_class_length, tvb, offset, 1, class_length);
2633
430
    proto_item_set_len(vtix, class_length+1);
2634
430
    offset++;
2635
2636
430
    if (class_length == 0) {
2637
31
      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);
2638
31
      break;
2639
31
    }
2640
2641
    /* Add data for instance of User Class. */
2642
399
    proto_tree_add_item(o77_v_tree, hf_dhcp_option77_user_class_data, tvb, offset, class_length, ENC_NA);
2643
2644
399
    offset += class_length;
2645
399
    uci_len -= class_length + 1;
2646
399
    user_class_instance_index++;
2647
399
  }
2648
2649
89
  return tvb_captured_length(tvb);
2650
112
}
2651
2652
static int
2653
dissect_dhcpopt_slp_directory_agent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2654
170
{
2655
170
  unsigned offset = 0;
2656
170
  uint32_t byte;
2657
2658
170
  if (tvb_reported_length(tvb) < 1) {
2659
99
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 1");
2660
99
    return 1;
2661
99
  }
2662
2663
71
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_slp_directory_agent_value, tvb, offset, 1, ENC_BIG_ENDIAN, &byte);
2664
71
  offset++;
2665
2666
71
  if (byte == 0x80) {
2667
5
    if (tvb_reported_length_remaining(tvb, offset) == 0)
2668
1
      return offset;
2669
2670
4
    offset++;
2671
4
  }
2672
2673
883
  while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2674
813
    proto_tree_add_item(tree, hf_dhcp_option_slp_directory_agent_slpda_address, tvb, offset, 4, ENC_BIG_ENDIAN);
2675
813
    offset += 4;
2676
813
  }
2677
2678
70
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2679
43
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2680
43
  }
2681
2682
70
  return tvb_captured_length(tvb);
2683
71
}
2684
2685
static int
2686
dissect_dhcpopt_slp_service_scope(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2687
191
{
2688
191
  unsigned offset = 0;
2689
2690
191
  proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2691
2692
191
  offset++;
2693
191
  proto_tree_add_item(tree, hf_dhcp_option_slp_service_scope_string, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2694
2695
191
  return tvb_captured_length(tvb);
2696
191
}
2697
2698
static int
2699
dissect_dhcpopt_client_full_domain_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2700
246
{
2701
246
  static int * const fqdn_hf_flags[] = {
2702
246
    &hf_dhcp_fqdn_mbz,
2703
246
    &hf_dhcp_fqdn_n,
2704
246
    &hf_dhcp_fqdn_e,
2705
246
    &hf_dhcp_fqdn_o,
2706
246
    &hf_dhcp_fqdn_s,
2707
246
    NULL
2708
246
  };
2709
246
  uint8_t fqdn_flags;
2710
246
  unsigned offset = 0, length = tvb_reported_length(tvb);
2711
246
  const char  *dns_name;
2712
246
  int   dns_name_len;
2713
2714
246
  if (length < 3) {
2715
49
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3");
2716
49
    return 1;
2717
49
  }
2718
2719
197
  fqdn_flags = tvb_get_uint8(tvb, offset);
2720
197
  proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_fqdn_flags,
2721
197
        ett_dhcp_fqdn_flags, fqdn_hf_flags, ENC_BIG_ENDIAN);
2722
2723
  /* XXX: use code from packet-dns for return code decoding */
2724
197
  proto_tree_add_item(tree, hf_dhcp_fqdn_rcode1, tvb, offset+1, 1, ENC_BIG_ENDIAN);
2725
  /* XXX: use code from packet-dns for return code decoding */
2726
197
  proto_tree_add_item(tree, hf_dhcp_fqdn_rcode2, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2727
2728
197
  if (length > 3) {
2729
189
    if (fqdn_flags & F_FQDN_E) {
2730
25
      get_dns_name(pinfo->pool, tvb, offset+3, length-3, offset+3, &dns_name, &dns_name_len);
2731
25
      proto_tree_add_string(tree, hf_dhcp_fqdn_name,
2732
25
        tvb, offset+3, length-3, format_text(pinfo->pool, dns_name, dns_name_len));
2733
164
    } else {
2734
164
      proto_tree_add_item(tree, hf_dhcp_fqdn_asciiname, tvb, offset+3, length-3, ENC_ASCII);
2735
164
    }
2736
189
  }
2737
2738
197
  return tvb_captured_length(tvb);
2739
246
}
2740
2741
static int
2742
dissect_dhcpopt_novell_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2743
34
{
2744
34
  unsigned offset = 0;
2745
2746
  /* Option 85 can be sent as a string */
2747
  /* Added by Greg Morris (gmorris[AT]novell.com) */
2748
34
  if (novell_string) {
2749
0
    proto_tree_add_item(tree, hf_dhcp_option_novell_dss_string, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
2750
34
  } else {
2751
    /* IP addresses */
2752
415
    while (tvb_reported_length_remaining(tvb, offset) >= 4) {
2753
2754
381
      proto_tree_add_item(tree, hf_dhcp_option_novell_dss_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
2755
381
      offset += 4;
2756
381
    }
2757
2758
34
    if (tvb_reported_length_remaining(tvb, offset) > 0) {
2759
24
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
2760
24
    }
2761
34
  }
2762
2763
34
  return tvb_captured_length(tvb);
2764
34
}
2765
2766
static int
2767
dissect_dhcpopt_dhcp_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
2768
39
{
2769
39
  unsigned offset = 0;
2770
39
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
2771
39
  uint32_t protocol, rdm;
2772
39
  uint8_t algorithm;
2773
2774
39
  if (tvb_reported_length(tvb) < 11) {
2775
14
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 11");
2776
14
    return 1;
2777
14
  }
2778
2779
25
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_protocol, tvb, offset, 1, ENC_BIG_ENDIAN, &protocol);
2780
25
  offset++;
2781
2782
25
  algorithm = tvb_get_uint8(tvb, offset);
2783
25
  switch (protocol) {
2784
2785
9
  case AUTHEN_PROTO_DELAYED_AUTHEN:
2786
9
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_alg_delay, tvb, offset, 1, ENC_BIG_ENDIAN);
2787
9
    break;
2788
2789
16
  default:
2790
16
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_algorithm, tvb, offset, 1, ENC_BIG_ENDIAN);
2791
16
    break;
2792
25
  }
2793
25
  offset++;
2794
2795
25
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_dhcp_authentication_rdm, tvb, offset, 1, ENC_BIG_ENDIAN, &rdm);
2796
25
  offset++;
2797
2798
25
  switch (rdm) {
2799
2800
4
  case AUTHEN_RDM_MONOTONIC_COUNTER:
2801
4
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_replay_detection, tvb, offset, 8, ENC_BIG_ENDIAN);
2802
4
    break;
2803
2804
21
  default:
2805
21
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_rdm_rdv, tvb, offset, 8, ENC_ASCII);
2806
21
    break;
2807
25
  }
2808
25
  offset += 8;
2809
2810
25
  switch (protocol) {
2811
2812
9
  case AUTHEN_PROTO_DELAYED_AUTHEN:
2813
9
    switch (algorithm) {
2814
2815
7
    case AUTHEN_DELAYED_ALGO_HMAC_MD5:
2816
7
      if (option_data->dhcp_type && !strcmp(option_data->dhcp_type, OPT53_DISCOVER)) {
2817
        /* Discover has no Secret ID nor HMAC MD5 Hash */
2818
1
        break;
2819
6
      } else {
2820
6
        if (tvb_reported_length_remaining(tvb, offset) < 20) {
2821
4
          expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 20");
2822
4
          break;
2823
4
        }
2824
2825
2
        proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_secret_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2826
2
        offset += 4;
2827
2
        proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_hmac_md5_hash, tvb, offset, 16, ENC_NA);
2828
2
        break;
2829
6
      }
2830
2831
2
    default:
2832
2
      if (tvb_reported_length_remaining(tvb, offset) == 0)
2833
1
        break;
2834
2835
1
      proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2836
1
      break;
2837
9
    }
2838
9
    break;
2839
2840
16
  default:
2841
16
    if (tvb_reported_length_remaining(tvb, offset) == 0)
2842
1
      break;
2843
2844
15
    proto_tree_add_item(tree, hf_dhcp_option_dhcp_authentication_information, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
2845
15
    break;
2846
25
  }
2847
2848
25
  return tvb_captured_length(tvb);
2849
25
}
2850
2851
static int
2852
dissect_dhcpopt_client_architecture(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2853
294
{
2854
294
  unsigned offset = 0;
2855
2856
1.99k
  while (tvb_reported_length_remaining(tvb, offset) > 1) {
2857
1.69k
    uint32_t architecture_id;
2858
1.69k
    proto_item *pi;
2859
2860
1.69k
    pi = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_client_system_architecture, tvb, offset, 2, ENC_BIG_ENDIAN, &architecture_id);
2861
1.69k
    offset += 2;
2862
2863
    /*
2864
     * Some Client Architecture IDs are widely misused.  For
2865
     * details, refer to the comment at the definition of
2866
     * dhcp_client_arch.
2867
     *
2868
     * The most common problem is a client using architecture ID 9
2869
     * when performing an EFI x64 boot.  Windows Server 2008 WDS
2870
     * does not recognize ID 9, but most other DHCP servers
2871
     * (including newer versions of WDS) silently map architecture
2872
     * ID 9 to x64 in order to accommodate these clients.
2873
     */
2874
1.69k
    if (architecture_id == 9) {
2875
123
      expert_add_info_format(pinfo, pi, &ei_dhcp_option93_client_arch_ambiguous, "Client Architecture ID 9 is often incorrectly used for EFI x64");
2876
123
    }
2877
2878
    /*
2879
     * Technically, architecture ID 7 is ambiguous for the same
2880
     * reason, but it's extremely unlikely to be a real world
2881
     * problem, so a warning would probably just be unwelcome
2882
     * noise.
2883
     */
2884
1.69k
  }
2885
294
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
2886
20
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 2");
2887
20
  }
2888
2889
294
  return tvb_captured_length(tvb);
2890
294
}
2891
2892
static int
2893
dissect_dhcpopt_client_network_interface_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2894
12
{
2895
12
  unsigned offset = 0;
2896
12
  uint8_t id_type;
2897
2898
12
  id_type = tvb_get_uint8(tvb, offset);
2899
12
  offset++;
2900
2901
12
  if (id_type == 0x01) {
2902
3
    proto_tree_add_item(tree, hf_dhcp_option_client_network_id_major_ver,
2903
3
              tvb, offset, 1, ENC_LITTLE_ENDIAN);
2904
3
    offset++;
2905
3
    proto_tree_add_item(tree, hf_dhcp_option_client_network_id_minor_ver,
2906
3
              tvb, offset, 1, ENC_LITTLE_ENDIAN);
2907
3
  }
2908
2909
12
  return tvb_captured_length(tvb);
2910
12
}
2911
2912
static int
2913
dissect_dhcpopt_client_identifier_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2914
47
{
2915
47
  unsigned offset = 0, length = tvb_reported_length(tvb);
2916
47
  uint8_t byte;
2917
2918
47
  if (length > 0)
2919
41
    byte = tvb_get_uint8(tvb, offset);
2920
6
  else
2921
6
    byte = 0;
2922
2923
  /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
2924
    guess that the first is the hwtype, and the last 6
2925
    are the hw addr */
2926
  /* See https://www.iana.org/assignments/arp-parameters */
2927
  /* RFC2132 9.14 Client-identifier has the following to say:
2928
    A hardware type of 0 (zero) should be used when the value
2929
    field contains an identifier other than a hardware address
2930
    (e.g. a fully qualified domain name). */
2931
2932
47
  if (length == 7 && byte > 0 && byte < 48) {
2933
9
    proto_tree_add_item(tree, hf_dhcp_hw_type, tvb, offset, 1, ENC_NA);
2934
9
    if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
2935
3
      proto_tree_add_item(tree, hf_dhcp_hw_ether_addr, tvb, offset+1, 6, ENC_NA);
2936
6
    else
2937
6
      proto_tree_add_string(tree, hf_dhcp_client_hardware_address, tvb, offset+1, 6,
2938
6
        tvb_arphrdaddr_to_str(pinfo->pool, tvb, offset+1, 6, byte));
2939
38
  } else if (length == 17 && byte == 0) {
2940
    /* Identifier is a UUID */
2941
1
    proto_tree_add_item(tree, hf_dhcp_client_identifier_uuid, tvb, offset + 1, 16, dhcp_uuid_endian);
2942
37
  } else {
2943
    /* otherwise, it's opaque data */
2944
37
  }
2945
2946
47
  return tvb_captured_length(tvb);
2947
47
}
2948
2949
static int
2950
dissect_dhcpopt_civic_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2951
66
{
2952
66
  unsigned offset = 0;
2953
2954
66
  if (tvb_reported_length(tvb) >= 3)
2955
53
  {
2956
53
    proto_tree_add_item(tree, hf_dhcp_option_civic_location_what, tvb, offset, 1, ENC_BIG_ENDIAN);
2957
53
    offset++;
2958
53
    proto_tree_add_item(tree, hf_dhcp_option_civic_location_country, tvb, offset, 2, ENC_ASCII);
2959
53
    offset += 2;
2960
2961
856
    while (tvb_reported_length_remaining(tvb, offset) >= 2)
2962
846
    {
2963
846
      uint32_t calength;
2964
846
      proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2965
846
      offset++;
2966
846
      proto_tree_add_item_ret_uint(tree, hf_dhcp_option_civic_location_ca_length, tvb, offset, 1, ENC_BIG_ENDIAN, &calength);
2967
846
      offset++;
2968
2969
846
      if (calength == 0)
2970
480
        continue;
2971
2972
366
      if (tvb_reported_length_remaining(tvb, offset) >= calength)
2973
323
      {
2974
323
        proto_tree_add_item(tree, hf_dhcp_option_civic_location_ca_value, tvb, offset, calength, ENC_ASCII);
2975
323
        offset += calength;
2976
323
      }
2977
43
      else
2978
43
      {
2979
43
        expert_add_info(pinfo, tree, &ei_dhcp_option_civic_location_bad_cattype);
2980
43
        break;
2981
43
      }
2982
366
    }
2983
53
  }
2984
2985
66
  return tvb_captured_length(tvb);
2986
66
}
2987
2988
static int
2989
dissect_dhcpopt_name_server_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2990
55
{
2991
55
  unsigned offset = 0, length = tvb_reported_length(tvb);
2992
55
  uint16_t ns;
2993
2994
55
  if (length < 2) {
2995
2
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 2");
2996
2
    return 1;
2997
53
  } else if (length & 1) {
2998
4
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length (%u) isn't even number", length);
2999
4
    return 1;
3000
4
  }
3001
3002
3.38k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3003
3.33k
    ns = tvb_get_ntohs(tvb, offset);
3004
    /* XXX - Make this a value_string */
3005
3.33k
    switch (ns) {
3006
532
    case RFC2937_LOCAL_NAMING_INFORMATION:
3007
532
      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)");
3008
532
      break;
3009
97
    case RFC2937_DOMAIN_NAME_SERVER_OPTION:
3010
97
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Domain Name Server Option (6)");
3011
97
      break;
3012
111
    case RFC2937_NETWORK_INFORMATION_SERVERS_OPTION:
3013
111
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Servers Option (41)");
3014
111
      break;
3015
120
    case RFC2937_NETBIOS_OVER_TCP_IP_NAME_SERVER_OPTION:
3016
120
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "NetBIOS over TCP/IP Name Server Option (44)");
3017
120
      break;
3018
122
    case RFC2937_NETWORK_INFORMATION_SERVICE_PLUS_SERVERS_OPTION:
3019
122
      proto_tree_add_string(tree, hf_dhcp_option_dhcp_name_service_search_option, tvb, offset, 2, "Network Information Service+ Servers Option (65)");
3020
122
      break;
3021
2.35k
    default:
3022
2.35k
      expert_add_info_format(pinfo, tree, &ei_dhcp_option_dhcp_name_service_invalid,
3023
2.35k
            "Invalid Name Service (%u). RFC 2937 defines only 0, 6, 41, 44, and 65 as possible values.", ns);
3024
2.35k
      break;
3025
3.33k
    }
3026
3.33k
    offset += 2;
3027
3.33k
  }
3028
3029
49
  return tvb_captured_length(tvb);
3030
49
}
3031
3032
static int
3033
dissect_dhcpopt_dhcp_domain_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3034
249
{
3035
249
  int length = tvb_reported_length(tvb);
3036
249
  unsigned offset = 0;
3037
249
  char    *name_out;
3038
249
  const char  *dns_name;
3039
249
  int   dns_name_len;
3040
3041
  /* Domain Names - Implementation And Specification (RFC 1035) */
3042
3043
  /* We will display the information about fqdn */
3044
249
  int consumedx = 0;
3045
3046
10.4k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3047
    /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3048
10.2k
    consumedx = get_dns_name(pinfo->pool, tvb, offset,
3049
10.2k
      length, 0, &dns_name, &dns_name_len);
3050
10.2k
    name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3051
10.2k
    proto_tree_add_string(tree, hf_dhcp_option_dhcp_dns_domain_search_list_fqdn, tvb, offset, consumedx, name_out);
3052
10.2k
    offset += consumedx;
3053
10.2k
  }
3054
3055
249
  return tvb_captured_length(tvb);
3056
249
}
3057
3058
static int
3059
dissect_dhcpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3060
48
{
3061
48
  int length = tvb_reported_length(tvb);
3062
48
  unsigned offset = 0;
3063
48
  const char  *dns_name;
3064
48
  int   dns_name_len;
3065
48
  char    *name_out;
3066
3067
  /* Domain Names - Implementation And Specification (RFC 1035) */
3068
  /* We will display the information about SIP server */
3069
48
  uint32_t enc;
3070
3071
48
  proto_tree_add_item_ret_uint(tree, hf_dhcp_option_sip_server_enc, tvb, offset, 1, ENC_NA, &enc);
3072
48
  offset += 1;
3073
3074
48
  switch (enc) {
3075
16
  case RFC_3361_ENC_FQDN: {
3076
16
    int consumedx = 0;
3077
16
    if (length < 3) {
3078
1
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 3 (len = %u)", length);
3079
1
      break;
3080
1
    }
3081
3082
307
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
3083
      /* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
3084
292
      consumedx = get_dns_name(pinfo->pool, tvb, offset, length,
3085
292
        1 /* ignore enc */, &dns_name, &dns_name_len);
3086
292
      name_out = format_text(pinfo->pool, dns_name, dns_name_len);
3087
3088
292
      proto_tree_add_string(tree, hf_dhcp_option_sip_server_name, tvb, offset, consumedx, name_out);
3089
292
      offset += consumedx;
3090
292
    }
3091
15
    break;
3092
16
  }
3093
15
  case RFC_3361_ENC_IPADDR:
3094
15
    if (length < 5) {
3095
2
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5 (len = %u)", length);
3096
2
      break;
3097
2
    }
3098
    /* x % 2^n == x & (2^n - 1) note : (assuming x is a positive integer) */
3099
13
    if ((length - 1) & 3) {
3100
1
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", length);
3101
1
      break;
3102
1
    }
3103
295
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
3104
283
      proto_tree_add_item(tree, hf_dhcp_option_sip_server_address, tvb, offset, 4, ENC_BIG_ENDIAN);
3105
283
      offset += 4;
3106
283
    }
3107
12
    break;
3108
17
  default:
3109
17
    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);
3110
17
    break;
3111
48
  }
3112
3113
34
  return tvb_captured_length(tvb);
3114
48
}
3115
3116
static int
3117
dissect_dhcpopt_classless_static_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3118
147
{
3119
147
  unsigned offset = 0;
3120
147
  unsigned i, mask_width, significant_octets;
3121
147
  proto_item* route_item;
3122
3123
  /* minimum length is 5 bytes */
3124
147
  if (tvb_reported_length(tvb) < 5) {
3125
66
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length isn't >= 5");
3126
66
    return 1;
3127
66
  }
3128
980
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3129
964
    mask_width = tvb_get_uint8(tvb, offset);
3130
    /* mask_width <= 32 */
3131
964
    if (mask_width > 32) {
3132
65
      expert_add_info_format(pinfo, tree, &ei_dhcp_option_classless_static_route, "Mask width (%d) > 32", mask_width);
3133
65
      break;
3134
65
    }
3135
899
    significant_octets = (mask_width + 7) / 8;
3136
899
    route_item = proto_tree_add_bytes_format(tree, hf_dhcp_option_classless_static_route, tvb, offset,
3137
899
      1 + significant_octets + 4, NULL, " ");
3138
899
    offset++;
3139
    /* significant octets + router(4) */
3140
899
    if (tvb_reported_length_remaining(tvb, offset) < significant_octets + 4) {
3141
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);
3142
0
      break;
3143
0
    }
3144
899
    if(mask_width == 0)
3145
355
      proto_item_append_text(route_item, "default");
3146
544
    else {
3147
1.62k
      for(i = 0 ; i < significant_octets ; i++) {
3148
1.08k
        if (i > 0)
3149
549
          proto_item_append_text(route_item, ".");
3150
1.08k
        proto_item_append_text(route_item, "%d", tvb_get_uint8(tvb, offset++));
3151
1.08k
      }
3152
1.59k
      for(i = significant_octets ; i < 4 ; i++)
3153
1.04k
        proto_item_append_text(route_item, ".0");
3154
544
      proto_item_append_text(route_item, "/%d", mask_width);
3155
544
    }
3156
899
    proto_item_append_text(route_item, "-%s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3157
899
    offset += 4;
3158
899
  }
3159
3160
81
  return tvb_captured_length(tvb);
3161
147
}
3162
3163
static int
3164
dissect_dhcpopt_coordinate_based_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3165
53
{
3166
53
  unsigned offset = 0, length = tvb_reported_length(tvb);
3167
53
  proto_item* ti;
3168
3169
53
  if (length == 16) {
3170
29
    int ret;
3171
29
    unsigned char lci[16];
3172
29
    struct rfc3825_location_fixpoint_t location_fp;
3173
29
    struct rfc3825_location_decimal_t location;
3174
3175
29
    tvb_memcpy(tvb, lci, offset, 16);
3176
3177
    /* convert lci encoding into fixpoint location */
3178
29
    rfc3825_lci_to_fixpoint(lci, &location_fp);
3179
3180
    /* convert location from decimal to fixpoint */
3181
29
    ret = rfc3825_fixpoint_to_decimal(&location_fp, &location);
3182
3183
29
    if (ret != RFC3825_NOERROR) {
3184
27
      ti = proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_error, tvb, offset, 1, ret);
3185
27
      proto_item_set_len(ti, length);
3186
27
    } else {
3187
2
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude, tvb, offset, 5, location.latitude, "%15.10f", location.latitude);
3188
2
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_longitude, tvb, offset+5, 5, location.longitude, "%15.10f", location.longitude);
3189
2
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_latitude_res, tvb, offset, 1, location.latitude_res, "%15.10f", location.latitude_res);
3190
2
      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);
3191
2
      proto_tree_add_double_format_value(tree, hf_dhcp_option_rfc3825_altitude, tvb, offset+12, 4, location.altitude, "%15.10f", location.altitude);
3192
2
      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);
3193
2
      proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_altitude_type, tvb, offset+10, 1, location.altitude_type);
3194
2
      proto_tree_add_uint(tree, hf_dhcp_option_rfc3825_map_datum, tvb, offset+15, 1, location.datum_type);
3195
2
    }
3196
29
  } else if (length < 69) { /* CableLabs DSS_ID */
3197
14
    unsigned s_len;
3198
3199
14
    proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset, 1, ENC_BIG_ENDIAN);
3200
14
    proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1, 1, ENC_BIG_ENDIAN);
3201
14
    s_len = tvb_get_uint8(tvb, offset+1);
3202
14
    proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2, s_len, ENC_ASCII);
3203
3204
14
    if (length > s_len+2) { /* Second DSS_ID*/
3205
3206
10
      proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_option, tvb, offset+2+s_len, 1, ENC_BIG_ENDIAN);
3207
10
      proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id_len, tvb, offset+1+2+s_len, 1, ENC_BIG_ENDIAN);
3208
10
      s_len = tvb_get_uint8(tvb, offset+1+2+s_len);
3209
10
      proto_tree_add_item(tree, hf_dhcp_option_cl_dss_id, tvb, offset+2+2+s_len, s_len, ENC_ASCII);
3210
10
    }
3211
14
  } else {
3212
10
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Invalid length of DHCP option!");
3213
10
  }
3214
3215
53
  return tvb_captured_length(tvb);
3216
53
}
3217
3218
static int
3219
dissect_dhcpopt_vi_vendor_class(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3220
111
{
3221
111
  unsigned offset = 0;
3222
111
  uint32_t enterprise = 0;
3223
111
  uint32_t option_data_len = 0;
3224
111
  unsigned data_len = 0;
3225
111
  unsigned s_end;
3226
111
  proto_item *eti, *expert_ti;
3227
111
  proto_tree *e_tree;
3228
111
  proto_tree *vcdi_tree;
3229
3230
111
  if (tvb_reported_length(tvb) == 1) {
3231
    /* CableLab specific */
3232
6
    proto_tree_add_item(tree, hf_dhcp_option_vi_class_cl_address_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
3233
6
    return 1;
3234
6
  }
3235
3236
1.04k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3237
3238
993
    eti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option_vi_class_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
3239
993
    e_tree = proto_item_add_subtree(eti, ett_dhcp_option);
3240
993
    offset += 4;
3241
993
    proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option_vi_class_data_length, tvb, offset, 1, ENC_BIG_ENDIAN, &option_data_len);
3242
993
    offset += 1;
3243
3244
993
    s_end = offset + option_data_len;
3245
993
    if ( tvb_reported_length_remaining(tvb, offset) < option_data_len) {
3246
55
      break;
3247
55
    }
3248
3249
1.83k
    while (offset < s_end) {
3250
1.17k
      tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
3251
      /* XXX - Do we really want to try the dissector table for *each*
3252
       * vendor-class-data for the same enterprise? This tvb is too long on
3253
       * subsequent iterations. Only giving the table dissector one attempt
3254
       * (and skipping past bytes it doesn't dissect to s_end) might be simpler.
3255
       */
3256
1.17k
      int bytes_dissected = dissector_try_uint(dhcp_enterprise_class_table, enterprise, enterprise_tvb, pinfo, e_tree);
3257
1.17k
      if (bytes_dissected == 0) {
3258
1.17k
        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");
3259
        /* According to RFC 3925, *each* vendor-class-data instance has
3260
         * its own length, but in practice some vendors have only included
3261
         * the overall per-enterprise option length. See the dhcwg m-l:
3262
         * https://mailarchive.ietf.org/arch/msg/dhcwg/B4fNsvUR0EHxcrKDsKCf7lBrc3s/
3263
         */
3264
1.17k
        data_len = tvb_get_uint8(tvb, offset);
3265
1.17k
        if (offset + data_len >= s_end) {
3266
271
          expert_ti = proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, s_end - offset, ENC_NA);
3267
271
          expert_add_info(pinfo, expert_ti, &ei_dhcp_nonstd_option_data);
3268
271
          offset = s_end;
3269
271
          break;
3270
271
        }
3271
901
        proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_length, tvb, offset, 1, ENC_NA);
3272
901
        offset += 1;
3273
901
        proto_tree_add_item(vcdi_tree, hf_dhcp_option_vi_class_data_item_data, tvb, offset, data_len, ENC_NA);
3274
3275
        /* look for next vendor-class-data-item */
3276
901
        offset += data_len;
3277
901
      } else {
3278
0
        offset += bytes_dissected;
3279
0
      }
3280
1.17k
    }
3281
3282
    /* loop for the next Enterprise number */
3283
938
  }
3284
3285
105
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
3286
95
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
3287
95
  }
3288
3289
105
  return tvb_captured_length(tvb);
3290
111
}
3291
3292
static int
3293
dissect_dhcpopt_forcerenew_nonce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3294
33
{
3295
33
  unsigned offset = 0;
3296
520
  while ( tvb_reported_length_remaining(tvb, offset) > 0) {
3297
487
    proto_tree_add_item(tree, hf_dhcp_option_forcerenew_nonce_algo, tvb, offset, 1, ENC_BIG_ENDIAN);
3298
487
    offset += 1;
3299
487
    }
3300
3301
33
  return tvb_captured_length(tvb);
3302
33
}
3303
3304
static int
3305
dissect_dhcpopt_rdnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3306
21
{
3307
21
  unsigned offset = 0;
3308
21
  const char *dns_name;
3309
21
  int dns_name_len;
3310
3311
21
  if (tvb_reported_length(tvb) < 10) {
3312
19
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 10");
3313
19
    return 1;
3314
19
  }
3315
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
3316
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_pref, tvb, offset, 1, ENC_BIG_ENDIAN);
3317
2
  offset += 1;
3318
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_prim_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3319
2
  offset += 4;
3320
2
  proto_tree_add_item(tree, hf_dhcp_option_rdnss_sec_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3321
2
  offset += 4;
3322
3323
2
  get_dns_name(pinfo->pool, tvb, offset, tvb_reported_length_remaining(tvb,offset), offset, &dns_name, &dns_name_len);
3324
2
  proto_tree_add_string(tree, hf_dhcp_option_rdnss_domain, tvb, offset,
3325
2
      tvb_reported_length_remaining(tvb,offset), format_text(pinfo->pool, dns_name, dns_name_len));
3326
3327
2
  return tvb_captured_length(tvb);
3328
21
}
3329
3330
static int
3331
dissect_dhcpopt_dhcp_captive_portal(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3332
39
{
3333
39
  proto_item *ti_cp;
3334
39
  ti_cp = proto_tree_add_item(tree, hf_dhcp_option_captive_portal, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
3335
39
  proto_item_set_url(ti_cp);
3336
3337
39
  return tvb_captured_length(tvb);
3338
39
}
3339
3340
static int
3341
dissect_dhcpopt_dnr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3342
624
{
3343
624
  unsigned offset = 0;
3344
624
  unsigned offset_end = tvb_captured_length(tvb);
3345
624
  int instance_id = 0;
3346
624
  uint32_t instance_offset = 0;
3347
624
  uint32_t instance_len;
3348
624
  uint32_t adn_len;
3349
624
  int adn_parsed_len;
3350
624
  const char *adn;
3351
624
  uint32_t addrs_len;
3352
624
  proto_item *dnr_instance_ti;
3353
624
  proto_tree *dnr_instance_tree;
3354
624
  proto_item *dnr_instance_addrs_ti;
3355
624
  proto_tree *dnr_instance_addrs_tree;
3356
624
  tvbuff_t *next_tvb;
3357
3358
624
  if (offset + 2 >= offset_end) {
3359
26
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "DNR: truncated option (no DNR instance present)");
3360
26
    return offset_end;
3361
26
  }
3362
3363
7.75k
  while (offset + 2 <= offset_end) {
3364
    // Handling a single DNR Instance
3365
7.61k
    instance_id++;
3366
3367
7.61k
    dnr_instance_ti = proto_tree_add_item(tree, hf_dhcp_dnr_instance, tvb, offset, -1, ENC_NA);
3368
7.61k
    dnr_instance_tree = proto_item_add_subtree(dnr_instance_ti, ett_dhcp_dnr_instance);
3369
3370
7.61k
    proto_tree_add_item_ret_uint(dnr_instance_tree, hf_dhcp_dnr_instance_len, tvb, offset, 2, ENC_BIG_ENDIAN, &instance_len);
3371
7.61k
    offset += 2;
3372
7.61k
    instance_offset = 0;
3373
3374
7.61k
    if (instance_len < 3) {
3375
113
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (instance length %d too short)", instance_len);
3376
113
      break;
3377
113
    }
3378
3379
7.49k
    if (offset + (int)instance_len > offset_end) {
3380
146
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (instance length %d larger than option)", instance_len);
3381
146
      break;
3382
146
    }
3383
3384
7.35k
    proto_item_append_text(dnr_instance_ti, " %d", instance_id);
3385
7.35k
    proto_item_set_len(dnr_instance_ti, (int)instance_len + 2);
3386
3387
7.35k
    proto_tree_add_item(dnr_instance_tree, hf_dhcp_dnr_svcpriority, tvb, offset + instance_offset, 2, ENC_BIG_ENDIAN);
3388
7.35k
    instance_offset += 2;
3389
3390
7.35k
    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);
3391
7.35k
    instance_offset++;
3392
3393
7.35k
    if (instance_offset + adn_len > instance_len) {
3394
55
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: truncated option (adn_len %d larger than option)", adn_len);
3395
55
      break;
3396
55
    }
3397
3398
7.29k
    get_dns_name(pinfo->pool, tvb, offset + instance_offset, adn_len,
3399
7.29k
        offset + instance_offset, &adn, &adn_parsed_len);
3400
7.29k
    proto_tree_add_string(dnr_instance_tree, hf_dhcp_dnr_auth_domain_name, tvb, offset + instance_offset,
3401
7.29k
        adn_len, format_text(pinfo->pool, adn, adn_parsed_len));
3402
3403
7.29k
    instance_offset += adn_len;
3404
3405
7.29k
    if (instance_offset == instance_len) {
3406
      // A DNR instance with only a service priority and authentication-domain-name (ADN) is in ADN-only mode,
3407
      // see RFC9463, Section 3.1.6.
3408
153
      proto_tree_add_expert(dnr_instance_tree, pinfo, &ei_dhcp_option_dnr_adn_only_mode, tvb, offset, instance_len);
3409
3410
153
      offset += instance_len;
3411
153
      continue;
3412
153
    }
3413
3414
7.14k
    proto_tree_add_item_ret_uint(dnr_instance_tree, hf_dhcp_dnr_addrs_len, tvb, offset + instance_offset, 1, ENC_BIG_ENDIAN, &addrs_len);
3415
7.14k
    instance_offset++;
3416
3417
7.14k
    if (addrs_len == 0 || addrs_len % 4 != 0) {
3418
136
      expert_add_info_format(pinfo, dnr_instance_tree, &ei_dhcp_bad_length, "DNR: invalid addrs_len %d (not divisible by 4)", addrs_len);
3419
136
      break;
3420
136
    }
3421
3422
7.00k
    dnr_instance_addrs_ti = proto_tree_add_item(dnr_instance_tree, hf_dhcp_dnr_addrs, tvb, offset + instance_offset, addrs_len, ENC_NA);
3423
7.00k
    dnr_instance_addrs_tree = proto_item_add_subtree(dnr_instance_addrs_ti, ett_dhcp_dnr_instance_addrs);
3424
3425
7.00k
    proto_item_append_text(dnr_instance_addrs_ti, ":");
3426
3427
15.3k
    for (uint32_t i = 0; i < addrs_len; i += 4) {
3428
8.32k
      proto_tree_add_item(dnr_instance_addrs_tree, hf_dhcp_dnr_addrs_ip, tvb, offset + instance_offset + i, 4, ENC_BIG_ENDIAN);
3429
8.32k
      proto_item_append_text(dnr_instance_addrs_ti, "%c%s", (i == 0 ? ' ' : ','), tvb_ip_to_str(pinfo->pool, tvb, offset + instance_offset + i));
3430
8.32k
    }
3431
3432
7.00k
    instance_offset += addrs_len;
3433
3434
    // Parse the service parameters
3435
7.00k
    next_tvb = tvb_new_subset_length(tvb, offset + instance_offset, instance_len - instance_offset);
3436
7.00k
    call_dissector(svc_params_handle, next_tvb, pinfo, dnr_instance_tree);
3437
3438
7.00k
    offset += instance_len;
3439
7.00k
  }
3440
3441
598
  return offset_end;
3442
624
}
3443
3444
static int
3445
dissect_dhcpopt_bulk_lease_query_start(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3446
42
{
3447
42
  if (tvb_reported_length(tvb) != 4) {
3448
23
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3449
23
    return 1;
3450
23
  }
3451
19
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_start, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3452
3453
19
  return tvb_captured_length(tvb);
3454
42
}
3455
3456
static int
3457
dissect_dhcpopt_bulk_lease_query_end(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3458
38
{
3459
38
  if (tvb_reported_length(tvb) != 4) {
3460
35
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3461
35
    return 1;
3462
35
  }
3463
3
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_query_end, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3464
3465
3
  return tvb_captured_length(tvb);
3466
38
}
3467
3468
static int
3469
dissect_dhcpopt_bulk_lease_base_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3470
23
{
3471
23
  if (tvb_reported_length(tvb) != 4) {
3472
21
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3473
21
    return 1;
3474
21
  }
3475
2
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_base_time, tvb, 0, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
3476
3477
2
  return tvb_captured_length(tvb);
3478
23
}
3479
3480
static int
3481
dissect_dhcpopt_bulk_lease_status_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3482
86
{
3483
86
  if (tvb_reported_length(tvb) < 1) {
3484
38
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 1");
3485
38
    return 1;
3486
38
  }
3487
48
  proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_code, tvb, 0, 1, ENC_BIG_ENDIAN);
3488
48
  if ( tvb_reported_length_remaining(tvb, 1) > 0) {
3489
10
    proto_tree_add_item(tree, hf_dhcp_option_bulk_lease_status_message, tvb, 1, tvb_reported_length_remaining(tvb, 1), ENC_UTF_8);
3490
10
    }
3491
3492
48
  return tvb_captured_length(tvb);
3493
86
}
3494
3495
static int
3496
dissect_dhcpopt_pcp_server(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3497
39
{
3498
39
  proto_tree *tree_pcp;
3499
39
  unsigned offset = 0;
3500
39
  uint8_t list_length;
3501
39
  uint8_t ip_list_length;
3502
39
  proto_item *ti_pcp;
3503
3504
39
  if (tvb_reported_length(tvb) < 5) {
3505
9
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must >= 5");
3506
9
    return 1;
3507
9
  }
3508
1.83k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
3509
1.80k
    ip_list_length = 0;
3510
1.80k
    list_length = tvb_get_uint8(tvb, offset);
3511
1.80k
    tree_pcp = proto_tree_add_subtree(tree, tvb, offset, list_length, ett_dhcp_option158_pcp_list,
3512
1.80k
            &ti_pcp, "PCP server list");
3513
1.80k
    proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_list_length, tvb, offset, 1, ENC_NA);
3514
1.80k
    offset += 1;
3515
1.80k
    ip_list_length += 1;
3516
2.55k
    while (((list_length - 1)%4 == 0) && (ip_list_length < list_length) && tvb_reported_length_remaining(tvb,offset) >= 4) {
3517
755
      proto_tree_add_item(tree_pcp, hf_dhcp_option_pcp_server, tvb, offset, 4, ENC_BIG_ENDIAN);
3518
755
      offset += 4;
3519
755
      ip_list_length += 4;
3520
755
    }
3521
1.80k
  }
3522
3523
30
  return tvb_captured_length(tvb);
3524
39
}
3525
3526
static int
3527
dissect_dhcpopt_portparams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3528
19
{
3529
19
  if (tvb_reported_length(tvb) != 4) {
3530
17
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be 4");
3531
17
    return 1;
3532
17
  }
3533
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_offset, tvb, 0, 1, ENC_NA);
3534
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_psid_length, tvb, 1, 1, ENC_NA);
3535
2
  proto_tree_add_item(tree, hf_dhcp_option_portparams_psid, tvb, 2, 2, ENC_NA);
3536
3537
2
  return tvb_captured_length(tvb);
3538
19
}
3539
3540
static int
3541
dissect_dhcpopt_6RD_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3542
58
{
3543
58
  unsigned offset = 0;
3544
3545
58
  if (tvb_reported_length(tvb) < 22) {
3546
27
    expert_add_info(pinfo, tree, &ei_dhcp_option_6RD_malformed);
3547
27
    return 1;
3548
27
  }
3549
3550
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_ipv4_mask_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3551
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix_len, tvb, offset+1, 1, ENC_BIG_ENDIAN);
3552
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_prefix, tvb, offset+2, 16, ENC_NA);
3553
31
  proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset+18, 4, ENC_BIG_ENDIAN);
3554
3555
  /* More Border Relay IPv4 addresses included */
3556
31
  if (tvb_reported_length(tvb) > 22) {
3557
29
    offset += 22;
3558
744
    while (tvb_reported_length_remaining(tvb, offset) >= 4) {
3559
715
      proto_tree_add_item(tree, hf_dhcp_option_6RD_border_relay_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
3560
715
      offset += 4;
3561
715
    }
3562
29
    if (tvb_reported_length_remaining(tvb, offset) > 0) {
3563
19
      expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Option length isn't a multiple of 4");
3564
19
    }
3565
29
  }
3566
3567
31
  return tvb_captured_length(tvb);
3568
58
}
3569
3570
static int
3571
dissect_dhcpopt_avaya_ip_telephone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3572
746
{
3573
746
  unsigned offset = 0;
3574
746
  proto_tree *o242avaya_v_tree;
3575
746
  proto_item *avaya_ti;
3576
746
  const char *avaya_option = NULL;
3577
746
  wmem_strbuf_t *avaya_param_buf = NULL;
3578
3579
  /* minimum length is 5 bytes */
3580
746
  if (tvb_reported_length(tvb) < 5) {
3581
15
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Avaya IP Telephone option length isn't >= 5");
3582
15
    return 1;
3583
15
  }
3584
731
  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);
3585
731
  o242avaya_v_tree = proto_item_add_subtree(avaya_ti, ett_dhcp_option242_suboption);
3586
731
  avaya_param_buf = wmem_strbuf_new(pinfo->pool, "");
3587
731
  char **fields = wmem_strsplit(pinfo->pool, avaya_option, ",", -1);
3588
15.4k
  for (int i = 0; fields[i]; i++) {
3589
14.7k
    const char *field = fields[i];
3590
14.7k
    if (!strchr(field, '=')) {
3591
2.89k
      if (wmem_strbuf_get_len(avaya_param_buf) == 0) {
3592
20
        expert_add_info_format(pinfo, avaya_ti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown parameter %s", field);
3593
20
        offset += (int)strlen(field);
3594
20
        break;
3595
20
      }
3596
2.87k
      wmem_strbuf_append_printf(avaya_param_buf,",%s", field);
3597
2.87k
    }
3598
11.8k
    else {
3599
11.8k
      if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3600
11.1k
        dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3601
11.1k
        offset += (int)wmem_strbuf_get_len(avaya_param_buf) + 1;
3602
11.1k
        wmem_strbuf_truncate(avaya_param_buf, 0);
3603
11.1k
      }
3604
11.8k
      wmem_strbuf_append(avaya_param_buf, field);
3605
11.8k
    }
3606
14.7k
  }
3607
731
  if (wmem_strbuf_get_len(avaya_param_buf) > 0) {
3608
626
    dissect_vendor_avaya_param(o242avaya_v_tree, pinfo, avaya_ti, tvb, offset, avaya_param_buf);
3609
626
  }
3610
3611
731
  return tvb_captured_length(tvb);
3612
746
}
3613
3614
static const value_string option82_suboption_vals[] = {
3615
  {  0, "Padding" },
3616
  {  1, "Agent Circuit ID" },
3617
  {  2, "Agent Remote ID" },
3618
  {  3, "Reserved" },
3619
  {  4, "DOCSIS Device Class" },
3620
  {  5, "Link selection" },
3621
  {  6, "Subscriber ID" },
3622
  {  7, "RADIUS Attributes" },
3623
  {  8, "Authentication" },
3624
  {  9, "Vendor-Specific Information" },
3625
  { 10, "Flags" },
3626
  { 11, "Server ID Override" },
3627
  { 12, "Relay Agent Identifier" },
3628
  { 13, "Access Technology Type" },
3629
  { 14, "Access Network Name" },
3630
  { 15, "Access Point Name" },
3631
  { 16, "Access Point BSSID" },
3632
  { 17, "Access Network Operator ID" },
3633
  { 18, "Access Network Operator Realm" },
3634
  { 19, "Source Port" },
3635
  { 150, "Link selection (Cisco proprietary)" },
3636
  { 151, "VRF name/VPN ID" },
3637
  { 152, "Server ID Override (Cisco proprietary)" },
3638
  { 0, NULL }
3639
};
3640
3641
26.2k
#define CL_AI_OPTION_DOCSIS_VERSION     1  /* 82:9:4491:1 */
3642
474
#define CL_AI_OPTION_DPOE_SYSTEM_VERSION    2  /* 82:9:4491:2 */
3643
934
#define CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE 4  /* 82:9:4491:4 */
3644
494
#define CL_AI_OPTION_CMTS_CM_SERVICE_CLASS    5  /* 82:9:4491:5 */
3645
462
#define CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT    6  /* 82:9:4491:6 */
3646
553
#define CL_AI_OPTION_SECURE_FILE_TRANSFER_URI   7  /* 82:9:4491:7 */
3647
3648
static const value_string option82_cl_tag_vals[] = {
3649
  { CL_AI_OPTION_DOCSIS_VERSION, "CMTS DOCSIS version number" },
3650
  { CL_AI_OPTION_DPOE_SYSTEM_VERSION, "DPOE System version number" },
3651
  { CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE, "DPOE System DHCPv4 PBB service option" },
3652
  { CL_AI_OPTION_CMTS_CM_SERVICE_CLASS, "Service Class or QoS Profile Name" },
3653
  { CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT, "MSO Defined Text" },
3654
  { CL_AI_OPTION_SECURE_FILE_TRANSFER_URI, "Secure File Transfer URI" },
3655
  { 0, NULL }
3656
};
3657
3658
static int
3659
dhcp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree, tvbuff_t *tvb, unsigned optoff,
3660
           unsigned optend)
3661
89.1k
{
3662
89.1k
  unsigned    suboptoff = optoff;
3663
89.1k
  uint8_t     subopt, vs_opt, vs_len;
3664
89.1k
  size_t      idx;
3665
89.1k
  unsigned    subopt_len, subopt_end, datalen;
3666
89.1k
  uint32_t    enterprise;
3667
89.1k
  proto_item *vti, *ti;
3668
89.1k
  proto_tree *o82_v_tree, *o82_sub_tree;
3669
89.1k
  unsigned    clsuboptoff, clsubopt_end;
3670
3671
89.1k
  static const struct basic_types_hfs default_hfs = {
3672
89.1k
    &hf_dhcp_option82_value,
3673
89.1k
    &hf_dhcp_option82_value_ip_address,
3674
89.1k
    &hf_dhcp_option82_value_ip_address,
3675
89.1k
    &hf_dhcp_option82_value_stringz,
3676
89.1k
    NULL,
3677
89.1k
    &hf_dhcp_option82_value_8,
3678
89.1k
    &hf_dhcp_option82_value_16,
3679
89.1k
    NULL,
3680
89.1k
    &hf_dhcp_option82_value_32,
3681
89.1k
    NULL,
3682
89.1k
    NULL
3683
89.1k
  };
3684
3685
89.1k
  struct opt82_info {
3686
89.1k
    int id;
3687
89.1k
    struct opt_info info;
3688
89.1k
  };
3689
89.1k
  static const struct opt82_info o82_opt[]= {
3690
89.1k
    {0, {"nop", bytes, &hf_dhcp_option82_padding}}, /* dummy */
3691
89.1k
    {1, {"Agent Circuit ID", bytes, &hf_dhcp_option82_agent_circuit_id}}, /* [RFC3046] */
3692
89.1k
    {2, {"Agent Remote ID", bytes, &hf_dhcp_option82_agent_remote_id}}, /* [RFC3046] */
3693
89.1k
    {3, {"Reserved", bytes, &hf_dhcp_option82_reserved}},
3694
89.1k
    {4, {"DOCSIS Device Class", val_u_long, &hf_dhcp_option82_docsis_device_class}}, /* [RFC3256] */
3695
89.1k
    {5, {"Link selection", ipv4, &hf_dhcp_option82_link_selection}}, /* [RFC3527] */
3696
89.1k
    {6, {"Subscriber ID", string, &hf_dhcp_option82_subscriber_id}},  /* [RFC3993] */ /***** CHECK STRING TYPE */
3697
89.1k
    {7, {"RADIUS Attributes", special, &hf_dhcp_option82_radius_attributes}}, /* [RFC4014] */
3698
89.1k
    {8, {"Authentication", bytes, &hf_dhcp_option82_authentication}}, /* [RFC4030] */
3699
89.1k
    {9, {"Vendor-Specific Information", special, &hf_dhcp_option82_vi}}, /* [RFC 4243] */
3700
89.1k
    {10, {"Flags", special, &hf_dhcp_option82_flags}}, /* [RFC5010] */
3701
89.1k
    {11, {"Server ID Override", ipv4, &hf_dhcp_option82_server_id_override}}, /* [RFC 5107] */
3702
89.1k
    {12, {"Relay Agent Identifier", bytes, &hf_dhcp_option82_relay_agent_id}}, /* [RFC 6925] */
3703
89.1k
    {13, {"Access Technology Type", bytes, &hf_dhcp_option82_option_ani_att}}, /* [RFC7839] */
3704
89.1k
    {14, {"Access Network Name", string, &hf_dhcp_option82_option_ani_network_name}}, /* [RFC7839] */
3705
89.1k
    {15, {"Access Point Name", string, &hf_dhcp_option82_option_ani_ap_name}}, /* [RFC7839] */
3706
89.1k
    {16, {"Access Point BSSID", special, &hf_dhcp_option82_option_ani_ap_bssid}}, /* [RFC7839] */
3707
89.1k
    {17, {"Access Network Operator ID", bytes, &hf_dhcp_option82_option_ani_operator_id}}, /* [RFC7839] */
3708
89.1k
    {18, {"Access Network Operator Realm", string, &hf_dhcp_option82_option_ani_operator_realm}}, /* [RFC7839] */
3709
89.1k
    {19, {"Source Port", presence, &hf_dhcp_option82_option_source_port}}, /* [RFC8357] */
3710
89.1k
    {150, {"Link selection (Cisco proprietary)", ipv4, &hf_dhcp_option82_link_selection_cisco}}, /* [RFC3527] */
3711
89.1k
    {151, {"VRF name/VPN ID", special, &hf_dhcp_option82_vrf_name_vpn_id}}, /* [RFC2685] */
3712
89.1k
    {152, {"Server ID Override (Cisco proprietary)", ipv4, &hf_dhcp_option82_server_id_override_cisco}} /* [RFC 5107] */
3713
89.1k
  };
3714
3715
89.1k
  subopt = tvb_get_uint8(tvb, optoff);
3716
89.1k
  suboptoff++;
3717
3718
89.1k
  if (suboptoff >= optend) {
3719
266
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
3720
266
                  "Suboption %d: no room left in option for suboption length", subopt);
3721
266
    return (optend);
3722
266
  }
3723
3724
88.9k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
3725
88.9k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option82_suboption,
3726
88.9k
    tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str_const(subopt, option82_suboption_vals, "Unknown"));
3727
3728
88.9k
  o82_v_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption);
3729
88.9k
  proto_tree_add_item(o82_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3730
88.9k
  suboptoff++;
3731
3732
88.9k
  subopt_end = suboptoff+subopt_len;
3733
88.9k
  if (subopt_end > optend) {
3734
2.94k
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
3735
2.94k
            "Suboption %d: no room left in option for suboption value", subopt);
3736
2.94k
    return (optend);
3737
2.94k
  }
3738
3739
614k
  for (idx = 0; idx < array_length(o82_opt); idx++) {
3740
605k
    if (o82_opt[idx].id == subopt) {
3741
76.7k
      break;
3742
76.7k
    }
3743
605k
  }
3744
3745
85.9k
  ti = proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3746
3747
85.9k
  if ( (idx >= 1 ) && (idx < array_length(o82_opt)) ) {
3748
43.1k
    proto_item_set_hidden(ti);
3749
43.1k
    if (o82_opt[idx].info.ftype == special) {
3750
26.4k
      switch(subopt)
3751
26.4k
      {
3752
23.1k
      case 7:
3753
23.1k
        dissect_attribute_value_pairs(o82_v_tree, pinfo, tvb, suboptoff, subopt_len, NULL);
3754
23.1k
        break;
3755
1.99k
      case 9:
3756
3.12k
        while (suboptoff < subopt_end) {
3757
1.17k
          vti = proto_tree_add_item_ret_uint(o82_v_tree, hf_dhcp_option82_vi_enterprise, tvb, suboptoff, 4, ENC_BIG_ENDIAN, &enterprise);
3758
1.17k
          suboptoff += 4;
3759
3760
1.17k
          o82_sub_tree = proto_item_add_subtree(vti, ett_dhcp_option82_suboption9);
3761
1.17k
          datalen = tvb_get_uint8(tvb, suboptoff);
3762
1.17k
          proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_data_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3763
1.17k
          suboptoff++;
3764
3765
1.17k
          switch (enterprise) {
3766
445
          case VENDOR_CABLELABS: /* CableLabs */
3767
            /* Compare CL-SP-CANN-DHCP-Reg-I06-110210 (2011) and
3768
             * CL-SP-CANN-DHCP-Reg-I13-160317 (2016) */
3769
445
            clsuboptoff = suboptoff;
3770
445
            clsubopt_end = clsuboptoff + datalen;
3771
13.1k
            while (clsuboptoff < clsubopt_end) {
3772
12.7k
              vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3773
12.7k
              vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3774
12.7k
              if (vs_opt == CL_AI_OPTION_DOCSIS_VERSION &&
3775
1.01k
                vs_len == 4) {
3776
3777
                /* Superseded version with a redundant option code and option-length */
3778
323
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3779
323
                clsuboptoff++;
3780
323
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_option_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3781
323
                clsuboptoff++;
3782
3783
323
                vs_opt = tvb_get_uint8(tvb, clsuboptoff);
3784
323
                vs_len = tvb_get_uint8(tvb, clsuboptoff+1);
3785
323
              }
3786
12.7k
              proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3787
12.7k
              clsuboptoff++;
3788
12.7k
              proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_tag_length, tvb, clsuboptoff, 1, ENC_BIG_ENDIAN);
3789
12.7k
              clsuboptoff++;
3790
12.7k
              switch (vs_opt) {
3791
824
              case CL_AI_OPTION_DOCSIS_VERSION:
3792
824
                proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_docsis_version,
3793
824
                      tvb, clsuboptoff, 2, 0, "%d.%d",
3794
824
                      tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3795
824
                clsuboptoff+=2;
3796
824
                break;
3797
474
              case CL_AI_OPTION_DPOE_SYSTEM_VERSION:
3798
474
                proto_tree_add_uint_format_value(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_version,
3799
474
                      tvb, clsuboptoff, 2, 0, "%d.%d",
3800
474
                      tvb_get_uint8(tvb, clsuboptoff), tvb_get_uint8(tvb, clsuboptoff+1));
3801
474
                clsuboptoff+=2;
3802
474
                break;
3803
934
              case CL_AI_OPTION_DPOE_SYSTEM_DHCPV4_PBB_SERVICE:
3804
934
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_dpoe_system_pbb_service, tvb, clsuboptoff, vs_len, ENC_NA);
3805
934
                break;
3806
494
              case CL_AI_OPTION_CMTS_CM_SERVICE_CLASS:
3807
494
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_service_class_name, tvb, clsuboptoff, vs_len, ENC_ASCII);
3808
494
                clsuboptoff += vs_len;
3809
494
                break;
3810
462
              case CL_AI_OPTION_CMTS_MSO_DEFINED_TEXT:
3811
462
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_mso_defined_text, tvb, clsuboptoff, vs_len, ENC_ASCII);
3812
462
                clsuboptoff += vs_len;
3813
462
                break;
3814
553
              case CL_AI_OPTION_SECURE_FILE_TRANSFER_URI:
3815
553
                proto_tree_add_item(o82_sub_tree, hf_dhcp_option82_vi_cl_secure_file_transfer_uri, tvb, clsuboptoff, vs_len, ENC_ASCII);
3816
553
                clsuboptoff += vs_len;
3817
553
                break;
3818
8.95k
              default:
3819
8.95k
                expert_add_info_format(pinfo, vti, &ei_dhcp_option82_vi_cl_tag_unknown, "Unknown tag %d (%d bytes)", vs_opt, vs_len);
3820
8.95k
                clsuboptoff += vs_len;
3821
8.95k
                break;
3822
12.7k
              }
3823
12.7k
            }
3824
431
            suboptoff = clsuboptoff;
3825
431
            break;
3826
732
          default:
3827
732
            proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, datalen, ENC_NA);
3828
732
            suboptoff += datalen;
3829
732
            break;
3830
1.17k
          }
3831
1.17k
        }
3832
1.94k
        break;
3833
1.94k
      case 10: /* Relay Agent Flags Suboption */
3834
522
        {
3835
522
          static int * const dhcp_option82_flags[] = {
3836
522
            &hf_dhcp_option82_flags_unicast,
3837
522
            &hf_dhcp_option82_flags_reserved,
3838
522
            NULL
3839
522
          };
3840
3841
522
          proto_tree_add_bitmask_with_flags(o82_v_tree, tvb, suboptoff, hf_dhcp_option82_flags,
3842
522
            ett_dhcp_option82_suboption10, dhcp_option82_flags, ENC_BIG_ENDIAN, BMT_NO_INT);
3843
522
        }
3844
522
        break;
3845
0
      case 13: /* Access Technology Type */
3846
0
        if (subopt_len != 2) {
3847
0
          expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 2");
3848
0
          break;
3849
0
        }
3850
0
        proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_res, tvb, suboptoff, 1, ENC_NA);
3851
0
        proto_tree_add_item(o82_v_tree, hf_dhcp_option82_option_ani_att_att, tvb, suboptoff+1, 1, ENC_NA);
3852
0
        break;
3853
380
      case 151:
3854
380
        if (subopt_len == 1) {
3855
170
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_global, tvb, suboptoff, 1, ENC_NA);
3856
170
        }
3857
210
        else if (subopt_len != 7) {
3858
115
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name, tvb, suboptoff, subopt_len, ENC_ASCII);
3859
115
        } else {
3860
95
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_oui, tvb, suboptoff, 3, ENC_BIG_ENDIAN);
3861
95
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_vrf_name_vpn_id_index, tvb, suboptoff+3, 4, ENC_BIG_ENDIAN);
3862
95
        }
3863
380
        break;
3864
379
      default:
3865
379
        if (o82_opt[idx].info.phf != NULL)
3866
379
          proto_tree_add_item(o82_v_tree, *o82_opt[idx].info.phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
3867
0
        else
3868
0
          proto_tree_add_item(o82_v_tree, hf_dhcp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
3869
379
        break;
3870
26.4k
      }
3871
26.4k
    }
3872
16.6k
    else {
3873
16.6k
      dhcp_handle_basic_types(pinfo, o82_v_tree, vti, tvb, o82_opt[idx].info.ftype,
3874
16.6k
                 suboptoff, subopt_len, o82_opt[idx].info.phf, &default_hfs);
3875
16.6k
    }
3876
43.1k
  }
3877
3878
81.0k
  optoff += (subopt_len + 2);
3879
81.0k
  return optoff;
3880
85.9k
}
3881
3882
static int
3883
dissect_dhcpopt_relay_agent_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
3884
8.41k
{
3885
8.41k
  unsigned offset = 0;
3886
3887
97.5k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
3888
89.1k
    offset = dhcp_dhcp_decode_agent_info(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
3889
89.1k
  }
3890
3891
8.41k
  return tvb_captured_length(tvb);
3892
8.41k
}
3893
3894
537
# define O43PXE_DISCOVERY 6
3895
181
# define O43PXE_BOOT_SERVER 8
3896
181
# define O43PXE_BOOT_MENU 9
3897
340
# define O43PXE_MENU_PROMPT 10
3898
80
# define O43PXE_BOOT_ITEM 71
3899
3900
static const value_string option43_pxeclient_suboption_vals[] = {
3901
  {  0, "Padding" },
3902
  {  1, "PXE mtftp IP" },
3903
  {  2, "PXE mtftp client port" },
3904
  {  3, "PXE mtftp server port" },
3905
  {  4, "PXE mtftp timeout" },
3906
  {  5, "PXE mtftp delay" },
3907
  { O43PXE_DISCOVERY, "PXE discovery control" },
3908
  {  7, "PXE multicast address" },
3909
  { O43PXE_BOOT_SERVER, "PXE boot servers" },
3910
  { O43PXE_BOOT_MENU, "PXE boot menu" },
3911
  { O43PXE_MENU_PROMPT, "PXE menu prompt" },
3912
  { 11, "PXE multicast address alloc", },
3913
  { 12, "PXE credential types" },
3914
  { O43PXE_BOOT_ITEM, "PXE boot item" },
3915
  { 179, "PXE LCM Server" },
3916
  { 180, "PXE LCM Domain" },
3917
  { 181, "PXE LCM NIC option 0" },
3918
  { 190, "PXE LCM Workgroup" },
3919
  { 191, "PXE Discovery" },
3920
  { 192, "PXE Configured" },
3921
  { 193, "PXE LCM version" },
3922
  { 194, "PXE LCM Serial Number" },
3923
  { 255, "PXE End" },
3924
  { 0, NULL}
3925
};
3926
3927
static int
3928
dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3929
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
3930
6.95k
{
3931
6.95k
  unsigned    suboptoff = optoff;
3932
6.95k
  unsigned    suboptoff_start;
3933
6.95k
  uint8_t     subopt;
3934
6.95k
  uint8_t     subopt_len;
3935
6.95k
  proto_tree *o43pxeclient_v_tree, *o43pxeclient_suboption_tree;
3936
6.95k
  proto_item *vti, *ti;
3937
6.95k
  uint32_t    boot_server_ip_count;
3938
6.95k
  uint32_t    boot_menu_length;
3939
3940
6.95k
  static const struct basic_types_hfs default_hfs = {
3941
6.95k
    NULL,
3942
6.95k
    &hf_dhcp_option43_value_ip_address,
3943
6.95k
    &hf_dhcp_option43_value_ip_address,
3944
6.95k
    NULL,
3945
6.95k
    NULL,
3946
6.95k
    &hf_dhcp_option43_value_8,
3947
6.95k
    NULL,
3948
6.95k
    NULL,
3949
6.95k
    NULL,
3950
6.95k
    NULL,
3951
6.95k
    NULL
3952
6.95k
  };
3953
3954
6.95k
  static int * const o43pxe_discovery_hf_flags[] = {
3955
6.95k
    &hf_dhcp_option43_pxeclient_discovery_control_bc,
3956
6.95k
    &hf_dhcp_option43_pxeclient_discovery_control_mc,
3957
6.95k
    &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
3958
6.95k
    &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
3959
6.95k
    NULL
3960
6.95k
  };
3961
3962
6.95k
  static const struct opt_info o43pxeclient_opt[]= {
3963
6.95k
    /* 0 */ {"nop", special, &hf_dhcp_option43_pxeclient_padding},  /* dummy */
3964
6.95k
    /* 1 */ {"PXE mtftp IP", ipv4_list, &hf_dhcp_option43_pxeclient_mtftp_ip},
3965
6.95k
    /* 2 */ {"PXE mtftp client port", val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_client_port},
3966
6.95k
    /* 3 */ {"PXE mtftp server port",val_u_le_short, &hf_dhcp_option43_pxeclient_mtftp_server_port},
3967
6.95k
    /* 4 */ {"PXE mtftp timeout", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_timeout},
3968
6.95k
    /* 5 */ {"PXE mtftp delay", val_u_byte, &hf_dhcp_option43_pxeclient_mtftp_delay},
3969
6.95k
    /* 6 */ {"PXE discovery control", special, NULL},
3970
6.95k
    /* 7 */ {"PXE multicast address", ipv4_list, &hf_dhcp_option43_pxeclient_multicast_address},
3971
6.95k
    /* 8 */ {"PXE boot servers", special, NULL},
3972
6.95k
    /* 9 */ {"PXE boot menu", special, NULL},
3973
6.95k
    /* 10 */ {"PXE menu prompt", special, NULL},
3974
6.95k
    /* 11 */ {"PXE multicast address alloc", special, &hf_dhcp_option43_pxeclient_multicast_address_alloc},
3975
6.95k
    /* 12 */ {"PXE credential types", special, &hf_dhcp_option43_pxeclient_credential_types},
3976
6.95k
    /* 13 */ {"Unassigned", opaque, NULL},
3977
6.95k
    /* 14 */ {"Unassigned", opaque, NULL},
3978
6.95k
    /* 15 */ {"Unassigned", opaque, NULL},
3979
6.95k
    /* 16 */ {"Unassigned", opaque, NULL},
3980
6.95k
    /* 17 */ {"Unassigned", opaque, NULL},
3981
6.95k
    /* 18 */ {"Unassigned", opaque, NULL},
3982
6.95k
    /* 19 */ {"Unassigned", opaque, NULL},
3983
6.95k
    /* 20 */ {"Unassigned", opaque, NULL},
3984
6.95k
    /* 21 */ {"Unassigned", opaque, NULL},
3985
6.95k
    /* 22 */ {"Unassigned", opaque, NULL},
3986
6.95k
    /* 23 */ {"Unassigned", opaque, NULL},
3987
6.95k
    /* 24 */ {"Unassigned", opaque, NULL},
3988
6.95k
    /* 25 */ {"Unassigned", opaque, NULL},
3989
6.95k
    /* 26 */ {"Unassigned", opaque, NULL},
3990
6.95k
    /* 27 */ {"Unassigned", opaque, NULL},
3991
6.95k
    /* 28 */ {"Unassigned", opaque, NULL},
3992
6.95k
    /* 29 */ {"Unassigned", opaque, NULL},
3993
6.95k
    /* 30 */ {"Unassigned", opaque, NULL},
3994
6.95k
    /* 31 */ {"Unassigned", opaque, NULL},
3995
6.95k
    /* 32 */ {"Unassigned", opaque, NULL},
3996
6.95k
    /* 33 */ {"Unassigned", opaque, NULL},
3997
6.95k
    /* 34 */ {"Unassigned", opaque, NULL},
3998
6.95k
    /* 35 */ {"Unassigned", opaque, NULL},
3999
6.95k
    /* 36 */ {"Unassigned", opaque, NULL},
4000
6.95k
    /* 37 */ {"Unassigned", opaque, NULL},
4001
6.95k
    /* 38 */ {"Unassigned", opaque, NULL},
4002
6.95k
    /* 39 */ {"Unassigned", opaque, NULL},
4003
6.95k
    /* 40 */ {"Unassigned", opaque, NULL},
4004
6.95k
    /* 41 */ {"Unassigned", opaque, NULL},
4005
6.95k
    /* 42 */ {"Unassigned", opaque, NULL},
4006
6.95k
    /* 43 */ {"Unassigned", opaque, NULL},
4007
6.95k
    /* 44 */ {"Unassigned", opaque, NULL},
4008
6.95k
    /* 45 */ {"Unassigned", opaque, NULL},
4009
6.95k
    /* 46 */ {"Unassigned", opaque, NULL},
4010
6.95k
    /* 47 */ {"Unassigned", opaque, NULL},
4011
6.95k
    /* 48 */ {"Unassigned", opaque, NULL},
4012
6.95k
    /* 49 */ {"Unassigned", opaque, NULL},
4013
6.95k
    /* 50 */ {"Unassigned", opaque, NULL},
4014
6.95k
    /* 51 */ {"Unassigned", opaque, NULL},
4015
6.95k
    /* 52 */ {"Unassigned", opaque, NULL},
4016
6.95k
    /* 53 */ {"Unassigned", opaque, NULL},
4017
6.95k
    /* 54 */ {"Unassigned", opaque, NULL},
4018
6.95k
    /* 55 */ {"Unassigned", opaque, NULL},
4019
6.95k
    /* 56 */ {"Unassigned", opaque, NULL},
4020
6.95k
    /* 57 */ {"Unassigned", opaque, NULL},
4021
6.95k
    /* 58 */ {"Unassigned", opaque, NULL},
4022
6.95k
    /* 59 */ {"Unassigned", opaque, NULL},
4023
6.95k
    /* 60 */ {"Unassigned", opaque, NULL},
4024
6.95k
    /* 61 */ {"Unassigned", opaque, NULL},
4025
6.95k
    /* 62 */ {"Unassigned", opaque, NULL},
4026
6.95k
    /* 63 */ {"Unassigned", opaque, NULL},
4027
6.95k
    /* 64 */ {"Unassigned", opaque, NULL},
4028
6.95k
    /* 65 */ {"Unassigned", opaque, NULL},
4029
6.95k
    /* 66 */ {"Unassigned", opaque, NULL},
4030
6.95k
    /* 67 */ {"Unassigned", opaque, NULL},
4031
6.95k
    /* 68 */ {"Unassigned", opaque, NULL},
4032
6.95k
    /* 69 */ {"Unassigned", opaque, NULL},
4033
6.95k
    /* 70 */ {"Unassigned", opaque, NULL},
4034
6.95k
    /* 71 */ {"PXE boot item", special, NULL},
4035
6.95k
    /* 72 */ {"Unassigned", opaque, NULL},
4036
6.95k
    /* 73 */ {"Unassigned", opaque, NULL},
4037
6.95k
    /* 74 */ {"Unassigned", opaque, NULL},
4038
6.95k
    /* 75 */ {"Unassigned", opaque, NULL},
4039
6.95k
    /* 76 */ {"Unassigned", opaque, NULL},
4040
6.95k
    /* 77 */ {"Unassigned", opaque, NULL},
4041
6.95k
    /* 78 */ {"Unassigned", opaque, NULL},
4042
6.95k
    /* 79 */ {"Unassigned", opaque, NULL},
4043
6.95k
    /* 80 */ {"Unassigned", opaque, NULL},
4044
6.95k
    /* 81 */ {"Unassigned", opaque, NULL},
4045
6.95k
    /* 82 */ {"Unassigned", opaque, NULL},
4046
6.95k
    /* 83 */ {"Unassigned", opaque, NULL},
4047
6.95k
    /* 84 */ {"Unassigned", opaque, NULL},
4048
6.95k
    /* 85 */ {"Unassigned", opaque, NULL},
4049
6.95k
    /* 86 */ {"Unassigned", opaque, NULL},
4050
6.95k
    /* 87 */ {"Unassigned", opaque, NULL},
4051
6.95k
    /* 88 */ {"Unassigned", opaque, NULL},
4052
6.95k
    /* 89 */ {"Unassigned", opaque, NULL},
4053
6.95k
    /* 90 */ {"Unassigned", opaque, NULL},
4054
6.95k
    /* 91 */ {"Unassigned", opaque, NULL},
4055
6.95k
    /* 92 */ {"Unassigned", opaque, NULL},
4056
6.95k
    /* 93 */ {"Unassigned", opaque, NULL},
4057
6.95k
    /* 94 */ {"Unassigned", opaque, NULL},
4058
6.95k
    /* 95 */ {"Unassigned", opaque, NULL},
4059
6.95k
    /* 96 */ {"Unassigned", opaque, NULL},
4060
6.95k
    /* 97 */ {"Unassigned", opaque, NULL},
4061
6.95k
    /* 98 */ {"Unassigned", opaque, NULL},
4062
6.95k
    /* 99 */ {"Unassigned", opaque, NULL},
4063
6.95k
    /* 100 */ {"Unassigned", opaque, NULL},
4064
6.95k
    /* 101 */ {"Unassigned", opaque, NULL},
4065
6.95k
    /* 102 */ {"Unassigned", opaque, NULL},
4066
6.95k
    /* 103 */ {"Unassigned", opaque, NULL},
4067
6.95k
    /* 104 */ {"Unassigned", opaque, NULL},
4068
6.95k
    /* 105 */ {"Unassigned", opaque, NULL},
4069
6.95k
    /* 106 */ {"Unassigned", opaque, NULL},
4070
6.95k
    /* 107 */ {"Unassigned", opaque, NULL},
4071
6.95k
    /* 108 */ {"Unassigned", opaque, NULL},
4072
6.95k
    /* 109 */ {"Unassigned", opaque, NULL},
4073
6.95k
    /* 110 */ {"Unassigned", opaque, NULL},
4074
6.95k
    /* 111 */ {"Unassigned", opaque, NULL},
4075
6.95k
    /* 112 */ {"Unassigned", opaque, NULL},
4076
6.95k
    /* 113 */ {"Unassigned", opaque, NULL},
4077
6.95k
    /* 114 */ {"Unassigned", opaque, NULL},
4078
6.95k
    /* 115 */ {"Unassigned", opaque, NULL},
4079
6.95k
    /* 116 */ {"Unassigned", opaque, NULL},
4080
6.95k
    /* 117 */ {"Unassigned", opaque, NULL},
4081
6.95k
    /* 118 */ {"Unassigned", opaque, NULL},
4082
6.95k
    /* 119 */ {"Unassigned", opaque, NULL},
4083
6.95k
    /* 120 */ {"Unassigned", opaque, NULL},
4084
6.95k
    /* 121 */ {"Unassigned", opaque, NULL},
4085
6.95k
    /* 122 */ {"Unassigned", opaque, NULL},
4086
6.95k
    /* 123 */ {"Unassigned", opaque, NULL},
4087
6.95k
    /* 124 */ {"Unassigned", opaque, NULL},
4088
6.95k
    /* 125 */ {"Unassigned", opaque, NULL},
4089
6.95k
    /* 126 */ {"Unassigned", opaque, NULL},
4090
6.95k
    /* 127 */ {"Unassigned", opaque, NULL},
4091
6.95k
    /* 128 */ {"Unassigned", opaque, NULL},
4092
6.95k
    /* 129 */ {"Unassigned", opaque, NULL},
4093
6.95k
    /* 130 */ {"Unassigned", opaque, NULL},
4094
6.95k
    /* 131 */ {"Unassigned", opaque, NULL},
4095
6.95k
    /* 132 */ {"Unassigned", opaque, NULL},
4096
6.95k
    /* 133 */ {"Unassigned", opaque, NULL},
4097
6.95k
    /* 134 */ {"Unassigned", opaque, NULL},
4098
6.95k
    /* 135 */ {"Unassigned", opaque, NULL},
4099
6.95k
    /* 136 */ {"Unassigned", opaque, NULL},
4100
6.95k
    /* 137 */ {"Unassigned", opaque, NULL},
4101
6.95k
    /* 138 */ {"Unassigned", opaque, NULL},
4102
6.95k
    /* 139 */ {"Unassigned", opaque, NULL},
4103
6.95k
    /* 140 */ {"Unassigned", opaque, NULL},
4104
6.95k
    /* 141 */ {"Unassigned", opaque, NULL},
4105
6.95k
    /* 142 */ {"Unassigned", opaque, NULL},
4106
6.95k
    /* 143 */ {"Unassigned", opaque, NULL},
4107
6.95k
    /* 144 */ {"Unassigned", opaque, NULL},
4108
6.95k
    /* 145 */ {"Unassigned", opaque, NULL},
4109
6.95k
    /* 146 */ {"Unassigned", opaque, NULL},
4110
6.95k
    /* 147 */ {"Unassigned", opaque, NULL},
4111
6.95k
    /* 148 */ {"Unassigned", opaque, NULL},
4112
6.95k
    /* 149 */ {"Unassigned", opaque, NULL},
4113
6.95k
    /* 150 */ {"Unassigned", opaque, NULL},
4114
6.95k
    /* 151 */ {"Unassigned", opaque, NULL},
4115
6.95k
    /* 152 */ {"Unassigned", opaque, NULL},
4116
6.95k
    /* 153 */ {"Unassigned", opaque, NULL},
4117
6.95k
    /* 154 */ {"Unassigned", opaque, NULL},
4118
6.95k
    /* 155 */ {"Unassigned", opaque, NULL},
4119
6.95k
    /* 156 */ {"Unassigned", opaque, NULL},
4120
6.95k
    /* 157 */ {"Unassigned", opaque, NULL},
4121
6.95k
    /* 158 */ {"Unassigned", opaque, NULL},
4122
6.95k
    /* 159 */ {"Unassigned", opaque, NULL},
4123
6.95k
    /* 160 */ {"Unassigned", opaque, NULL},
4124
6.95k
    /* 161 */ {"Unassigned", opaque, NULL},
4125
6.95k
    /* 162 */ {"Unassigned", opaque, NULL},
4126
6.95k
    /* 163 */ {"Unassigned", opaque, NULL},
4127
6.95k
    /* 164 */ {"Unassigned", opaque, NULL},
4128
6.95k
    /* 165 */ {"Unassigned", opaque, NULL},
4129
6.95k
    /* 166 */ {"Unassigned", opaque, NULL},
4130
6.95k
    /* 167 */ {"Unassigned", opaque, NULL},
4131
6.95k
    /* 168 */ {"Unassigned", opaque, NULL},
4132
6.95k
    /* 169 */ {"Unassigned", opaque, NULL},
4133
6.95k
    /* 170 */ {"Unassigned", opaque, NULL},
4134
6.95k
    /* 171 */ {"Unassigned", opaque, NULL},
4135
6.95k
    /* 172 */ {"Unassigned", opaque, NULL},
4136
6.95k
    /* 173 */ {"Unassigned", opaque, NULL},
4137
6.95k
    /* 174 */ {"Unassigned", opaque, NULL},
4138
6.95k
    /* 175 */ {"Unassigned", opaque, NULL},
4139
6.95k
    /* 176 */ {"Unassigned", opaque, NULL},
4140
6.95k
    /* 177 */ {"Unassigned", opaque, NULL},
4141
6.95k
    /* 178 */ {"Unassigned", opaque, NULL},
4142
6.95k
    /* 179 */ {"LCM Server", string, &hf_dhcp_option43_pxeclient_lcm_server},
4143
6.95k
    /* 180 */ {"LCM Domain", string, &hf_dhcp_option43_pxeclient_lcm_domain},
4144
6.95k
    /* 181 */ {"LCM NIC Option 0", bytes, &hf_dhcp_option43_pxeclient_lcm_nic_option},
4145
6.95k
    /* 182 */ {"Unassigned", opaque, NULL},
4146
6.95k
    /* 183 */ {"Unassigned", opaque, NULL},
4147
6.95k
    /* 184 */ {"Unassigned", opaque, NULL},
4148
6.95k
    /* 185 */ {"Unassigned", opaque, NULL},
4149
6.95k
    /* 186 */ {"Unassigned", opaque, NULL},
4150
6.95k
    /* 187 */ {"Unassigned", opaque, NULL},
4151
6.95k
    /* 188 */ {"Unassigned", opaque, NULL},
4152
6.95k
    /* 189 */ {"Unassigned", opaque, NULL},
4153
6.95k
    /* 190 */ {"LCM Workgroup", string, &hf_dhcp_option43_pxeclient_lcm_workgroup},
4154
6.95k
    /* 191 */ {"Discovery", val_boolean, &hf_dhcp_option43_pxeclient_discovery},
4155
6.95k
    /* 192 */ {"Configured", val_boolean, &hf_dhcp_option43_pxeclient_configured},
4156
6.95k
    /* 193 */ {"LCM Version", val_u_long, &hf_dhcp_option43_pxeclient_lcm_version},
4157
6.95k
    /* 194 */ {"LCM Serial Number", string, &hf_dhcp_option43_pxeclient_lcm_serial},
4158
    /* 255 {"PXE end options", special, &hf_dhcp_option43_pxeclient_end} */
4159
6.95k
  };
4160
4161
6.95k
  subopt = tvb_get_uint8(tvb, optoff);
4162
6.95k
  suboptoff++;
4163
4164
6.95k
  if (subopt == 0) {
4165
2.79k
    proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4166
2.79k
    return (suboptoff);
4167
4.15k
  } else if (subopt == 255) { /* End Option */
4168
7
    proto_tree_add_item(v_tree, hf_dhcp_option43_pxeclient_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4169
    /* Make sure we skip any junk left this option */
4170
7
    return (optend);
4171
7
  }
4172
4173
4.15k
  if (suboptoff >= optend) {
4174
8
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4175
8
                  "Suboption %d: no room left in option for suboption length", subopt);
4176
8
    return (optend);
4177
8
  }
4178
4179
4.14k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
4180
4.14k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_pxeclient_suboption,
4181
4.14k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4182
4.14k
        subopt, val_to_str_const(subopt, option43_pxeclient_suboption_vals, "Unknown"));
4183
4184
4.14k
  o43pxeclient_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4185
4.14k
  proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4186
4.14k
  suboptoff++;
4187
4188
4.14k
  ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4189
4.14k
  proto_item_set_hidden(ti);
4190
4191
4.14k
  if ((subopt < 1) || (subopt >= array_length(o43pxeclient_opt))) {
4192
305
    expert_add_info_format(pinfo, vti, &ei_dhcp_suboption_invalid, "Unknown suboption %d (%d bytes)", subopt, subopt_len);
4193
3.83k
  } else if (o43pxeclient_opt[subopt].ftype == special) {
4194
    /* I may need to decode that properly one day */
4195
1.46k
    if (o43pxeclient_opt[subopt].phf != NULL)
4196
142
      proto_tree_add_item(o43pxeclient_v_tree, *o43pxeclient_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4197
1.31k
    else {
4198
1.31k
      switch(subopt)
4199
1.31k
      {
4200
537
      case O43PXE_DISCOVERY:
4201
537
        proto_tree_add_bitmask(o43pxeclient_v_tree, tvb, suboptoff, hf_dhcp_option43_pxeclient_discovery_control,
4202
537
                  ett_dhcp_option43_suboption_discovery, o43pxe_discovery_hf_flags, ENC_BIG_ENDIAN);
4203
537
        break;
4204
181
      case O43PXE_BOOT_SERVER:
4205
181
        suboptoff_start = suboptoff;
4206
181
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_servers, tvb, suboptoff, subopt_len, ENC_NA);
4207
181
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4208
733
        while((suboptoff - suboptoff_start) < (unsigned)(subopt_len - 1)) {
4209
552
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4210
552
          suboptoff += 2;
4211
552
          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);
4212
552
          suboptoff += 1;
4213
2.21k
          while(boot_server_ip_count > 0) {
4214
1.66k
            proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_server_ip, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
4215
1.66k
            suboptoff += 4;
4216
1.66k
            boot_server_ip_count -=1;
4217
1.66k
          }
4218
552
        }
4219
181
        break;
4220
181
      case O43PXE_BOOT_MENU:
4221
181
        suboptoff_start = suboptoff;
4222
181
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_menu, tvb, suboptoff, subopt_len, ENC_NA);
4223
181
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4224
439
        while((suboptoff - suboptoff_start) < (unsigned)(subopt_len - 1)) {
4225
258
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4226
258
          suboptoff += 2;
4227
258
          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);
4228
258
          suboptoff += 1;
4229
258
          proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_menu_desc, tvb, suboptoff, boot_menu_length, ENC_ASCII);
4230
258
          suboptoff += boot_menu_length;
4231
258
        }
4232
181
        break;
4233
340
      case O43PXE_MENU_PROMPT:
4234
340
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_menu_prompt, tvb, suboptoff, subopt_len, ENC_NA);
4235
340
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4236
340
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_timeout, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4237
340
        suboptoff += 1;
4238
340
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_menu_prompt_prompt, tvb, suboptoff, subopt_len - 1, ENC_ASCII);
4239
340
        break;
4240
80
      case O43PXE_BOOT_ITEM:
4241
80
        ti = proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_pxeclient_boot_item, tvb, suboptoff, subopt_len, ENC_NA);
4242
80
        o43pxeclient_suboption_tree = proto_item_add_subtree(ti, ett_dhcp_option43_suboption_tree);
4243
80
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_type, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
4244
80
        suboptoff += 2;
4245
80
        proto_tree_add_item(o43pxeclient_suboption_tree, hf_dhcp_option43_pxeclient_boot_item_layer, tvb, suboptoff, 2, ENC_NA);
4246
80
        break;
4247
0
      default:
4248
0
        proto_tree_add_item(o43pxeclient_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4249
0
        break;
4250
1.31k
      }
4251
1.31k
    }
4252
2.37k
  } else {
4253
2.37k
    if (dhcp_handle_basic_types(pinfo, o43pxeclient_v_tree, vti, tvb, o43pxeclient_opt[subopt].ftype,
4254
2.37k
              suboptoff, subopt_len, o43pxeclient_opt[subopt].phf, &default_hfs) == 0)
4255
1.88k
    {
4256
1.88k
      expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4257
1.88k
    }
4258
2.37k
  }
4259
4260
4.11k
  optoff += (subopt_len + 2);
4261
4.11k
  return optoff;
4262
4.14k
}
4263
4264
static bool
4265
dissect_pxeclient_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4266
1.29k
{
4267
1.29k
  unsigned offset = 0;
4268
1.29k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4269
1.29k
  proto_tree* vendor_tree;
4270
4271
  /* PXE protocol 2.1 as described in the Intel specs */
4272
1.29k
  if ((option_data->vendor_class_id == NULL) ||
4273
880
    (strncmp((const char*)option_data->vendor_class_id, "PXEClient", strlen("PXEClient")) != 0))
4274
1.18k
    return false;
4275
4276
113
  proto_item_append_text(tree, " (PXEClient)");
4277
113
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4278
4279
7.06k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
4280
6.95k
    offset = dissect_vendor_pxeclient_suboption(pinfo, tree, vendor_tree,
4281
6.95k
      tvb, offset, tvb_reported_length(tvb));
4282
6.95k
  }
4283
4284
113
  return true;
4285
1.29k
}
4286
4287
static void
4288
dissect_vendor_avaya_param(proto_tree *tree, packet_info *pinfo, proto_item *vti,
4289
    tvbuff_t *tvb, unsigned optoff, wmem_strbuf_t *avaya_param_buf)
4290
11.7k
{
4291
11.7k
  const char *field;
4292
11.7k
  int len;
4293
4294
11.7k
  field = wmem_strbuf_get_str(avaya_param_buf);
4295
11.7k
  len = (int)wmem_strbuf_get_len(avaya_param_buf);
4296
4297
11.7k
  if((strncmp(field, "TLSSRVR=", 8) == 0) && ( len > 8 )) {
4298
61
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_tlssrvr, tvb, optoff, len, field + 8);
4299
61
  }
4300
11.6k
  else if((strncmp(field, "HTTPSRVR=", 9) == 0) && ( len > 9)) {
4301
48
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpsrvr, tvb, optoff, len, field + 9);
4302
48
  }
4303
11.6k
  else if((strncmp(field, "HTTPDIR=", 8) == 0) && ( len > 8)) {
4304
30
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_httpdir, tvb, optoff, len, field + 8);
4305
30
  }
4306
11.5k
  else if((strncmp(field, "STATIC=", 7) == 0) && ( len > 7)) {
4307
65
    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)"));
4308
65
  }
4309
11.5k
  else if((strncmp(field, "MCIPADD=", 8) == 0) && ( len > 8)) {
4310
80
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_mcipadd, tvb, optoff, len, field + 8);
4311
80
  }
4312
11.4k
  else if((strncmp(field, "DOT1X=", 6) == 0) && ( len > 6)) {
4313
57
    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)"));
4314
57
  }
4315
11.3k
  else if((strncmp(field, "ICMPDU=", 7) == 0) && ( len > 7)) {
4316
77
    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)"));
4317
77
  }
4318
11.3k
  else if((strncmp(field, "ICMPRED=", 8) == 0) && ( len > 8)) {
4319
55
    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)"));
4320
55
  }
4321
11.2k
  else if((strncmp(field, "L2Q=", 4) == 0) && ( len > 4)) {
4322
154
    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)"));
4323
154
  }
4324
11.1k
  else if((strncmp(field, "L2QVLAN=", 8) == 0) && ( len > 8)) {
4325
414
    int32_t val = -1;
4326
414
    bool val_valid;
4327
414
    proto_item* pi;
4328
4329
414
    val_valid = ws_strtoi32(field + 8, NULL, &val);
4330
414
    pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_l2qvlan, tvb, optoff, len, val);
4331
414
    if (val_valid)
4332
59
      expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_l2qvlan_invalid);
4333
414
  }
4334
10.6k
  else if((strncmp(field, "LOGLOCAL=", 9) == 0) && ( len > 9)) {
4335
52
    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)"));
4336
52
  }
4337
10.6k
  else if((strncmp(field, "PHY1STAT=", 9) == 0) && ( len > 9)) {
4338
48
    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)"));
4339
48
  }
4340
10.5k
  else if((strncmp(field, "PHY2STAT=", 9) == 0) && ( len > 9)) {
4341
50
    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)"));
4342
50
  }
4343
10.5k
  else if((strncmp(field, "PROCPSWD=", 9) == 0) && ( len > 9)) {
4344
56
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_procpswd, tvb, optoff, len, field + 9);
4345
56
  }
4346
10.4k
  else if((strncmp(field, "PROCSTAT=", 9) == 0) && ( len > 9)) {
4347
52
    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)"));
4348
52
  }
4349
10.4k
  else if((strncmp(field, "SNMPADD=", 8) == 0) && ( len > 8)) {
4350
57
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpadd, tvb, optoff, len, field + 8);
4351
57
  }
4352
10.3k
  else if((strncmp(field, "SNMPSTRING=", 11) == 0) && ( len > 11)) {
4353
56
    proto_tree_add_string(tree, hf_dhcp_option242_avaya_snmpstring, tvb, optoff, len, field + 11);
4354
56
  }
4355
10.3k
  else if((strncmp(field, "VLANTEST=", 9) == 0) && ( len > 9)) {
4356
684
    int32_t val = -1;
4357
684
    bool val_valid;
4358
684
    proto_item* pi;
4359
4360
684
    val_valid = ws_strtoi32(field + 9, NULL, &val);
4361
684
    pi = proto_tree_add_int(tree, hf_dhcp_option242_avaya_vlantest, tvb, optoff, len, val);
4362
684
    if (!val_valid)
4363
512
      expert_add_info(pinfo, pi, &ei_dhcp_option242_avaya_vlantest_invalid);
4364
684
  }
4365
9.63k
  else {
4366
9.63k
    expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, Unknown Avaya IP Telephone parameter %s", field);
4367
9.63k
  }
4368
11.7k
}
4369
4370
/* RFC3825Decoder:
4371
 *
4372
 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4373
 *
4374
 * The code is no longer available.
4375
 */
4376
static void
4377
rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint)
4378
29
{
4379
29
  fixpoint->latitude_res = (lci[0]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
4380
29
  if (lci[0] & 2) { /* LSB<<1 contains the sign of the latitude */
4381
    /* Latitude is negative, expand two's complement */
4382
4
    fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4383
4
             ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8)  |
4384
4
              (int64_t)lci[4] | ((int64_t)0x3FFFFFFF<<34);
4385
4386
25
  } else {
4387
    /* Latitude is positive */
4388
25
    fixpoint->latitude = (((int64_t)lci[0] & 3)<<32) | ((int64_t)lci[1]<<24) |
4389
25
             ((int64_t)lci[2]<<16) | ((int64_t)lci[3]<<8)  |
4390
25
              (int64_t)lci[4];
4391
25
  }
4392
29
  fixpoint->longitude_res = (lci[5]>>2) & 0x3F;  /* make sure that right-shift does not copy sign bit */
4393
29
  if (lci[5] & 2) { /* LSB<<1 contains the sign of the latitude */
4394
    /* Longitude is negative, expand two's complement */
4395
9
    fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4396
9
              ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8)  |
4397
9
               (int64_t)lci[9]   | ((int64_t)0x3FFFFFFF<<34);
4398
4399
20
  } else {
4400
    /* Longitude is positive */
4401
20
    fixpoint->longitude = (((int64_t)lci[5] & 3)<<32) | ((int64_t)lci[6]<<24) |
4402
20
              ((int64_t)lci[7]<<16) | ((int64_t)lci[8]<<8)  |
4403
20
               (int64_t)lci[9];
4404
20
  }
4405
29
  fixpoint->altitude_type = (lci[10]>>4) & 0x0F;  /* make sure that right-shift does not copy sign bit */
4406
29
  fixpoint->altitude_res  = ((lci[10] & 0x0F) << 2) | ((lci[11]>>6) & 0x03);
4407
29
  if (lci[11] & 0x20) { /* LSB<<1 contains the sign of the latitude */
4408
    /* Altitude is negative, expand two's complement */
4409
10
    fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4410
10
             ((int32_t)lci[13]<<8) | ((int32_t)lci[14]) |
4411
10
              ((int32_t)0x03<<30);
4412
4413
19
  } else {
4414
    /* Altitude is positive */
4415
19
    fixpoint->altitude = (((int32_t)lci[11] & 0x3F)<<24) | ((int32_t)lci[12]<<16) |
4416
19
             ((int32_t)lci[13]<<8) | ((int32_t)lci[14]);
4417
19
  }
4418
4419
29
  fixpoint->datum_type = lci[15];
4420
4421
29
}
4422
4423
/* RFC3825Decoder:
4424
 *
4425
 * https://web.archive.org/web/20100312054301/http://www.enum.at/rfc3825encoder.529.0.html
4426
 *
4427
 * The code is no longer available.
4428
 */
4429
static int
4430
rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal)
4431
29
{
4432
  /* Latitude */
4433
29
  decimal->latitude = (double) fixpoint->latitude / (1 << 25);
4434
29
  if ((decimal->latitude > 90) || (decimal->latitude < -90)) {
4435
3
    return RFC3825_LATITUDE_OUTOFRANGE;
4436
3
  }
4437
4438
  /* Latitude Uncertainty */
4439
26
  if (fixpoint->latitude_res > 34) {
4440
2
    return RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE;
4441
2
  }
4442
24
  if (fixpoint->latitude_res > 8 ) {
4443
5
    decimal->latitude_res = (double) 1  / (UINT64_C(1) << (fixpoint->latitude_res - 8));
4444
19
  } else {
4445
19
    decimal->latitude_res = (double) (UINT64_C(1) << (8 - fixpoint->latitude_res));
4446
19
  }
4447
4448
  /* Longitude */
4449
24
  decimal->longitude = (double) fixpoint->longitude / (1 << 25);
4450
24
  if ((decimal->longitude > 180) || (decimal->longitude < -180)) {
4451
2
    return RFC3825_LONGITUDE_OUTOFRANGE;
4452
2
  }
4453
4454
  /* Longitude Uncertainty */
4455
22
  if (fixpoint->longitude_res > 34) {
4456
2
    return RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE;
4457
2
  }
4458
20
  if (fixpoint->longitude_res > 8 ) {
4459
4
    decimal->longitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->longitude_res - 8));
4460
16
  } else {
4461
16
    decimal->longitude_res = (double) (UINT64_C(1) << (8 - fixpoint->longitude_res));
4462
16
  }
4463
4464
  /* Altitude Type */
4465
20
  decimal->altitude_type = fixpoint->altitude_type;
4466
20
  decimal->altitude = 0;
4467
20
  decimal->altitude_res = 0;
4468
4469
20
  if (decimal->altitude_type == 0) { /* Unknown */
4470
18
  } else if (decimal->altitude_type == 1) { /* Meters */
4471
    /* Altitude */
4472
12
    decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4473
12
    if ((decimal->altitude > ((int32_t) 1<<21)-1) || (decimal->altitude < ((int32_t) -(1<<21))))
4474
1
      return RFC3825_ALTITUDE_OUTOFRANGE;
4475
4476
    /* Altitude Uncertainty */
4477
11
    if (fixpoint->altitude_res > 30) {
4478
4
      return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4479
4
    }
4480
7
    if (fixpoint->altitude_res > 21 ) {
4481
2
      decimal->altitude_res = (double) 1 / (UINT64_C(1) << (fixpoint->altitude_res - 21));
4482
5
    } else {
4483
5
      decimal->altitude_res = (double) (UINT64_C(1) << (21 - fixpoint->altitude_res));
4484
5
    }
4485
7
  } else if (decimal->altitude_type == 2) { /* Floors */
4486
    /* Altitude */
4487
3
    if ((fixpoint->altitude_res != 30) && (fixpoint->altitude_res != 0)) {
4488
1
      return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
4489
1
    }
4490
2
    decimal->altitude = (double) fixpoint->altitude / (1 << 8);
4491
3
  } else { /* invalid type */
4492
3
    return RFC3825_ALTITUDE_TYPE_OUTOFRANGE;
4493
3
  }
4494
4495
  /* Datum Type */
4496
11
  decimal->datum_type = 0;
4497
11
  if ((fixpoint->datum_type > 3) || (fixpoint->datum_type < 1)) {
4498
9
    return RFC3825_DATUM_TYPE_OUTOFRANGE;
4499
9
  }
4500
2
  decimal->datum_type = fixpoint->datum_type;
4501
4502
2
  return RFC3825_NOERROR;
4503
11
}
4504
4505
static int
4506
dissect_dhcpopt_isns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
4507
205
{
4508
205
  static int * const isns_functions_hf_flags[] = {
4509
205
    &hf_dhcp_option_isns_functions_enabled,
4510
205
    &hf_dhcp_option_isns_functions_dd_authorization,
4511
205
    &hf_dhcp_option_isns_functions_sec_policy_distibution,
4512
205
    &hf_dhcp_option_isns_functions_reserved,
4513
205
    NULL
4514
205
  };
4515
4516
205
  static int * const isns_dda_hf_flags[] = {
4517
205
    &hf_dhcp_option_isns_discovery_domain_access_enabled,
4518
205
    &hf_dhcp_option_isns_discovery_domain_access_control_node,
4519
205
    &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
4520
205
    &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
4521
205
    &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
4522
205
    &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
4523
205
    &hf_dhcp_option_isns_discovery_domain_access_reserved,
4524
205
    NULL
4525
205
  };
4526
4527
205
  static int * const isns_administrative_flags[] = {
4528
205
    &hf_dhcp_option_isns_administrative_flags_enabled,
4529
205
    &hf_dhcp_option_isns_administrative_flags_heartbeat,
4530
205
    &hf_dhcp_option_isns_administrative_flags_management_scns,
4531
205
    &hf_dhcp_option_isns_administrative_flags_default_dd,
4532
205
    &hf_dhcp_option_isns_administrative_flags_reserved,
4533
205
    NULL
4534
205
  };
4535
4536
205
  static int * const isns_server_security_flags[] = {
4537
205
    &hf_dhcp_option_isns_server_security_bitmap_enabled,
4538
205
    &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
4539
205
    &hf_dhcp_option_isns_server_security_bitmap_main_mode,
4540
205
    &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
4541
205
    &hf_dhcp_option_isns_server_security_bitmap_pfs,
4542
205
    &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
4543
205
    &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
4544
205
    &hf_dhcp_option_isns_server_security_bitmap_reserved,
4545
205
    NULL
4546
205
  };
4547
4548
205
  uint16_t function_flags, dd_access_flags, administrative_flags;
4549
205
  uint32_t server_security_flags;
4550
205
  proto_tree *server_tree;
4551
205
  proto_item *item;
4552
205
  int length = tvb_reported_length(tvb);
4553
205
  unsigned offset = 0, heartbeat_set = 0;
4554
4555
205
  if (length < 14) {
4556
16
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 14");
4557
16
    return 1;
4558
16
  }
4559
4560
189
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_functions,
4561
189
              ett_dhcp_isns_functions, isns_functions_hf_flags, ENC_BIG_ENDIAN);
4562
189
  function_flags = tvb_get_ntohs(tvb, offset);
4563
  /* RFC 4174, section "2.1. iSNS Functions Field" specifies that if
4564
   * the field "Function Fields Enabled" is set to 0, then "the contents
4565
   * of all other iSNS Function fields MUST be ignored. We will display
4566
   * the fields but add an informational expert info. This goes for all
4567
   * the bitmasks: iSNS Functions, DD Access, Administrative Flags, iSNS
4568
   * Server Security Bitmap */
4569
189
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(function_flags, F_ISNS_FUNCTIONS_ENABLED))
4570
100
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4571
4572
189
  offset += 2;
4573
189
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_discovery_domain_access,
4574
189
              ett_dhcp_isns_discovery_domain_access, isns_dda_hf_flags, ENC_BIG_ENDIAN);
4575
189
  dd_access_flags = tvb_get_ntohs(tvb, offset);
4576
189
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(dd_access_flags, F_ISNS_DD_ACCESS_ENABLED))
4577
111
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4578
4579
189
  offset += 2;
4580
189
  administrative_flags = tvb_get_ntohs(tvb, offset);
4581
189
  if (administrative_flags & F_ISNS_ADMIN_FLAGS_ENABLED) {
4582
80
    if ((administrative_flags & F_ISNS_ADMIN_FLAGS_HEARTBEAT)) {
4583
47
      if (length < 18) {
4584
3
        expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length must be >= 18");
4585
3
        return offset;
4586
3
      }
4587
44
      heartbeat_set = 1;
4588
44
    }
4589
80
  }
4590
186
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_administrative_flags,
4591
186
              ett_dhcp_isns_administrative_flags, isns_administrative_flags, ENC_BIG_ENDIAN);
4592
186
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(administrative_flags, F_ISNS_ADMIN_FLAGS_ENABLED))
4593
93
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4594
4595
186
  offset += 2;
4596
186
  item = proto_tree_add_bitmask(tree, tvb, offset, hf_dhcp_option_isns_server_security_bitmap,
4597
186
              ett_dhcp_isns_server_security_bitmap, isns_server_security_flags, ENC_BIG_ENDIAN);
4598
186
  server_security_flags = tvb_get_ntohl(tvb, offset);
4599
186
  if (ISNS_BITFIELD_NZ_MUST_BE_IGNORED(server_security_flags, F_ISNS_SRV_SEC_BITMAP_ENABLED))
4600
113
    expert_add_info(pinfo, item, &ei_dhcp_option_isns_ignored_bitfield);
4601
4602
186
  offset += 4;
4603
186
  if (heartbeat_set) {
4604
44
    proto_tree_add_item(tree, hf_dhcp_option_isns_heartbeat_originator_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4605
44
    offset += 4;
4606
44
  }
4607
4608
186
  proto_tree_add_item(tree, hf_dhcp_option_isns_primary_server_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4609
4610
186
  offset += 4;
4611
186
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
4612
183
    server_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_dhcp_isns_secondary_server_addr,
4613
183
            &item, "Secondary iSNS Servers");
4614
183
    dhcp_handle_basic_types(pinfo, server_tree, item, tvb, ipv4_list, offset, tvb_reported_length_remaining(tvb, offset),
4615
183
               &hf_dhcp_option_isns_secondary_server_addr_list, NULL);
4616
183
  }
4617
4618
186
  return tvb_captured_length(tvb);
4619
189
}
4620
4621
static const value_string option43_cl_suboption_vals[] = {
4622
  {  0, "Padding" },
4623
  {  1, "Suboption Request List" },
4624
  {  2, "Device Type" },
4625
  {  3, "eSAFE Types" },
4626
  {  4, "Serial Number" },
4627
  {  5, "Hardware Version" },
4628
  {  6, "Software Version" },
4629
  {  7, "Boot ROM version" },
4630
  {  8, "Organizationally Unique Identifier" },
4631
  {  9, "Model Number" },
4632
  { 10, "Vendor Name" },
4633
  { 11, "Address Realm" },
4634
  { 12, "CM/PS System Description" },
4635
  { 13, "CM/PS Firmware Revision" },
4636
  { 14, "Firewall Policy File Version" },
4637
  { 15, "eSafe Config File Devices" },
4638
  { 18, "Video Security Type" },
4639
  { 31, "MTA MAC Address" },
4640
  { 32, "Correlation ID" },
4641
  { 51, "Vendor Name" },
4642
  { 52, "CableCARD Capability" },
4643
  { 53, "Device Identification (CA)" },
4644
  { 54, "Device Identification (X.509)" },
4645
  { 179, "LCM Server" },
4646
  { 180, "LCM Domain" },
4647
  { 181, "LCM NIC option 0" },
4648
  { 190, "LCM Workgroup" },
4649
  { 191, "Discovery" },
4650
  { 192, "HH Configured" },
4651
  { 193, "LCM Version" },
4652
  { 194, "LCM Serial Number" },
4653
  { 255, "CL End" },
4654
  { 0, NULL}
4655
};
4656
4657
static const value_string cablehome_subopt11_vals[] = {
4658
  { 1, "PS WAN-Man" },
4659
  { 2, "PS WAN-Data" },
4660
  { 0, NULL }
4661
};
4662
4663
static int
4664
dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4665
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
4666
5.13k
{
4667
5.13k
  unsigned    suboptoff = optoff;
4668
5.13k
  uint8_t     subopt;
4669
5.13k
  uint8_t     subopt_len;
4670
5.13k
  proto_tree *o43cl_v_tree;
4671
5.13k
  proto_item *vti;
4672
4673
5.13k
  static const struct basic_types_hfs default_hfs = {
4674
5.13k
    &hf_dhcp_option43_value,
4675
5.13k
    NULL,
4676
5.13k
    NULL,
4677
5.13k
    &hf_dhcp_option43_value_stringz,
4678
5.13k
    NULL,
4679
5.13k
    &hf_dhcp_option43_value_8,
4680
5.13k
    NULL,
4681
5.13k
    NULL,
4682
5.13k
    &hf_dhcp_option43_value_32,
4683
5.13k
    NULL,
4684
5.13k
    NULL
4685
5.13k
  };
4686
4687
5.13k
  static const struct opt_info o43cablelabs_opt[]= {
4688
5.13k
    /*  0 */ {"nop", special, &hf_dhcp_option43_cl_padding},  /* dummy */
4689
5.13k
    /*  1 */ {"Suboption Request List", string, &hf_dhcp_option43_cl_suboption_request_list},
4690
5.13k
    /*  2 */ {"Device Type", string, &hf_dhcp_option43_cl_device_type},
4691
5.13k
    /*  3 */ {"eSAFE Types", string, &hf_dhcp_option43_cl_esafe_type},
4692
5.13k
    /*  4 */ {"Serial Number", string, &hf_dhcp_option43_cl_serial_number},
4693
5.13k
    /*  5 */ {"Hardware Version", string, &hf_dhcp_option43_cl_hardware_version},
4694
5.13k
    /*  6 */ {"Software Version", string, &hf_dhcp_option43_cl_software_version},
4695
5.13k
    /*  7 */ {"Boot ROM version", string, &hf_dhcp_option43_cl_boot_rom_version},
4696
5.13k
    /*  8 */ {"Organizationally Unique Identifier", special, &hf_dhcp_option43_cl_oui_bytes},
4697
5.13k
    /*  9 */ {"Model Number", string, &hf_dhcp_option43_cl_model_number},
4698
5.13k
    /* 10 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name10},
4699
    /* *** 11-30: CableHome *** */
4700
5.13k
    /* 11 */ {"Address Realm", val_u_byte, &hf_dhcp_option43_cl_address_realm},
4701
5.13k
    /* 12 */ {"CM/PS System Description", string, &hf_dhcp_option43_cl_cm_ps_system_desc},
4702
5.13k
    /* 13 */ {"CM/PS Firmware Revision", string, &hf_dhcp_option43_cl_cm_ps_firmware_revision},
4703
5.13k
    /* 14 */ {"Firewall Policy File Version", string, &hf_dhcp_option43_cl_firewall_policy_file_version},
4704
5.13k
    /* 15 */ {"eSafe Config File Devices", string, &hf_dhcp_option43_cl_esafe_config_file_devices},
4705
5.13k
    /* 16 */ {"Unassigned (CableHome)", special, NULL},
4706
5.13k
    /* 17 */ {"Unassigned (CableHome)", special, NULL},
4707
5.13k
    /* 18 */ {"Video Security Type", string, &hf_dhcp_option43_cl_video_security_tape},
4708
5.13k
    /* 19 */ {"Unassigned (CableHome)", special, NULL},
4709
5.13k
    /* 20 */ {"Unassigned (CableHome)", special, NULL},
4710
5.13k
    /* 21 */ {"Unassigned (CableHome)", special, NULL},
4711
5.13k
    /* 22 */ {"Unassigned (CableHome)", special, NULL},
4712
5.13k
    /* 23 */ {"Unassigned (CableHome)", special, NULL},
4713
5.13k
    /* 24 */ {"Unassigned (CableHome)", special, NULL},
4714
5.13k
    /* 25 */ {"Unassigned (CableHome)", special, NULL},
4715
5.13k
    /* 26 */ {"Unassigned (CableHome)", special, NULL},
4716
5.13k
    /* 27 */ {"Unassigned (CableHome)", special, NULL},
4717
5.13k
    /* 28 */ {"Unassigned (CableHome)", special, NULL},
4718
5.13k
    /* 29 */ {"Unassigned (CableHome)", special, NULL},
4719
5.13k
    /* 30 */ {"Unassigned (CableHome)", special, NULL},
4720
    /* *** 31-50: PacketCable *** */
4721
5.13k
    /* 31 */ {"MTA MAC Address", special, &hf_dhcp_option43_cl_mta_mac_address},
4722
5.13k
    /* 32 */ {"Correlation ID", val_u_long, &hf_dhcp_option43_cl_correlation_ID},
4723
5.13k
    /* 33 */ {"Unassigned (PacketCable)", special, NULL},
4724
5.13k
    /* 34 */ {"Unassigned (PacketCable)", special, NULL},
4725
5.13k
    /* 35 */ {"Unassigned (PacketCable)", special, NULL},
4726
5.13k
    /* 36 */ {"Unassigned (PacketCable)", special, NULL},
4727
5.13k
    /* 37 */ {"Unassigned (PacketCable)", special, NULL},
4728
5.13k
    /* 38 */ {"Unassigned (PacketCable)", special, NULL},
4729
5.13k
    /* 39 */ {"Unassigned (PacketCable)", special, NULL},
4730
5.13k
    /* 40 */ {"Unassigned (PacketCable)", special, NULL},
4731
5.13k
    /* 41 */ {"Unassigned (PacketCable)", special, NULL},
4732
5.13k
    /* 42 */ {"Unassigned (PacketCable)", special, NULL},
4733
5.13k
    /* 43 */ {"Unassigned (PacketCable)", special, NULL},
4734
5.13k
    /* 44 */ {"Unassigned (PacketCable)", special, NULL},
4735
5.13k
    /* 45 */ {"Unassigned (PacketCable)", special, NULL},
4736
5.13k
    /* 46 */ {"Unassigned (PacketCable)", special, NULL},
4737
5.13k
    /* 47 */ {"Unassigned (PacketCable)", special, NULL},
4738
5.13k
    /* 48 */ {"Unassigned (PacketCable)", special, NULL},
4739
5.13k
    /* 49 */ {"Unassigned (PacketCable)", special, NULL},
4740
5.13k
    /* 50 */ {"Unassigned (PacketCable)", special, NULL},
4741
    /* *** 51-127: CableLabs *** */
4742
5.13k
    /* 51 */ {"Vendor Name", string, &hf_dhcp_option43_cl_vendor_name51},
4743
5.13k
    /* 52 */ {"CableCARD Capability", special, &hf_dhcp_option43_cl_cablecard_capability},
4744
5.13k
    /* 53 */ {"Device Identification (CA)", special, &hf_dhcp_option43_cl_device_id_ca},
4745
5.13k
    /* 54 */ {"Device Identification (X.509)", string, &hf_dhcp_option43_cl_device_id_x509},
4746
5.13k
    /* 55 */ {"Unassigned (CableLabs)", special, NULL},
4747
    /* *** 128-254: Vendors *** */
4748
    /* 128-254 {"Unassigned (Vendors)", special, NULL}, */
4749
    /* 255 {"end options", special, &hf_dhcp_option43_cl_end} */
4750
5.13k
  };
4751
4752
5.13k
  subopt = tvb_get_uint8(tvb, optoff);
4753
5.13k
  suboptoff++;
4754
4755
5.13k
  if (subopt == 0) {
4756
1.64k
    proto_tree_add_item(v_tree, hf_dhcp_option43_cl_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
4757
1.64k
    return (suboptoff);
4758
3.48k
  } else if (subopt == 255) { /* End Option */
4759
3
    proto_tree_add_item(v_tree, hf_dhcp_option43_cl_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
4760
    /* Make sure we skip any junk left this option */
4761
3
    return (optend);
4762
3
  }
4763
4764
3.48k
  if (suboptoff >= optend) {
4765
10
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4766
10
                  "Suboption %d: no room left in option for suboption length", subopt);
4767
10
    return (optend);
4768
10
  }
4769
4770
3.47k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
4771
3.47k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cl_suboption,
4772
3.47k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
4773
3.47k
        subopt, val_to_str_const(subopt, option43_cl_suboption_vals, "Unknown"));
4774
4775
3.47k
  o43cl_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4776
3.47k
  proto_tree_add_item(o43cl_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4777
3.47k
  suboptoff++;
4778
4779
3.47k
  if (suboptoff+subopt_len > optend) {
4780
79
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4781
79
            "Suboption %d: no room left in option for suboption value", subopt);
4782
79
    return (optend);
4783
79
  }
4784
4785
3.39k
  if ( (subopt < 1 ) || (subopt >= array_length(o43cablelabs_opt)) ) {
4786
522
    proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4787
2.87k
  } else if (o43cablelabs_opt[subopt].ftype == special) {
4788
1.48k
    switch(subopt)
4789
1.48k
    {
4790
520
    case 8:/* OUI */
4791
      /* CableLabs specs treat 43.8 inconsistently
4792
       * as either binary (3b) or string (6b) */
4793
520
      if (subopt_len == 3) {
4794
77
        proto_tree_add_bytes_format_value(o43cl_v_tree, hf_dhcp_option43_cl_oui_bytes, tvb, suboptoff, subopt_len, NULL,
4795
77
          "%02x:%02x:%02x", tvb_get_uint8(tvb, suboptoff), tvb_get_uint8(tvb, suboptoff+1), tvb_get_uint8(tvb, suboptoff+2));
4796
443
      } else if (subopt_len == 6) {
4797
82
        proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_oui_string, tvb, suboptoff, subopt_len, ENC_ASCII);
4798
361
      } else {
4799
361
        expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 3 or 6");
4800
361
      }
4801
520
      break;
4802
168
    case 31: /* MTA MAC address */
4803
168
      if (subopt_len != 6) {
4804
96
        expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 6");
4805
96
        break;
4806
96
      }
4807
4808
72
      proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_cl_mta_mac_address, tvb, suboptoff, 6, ENC_NA);
4809
72
      break;
4810
801
    default:
4811
801
      if (o43cablelabs_opt[subopt].phf != NULL)
4812
295
        proto_tree_add_item(o43cl_v_tree, *o43cablelabs_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
4813
506
      else
4814
506
        proto_tree_add_item(o43cl_v_tree, hf_dhcp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
4815
1.48k
    }
4816
1.48k
  }
4817
1.38k
  else {
4818
1.38k
    if (dhcp_handle_basic_types(pinfo, o43cl_v_tree, vti, tvb, o43cablelabs_opt[subopt].ftype,
4819
1.38k
              suboptoff, subopt_len, o43cablelabs_opt[subopt].phf, &default_hfs) == 0) {
4820
754
      expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
4821
754
    }
4822
1.38k
  }
4823
4824
3.39k
  optoff += (subopt_len + 2);
4825
3.39k
  return optoff;
4826
3.39k
}
4827
4828
static bool
4829
dissect_cablelabs_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4830
1.42k
{
4831
1.42k
  unsigned offset = 0;
4832
1.42k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4833
1.42k
  proto_tree* vendor_tree;
4834
4835
  /* Vendor Class IDs
4836
   * DOCSIS - docsis
4837
   * CableHome - CableHome
4838
   * OpenCable2.0 - OpenCable2.0
4839
   * PacketCable - pktc
4840
   * DEMARC - DEMARC
4841
   * sRouter - SROUTER
4842
   * Remote PHY - RPD
4843
   * eDOCSIS - PTA or ECM
4844
   * OpenCable TRIF - TR
4845
   */
4846
4847
1.42k
  if ((option_data->vendor_class_id != NULL) &&
4848
989
    ((strncmp((const char*)option_data->vendor_class_id, "pktc", strlen("pktc")) == 0) ||
4849
949
     (strncmp((const char*)option_data->vendor_class_id, "docsis", strlen("docsis")) == 0) ||
4850
909
     (strncmp((const char*)option_data->vendor_class_id, "OpenCable2.0", strlen("OpenCable2.0")) == 0) ||
4851
907
     (strncmp((const char*)option_data->vendor_class_id, "CableHome", strlen("CableHome")) == 0) ||
4852
902
     (strncmp((const char*)option_data->vendor_class_id, "RPD", strlen("RPD")) == 0) ||
4853
897
     (strncmp((const char*)option_data->vendor_class_id, "RMD", strlen("RMD")) == 0) ||
4854
893
     (strncmp((const char*)option_data->vendor_class_id, "ECM", strlen("ECM")) == 0) ||
4855
890
     (strncmp((const char*)option_data->vendor_class_id, "PTA", strlen("PTA")) == 0) ||
4856
888
     (strncmp((const char*)option_data->vendor_class_id, "DEMARC", strlen("DEMARC")) == 0) ||
4857
883
     (strncmp((const char*)option_data->vendor_class_id, "TR", strlen("TR")) == 0) ||
4858
875
     (strncmp((const char*)option_data->vendor_class_id, "SROUTER", strlen("SROUTER")) == 0))) {
4859
    /* CableLabs standard - see www.cablelabs.com/projects */
4860
116
    proto_item_append_text(tree, " (CableLabs)");
4861
116
    vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4862
4863
5.24k
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
4864
5.13k
      offset = dissect_vendor_cablelabs_suboption(pinfo, tree, vendor_tree,
4865
5.13k
        tvb, offset, tvb_reported_length(tvb));
4866
5.13k
    }
4867
116
    return true;
4868
116
  }
4869
4870
1.30k
  return false;
4871
1.42k
}
4872
4873
static bool
4874
dissect_aruba_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4875
1.07k
{
4876
1.07k
  unsigned offset = 0;
4877
1.07k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4878
1.07k
  proto_tree* vendor_tree;
4879
4880
1.07k
  if ((option_data->vendor_class_id == NULL) ||
4881
675
    (strncmp((const char*)option_data->vendor_class_id, ARUBA_AP, strlen(ARUBA_AP)) != 0))
4882
1.07k
    return false;
4883
4884
1
  proto_item_append_text(tree, " (Aruba AP)");
4885
1
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
4886
4887
1
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaap_controllerip, tvb, offset, tvb_reported_length(tvb), ENC_ASCII);
4888
1
  return true;
4889
1.07k
}
4890
4891
static bool
4892
dissect_aruba_instant_ap_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
4893
1.12k
{
4894
1.12k
  unsigned offset = 0;
4895
1.12k
  unsigned reported_len = tvb_reported_length(tvb);
4896
1.12k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
4897
1.12k
  proto_tree* vendor_tree;
4898
1.12k
  proto_item* vendor_item;
4899
1.12k
  uint32_t nameorglen, ampiplen;
4900
4901
  /* Aruba  Instant AP */
4902
1.12k
  if ((option_data->vendor_class_id == NULL) ||
4903
715
    (strncmp((const char*)option_data->vendor_class_id, ARUBA_INSTANT_AP, strlen(ARUBA_INSTANT_AP)) != 0))
4904
1.10k
    return false;
4905
4906
14
  proto_item_append_text(tree, " (Aruba Instant AP)");
4907
4908
14
  vendor_item = proto_tree_add_item(tree, hf_dhcp_option43_arubaiap, tvb, offset, reported_len, ENC_ASCII);
4909
14
  vendor_tree = proto_item_add_subtree(vendor_item, ett_dhcp_option43_suboption);
4910
14
  tvb_find_uint8_length(tvb, offset, tvb_reported_length(tvb), ',', &nameorglen);
4911
14
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_nameorg, tvb, offset, nameorglen, ENC_ASCII);
4912
14
  offset += (nameorglen+1);
4913
14
  tvb_find_uint8_length(tvb, offset, reported_len - nameorglen - 1, ',', &ampiplen);
4914
14
  ampiplen = ampiplen -offset;
4915
14
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_ampip, tvb, offset, ampiplen, ENC_ASCII);
4916
14
  offset += (ampiplen+1);
4917
14
  proto_tree_add_item(vendor_tree, hf_dhcp_option43_arubaiap_password, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII);
4918
4919
14
  return true;
4920
1.12k
}
4921
4922
static const value_string option43_bsdp_suboption_vals[] = {
4923
  {  0, "Pad" },
4924
  {  1, "Message Type" },
4925
  {  2, "Version" },
4926
  {  3, "Server Identifier" },
4927
  {  4, "Server Priority" },
4928
  {  5, "Reply Port" },
4929
  {  6, "Boot Image List Path" },
4930
  {  7, "Default Boot Image" },
4931
  {  8, "Selected Boot Image" },
4932
  {  9, "Boot Image List" },
4933
  { 10, "NetBoot 1.0 Firmware" },
4934
  { 11, "Boot Image Attributes Filter List" },
4935
  { 12, "Maximum Message Size" },
4936
  { 255, "End" },
4937
  { 0, NULL}
4938
};
4939
4940
static void
4941
dissect_vendor_bsdp_boot_image(proto_tree *v_tree, tvbuff_t *tvb, unsigned optoff)
4942
1.97k
{
4943
1.97k
  static int * const dhcp_o43_bsdp_attributes_flags[] = {
4944
1.97k
    &hf_dhcp_option43_bsdp_boot_image_attribute_install,
4945
1.97k
    &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
4946
1.97k
    &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
4947
1.97k
    NULL
4948
1.97k
  };
4949
4950
1.97k
  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);
4951
1.97k
}
4952
4953
static unsigned
4954
dissect_vendor_bsdp_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4955
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
4956
7.23k
{
4957
7.23k
  unsigned    suboptoff = optoff;
4958
7.23k
  unsigned    attributes_off;
4959
7.23k
  uint8_t     subopt, string_len;
4960
7.23k
  uint8_t     subopt_len, attributes_len;
4961
7.23k
  unsigned    item_len;
4962
7.23k
  proto_tree *o43bsdp_v_tree, *o43bsdp_va_tree, *o43bsdp_vb_tree, *o43bsdp_vc_tree, *o43bsdp_vd_tree;
4963
7.23k
  proto_item *vti, *ti, *tj;
4964
4965
7.23k
  subopt = tvb_get_uint8(tvb, optoff);
4966
7.23k
  suboptoff++;
4967
4968
7.23k
  if (subopt == 0 || subopt == 255) {
4969
    /* Pad (0) and End (255) have implicit length of 1. */
4970
2.74k
    item_len = 1;
4971
4.48k
  } else if (suboptoff >= optend) {
4972
14
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
4973
14
                  "Suboption %d: no room left in option for suboption length", subopt);
4974
14
    return (optend);
4975
4.46k
  } else {
4976
4.46k
    subopt_len = tvb_get_uint8(tvb, suboptoff);
4977
4.46k
    item_len = subopt_len + 2;
4978
4.46k
  }
4979
4980
7.21k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_bsdp_suboption,
4981
7.21k
        tvb, optoff, item_len, subopt, "(%d) %s",
4982
7.21k
        subopt, val_to_str_const(subopt, option43_bsdp_suboption_vals, "Unknown"));
4983
7.21k
  if (item_len == 1) {
4984
2.74k
    return (optoff + 1);
4985
2.74k
  }
4986
4987
4.46k
  o43bsdp_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
4988
4.46k
  proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
4989
4.46k
  suboptoff++;
4990
4991
4.46k
  if (suboptoff+subopt_len > optend) {
4992
83
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
4993
83
            "Suboption %d: no room left in option for suboption value", subopt);
4994
83
    return (optend);
4995
83
  }
4996
4997
4.38k
  switch(subopt)
4998
4.38k
  {
4999
312
    case 1:
5000
312
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_type, tvb, suboptoff, subopt_len, ENC_NA);
5001
312
      break;
5002
291
    case 2:
5003
291
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_version, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5004
291
      break;
5005
314
    case 3:
5006
314
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_identifier, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5007
314
      break;
5008
447
    case 4:
5009
447
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_server_priority, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5010
447
      break;
5011
142
    case 5:
5012
142
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_reply_port, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5013
142
      break;
5014
416
    case 6:
5015
416
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list_path, tvb, suboptoff, subopt_len, ENC_ASCII);
5016
416
      break;
5017
116
    case 7:
5018
116
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_default_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5019
116
      o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
5020
116
      dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, suboptoff);
5021
116
      proto_tree_add_item(o43bsdp_va_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN);
5022
116
      break;
5023
100
    case 8:
5024
100
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_selected_boot_image_id, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5025
100
      o43bsdp_vc_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_boot_image);
5026
100
      dissect_vendor_bsdp_boot_image(o43bsdp_vc_tree, tvb, suboptoff);
5027
100
      proto_tree_add_item(o43bsdp_vc_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, suboptoff+2, subopt_len-2, ENC_BIG_ENDIAN);
5028
100
      break;
5029
422
    case 9:
5030
422
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_boot_image_list, tvb, suboptoff, subopt_len, ENC_NA);
5031
422
      attributes_len = subopt_len;
5032
422
      attributes_off = suboptoff;
5033
422
      o43bsdp_vd_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_image_desc_list);
5034
1.14k
      while (attributes_len >= 5) {
5035
720
        string_len = tvb_get_uint8(tvb, attributes_off+4);
5036
720
        if (string_len > 0) {
5037
334
          tj = proto_tree_add_item(o43bsdp_vd_tree, hf_dhcp_option43_bsdp_image_desc, tvb, attributes_off, string_len+5, ENC_NA);
5038
334
          o43bsdp_vb_tree = proto_item_add_subtree(tj, ett_dhcp_o43_bsdp_image_desc);
5039
334
          dissect_vendor_bsdp_boot_image(o43bsdp_vb_tree, tvb, attributes_off);
5040
334
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_index, tvb, attributes_off+2, 2, ENC_BIG_ENDIAN);
5041
334
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name_len, tvb, attributes_off+4, 1, ENC_BIG_ENDIAN);
5042
334
          proto_tree_add_item(o43bsdp_vb_tree, hf_dhcp_option43_bsdp_boot_image_name, tvb, attributes_off+5, string_len, ENC_UTF_8);
5043
334
        }
5044
720
        attributes_off += 5 + string_len;
5045
720
        attributes_len -= 5 + string_len;
5046
720
      }
5047
422
      break;
5048
438
    case 10:
5049
438
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_netboot_firmware, tvb, suboptoff, subopt_len, ENC_NA);
5050
438
      break;
5051
218
    case 11:
5052
218
      ti = proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_attributes_filter_list, tvb, suboptoff, subopt_len, ENC_NA);
5053
218
      attributes_len = subopt_len;
5054
218
      attributes_off = suboptoff;
5055
218
      o43bsdp_va_tree = proto_item_add_subtree(ti, ett_dhcp_o43_bsdp_attributes);
5056
1.65k
      while (attributes_len >= 2) {
5057
1.43k
        dissect_vendor_bsdp_boot_image(o43bsdp_va_tree, tvb, attributes_off);
5058
1.43k
        attributes_off+=2;
5059
1.43k
        attributes_len-=2;
5060
1.43k
      }
5061
218
      break;
5062
152
    case 12:
5063
152
      proto_tree_add_item(o43bsdp_v_tree, hf_dhcp_option43_bsdp_message_size, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5064
152
      break;
5065
4.38k
  }
5066
5067
4.36k
  optoff += item_len;
5068
4.36k
  return optoff;
5069
4.38k
}
5070
5071
static bool
5072
dissect_apple_bsdp_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5073
1.42k
{
5074
1.42k
  unsigned offset = 0;
5075
1.42k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5076
1.42k
  proto_tree* vendor_tree;
5077
5078
1.42k
  if ((option_data->vendor_class_id == NULL) ||
5079
989
    (strncmp((const char*)option_data->vendor_class_id, APPLE_BSDP_SERVER, strlen(APPLE_BSDP_SERVER)) != 0))
5080
1.29k
    return false;
5081
5082
  /* Apple BSDP */
5083
132
  proto_item_append_text(tree, " (Boot Server Discovery Protocol (BSDP))");
5084
132
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5085
5086
7.36k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5087
7.23k
    offset = dissect_vendor_bsdp_suboption(pinfo, tree, vendor_tree,
5088
7.23k
      tvb, offset, tvb_reported_length(tvb));
5089
7.23k
  }
5090
5091
132
  return true;
5092
1.42k
}
5093
5094
/* Cisco Vendor Specific Information */
5095
5096
/*
5097
        {  1, "1" },            * D,R: 03 *
5098
        {  2, "2" },            * D,R: 01 *
5099
        {  3, "3" },            * D,R: 00 01 # O,A: 00 02 *
5100
        {  4, "Node ID" },      * O,A: 00 00 00 ca *
5101
        {  5, "5" },            * O,A: 01 *
5102
        {  6, "6" },            * D,R: 01 # O,A: 01 *
5103
        {  7, "Model" },        * D,R: N9K-C9336PQ *
5104
        {  8, "APIC UUID" },    * O,A: 09bced36-69f1-11e6-96ce-8baf09371338 *
5105
        {  9, "Fabricname" },   * O,A: ams-fab1 *
5106
        { 10, "10" },           * D,R: 00 00 00 01 *
5107
        { 11, "SerialNo" },     * D,R: SAL1926J4QW *
5108
        { 12, "Client Int" },   * D,O: eth1/20.20 # R,A: eth1/20.20 *
5109
*/
5110
static const value_string option43_cisco_suboption_vals[] = {
5111
  {  1, "Unk-1 (Node role?)" },   /* uint8 */
5112
  {  2, "Unk-2 (Spine level?)" },   /* uint8 */
5113
  {  3, "Unk-3 (Pod ID?)" },    /* uint16 */
5114
  {  4, "Node ID" },      /* uint32 */
5115
  {  5, "Unk-5" },      /* uint8 */
5116
  {  6, "Unk-6" },      /* uint8 */
5117
  {  7, "Model" },      /* String */
5118
  {  8, "APIC UUID" },      /* String */
5119
  {  9, "Fabricname" },     /* String */
5120
  { 10, "Unk-10" },     /* uint32 */
5121
  { 11, "SerialNo" },     /* String */
5122
  { 12, "Interfacename" },    /* String */
5123
5124
  { 0, NULL}
5125
};
5126
5127
static unsigned
5128
dissect_vendor_cisco_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5129
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5130
661
{
5131
661
  unsigned    suboptoff = optoff;
5132
661
  uint8_t     subopt;
5133
661
  uint8_t     subopt_len;
5134
661
  unsigned    item_len;
5135
661
  proto_tree *o43cisco_v_tree;
5136
661
  proto_item *vti;
5137
5138
661
  subopt = tvb_get_uint8(tvb, optoff);
5139
661
  suboptoff++;
5140
5141
661
  if (suboptoff >= optend) {
5142
3
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5143
3
                  "Suboption %d: No room left in option for suboption length", subopt);
5144
3
    return (optend);
5145
658
  } else {
5146
658
    subopt_len = tvb_get_uint8(tvb, suboptoff);
5147
658
    item_len = subopt_len + 2;
5148
658
  }
5149
5150
658
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_cisco_suboption,
5151
658
        tvb, optoff, item_len, subopt, "(%d) %s",
5152
658
        subopt, val_to_str_const(subopt, option43_cisco_suboption_vals, "Unknown"));
5153
5154
658
  o43cisco_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5155
658
  proto_tree_add_item(o43cisco_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5156
658
  suboptoff++;
5157
5158
658
  if (suboptoff+subopt_len > optend) {
5159
14
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5160
14
            "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5161
14
    return (optend);
5162
14
  }
5163
5164
644
  switch(subopt)
5165
644
  {
5166
6
    case 1:
5167
6
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown1, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5168
6
      break;
5169
6
    case 2:
5170
6
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown2, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5171
6
      break;
5172
6
    case 3:
5173
6
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown3, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5174
6
      break;
5175
146
    case 4:
5176
146
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_nodeid, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5177
146
      break;
5178
8
    case 5:
5179
8
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown5, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5180
8
      break;
5181
21
    case 6:
5182
21
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown6, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5183
21
      break;
5184
2
    case 7:
5185
2
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_model, tvb, suboptoff, subopt_len, ENC_ASCII);
5186
2
      break;
5187
29
    case 8:
5188
29
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_apicuuid, tvb, suboptoff, subopt_len, ENC_ASCII);
5189
29
      break;
5190
12
    case 9:
5191
12
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_fabricname, tvb, suboptoff, subopt_len, ENC_ASCII);
5192
12
      break;
5193
2
    case 10:
5194
2
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown10, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5195
2
      break;
5196
1
    case 11:
5197
1
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_serialno, tvb, suboptoff, subopt_len, ENC_ASCII);
5198
1
      break;
5199
5
    case 12:
5200
5
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_clientint, tvb, suboptoff, subopt_len, ENC_ASCII);
5201
5
      break;
5202
400
    default:
5203
400
      proto_tree_add_item(o43cisco_v_tree, hf_dhcp_option43_cisco_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5204
644
  }
5205
5206
644
  optoff += item_len;
5207
644
  return optoff;
5208
644
}
5209
5210
static bool
5211
dissect_cisco_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5212
1.22k
{
5213
1.22k
  unsigned offset = 0;
5214
1.22k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5215
1.22k
  proto_tree* vendor_tree;
5216
5217
1.22k
  if ((option_data->vendor_class_id == NULL) ||
5218
807
    (strncmp((const char*)option_data->vendor_class_id, CISCO_VCID, strlen(CISCO_VCID)) != 0))
5219
1.20k
    return false;
5220
5221
  /* Cisco ACI Fabric*/
5222
21
  proto_item_append_text(tree, " (Cisco ACI Fabric)");
5223
21
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5224
5225
682
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5226
661
    offset = dissect_vendor_cisco_suboption(pinfo, tree, vendor_tree,
5227
661
      tvb, offset, tvb_reported_length(tvb));
5228
661
  }
5229
5230
21
  return true;
5231
1.22k
}
5232
5233
/* Aerohive (Extremenetworks) Vendor Specific Information */
5234
5235
static const value_string option43_aerohive_suboption_vals[] = {
5236
  {  225, "XiqHostname" },  /* String */
5237
  {  226, "XiqIpAddress" }, /* Ipv4address */
5238
5239
  { 0, NULL}
5240
};
5241
5242
static unsigned
5243
dissect_vendor_aerohive_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5244
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5245
389
{
5246
389
  unsigned    suboptoff = optoff;
5247
389
  uint8_t     subopt;
5248
389
  uint8_t     subopt_len;
5249
389
  unsigned    item_len;
5250
389
  proto_tree *o43aerohive_v_tree;
5251
389
  proto_item *vti;
5252
5253
389
  subopt = tvb_get_uint8(tvb, optoff);
5254
389
  suboptoff++;
5255
5256
389
  if (suboptoff >= optend) {
5257
1
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5258
1
                  "Suboption %d: No room left in option for suboption length", subopt);
5259
1
    return (optend);
5260
388
  } else {
5261
388
    subopt_len = tvb_get_uint8(tvb, suboptoff);
5262
388
    item_len = subopt_len + 2;
5263
388
  }
5264
5265
388
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_aerohive_suboption,
5266
388
        tvb, optoff, item_len, subopt, "(%d) %s",
5267
388
        subopt, val_to_str_const(subopt, option43_aerohive_suboption_vals, "Unknown"));
5268
5269
388
  o43aerohive_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5270
388
  proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5271
388
  suboptoff++;
5272
5273
388
  if (suboptoff+subopt_len > optend) {
5274
16
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5275
16
            "Suboption %d: Not sufficient room left in option for suboption value", subopt);
5276
16
    return (optend);
5277
16
  }
5278
5279
372
  switch(subopt)
5280
372
  {
5281
1
    case 225:
5282
1
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqhostname, tvb, suboptoff, subopt_len, ENC_ASCII);
5283
1
      break;
5284
1
    case 226:
5285
1
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_xiqipaddress, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
5286
1
      break;
5287
370
    default:
5288
370
      proto_tree_add_item(o43aerohive_v_tree, hf_dhcp_option43_aerohive_unknown, tvb, suboptoff, subopt_len, ENC_NA);
5289
372
  }
5290
5291
372
  optoff += item_len;
5292
372
  return optoff;
5293
372
}
5294
5295
static bool
5296
dissect_aerohive_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5297
1.21k
{
5298
1.21k
  unsigned offset = 0;
5299
1.21k
  dhcp_option_data_t *option_data = (dhcp_option_data_t*)data;
5300
1.21k
  proto_tree* vendor_tree;
5301
5302
1.21k
  if ((option_data->vendor_class_id == NULL) ||
5303
797
    (strncmp((const char*)option_data->vendor_class_id, AEROHIVE_VCID, strlen(AEROHIVE_VCID)) != 0))
5304
1.19k
    return false;
5305
5306
  /* Cisco ACI Fabric*/
5307
20
  proto_item_append_text(tree, " (Aerohive)");
5308
20
  vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5309
5310
409
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5311
389
    offset = dissect_vendor_aerohive_suboption(pinfo, tree, vendor_tree,
5312
389
      tvb, offset, tvb_reported_length(tvb));
5313
389
  }
5314
5315
20
  return true;
5316
1.21k
}
5317
5318
static unsigned
5319
dissect_vendor_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5320
         tvbuff_t *tvb, uint32_t optoff, uint32_t optend)
5321
819
{
5322
819
  uint32_t    suboptoff = optoff;
5323
819
  uint8_t     subopt;
5324
819
  uint32_t    subopt_len;
5325
819
  proto_item *item;
5326
819
  proto_tree *sub_tree;
5327
5328
819
  item = proto_tree_add_item(v_tree, hf_dhcp_vendor_unknown_suboption, tvb, optoff, 1, ENC_NA);
5329
819
  subopt = tvb_get_uint8(tvb, optoff);
5330
5331
819
  suboptoff+=1;
5332
5333
819
  if (suboptoff >= optend) {
5334
181
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5335
181
                  "Suboption %d: no room left in option for suboption length", subopt);
5336
181
    return (optend);
5337
181
  }
5338
5339
638
  sub_tree = proto_item_add_subtree(item, ett_dhcp_option125_suboption);
5340
638
  proto_tree_add_item_ret_uint(sub_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_NA, &subopt_len);
5341
638
  suboptoff++;
5342
5343
638
  if (suboptoff+subopt_len > optend) {
5344
187
    expert_add_info_format(pinfo, item, &ei_dhcp_missing_subopt_value,
5345
187
            "Suboption %d: no room left in option for suboption value", subopt);
5346
187
    return (optend);
5347
187
  }
5348
5349
451
  proto_tree_add_item(sub_tree, hf_dhcp_suboption_data, tvb, suboptoff, subopt_len, ENC_NA);
5350
451
  suboptoff+= subopt_len;
5351
5352
451
  return suboptoff;
5353
5354
638
}
5355
5356
static int
5357
dissect_dhcpopt_vi_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5358
530
{
5359
530
  uint32_t offset = 0;
5360
530
  uint32_t enterprise = 0;
5361
530
  uint32_t s_end = 0;
5362
530
  uint32_t option_data_len = 0;
5363
530
  proto_item *vti;
5364
530
  proto_tree *e_tree;
5365
5366
2.86k
  while (tvb_reported_length_remaining(tvb, offset) >= 5) {
5367
5368
2.43k
    vti = proto_tree_add_item_ret_uint(tree, hf_dhcp_option125_enterprise, tvb, offset, 4, ENC_BIG_ENDIAN, &enterprise);
5369
2.43k
    e_tree = proto_item_add_subtree(vti, ett_dhcp_option);
5370
2.43k
    offset += 4;
5371
5372
2.43k
    proto_tree_add_item_ret_uint(e_tree, hf_dhcp_option125_length, tvb, offset, 1, ENC_NA, &option_data_len);
5373
2.43k
    offset += 1;
5374
5375
2.43k
    s_end = offset + option_data_len;
5376
2.43k
    if ( tvb_reported_length_remaining(tvb, offset) < option_data_len ) {
5377
101
      expert_add_info_format(pinfo, vti, &ei_dhcp_option125_enterprise_malformed, "no room left in option for enterprise %u data", enterprise);
5378
101
      break;
5379
101
    }
5380
5381
12.1k
    while (offset < s_end) {
5382
9.80k
      tvbuff_t *enterprise_tvb = tvb_new_subset_length(tvb, offset, option_data_len);
5383
9.80k
      int bytes_dissected = dissector_try_uint(dhcp_enterprise_specific_table, enterprise, enterprise_tvb, pinfo, e_tree);
5384
9.80k
      if (bytes_dissected == 0) {
5385
819
        offset = dissect_vendor_generic_suboption(pinfo, vti, e_tree, tvb, offset, s_end);
5386
8.98k
      } else{
5387
8.98k
        offset += bytes_dissected;
5388
8.98k
      }
5389
9.80k
    }
5390
2.33k
  }
5391
5392
530
  if (tvb_reported_length_remaining(tvb, offset) > 0) {
5393
168
    expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "length < 5");
5394
168
  }
5395
5396
530
  return tvb_captured_length(tvb);
5397
530
}
5398
5399
static const value_string option43_alcatel_suboption_vals[] = {
5400
  {  0, "Padding" },
5401
  { 58, "Voice VLAN ID" },
5402
  { 64, "Spatial Redundancy TFTP1" },
5403
  { 65, "Spatial Redundancy TFTP2" },
5404
  { 66, "Application Type" },
5405
  { 67, "SIP URL" },
5406
  { 255, "Alcatel-Lucent End" },
5407
  { 0, NULL}
5408
};
5409
5410
static const value_string option43_alcatel_app_type_vals[] = {
5411
  { 0, "NOE" },
5412
  { 1, "SIP" },
5413
  { 0, NULL}
5414
};
5415
5416
/* If an Alcatel-Lucent Option 43 suboption has a known fixed length,
5417
 * return that length. Returns 0 for variable length options and unknown
5418
 * options.
5419
 */
5420
static unsigned
5421
get_alcatel_suboption_len(unsigned subopt)
5422
1.95k
{
5423
1.95k
  switch(subopt) {
5424
190
  case 58:  /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5425
190
    return 2;
5426
192
  case 64:  /* 0x40 - Alcatel-Lucent TFTP1 */
5427
192
    return 4;
5428
202
  case 65:  /* 0x41 - Alcatel-Lucent TFTP2 */
5429
202
    return 4;
5430
150
  case 66:  /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5431
150
    return 1;
5432
0
  case 0:   /* Alcatel-Lucent Padding */
5433
553
  case 67:  /* 0x43 - Alcatel-Lucent SIP URL */
5434
553
  case 255: /* Alcatel-Lucent End */
5435
1.22k
  default:
5436
1.22k
    return 0;
5437
1.95k
  }
5438
1.95k
}
5439
5440
static unsigned
5441
dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5442
         tvbuff_t *tvb, unsigned optoff, unsigned optend)
5443
2.02k
{
5444
2.02k
  unsigned    suboptoff = optoff;
5445
2.02k
  uint8_t     subopt;
5446
2.02k
  uint8_t     subopt_len;
5447
2.02k
  proto_item *vti;
5448
2.02k
  proto_tree *o43alcatel_v_tree;
5449
5450
2.02k
  subopt = tvb_get_uint8(tvb, optoff);
5451
2.02k
  suboptoff++;
5452
5453
2.02k
  if (subopt == 0) {
5454
1.44k
    proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
5455
1.44k
    return (suboptoff);
5456
1.44k
  } else if (subopt == 255) { /* End Option */
5457
9
    proto_tree_add_item(v_tree, hf_dhcp_option43_alcatel_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
5458
    /* Make sure we skip any junk left this option */
5459
9
    return (optend);
5460
9
  }
5461
5462
571
  if (suboptoff >= optend) {
5463
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5464
0
                  "Suboption %d: no room left in option for suboption length", subopt);
5465
0
    return (optend);
5466
0
  }
5467
5468
571
  subopt_len = tvb_get_uint8(tvb, suboptoff);
5469
571
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option43_alcatel_suboption,
5470
571
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5471
571
        subopt, val_to_str_const(subopt, option43_alcatel_suboption_vals, "Unknown"));
5472
5473
571
  o43alcatel_v_tree = proto_item_add_subtree(vti, ett_dhcp_option43_suboption);
5474
571
  proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5475
571
  suboptoff++;
5476
5477
571
  if (suboptoff+subopt_len > optend) {
5478
0
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5479
0
            "Suboption %d: no room left in option for suboption value", subopt);
5480
0
    return (optend);
5481
0
  }
5482
5483
571
  unsigned subopt_len_expected = get_alcatel_suboption_len(subopt);
5484
571
  if (subopt_len_expected && subopt_len_expected != subopt_len) {
5485
0
    expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't %u", subopt_len_expected);
5486
0
    return optend;
5487
0
  }
5488
571
  switch (subopt)
5489
571
  {
5490
76
  case 58: /* 0x3A - Alcatel-Lucent AVA VLAN Id */
5491
76
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_vlan_id, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
5492
76
    break;
5493
57
  case 64: /* 0x40 - Alcatel-Lucent TFTP1 */
5494
57
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp1, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5495
57
    break;
5496
78
  case 65: /* 0x41 - Alcatel-Lucent TFTP2 */
5497
78
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_tftp2, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
5498
78
    break;
5499
69
  case 66: /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
5500
69
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_app_type, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5501
69
    break;
5502
260
  case 67: /* 0x43 - Alcatel-Lucent SIP URL */
5503
260
    proto_tree_add_item(o43alcatel_v_tree, hf_dhcp_option43_alcatel_sip_url, tvb, suboptoff, subopt_len, ENC_ASCII);
5504
260
    break;
5505
31
  default:
5506
31
    expert_add_info_format(pinfo, vti, &ei_dhcp_subopt_unknown_type, "ERROR, please report: Unknown subopt type handler %d", subopt);
5507
31
    return optend;
5508
571
  }
5509
5510
540
  optoff += (subopt_len + 2);
5511
540
  return optoff;
5512
571
}
5513
5514
static bool
5515
dissect_alcatel_lucent_vendor_info_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
5516
1.30k
{
5517
1.30k
  unsigned offset = 0;
5518
1.30k
  uint8_t s_option;
5519
1.30k
  proto_tree* vendor_tree;
5520
5521
1.30k
  if (tvb_reported_length(tvb) < 1)
5522
298
    return false;
5523
5524
1.00k
  s_option = tvb_get_uint8(tvb, offset);
5525
1.00k
  if ((s_option==58 || s_option==64 || s_option==65
5526
915
    || s_option==66 || s_option==67)
5527
161
    && test_encapsulated_vendor_options(tvb, offset, tvb_reported_length(tvb), get_alcatel_suboption_len)) {
5528
5529
    /* Alcatel-Lucent DHCP Extensions */
5530
53
    proto_item_append_text(tree, " (Alcatel-Lucent)");
5531
53
    vendor_tree = proto_item_add_subtree(tree, ett_dhcp_option);
5532
5533
2.08k
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
5534
2.02k
      offset = dissect_vendor_alcatel_suboption(pinfo, tree, vendor_tree,
5535
2.02k
        tvb, offset, tvb_reported_length(tvb));
5536
2.02k
    }
5537
53
    return true;
5538
53
  }
5539
5540
951
  return false;
5541
1.00k
}
5542
5543
static const value_string option63_suboption_vals[] = {
5544
  { 1, "NWIP does not exist on subnet" },
5545
  { 2, "NWIP exists in options area" },
5546
  { 3, "NWIP exists in sname/file" },
5547
  { 4, "NWIP exists, but too big" },
5548
  { 5, "Broadcast for nearest Netware server" },
5549
  { 6, "Preferred DSS server" },
5550
  { 7, "Nearest NWIP server" },
5551
  { 8, "Autoretries" },
5552
  { 9, "Autoretry delay, secs" },
5553
  { 10, "Support NetWare/IP v1.1" },
5554
  { 11, "Primary DSS" },
5555
  { 0, NULL }
5556
};
5557
5558
static unsigned
5559
dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
5560
           tvbuff_t *tvb, unsigned optoff, unsigned optend)
5561
1.64k
{
5562
1.64k
  unsigned    suboptoff = optoff;
5563
1.64k
  uint8_t     subopt, subopt_len;
5564
1.64k
  proto_tree *o63_v_tree;
5565
1.64k
  proto_item *vti, *ti;
5566
5567
1.64k
  static const struct basic_types_hfs default_hfs = {
5568
1.64k
    NULL,
5569
1.64k
    &hf_dhcp_option63_value_ip_address,
5570
1.64k
    &hf_dhcp_option63_value_ip_address,
5571
1.64k
    NULL,
5572
1.64k
    &hf_dhcp_option63_value_boolean,
5573
1.64k
    &hf_dhcp_option63_value_8,
5574
1.64k
    NULL,
5575
1.64k
    NULL,
5576
1.64k
    NULL,
5577
1.64k
    NULL,
5578
1.64k
    NULL
5579
1.64k
  };
5580
5581
1.64k
  static const struct opt_info o63_opt[]= {
5582
1.64k
    /* 0 */ {"",none,NULL},
5583
1.64k
    /* 1 */ {"NWIP does not exist on subnet",presence,NULL},
5584
1.64k
    /* 2 */ {"NWIP exists in options area",presence,NULL},
5585
1.64k
    /* 3 */ {"NWIP exists in sname/file",presence,NULL},
5586
1.64k
    /* 4 */ {"NWIP exists, but too big",presence,NULL},
5587
1.64k
    /* 5 */ {"Broadcast for nearest Netware server",val_boolean, &hf_dhcp_option63_broadcast},
5588
1.64k
    /* 6 */ {"Preferred DSS server",ipv4_list,&hf_dhcp_option63_preferred_dss_server},
5589
1.64k
    /* 7 */ {"Nearest NWIP server",ipv4_list,&hf_dhcp_option63_nearest_nwip_server},
5590
1.64k
    /* 8 */ {"Autoretries",val_u_byte,&hf_dhcp_option63_autoretries},
5591
1.64k
    /* 9 */ {"Autoretry delay, secs",val_u_byte,&hf_dhcp_option63_autoretry_delay},
5592
1.64k
    /* 10*/ {"Support NetWare/IP v1.1",val_boolean,&hf_dhcp_option63_support_netware_v1_1},
5593
1.64k
    /* 11*/ {"Primary DSS",ipv4,&hf_dhcp_option63_primary_dss}
5594
1.64k
  };
5595
5596
1.64k
  subopt = tvb_get_uint8(tvb, optoff);
5597
1.64k
  suboptoff++;
5598
5599
1.64k
  if (suboptoff >= optend) {
5600
11
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
5601
11
                  "Suboption %d: no room left in option for suboption length", subopt);
5602
11
    return (optend);
5603
11
  }
5604
5605
1.62k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
5606
1.62k
  vti = proto_tree_add_uint_format_value(v_tree, hf_dhcp_option63_suboption,
5607
1.62k
        tvb, optoff, subopt_len+2, subopt, "(%d) %s",
5608
1.62k
        subopt, val_to_str_const(subopt, option63_suboption_vals, "Unknown"));
5609
5610
1.62k
  o63_v_tree = proto_item_add_subtree(vti, ett_dhcp_option63_suboption);
5611
1.62k
  proto_tree_add_item(o63_v_tree, hf_dhcp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
5612
1.62k
  suboptoff++;
5613
5614
1.62k
  ti = proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5615
1.62k
  proto_item_set_hidden(ti);
5616
5617
1.62k
  if (subopt < array_length(o63_opt)) {
5618
1.28k
    if (dhcp_handle_basic_types(pinfo, o63_v_tree, vti, tvb, o63_opt[subopt].ftype,
5619
1.28k
              suboptoff, subopt_len, o63_opt[subopt].phf, &default_hfs) == 0) {
5620
1.16k
      switch(o63_opt[subopt].ftype)
5621
1.16k
      {
5622
462
      case presence:
5623
462
        if (subopt_len != 0) {
5624
226
          expert_add_info_format(pinfo, vti, &ei_dhcp_bad_length, "length isn't 0");
5625
226
        }
5626
462
        break;
5627
704
      default:
5628
704
        if (o63_opt[subopt].phf == NULL)
5629
350
          proto_tree_add_item(o63_v_tree, hf_dhcp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
5630
704
        break;
5631
1.16k
      }
5632
1.16k
    }
5633
1.28k
  }
5634
1.62k
  optoff += (subopt_len + 2);
5635
1.62k
  return optoff;
5636
1.62k
}
5637
5638
static int
5639
dissect_dhcpopt_netware_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5640
144
{
5641
144
  unsigned offset = 0;
5642
5643
1.78k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
5644
1.64k
    offset = dissect_netware_ip_suboption(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
5645
1.64k
  }
5646
5647
144
  return tvb_captured_length(tvb);
5648
144
}
5649
5650
static const value_string option125_tr111_suboption_vals[] = {
5651
  { 1, "DeviceManufacturerOUI" },
5652
  { 2, "DeviceSerialNumber" },
5653
  { 3, "DeviceProductClass" },
5654
  { 4, "GatewayManufacturerOUI" },
5655
  { 5, "GatewaySerialNumber" },
5656
  { 6, "GatewayProductClass" },
5657
  { 0, NULL }
5658
};
5659
5660
static int
5661
dissect_vendor_tr111_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5662
4.10k
{
5663
4.10k
  unsigned offset = 0;
5664
4.10k
  proto_tree *o125_v_tree;
5665
4.10k
  proto_item *vti, *ti;
5666
4.10k
  uint8_t subopt, subopt_len;
5667
5668
4.10k
  static const struct basic_types_hfs default_hfs = {
5669
4.10k
    NULL,
5670
4.10k
    NULL,
5671
4.10k
    NULL,
5672
4.10k
    &hf_dhcp_option125_value_stringz,
5673
4.10k
    NULL,
5674
4.10k
    NULL,
5675
4.10k
    NULL,
5676
4.10k
    NULL,
5677
4.10k
    NULL,
5678
4.10k
    NULL,
5679
4.10k
    NULL
5680
4.10k
  };
5681
5682
  /* Reference: TR-111 DHCP Option 125 Sub-Option Data Fields
5683
     Page 10.
5684
  */
5685
5686
4.10k
  static const struct opt_info o125_tr111_opt[]= {
5687
4.10k
    /* 0 */ {"nop", special, NULL},  /* dummy */
5688
4.10k
    /* 1 */ {"DeviceManufacturerOUI",  oui,    &hf_dhcp_option125_tr111_device_manufacturer_oui},
5689
4.10k
    /* 2 */ {"DeviceSerialNumber",     string, &hf_dhcp_option125_tr111_device_serial_number},
5690
4.10k
    /* 3 */ {"DeviceProductClass",     string, &hf_dhcp_option125_tr111_device_product_class},
5691
4.10k
    /* 4 */ {"GatewayManufacturerOUI", string, &hf_dhcp_option125_tr111_gateway_manufacturer_oui},
5692
4.10k
    /* 5 */ {"GatewaySerialNumber",    string, &hf_dhcp_option125_tr111_gateway_serial_number},
5693
4.10k
    /* 6 */ {"GatewayProductClass",    string, &hf_dhcp_option125_tr111_gateway_product_class},
5694
4.10k
  };
5695
5696
4.10k
  subopt = tvb_get_uint8(tvb, offset);
5697
4.10k
  offset++;
5698
5699
4.10k
  if (tvb_reported_length_remaining(tvb, offset) < 1) {
5700
19
    expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5701
19
               "Suboption %d: no room left in option for suboption length", subopt);
5702
19
    return offset;
5703
19
  }
5704
5705
4.09k
  subopt_len = tvb_get_uint8(tvb, offset);
5706
4.09k
  vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_tr111_suboption,
5707
4.09k
        tvb, offset, subopt_len+2, subopt, "(%d) %s",
5708
4.09k
        subopt, val_to_str_const(subopt, option125_tr111_suboption_vals, "Unknown"));
5709
5710
4.09k
  o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_tr111_suboption);
5711
4.09k
  proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5712
4.09k
  offset++;
5713
5714
4.09k
  if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5715
629
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5716
629
            "Suboption %d: no room left in option for suboption value", subopt);
5717
629
    return offset;
5718
629
  }
5719
5720
3.46k
  ti = proto_tree_add_item(tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5721
3.46k
  proto_item_set_hidden(ti);
5722
5723
3.46k
  if (subopt < array_length(o125_tr111_opt)) {
5724
2.81k
    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) {
5725
2.69k
      if (o125_tr111_opt[subopt].ftype == special) {
5726
933
        if (o125_tr111_opt[subopt].phf != NULL)
5727
0
           proto_tree_add_item(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5728
933
        else
5729
933
           proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5730
933
      }
5731
1.76k
      else if (o125_tr111_opt[subopt].ftype == oui) {
5732
        /* Get hex OUI number.  Expecting 6 characters. */
5733
1.53k
        uint32_t oui_number;
5734
1.53k
        tvb_get_string_uint(tvb, offset, subopt_len, ENC_STR_HEX, &oui_number, NULL);
5735
        /* Add item using oui_vals */
5736
1.53k
        proto_tree_add_uint(o125_v_tree, *o125_tr111_opt[subopt].phf, tvb, offset, subopt_len, oui_number);
5737
1.53k
      } else if (o125_tr111_opt[subopt].phf == NULL)
5738
0
        proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5739
2.69k
    }
5740
2.81k
  }
5741
5742
3.46k
  return subopt_len + 2;
5743
4.09k
}
5744
5745
static const value_string option125_cl_suboption_vals[] = {
5746
  { 1, "Option Request" },
5747
  { 2, "TFTP Server Addresses" },
5748
  { 3, "eRouter Container Option" },
5749
  { 4, "MIB Environment Indicator Option" },
5750
  { 5, "Modem Capabilities" },
5751
  { 0, NULL }
5752
};
5753
5754
static const value_string pkt_mib_env_ind_opt_vals[] = {
5755
  { 0x00, "Reserved" },
5756
  { 0x01, "CableLabs" },
5757
  { 0x02, "IETF" },
5758
  { 0x03, "EuroCableLabs" },
5759
  { 0, NULL }
5760
};
5761
5762
static int
5763
dissect_vendor_cl_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5764
4.87k
{
5765
4.87k
  unsigned offset = 0;
5766
4.87k
  uint8_t subopt, subopt_len;
5767
4.87k
  proto_tree *o125_v_tree;
5768
4.87k
  proto_item *vti;
5769
5770
4.87k
  static const struct basic_types_hfs default_hfs = {
5771
4.87k
    &hf_dhcp_option125_value,
5772
4.87k
    &hf_dhcp_option125_value_ip_address,
5773
4.87k
    &hf_dhcp_option125_value_ip_address,
5774
4.87k
    &hf_dhcp_option125_value_stringz,
5775
4.87k
    NULL,
5776
4.87k
    &hf_dhcp_option125_value_8,
5777
4.87k
    &hf_dhcp_option125_value_16,
5778
4.87k
    NULL,
5779
4.87k
    NULL,
5780
4.87k
    NULL,
5781
4.87k
    NULL
5782
4.87k
  };
5783
5784
4.87k
  static const struct opt_info o125_cl_opt[]= {
5785
4.87k
    /* 0 */ {"nop", special, NULL},  /* dummy */
5786
4.87k
    /* 1 */ {"Option Request = ", bytes, &hf_dhcp_option125_cl_option_request},
5787
4.87k
    /* 2 */ {"TFTP Server Addresses : ", ipv4_list, &hf_dhcp_option125_cl_tftp_server_addresses},
5788
4.87k
    /* 3 */ {"eRouter Container Option : ", bytes, &hf_dhcp_option125_cl_erouter_container_option},
5789
4.87k
    /* 4 */ {"MIB Environment Indicator Option = ", val_u_byte, &hf_dhcp_option125_cl_mib_environment_indicator_option},
5790
4.87k
    /* 5 */ {"Modem Capabilities : ", special, &hf_dhcp_option125_cl_modem_capabilities},
5791
4.87k
  };
5792
5793
4.87k
  subopt = tvb_get_uint8(tvb, offset);
5794
4.87k
  offset++;
5795
5796
4.87k
  if (tvb_reported_length_remaining(tvb, offset) < 1) {
5797
34
    expert_add_info_format(pinfo, tree, &ei_dhcp_missing_subopt_length,
5798
34
                  "Suboption %d: no room left in option for suboption length", subopt);
5799
34
    return offset;
5800
34
  }
5801
5802
4.84k
  subopt_len = tvb_get_uint8(tvb, offset);
5803
4.84k
  vti = proto_tree_add_uint_format_value(tree, hf_dhcp_option125_cl_suboption,
5804
4.84k
        tvb, offset, subopt_len+2, subopt, "(%d) %s",
5805
4.84k
        subopt, val_to_str_const(subopt, option125_cl_suboption_vals, "Unknown"));
5806
5807
4.84k
  o125_v_tree = proto_item_add_subtree(vti, ett_dhcp_option125_cl_suboption);
5808
4.84k
  proto_tree_add_item(o125_v_tree, hf_dhcp_suboption_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5809
4.84k
  offset++;
5810
5811
4.84k
  if (tvb_reported_length_remaining(tvb, offset) < subopt_len) {
5812
1.00k
    expert_add_info_format(pinfo, vti, &ei_dhcp_missing_subopt_value,
5813
1.00k
            "Suboption %d: no room left in option for suboption value", subopt);
5814
1.00k
    return offset;
5815
1.00k
  }
5816
5817
3.83k
  if (subopt < array_length(o125_cl_opt)) {
5818
3.01k
    if (dhcp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_cl_opt[subopt].ftype,
5819
3.01k
              offset, subopt_len, o125_cl_opt[subopt].phf, &default_hfs) == 0) {
5820
5821
2.75k
      switch(o125_cl_opt[subopt].ftype) {
5822
2.27k
      case special:
5823
2.27k
        if (o125_cl_opt[subopt].phf != NULL)
5824
620
          proto_tree_add_item(o125_v_tree, *o125_cl_opt[subopt].phf, tvb, offset, subopt_len, ENC_BIG_ENDIAN);
5825
1.65k
        else
5826
1.65k
          proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5827
2.27k
        switch(subopt){
5828
619
          case 5: /* Modem Capabilities */
5829
619
            dissect_docsis_cm_cap(pinfo, o125_v_tree, tvb, offset-2, subopt_len+2, true);
5830
619
          break;
5831
2.27k
        }
5832
2.09k
        break;
5833
2.09k
      default:
5834
471
        if (o125_cl_opt[subopt].phf == NULL)
5835
0
          proto_tree_add_item(o125_v_tree, hf_dhcp_option125_value, tvb, offset, subopt_len, ENC_NA);
5836
471
        break;
5837
2.75k
      }
5838
2.75k
    }
5839
3.01k
  }
5840
5841
3.64k
  return subopt_len + 2;
5842
3.83k
}
5843
5844
/* PacketCable Multimedia Terminal Adapter device capabilities (option 60).
5845
   Ref: PKT-SP-I05-021127 sections 8.2 and 10 */
5846
5847
221
#define PKT_MDC_TLV_OFF 10
5848
5849
5850
/* These are ASCII-encoded hexadecimal digits.  We use the raw hex equivalent for
5851
   convenience. */
5852
59
#define PKT_MDC_VERSION     0x3031  /* "01" */
5853
43
#define PKT_MDC_TEL_END     0x3032  /* "02" */
5854
58
#define PKT_MDC_TGT     0x3033  /* "03" */
5855
113
#define PKT_MDC_HTTP_ACC    0x3034  /* "04" */
5856
143
#define PKT_MDC_SYSLOG      0x3035  /* "05" */
5857
186
#define PKT_MDC_NCS     0x3036  /* "06" */
5858
242
#define PKT_MDC_PRI_LINE    0x3037  /* "07" */
5859
8
#define PKT_MDC_VENDOR_TLV    0x3038  /* "08" */
5860
265
#define PKT_MDC_NVRAM_STOR    0x3039  /* "09" */
5861
331
#define PKT_MDC_PROV_REP    0x3041  /* "0A" */
5862
396
#define PKT_MDC_PROV_REP_LC   0x3061  /* "0a" */
5863
85
#define PKT_MDC_SUPP_CODECS   0x3042  /* "0B" */
5864
135
#define PKT_MDC_SUPP_CODECS_LC    0x3062  /* "0b" */
5865
445
#define PKT_MDC_SILENCE     0x3043  /* "0C" */
5866
500
#define PKT_MDC_SILENCE_LC    0x3063  /* "0c" */
5867
594
#define PKT_MDC_ECHO_CANCEL   0x3044  /* "0D" */
5868
636
#define PKT_MDC_ECHO_CANCEL_LC    0x3064  /* "0d" */
5869
689
#define PKT_MDC_RSVP      0x3045  /* "0E" */
5870
757
#define PKT_MDC_RSVP_LC     0x3065  /* "0e" */
5871
842
#define PKT_MDC_UGS_AD      0x3046  /* "0F" */
5872
956
#define PKT_MDC_UGS_AD_LC   0x3066  /* "0f" */
5873
100
#define PKT_MDC_IF_INDEX    0x3130  /* "10" */
5874
1.02k
#define PKT_MDC_FLOW_LOG    0x3131  /* "11" */
5875
3.16k
#define PKT_MDC_PROV_FLOWS    0x3132  /* "12" */
5876
/* PacketCable 1.5: */
5877
43
#define PKT_MDC_T38_VERSION   0x3133  /* "13" */
5878
106
#define PKT_MDC_T38_EC      0x3134  /* "14" */
5879
1.09k
#define PKT_MDC_RFC2833_DTMF    0x3135  /* "15" */
5880
1.15k
#define PKT_MDC_VOICE_METRICS   0x3136  /* "16" */
5881
2.73k
#define PKT_MDC_MIBS      0x3137  /* "17" */
5882
1.19k
#define PKT_MDC_MGPI      0x3138  /* "18" */
5883
1.25k
#define PKT_MDC_V152      0x3139  /* "19" */
5884
1.29k
#define PKT_MDC_CBS     0x3141  /* "1A" */
5885
1.38k
#define PKT_MDC_CBS_LC      0x3161  /* "1a" */
5886
5887
static const value_string pkt_mdc_type_vals[] = {
5888
  { PKT_MDC_VERSION,    "PacketCable Version" },
5889
  { PKT_MDC_TEL_END,    "Number Of Telephony Endpoints" },
5890
  { PKT_MDC_TGT,      "TGT Support" },
5891
  { PKT_MDC_HTTP_ACC,   "HTTP Download File Access Method Support" },
5892
  { PKT_MDC_SYSLOG,   "MTA-24 Event SYSLOG Notification Support" },
5893
  { PKT_MDC_NCS,      "NCS Service Flow Support" },
5894
  { PKT_MDC_PRI_LINE,   "Primary Line Support" },
5895
  { PKT_MDC_VENDOR_TLV,   "Vendor Specific TLV Type(s)" },
5896
  { PKT_MDC_NVRAM_STOR,   "NVRAM Ticket/Session Keys Storage Support" },
5897
  { PKT_MDC_PROV_REP,   "Provisioning Event Reporting Support" },
5898
  { PKT_MDC_PROV_REP_LC,    "Provisioning Event Reporting Support" },
5899
  { PKT_MDC_SUPP_CODECS,    "Supported CODEC(s)" },
5900
  { PKT_MDC_SUPP_CODECS_LC, "Supported CODEC(s)" },
5901
  { PKT_MDC_SILENCE,    "Silence Suppression Support" },
5902
  { PKT_MDC_SILENCE_LC,   "Silence Suppression Support" },
5903
  { PKT_MDC_ECHO_CANCEL,    "Echo Cancellation Support" },
5904
  { PKT_MDC_ECHO_CANCEL_LC, "Echo Cancellation Support" },
5905
  { PKT_MDC_RSVP,     "RSVP Support/ Reserved" },
5906
  { PKT_MDC_RSVP_LC,    "RSVP Support/ Reserved" },
5907
  { PKT_MDC_UGS_AD,   "UGS-AD Support" },
5908
  { PKT_MDC_UGS_AD_LC,    "UGS-AD Support" },
5909
  { PKT_MDC_IF_INDEX,   "MTA's \"ifIndex\" starting number in \"ifTable\"" },
5910
  { PKT_MDC_FLOW_LOG,   "Provisioning Flow Logging Support" },
5911
  { PKT_MDC_PROV_FLOWS,   "Supported Provisioning Flows" },
5912
  /* PacketCable 1.5: */
5913
  { PKT_MDC_T38_VERSION,    "T38 Version Support" },
5914
  { PKT_MDC_T38_EC,   "T38 Error Correction Support" },
5915
  { PKT_MDC_RFC2833_DTMF,   "RFC 2833 DTMF Support" },
5916
  { PKT_MDC_VOICE_METRICS,  "Voice Metrics Support" },
5917
  { PKT_MDC_MIBS,     "MIB Support" },
5918
  { PKT_MDC_MGPI,     "Multiple Grants Per Interval Support" },
5919
  { PKT_MDC_V152,     "V.152 Support" },
5920
  /* PacketCable 2.0: */
5921
  { PKT_MDC_CBS,      "Certificate Bootstrapping Support" },
5922
  { PKT_MDC_CBS_LC,   "Certificate Bootstrapping Support" },
5923
  { 0,        NULL }
5924
};
5925
5926
static const value_string pkt_mdc_version_vals[] = {
5927
  { 0x3030, "PacketCable 1.0" },
5928
  { 0x3031, "PacketCable 1.1/1.5" }, /* 1.5 replaces 1.1-1.3 */
5929
  { 0x3032, "PacketCable 2.0" },
5930
  { 0,    NULL }
5931
};
5932
5933
static const value_string pkt_mdc_boolean_vals[] = {
5934
  { 0x3030, "No" },
5935
  { 0x3031, "Yes" },
5936
  { 0,    NULL }
5937
};
5938
5939
static const value_string pkt_mdc_codec_vals[] = {
5940
  { 0x3031, "other" },       /* "01" */
5941
  { 0x3032, "unknown" },
5942
  { 0x3033, "G.729" },
5943
  { 0x3034, "reserved" },
5944
  { 0x3035, "G.729E" },
5945
  { 0x3036, "PCMU" },
5946
  { 0x3037, "G.726-32" },
5947
  { 0x3038, "G.728" },
5948
  { 0x3039, "PCMA" },      /* "09" */
5949
  { 0x3041, "G.726-16" },      /* "0A" */
5950
  { 0x3042, "G.726-24" },
5951
  { 0x3043, "G.726-40" },
5952
  { 0x3044, "iLBC" },
5953
  { 0x3045, "BV16" },
5954
  { 0x3046, "telephone-event" }, /* "0F" */
5955
  { 0,    NULL }
5956
};
5957
5958
static const value_string pkt_mdc_t38_version_vals[] = {
5959
  { 0x3030, "Unsupported" },
5960
  { 0x3031, "T.38 Version Zero" }, /* default */
5961
  { 0x3032, "T.38 Version One" },
5962
  { 0x3033, "T.38 Version Two" },
5963
  { 0x3035, "T.38 Version Three" },
5964
  { 0,    NULL }
5965
};
5966
5967
static const value_string pkt_mdc_t38_ec_vals[] = {
5968
  { 0x3030, "None" },
5969
  { 0x3031, "Redundancy" }, /* default */
5970
  { 0x3032, "FEC" },
5971
  { 0,    NULL }
5972
};
5973
5974
static const value_string pkt_mdc_mib_orgs[] = {
5975
  { 0x3030, "CableLabs" },
5976
  { 0x3031, "IETF" },
5977
  { 0x3032, "EuroCableLabs" },
5978
  { 0x3033, "Reserved" },
5979
  { 0x3034, "Reserved" },
5980
  { 0x3035, "Reserved" },
5981
  { 0x3036, "Reserved" },
5982
  { 0x3037, "Reserved" },
5983
  { 0x3038, "Reserved" },
5984
  { 0x3039, "Reserved" },
5985
  { 0,    NULL }
5986
};
5987
5988
static int hf_dhcp_pkt_mdc_supp_flow_secure;
5989
static int hf_dhcp_pkt_mdc_supp_flow_hybrid;
5990
static int hf_dhcp_pkt_mdc_supp_flow_basic;
5991
5992
0
#define PKT_MDC_MIB_CL 0x3030
5993
static int hf_dhcp_pkt_mdc_mib_cl_mta;
5994
static int hf_dhcp_pkt_mdc_mib_cl_signaling;
5995
static int hf_dhcp_pkt_mdc_mib_cl_management_event;
5996
static int hf_dhcp_pkt_mdc_mib_cl_mta_extension;
5997
static int hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension;
5998
static int hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension;
5999
static int hf_dhcp_pkt_mdc_mib_cl_reserved;
6000
6001
8
#define PKT_MDC_MIB_IETF 0x3031
6002
static int hf_dhcp_pkt_mdc_mib_ietf_mta;
6003
static int hf_dhcp_pkt_mdc_mib_ietf_signaling;
6004
static int hf_dhcp_pkt_mdc_mib_ietf_management_event;
6005
static int hf_dhcp_pkt_mdc_mib_ietf_reserved;
6006
6007
19
#define PKT_MDC_MIB_EURO 0x3032
6008
static int hf_dhcp_pkt_mdc_mib_euro_mta;
6009
static int hf_dhcp_pkt_mdc_mib_euro_signaling;
6010
static int hf_dhcp_pkt_mdc_mib_euro_management_event;
6011
static int hf_dhcp_pkt_mdc_mib_euro_mta_extension;
6012
static int hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension;
6013
static int hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension;
6014
static int hf_dhcp_pkt_mdc_mib_euro_reserved;
6015
6016
6017
static void
6018
dissect_packetcable_mta_cap(proto_tree *v_tree, packet_info *pinfo, tvbuff_t *tvb, unsigned voff, unsigned len)
6019
221
{
6020
221
  uint16_t  raw_val;
6021
221
  uint32_t  flow_val    = 0;
6022
221
  unsigned  off   = PKT_MDC_TLV_OFF + voff;
6023
221
  unsigned  subopt_off, max_len;
6024
221
  unsigned  tlv_len, i, mib_val;
6025
221
  const char    *asc_val;
6026
221
  proto_item    *ti, *mib_ti;
6027
221
  proto_tree    *subtree, *subtree2;
6028
6029
221
  asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, off, 2, ENC_ASCII);
6030
221
  if (sscanf(asc_val, "%x", &tlv_len) != 1 || tlv_len > 0xff) {
6031
13
    proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
6032
13
      "Bogus length: %s",
6033
13
      format_text_string(pinfo->pool, asc_val));
6034
13
    return;
6035
208
  } else {
6036
208
    proto_tree_add_uint(v_tree, hf_dhcp_pkt_mta_cap_len, tvb, off, 2, tlv_len);
6037
208
    off += 2;
6038
6039
3.26k
    while (off - voff < len) {
6040
      /* Type */
6041
3.22k
      raw_val = tvb_get_ntohs (tvb, off);
6042
6043
      /* Length */
6044
3.22k
      asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, off + 2, 2, ENC_ASCII);
6045
3.22k
      if (sscanf(asc_val, "%x", &tlv_len) != 1
6046
3.16k
          || tlv_len < 1 || tlv_len > UINT16_MAX) {
6047
67
        proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_length, tvb, off, len - off,
6048
67
          "Bogus length: %s",
6049
67
          format_text_string(pinfo->pool, asc_val));
6050
67
        return;
6051
3.15k
      } else {
6052
        /* Value(s) */
6053
6054
3.15k
        ti = proto_tree_add_uint_format(v_tree, hf_dhcp_pkt_mta_cap_type,
6055
3.15k
            tvb, off, 2, raw_val, "0x%s: %s = ",
6056
3.15k
            tvb_format_text(pinfo->pool, tvb, off, 2),
6057
3.15k
            val_to_str_const(raw_val, pkt_mdc_type_vals, "unknown"));
6058
3.15k
        proto_item_set_len(ti, (tlv_len * 2) + 4);
6059
3.15k
        switch (raw_val) {
6060
6061
59
        case PKT_MDC_VERSION:
6062
59
          raw_val = tvb_get_ntohs(tvb, off + 4);
6063
59
          proto_item_append_text(ti,
6064
59
                     "%s (%s)",
6065
59
                     val_to_str_const(raw_val, pkt_mdc_version_vals, "Reserved"),
6066
59
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6067
59
          break;
6068
6069
43
        case PKT_MDC_TEL_END:
6070
100
        case PKT_MDC_IF_INDEX:
6071
100
          proto_item_append_text(ti,
6072
100
                     "%s",
6073
100
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6074
100
          break;
6075
6076
58
        case PKT_MDC_TGT:
6077
113
        case PKT_MDC_HTTP_ACC:
6078
143
        case PKT_MDC_SYSLOG:
6079
186
        case PKT_MDC_NCS:
6080
242
        case PKT_MDC_PRI_LINE:
6081
265
        case PKT_MDC_NVRAM_STOR:
6082
331
        case PKT_MDC_PROV_REP:
6083
396
        case PKT_MDC_PROV_REP_LC:
6084
445
        case PKT_MDC_SILENCE:
6085
500
        case PKT_MDC_SILENCE_LC:
6086
594
        case PKT_MDC_ECHO_CANCEL:
6087
636
        case PKT_MDC_ECHO_CANCEL_LC:
6088
689
        case PKT_MDC_RSVP:
6089
757
        case PKT_MDC_RSVP_LC:
6090
842
        case PKT_MDC_UGS_AD:
6091
956
        case PKT_MDC_UGS_AD_LC:
6092
1.02k
        case PKT_MDC_FLOW_LOG:
6093
1.09k
        case PKT_MDC_RFC2833_DTMF:
6094
1.15k
        case PKT_MDC_VOICE_METRICS:
6095
1.19k
        case PKT_MDC_MGPI:
6096
1.25k
        case PKT_MDC_V152:
6097
1.29k
        case PKT_MDC_CBS:
6098
1.38k
        case PKT_MDC_CBS_LC:
6099
1.38k
          raw_val = tvb_get_ntohs(tvb, off + 4);
6100
1.38k
          proto_item_append_text(ti,
6101
1.38k
                     "%s (%s)",
6102
1.38k
                     val_to_str_const(raw_val, pkt_mdc_boolean_vals, "unknown"),
6103
1.38k
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6104
1.38k
          break;
6105
6106
85
        case PKT_MDC_SUPP_CODECS:
6107
135
        case PKT_MDC_SUPP_CODECS_LC:
6108
1.19k
          for (i = 0; i < tlv_len; i++) {
6109
1.05k
            raw_val = tvb_get_ntohs(tvb, off + 4 + (i * 2) );
6110
1.05k
            proto_item_append_text(ti,
6111
1.05k
                       "%s%s (%s)",
6112
1.05k
                       plurality(i + 1, "", ", "),
6113
1.05k
                       val_to_str_const(raw_val, pkt_mdc_codec_vals, "unknown"),
6114
1.05k
                       tvb_format_stringzpad(pinfo->pool, tvb, off + 4 + (i * 2), 2) );
6115
1.05k
          }
6116
135
          break;
6117
6118
91
        case PKT_MDC_PROV_FLOWS:
6119
          /* We are only reading 4 digits which should fit in 32 bits */
6120
91
          tvb_get_string_uint(tvb, off + 4, 4, ENC_STR_HEX, &flow_val, NULL);
6121
91
          proto_item_append_text(ti,
6122
91
                     "0x%04x", flow_val);
6123
91
          break;
6124
6125
43
        case PKT_MDC_T38_VERSION:
6126
43
          raw_val = tvb_get_ntohs(tvb, off + 4);
6127
43
          proto_item_append_text(ti,
6128
43
                     "%s (%s)",
6129
43
                     val_to_str_const(raw_val, pkt_mdc_t38_version_vals, "unknown"),
6130
43
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6131
43
          break;
6132
6133
106
        case PKT_MDC_T38_EC:
6134
106
          raw_val = tvb_get_ntohs(tvb, off + 4);
6135
106
          proto_item_append_text(ti,
6136
106
                     "%s (%s)",
6137
106
                     val_to_str_const(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
6138
106
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, 2) );
6139
106
          break;
6140
6141
79
        case PKT_MDC_MIBS:
6142
79
          break;
6143
6144
8
        case PKT_MDC_VENDOR_TLV:
6145
1.15k
        default:
6146
1.15k
          proto_item_append_text(ti,
6147
1.15k
                     "%s",
6148
1.15k
                     tvb_format_stringzpad(pinfo->pool, tvb, off + 4, tlv_len * 2) );
6149
1.15k
          break;
6150
3.15k
        }
6151
3.15k
      }
6152
3.07k
      subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6153
3.07k
      if (raw_val == PKT_MDC_PROV_FLOWS) {
6154
419
        static int * const flows[] = {
6155
419
          &hf_dhcp_pkt_mdc_supp_flow_secure,
6156
419
          &hf_dhcp_pkt_mdc_supp_flow_hybrid,
6157
419
          &hf_dhcp_pkt_mdc_supp_flow_basic,
6158
419
          NULL
6159
419
        };
6160
6161
419
        proto_tree_add_bitmask_list_value(subtree, tvb, off + 4, 4, flows, flow_val);
6162
2.65k
      } else if (raw_val == PKT_MDC_MIBS) {
6163
      /* 17 06 02 00 38 02 01 07 */
6164
80
        subopt_off = off + 4;
6165
80
        max_len = subopt_off + (tlv_len * 2);
6166
245
        while (subopt_off < max_len) {
6167
190
          raw_val = tvb_get_ntohs(tvb, subopt_off);
6168
190
          if (raw_val != 0x3032) { /* We only know how to handle a length of 2 */
6169
22
            asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6170
22
            proto_tree_add_expert_format(subtree, pinfo, &ei_dhcp_bad_length, tvb, subopt_off, 2,
6171
22
              "Bogus length: %s",
6172
22
              format_text_string(pinfo->pool, asc_val));
6173
22
            return;
6174
22
          }
6175
6176
168
          subopt_off += 2;
6177
168
          raw_val = tvb_get_ntohs(tvb, subopt_off);
6178
168
          asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6179
168
          subtree2 = proto_tree_add_subtree_format(subtree, tvb, subopt_off, 2,
6180
168
            ett_dhcp_option, &mib_ti, "%s (%s)",
6181
168
            val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"),
6182
168
            format_text_string(pinfo->pool, asc_val));
6183
168
          if (subopt_off > off + 4 + 2) {
6184
95
            proto_item_append_text(ti, ", ");
6185
95
          }
6186
168
          proto_item_append_text(ti, "%s", val_to_str_const(raw_val, pkt_mdc_mib_orgs, "Unknown"));
6187
6188
168
          subopt_off += 2;
6189
168
          asc_val = (char*)tvb_get_string_enc(pinfo->pool, tvb, subopt_off, 2, ENC_ASCII);
6190
168
          if (sscanf(asc_val, "%x", &mib_val) != 1) {
6191
2
            proto_tree_add_expert_format(v_tree, pinfo, &ei_dhcp_bad_bitfield, tvb, subopt_off, 2,
6192
2
              "Bogus bitfield: %s", format_text_string(pinfo->pool, asc_val));
6193
2
            return;
6194
2
          }
6195
166
          switch (raw_val) {
6196
6197
0
          case PKT_MDC_MIB_CL: {
6198
0
            static int * const cl_flags[] = {
6199
0
              &hf_dhcp_pkt_mdc_mib_cl_mta,
6200
0
              &hf_dhcp_pkt_mdc_mib_cl_signaling,
6201
0
              &hf_dhcp_pkt_mdc_mib_cl_management_event,
6202
0
              &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
6203
0
              &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
6204
0
              &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
6205
0
              &hf_dhcp_pkt_mdc_mib_cl_reserved,
6206
0
              NULL
6207
0
            };
6208
6209
0
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, cl_flags, mib_val);
6210
0
            }
6211
0
            break;
6212
6213
8
          case PKT_MDC_MIB_IETF: {
6214
8
            static int * const ietf_flags[] = {
6215
8
              &hf_dhcp_pkt_mdc_mib_ietf_mta,
6216
8
              &hf_dhcp_pkt_mdc_mib_ietf_signaling,
6217
8
              &hf_dhcp_pkt_mdc_mib_ietf_management_event,
6218
8
              &hf_dhcp_pkt_mdc_mib_ietf_reserved,
6219
8
              NULL
6220
8
            };
6221
6222
8
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, ietf_flags, mib_val);
6223
8
            }
6224
8
            break;
6225
6226
19
          case PKT_MDC_MIB_EURO: {
6227
19
            static int * const euro_flags[] = {
6228
19
              &hf_dhcp_pkt_mdc_mib_euro_mta,
6229
19
              &hf_dhcp_pkt_mdc_mib_euro_signaling,
6230
19
              &hf_dhcp_pkt_mdc_mib_euro_management_event,
6231
19
              &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
6232
19
              &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
6233
19
              &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
6234
19
              &hf_dhcp_pkt_mdc_mib_euro_reserved,
6235
19
              NULL
6236
19
            };
6237
6238
19
            proto_tree_add_bitmask_list_value(subtree2, tvb, subopt_off, 2, euro_flags, mib_val);
6239
19
            }
6240
19
            break;
6241
6242
138
          default:
6243
138
            break;
6244
166
          }
6245
165
          subopt_off += 2;
6246
165
        }
6247
6248
80
      }
6249
3.05k
      off += (tlv_len * 2) + 4;
6250
3.05k
    }
6251
208
  }
6252
221
}
6253
6254
static bool
6255
dissect_packetcable_mta_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6256
1.63k
{
6257
1.63k
  uint8_t* vendor_id;
6258
6259
1.63k
  if (tvb_reported_length(tvb) < 8) {
6260
144
    return false;
6261
144
  }
6262
6263
1.48k
  vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 8, ENC_ASCII|ENC_NA);
6264
1.48k
  if ((strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP10) == 0) ||
6265
1.42k
    (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP15) == 0) ||
6266
1.33k
    (strcmp((const char*)vendor_id, PACKETCABLE_MTA_CAP20) == 0)) {
6267
221
    dissect_packetcable_mta_cap(tree, pinfo, tvb, 0, tvb_reported_length(tvb));
6268
221
    return true;
6269
221
  }
6270
6271
1.26k
  return false;
6272
1.48k
}
6273
6274
/* DOCSIS Cable Modem device capabilities (option 60/option 125). */
6275
117
#define DOCSIS_CM_CAP_TLV_OFF 12
6276
6277
584
#define DOCSIS_CM_CAP_CONCAT_SUP  0x01
6278
220
#define DOCSIS_CM_CAP_DOCSIS_VER  0x02
6279
987
#define DOCSIS_CM_CAP_FRAG_SUP    0x03
6280
1.82k
#define DOCSIS_CM_CAP_PHS_SUP   0x04
6281
2.11k
#define DOCSIS_CM_CAP_IGMP_SUP    0x05
6282
249
#define DOCSIS_CM_CAP_PRIV_SUP    0x06
6283
192
#define DOCSIS_CM_CAP_DSAID_SUP   0x07
6284
1.32k
#define DOCSIS_CM_CAP_USSF_SUP    0x08
6285
116
#define DOCSIS_CM_CAP_FILT_SUP    0x09
6286
747
#define DOCSIS_CM_CAP_TET_MI    0x0a
6287
507
#define DOCSIS_CM_CAP_TET   0x0b
6288
2.22k
#define DOCSIS_CM_CAP_DCC_SUP   0x0c
6289
121
#define DOCSIS_CM_CAP_IPFILT_SUP  0x0d
6290
349
#define DOCSIS_CM_CAP_LLCFILT_SUP 0x0e
6291
2.36k
#define DOCSIS_CM_CAP_EXPUNI_SPACE  0x0f
6292
35.4k
#define DOCSIS_CM_CAP_RNGHLDOFF_SUP 0x10
6293
168
#define DOCSIS_CM_CAP_L2VPN_SUP   0x11
6294
138
#define DOCSIS_CM_CAP_L2VPN_HOST_SUP  0x12
6295
2.56k
#define DOCSIS_CM_CAP_DUTFILT_SUP 0x13
6296
51
#define DOCSIS_CM_CAP_USFREQRNG_SUP 0x14
6297
17.7k
#define DOCSIS_CM_CAP_USSYMRATE_SUP 0x15
6298
2.76k
#define DOCSIS_CM_CAP_SACM2_SUP   0x16
6299
2.97k
#define DOCSIS_CM_CAP_SACM2HOP_SUP  0x17
6300
304
#define DOCSIS_CM_CAP_MULTTXCHAN_SUP  0x18
6301
422
#define DOCSIS_CM_CAP_512USTXCHAN_SUP 0x19
6302
605
#define DOCSIS_CM_CAP_256USTXCHAN_SUP 0x1a
6303
801
#define DOCSIS_CM_CAP_TOTALSIDCLU_SUP 0x1b
6304
611
#define DOCSIS_CM_CAP_SIDCLUPERSF_SUP 0x1c
6305
955
#define DOCSIS_CM_CAP_MULTRXCHAN_SUP  0x1d
6306
857
#define DOCSIS_CM_CAP_TOTALDSID_SUP 0x1e
6307
155
#define DOCSIS_CM_CAP_RESEQDSID_SUP 0x1f
6308
552
#define DOCSIS_CM_CAP_MULTDSID_SUP  0x20
6309
185
#define DOCSIS_CM_CAP_MULTDSIDFW_SUP  0x21
6310
97
#define DOCSIS_CM_CAP_FCTF_SUP    0x22
6311
229
#define DOCSIS_CM_CAP_DPV_SUP   0x23
6312
1.10k
#define DOCSIS_CM_CAP_UGSPERUSFLOW_SUP  0x24
6313
153
#define DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP 0x25
6314
332
#define DOCSIS_CM_CAP_USDROPCLASSIF_SUP 0x26
6315
3.04k
#define DOCSIS_CM_CAP_IPV6_SUP    0x27
6316
568
#define DOCSIS_CM_CAP_ExUsTrPow   0x28
6317
35.5k
#define DOCSIS_CM_CAP_Opt802MPLSSup   0x29
6318
417
#define DOCSIS_CM_CAP_DounEnc   0x2a
6319
116
#define DOCSIS_CM_CAP_EnrgMang    0x2c
6320
6321
static const value_string docsis_cm_cap_type_vals[] = {
6322
  { DOCSIS_CM_CAP_CONCAT_SUP,   "Concatenation Support" },
6323
  { DOCSIS_CM_CAP_DOCSIS_VER,   "DOCSIS Version" },
6324
  { DOCSIS_CM_CAP_FRAG_SUP,   "Fragmentation Support" },
6325
  { DOCSIS_CM_CAP_PHS_SUP,    "Payload Header Suppression Support" },
6326
  { DOCSIS_CM_CAP_IGMP_SUP,   "IGMP Support" },
6327
  { DOCSIS_CM_CAP_PRIV_SUP,   "Privacy Support" },
6328
  { DOCSIS_CM_CAP_DSAID_SUP,    "Downstream SAID Support" },
6329
  { DOCSIS_CM_CAP_USSF_SUP,   "Upstream Service Flow Support" },
6330
  { DOCSIS_CM_CAP_FILT_SUP,   "Optional Filtering Support" },
6331
  { DOCSIS_CM_CAP_TET_MI,     "Transmit Equalizer Taps per Modulation Interval" },
6332
  { DOCSIS_CM_CAP_TET,      "Number of Transmit Equalizer Taps" },
6333
  { DOCSIS_CM_CAP_DCC_SUP,    "DCC Support" },
6334
  { DOCSIS_CM_CAP_IPFILT_SUP,   "IP Filters Support" },
6335
  { DOCSIS_CM_CAP_LLCFILT_SUP,    "LLC Filters Support" },
6336
  { DOCSIS_CM_CAP_EXPUNI_SPACE,   "Expanded Unicast SID Space" },
6337
  { DOCSIS_CM_CAP_RNGHLDOFF_SUP,    "Ranging Hold-Off Support" },
6338
  { DOCSIS_CM_CAP_L2VPN_SUP,    "L2VPN Capability" },
6339
  { DOCSIS_CM_CAP_L2VPN_HOST_SUP,   "L2VPN eSAFE Host Capability" },
6340
  { DOCSIS_CM_CAP_DUTFILT_SUP,    "Downstream Unencrypted Traffic (DUT) Filtering" },
6341
  { DOCSIS_CM_CAP_USFREQRNG_SUP,    "Upstream Frequency Range Support" },
6342
  { DOCSIS_CM_CAP_USSYMRATE_SUP,    "Upstream Symbol Rate Support" },
6343
  { DOCSIS_CM_CAP_SACM2_SUP,    "Selectable Active Code Mode 2 Support" },
6344
  { DOCSIS_CM_CAP_SACM2HOP_SUP,   "Code Hopping Mode 2 Support" },
6345
  { DOCSIS_CM_CAP_MULTTXCHAN_SUP,   "Multiple Transmit Channel Support" },
6346
  { DOCSIS_CM_CAP_512USTXCHAN_SUP,  "5.12 Msps Upstream Transmit Channel Support" },
6347
  { DOCSIS_CM_CAP_256USTXCHAN_SUP,  "2.56 Msps Upstream Transmit Channel Support" },
6348
  { DOCSIS_CM_CAP_TOTALSIDCLU_SUP,  "Total SID Cluster Support" },
6349
  { DOCSIS_CM_CAP_SIDCLUPERSF_SUP,  "SID Clusters per Service Flow Support" },
6350
  { DOCSIS_CM_CAP_MULTRXCHAN_SUP,   "Multiple Receive Channel Support" },
6351
  { DOCSIS_CM_CAP_TOTALDSID_SUP,    "Total Downstream Service ID (DSID) Support" },
6352
  { DOCSIS_CM_CAP_RESEQDSID_SUP,    "Resequencing Downstream Service ID (DSID) Support" },
6353
  { DOCSIS_CM_CAP_MULTDSID_SUP,   "Multicast Downstream Service ID (DSID) Support" },
6354
  { DOCSIS_CM_CAP_MULTDSIDFW_SUP,   "Multicast DSID Forwarding" },
6355
  { DOCSIS_CM_CAP_FCTF_SUP,   "Frame Control Type Forwarding Capability" },
6356
  { DOCSIS_CM_CAP_DPV_SUP,    "DPV Capability" },
6357
  { DOCSIS_CM_CAP_UGSPERUSFLOW_SUP, "Unsolicited Grant Service/Upstream Service Flow Support" },
6358
  { DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP,  "MAP and UCD Receipt Support" },
6359
  { DOCSIS_CM_CAP_USDROPCLASSIF_SUP,  "Upstream Drop Classifier Support" },
6360
  { DOCSIS_CM_CAP_IPV6_SUP,   "IPv6 Support" },
6361
  { DOCSIS_CM_CAP_ExUsTrPow,    "Extended Upstream Transmit Power Capability (1/4 dB)" },
6362
  { DOCSIS_CM_CAP_Opt802MPLSSup,    "Optional 802.1ad, 802.1ah, MPLS Classification Support" },
6363
  { DOCSIS_CM_CAP_DounEnc,    "D-ONU Capabilities Encoding" },
6364
  { DOCSIS_CM_CAP_EnrgMang,   "Energy Management Capabilities" },
6365
  { 0, NULL }
6366
};
6367
6368
static const value_string docsis_cm_cap_supported_vals[] = {
6369
  { 0x00, "Not Support" },
6370
  { 0x01, "Supported" },
6371
  { 0,    NULL }
6372
};
6373
6374
static const value_string docsis_cm_cap_version_vals[] = {
6375
  { 0x00, "DOCSIS 1.0" },
6376
  { 0x01, "DOCSIS 1.1" },
6377
  { 0x02, "DOCSIS 2.0" },
6378
  { 0x03, "DOCSIS 3.0" },
6379
  { 0,    NULL }
6380
};
6381
6382
static const value_string docsis_cm_cap_privacy_vals[] = {
6383
  { 0x00, "BPI Support" },
6384
  { 0x01, "BPI Plus Support" },
6385
  { 0,    NULL }
6386
};
6387
6388
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_cm;
6389
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_eps;
6390
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_emta;
6391
static int hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg;
6392
6393
static const value_string docsis_cm_cap_l2vpn_vals[] = {
6394
  { 0x00, "CM not compliant with DOCSIS L2VPN Section 7 (default)" },
6395
  { 0x01, "CM compliant with DOCSIS L2VPN Section 7" },
6396
  { 0,    NULL }
6397
};
6398
6399
static const value_string docsis_cm_cap_filt_vals[] = {
6400
  { 0x00, "802.1P Filtering" },
6401
  { 0x01, "802.1Q Filtering" },
6402
  { 0,    NULL }
6403
};
6404
6405
static int hf_dhcp_docsis_cm_cap_mpls_stpid;
6406
static int hf_dhcp_docsis_cm_cap_mpls_svid;
6407
static int hf_dhcp_docsis_cm_cap_mpls_spcp;
6408
static int hf_dhcp_docsis_cm_cap_mpls_sdei;
6409
static int hf_dhcp_docsis_cm_cap_mpls_ctpid;
6410
static int hf_dhcp_docsis_cm_cap_mpls_cvid;
6411
static int hf_dhcp_docsis_cm_cap_mpls_cpcp;
6412
static int hf_dhcp_docsis_cm_cap_mpls_ccfi;
6413
static int hf_dhcp_docsis_cm_cap_mpls_stci;
6414
static int hf_dhcp_docsis_cm_cap_mpls_ctci;
6415
static int hf_dhcp_docsis_cm_cap_mpls_itpid;
6416
static int hf_dhcp_docsis_cm_cap_mpls_isid;
6417
static int hf_dhcp_docsis_cm_cap_mpls_itci;
6418
static int hf_dhcp_docsis_cm_cap_mpls_ipcp;
6419
static int hf_dhcp_docsis_cm_cap_mpls_idei;
6420
static int hf_dhcp_docsis_cm_cap_mpls_iuca;
6421
static int hf_dhcp_docsis_cm_cap_mpls_btpid;
6422
static int hf_dhcp_docsis_cm_cap_mpls_btci;
6423
static int hf_dhcp_docsis_cm_cap_mpls_bpcp;
6424
static int hf_dhcp_docsis_cm_cap_mpls_bdei;
6425
static int hf_dhcp_docsis_cm_cap_mpls_bvid;
6426
static int hf_dhcp_docsis_cm_cap_mpls_bda;
6427
static int hf_dhcp_docsis_cm_cap_mpls_bsa;
6428
static int hf_dhcp_docsis_cm_cap_mpls_tc;
6429
static int hf_dhcp_docsis_cm_cap_mpls_label;
6430
6431
static const value_string docsis_cm_cap_enrgmang_vals[] = {
6432
  { 0x00, "Energy Management 1x1 Feature" },
6433
  { 0,    NULL }
6434
};
6435
6436
static const value_string docsis_cm_cap_usfreqrng_vals[] = {
6437
  { 0x00, "Standard Upstream Frequency Range" },
6438
  { 0x01, "Standard Upstream Frequency Range and Extended Upstream Frequency Range" },
6439
  { 0,    NULL }
6440
};
6441
6442
static const value_string docsis_cm_cap_map_ucd_receipt_vals[] = {
6443
  { 0x00, "CM cannot support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6444
  { 0x01, "CM can support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
6445
  { 0,    NULL }
6446
};
6447
6448
static const value_string docsis_cm_cap_map_dpv_support_vals[] = {
6449
  { 0x00, "U1 supported as a Start Reference Point for DPV per Path" },
6450
  { 0x01, "U1 supported as a Start Reference Point for DPV per Packet" },
6451
  { 0,    NULL }
6452
};
6453
6454
static const value_string docsis_cm_cap_map_multDsidForward_support_vals[] = {
6455
  { 0x00, "No support for multicast DSID forwarding" },
6456
  { 0x01, "Support for GMAC explicit multicast DSID forwarding" },
6457
  { 0x02, "Support for GMAC promiscuous multicast DSID forwarding" },
6458
  { 0,    NULL }
6459
};
6460
6461
static const value_string docsis_cm_cap_map_fctfc_support_vals[] = {
6462
  { 0x00, "Isolation Packet PDU MAC Header (FC_Type of 10) is not forwarded" },
6463
  { 0x01, "Isolation Packet PDU MAC Header (FC_Type of 10) is forwarded" },
6464
  { 0,    NULL }
6465
};
6466
6467
static const value_string docsis_cm_cap_map_l2vpn_esafe_index_support_vals[] = {
6468
  { 0x01, "ePs or eRouter" },
6469
  { 0x10, "eMTA" },
6470
  { 0x11, "eSTB-IP" },
6471
  { 0x12, "eSTB-DSG" },
6472
  { 0x13, "eTEA" },
6473
  { 0,    NULL }
6474
};
6475
6476
static int hf_dhcp_docsis_cm_cap_ussymrate_160;
6477
static int hf_dhcp_docsis_cm_cap_ussymrate_320;
6478
static int hf_dhcp_docsis_cm_cap_ussymrate_640;
6479
static int hf_dhcp_docsis_cm_cap_ussymrate_1280;
6480
static int hf_dhcp_docsis_cm_cap_ussymrate_2560;
6481
static int hf_dhcp_docsis_cm_cap_ussymrate_5120;
6482
6483
static void
6484
display_uint_with_range_checking(proto_item *ti, uint8_t val_byte, uint16_t val_uint16, int min_value, int max_value)
6485
4.93k
{
6486
4.93k
  uint16_t value;
6487
6488
4.93k
  if (0 != val_byte)
6489
1.93k
  {
6490
1.93k
    value = val_byte;
6491
1.93k
  }
6492
3.00k
  else
6493
3.00k
  {
6494
3.00k
    value = val_uint16;
6495
3.00k
  }
6496
4.93k
  proto_item_append_text(ti, "%i", value);
6497
4.93k
  if ((value < min_value) ||
6498
3.10k
      (value > max_value))
6499
2.89k
  {
6500
2.89k
    proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
6501
2.89k
  }
6502
4.93k
}
6503
6504
static void get_opt125_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6505
13.8k
{
6506
  /* Type */
6507
13.8k
  *tlvtype = tvb_get_uint8(tvb, off);
6508
  /* Length */
6509
13.8k
  *tlvlen  = tvb_get_uint8(tvb, off+1);
6510
  /* Value */
6511
13.8k
  *value = (uint8_t *)tvb_memdup(scope, tvb, off + 2, *tlvlen);
6512
13.8k
}
6513
6514
static void get_opt60_tlv(wmem_allocator_t *scope, tvbuff_t *tvb, unsigned off, uint8_t *tlvtype, uint8_t *tlvlen, uint8_t **value)
6515
3.94k
{
6516
3.94k
  unsigned  i;
6517
6518
  /* Type */
6519
3.94k
  tvb_get_string_uint8(tvb, off, 2, ENC_STR_HEX, tlvtype, NULL);
6520
  /* Length */
6521
3.94k
  tvb_get_string_uint8(tvb, off + 2, 2, ENC_STR_HEX, tlvlen, NULL);
6522
  /* Value */
6523
3.94k
  *value = (uint8_t *)wmem_alloc0(scope, *tlvlen);
6524
9.37k
  for (i=0; i<*tlvlen; i++)
6525
5.43k
  {
6526
5.43k
    tvb_get_string_uint8(tvb, off + ((i*2) + 4), 2, ENC_STR_HEX, &((*value)[i]), NULL);
6527
5.43k
  }
6528
3.94k
}
6529
6530
static void
6531
dissect_docsis_cm_cap(packet_info *pinfo, proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, bool opt125)
6532
736
{
6533
736
  proto_item *ti;
6534
736
  proto_tree *subtree;
6535
736
  uint8_t     tlv_type;
6536
736
  uint8_t     tlv_len;
6537
736
  uint8_t     val_byte   = 0;
6538
736
  uint16_t      val_uint16 = 0;
6539
736
  uint8_t    *val_other  = NULL;
6540
736
  unsigned      off        = voff;
6541
6542
736
  if (opt125)
6543
619
  {
6544
    /* Option 125 is formatted as uint8's */
6545
    /* Type */
6546
619
    tlv_type = tvb_get_uint8(tvb, off);
6547
    /* Length */
6548
619
    tlv_len  = tvb_get_uint8(tvb, off+1);
6549
619
    proto_tree_add_uint(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+1, 1, tlv_len);
6550
619
  }
6551
117
  else
6552
117
  {
6553
    /* Option 60 is formatted as an ASCII string.
6554
       Since the capabilities are the same for both options
6555
       I am converting the Option 60 values from ASCII to
6556
       uint8s to allow the same parser to work for both */
6557
117
    off += DOCSIS_CM_CAP_TLV_OFF;
6558
117
    tvb_get_string_uint8(tvb, off, 2, ENC_STR_HEX, &tlv_len, NULL);
6559
117
    proto_tree_add_uint(v_tree, hf_dhcp_docsis_cm_cap_len, tvb, off+2, 2, tlv_len);
6560
117
  }
6561
6562
736
  off+=2;
6563
6564
18.2k
  while (off - ((unsigned) voff) < ((unsigned) len))
6565
17.8k
  {
6566
17.8k
    tlv_type = 0;
6567
17.8k
    tlv_len = 0;
6568
17.8k
    val_byte = 0;
6569
17.8k
    val_uint16 = 0;
6570
6571
17.8k
    if (opt125)
6572
13.8k
    {
6573
13.8k
      get_opt125_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6574
13.8k
      ti =  proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6575
13.8k
               tlv_len + 2,
6576
13.8k
               tlv_type,
6577
13.8k
               "0x%02x: %s = ",
6578
13.8k
               tlv_type,
6579
13.8k
               val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6580
13.8k
    }
6581
3.94k
    else
6582
3.94k
    {
6583
      /* Option 60 is formatted as an ASCII string.  Since the capabilities
6584
         are the same for both options I am converting the Option 60 values
6585
         from ASCII to uint8s to allow the same parser to work for both */
6586
3.94k
      get_opt60_tlv(pinfo->pool, tvb, off, &tlv_type, &tlv_len, &val_other);
6587
3.94k
      ti =  proto_tree_add_uint_format(v_tree, hf_dhcp_docsis_cm_cap_type, tvb, off,
6588
3.94k
               (tlv_len * 2) + 4,
6589
3.94k
               tlv_type,
6590
3.94k
               "0x%02x: %s = ",
6591
3.94k
               tlv_type,
6592
3.94k
               val_to_str_const(tlv_type, docsis_cm_cap_type_vals, "unknown"));
6593
3.94k
    }
6594
6595
17.8k
    if (tlv_len == 1)
6596
3.77k
    {
6597
      /* The value refers to a byte. */
6598
3.77k
      val_byte = val_other[0];
6599
3.77k
    }
6600
14.0k
    else
6601
14.0k
    {
6602
14.0k
      if (tlv_len == 2)
6603
1.17k
      {
6604
        /* The value refers to a uint16. */
6605
1.17k
        val_uint16 = (val_other[0] << 8) + val_other[1];
6606
1.17k
      }
6607
14.0k
    }
6608
6609
17.8k
    switch (tlv_type)
6610
17.8k
    {
6611
584
    case DOCSIS_CM_CAP_CONCAT_SUP:
6612
987
    case DOCSIS_CM_CAP_FRAG_SUP:
6613
1.82k
    case DOCSIS_CM_CAP_PHS_SUP:
6614
2.11k
    case DOCSIS_CM_CAP_IGMP_SUP:
6615
2.22k
    case DOCSIS_CM_CAP_DCC_SUP:
6616
2.36k
    case DOCSIS_CM_CAP_EXPUNI_SPACE:
6617
2.56k
    case DOCSIS_CM_CAP_DUTFILT_SUP:
6618
2.76k
    case DOCSIS_CM_CAP_SACM2_SUP:
6619
2.97k
    case DOCSIS_CM_CAP_SACM2HOP_SUP:
6620
3.04k
    case DOCSIS_CM_CAP_IPV6_SUP:
6621
3.04k
      proto_item_append_text(ti,
6622
3.04k
                 "%s",
6623
3.04k
                 val_to_str_const(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
6624
3.04k
      break;
6625
220
    case DOCSIS_CM_CAP_DOCSIS_VER:
6626
220
      proto_item_append_text(ti,
6627
220
                 "%s",
6628
220
                 val_to_str_const(val_byte, docsis_cm_cap_version_vals, "Reserved"));
6629
220
      break;
6630
249
    case DOCSIS_CM_CAP_PRIV_SUP:
6631
249
      proto_item_append_text(ti,
6632
249
                 "%s",
6633
249
                 val_to_str_const(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
6634
249
      break;
6635
116
    case DOCSIS_CM_CAP_FILT_SUP:
6636
116
      proto_item_append_text(ti,
6637
116
                 "%s",
6638
116
                 val_to_str_const(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
6639
116
      break;
6640
168
    case DOCSIS_CM_CAP_L2VPN_SUP:
6641
168
      proto_item_append_text(ti,
6642
168
                 "%s",
6643
168
                 val_to_str_const(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
6644
168
      break;
6645
138
    case DOCSIS_CM_CAP_L2VPN_HOST_SUP:
6646
138
      if (tlv_len == 7) {
6647
38
        proto_item_append_text(ti,
6648
38
                   "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
6649
38
                   val_to_str_const(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
6650
38
                   val_other[0],
6651
38
                   val_other[1],
6652
38
                   val_other[2],
6653
38
                   val_other[3],
6654
38
                   val_other[4],
6655
38
                   val_other[5],
6656
38
                   val_other[6]);
6657
100
      } else {
6658
100
        proto_item_append_text(ti,
6659
100
                   "Invalid (length should be 7, is %d)",
6660
100
                   tlv_len);
6661
100
      }
6662
138
      break;
6663
51
    case DOCSIS_CM_CAP_USFREQRNG_SUP:
6664
51
      proto_item_append_text(ti,
6665
51
                 "%s",
6666
51
                 val_to_str_const(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
6667
51
      break;
6668
153
    case DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP:
6669
153
      proto_item_append_text(ti,
6670
153
                 "%s",
6671
153
                 val_to_str_const(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
6672
153
      break;
6673
229
    case DOCSIS_CM_CAP_DPV_SUP:
6674
229
      proto_item_append_text(ti,
6675
229
                 "%s",
6676
229
                 val_to_str_const(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
6677
229
      break;
6678
192
    case DOCSIS_CM_CAP_DSAID_SUP:
6679
304
    case DOCSIS_CM_CAP_MULTTXCHAN_SUP:
6680
422
    case DOCSIS_CM_CAP_512USTXCHAN_SUP:
6681
605
    case DOCSIS_CM_CAP_256USTXCHAN_SUP:
6682
801
    case DOCSIS_CM_CAP_TOTALSIDCLU_SUP:
6683
955
    case DOCSIS_CM_CAP_MULTRXCHAN_SUP:
6684
1.10k
    case DOCSIS_CM_CAP_UGSPERUSFLOW_SUP:
6685
1.32k
    case DOCSIS_CM_CAP_USSF_SUP:
6686
1.32k
      display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
6687
1.32k
      break;
6688
155
    case DOCSIS_CM_CAP_RESEQDSID_SUP:
6689
552
    case DOCSIS_CM_CAP_MULTDSID_SUP:
6690
552
      display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
6691
552
      break;
6692
611
    case DOCSIS_CM_CAP_SIDCLUPERSF_SUP:
6693
611
      display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
6694
611
      break;
6695
857
    case DOCSIS_CM_CAP_TOTALDSID_SUP:
6696
857
      display_uint_with_range_checking(ti, val_byte, val_uint16, 32, 255);
6697
857
      break;
6698
507
    case DOCSIS_CM_CAP_TET:
6699
507
      display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
6700
507
      break;
6701
747
    case DOCSIS_CM_CAP_TET_MI:
6702
747
      if ((val_byte == 1) ||
6703
632
          (val_byte == 2) ||
6704
507
          (val_byte == 4))
6705
452
      {
6706
452
        proto_item_append_text(ti,
6707
452
                   " %i",
6708
452
                   val_byte);
6709
452
      }
6710
295
      else
6711
295
      {
6712
295
        proto_item_append_text(ti,
6713
295
                   " (Invalid Value %i : Should be [1,2,4]",
6714
295
                   val_byte);
6715
295
      }
6716
747
      break;
6717
121
    case DOCSIS_CM_CAP_IPFILT_SUP:
6718
332
    case DOCSIS_CM_CAP_USDROPCLASSIF_SUP:
6719
332
      display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
6720
332
      break;
6721
349
    case DOCSIS_CM_CAP_LLCFILT_SUP:
6722
349
      display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
6723
349
      break;
6724
568
    case DOCSIS_CM_CAP_ExUsTrPow:
6725
568
      if (val_byte == 0)
6726
157
      {
6727
157
        proto_item_append_text(ti, "%i", val_byte);
6728
157
      }
6729
411
      else
6730
411
      {
6731
411
        display_uint_with_range_checking(ti, val_byte, val_uint16, 205, 244);
6732
411
      }
6733
568
      break;
6734
411
    case DOCSIS_CM_CAP_Opt802MPLSSup:
6735
411
      proto_item_append_text(ti,
6736
411
                 "0x%02x", val_byte);
6737
417
    case DOCSIS_CM_CAP_DounEnc:
6738
      /* TODO: add D-ONU Capabilities Encoding according DPoE-SP-MULPIv1.0-I02-120607 */
6739
417
      break;
6740
116
    case DOCSIS_CM_CAP_EnrgMang:
6741
116
      proto_item_append_text(ti,
6742
116
                 "%s",
6743
116
                 val_to_str_const(val_byte, docsis_cm_cap_enrgmang_vals, "Reserved"));
6744
116
      break;
6745
296
    case DOCSIS_CM_CAP_RNGHLDOFF_SUP:
6746
296
      proto_item_append_text(ti,
6747
296
                 "Ranging ID ");
6748
296
      if (tlv_len == 4)
6749
156
      {
6750
156
        proto_item_append_text(ti,
6751
156
            "(0x%04x)", (val_other[0] << sizeof(uint8_t)) + val_other[1]);
6752
156
        proto_item_append_text(ti,
6753
156
            " Component Bit Mask ");
6754
156
        proto_item_append_text(ti,
6755
156
            "(0x%04x)", (val_other[2] << sizeof(uint8_t)) + val_other[3]);
6756
156
      }
6757
140
      else
6758
140
      {
6759
140
        proto_item_append_text(ti,
6760
140
            " (Invalid Length %u : Should be 4",
6761
140
            tlv_len);
6762
140
      }
6763
296
      break;
6764
169
    case DOCSIS_CM_CAP_USSYMRATE_SUP:
6765
169
      proto_item_append_text(ti,
6766
169
                 "0x%02x", val_byte);
6767
169
      break;
6768
97
    case DOCSIS_CM_CAP_FCTF_SUP:
6769
97
      proto_item_append_text(ti,
6770
97
                 "%s",
6771
97
                 val_to_str_const(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
6772
97
      break;
6773
185
    case DOCSIS_CM_CAP_MULTDSIDFW_SUP:
6774
185
      proto_item_append_text(ti,
6775
185
                 "%s",
6776
185
                 val_to_str_const(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
6777
185
      break;
6778
17.8k
    }
6779
6780
17.5k
    subtree = proto_item_add_subtree(ti, ett_dhcp_option);
6781
17.5k
    if (tlv_type == DOCSIS_CM_CAP_RNGHLDOFF_SUP && tlv_len >= 4)
6782
174
    {
6783
174
      static int * const flags[] = {
6784
174
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
6785
174
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
6786
174
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
6787
174
        &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
6788
174
        NULL
6789
174
      };
6790
174
      val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6791
6792
174
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6793
174
    }
6794
17.5k
    if (tlv_type == DOCSIS_CM_CAP_USSYMRATE_SUP)
6795
169
    {
6796
169
      static int * const flags[] = {
6797
169
        &hf_dhcp_docsis_cm_cap_ussymrate_160,
6798
169
        &hf_dhcp_docsis_cm_cap_ussymrate_320,
6799
169
        &hf_dhcp_docsis_cm_cap_ussymrate_640,
6800
169
        &hf_dhcp_docsis_cm_cap_ussymrate_1280,
6801
169
        &hf_dhcp_docsis_cm_cap_ussymrate_2560,
6802
169
        &hf_dhcp_docsis_cm_cap_ussymrate_5120,
6803
169
        NULL
6804
169
      };
6805
6806
169
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 1, flags, val_byte);
6807
169
    }
6808
17.5k
    if (tlv_type == DOCSIS_CM_CAP_Opt802MPLSSup && tlv_len >= 4)
6809
96
    {
6810
96
      static int * const flags[] = {
6811
96
        &hf_dhcp_docsis_cm_cap_mpls_stpid,
6812
96
        &hf_dhcp_docsis_cm_cap_mpls_svid,
6813
96
        &hf_dhcp_docsis_cm_cap_mpls_spcp,
6814
96
        &hf_dhcp_docsis_cm_cap_mpls_sdei,
6815
96
        &hf_dhcp_docsis_cm_cap_mpls_ctpid,
6816
96
        &hf_dhcp_docsis_cm_cap_mpls_cvid,
6817
96
        &hf_dhcp_docsis_cm_cap_mpls_cpcp,
6818
96
        &hf_dhcp_docsis_cm_cap_mpls_ccfi,
6819
96
        &hf_dhcp_docsis_cm_cap_mpls_stci,
6820
96
        &hf_dhcp_docsis_cm_cap_mpls_ctci,
6821
96
        &hf_dhcp_docsis_cm_cap_mpls_itpid,
6822
96
        &hf_dhcp_docsis_cm_cap_mpls_isid,
6823
96
        &hf_dhcp_docsis_cm_cap_mpls_itci,
6824
96
        &hf_dhcp_docsis_cm_cap_mpls_ipcp,
6825
96
        &hf_dhcp_docsis_cm_cap_mpls_idei,
6826
96
        &hf_dhcp_docsis_cm_cap_mpls_iuca,
6827
96
        &hf_dhcp_docsis_cm_cap_mpls_btpid,
6828
96
        &hf_dhcp_docsis_cm_cap_mpls_btci,
6829
96
        &hf_dhcp_docsis_cm_cap_mpls_bpcp,
6830
96
        &hf_dhcp_docsis_cm_cap_mpls_bdei,
6831
96
        &hf_dhcp_docsis_cm_cap_mpls_bvid,
6832
96
        &hf_dhcp_docsis_cm_cap_mpls_bda,
6833
96
        &hf_dhcp_docsis_cm_cap_mpls_bsa,
6834
96
        &hf_dhcp_docsis_cm_cap_mpls_tc,
6835
96
        &hf_dhcp_docsis_cm_cap_mpls_label,
6836
96
        NULL
6837
96
      };
6838
96
      val_uint16 = (val_other[2] << sizeof(uint8_t)) + val_other[3];
6839
6840
96
      proto_tree_add_bitmask_list_value(subtree, tvb, off + 2, 4, flags, val_uint16);
6841
96
    }
6842
17.5k
    if (opt125)
6843
13.7k
    {
6844
13.7k
      off += (tlv_len) + 2;
6845
13.7k
    }
6846
3.85k
    else
6847
3.85k
    {
6848
3.85k
      off += (tlv_len *2) + 4;
6849
3.85k
    }
6850
6851
17.5k
  }
6852
736
}
6853
6854
static bool
6855
dissect_packetcable_cm_vendor_id_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
6856
1.44k
{
6857
1.44k
  uint8_t* vendor_id;
6858
6859
1.44k
  if (tvb_reported_length(tvb) < 10) {
6860
145
    return false;
6861
145
  }
6862
6863
1.30k
  vendor_id = tvb_get_string_enc(pinfo->pool, tvb, 0, 10, ENC_ASCII|ENC_NA);
6864
1.30k
  if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP11) == 0) ||
6865
1.24k
    (strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP20) == 0)) {
6866
117
    dissect_docsis_cm_cap(pinfo, tree, tvb, 0, tvb_reported_length(tvb), false);
6867
117
    return true;
6868
117
  }
6869
6870
1.18k
  if ((strcmp((const char*)vendor_id, PACKETCABLE_CM_CAP30) == 0)) {
6871
2
    proto_tree_add_item(tree, hf_dhcp_option_vendor_class_data, tvb, 0, tvb_reported_length(tvb), ENC_ASCII);
6872
2
    return true;
6873
2
  }
6874
6875
1.18k
  return false;
6876
1.18k
}
6877
6878
static bool
6879
dissect_apple_bsdp_vendor_id_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6880
6881
1.53k
{
6882
1.53k
  int vendor_id_len = (int)strlen(APPLE_BSDP_CLIENT);
6883
1.53k
  if ((int)tvb_reported_length(tvb) < vendor_id_len) {
6884
146
    return false;
6885
146
  }
6886
6887
1.39k
  if (tvb_memeql(tvb, 0, (const uint8_t*)APPLE_BSDP_CLIENT, vendor_id_len) == 0) {
6888
98
    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);
6889
98
    return true;
6890
98
  }
6891
6892
1.29k
  return false;
6893
1.39k
}
6894
6895
6896
/* Definitions specific to PKT-SP-PROV-I05-021127 begin with "PKT_CCC_I05".
6897
   Definitions specific to IETF draft 5 and RFC 3495 begin with "PKT_CCC_IETF".
6898
   Shared definitions begin with "PKT_CCC".
6899
 */
6900
460
#define PKT_CCC_PRI_DHCP       1
6901
788
#define PKT_CCC_SEC_DHCP       2
6902
0
#define PKT_CCC_I05_SNMP       3
6903
583
#define PKT_CCC_IETF_PROV_SRV  3
6904
0
#define PKT_CCC_I05_PRI_DNS    4
6905
475
#define PKT_CCC_IETF_AS_KRB    4
6906
0
#define PKT_CCC_I05_SEC_DNS    5
6907
329
#define PKT_CCC_IETF_AP_KRB    5
6908
353
#define PKT_CCC_KRB_REALM      6
6909
344
#define PKT_CCC_TGT_FLAG       7
6910
309
#define PKT_CCC_PROV_TIMER     8
6911
0
#define PKT_CCC_CMS_FQDN       9
6912
317
#define PKT_CCC_IETF_SEC_TKT   9
6913
0
#define PKT_CCC_AS_KRB        10
6914
0
#define PKT_CCC_AP_KRB        11
6915
0
#define PKT_CCC_MTA_KRB_CLEAR 12
6916
6917
static const value_string pkt_i05_ccc_opt_vals[] = {
6918
  { PKT_CCC_PRI_DHCP,   "Primary DHCP Server" },
6919
  { PKT_CCC_SEC_DHCP,   "Secondary DHCP Server" },
6920
  { PKT_CCC_I05_SNMP,   "SNMP Entity" },
6921
  { PKT_CCC_I05_PRI_DNS,    "Primary DNS Server" },
6922
  { PKT_CCC_I05_SEC_DNS,    "Secondary DNS Server" },
6923
  { PKT_CCC_KRB_REALM,    "Kerberos Realm" },
6924
  { PKT_CCC_TGT_FLAG,   "MTA should fetch TGT?" },
6925
  { PKT_CCC_PROV_TIMER,   "Provisioning Timer" },
6926
  { PKT_CCC_CMS_FQDN,   "CMS FQDN" },
6927
  { PKT_CCC_AS_KRB,   "AS-REQ/AS-REP Backoff and Retry" },
6928
  { PKT_CCC_AP_KRB,   "AP-REQ/AP-REP Backoff and Retry" },
6929
  { PKT_CCC_MTA_KRB_CLEAR,  "MTA should clear Kerberos tickets?" },
6930
  { 0, NULL },
6931
};
6932
6933
static const value_string pkt_draft5_ccc_opt_vals[] = {
6934
  { PKT_CCC_PRI_DHCP,   "TSP's Primary DHCP Server" },
6935
  { PKT_CCC_SEC_DHCP,   "TSP's Secondary DHCP Server" },
6936
  { PKT_CCC_IETF_PROV_SRV,  "TSP's Provisioning Server" },
6937
  { PKT_CCC_IETF_AS_KRB,    "TSP's AS-REQ/AS-REP Backoff and Retry" },
6938
  { PKT_CCC_IETF_AP_KRB,    "TSP's AP-REQ/AP-REP Backoff and Retry" },
6939
  { PKT_CCC_KRB_REALM,    "TSP's Kerberos Realm Name" },
6940
  { PKT_CCC_TGT_FLAG,   "TSP's Ticket Granting Server Utilization" },
6941
  { PKT_CCC_PROV_TIMER,   "TSP's Provisioning Timer Value" },
6942
  { PKT_CCC_IETF_SEC_TKT,   "PacketCable Security Ticket Control" },
6943
  { 0, NULL },
6944
};
6945
6946
static const value_string pkt_i05_ccc_ticket_ctl_vals[] = {
6947
  { 1, "Invalidate Provisioning Application Server's ticket" },
6948
  { 2, "Invalidate all CMS Application Server tickets" },
6949
  { 3, "Invalidate all Application Server tickets" },
6950
  { 0, NULL },
6951
};
6952
6953
static unsigned
6954
dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
6955
          tvbuff_t *tvb, unsigned optoff, unsigned optend)
6956
0
{
6957
0
  unsigned    suboptoff = optoff;
6958
0
  uint8_t     subopt, subopt_len, fetch_tgt, timer_val, ticket_ctl;
6959
0
  proto_tree *pkt_s_tree;
6960
0
  proto_item *vti;
6961
6962
0
  subopt = tvb_get_uint8(tvb, optoff);
6963
0
  suboptoff++;
6964
6965
0
  if (suboptoff >= optend) {
6966
0
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
6967
0
                  "Suboption %d: no room left in option for suboption length", subopt);
6968
0
    return (optend);
6969
0
  }
6970
6971
0
  subopt_len = tvb_get_uint8(tvb, optoff);
6972
0
  suboptoff++;
6973
6974
0
  vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_i05_ccc_suboption, tvb, optoff, 1, subopt);
6975
0
  proto_item_set_len(vti, subopt_len + 2);
6976
0
  proto_item_append_text(vti, ": ");
6977
6978
0
  switch (subopt) {
6979
6980
0
  case PKT_CCC_PRI_DHCP: /* String values */
6981
0
  case PKT_CCC_SEC_DHCP:
6982
0
  case PKT_CCC_I05_SNMP:
6983
0
  case PKT_CCC_I05_PRI_DNS:
6984
0
  case PKT_CCC_I05_SEC_DNS:
6985
0
  case PKT_CCC_KRB_REALM:
6986
0
  case PKT_CCC_CMS_FQDN:
6987
0
    proto_item_append_text(vti, "%s (%u byte%s)",
6988
0
               tvb_format_stringzpad(pinfo->pool, tvb, suboptoff, subopt_len),
6989
0
               subopt_len,
6990
0
               plurality(subopt_len, "", "s") );
6991
0
    suboptoff += subopt_len;
6992
0
    break;
6993
6994
0
  case PKT_CCC_TGT_FLAG:
6995
0
    if (suboptoff+1 > optend) {
6996
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
6997
0
      return (optend);
6998
0
    }
6999
0
    fetch_tgt = tvb_get_uint8(tvb, suboptoff);
7000
0
    proto_item_append_text(vti, "%s (%u byte%s%s)",
7001
0
               fetch_tgt ? "Yes" : "No",
7002
0
               subopt_len,
7003
0
               plurality(subopt_len, "", "s"),
7004
0
               subopt_len != 1 ? " [Invalid]" : "");
7005
0
    suboptoff += subopt_len;
7006
0
    break;
7007
7008
0
  case PKT_CCC_PROV_TIMER:
7009
0
    if (suboptoff+1 > optend) {
7010
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7011
0
      return (optend);
7012
0
    }
7013
0
    timer_val = tvb_get_uint8(tvb, suboptoff);
7014
0
    proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
7015
0
               timer_val > 30 ? " [Invalid]" : "",
7016
0
               subopt_len,
7017
0
               plurality(subopt_len, "", "s"),
7018
0
               subopt_len != 1 ? " [Invalid]" : "");
7019
0
    suboptoff += subopt_len;
7020
0
    break;
7021
7022
0
  case PKT_CCC_AS_KRB:
7023
0
    if (suboptoff+12 > optend) {
7024
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7025
0
      return (optend);
7026
0
    }
7027
0
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7028
0
               plurality(subopt_len, "", "s"),
7029
0
               subopt_len != 12 ? " [Invalid]" : "");
7030
0
    if (subopt_len == 12) {
7031
0
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7032
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);
7033
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);
7034
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);
7035
0
    }
7036
0
    suboptoff += subopt_len;
7037
0
    break;
7038
7039
0
  case PKT_CCC_AP_KRB:
7040
0
    if (suboptoff+12 > optend) {
7041
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7042
0
      return (optend);
7043
0
    }
7044
0
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7045
0
               plurality(subopt_len, "", "s"),
7046
0
               subopt_len != 12 ? " [Invalid]" : "");
7047
0
    if (subopt_len == 12) {
7048
0
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7049
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);
7050
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);
7051
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);
7052
0
    }
7053
0
    suboptoff += subopt_len;
7054
0
    break;
7055
7056
0
  case PKT_CCC_MTA_KRB_CLEAR:
7057
0
    if (suboptoff+1 > optend) {
7058
0
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7059
0
      return (optend);
7060
0
    }
7061
0
    ticket_ctl = tvb_get_uint8(tvb, suboptoff);
7062
0
    proto_item_append_text(vti, "%s (%u) (%u byte%s%s)",
7063
0
               val_to_str_const (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
7064
0
               ticket_ctl,
7065
0
               subopt_len,
7066
0
               plurality(subopt_len, "", "s"),
7067
0
               subopt_len != 1 ? " [Invalid]" : "");
7068
0
    suboptoff += subopt_len;
7069
0
    break;
7070
7071
0
  default:
7072
0
    suboptoff += subopt_len;
7073
0
    break;
7074
7075
0
  }
7076
0
  return suboptoff;
7077
0
}
7078
7079
static int hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server;
7080
static int hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management;
7081
7082
static unsigned
7083
dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
7084
           tvbuff_t *tvb, unsigned optoff, unsigned optend, int revision)
7085
5.54k
{
7086
5.54k
  unsigned      suboptoff     = optoff;
7087
5.54k
  uint8_t       subopt, subopt_len;
7088
5.54k
  uint8_t       prov_type, fetch_tgt, timer_val;
7089
5.54k
  uint16_t        sec_tcm;
7090
5.54k
  proto_tree   *pkt_s_tree;
7091
5.54k
  proto_item   *vti;
7092
5.54k
  int       max_timer_val = 255;
7093
5.54k
  const char *dns_name;
7094
5.54k
  int      dns_name_len;
7095
7096
5.54k
  subopt = tvb_get_uint8(tvb, suboptoff);
7097
5.54k
  suboptoff++;
7098
7099
5.54k
  if (suboptoff >= optend) {
7100
18
    expert_add_info_format(pinfo, v_ti, &ei_dhcp_missing_subopt_length,
7101
18
                  "Suboption %d: no room left in option for suboption length", subopt);
7102
18
    return (optend);
7103
18
  }
7104
5.52k
  subopt_len = tvb_get_uint8(tvb, suboptoff);
7105
5.52k
  suboptoff++;
7106
7107
5.52k
  vti = proto_tree_add_uint(v_tree, hf_dhcp_pc_ietf_ccc_suboption, tvb, optoff, 1, subopt);
7108
5.52k
  proto_item_set_len(vti, subopt_len + 2);
7109
5.52k
  proto_item_append_text(vti, ": ");
7110
7111
5.52k
  switch (subopt) {
7112
7113
460
  case PKT_CCC_PRI_DHCP: /* IPv4 values */
7114
788
  case PKT_CCC_SEC_DHCP:
7115
788
    if (suboptoff+4 > optend) {
7116
6
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7117
6
      return (optend);
7118
6
    }
7119
782
    proto_item_append_text(vti, "%s (%u byte%s%s)",
7120
782
               tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7121
782
               subopt_len,
7122
782
               plurality(subopt_len, "", "s"),
7123
782
               subopt_len != 4 ? " [Invalid]" : "");
7124
782
    suboptoff += subopt_len;
7125
782
    break;
7126
7127
583
  case PKT_CCC_IETF_PROV_SRV:
7128
583
    if (suboptoff+1 > optend) {
7129
1
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7130
1
      return (optend);
7131
1
    }
7132
582
    prov_type = tvb_get_uint8(tvb, suboptoff);
7133
582
    suboptoff += 1;
7134
582
    switch (prov_type) {
7135
7136
95
    case 0:
7137
95
      get_dns_name(pinfo->pool, tvb, suboptoff, subopt_len, suboptoff, (const char **)&dns_name, &dns_name_len);
7138
95
      proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7139
95
                 subopt_len - 1, plurality(subopt_len, "", "s") );
7140
95
      break;
7141
7142
141
    case 1:
7143
141
      if (suboptoff+4 > optend) {
7144
4
        expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7145
4
        return (optend);
7146
4
      }
7147
137
      proto_item_append_text(vti, "%s (%u byte%s%s)",
7148
137
                 tvb_ip_to_str(pinfo->pool, tvb, suboptoff),
7149
137
                 subopt_len,
7150
137
                 plurality(subopt_len, "", "s"),
7151
137
                 subopt_len != 5 ? " [Invalid]" : "");
7152
137
      break;
7153
7154
346
    default:
7155
346
      proto_item_append_text(vti, "Invalid type: %u (%u byte%s)",
7156
346
                 prov_type,
7157
346
                 subopt_len,
7158
346
                 plurality(subopt_len, "", "s") );
7159
346
      break;
7160
582
    }
7161
573
    suboptoff += subopt_len - 1;
7162
573
    break;
7163
7164
475
  case PKT_CCC_IETF_AS_KRB:
7165
475
    if (suboptoff+12 > optend) {
7166
13
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7167
13
      return (optend);
7168
13
    }
7169
462
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7170
462
               plurality(subopt_len, "", "s"),
7171
462
               subopt_len != 12 ? " [Invalid]" : "");
7172
462
    if (subopt_len == 12) {
7173
36
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7174
36
      proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7175
36
      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);
7176
36
      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);
7177
36
    }
7178
462
    suboptoff += subopt_len;
7179
462
    break;
7180
7181
329
  case PKT_CCC_IETF_AP_KRB:
7182
329
    proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
7183
329
               plurality(subopt_len, "", "s"),
7184
329
               subopt_len != 12 ? " [Invalid]" : "");
7185
329
    if (subopt_len == 12) {
7186
42
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7187
42
      proto_tree_add_item(pkt_s_tree, hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
7188
42
      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);
7189
42
      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);
7190
42
    }
7191
329
    suboptoff += subopt_len;
7192
329
    break;
7193
7194
353
  case PKT_CCC_KRB_REALM: /* String values */
7195
353
    get_dns_name(pinfo->pool, tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
7196
353
    proto_item_append_text(vti, "%s (%u byte%s)", format_text(pinfo->pool, dns_name, dns_name_len),
7197
353
               subopt_len, plurality(subopt_len, "", "s") );
7198
353
    suboptoff += subopt_len;
7199
353
    break;
7200
7201
344
  case PKT_CCC_TGT_FLAG:
7202
344
    if (suboptoff+1 > optend) {
7203
2
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7204
2
      return (optend);
7205
2
    }
7206
342
    fetch_tgt = tvb_get_uint8(tvb, suboptoff);
7207
342
    proto_item_append_text(vti, "%s (%u byte%s%s)",
7208
342
               fetch_tgt ? "Yes" : "No",
7209
342
               subopt_len,
7210
342
               plurality(subopt_len, "", "s"),
7211
342
               subopt_len != 1 ? " [Invalid]" : "");
7212
342
    suboptoff += 1;
7213
342
    break;
7214
7215
309
  case PKT_CCC_PROV_TIMER:
7216
309
    if (suboptoff+1 > optend) {
7217
2
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7218
2
      return (optend);
7219
2
    }
7220
307
    if (revision == PACKETCABLE_CCC_DRAFT5)
7221
0
      max_timer_val = 30;
7222
307
    timer_val = tvb_get_uint8(tvb, suboptoff);
7223
307
    proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
7224
307
               timer_val > max_timer_val ? " [Invalid]" : "",
7225
307
               subopt_len,
7226
307
               plurality(subopt_len, "", "s"),
7227
307
               subopt_len != 1 ? " [Invalid]" : "");
7228
307
    suboptoff += 1;
7229
307
    break;
7230
7231
317
  case PKT_CCC_IETF_SEC_TKT:
7232
317
    if (suboptoff+2 > optend) {
7233
3
      expert_add_info(pinfo, vti, &ei_dhcp_missing_subopt_value);
7234
3
      return (optend);
7235
3
    }
7236
314
    sec_tcm = tvb_get_ntohs(tvb, suboptoff);
7237
314
    proto_item_append_text(vti, "0x%04x (%u byte%s%s)", sec_tcm, subopt_len,
7238
314
               plurality(subopt_len, "", "s"),
7239
314
               subopt_len != 2 ? " [Invalid]" : "");
7240
314
    if (subopt_len == 2) {
7241
96
      pkt_s_tree = proto_item_add_subtree(vti, ett_dhcp_option);
7242
96
      proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server, tvb, suboptoff, 2, sec_tcm);
7243
96
      proto_tree_add_boolean(pkt_s_tree, hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management, tvb, suboptoff, 2, sec_tcm);
7244
96
    }
7245
314
    suboptoff += subopt_len;
7246
314
    break;
7247
7248
2.02k
  default:
7249
2.02k
    suboptoff += subopt_len;
7250
2.02k
    break;
7251
5.52k
  }
7252
5.47k
  return suboptoff;
7253
5.52k
}
7254
7255
static int
7256
dissect_dhcpopt_packetcable_ccc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7257
238
{
7258
238
  unsigned offset = 0;
7259
7260
5.76k
  while (tvb_reported_length_remaining(tvb, offset) > 0) {
7261
5.54k
    switch (pkt_ccc_protocol_version) {
7262
7263
0
    case PACKETCABLE_CCC_I05:
7264
0
      offset = dissect_packetcable_i05_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb));
7265
0
      break;
7266
0
    case PACKETCABLE_CCC_DRAFT5:
7267
5.54k
    case PACKETCABLE_CCC_RFC_3495:
7268
5.54k
      offset = dissect_packetcable_ietf_ccc(pinfo, tree, tree, tvb, offset, tvb_reported_length(tvb), pkt_ccc_protocol_version);
7269
5.54k
      break;
7270
0
    default: /* XXX Should we do something here? */
7271
0
      break;
7272
5.54k
    }
7273
5.54k
  }
7274
7275
221
  return tvb_captured_length(tvb);
7276
238
}
7277
7278
1.10k
#define BOOTREQUEST 1
7279
43
#define BOOTREPLY 2
7280
7281
static const value_string op_vals[] = {
7282
  { BOOTREQUEST,  "Boot Request" },
7283
  { BOOTREPLY,  "Boot Reply" },
7284
  { 0,    NULL }
7285
};
7286
7287
static int
7288
dissect_dhcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
7289
12.8k
{
7290
12.8k
  proto_tree   *bp_tree;
7291
12.8k
  proto_item   *bp_ti, *ti;
7292
12.8k
  proto_item   *file_ti, *sname_ti;
7293
12.8k
  proto_item   *fi, *hidden_item;
7294
12.8k
  uint8_t       op;
7295
12.8k
  uint8_t       htype, hlen;
7296
12.8k
  unsigned      voff, eoff; /* vendor offset, end offset */
7297
12.8k
  unsigned      tmpvoff, tmpvoff_end;
7298
12.8k
  uint32_t        ip_addr;
7299
12.8k
  bool          at_end;
7300
12.8k
  bool          isProxyDhcp;
7301
12.8k
  const char   *dhcp_type            = NULL;
7302
12.8k
  const uint8_t *vendor_class_id           = NULL;
7303
12.8k
  uint16_t        flags, secs;
7304
12.8k
  unsigned      offset_delta;
7305
12.8k
  uint8_t       overload             = 0; /* DHCP option overload */
7306
12.8k
  static int * const dhcp_flags[] = {
7307
12.8k
    &hf_dhcp_flags_broadcast,
7308
12.8k
    &hf_dhcp_flags_reserved,
7309
12.8k
    NULL
7310
12.8k
  };
7311
7312
12.8k
  if (pinfo->srcport == PROXYDHCP_UDP_PORT ||
7313
12.8k
      pinfo->destport == PROXYDHCP_UDP_PORT) {
7314
    /* The "DHCP magic" is mandatory for proxyDHCP. Use it as a heuristic. */
7315
0
    if (!tvb_bytes_exist(tvb, VENDOR_INFO_OFFSET, 4) ||
7316
0
        tvb_get_ntohl(tvb, VENDOR_INFO_OFFSET) != 0x63825363) {
7317
   /* Not a DHCP packet at all. */
7318
0
      return 0;
7319
0
    }
7320
0
    isProxyDhcp = true;
7321
12.8k
  } else {
7322
12.8k
    isProxyDhcp = false;
7323
12.8k
  }
7324
7325
12.8k
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "BOOTP");
7326
  /*
7327
   * In case we throw an exception fetching the opcode, etc.
7328
   */
7329
12.8k
  col_clear(pinfo->cinfo, COL_INFO);
7330
7331
12.8k
  op = tvb_get_uint8(tvb, 0);
7332
12.8k
  htype = tvb_get_uint8(tvb, 1);
7333
12.8k
  hlen = tvb_get_uint8(tvb, 2);
7334
12.8k
  switch (op) {
7335
7336
1.10k
  case BOOTREQUEST:
7337
1.10k
    if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7338
316
        && hlen == 6) {
7339
189
      col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
7340
189
             tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype),
7341
189
             tvb_get_ether_name(tvb, 28));
7342
189
    }
7343
915
    else {
7344
915
      col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
7345
915
             tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7346
915
    }
7347
1.10k
    break;
7348
7349
43
  case BOOTREPLY:
7350
43
    col_set_str(pinfo->cinfo, COL_INFO, "Boot Reply");
7351
43
    break;
7352
7353
11.6k
  default:
7354
11.6k
    col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)", op);
7355
11.6k
    break;
7356
12.8k
  }
7357
7358
12.7k
  voff = VENDOR_INFO_OFFSET;
7359
7360
  /* rfc2132 says it SHOULD exist, not that it MUST exist */
7361
12.7k
  if (tvb_bytes_exist(tvb, voff, 4) &&
7362
12.4k
      (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7363
3.38k
    voff += 4;
7364
9.37k
  } else {
7365
9.37k
    voff += 64;
7366
9.37k
  }
7367
12.7k
  eoff = tvb_reported_length(tvb);
7368
7369
12.7k
  bp_ti = proto_tree_add_item(tree, proto_dhcp, tvb, 0, -1, ENC_NA);
7370
12.7k
  bp_tree = proto_item_add_subtree(bp_ti, ett_dhcp);
7371
7372
12.7k
  wmem_map_t *rfc3396_map = wmem_map_new(pinfo->pool, g_direct_hash, g_direct_equal);
7373
  /*
7374
   * In the first pass, we just look for the overload, DHCP message type
7375
   * and Vendor class identifier options, and any repeated options for
7376
   * RFC 3396 long option concatenation.
7377
   */
7378
12.7k
  tmpvoff = voff;
7379
12.7k
  at_end = false;
7380
47.8k
  while (tmpvoff < eoff && !at_end) {
7381
35.0k
    offset_delta = dhcp_option(tvb, pinfo, NULL, tmpvoff, eoff, true, &at_end,
7382
35.0k
        &dhcp_type, &vendor_class_id, &overload, rfc3396_map);
7383
35.0k
    if (offset_delta <= 0) {
7384
0
      proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7385
0
          tvb, tmpvoff, eoff);
7386
0
      return tmpvoff;
7387
0
    }
7388
35.0k
    tmpvoff += offset_delta;
7389
35.0k
  }
7390
7391
  /*
7392
   * If there was a DHCP message type option, flag this packet
7393
   * as DHCP.
7394
   */
7395
12.7k
  if (dhcp_type != NULL) {
7396
    /*
7397
     * Yes, this is a DHCP packet, and "dhcp_type" is the
7398
     * packet type.
7399
     */
7400
38
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCP");
7401
7402
38
    col_add_fstr(pinfo->cinfo, COL_INFO, "%sDHCP %-8s - Transaction ID 0x%x",
7403
38
           isProxyDhcp ? "proxy" : "", dhcp_type, tvb_get_ntohl(tvb, 4));
7404
38
    tap_queue_packet( dhcp_bootp_tap, pinfo, dhcp_type);
7405
38
  }
7406
7407
  /*
7408
   * OK, now populate the protocol tree.
7409
   */
7410
7411
12.7k
  proto_tree_add_uint(bp_tree, hf_dhcp_type, tvb,
7412
12.7k
           0, 1,
7413
12.7k
           op);
7414
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_hw_type, tvb,
7415
12.7k
           1, 1, ENC_BIG_ENDIAN);
7416
12.7k
  proto_tree_add_uint(bp_tree, hf_dhcp_hw_len, tvb,
7417
12.7k
          2, 1, hlen);
7418
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_hops, tvb,
7419
12.7k
          3, 1, ENC_BIG_ENDIAN);
7420
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_id, tvb,
7421
12.7k
          4, 4, ENC_BIG_ENDIAN);
7422
  /*
7423
   * Windows (98, XP and Vista tested) sends the "secs" value on
7424
   * the wire formatted as little-endian. See if the LE value
7425
   * makes sense, if autodetect is used.
7426
   */
7427
12.7k
  if (dhcp_secs_endian == DHCP_SECS_ENDIAN_AUTODETECT) {
7428
12.7k
    secs = tvb_get_letohs(tvb, 8);
7429
12.7k
    if (secs > 0 && secs <= 0xff) {
7430
1.77k
      ti = proto_tree_add_uint(bp_tree, hf_dhcp_secs, tvb, 8, 2, secs);
7431
1.77k
      expert_add_info(pinfo, ti, &ei_dhcp_secs_le);
7432
10.9k
    } else {
7433
10.9k
      proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb,
7434
10.9k
          8, 2, ENC_BIG_ENDIAN);
7435
10.9k
    }
7436
12.7k
  }
7437
10
  else {
7438
    /* Use whatever endianness is configured */
7439
10
    proto_tree_add_item(bp_tree, hf_dhcp_secs, tvb, 8, 2, dhcp_secs_endian);
7440
10
  }
7441
12.7k
  flags = tvb_get_ntohs(tvb, 10);
7442
12.7k
  fi = proto_tree_add_bitmask(bp_tree, tvb, 10, hf_dhcp_flags,
7443
12.7k
             ett_dhcp_flags, dhcp_flags, ENC_BIG_ENDIAN);
7444
12.7k
  proto_item_append_text(fi, " (%s)",
7445
12.7k
      (flags & BOOTP_BC) ? "Broadcast" : "Unicast");
7446
7447
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_client, tvb,
7448
12.7k
          12, 4, ENC_BIG_ENDIAN);
7449
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_your, tvb,
7450
12.7k
          16, 4, ENC_BIG_ENDIAN);
7451
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_server, tvb,
7452
12.7k
          20, 4, ENC_BIG_ENDIAN);
7453
12.7k
  proto_tree_add_item(bp_tree, hf_dhcp_ip_relay, tvb,
7454
12.7k
          24, 4, ENC_BIG_ENDIAN);
7455
7456
12.7k
  if (hlen > 0 && hlen <= 16) {
7457
1.98k
    if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
7458
294
        && hlen == 6)
7459
179
      proto_tree_add_item(bp_tree, hf_dhcp_hw_ether_addr, tvb, 28, 6, ENC_NA);
7460
1.80k
    else
7461
      /* The chaddr element is 16 bytes in length,
7462
         although only the first hlen bytes are used */
7463
1.80k
      proto_tree_add_bytes_format_value(bp_tree, hf_dhcp_hw_addr, tvb, 28, 16,
7464
1.80k
             NULL, "%s", tvb_arphrdaddr_to_str(pinfo->pool, tvb, 28, hlen, htype));
7465
1.98k
    if ((16 - hlen) > 0)
7466
1.92k
      proto_tree_add_item(bp_tree, hf_dhcp_hw_addr_padding, tvb, 28+hlen, 16-hlen, ENC_NA);
7467
10.7k
  } else {
7468
10.7k
    proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_client_address_not_given, tvb, 28, 16);
7469
10.7k
  }
7470
7471
  /* RFC 3396 5: "The aggregate option buffer is made up of the optional
7472
   * parameters field, the file field, and the sname field, in that order.
7473
   * WARNING: This is not the physical ordering of these fields in the
7474
   * DHCP packet."
7475
   *
7476
   * RFC 3396 6: "[I]f an option were split into three parts and each
7477
   * part went into one of the possible option fields, the first part
7478
   * would go into the optional parameters field, the second part would
7479
   * go into the file field, and the third part would go into the sname
7480
   * field."
7481
   *
7482
   * So we process and reassemble the options in the order listed above,
7483
   * and move the items after processing so that they are generally in
7484
   * physical ordering in the tree. (Whichever ordering choice we make
7485
   * is bound to confused someone.)
7486
   */
7487
7488
12.7k
  if (overload & OPT_OVERLOAD_FILE) {
7489
11.3k
    file_ti = proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_boot_filename_overloaded_by_dhcp, tvb,
7490
11.3k
      FILE_NAME_OFFSET, FILE_NAME_LEN);
7491
11.3k
    tmpvoff = FILE_NAME_OFFSET;
7492
11.3k
    tmpvoff_end = FILE_NAME_OFFSET + FILE_NAME_LEN;
7493
11.3k
    at_end = false;
7494
80.3k
    while (tmpvoff < tmpvoff_end && !at_end) {
7495
69.0k
      tmpvoff += dhcp_option(tvb, pinfo, NULL, tmpvoff,
7496
69.0k
        tmpvoff_end, true, &at_end,
7497
69.0k
        &dhcp_type, &vendor_class_id,
7498
69.0k
        NULL, rfc3396_map);
7499
69.0k
    }
7500
11.3k
  } else {
7501
    /* Boot file is optional */
7502
1.44k
    if (tvb_get_uint8(tvb, FILE_NAME_OFFSET) != '\0') {
7503
841
      file_ti = proto_tree_add_item(bp_tree, hf_dhcp_file, tvb,
7504
841
             FILE_NAME_OFFSET,
7505
841
             FILE_NAME_LEN, ENC_ASCII);
7506
841
    } else {
7507
607
      file_ti = proto_tree_add_string_format(bp_tree, hf_dhcp_file, tvb,
7508
607
               FILE_NAME_OFFSET,
7509
607
               FILE_NAME_LEN,
7510
607
               "", "Boot file name not given");
7511
607
    }
7512
1.44k
  }
7513
7514
7515
12.7k
  if (overload & OPT_OVERLOAD_SNAME) {
7516
11.5k
    sname_ti = proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_server_name_overloaded_by_dhcp, tvb,
7517
11.5k
      SERVER_NAME_OFFSET, SERVER_NAME_LEN);
7518
11.5k
    tmpvoff = SERVER_NAME_OFFSET;
7519
11.5k
    tmpvoff_end = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
7520
11.5k
    at_end = false;
7521
54.1k
    while (tmpvoff < tmpvoff_end && !at_end) {
7522
42.6k
      tmpvoff += dhcp_option(tvb, pinfo, NULL, tmpvoff,
7523
42.6k
        tmpvoff_end, true, &at_end,
7524
42.6k
        &dhcp_type, &vendor_class_id,
7525
42.6k
        NULL, rfc3396_map);
7526
42.6k
    }
7527
11.5k
  } else {
7528
    /* The server host name is optional */
7529
1.20k
    if (tvb_get_uint8(tvb, SERVER_NAME_OFFSET) != '\0') {
7530
602
      sname_ti = proto_tree_add_item(bp_tree, hf_dhcp_server, tvb,
7531
602
             SERVER_NAME_OFFSET,
7532
602
             SERVER_NAME_LEN, ENC_ASCII);
7533
7534
607
    } else {
7535
607
      sname_ti = proto_tree_add_string_format(bp_tree, hf_dhcp_server, tvb,
7536
607
               SERVER_NAME_OFFSET,
7537
607
               SERVER_NAME_LEN,
7538
607
               "", "Server host name not given");
7539
607
    }
7540
1.20k
  }
7541
7542
12.7k
  proto_tree_move_item(bp_tree, sname_ti, file_ti);
7543
7544
12.7k
  voff = VENDOR_INFO_OFFSET;
7545
12.7k
  if (dhcp_type == NULL) {
7546
12.2k
    hidden_item = proto_tree_add_boolean(bp_tree, hf_dhcp_bootp, tvb, 0, 0, 1);
7547
12.2k
    proto_item_set_hidden(hidden_item);
7548
12.2k
  }
7549
12.7k
  if (tvb_bytes_exist(tvb, voff, 4) &&
7550
12.4k
      (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
7551
3.38k
    ip_addr = tvb_get_ipv4(tvb, voff);
7552
3.38k
    proto_tree_add_ipv4_format_value(bp_tree, hf_dhcp_cookie, tvb,
7553
3.38k
      voff, 4, ip_addr, "DHCP");
7554
3.38k
    voff += 4;
7555
9.38k
  } else {
7556
9.38k
    proto_tree_add_item(bp_tree, hf_dhcp_vendor_specific_options, tvb,
7557
9.38k
      voff, 64, ENC_NA);
7558
9.38k
    voff += 64;
7559
9.38k
  }
7560
7561
12.7k
  at_end = false;
7562
47.2k
  while (voff < eoff && !at_end) {
7563
34.4k
    offset_delta = dhcp_option(tvb, pinfo, bp_tree, voff, eoff, false, &at_end,
7564
34.4k
        &dhcp_type, &vendor_class_id, &overload, rfc3396_map);
7565
34.4k
    if (offset_delta <= 0) {
7566
0
      proto_tree_add_expert(bp_tree, pinfo, &ei_dhcp_option_parse_err,
7567
0
          tvb, voff, eoff);
7568
0
      return voff;
7569
0
    }
7570
34.4k
    voff += offset_delta;
7571
34.4k
  }
7572
12.7k
  if ((dhcp_type != NULL) && (!at_end))
7573
160
  {
7574
160
    expert_add_info(pinfo, bp_ti, &ei_dhcp_end_option_missing);
7575
160
  }
7576
7577
12.7k
  if (overload & OPT_OVERLOAD_FILE) {
7578
11.2k
    proto_item *oti;
7579
11.2k
    proto_tree *overload_tree = proto_tree_add_subtree(bp_tree, tvb,
7580
11.2k
      FILE_NAME_OFFSET, FILE_NAME_LEN, ett_dhcp_filename_option, &oti,
7581
11.2k
      "Boot file name option overload");
7582
11.2k
    tmpvoff = FILE_NAME_OFFSET;
7583
11.2k
    tmpvoff_end = FILE_NAME_OFFSET + FILE_NAME_LEN;
7584
11.2k
    at_end = false;
7585
79.8k
    while (tmpvoff < tmpvoff_end && !at_end) {
7586
68.5k
      tmpvoff += dhcp_option(tvb, pinfo, overload_tree, tmpvoff,
7587
68.5k
        tmpvoff_end, false, &at_end,
7588
68.5k
        &dhcp_type, &vendor_class_id,
7589
68.5k
        NULL, rfc3396_map);
7590
68.5k
    }
7591
11.2k
    if (!at_end)
7592
8.42k
    {
7593
8.42k
      expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_file_end_missing);
7594
8.42k
    }
7595
11.2k
    proto_tree_move_item(bp_tree, file_ti, oti);
7596
11.2k
  }
7597
12.7k
  if (overload & OPT_OVERLOAD_SNAME) {
7598
11.0k
    proto_item *oti;
7599
11.0k
    proto_tree *overload_tree = proto_tree_add_subtree(bp_tree, tvb,
7600
11.0k
      SERVER_NAME_OFFSET, SERVER_NAME_LEN, ett_dhcp_server_hostname, &oti,
7601
11.0k
      "Server host name option overload");
7602
11.0k
    tmpvoff = SERVER_NAME_OFFSET;
7603
11.0k
    tmpvoff_end = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
7604
11.0k
    at_end = false;
7605
51.4k
    while (tmpvoff < tmpvoff_end && !at_end) {
7606
40.4k
      tmpvoff += dhcp_option(tvb, pinfo, overload_tree, tmpvoff,
7607
40.4k
        tmpvoff_end, false, &at_end,
7608
40.4k
        &dhcp_type, &vendor_class_id,
7609
40.4k
        NULL, rfc3396_map);
7610
40.4k
    }
7611
11.0k
    if (!at_end)
7612
5.81k
    {
7613
5.81k
      expert_add_info(pinfo, oti, &ei_dhcp_opt_overload_sname_end_missing);
7614
5.81k
    }
7615
11.0k
    proto_tree_move_item(bp_tree, sname_ti, oti);
7616
11.0k
  }
7617
7618
12.7k
  if (voff < eoff) {
7619
    /*
7620
     * Padding after the end option.
7621
     */
7622
105
    proto_tree_add_item(bp_tree, hf_dhcp_option_padding, tvb, voff, eoff - voff, ENC_NA);
7623
105
  }
7624
7625
12.7k
  return tvb_captured_length(tvb);
7626
12.7k
}
7627
7628
static void
7629
dhcp_init_protocol(void)
7630
15
{
7631
15
  unsigned i;
7632
7633
  /* first copy default_dhcp_opt[] to dhcp_opt[].  This resets all values to default */
7634
15
  memcpy(dhcp_opt, default_dhcp_opt, sizeof(dhcp_opt));
7635
7636
15
  if ((num_dhcp_records_uat > 0) && (saved_uat_opts == NULL))
7637
0
  {
7638
0
    saved_uat_opts = wmem_list_new(NULL);
7639
0
  }
7640
7641
  /* Now apply the custom options */
7642
15
  for (i = 0; i < num_dhcp_records_uat; i++)
7643
0
  {
7644
0
    dhcp_opt[uat_dhcp_records[i].opt].text = wmem_strdup(wmem_file_scope(), uat_dhcp_records[i].text);
7645
0
    dhcp_opt[uat_dhcp_records[i].opt].ftype = uat_dhcp_records[i].ftype;
7646
0
    dhcp_opt[uat_dhcp_records[i].opt].phf = NULL;
7647
7648
    /* Apply the custom option to the dissection table*/
7649
0
    dissector_change_uint("dhcp.option", uat_dhcp_records[i].opt, dhcpopt_basic_handle);
7650
7651
    /* Save the option so it can be cleared later */
7652
0
    wmem_list_append(saved_uat_opts, GUINT_TO_POINTER(uat_dhcp_records[i].opt));
7653
0
  }
7654
15
}
7655
7656
static void
7657
dhcp_clear_uat_dhcpopt(void *data, void *user_data _U_)
7658
0
{
7659
0
  dissector_reset_uint("dhcp.option", GPOINTER_TO_UINT(data));
7660
0
}
7661
7662
static void
7663
dhcp_cleanup_protocol(void)
7664
0
{
7665
0
  if (saved_uat_opts != NULL) {
7666
0
    wmem_list_foreach(saved_uat_opts, dhcp_clear_uat_dhcpopt,
7667
0
        NULL);
7668
7669
0
    wmem_destroy_list(saved_uat_opts);
7670
0
    saved_uat_opts = NULL;
7671
0
  }
7672
0
}
7673
7674
7675
/* TAP STAT INFO */
7676
typedef enum
7677
{
7678
  MESSAGE_TYPE_COLUMN = 0,
7679
  PACKET_COLUMN
7680
} dhcp_stat_columns;
7681
7682
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"}};
7683
7684
static void dhcp_stat_init(stat_tap_table_ui* new_stat)
7685
0
{
7686
0
  const char *table_name = "DHCP Statistics";
7687
0
  int num_fields = array_length(dhcp_stat_fields);
7688
0
  stat_tap_table *table;
7689
0
  int i = 0;
7690
0
  stat_tap_table_item_type items[array_length(dhcp_stat_fields)];
7691
7692
0
  table = stat_tap_find_table(new_stat, table_name);
7693
0
  if (table) {
7694
0
    if (new_stat->stat_tap_reset_table_cb) {
7695
0
      new_stat->stat_tap_reset_table_cb(table);
7696
0
    }
7697
0
    return;
7698
0
  }
7699
7700
0
  table = stat_tap_init_table(table_name, num_fields, 0, NULL);
7701
0
  stat_tap_add_table(new_stat, table);
7702
7703
0
  memset(items, 0x0, sizeof(items));
7704
  /* Add a row for each value type */
7705
0
  while (opt53_text[i].strptr)
7706
0
  {
7707
0
    items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING;
7708
0
    items[MESSAGE_TYPE_COLUMN].value.string_value = opt53_text[i].strptr;
7709
0
    items[PACKET_COLUMN].type = TABLE_ITEM_UINT;
7710
0
    items[PACKET_COLUMN].value.uint_value = 0;
7711
7712
0
    stat_tap_init_table_row(table, i, num_fields, items);
7713
0
    i++;
7714
0
  }
7715
0
}
7716
7717
static tap_packet_status
7718
dhcp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_)
7719
0
{
7720
0
  stat_data_t* stat_data = (stat_data_t*)tapdata;
7721
0
  const char* value = (const char*)data;
7722
0
  stat_tap_table* table;
7723
0
  stat_tap_table_item_type* msg_data;
7724
0
  int idx;
7725
7726
0
  idx = str_to_val_idx(value, opt53_text);
7727
0
  if (idx < 0)
7728
0
    return TAP_PACKET_DONT_REDRAW;
7729
7730
0
  table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0);
7731
0
  msg_data = stat_tap_get_field_data(table, idx, PACKET_COLUMN);
7732
0
  msg_data->value.uint_value++;
7733
0
  stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data);
7734
7735
0
  return TAP_PACKET_REDRAW;
7736
0
}
7737
7738
static void
7739
dhcp_stat_reset(stat_tap_table* table)
7740
0
{
7741
0
  unsigned element;
7742
0
  stat_tap_table_item_type* item_data;
7743
7744
0
  for (element = 0; element < table->num_elements; element++)
7745
0
  {
7746
0
    item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN);
7747
0
    item_data->value.uint_value = 0;
7748
0
    stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data);
7749
0
  }
7750
0
}
7751
7752
void
7753
proto_register_dhcp(void)
7754
15
{
7755
15
  static const value_string dhcp_custom_type_vals[] = {
7756
15
    { ipv4,       "IP Address"},
7757
15
    { ipv4_list,      "IP Address List" },
7758
15
    { string,     "string" },
7759
15
    { bytes,      "bytes" },
7760
15
    { val_boolean,      "boolean" },
7761
15
    { val_u_byte,     "byte" },
7762
15
    { val_u_short,      "unsigned short" },
7763
15
    { val_u_short_list, "unsigned short list" },
7764
15
    { val_u_long,     "unsigned long" },
7765
15
    { time_in_s_secs,   "integer time in seconds" },
7766
15
    { time_in_u_secs,   "unsigned integer time in seconds" },
7767
15
    { 0x00, NULL }
7768
15
  };
7769
7770
15
  static hf_register_info hf[] = {
7771
15
    { &hf_dhcp_bootp,
7772
15
      { "Frame is BOOTP", "dhcp.bootp",
7773
15
        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
7774
15
        NULL, HFILL }},
7775
7776
15
    { &hf_dhcp_type,
7777
15
      { "Message type", "dhcp.type",
7778
15
        FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
7779
15
        NULL, HFILL }},
7780
7781
15
    { &hf_dhcp_hw_type,
7782
15
      { "Hardware type", "dhcp.hw.type",
7783
15
        FT_UINT8, BASE_HEX, VALS(arp_hrd_vals), 0x0,
7784
15
        NULL, HFILL }},
7785
7786
15
    { &hf_dhcp_hw_len,
7787
15
      { "Hardware address length", "dhcp.hw.len",
7788
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
7789
15
        NULL, HFILL }},
7790
7791
15
    { &hf_dhcp_hops,
7792
15
      { "Hops", "dhcp.hops",
7793
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
7794
15
        NULL, HFILL }},
7795
7796
15
    { &hf_dhcp_id,
7797
15
      { "Transaction ID", "dhcp.id",
7798
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
7799
15
        NULL, HFILL }},
7800
7801
15
    { &hf_dhcp_secs,
7802
15
      { "Seconds elapsed", "dhcp.secs",
7803
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
7804
15
        NULL, HFILL }},
7805
7806
15
    { &hf_dhcp_flags,
7807
15
      { "Bootp flags", "dhcp.flags",
7808
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
7809
15
        NULL, HFILL }},
7810
7811
15
    { &hf_dhcp_flags_broadcast,
7812
15
      { "Broadcast flag", "dhcp.flags.bc",
7813
15
        FT_BOOLEAN, 16, TFS(&flag_set_broadcast), BOOTP_BC,
7814
15
        NULL, HFILL }},
7815
7816
15
    { &hf_dhcp_flags_reserved,
7817
15
      { "Reserved flags", "dhcp.flags.reserved",
7818
15
        FT_UINT16, BASE_HEX, NULL, BOOTP_MBZ,
7819
15
        NULL, HFILL }},
7820
7821
15
    { &hf_dhcp_ip_client,
7822
15
      { "Client IP address", "dhcp.ip.client",
7823
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
7824
15
        NULL, HFILL }},
7825
7826
15
    { &hf_dhcp_ip_your,
7827
15
      { "Your (client) IP address", "dhcp.ip.your",
7828
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
7829
15
        NULL, HFILL }},
7830
7831
15
    { &hf_dhcp_ip_server,
7832
15
      { "Next server IP address", "dhcp.ip.server",
7833
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
7834
15
        NULL, HFILL }},
7835
7836
15
    { &hf_dhcp_ip_relay,
7837
15
      { "Relay agent IP address", "dhcp.ip.relay",
7838
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
7839
15
        NULL, HFILL }},
7840
7841
15
    { &hf_dhcp_hw_addr,
7842
15
      { "Client hardware address", "dhcp.hw.addr",
7843
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
7844
15
        NULL, HFILL }},
7845
7846
15
    { &hf_dhcp_hw_addr_padding,
7847
15
      { "Client hardware address padding", "dhcp.hw.addr_padding",
7848
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
7849
15
        NULL, HFILL }},
7850
7851
15
    { &hf_dhcp_hw_ether_addr,
7852
15
      { "Client MAC address", "dhcp.hw.mac_addr",
7853
15
        FT_ETHER, BASE_NONE, NULL, 0x0,
7854
15
        NULL, HFILL }},
7855
7856
15
    { &hf_dhcp_server,
7857
15
      { "Server host name", "dhcp.server",
7858
15
        FT_STRING, BASE_NONE, NULL, 0x0,
7859
15
        NULL, HFILL }},
7860
7861
15
    { &hf_dhcp_file,
7862
15
      { "Boot file name", "dhcp.file",
7863
15
        FT_STRING, BASE_NONE, NULL, 0x0,
7864
15
        NULL, HFILL }},
7865
7866
15
    { &hf_dhcp_cookie,
7867
15
      { "Magic cookie", "dhcp.cookie",
7868
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
7869
15
        NULL, HFILL }},
7870
7871
15
    { &hf_dhcp_vendor_specific_options,
7872
15
      { "Bootp vendor specific options", "dhcp.vendor_specific_options",
7873
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
7874
15
        NULL, HFILL }},
7875
7876
15
    { &hf_dhcp_fqdn_s,
7877
15
      { "Server", "dhcp.fqdn.s",
7878
15
      FT_BOOLEAN, 8, TFS(&tfs_server_client), F_FQDN_S,
7879
15
        "If true, server should do DDNS update", HFILL }},
7880
7881
15
    { &hf_dhcp_fqdn_o,
7882
15
      { "Server overrides", "dhcp.fqdn.o",
7883
15
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_o), F_FQDN_O,
7884
15
        "If true, server insists on doing DDNS update", HFILL }},
7885
7886
15
    { &hf_dhcp_fqdn_e,
7887
15
      { "Encoding", "dhcp.fqdn.e",
7888
15
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_e), F_FQDN_E,
7889
15
        "If true, name is binary encoded", HFILL }},
7890
7891
15
    { &hf_dhcp_fqdn_n,
7892
15
      { "Server DDNS", "dhcp.fqdn.n",
7893
15
        FT_BOOLEAN, 8, TFS(&tfs_fqdn_n), F_FQDN_N,
7894
15
        "If true, server should not do any DDNS updates", HFILL }},
7895
7896
15
    { &hf_dhcp_fqdn_flags,
7897
15
      { "Flags", "dhcp.fqdn.flags",
7898
15
        FT_UINT8, BASE_HEX, NULL, 0,
7899
15
        NULL, HFILL }},
7900
7901
15
    { &hf_dhcp_fqdn_mbz,
7902
15
      { "Reserved flags", "dhcp.fqdn.mbz",
7903
15
        FT_UINT8, BASE_HEX, NULL, F_FQDN_MBZ,
7904
15
        NULL, HFILL }},
7905
7906
15
    { &hf_dhcp_fqdn_rcode1,
7907
15
      { "A-RR result", "dhcp.fqdn.rcode1",
7908
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
7909
15
        "Result code of A-RR update", HFILL }},
7910
7911
15
    { &hf_dhcp_fqdn_rcode2,
7912
15
      { "PTR-RR result", "dhcp.fqdn.rcode2",
7913
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
7914
15
        "Result code of PTR-RR update", HFILL }},
7915
7916
15
    { &hf_dhcp_fqdn_name,
7917
15
      { "Client name", "dhcp.fqdn.name",
7918
15
        FT_STRING, BASE_NONE, NULL, 0x0,
7919
15
        "Name to register via DDNS", HFILL }},
7920
7921
15
    { &hf_dhcp_fqdn_asciiname,
7922
15
      { "Client name", "dhcp.fqdn.name",
7923
15
        FT_STRING, BASE_NONE, NULL, 0x0,
7924
15
        "Name to register via DDNS", HFILL }},
7925
7926
15
    { &hf_dhcp_pkt_mta_cap_len,
7927
15
      { "MTA DC Length", "dhcp.vendor.pktc.mta_cap_len",
7928
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
7929
15
        "PacketCable MTA Device Capabilities Length", HFILL }},
7930
7931
15
    { &hf_dhcp_pkt_mta_cap_type,
7932
15
      { "Type", "dhcp.vendor.pktc.mta_cap_type",
7933
15
        FT_UINT16, BASE_DEC, VALS(pkt_mdc_type_vals), 0x0,
7934
15
        NULL, HFILL }},
7935
7936
15
    { &hf_dhcp_pkt_mdc_supp_flow_secure,
7937
15
      { "Secure Flow (Full Secure Provisioning Flow)", "dhcp.vendor.pktc.mdc.supp_flow.secure",
7938
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
7939
15
        NULL, HFILL }},
7940
7941
15
    { &hf_dhcp_pkt_mdc_supp_flow_hybrid,
7942
15
      { "Hybrid Flow", "dhcp.vendor.pktc.mdc.supp_flow.hybrid",
7943
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
7944
15
        NULL, HFILL }},
7945
7946
15
    { &hf_dhcp_pkt_mdc_supp_flow_basic,
7947
15
      { "Basic Flow", "dhcp.vendor.pktc.mdc.supp_flow.basic",
7948
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
7949
15
        NULL, HFILL }},
7950
7951
15
    { &hf_dhcp_pkt_mdc_mib_cl_mta,
7952
15
      { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta",
7953
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7954
15
        NULL, HFILL }},
7955
7956
15
    { &hf_dhcp_pkt_mdc_mib_cl_signaling,
7957
15
      { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling",
7958
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7959
15
        NULL, HFILL }},
7960
7961
15
    { &hf_dhcp_pkt_mdc_mib_cl_management_event,
7962
15
      { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_cl.mib.management_event",
7963
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7964
15
        NULL, HFILL }},
7965
7966
15
    { &hf_dhcp_pkt_mdc_mib_cl_mta_extension,
7967
15
      { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mta_extension",
7968
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
7969
15
        NULL, HFILL }},
7970
7971
15
    { &hf_dhcp_pkt_mdc_mib_cl_mta_signaling_extension,
7972
15
      { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.signaling_extension",
7973
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
7974
15
        NULL, HFILL }},
7975
7976
15
    { &hf_dhcp_pkt_mdc_mib_cl_mta_mem_extension,
7977
15
      { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_cl.mib.mem_extension",
7978
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
7979
15
        NULL, HFILL }},
7980
7981
15
    { &hf_dhcp_pkt_mdc_mib_cl_reserved,
7982
15
      { "Reserved", "dhcp.vendor.pktc.mdc_cl.mib.reserved",
7983
15
        FT_UINT8, BASE_HEX, NULL, 0xC0,
7984
15
        NULL, HFILL }},
7985
7986
15
    { &hf_dhcp_pkt_mdc_mib_ietf_mta,
7987
15
      { "IETF MTA MIB", "dhcp.vendor.pktc.mdc_ietf.mib.mta",
7988
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7989
15
        NULL, HFILL }},
7990
7991
15
    { &hf_dhcp_pkt_mdc_mib_ietf_signaling,
7992
15
      { "IETF Signaling MIB", "dhcp.vendor.pktc.mdc_ietf.mib.signaling",
7993
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7994
15
        NULL, HFILL }},
7995
7996
15
    { &hf_dhcp_pkt_mdc_mib_ietf_management_event,
7997
15
      { "IETF Management Event MIB", "dhcp.vendor.pktc.mdc_ietf.mib.management_event",
7998
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7999
15
        NULL, HFILL }},
8000
8001
15
    { &hf_dhcp_pkt_mdc_mib_ietf_reserved,
8002
15
      { "Reserved", "dhcp.vendor.pktc.mdc_ietf.mib.reserved",
8003
15
        FT_UINT8, BASE_HEX, NULL, 0xF8,
8004
15
        NULL, HFILL }},
8005
8006
15
    { &hf_dhcp_pkt_mdc_mib_euro_mta,
8007
15
      { "PacketCable 1.5 MTA MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta",
8008
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
8009
15
        NULL, HFILL }},
8010
8011
15
    { &hf_dhcp_pkt_mdc_mib_euro_signaling,
8012
15
      { "PacketCable 1.5 Signaling MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling",
8013
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
8014
15
        NULL, HFILL }},
8015
8016
15
    { &hf_dhcp_pkt_mdc_mib_euro_management_event,
8017
15
      { "PacketCable 1.5 Management Event MIB", "dhcp.vendor.pktc.mdc_euro.mib.management_event",
8018
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
8019
15
        NULL, HFILL }},
8020
8021
15
    { &hf_dhcp_pkt_mdc_mib_euro_mta_extension,
8022
15
      { "PacketCable 1.5 MTA Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mta_extension",
8023
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
8024
15
        NULL, HFILL }},
8025
8026
15
    { &hf_dhcp_pkt_mdc_mib_euro_mta_signaling_extension,
8027
15
      { "PacketCable 1.5 Signaling Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.signaling_extension",
8028
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
8029
15
        NULL, HFILL }},
8030
8031
15
    { &hf_dhcp_pkt_mdc_mib_euro_mta_mem_extension,
8032
15
      { "PacketCable 1.5 MEM Extension MIB", "dhcp.vendor.pktc.mdc_euro.mib.mem_extension",
8033
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
8034
15
        NULL, HFILL }},
8035
8036
15
    { &hf_dhcp_pkt_mdc_mib_euro_reserved,
8037
15
      { "Reserved", "dhcp.vendor.pktc.mdc_euro.mib.reserved",
8038
15
        FT_UINT8, BASE_HEX, NULL, 0xC0,
8039
15
        NULL, HFILL }},
8040
8041
15
    { &hf_dhcp_docsis_cm_cap_len,
8042
15
      { "CM DC Length", "dhcp.vendor.docsis.cm_cap_len",
8043
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8044
15
        "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
8045
8046
15
    { &hf_dhcp_docsis_cm_cap_type,
8047
15
      { "CM DC Type", "dhcp.docsis_cm_cap_type",
8048
15
        FT_UINT16, BASE_DEC, VALS(docsis_cm_cap_type_vals), 0x0,
8049
15
        "Docsis Cable Modem Device Capability type", HFILL }},
8050
8051
15
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_cm,
8052
15
      { "CM", "dhcp.docsis_cm_cap.ranging_hold_off.cm",
8053
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
8054
15
        NULL, HFILL }},
8055
8056
15
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_eps,
8057
15
      { "ePS or eRouter", "dhcp.docsis_cm_cap.ranging_hold_off.eps",
8058
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002,
8059
15
        NULL, HFILL }},
8060
8061
15
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_emta,
8062
15
      { "EMTA or EDVA", "dhcp.docsis_cm_cap.ranging_hold_off.emta",
8063
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004,
8064
15
        NULL, HFILL }},
8065
8066
15
    { &hf_dhcp_docsis_cm_cap_ranging_hold_off_dsg,
8067
15
      { "DSG/eSTB", "dhcp.docsis_cm_cap.ranging_hold_off.dsg",
8068
15
        FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0008,
8069
15
        NULL, HFILL }},
8070
8071
8072
15
    { &hf_dhcp_docsis_cm_cap_mpls_stpid,
8073
15
      { "[IEEE 802.1ad] S-TPID", "dhcp.docsis_cm_cap.mpls.stpid",
8074
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8075
15
        NULL, HFILL }},
8076
8077
15
    { &hf_dhcp_docsis_cm_cap_mpls_svid,
8078
15
      { "[IEEE 802.1ad] S-VID", "dhcp.docsis_cm_cap.mpls.svid",
8079
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8080
15
        NULL, HFILL }},
8081
8082
15
    { &hf_dhcp_docsis_cm_cap_mpls_spcp,
8083
15
      { "[IEEE 802.1ad] S-PCP", "dhcp.docsis_cm_cap.mpls.spcp",
8084
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8085
15
        NULL, HFILL }},
8086
8087
15
    { &hf_dhcp_docsis_cm_cap_mpls_sdei,
8088
15
      { "[IEEE 802.1ad] S-DEI", "dhcp.docsis_cm_cap.mpls.sdei",
8089
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8090
15
        NULL, HFILL }},
8091
8092
15
    { &hf_dhcp_docsis_cm_cap_mpls_ctpid,
8093
15
      { "[IEEE 802.1ad] C-TPID", "dhcp.docsis_cm_cap.mpls.ctpid",
8094
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
8095
15
        NULL, HFILL }},
8096
8097
15
    { &hf_dhcp_docsis_cm_cap_mpls_cvid,
8098
15
      { "[IEEE 802.1ad] C-VID", "dhcp.docsis_cm_cap.mpls.cvid",
8099
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
8100
15
        NULL, HFILL }},
8101
8102
15
    { &hf_dhcp_docsis_cm_cap_mpls_cpcp,
8103
15
      { "[IEEE 802.1ad] C-PCP", "dhcp.docsis_cm_cap.mpls.cpcp",
8104
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
8105
15
        NULL, HFILL }},
8106
8107
15
    { &hf_dhcp_docsis_cm_cap_mpls_ccfi,
8108
15
      { "[IEEE 802.1ad] C-CFI", "dhcp.docsis_cm_cap.mpls.ccfi",
8109
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
8110
15
        NULL, HFILL }},
8111
8112
15
    { &hf_dhcp_docsis_cm_cap_mpls_stci,
8113
15
      { "[IEEE 802.1ad] S-TCI", "dhcp.docsis_cm_cap.mpls.stci",
8114
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
8115
15
        NULL, HFILL }},
8116
8117
15
    { &hf_dhcp_docsis_cm_cap_mpls_ctci,
8118
15
      { "[IEEE 802.1ad] C-TCI", "dhcp.docsis_cm_cap.mpls.ctci",
8119
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
8120
15
        NULL, HFILL }},
8121
8122
15
    { &hf_dhcp_docsis_cm_cap_mpls_itpid,
8123
15
      { "[IEEE 802.1ad] I-TPID", "dhcp.docsis_cm_cap.mpls.itpid",
8124
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
8125
15
        NULL, HFILL }},
8126
8127
15
    { &hf_dhcp_docsis_cm_cap_mpls_isid,
8128
15
      { "[IEEE 802.1ad] I-SID", "dhcp.docsis_cm_cap.mpls.isid",
8129
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
8130
15
        NULL, HFILL }},
8131
8132
15
    { &hf_dhcp_docsis_cm_cap_mpls_itci,
8133
15
      { "[IEEE 802.1ad] I-TCI", "dhcp.docsis_cm_cap.mpls.itci",
8134
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
8135
15
        NULL, HFILL }},
8136
8137
15
    { &hf_dhcp_docsis_cm_cap_mpls_ipcp,
8138
15
      { "[IEEE 802.1ad] I-PCP", "dhcp.docsis_cm_cap.mpls.ipcp",
8139
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
8140
15
        NULL, HFILL }},
8141
8142
15
    { &hf_dhcp_docsis_cm_cap_mpls_idei,
8143
15
      { "[IEEE 802.1ad] I-DEI", "dhcp.docsis_cm_cap.mpls.idei",
8144
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
8145
15
        NULL, HFILL }},
8146
8147
15
    { &hf_dhcp_docsis_cm_cap_mpls_iuca,
8148
15
      { "[IEEE 802.1ad] I-UCA", "dhcp.docsis_cm_cap.mpls.iuca",
8149
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
8150
15
        NULL, HFILL }},
8151
8152
15
    { &hf_dhcp_docsis_cm_cap_mpls_btpid,
8153
15
      { "[IEEE 802.1ad] B-TPID", "dhcp.docsis_cm_cap.mpls.btpid",
8154
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
8155
15
        NULL, HFILL }},
8156
8157
15
    { &hf_dhcp_docsis_cm_cap_mpls_btci,
8158
15
      { "[IEEE 802.1ad] B-TCI", "dhcp.docsis_cm_cap.mpls.btci",
8159
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
8160
15
        NULL, HFILL }},
8161
8162
15
    { &hf_dhcp_docsis_cm_cap_mpls_bpcp,
8163
15
      { "[IEEE 802.1ad] B-PCP", "dhcp.docsis_cm_cap.mpls.bpcp",
8164
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
8165
15
        NULL, HFILL }},
8166
8167
15
    { &hf_dhcp_docsis_cm_cap_mpls_bdei,
8168
15
      { "[IEEE 802.1ad] B-DEI", "dhcp.docsis_cm_cap.mpls.bdei",
8169
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
8170
15
        NULL, HFILL }},
8171
8172
15
    { &hf_dhcp_docsis_cm_cap_mpls_bvid,
8173
15
      { "[IEEE 802.1ad] B-VID", "dhcp.docsis_cm_cap.mpls.bvid",
8174
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
8175
15
        NULL, HFILL }},
8176
8177
15
    { &hf_dhcp_docsis_cm_cap_mpls_bda,
8178
15
      { "[IEEE 802.1ad] B-DA", "dhcp.docsis_cm_cap.mpls.bda",
8179
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
8180
15
        NULL, HFILL }},
8181
8182
15
    { &hf_dhcp_docsis_cm_cap_mpls_bsa,
8183
15
      { "[IEEE 802.1ad] B-SA", "dhcp.docsis_cm_cap.mpls.bsa",
8184
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
8185
15
        NULL, HFILL }},
8186
8187
15
    { &hf_dhcp_docsis_cm_cap_mpls_tc,
8188
15
      { "MPLS TC", "dhcp.docsis_cm_cap.mpls.tc",
8189
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
8190
15
        NULL, HFILL }},
8191
8192
15
    { &hf_dhcp_docsis_cm_cap_mpls_label,
8193
15
      { "MPLS Label", "dhcp.docsis_cm_cap.mpls.label",
8194
15
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
8195
15
        NULL, HFILL }},
8196
8197
8198
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_160,
8199
15
      { "160 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.160",
8200
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
8201
15
        NULL, HFILL }},
8202
8203
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_320,
8204
15
      { "320 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.320",
8205
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
8206
15
        NULL, HFILL }},
8207
8208
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_640,
8209
15
      { "640 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.640",
8210
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
8211
15
        NULL, HFILL }},
8212
8213
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_1280,
8214
15
      { "1280 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.1280",
8215
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
8216
15
        NULL, HFILL }},
8217
8218
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_2560,
8219
15
      { "2560 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.2560",
8220
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
8221
15
        NULL, HFILL }},
8222
8223
15
    { &hf_dhcp_docsis_cm_cap_ussymrate_5120,
8224
15
      { "5120 ksps symbol rate", "dhcp.docsis_cm_cap.ussymrate.5120",
8225
15
        FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
8226
15
        NULL, HFILL }},
8227
8228
15
    { &hf_dhcp_client_identifier_uuid,
8229
15
      { "Client Identifier (UUID)", "dhcp.client_id.uuid",
8230
15
        FT_GUID, BASE_NONE, NULL, 0x0,
8231
15
        "Client Machine Identifier (UUID)", HFILL }},
8232
8233
15
    { &hf_dhcp_client_hardware_address,
8234
15
      { "Client hardware address", "dhcp.client_hardware_address",
8235
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8236
15
        NULL, HFILL }},
8237
8238
15
    { &hf_dhcp_client_id_iaid,
8239
15
      { "IAID", "dhcp.client_id.iaid",
8240
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8241
15
        NULL, HFILL }},
8242
8243
15
    { &hf_dhcp_client_id_duid_type,
8244
15
      { "DUID Type", "dhcp.client_id.duid_type",
8245
15
        FT_UINT16, BASE_DEC, VALS(duidtype_vals), 0x0,
8246
15
        NULL, HFILL }},
8247
8248
15
    { &hf_dhcp_client_identifier_duid_llt_hw_type,
8249
15
      { "Hardware type", "dhcp.client_id.duid_llt_hw_type",
8250
15
        FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8251
15
        "Client Identifier DUID LLT Hardware type", HFILL }},
8252
8253
15
    { &hf_dhcp_client_identifier_duid_ll_hw_type,
8254
15
      { "Hardware type", "dhcp.client_id.duid_ll_hw_type",
8255
15
        FT_UINT16, BASE_DEC, VALS(arp_hrd_vals), 0x0,
8256
15
        "Client Identifier DUID LL Hardware type", HFILL }},
8257
8258
15
    { &hf_dhcp_client_identifier_time,
8259
15
      { "Time", "dhcp.client_id.time",
8260
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
8261
15
        NULL, HFILL }},
8262
8263
15
    { &hf_dhcp_client_identifier_link_layer_address,
8264
15
      { "Link layer address", "dhcp.client_id.link_layer_address",
8265
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8266
15
        NULL, HFILL }},
8267
8268
15
    { &hf_dhcp_client_identifier_link_layer_address_ether,
8269
15
      { "Link layer address (Ethernet)", "dhcp.client_id.link_layer_address_ether",
8270
15
        FT_ETHER, BASE_NONE, NULL, 0x0,
8271
15
        NULL, HFILL }},
8272
8273
15
    { &hf_dhcp_client_identifier_enterprise_num,
8274
15
      { "Enterprise-number", "dhcp.client_id.enterprise_num",
8275
15
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
8276
15
        NULL, HFILL }},
8277
8278
15
    { &hf_dhcp_client_identifier,
8279
15
      { "Identifier", "dhcp.client_id",
8280
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8281
15
        NULL, HFILL }},
8282
8283
15
    { &hf_dhcp_client_identifier_type,
8284
15
      { "Type", "dhcp.client_id.type",
8285
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8286
15
        NULL, HFILL }},
8287
8288
15
    { &hf_dhcp_client_identifier_undef,
8289
15
      { "Client Identifier", "dhcp.client_id.undef",
8290
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8291
15
        NULL, HFILL }},
8292
8293
15
    { &hf_dhcp_option_type,
8294
15
      { "Option", "dhcp.option.type",
8295
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8296
15
        "DHCP/BOOTP option type", HFILL }},
8297
8298
15
    { &hf_dhcp_option_length,
8299
15
      { "Length", "dhcp.option.length",
8300
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8301
15
        "DHCP/BOOTP option length", HFILL }},
8302
8303
15
    { &hf_dhcp_suboption_length,
8304
15
      { "Length", "dhcp.option.suboption_length",
8305
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8306
15
        "Suboption length", HFILL }},
8307
8308
15
    { &hf_dhcp_option_value,
8309
15
      { "Value", "dhcp.option.value",
8310
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8311
15
        "DHCP/BOOTP option value", HFILL }},
8312
8313
15
    { &hf_dhcp_option_value_8,
8314
15
      { "Value", "dhcp.option.value.uint",
8315
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8316
15
        "8-bit DHCP/BOOTP option value", HFILL }},
8317
8318
15
    { &hf_dhcp_option_value_16,
8319
15
      { "Value", "dhcp.option.value.uint",
8320
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8321
15
        "16-bit DHCP/BOOTP option value", HFILL }},
8322
8323
15
    { &hf_dhcp_option_value_u32,
8324
15
      { "Value", "dhcp.option.value.uint",
8325
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
8326
15
        "32-bit DHCP/BOOTP option value", HFILL }},
8327
8328
15
    { &hf_dhcp_option_value_s_secs,
8329
15
      { "Value", "dhcp.option.value.secs",
8330
15
        FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8331
15
        "32-bit DHCP/BOOTP option value", HFILL }},
8332
8333
15
    { &hf_dhcp_option_value_u_secs,
8334
15
      { "Value", "dhcp.option.value.usecs",
8335
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8336
15
        "32-bit DHCP/BOOTP option value", HFILL }},
8337
8338
15
    { &hf_dhcp_option_value_stringz,
8339
15
      { "Value", "dhcp.option.value.string",
8340
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8341
15
        "Z-String DHCP/BOOTP option value", HFILL }},
8342
8343
15
    { &hf_dhcp_option_value_ip_address,
8344
15
      { "Value", "dhcp.option.value.address",
8345
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8346
15
        "IP address DHCP/BOOTP option value", HFILL }},
8347
8348
15
    { &hf_dhcp_option_value_boolean,
8349
15
      { "Value", "dhcp.option.value.bool",
8350
15
        FT_BOOLEAN, BASE_NONE, NULL, 0x00,
8351
15
        "Boolean DHCP/BOOTP option value", HFILL }},
8352
8353
15
    { &hf_dhcp_option_rfc_3396_detected,
8354
15
      { "Encoding Long Options detected (RFC 3396)", "dhcp.option.rfc_3396_detected",
8355
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8356
15
        NULL, HFILL }},
8357
8358
15
    { &hf_dhcp_option_padding,
8359
15
      { "Padding", "dhcp.option.padding",
8360
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8361
15
        "Option 0: Padding", HFILL }},
8362
8363
15
    { &hf_dhcp_option_subnet_mask,
8364
15
      { "Subnet Mask", "dhcp.option.subnet_mask",
8365
15
        FT_IPv4, BASE_NETMASK, NULL, 0x00,
8366
15
        "Option 1: Subnet Mask", HFILL }},
8367
8368
15
    { &hf_dhcp_option_time_offset,
8369
15
      { "Time Offset", "dhcp.option.time_offset",
8370
15
        FT_INT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_s_secs_fmt), 0x0,
8371
15
        "Option 2: Time Offset", HFILL }},
8372
8373
15
    { &hf_dhcp_option_router,
8374
15
      { "Router", "dhcp.option.router",
8375
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8376
15
        "Option 3: Router", HFILL }},
8377
8378
15
    { &hf_dhcp_option_time_server,
8379
15
      { "Time Server", "dhcp.option.time_server",
8380
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8381
15
        "Option 4: Time Server", HFILL }},
8382
8383
15
    { &hf_dhcp_option_name_server,
8384
15
      { "Name Server", "dhcp.option.name_server",
8385
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8386
15
        "Option 5: Name Server", HFILL }},
8387
8388
15
    { &hf_dhcp_option_domain_name_server,
8389
15
      { "Domain Name Server", "dhcp.option.domain_name_server",
8390
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8391
15
        "Option 6: Domain Name Server", HFILL }},
8392
8393
15
    { &hf_dhcp_option_log_server,
8394
15
      { "Log Server", "dhcp.option.log_server",
8395
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8396
15
        "Option 7: Log Server", HFILL }},
8397
8398
15
    { &hf_dhcp_option_quotes_server,
8399
15
      { "Quotes Server", "dhcp.option.quotes_server",
8400
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8401
15
        "Option 8: Quotes Server", HFILL }},
8402
8403
15
    { &hf_dhcp_option_lpr_server,
8404
15
      { "LPR Server", "dhcp.option.lpr_server",
8405
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8406
15
        "Option 9: LPR Server", HFILL }},
8407
8408
15
    { &hf_dhcp_option_impress_server,
8409
15
      { "Impress Server", "dhcp.option.impress_server",
8410
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8411
15
        "Option 10: Impress Server", HFILL }},
8412
8413
15
    { &hf_dhcp_option_resource_location_server,
8414
15
      { "Resource Location Server", "dhcp.option.resource_location_server",
8415
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8416
15
        "Option 11: Resource Location Server", HFILL }},
8417
8418
15
    { &hf_dhcp_option_hostname,
8419
15
      { "Host Name", "dhcp.option.hostname",
8420
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8421
15
        "Option 12: Host Name", HFILL }},
8422
8423
15
    { &hf_dhcp_option_boot_file_size,
8424
15
      { "Boot File Size", "dhcp.option.boot_file_size",
8425
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8426
15
        "Option 13: Boot File Size", HFILL }},
8427
8428
15
    { &hf_dhcp_option_merit_dump_file,
8429
15
      { "Merit Dump File", "dhcp.option.merit_dump_file",
8430
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8431
15
        "Option 14: Merit Dump File", HFILL }},
8432
8433
15
    { &hf_dhcp_option_domain_name,
8434
15
      { "Domain Name", "dhcp.option.domain_name",
8435
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8436
15
        "Option 15: Domain Name", HFILL }},
8437
8438
15
    { &hf_dhcp_option_swap_server,
8439
15
      { "Swap Server", "dhcp.option.swap_server",
8440
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8441
15
        "Option 16: Swap Server", HFILL }},
8442
8443
15
    { &hf_dhcp_option_root_path,
8444
15
      { "Root Path", "dhcp.option.root_path",
8445
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8446
15
        "Option 17: Root Path", HFILL }},
8447
8448
15
    { &hf_dhcp_option_extension_path,
8449
15
      { "Extensions Path", "dhcp.option.extension_path",
8450
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8451
15
        "Option 18: Extensions Path", HFILL }},
8452
8453
15
    { &hf_dhcp_option_ip_forwarding,
8454
15
      { "IP Forwarding", "dhcp.option.ip_forwarding",
8455
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8456
15
        "Option 19: IP Forwarding", HFILL }},
8457
8458
15
    { &hf_dhcp_option_policy_filter_ip,
8459
15
      { "IP Address", "dhcp.option.policy_filter.ip",
8460
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8461
15
        "Option 21: IP address", HFILL }},
8462
8463
15
    { &hf_dhcp_option_policy_filter_subnet_mask,
8464
15
      { "Subnet Mask", "dhcp.option.policy_filter.subnet_mask",
8465
15
        FT_IPv4, BASE_NETMASK, NULL, 0x00,
8466
15
        "Option 21: Subnet Mask", HFILL }},
8467
8468
15
    { &hf_dhcp_option_non_local_source_routing,
8469
15
      { "Non-Local Source Routing", "dhcp.option.non_local_source_routing",
8470
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8471
15
        "Option 20: Non-Local Source Routing", HFILL }},
8472
8473
15
    { &hf_dhcp_option_max_datagram_reassembly_size,
8474
15
      { "Maximum Datagram Reassembly Size", "dhcp.option.max_datagram_reassembly_size",
8475
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8476
15
        "Option 22: Maximum Datagram Reassembly Size", HFILL }},
8477
8478
15
    { &hf_dhcp_option_default_ip_ttl,
8479
15
      { "Default IP Time-to-Live", "dhcp.option.default_ip_ttl",
8480
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8481
15
        "Option 23: Default IP Time-to-Live", HFILL }},
8482
8483
15
    { &hf_dhcp_option_path_mtu_aging_timeout,
8484
15
      { "Path MTU Aging Timeout", "dhcp.option.path_mtu_aging_timeout",
8485
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8486
15
        "Option 24: Path MTU Aging Timeout", HFILL }},
8487
8488
15
    { &hf_dhcp_option_path_mtu_plateau_table_item,
8489
15
      { "Path MTU Plateau Table Item", "dhcp.option.path_mtu_plateau_table_item",
8490
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8491
15
        "Option 25: Path MTU Plateau Table Item", HFILL }},
8492
8493
15
    { &hf_dhcp_option_interface_mtu,
8494
15
      { "Interface MTU", "dhcp.option.interface_mtu",
8495
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8496
15
        "Option 26: Interface MTU", HFILL }},
8497
8498
15
    { &hf_dhcp_option_all_subnets_are_local,
8499
15
      { "All Subnets are Local", "dhcp.option.all_subnets_are_local",
8500
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8501
15
        "Option 27: All Subnets are Local", HFILL }},
8502
8503
15
    { &hf_dhcp_option_broadcast_address,
8504
15
      { "Broadcast Address", "dhcp.option.broadcast_address",
8505
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8506
15
        "Option 28: Broadcast Address", HFILL }},
8507
8508
15
    { &hf_dhcp_option_perform_mask_discovery,
8509
15
      { "Perform Mask Discovery", "dhcp.option.perform_mask_discovery",
8510
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8511
15
        "Option 29: Perform Mask Discovery", HFILL }},
8512
8513
15
    { &hf_dhcp_option_mask_supplier,
8514
15
      { "Mask Supplier", "dhcp.option.mask_supplier",
8515
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
8516
15
        "Option 30: Mask Supplier", HFILL }},
8517
8518
15
    { &hf_dhcp_option_perform_router_discover,
8519
15
      { "Perform Router Discover", "dhcp.option.perform_router_discover",
8520
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8521
15
        "Option 31: Perform Router Discover", HFILL }},
8522
8523
15
    { &hf_dhcp_option_router_solicitation_address,
8524
15
      { "Router Solicitation Address", "dhcp.option.router_solicitation_address",
8525
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8526
15
        "Option 32: Router Solicitation Address", HFILL }},
8527
8528
15
    { &hf_dhcp_option_static_route_ip,
8529
15
      { "Destination IP Address", "dhcp.option.static_route.ip",
8530
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8531
15
        "Option 33: Destination IP address", HFILL }},
8532
8533
15
    { &hf_dhcp_option_static_route_router,
8534
15
      { "Destination Router", "dhcp.option.static_route.router",
8535
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8536
15
        "Option 33: Destination Router", HFILL }},
8537
8538
15
    { &hf_dhcp_option_trailer_encapsulation,
8539
15
      { "Trailer Encapsulation", "dhcp.option.trailer_encapsulation",
8540
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8541
15
        "Option 34: Trailer Encapsulation", HFILL }},
8542
8543
15
    { &hf_dhcp_option_arp_cache_timeout,
8544
15
      { "ARP Cache Timeout", "dhcp.option.arp_cache_timeout",
8545
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8546
15
        "Option 35: ARP Cache Timeout", HFILL }},
8547
8548
15
    { &hf_dhcp_option_ethernet_encapsulation,
8549
15
      { "Ethernet Encapsulation", "dhcp.option.ethernet_encapsulation",
8550
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8551
15
        "Option 36: Ethernet Encapsulation", HFILL }},
8552
8553
15
    { &hf_dhcp_option_tcp_default_ttl,
8554
15
      { "TCP Default TTL", "dhcp.option.tcp_default_ttl",
8555
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8556
15
        "Option 37: TCP Default TTL", HFILL }},
8557
8558
15
    { &hf_dhcp_option_tcp_keepalive_interval,
8559
15
      { "TCP Keepalive Interval", "dhcp.option.tcp_keepalive_interval",
8560
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
8561
15
        "Option 38: TCP Keepalive Interval", HFILL }},
8562
8563
15
    { &hf_dhcp_option_tcp_keepalive_garbage,
8564
15
      { "TCP Keepalive Garbage", "dhcp.option.tcp_keepalive_garbage",
8565
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x00,
8566
15
        "Option 39: TCP Keepalive Garbage", HFILL }},
8567
8568
15
    { &hf_dhcp_option_nis_domain,
8569
15
      { "Network Information Service Domain", "dhcp.option.nis_domain",
8570
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8571
15
        "Option 40: Network Information Service Domain", HFILL }},
8572
8573
15
    { &hf_dhcp_option_nis_server,
8574
15
      { "Network Information Service Server", "dhcp.option.nis_server",
8575
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8576
15
        "Option 41: Network Information Service Server", HFILL }},
8577
8578
15
    { &hf_dhcp_option_ntp_server,
8579
15
      { "Network Time Protocol Server", "dhcp.option.ntp_server",
8580
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8581
15
        "Option 42: Network Time Protocol Server", HFILL }},
8582
8583
15
    { &hf_dhcp_option43_suboption,
8584
15
      { "Option 43 Suboption", "dhcp.option.vendor.suboption",
8585
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8586
15
        NULL, HFILL }},
8587
8588
15
    { &hf_dhcp_option43_value,
8589
15
      { "Value", "dhcp.option.vendor.value",
8590
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8591
15
        "Option 43: Suboption value", HFILL }},
8592
8593
15
    { &hf_dhcp_option43_value_8,
8594
15
      { "Value", "dhcp.option.vendor.value.uint",
8595
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8596
15
        "Option 43: Suboption 8-bit value", HFILL }},
8597
8598
15
    { &hf_dhcp_option43_value_32,
8599
15
      { "Value", "dhcp.option.vendor.value.uint",
8600
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
8601
15
        "Option 43: Suboption 32-bit value", HFILL }},
8602
8603
15
    { &hf_dhcp_option43_value_stringz,
8604
15
      { "Value", "dhcp.option.vendor.value.string",
8605
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8606
15
        "Option 43: Suboption Z-String value", HFILL }},
8607
8608
15
    { &hf_dhcp_option43_value_ip_address,
8609
15
      { "Value", "dhcp.option.vendor.value.address",
8610
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8611
15
        "Option 43: Suboption IP address", HFILL }},
8612
8613
8614
15
    { &hf_dhcp_option43_pxeclient_suboption,
8615
15
      { "Option 43 Suboption", "dhcp.option.vendor.pxeclient.suboption",
8616
15
        FT_UINT8, BASE_DEC, VALS(option43_pxeclient_suboption_vals), 0x0,
8617
15
        "Option 43:PXE Client Suboption", HFILL }},
8618
8619
15
    { &hf_dhcp_option43_pxeclient_padding,
8620
15
      { "Padding", "dhcp.option.vendor.pxeclient.padding",
8621
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8622
15
        "Option 43:PXE Client 0 Padding", HFILL }},
8623
8624
15
    { &hf_dhcp_option43_pxeclient_mtftp_ip,
8625
15
      { "mtftp IP", "dhcp.option.vendor.pxeclient.mtftp_ip",
8626
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8627
15
        "Option 43:PXE Client 1 mtftp IP", HFILL }},
8628
8629
15
    { &hf_dhcp_option43_pxeclient_mtftp_client_port,
8630
15
      { "mtftp client port", "dhcp.option.vendor.pxeclient.mtftp_client_port",
8631
15
        FT_UINT16, BASE_DEC, NULL, 0x00,
8632
15
        "Option 43:PXE Client 2 mtftp client port", HFILL }},
8633
8634
15
    { &hf_dhcp_option43_pxeclient_mtftp_server_port,
8635
15
      { "mtftp server port", "dhcp.option.vendor.pxeclient.mtftp_server_port",
8636
15
        FT_UINT16, BASE_DEC, NULL, 0x00,
8637
15
        "Option 43:PXE Client 3 mtftp server port", HFILL }},
8638
8639
15
    { &hf_dhcp_option43_pxeclient_mtftp_timeout,
8640
15
      { "mtftp timeout", "dhcp.option.vendor.pxeclient.mtftp_timeout",
8641
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8642
15
        "Option 43:PXE Client 4 mtftp timeout", HFILL }},
8643
8644
15
    { &hf_dhcp_option43_pxeclient_mtftp_delay,
8645
15
      { "mtftp delay", "dhcp.option.vendor.pxeclient.mtftp_delay",
8646
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8647
15
        "Option 43:PXE Client 5 mtftp delay", HFILL }},
8648
8649
15
    { &hf_dhcp_option43_pxeclient_discovery_control,
8650
15
      { "discovery control", "dhcp.option.vendor.pxeclient.discovery_control",
8651
15
        FT_UINT8, BASE_HEX, NULL, 0x0,
8652
15
        "Option 43:PXE Client 6 discovery control", HFILL }},
8653
8654
15
    { &hf_dhcp_option43_pxeclient_discovery_control_bc,
8655
15
      { "Disable Broadcast", "dhcp.option.vendor.pxeclient.discovery_control.broadcast",
8656
15
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
8657
15
        NULL, HFILL }},
8658
8659
15
    { &hf_dhcp_option43_pxeclient_discovery_control_mc,
8660
15
      { "Disable Multicast", "dhcp.option.vendor.pxeclient.discovery_control.multicast",
8661
15
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
8662
15
        NULL, HFILL }},
8663
8664
15
    { &hf_dhcp_option43_pxeclient_discovery_control_serverlist,
8665
15
      { "Serverlist only", "dhcp.option.vendor.pxeclient.discovery_control.serverlist",
8666
15
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
8667
15
        NULL, HFILL }},
8668
8669
15
    { &hf_dhcp_option43_pxeclient_discovery_control_bstrap,
8670
15
      { "Bootstrap override", "dhcp.option.vendor.pxeclient.discovery_control.bstrap",
8671
15
        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
8672
15
        NULL, HFILL }},
8673
8674
15
    { &hf_dhcp_option43_pxeclient_multicast_address,
8675
15
      { "multicast address", "dhcp.option.vendor.pxeclient.multicast_address",
8676
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
8677
15
        "Option 43:PXE Client 7 multicast address", HFILL }},
8678
8679
15
    { &hf_dhcp_option43_pxeclient_boot_servers,
8680
15
      { "boot servers", "dhcp.option.vendor.pxeclient.boot_servers",
8681
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8682
15
        "Option 43:PXE Client 8 boot servers", HFILL }},
8683
8684
15
    { &hf_dhcp_option43_pxeclient_boot_server_type,
8685
15
      { "Type", "dhcp.option.vendor.pxeclient.boot_servers.type",
8686
15
        FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_server_types), 0x0,
8687
15
        NULL, HFILL }},
8688
8689
15
    { &hf_dhcp_option43_pxeclient_boot_server_count,
8690
15
      { "IP count", "dhcp.option.vendor.pxeclient.boot_servers.count",
8691
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8692
15
        NULL, HFILL }},
8693
8694
15
    { &hf_dhcp_option43_pxeclient_boot_server_ip,
8695
15
      { "IP", "dhcp.option.vendor.pxeclient.boot_servers.ip",
8696
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
8697
15
        NULL, HFILL }},
8698
8699
15
    { &hf_dhcp_option43_pxeclient_boot_menu,
8700
15
      { "boot menu", "dhcp.option.vendor.pxeclient.boot_menu",
8701
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8702
15
        "Option 43:PXE Client 9 boot menu", HFILL }},
8703
8704
15
    { &hf_dhcp_option43_pxeclient_boot_menu_type,
8705
15
      { "Type", "dhcp.option.vendor.pxeclient.boot_menu.type",
8706
15
        FT_UINT16, BASE_DEC, VALS(o43pxeclient_boot_menu_types), 0x0,
8707
15
        NULL, HFILL }},
8708
8709
15
    { &hf_dhcp_option43_pxeclient_boot_menu_length,
8710
15
      { "Length", "dhcp.option.vendor.pxeclient.boot_menu.length",
8711
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8712
15
        NULL, HFILL }},
8713
8714
15
    { &hf_dhcp_option43_pxeclient_boot_menu_desc,
8715
15
      { "Description", "dhcp.option.vendor.pxeclient.boot_menu.desc",
8716
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8717
15
        NULL, HFILL }},
8718
8719
15
    { &hf_dhcp_option43_pxeclient_menu_prompt,
8720
15
      { "menu prompt", "dhcp.option.vendor.pxeclient.menu_prompt",
8721
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8722
15
        "Option 43:PXE Client 10 menu prompt", HFILL }},
8723
8724
15
    { &hf_dhcp_option43_pxeclient_menu_prompt_timeout,
8725
15
      { "Timeout", "dhcp.option.vendor.pxeclient.menu_prompt.timeout",
8726
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8727
15
        NULL, HFILL }},
8728
8729
15
    { &hf_dhcp_option43_pxeclient_menu_prompt_prompt,
8730
15
      { "Prompt", "dhcp.option.vendor.pxeclient.menu_prompt.prompt",
8731
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8732
15
        NULL, HFILL }},
8733
8734
15
    { &hf_dhcp_option43_pxeclient_multicast_address_alloc,
8735
15
      { "multicast address alloc", "dhcp.option.vendor.pxeclient.multicast_address_alloc",
8736
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8737
15
        "Option 43:PXE Client 11 multicast address alloc", HFILL }},
8738
8739
15
    { &hf_dhcp_option43_pxeclient_credential_types,
8740
15
      { "credential types", "dhcp.option.vendor.pxeclient.credential_types",
8741
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8742
15
        "Option 43:PXE Client 12 credential types", HFILL }},
8743
8744
15
    { &hf_dhcp_option43_pxeclient_boot_item,
8745
15
      { "boot item", "dhcp.option.vendor.pxeclient.boot_item",
8746
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8747
15
        "Option 43:PXE Client 71 boot item", HFILL }},
8748
8749
15
    { &hf_dhcp_option43_pxeclient_boot_item_type,
8750
15
      { "Type", "dhcp.option.vendor.pxeclient.boot_item.type",
8751
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8752
15
        NULL, HFILL }},
8753
8754
15
    { &hf_dhcp_option43_pxeclient_boot_item_layer,
8755
15
      { "Layer", "dhcp.option.vendor.pxeclient.boot_item.layer",
8756
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8757
15
        NULL, HFILL }},
8758
8759
15
    { &hf_dhcp_option43_pxeclient_lcm_server,
8760
15
      { "LCM Server Name", "dhcp.option.vendor.pxeclient.lcm_server",
8761
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8762
15
        "Option 43:PXE Client 179 LCM Server", HFILL }},
8763
8764
15
    { &hf_dhcp_option43_pxeclient_lcm_domain,
8765
15
      { "LCM Domain", "dhcp.option.vendor.pxeclient.lcm_domain",
8766
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8767
15
        "Option 43:PXE Client 180 LCM Domain", HFILL }},
8768
8769
15
    { &hf_dhcp_option43_pxeclient_lcm_nic_option,
8770
15
      { "LCM NIC option", "dhcp.option.vendor.pxeclient.lcm_nic_option",
8771
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8772
15
        "Option 43:PXE Client 181 LCM NIC Option", HFILL }},
8773
8774
15
    { &hf_dhcp_option43_pxeclient_lcm_workgroup,
8775
15
      { "LCM Workgroup", "dhcp.option.vendor.pxeclient.lcm_workgroup",
8776
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8777
15
        "Option 43:PXE Client 190 LCM Workgroup", HFILL }},
8778
8779
15
    { &hf_dhcp_option43_pxeclient_discovery,
8780
15
      { "Discovery", "dhcp.option.vendor.pxeclient.discovery",
8781
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8782
15
        "Option 43:PXE Client 191 Discovery", HFILL }},
8783
8784
15
    { &hf_dhcp_option43_pxeclient_configured,
8785
15
      { "Configured", "dhcp.option.vendor.pxeclient.configured",
8786
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
8787
15
        "Option 43:PXE Client 192 Configured", HFILL }},
8788
8789
15
    { &hf_dhcp_option43_pxeclient_lcm_version,
8790
15
      { "LCM Version", "dhcp.option.vendor.pxeclient.lcm_version",
8791
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
8792
15
        "Option 43:PXE Client 193 LCM Version", HFILL }},
8793
8794
15
    { &hf_dhcp_option43_pxeclient_lcm_serial,
8795
15
      { "LCM Serial Number", "dhcp.option.vendor.pxeclient.lcm_serial",
8796
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8797
15
        "Option 43:PXE Client 194 LCM Serial Number", HFILL }},
8798
8799
15
    { &hf_dhcp_option43_pxeclient_end,
8800
15
      { "PXE Client End", "dhcp.option.vendor.pxeclient.end",
8801
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8802
15
        "Option 43:PXE Client 255 End", HFILL }},
8803
8804
8805
         /* AEROHIVE (Extremenetworks) vendor suboptions */
8806
15
         { &hf_dhcp_option43_aerohive_suboption,
8807
15
     { "Option 43 Suboption", "dhcp.option.vendor.aerohive.suboption",
8808
15
       FT_UINT8, BASE_DEC, VALS(option43_aerohive_suboption_vals), 0x0,
8809
15
       "Option 43:AEROHIVE Suboption", HFILL }},
8810
8811
15
    { &hf_dhcp_option43_aerohive_unknown,
8812
15
      { "Unknown", "dhcp.option.vendor.aerohive.unknown",
8813
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8814
15
        NULL, HFILL }},
8815
8816
15
         { &hf_dhcp_option43_aerohive_xiqhostname,
8817
15
     { "HM FQDN", "dhcp.option.vendor.aerohive.xiqhostname",
8818
15
       FT_STRING, BASE_NONE, NULL, 0x0,
8819
15
       "Hive Manager NG FQDN", HFILL }},
8820
8821
15
         { &hf_dhcp_option43_aerohive_xiqipaddress,
8822
15
     { "HM IP", "dhcp.option.vendor.aerohive.xiqipaddress",
8823
15
       FT_IPv4, BASE_NONE, NULL, 0x0,
8824
15
       "Hive Manager NG IP address", HFILL }},
8825
8826
8827
15
    { &hf_dhcp_option43_cl_suboption,
8828
15
      { "Option 43 Suboption", "dhcp.option.vendor.cl.suboption",
8829
15
        FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
8830
15
        "Option 43:CL Suboption", HFILL }},
8831
8832
15
    { &hf_dhcp_option43_cl_padding,
8833
15
      { "Padding", "dhcp.option.vendor.cl.padding",
8834
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8835
15
        "Option 43:CL 0 Padding", HFILL }},
8836
8837
15
    { &hf_dhcp_option43_cl_suboption_request_list,
8838
15
      { "Suboption Request List", "dhcp.option.vendor.cl.suboption_request_list",
8839
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8840
15
        "Option 43:CL 1 Suboption Request List", HFILL }},
8841
8842
15
    { &hf_dhcp_option43_cl_device_type,
8843
15
      { "Device Type", "dhcp.option.vendor.cl.device_type",
8844
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8845
15
        "Option 43:CL 2 Device Type", HFILL }},
8846
8847
15
    { &hf_dhcp_option43_cl_esafe_type,
8848
15
      { "eSAFE Types", "dhcp.option.vendor.cl.esafe_type",
8849
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8850
15
        "Option 43:CL 3 eSAFE Types", HFILL }},
8851
8852
15
    { &hf_dhcp_option43_cl_serial_number,
8853
15
      { "Serial Number", "dhcp.option.vendor.cl.serial_number",
8854
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8855
15
        "Option 43:CL 4 Serial Number", HFILL }},
8856
8857
15
    { &hf_dhcp_option43_cl_hardware_version,
8858
15
      { "Hardware Version", "dhcp.option.vendor.cl.hardware_version",
8859
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8860
15
        "Option 43:CL 5 Hardware Version", HFILL }},
8861
8862
15
    { &hf_dhcp_option43_cl_software_version,
8863
15
      { "Software Version", "dhcp.option.vendor.cl.software_version",
8864
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8865
15
        "Option 43:CL 6 Software Version", HFILL }},
8866
8867
15
    { &hf_dhcp_option43_cl_boot_rom_version,
8868
15
      { "Boot ROM version", "dhcp.option.vendor.cl.boot_rom_version",
8869
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8870
15
        "Option 43:CL 7 Boot ROM version", HFILL }},
8871
8872
15
    { &hf_dhcp_option43_cl_oui_string,
8873
15
      { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_string",
8874
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8875
15
        "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8876
8877
15
    { &hf_dhcp_option43_cl_oui_bytes,
8878
15
      { "Organizationally Unique Identifier", "dhcp.option.vendor.cl.oui_bytes",
8879
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8880
15
        "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
8881
8882
15
    { &hf_dhcp_option43_cl_model_number,
8883
15
      { "Model Number", "dhcp.option.vendor.cl.model_number",
8884
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8885
15
        "Option 43:CL 9 Model Number", HFILL }},
8886
8887
15
    { &hf_dhcp_option43_cl_vendor_name10,
8888
15
      { "Vendor Name", "dhcp.option.vendor.cl.vendor_name10",
8889
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8890
15
        "Option 43:CL 10 Vendor Name", HFILL }},
8891
8892
15
    { &hf_dhcp_option43_cl_address_realm,
8893
15
      { "Address Realm", "dhcp.option.vendor.cl.address_realm",
8894
15
        FT_UINT8, BASE_DEC, VALS(cablehome_subopt11_vals), 0x0,
8895
15
        "Option 43:CL 11 Address Realm", HFILL }},
8896
8897
15
    { &hf_dhcp_option43_cl_cm_ps_system_desc,
8898
15
      { "CM/PS System Description", "dhcp.option.vendor.cl.cm_ps_system_desc",
8899
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8900
15
        "Option 43:CL 12 CM/PS System Description", HFILL }},
8901
8902
15
    { &hf_dhcp_option43_cl_cm_ps_firmware_revision,
8903
15
      { "CM/PS Firmware Revision", "dhcp.option.vendor.cl.cm_ps_firmware_revision",
8904
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8905
15
        "Option 43:CL 13 CM/PS Firmware Revision", HFILL }},
8906
8907
15
    { &hf_dhcp_option43_cl_firewall_policy_file_version,
8908
15
      { "Firewall Policy File Version", "dhcp.option.vendor.cl.firewall_policy_file_version",
8909
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8910
15
        "Option 43:CL 14 Firewall Policy File Version", HFILL }},
8911
8912
15
    { &hf_dhcp_option43_cl_esafe_config_file_devices,
8913
15
      { "eSafe Config File Devices", "dhcp.option.vendor.cl.esafe_config_file_devices",
8914
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8915
15
        "Option 43:CL 15 eSafe Config File Devices", HFILL }},
8916
8917
15
    { &hf_dhcp_option43_cl_video_security_tape,
8918
15
      { "Video Security Type", "dhcp.option.vendor.cl.video_security_tape",
8919
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8920
15
        "Option 43:CL 18 Video Security Type", HFILL }},
8921
8922
15
    { &hf_dhcp_option43_cl_mta_mac_address,
8923
15
      { "MTA MAC Address", "dhcp.option.vendor.cl.mta_mac_address",
8924
15
        FT_ETHER, BASE_NONE, NULL, 0x0,
8925
15
        "Option 43:CL 31 MTA MAC Address", HFILL }},
8926
8927
15
    { &hf_dhcp_option43_cl_correlation_ID,
8928
15
      { "Correlation ID", "dhcp.option.vendor.cl.correlation_ID",
8929
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
8930
15
        "Option 43: CL 32 Correlation ID", HFILL }},
8931
8932
15
    { &hf_dhcp_option43_cl_vendor_name51,
8933
15
      { "Vendor Name", "dhcp.option.vendor.cl.vendor_name51",
8934
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8935
15
        "Option 43:CL 51 Vendor Name", HFILL }},
8936
8937
15
    { &hf_dhcp_option43_cl_cablecard_capability,
8938
15
      { "CableCARD Capability", "dhcp.option.vendor.cl.cablecard_capability",
8939
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8940
15
        "Option 43:CL 52 CableCARD Capability", HFILL }},
8941
8942
15
    { &hf_dhcp_option43_cl_device_id_ca,
8943
15
      { "Device Identification (CA)", "dhcp.option.vendor.cl.device_id_ca",
8944
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
8945
15
        "Option 43:CL 53 Device Identification (CA)", HFILL }},
8946
8947
15
    { &hf_dhcp_option43_cl_device_id_x509,
8948
15
      { "Device Identification (X.509)", "dhcp.option.vendor.cl.device_id_x509",
8949
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
8950
15
        "Option 43:CL 54 Device Identification (X.509)", HFILL }},
8951
8952
15
    { &hf_dhcp_option43_cl_end,
8953
15
      { "CL End", "dhcp.option.vendor.cl.end",
8954
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8955
15
        "Option 43:CL 255 End", HFILL }},
8956
8957
8958
15
    { &hf_dhcp_option43_alcatel_suboption,
8959
15
      { "Option 43 Suboption", "dhcp.option.vendor.alu.suboption",
8960
15
        FT_UINT8, BASE_DEC, VALS(option43_alcatel_suboption_vals), 0x0,
8961
15
        "Option 43:Alcatel Suboption", HFILL }},
8962
8963
15
    { &hf_dhcp_option43_alcatel_padding,
8964
15
      { "Padding", "dhcp.option.vendor.alu.padding",
8965
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8966
15
        "Option 43:Alcatel 0 Padding", HFILL }},
8967
8968
15
    { &hf_dhcp_option43_alcatel_vlan_id,
8969
15
      { "Voice VLAN ID", "dhcp.option.vendor.alu.vid",
8970
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
8971
15
        "Option 43:Alcatel 58 Voice VLAN ID", HFILL }},
8972
8973
15
    { &hf_dhcp_option43_alcatel_tftp1,
8974
15
      { "Spatial Redundancy TFTP1", "dhcp.option.vendor.alu.tftp1",
8975
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
8976
15
        "Option 43:Alcatel 64 Spatial Redundancy TFTP1", HFILL }},
8977
8978
15
    { &hf_dhcp_option43_alcatel_tftp2,
8979
15
      { "Spatial Redundancy TFTP2", "dhcp.option.vendor.alu.tftp2",
8980
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
8981
15
        "Option 43:Alcatel 65 Spatial Redundancy TFTP2", HFILL }},
8982
8983
15
    { &hf_dhcp_option43_alcatel_app_type,
8984
15
      { "Application Type", "dhcp.option.vendor.alu.app_type",
8985
15
        FT_UINT8, BASE_DEC, VALS(option43_alcatel_app_type_vals), 0x0,
8986
15
        "Option 43:Alcatel 66 Application Type", HFILL }},
8987
8988
15
    { &hf_dhcp_option43_alcatel_sip_url,
8989
15
      { "SIP URL", "dhcp.option.vendor.alu.sip_url",
8990
15
        FT_STRING, BASE_NONE, NULL, 0x0,
8991
15
        "Option 43:Alcatel 67 SIP URL", HFILL }},
8992
8993
15
    { &hf_dhcp_option43_alcatel_end,
8994
15
      { "Alcatel End", "dhcp.option.vendor.alu.end",
8995
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
8996
15
        "Option 43:Alcatel 255 End", HFILL }},
8997
8998
15
    { &hf_dhcp_option43_arubaap_controllerip,
8999
15
      { "Aruba Controller IP", "dhcp.option.vendor.arubaap.controllerip",
9000
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9001
15
        "Address IP of Aruba controller", HFILL }},
9002
9003
15
    { &hf_dhcp_option43_arubaiap,
9004
15
      { "Aruba Instant AP", "dhcp.option.vendor.arubaiap",
9005
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9006
15
        "nameorg,amp-ip-address,password", HFILL }},
9007
9008
15
    { &hf_dhcp_option43_arubaiap_nameorg,
9009
15
      { "Name Organisation", "dhcp.option.vendor.arubaiap.name_org",
9010
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9011
15
        NULL, HFILL }},
9012
9013
15
    { &hf_dhcp_option43_arubaiap_ampip,
9014
15
      { "AMP IP Address", "dhcp.option.vendor.arubaiap.amp_ip",
9015
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9016
15
        "Address IP of Airwave server (AMP)", HFILL }},
9017
9018
15
    { &hf_dhcp_option43_arubaiap_password,
9019
15
      { "Password", "dhcp.option.vendor.arubaiap.password",
9020
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9021
15
        "Password for Instant AP Airwave server (AMP)", HFILL }},
9022
9023
9024
15
    { &hf_dhcp_option43_bsdp_suboption,
9025
15
      { "Option 43 Suboption", "dhcp.option.vendor.bsdp.suboption",
9026
15
        FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0,
9027
15
        "Option 43:BSDP Suboption", HFILL }},
9028
9029
15
    { &hf_dhcp_option43_bsdp_message_type,
9030
15
      { "Message Type", "dhcp.option.vendor.bsdp.message_type",
9031
15
        FT_UINT8, BASE_DEC, VALS(o43_bsdp_message_type_vals), 0x0,
9032
15
        NULL, HFILL }},
9033
9034
15
    { &hf_dhcp_option43_bsdp_version,
9035
15
      { "Version", "dhcp.option.vendor.bsdp.version",
9036
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
9037
15
        NULL, HFILL }},
9038
9039
15
    { &hf_dhcp_option43_bsdp_server_identifier,
9040
15
      { "Server Identifier", "dhcp.option.vendor.bsdp.server_identifier",
9041
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
9042
15
        NULL, HFILL }},
9043
9044
15
    { &hf_dhcp_option43_bsdp_server_priority,
9045
15
      { "Server Priority", "dhcp.option.vendor.bsdp.server_priority",
9046
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9047
15
        NULL, HFILL }},
9048
9049
15
    { &hf_dhcp_option43_bsdp_reply_port,
9050
15
      { "Reply Port", "dhcp.option.vendor.bsdp.reply_port",
9051
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9052
15
        NULL, HFILL }},
9053
9054
15
    { &hf_dhcp_option43_bsdp_boot_image_list_path,
9055
15
      { "Boot Image List Path", "dhcp.option.vendor.bsdp.boot_image_list_path",
9056
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9057
15
        NULL, HFILL }},
9058
9059
15
    { &hf_dhcp_option43_bsdp_boot_image_index,
9060
15
      { "Boot Image Index", "dhcp.option.vendor.bsdp.boot_image.index",
9061
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
9062
15
        NULL, HFILL }},
9063
9064
15
    { &hf_dhcp_option43_bsdp_default_boot_image_id,
9065
15
      { "Default Boot Image ID", "dhcp.option.vendor.bsdp.default_boot_image_id",
9066
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
9067
15
        NULL, HFILL }},
9068
9069
15
    { &hf_dhcp_option43_bsdp_selected_boot_image_id,
9070
15
      { "Selected Boot Image ID", "dhcp.option.vendor.bsdp.selected_boot_image_id",
9071
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
9072
15
        NULL, HFILL }},
9073
9074
15
    { &hf_dhcp_option43_bsdp_boot_image_list,
9075
15
      { "Boot Image List", "dhcp.option.vendor.bsdp.boot_image_list",
9076
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9077
15
        NULL, HFILL }},
9078
9079
15
    { &hf_dhcp_option43_bsdp_image_desc,
9080
15
      { "Boot Image Description", "dhcp.option.vendor.bsdp.boot_image.desc",
9081
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9082
15
        NULL, HFILL }},
9083
9084
15
    { &hf_dhcp_option43_bsdp_boot_image_name_len,
9085
15
      { "Boot Image Name Length", "dhcp.option.vendor.bsdp.boot_image.name_len",
9086
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9087
15
        NULL, HFILL }},
9088
9089
15
    { &hf_dhcp_option43_bsdp_boot_image_name,
9090
15
      { "Boot Image Name", "dhcp.option.vendor.bsdp.boot_image.name",
9091
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9092
15
        NULL, HFILL }},
9093
9094
15
    { &hf_dhcp_option43_bsdp_netboot_firmware,
9095
15
      { "NetBoot 1.0 Firmware", "dhcp.option.vendor.bsdp.netboot_firmware",
9096
15
        FT_NONE, BASE_NONE, NULL, 0x0,
9097
15
        NULL, HFILL }},
9098
9099
15
    { &hf_dhcp_option43_bsdp_attributes_filter_list,
9100
15
      { "Boot Image Attributes Filter List", "dhcp.option.vendor.bsdp.attributes_filter_list",
9101
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9102
15
        NULL, HFILL }},
9103
9104
15
    { &hf_dhcp_option43_bsdp_boot_image_attribute,
9105
15
      { "Boot Image Attribute", "dhcp.option.vendor.bsdp.boot_image.attribute",
9106
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
9107
15
        NULL, HFILL }},
9108
9109
15
    { &hf_dhcp_option43_bsdp_boot_image_attribute_install,
9110
15
      { "Install", "dhcp.option.vendor.bsdp.boot_image.attribute.install",
9111
15
        FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_install_vals), 0x8000,
9112
15
        "Boot Image Attribute Install", HFILL }},
9113
9114
15
    { &hf_dhcp_option43_bsdp_boot_image_attribute_kind,
9115
15
      { "Kind", "dhcp.option.vendor.bsdp.boot_image.attribute.kind",
9116
15
        FT_UINT16, BASE_HEX, VALS(o43_bsdp_boot_image_kind_vals), 0x7f00,
9117
15
        "Boot Image Attribute Kind", HFILL }},
9118
9119
15
    { &hf_dhcp_option43_bsdp_boot_image_attribute_reserved,
9120
15
      { "Reserved", "dhcp.option.vendor.bsdp.boot_image.attribute.reserved",
9121
15
        FT_UINT16, BASE_HEX, NULL, 0x00ff,
9122
15
        "Boot Image Attribute Reserved", HFILL }},
9123
9124
15
    { &hf_dhcp_option43_bsdp_message_size,
9125
15
      { "Message Size", "dhcp.option.vendor.bsdp.message_size",
9126
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9127
15
        NULL, HFILL }},
9128
9129
9130
15
    { &hf_dhcp_option_netbios_over_tcpip_name_server,
9131
15
      { "NetBIOS over TCP/IP Name Server", "dhcp.option.netbios_over_tcpip_name_server",
9132
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9133
15
        "Option 44: NetBIOS over TCP/IP Name Server", HFILL }},
9134
9135
15
    { &hf_dhcp_option_netbios_over_tcpip_dd_name_server,
9136
15
      { "NetBIOS over TCP/IP Datagram Distribution Name Server", "dhcp.option.netbios_over_tcpip_dd_name_server",
9137
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9138
15
        "Option 45: NetBIOS over TCP/IP Datagram Distribution Name Server", HFILL }},
9139
9140
15
    { &hf_dhcp_option_netbios_over_tcpip_node_type,
9141
15
      { "NetBIOS over TCP/IP Node Type", "dhcp.option.netbios_over_tcpip_node_type",
9142
15
        FT_UINT8, BASE_DEC, VALS(dhcp_nbnt_vals), 0x0,
9143
15
        "Option 46: NetBIOS over TCP/IP Node Type", HFILL }},
9144
9145
15
    { &hf_dhcp_option_netbios_over_tcpip_scope,
9146
15
      { "NetBIOS over TCP/IP Scope", "dhcp.option.netbios_over_tcpip_scope",
9147
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9148
15
        "Option 47: NetBIOS over TCP/IP Scope", HFILL }},
9149
9150
15
    { &hf_dhcp_option_xwindows_system_font_server,
9151
15
      { "X Window System Font Server", "dhcp.option.xwindows_system_font_server",
9152
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9153
15
        "Option 48: X Window System Font Server", HFILL }},
9154
9155
15
    { &hf_dhcp_option_xwindows_system_display_manager,
9156
15
      { "X Window System Display Manager", "dhcp.option.xwindows_system_display_manager",
9157
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9158
15
        "Option 49: X Window System Display Manager", HFILL }},
9159
9160
15
    { &hf_dhcp_option_requested_ip_address,
9161
15
      { "Requested IP Address", "dhcp.option.requested_ip_address",
9162
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9163
15
        "Option 50: Requested IP Address", HFILL }},
9164
9165
15
    { &hf_dhcp_option_ip_address_lease_time,
9166
15
      { "IP Address Lease Time", "dhcp.option.ip_address_lease_time",
9167
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9168
15
        "Option 51: IP Address Lease Time", HFILL }},
9169
9170
15
    { &hf_dhcp_option_option_overload,
9171
15
      { "Option Overload", "dhcp.option.option_overload",
9172
15
        FT_UINT8, BASE_DEC, VALS(opt_overload_vals), 0x0,
9173
15
        "Option 52: Option Overload", HFILL }},
9174
9175
15
    { &hf_dhcp_option_dhcp,
9176
15
      { "DHCP", "dhcp.option.dhcp",
9177
15
        FT_UINT8, BASE_DEC, VALS(opt53_text), 0x0,
9178
15
        "Option 53: DHCP option", HFILL }},
9179
9180
15
    { &hf_dhcp_option_dhcp_server_id,
9181
15
      { "DHCP Server Identifier", "dhcp.option.dhcp_server_id",
9182
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9183
15
        "Option 54: DHCP Server Identifier", HFILL }},
9184
9185
15
    { &hf_dhcp_option_parameter_request_list_item,
9186
15
      { "Parameter Request List Item", "dhcp.option.request_list_item",
9187
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9188
15
        "Option 55: Parameter Request List Item", HFILL }},
9189
9190
15
    { &hf_dhcp_option_message,
9191
15
      { "Message", "dhcp.option.message",
9192
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9193
15
        "Option 56: Option message", HFILL }},
9194
9195
15
    { &hf_dhcp_option_dhcp_max_message_size,
9196
15
      { "Maximum DHCP Message Size", "dhcp.option.dhcp_max_message_size",
9197
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9198
15
        "Option 57: Maximum DHCP Message Size", HFILL }},
9199
9200
15
    { &hf_dhcp_option_renewal_time_value,
9201
15
      { "Renewal Time Value", "dhcp.option.renewal_time_value",
9202
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9203
15
        "Option 58: Renewal Time Value", HFILL }},
9204
9205
15
    { &hf_dhcp_option_rebinding_time_value,
9206
15
      { "Rebinding Time Value", "dhcp.option.rebinding_time_value",
9207
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9208
15
        "Option 59: Rebinding Time Value", HFILL }},
9209
9210
15
    { &hf_dhcp_option_vendor_class_id,
9211
15
      { "Vendor class identifier", "dhcp.option.vendor_class_id",
9212
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9213
15
        "Option 60: Vendor class identifier", HFILL }},
9214
9215
15
    { &hf_dhcp_option_vendor_class_data,
9216
15
      { "vendor-class-data", "dhcp.option.vendor_class_data",
9217
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9218
15
        "Option 60: Vendor class data", HFILL }},
9219
9220
15
    { &hf_dhcp_option_novell_netware_ip_domain,
9221
15
      { "Novell/Netware IP domain", "dhcp.option.novell_netware_ip_domain",
9222
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9223
15
        "Option 62: Novell/Netware IP domain", HFILL }},
9224
9225
15
    { &hf_dhcp_option63_suboption,
9226
15
      { "Option 63 Suboption", "dhcp.option.novell_options.suboption",
9227
15
        FT_UINT8, BASE_DEC, VALS(option63_suboption_vals), 0x0,
9228
15
        "Option 63: Suboption", HFILL }},
9229
9230
15
    { &hf_dhcp_option63_value,
9231
15
      { "Value", "dhcp.option.novell_options.value",
9232
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9233
15
        "Option 63: Suboption value", HFILL }},
9234
9235
15
    { &hf_dhcp_option63_value_8,
9236
15
      { "Value", "dhcp.option.novell_options.value.uint",
9237
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9238
15
        "Option 63: Suboption 8-bit value", HFILL }},
9239
9240
15
    { &hf_dhcp_option63_value_ip_address,
9241
15
      { "Value", "dhcp.option.novell_options.value.address",
9242
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9243
15
        "Option 63: Suboption IP address", HFILL }},
9244
9245
15
    { &hf_dhcp_option63_value_boolean,
9246
15
      { "Value", "dhcp.option.novell_options.value.bool",
9247
15
        FT_BOOLEAN, BASE_NONE, NULL, 0x00,
9248
15
        "Option 63: Suboption Boolean value", HFILL }},
9249
9250
15
    { &hf_dhcp_option63_broadcast,
9251
15
      { "Broadcast for nearest Netware server", "dhcp.option.novell_options.broadcast",
9252
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9253
15
        "Option 63:5 Broadcast for nearest Netware server", HFILL }},
9254
9255
15
    { &hf_dhcp_option63_preferred_dss_server,
9256
15
      { "Preferred DSS server", "dhcp.option.novell_options.preferred_dss_server",
9257
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9258
15
        "Option 63:6 Preferred DSS server", HFILL }},
9259
9260
15
    { &hf_dhcp_option63_nearest_nwip_server,
9261
15
      { "Nearest NWIP server", "dhcp.option.novell_options.nearest_nwip_server",
9262
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9263
15
        "Option 63:7 Nearest NWIP server", HFILL }},
9264
9265
15
    { &hf_dhcp_option63_autoretries,
9266
15
      { "Autoretries", "dhcp.option.novell_options.autoretries",
9267
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9268
15
        "Option 63:8 Autoretries", HFILL }},
9269
9270
15
    { &hf_dhcp_option63_autoretry_delay,
9271
15
      { "Autoretry delay, sec",
9272
15
        "dhcp.option.novell_options.autoretry_delay", FT_UINT8, BASE_DEC, NULL,
9273
15
        0x0, "Option 63:9 Autoretry delay, sec", HFILL }},
9274
9275
15
    { &hf_dhcp_option63_support_netware_v1_1,
9276
15
      { "Broadcast for nearest Netware server", "dhcp.option.novell_options.support_netware_v1_1",
9277
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x00,
9278
15
        "Option 63:10 Broadcast for nearest Netware server", HFILL }},
9279
9280
15
    { &hf_dhcp_option63_primary_dss,
9281
15
      { "Primary DSS", "dhcp.option.novell_options.primary_dss",
9282
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9283
15
        "Option 63:11 Primary DSS", HFILL }},
9284
9285
9286
15
    { &hf_dhcp_option_nis_plus_domain,
9287
15
      { "Network Information Service+ Domain", "dhcp.option.nis_plus_domain",
9288
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9289
15
        "Option 64: Network Information Service+ Domain", HFILL }},
9290
9291
15
    { &hf_dhcp_option_nis_plus_server,
9292
15
      { "Network Information Service+ Server", "dhcp.option.nis_plus_server",
9293
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9294
15
        "Option 65: Network Information Service+ Server", HFILL }},
9295
9296
15
    { &hf_dhcp_option_tftp_server_name,
9297
15
      { "TFTP Server Name", "dhcp.option.tftp_server_name",
9298
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9299
15
        "Option 66: TFTP Server Name", HFILL }},
9300
9301
15
    { &hf_dhcp_option_bootfile_name,
9302
15
      { "Bootfile name", "dhcp.option.bootfile_name",
9303
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9304
15
        "Option 67: Bootfile name", HFILL }},
9305
9306
15
    { &hf_dhcp_option_mobile_ip_home_agent,
9307
15
      { "Mobile IP Home Agent", "dhcp.option.mobile_ip_home_agent",
9308
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9309
15
        "Option 68: Mobile IP Home Agent", HFILL }},
9310
9311
15
    { &hf_dhcp_option_smtp_server,
9312
15
      { "SMTP Server", "dhcp.option.smtp_server",
9313
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9314
15
        "Option 69: SMTP Server", HFILL }},
9315
9316
15
    { &hf_dhcp_option_pop3_server,
9317
15
      { "POP3 Server", "dhcp.option.pop3_server",
9318
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9319
15
        "Option 70: POP3 Server", HFILL }},
9320
9321
15
    { &hf_dhcp_option_nntp_server,
9322
15
      { "NNTP Server", "dhcp.option.nntp_server",
9323
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9324
15
        "Option 71: NNTP Server", HFILL }},
9325
9326
15
    { &hf_dhcp_option_default_www_server,
9327
15
      { "Default WWW Server", "dhcp.option.default_www_server",
9328
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9329
15
        "Option 72: Default WWW Server", HFILL }},
9330
9331
15
    { &hf_dhcp_option_default_finger_server,
9332
15
      { "Default Finger Server", "dhcp.option.default_finger_server",
9333
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9334
15
        "Option 73: Default Finger Server", HFILL }},
9335
9336
15
    { &hf_dhcp_option_default_irc_server,
9337
15
      { "Default IRC Server", "dhcp.option.default_irc_server",
9338
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9339
15
        "Option 74: Default IRC Server", HFILL }},
9340
9341
15
    { &hf_dhcp_option_streettalk_server,
9342
15
      { "StreetTalk Server", "dhcp.option.streettalk_server",
9343
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9344
15
        "Option 75: StreetTalk Server", HFILL }},
9345
9346
15
    { &hf_dhcp_option_streettalk_da_server,
9347
15
      { "StreetTalk Directory Assistance Server", "dhcp.option.streettalk_da_server",
9348
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9349
15
        "Option 76: StreetTalk Directory Assistance Server", HFILL }},
9350
9351
15
    { &hf_dhcp_option77_user_class,
9352
15
      { "Instance of User Class", "dhcp.option.user_class",
9353
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9354
15
        NULL, HFILL }},
9355
9356
15
    { &hf_dhcp_option77_user_class_length,
9357
15
      { "User Class Length", "dhcp.option.user_class.length",
9358
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9359
15
        "Length of User Class Instance", HFILL }},
9360
9361
15
    { &hf_dhcp_option77_user_class_data,
9362
15
      { "User Class Data", "dhcp.option.user_class.data",
9363
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9364
15
        "Data of User Class Instance", HFILL }},
9365
9366
15
    { &hf_dhcp_option77_user_class_text,
9367
15
      { "User Class Data (Text)", "dhcp.option.user_class.text",
9368
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9369
15
        "Text of User Class Instance", HFILL }},
9370
9371
15
    { &hf_dhcp_option77_user_class_binary_data_length,
9372
15
      { "User Class Binary Data Length", "dhcp.option.user_class_binary_data_length",
9373
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9374
15
        "Length of User Class Binary Data (Microsoft)", HFILL }},
9375
9376
15
    { &hf_dhcp_option77_user_class_binary_data,
9377
15
      { "User Class Binary Data", "dhcp.option.user_class_binary_data",
9378
15
        FT_BYTES, BASE_SHOW_UTF_8_PRINTABLE, NULL, 0x0,
9379
15
        "User Class Binary Data (Microsoft)", HFILL }},
9380
9381
15
    { &hf_dhcp_option77_user_class_padding,
9382
15
      { "User Class padding", "dhcp.option.user_class_padding",
9383
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9384
15
        "User Class padding (Microsoft)", HFILL }},
9385
9386
15
    { &hf_dhcp_option77_user_class_name_length,
9387
15
      { "User Class Name Length", "dhcp.option.user_class_name_length",
9388
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9389
15
        "Length of User Class Name (Microsoft)", HFILL }},
9390
9391
15
    { &hf_dhcp_option77_user_class_name,
9392
15
      { "User Class Name", "dhcp.option.user_class_name",
9393
15
        FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9394
15
        "User Class Name (Microsoft)", HFILL }},
9395
9396
15
    { &hf_dhcp_option77_user_class_description_length,
9397
15
      { "User Class Description Length", "dhcp.option.user_class_description_length",
9398
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9399
15
        "Length of User Class Description (Microsoft)", HFILL }},
9400
9401
15
    { &hf_dhcp_option77_user_class_description,
9402
15
      { "User Class Description", "dhcp.option.user_class_description",
9403
15
        FT_STRINGZPAD, BASE_NONE, NULL, 0x0,
9404
15
        "User Class Description (Microsoft)", HFILL }},
9405
9406
15
    { &hf_dhcp_option_slp_directory_agent_value,
9407
15
      { "Value", "dhcp.option.slp_directory_agent.value",
9408
15
        FT_UINT8, BASE_DEC, VALS(slpda_vals), 0x0,
9409
15
        "Option 78: SLPDA Value", HFILL }},
9410
9411
15
    { &hf_dhcp_option_slp_directory_agent_slpda_address,
9412
15
      { "IP Address", "dhcp.option.slp_directory_agent.slpda_address",
9413
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9414
15
        "Option 78: SLPDA Address", HFILL }},
9415
9416
15
    { &hf_dhcp_option_slp_service_scope_value,
9417
15
      { "Value", "dhcp.option.slp_service_scope.value",
9418
15
        FT_UINT8, BASE_DEC, VALS(slp_scope_vals), 0x0,
9419
15
        "Option 79: SLP Service Scope Value", HFILL }},
9420
9421
15
    { &hf_dhcp_option_slp_service_scope_string,
9422
15
      { "SLP Service Scope", "dhcp.option.slp_service_scope.string",
9423
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9424
15
        "Option 79: SLP Service Scope", HFILL }},
9425
9426
9427
15
    { &hf_dhcp_option82_suboption,
9428
15
      { "Option 82 Suboption", "dhcp.option.agent_information_option.suboption",
9429
15
        FT_UINT8, BASE_DEC, VALS(option82_suboption_vals), 0x0,
9430
15
        "Option 82: Suboption", HFILL }},
9431
9432
15
    { &hf_dhcp_option82_value,
9433
15
      { "Value", "dhcp.option.agent_information_option.value",
9434
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9435
15
        "Option 82: Suboption value", HFILL }},
9436
9437
15
    { &hf_dhcp_option82_value_8,
9438
15
      { "Value", "dhcp.option.agent_information_option.value.uint",
9439
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9440
15
        "Option 82: Suboption 8-bit value", HFILL }},
9441
9442
15
    { &hf_dhcp_option82_value_16,
9443
15
      { "Value", "dhcp.option.agent_information_option.value.uint",
9444
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
9445
15
        "Option 162: Suboption 16-bit value", HFILL }},
9446
9447
15
    { &hf_dhcp_option82_value_32,
9448
15
      { "Value", "dhcp.option.agent_information_option.value.uint",
9449
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
9450
15
        "Option 82: Suboption 32-bit value", HFILL }},
9451
9452
15
    { &hf_dhcp_option82_value_ip_address,
9453
15
      { "Value", "dhcp.option.agent_information_option.value.address",
9454
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9455
15
        "Option 82: Suboption IP address", HFILL }},
9456
9457
15
    { &hf_dhcp_option82_value_stringz,
9458
15
      { "Value", "dhcp.option.agent_information_option.value.string",
9459
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9460
15
        "Option 82: Suboption Z-String value", HFILL }},
9461
9462
15
    { &hf_dhcp_option82_padding,
9463
15
      { "Padding", "dhcp.option.agent_information_option.padding",
9464
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9465
15
        "Option 82:0 Padding", HFILL }},
9466
9467
15
    { &hf_dhcp_option82_agent_circuit_id,
9468
15
      { "Agent Circuit ID", "dhcp.option.agent_information_option.agent_circuit_id",
9469
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9470
15
        "Option 82:1 Agent Circuit ID", HFILL }},
9471
9472
15
    { &hf_dhcp_option82_agent_remote_id,
9473
15
      { "Agent Remote ID", "dhcp.option.agent_information_option.agent_remote_id",
9474
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9475
15
        "Option 82:2 Agent Remote ID", HFILL }},
9476
9477
15
    { &hf_dhcp_option82_reserved,
9478
15
      { "Reserved", "dhcp.option.agent_information_option.reserved",
9479
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9480
15
        "Option 82:3 Reserved", HFILL }},
9481
9482
15
    { &hf_dhcp_option82_docsis_device_class,
9483
15
      { "DOCSIS Device Class", "dhcp.option.agent_information_option.docsis_device_class",
9484
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
9485
15
        "Option 82:4 DOCSIS Device Class", HFILL }},
9486
9487
15
    { &hf_dhcp_option82_link_selection,
9488
15
      { "Link selection", "dhcp.option.agent_information_option.link_selection",
9489
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9490
15
        "Option 82:5 Link selection", HFILL }},
9491
9492
15
    { &hf_dhcp_option82_subscriber_id,
9493
15
      { "Subscriber ID", "dhcp.option.agent_information_option.subscriber_id",
9494
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9495
15
        "Option 82:6 Subscriber ID", HFILL }},
9496
9497
15
    { &hf_dhcp_option82_radius_attributes,
9498
15
      { "RADIUS Attributes", "dhcp.option.agent_information_option.radius_attributes",
9499
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9500
15
        "Option 82:7 RADIUS Attributes", HFILL }},
9501
9502
15
    { &hf_dhcp_option82_authentication,
9503
15
      { "Authentication", "dhcp.option.agent_information_option.authentication",
9504
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9505
15
        "Option 82:8 Authentication", HFILL }},
9506
9507
15
    { &hf_dhcp_option82_vi,
9508
15
      { "Vendor-Specific Information", "dhcp.option.agent_information_option.vi",
9509
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9510
15
        "Option 82:9 Vendor-Specific Information", HFILL }},
9511
9512
15
    { &hf_dhcp_option82_vi_enterprise,
9513
15
      { "Enterprise", "dhcp.option.agent_information_option.vi.enterprise",
9514
15
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
9515
15
        "Option 82:9 VI Enterprise", HFILL }},
9516
9517
15
    { &hf_dhcp_option82_vi_data_length,
9518
15
      { "Data Length", "dhcp.option.agent_information_option.vi.data_length",
9519
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9520
15
        "Option 82:9 VI Data Length", HFILL }},
9521
9522
15
    { &hf_dhcp_option82_vi_cl_option,
9523
15
      { "Option", "dhcp.option.agent_information_option.vi.cl.option",
9524
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9525
15
        "Option 82:9 VI CL Option", HFILL }},
9526
9527
15
    { &hf_dhcp_option82_vi_cl_option_length,
9528
15
      { "Option Length", "dhcp.option.agent_information_option.vi.cl.option_length",
9529
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9530
15
        "Option 82:9 VI CL Option Length", HFILL }},
9531
9532
15
    { &hf_dhcp_option82_vi_cl_tag,
9533
15
      { "Tag", "dhcp.option.agent_information_option.vi.cl.tag",
9534
15
        FT_UINT8, BASE_DEC, VALS(option82_cl_tag_vals), 0x0,
9535
15
        "Option 82:9 VI CL Tag", HFILL }},
9536
9537
15
    { &hf_dhcp_option82_vi_cl_tag_length,
9538
15
      { "Tag Length", "dhcp.option.agent_information_option.vi.cl.tag_length",
9539
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9540
15
        "Option 82:9 VI CL Tag Length", HFILL }},
9541
9542
15
    { &hf_dhcp_option82_vi_cl_docsis_version,
9543
15
      { "DOCSIS Version Number", "dhcp.option.agent_information_option.vi.cl.docsis_version",
9544
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
9545
15
        "Option 82:9 VI CL DOCSIS Version Number", HFILL }},
9546
9547
15
    { &hf_dhcp_option82_vi_cl_dpoe_system_version,
9548
15
      { "DPoE System Version Number", "dhcp.option.agent_information_option.vi.cl.dpoe_system_version",
9549
15
        FT_UINT16, BASE_HEX, NULL, 0x0,
9550
15
        "Option 82:9 VI CL DPoE System Version Number", HFILL }},
9551
9552
15
    { &hf_dhcp_option82_vi_cl_dpoe_system_pbb_service,
9553
15
      { "DPoE System PBB Service", "dhcp.option.agent_information_option.vi.cl.dpoe_system_pbb_service",
9554
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9555
15
        "Option 82:9 VI CL DPoE System PBB Service", HFILL }},
9556
9557
15
    { &hf_dhcp_option82_vi_cl_service_class_name,
9558
15
      { "Service Class Name", "dhcp.option.agent_information_option.vi.cl.service_class_name",
9559
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9560
15
        "Option 82:9 VI CL Service Class Name", HFILL }},
9561
9562
15
    { &hf_dhcp_option82_vi_cl_mso_defined_text,
9563
15
      { "MSO Defined Text", "dhcp.option.agent_information_option.vi.cl.mso_defined_text",
9564
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9565
15
        "Option 82:9 VI CL MSO Defined Text", HFILL }},
9566
9567
15
    { &hf_dhcp_option82_vi_cl_secure_file_transfer_uri,
9568
15
      { "Secure File Transfer URI", "dhcp.option.agent_information_option.vi.cl.secure_file_transfer_uri",
9569
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9570
15
        "Option 82:9 VI CL Secure File Transfer URI", HFILL }},
9571
9572
15
    { &hf_dhcp_option82_flags,
9573
15
      { "Flags", "dhcp.option.agent_information_option.flags",
9574
15
        FT_UINT8, BASE_HEX, NULL, 0x0,
9575
15
        "Option 82:10 Flags", HFILL }},
9576
9577
15
    { &hf_dhcp_option82_flags_unicast,
9578
15
      { "Unicast flag", "dhcp.option.agent_information_option.flags.unicast",
9579
15
        FT_BOOLEAN, 8, TFS(&flag_set_unicast), 0x80,
9580
15
        "Option 82:10 Unicast flag", HFILL }},
9581
9582
15
    { &hf_dhcp_option82_flags_reserved,
9583
15
      { "Reserved flags", "dhcp.option.agent_information_option.flags.reserved",
9584
15
        FT_UINT8, BASE_HEX, NULL, 0x7F,
9585
15
        "Option 82:10 Reserved flags", HFILL }},
9586
9587
15
    { &hf_dhcp_option82_server_id_override,
9588
15
      { "Server ID Override", "dhcp.option.agent_information_option.server_id_override",
9589
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9590
15
        "Option 82:11 Server ID Override", HFILL }},
9591
9592
15
    { &hf_dhcp_option82_relay_agent_id,
9593
15
      { "Relay Agent Identifier", "dhcp.option.agent_information_option.relay_agent_id",
9594
15
        FT_BYTES, BASE_NONE, NULL, 0x00,
9595
15
        "Option 82:12 Relay Agent Identifier", HFILL }},
9596
9597
15
    { &hf_dhcp_option82_option_ani_att,
9598
15
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att",
9599
15
        FT_UINT8, BASE_DEC, NULL, 0x00,
9600
15
        "Option 82:13 Access Technology Type", HFILL }},
9601
9602
15
    { &hf_dhcp_option82_option_ani_att_res,
9603
15
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.res",
9604
15
        FT_UINT8, BASE_DEC, NULL, 0x00,
9605
15
        "Option 82:13 Access Technology Type Reserved", HFILL }},
9606
9607
15
    { &hf_dhcp_option82_option_ani_att_att,
9608
15
      { "Access Technology Type", "dhcp.option.agent_information_option.ani_att.att",
9609
15
        FT_UINT8, BASE_DEC, NULL, 0x00,
9610
15
        "Option 82:13 Access Technology Type Value", HFILL }},
9611
9612
15
    { &hf_dhcp_option82_option_ani_network_name,
9613
15
      { "Access Network Name", "dhcp.option.agent_information_option.ani_network_name",
9614
15
        FT_STRING, BASE_NONE, NULL, 0x00,
9615
15
        "Option 82:14 Access Network Name", HFILL }},
9616
9617
15
    { &hf_dhcp_option82_option_ani_ap_name,
9618
15
      { "Access Point Name", "dhcp.option.agent_information_option.ani_ap_name",
9619
15
        FT_STRING, BASE_NONE, NULL, 0x00,
9620
15
        "Option 82:15 Access Point Name", HFILL }},
9621
9622
15
    { &hf_dhcp_option82_option_ani_ap_bssid,
9623
15
      { "Access Point BSSID", "dhcp.option.agent_information_option.ani_ap_bssid",
9624
15
        FT_ETHER, BASE_NONE, NULL, 0x0,
9625
15
        "Option 82:16 Access Point BSSID", HFILL }},
9626
9627
15
    { &hf_dhcp_option82_option_ani_operator_id,
9628
15
      { "Access Network Operator ID", "dhcp.option.agent_information_option.ani_operator_id",
9629
15
        FT_BYTES, BASE_NONE, NULL, 0x00,
9630
15
        "Option 82:17 Access Network Operator ID", HFILL }},
9631
9632
15
    { &hf_dhcp_option82_option_ani_operator_realm,
9633
15
      { "Access Network Operator Realm", "dhcp.option.agent_information_option.ani_operator_realm",
9634
15
        FT_STRING, BASE_NONE, NULL, 0x00,
9635
15
        "Option 82:18 Access Network Operator Realm", HFILL }},
9636
9637
15
    { &hf_dhcp_option82_option_source_port,
9638
15
      { "Source Port", "dhcp.option.agent_information_option.source_port",
9639
15
        FT_NONE, BASE_NONE, NULL, 0x00,
9640
15
        "Option 82:19 Source Port", HFILL }},
9641
9642
15
    { &hf_dhcp_option82_link_selection_cisco,
9643
15
      { "Link selection (Cisco proprietary)", "dhcp.option.agent_information_option.link_selection_cisco",
9644
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9645
15
        "Option 82:150 Link selection (Cisco proprietary)", HFILL }},
9646
9647
15
    { &hf_dhcp_option82_vrf_name_vpn_id,
9648
15
      { "VRF name/VPN ID", "dhcp.option.agent_information_option.vrf_name.vpn_id",
9649
15
        FT_BYTES, BASE_NONE, NULL, 0x00,
9650
15
        "Option 82:151 VRF name/VPN ID", HFILL }},
9651
9652
15
    { &hf_dhcp_option82_vrf_name_global,
9653
15
      { "Global, default VPN", "dhcp.option.agent_information_option.vrf_name.global",
9654
15
        FT_UINT8, BASE_DEC, NULL, 0x00,
9655
15
        "Option 82:151 Global, default VPN", HFILL }},
9656
9657
15
    { &hf_dhcp_option82_vrf_name,
9658
15
      { "VRF name", "dhcp.option.agent_information_option.vrf_name",
9659
15
        FT_STRING, BASE_NONE, NULL, 0x00,
9660
15
        "Option 82:151 VRF name", HFILL }},
9661
9662
15
    { &hf_dhcp_option82_vrf_name_vpn_id_oui,
9663
15
      { "VRF name/VPN ID OUI", "dhcp.option.agent_information_option.vrf_name.vpn_id.oui",
9664
15
        FT_UINT24, BASE_HEX, NULL, 0x00,
9665
15
        "Option 82:151 VRF name/VPN ID OUI", HFILL }},
9666
9667
15
    { &hf_dhcp_option82_vrf_name_vpn_id_index,
9668
15
      { "VRF name/VPN ID Index", "dhcp.option.agent_information_option.vrf_name.vpn_id.index",
9669
15
        FT_UINT32, BASE_HEX, NULL, 0x00,
9670
15
        "Option 82:151 VRF name/VPN ID Index", HFILL }},
9671
9672
15
    { &hf_dhcp_option82_server_id_override_cisco,
9673
15
      { "Server ID Override (Cisco proprietary)", "dhcp.option.agent_information_option.server_id_override_cisco",
9674
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9675
15
        "Option 82:152 Server ID Override (Cisco proprietary)", HFILL }},
9676
9677
9678
15
    { &hf_dhcp_option_isns_functions,
9679
15
      { "iSNS Functions", "dhcp.option.isns.functions",
9680
15
        FT_UINT16, BASE_HEX, NULL, 0x00,
9681
15
        "iSNS: the functions supported by the iSNS servers", HFILL }},
9682
9683
15
    { &hf_dhcp_option_isns_functions_enabled,
9684
15
      { "Function Fields Enabled", "dhcp.option.isns.functions.enabled",
9685
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_FUNCTIONS_ENABLED,
9686
15
        "If set to zero, then the contents of all other iSNS Function fields MUST be ignored", HFILL }},
9687
9688
15
    { &hf_dhcp_option_isns_functions_dd_authorization,
9689
15
      { "Discovery Domain based Authorization", "dhcp.option.isns.functions.dd_base_authorization",
9690
15
        FT_BOOLEAN, 16, TFS(&tfs_isns_function_dd_based_auth), F_ISNS_FUNCTIONS_DD_AUTH,
9691
15
        "If set to zero, then access authorization must be explicitly performed by each device", HFILL }},
9692
9693
15
    { &hf_dhcp_option_isns_functions_sec_policy_distibution,
9694
15
      { "Security Policy Distribution", "dhcp.option.isns.functions.sec_policy_distribution",
9695
15
        FT_BOOLEAN, 16, TFS(&tfs_isns_functions_sec_distrib), F_ISNS_FUNCTIONS_SEC_POLICY,
9696
15
        NULL, HFILL }},
9697
9698
15
    { &hf_dhcp_option_isns_functions_reserved,
9699
15
      { "Reserved flags", "dhcp.option.isns.functions.reserved",
9700
15
        FT_UINT16, BASE_HEX, NULL, F_ISNS_FUNCTIONS_RESERVED,
9701
15
        NULL, HFILL }},
9702
9703
15
    { &hf_dhcp_option_isns_discovery_domain_access,
9704
15
      { "Discovery Domain Access flags", "dhcp.option.isns.discovery_domain_access",
9705
15
        FT_UINT16, BASE_HEX, NULL, 0x00,
9706
15
        "iSNS: the types of iSNS clients that are allowed to modify Discovery Domains", HFILL }},
9707
9708
15
    { &hf_dhcp_option_isns_discovery_domain_access_enabled,
9709
15
      { "Discovery Domain Enabled", "dhcp.option.isns.discovery_domain_access.enabled",
9710
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ENABLED,
9711
15
        "If set to zero, then the contents of the remainder of this field MUST be ignored", HFILL }},
9712
9713
15
    { &hf_dhcp_option_isns_discovery_domain_access_control_node,
9714
15
      { "Control Node", "dhcp.option.isns.discovery_domain_access_control.node",
9715
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_CTRL_NODE,
9716
15
        NULL, HFILL }},
9717
9718
15
    { &hf_dhcp_option_isns_discovery_domain_access_iscsi_target,
9719
15
      { "iSCSI Target", "dhcp.option.isns.discovery_domain_access.iscsi_target",
9720
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_TARGET,
9721
15
        NULL, HFILL }},
9722
9723
15
    { &hf_dhcp_option_isns_discovery_domain_access_iscsi_inititator,
9724
15
      { "iSCSI Initiator", "dhcp.option.isns.discovery_domain_access.iscsi_initiator",
9725
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_ISCSI_INITIATOR,
9726
15
        NULL, HFILL }},
9727
9728
15
    { &hf_dhcp_option_isns_discovery_domain_access_ifcp_target_port,
9729
15
      { "iFCP Target Port", "dhcp.option.isns.discovery_domain_access.ifcp_target_port",
9730
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_TARGET_PORT,
9731
15
        NULL, HFILL }},
9732
9733
15
    { &hf_dhcp_option_isns_discovery_domain_access_ifcp_initiator_port,
9734
15
      { "iFCP Initiator Port", "dhcp.option.isns.discovery_domain_access.initiator_target_port",
9735
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_DD_ACCESS_IFCP_INITIATOR_PORT,
9736
15
        NULL, HFILL }},
9737
9738
15
    { &hf_dhcp_option_isns_discovery_domain_access_reserved,
9739
15
      { "Reserved Flags", "dhcp.option.isns.discovery_domain_access.reserved",
9740
15
        FT_UINT16, BASE_HEX, NULL, F_ISNS_DD_ACCESS_RESERVED,
9741
15
        NULL, HFILL }},
9742
9743
15
    { &hf_dhcp_option_isns_administrative_flags,
9744
15
      { "Administrative Flags", "dhcp.option.isns.administrative_flags",
9745
15
        FT_UINT16, BASE_HEX, NULL, 0x00,
9746
15
        "iSNS: administrative settings for the iSNS servers discovered through the DHCP query", HFILL }},
9747
9748
15
    { &hf_dhcp_option_isns_administrative_flags_enabled,
9749
15
      { "Administrative Flags Enabled", "dhcp.option.isns.administrative_flags.enabled",
9750
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_ENABLED,
9751
15
        NULL, HFILL }},
9752
9753
15
    { &hf_dhcp_option_isns_administrative_flags_heartbeat,
9754
15
      { "Heartbeat", "dhcp.option.isns.administrative_flags.heartbeat",
9755
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_HEARTBEAT,
9756
15
        NULL, HFILL }},
9757
9758
15
    { &hf_dhcp_option_isns_administrative_flags_management_scns,
9759
15
      { "Management SCNs", "dhcp.option.isns.administrative_flags.management_scns",
9760
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_MANAGEMENT_SCNS,
9761
15
        NULL, HFILL }},
9762
9763
15
    { &hf_dhcp_option_isns_administrative_flags_default_dd,
9764
15
      { "Default Discovery Domain", "dhcp.option.isns.administrative_flags.default_discovery_domain",
9765
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_ADMIN_FLAGS_DEFAULT_DD,
9766
15
        NULL, HFILL }},
9767
9768
15
    { &hf_dhcp_option_isns_administrative_flags_reserved,
9769
15
      { "Reserved Flags", "dhcp.option.isns.administrative_flags.reserved",
9770
15
        FT_UINT16, BASE_HEX, NULL, F_ISNS_ADMIN_FLAGS_RESERVED,
9771
15
        NULL, HFILL }},
9772
9773
15
    { &hf_dhcp_option_isns_server_security_bitmap,
9774
15
      { "iSNS Server Security Bitmap", "dhcp.option.isns.server_security_bitmap",
9775
15
        FT_UINT32, BASE_HEX, NULL, 0x00,
9776
15
        "iSNS: server security settings", HFILL }},
9777
9778
15
    { &hf_dhcp_option_isns_server_security_bitmap_enabled,
9779
15
      { "Server Security Bitmap Enabled", "dhcp.option.isns.server_security_bitmap.enabled",
9780
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), F_ISNS_SRV_SEC_BITMAP_ENABLED,
9781
15
        NULL, HFILL }},
9782
9783
15
    { &hf_dhcp_option_isns_server_security_bitmap_ike_ipsec_enabled,
9784
15
      { "IKE/IPSec", "dhcp.option.isns.server_security_bitmap.ike_ipsec_enabled",
9785
15
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_IKE_IPSEC,
9786
15
        NULL, HFILL }},
9787
9788
15
    { &hf_dhcp_option_isns_server_security_bitmap_main_mode,
9789
15
      { "Main Mode", "dhcp.option.isns.server_security_bitmap.main_mode",
9790
15
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_MAIN_MODE,
9791
15
        NULL, HFILL }},
9792
9793
15
    { &hf_dhcp_option_isns_server_security_bitmap_aggressive_mode,
9794
15
      { "Aggressive Mode", "dhcp.option.isns.server_security_bitmap.aggressive_mode",
9795
15
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_AGGRESSIVE,
9796
15
        NULL, HFILL }},
9797
9798
15
    { &hf_dhcp_option_isns_server_security_bitmap_pfs,
9799
15
      { "PFS", "dhcp.option.isns.server_security_bitmap.pfs",
9800
15
        FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), F_ISNS_SRV_SEC_BITMAP_PFS,
9801
15
        NULL, HFILL }},
9802
9803
15
    { &hf_dhcp_option_isns_server_security_bitmap_transport_mode,
9804
15
      { "Transport Mode", "dhcp.option.isns.server_security_bitmap.transport_mode",
9805
15
        FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TRASPORT_MODE,
9806
15
        NULL, HFILL }},
9807
9808
15
    { &hf_dhcp_option_isns_server_security_bitmap_tunnel_mode,
9809
15
      { "Tunnel Mode", "dhcp.option.isns.server_security_bitmap.tunnel_mode",
9810
15
        FT_BOOLEAN, 16, TFS(&tfs_preferred_no_preference), F_ISNS_SRV_SEC_BITMAP_TUNNEL_MODE,
9811
15
        NULL, HFILL }},
9812
9813
15
    { &hf_dhcp_option_isns_server_security_bitmap_reserved,
9814
15
      { "Reserved Flags", "dhcp.option.isns.server_security_bitmap.reserved",
9815
15
        FT_UINT16, BASE_HEX, NULL, F_ISNS_SRV_SEC_BITMAP_RESERVED,
9816
15
        NULL, HFILL }},
9817
9818
15
    { &hf_dhcp_option_isns_primary_server_addr,
9819
15
      { "Primary Server Address", "dhcp.option.isns.primary_server_addr",
9820
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9821
15
        "iSNS: IP address of the primary server", HFILL }},
9822
9823
15
    { &hf_dhcp_option_isns_heartbeat_originator_addr,
9824
15
      { "Heartbeat Originator Address", "dhcp.option.isns.heartbeat_originator_addr",
9825
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9826
15
        "iSNS: IP address from which the iSNS heartbeat originates", HFILL }},
9827
9828
15
    { &hf_dhcp_option_isns_secondary_server_addr_list,
9829
15
      { "Secondary Server Address", "dhcp.option.isns.secondary_server_addr",
9830
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9831
15
        "iSNS: a list of IP addresses of the secondary iSNS servers", HFILL }},
9832
9833
9834
15
    { &hf_dhcp_option_novell_dss_string,
9835
15
      { "Novell Directory Services Servers String", "dhcp.option.novell_dss.string",
9836
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9837
15
        "Option 85: Novell Directory Services Servers String", HFILL }},
9838
9839
15
    { &hf_dhcp_option_novell_dss_ip,
9840
15
      { "IP Address", "dhcp.option.novell_dss.ip",
9841
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9842
15
        "Option 85: Novell Directory Services Servers IP Address", HFILL }},
9843
9844
15
    { &hf_dhcp_option_novell_ds_tree_name,
9845
15
      { "Novell Directory Services Tree Name", "dhcp.option.novell_ds_tree_name",
9846
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9847
15
        "Option 86: Novell Directory Services Tree Name", HFILL }},
9848
9849
15
    { &hf_dhcp_option_novell_ds_context,
9850
15
      { "Novell Directory Services Context", "dhcp.option.novell_ds_context",
9851
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9852
15
        "Option 87: Novell Directory Services Context", HFILL }},
9853
9854
15
    { &hf_dhcp_option_dhcp_authentication_protocol,
9855
15
      { "Protocol", "dhcp.option.dhcp_authentication.protocol",
9856
15
        FT_UINT8, BASE_DEC, VALS(authen_protocol_vals), 0x0,
9857
15
        "Option 90: Authentication Protocol", HFILL }},
9858
9859
15
    { &hf_dhcp_option_dhcp_authentication_alg_delay,
9860
15
      { "Delay Algorithm", "dhcp.option.dhcp_authentication.alg_delay",
9861
15
        FT_UINT8, BASE_DEC, VALS(authen_da_algo_vals), 0x0,
9862
15
        "Option 90: Delayed Authentication Algorithm", HFILL }},
9863
9864
15
    { &hf_dhcp_option_dhcp_authentication_algorithm,
9865
15
      { "Algorithm", "dhcp.option.dhcp_authentication.algorithm",
9866
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9867
15
        "Option 90: Authentication Algorithm", HFILL }},
9868
9869
15
    { &hf_dhcp_option_dhcp_authentication_rdm,
9870
15
      { "Replay Detection Method", "dhcp.option.dhcp_authentication.rdm",
9871
15
        FT_UINT8, BASE_DEC, VALS(authen_rdm_vals), 0x0,
9872
15
        "Option 90: Replay Detection Method", HFILL }},
9873
9874
15
    { &hf_dhcp_option_dhcp_authentication_rdm_replay_detection,
9875
15
      { "RDM Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_replay_detection",
9876
15
        FT_UINT64, BASE_HEX, NULL, 0x0,
9877
15
        "Option 90: RDM Replay Detection Value", HFILL }},
9878
9879
15
    { &hf_dhcp_option_dhcp_authentication_rdm_rdv,
9880
15
      { "Replay Detection Value", "dhcp.option.dhcp_authentication.rdm_rdv",
9881
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9882
15
        "Option 90: Replay Detection Value", HFILL }},
9883
9884
15
    { &hf_dhcp_option_dhcp_authentication_secret_id,
9885
15
      { "Secret ID", "dhcp.option.dhcp_authentication.secret_id",
9886
15
        FT_UINT32, BASE_HEX, NULL, 0x0,
9887
15
        "Option 90: Secret ID", HFILL }},
9888
9889
15
    { &hf_dhcp_option_dhcp_authentication_hmac_md5_hash,
9890
15
      { "HMAC MD5 Hash", "dhcp.option.dhcp_authentication.hmac_md5_hash",
9891
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
9892
15
        "Option 90: HMAC MD5 Hash", HFILL }},
9893
9894
15
    { &hf_dhcp_option_dhcp_authentication_information,
9895
15
      { "Authentication Information", "dhcp.option.dhcp_authentication.information",
9896
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9897
15
        "Option 90: Authentication Information", HFILL }},
9898
9899
15
    { &hf_dhcp_option_client_last_transaction_time,
9900
15
      { "Client last transaction time", "dhcp.option.client_last_transaction_time",
9901
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9902
15
        "Option 91: Client last transaction time", HFILL }},
9903
9904
15
    { &hf_dhcp_option_associated_ip_option,
9905
15
      { "Associated IP option", "dhcp.option.associated_ip_option",
9906
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9907
15
        "Option 92: Associated IP option", HFILL }},
9908
9909
15
    { &hf_dhcp_option_client_system_architecture,
9910
15
      { "Client System Architecture", "dhcp.option.client_system_architecture",
9911
15
        FT_UINT16, BASE_DEC, VALS(dhcp_client_arch), 0x0,
9912
15
        "Option 93: Client System Architecture", HFILL }},
9913
9914
15
    { &hf_dhcp_option_client_network_id_major_ver,
9915
15
      { "Major Version", "dhcp.client_network_id_major",
9916
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9917
15
        "Option 94: Major Version", HFILL }},
9918
9919
15
    { &hf_dhcp_option_client_network_id_minor_ver,
9920
15
      { "Minor Version", "dhcp.client_network_id_minor",
9921
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9922
15
        "Option 94: Minor Version", HFILL }},
9923
9924
15
    { &hf_dhcp_option_civic_location_what,
9925
15
      { "What", "dhcp.option.civic_location.what",
9926
15
        FT_UINT8, BASE_DEC, VALS(civic_address_what_values), 0x0,
9927
15
        "Option 99: What", HFILL }},
9928
9929
15
    { &hf_dhcp_option_civic_location_country,
9930
15
      { "Country", "dhcp.option.civic_location.country",
9931
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9932
15
        "Option 99: Country", HFILL }},
9933
9934
15
    { &hf_dhcp_option_civic_location_ca_type,
9935
15
      { "CA Type", "dhcp.option.civic_location.ca_type",
9936
15
        FT_UINT8, BASE_DEC, VALS(civic_address_type_values), 0x0,
9937
15
        "Option 99: CA Type", HFILL }},
9938
9939
15
    { &hf_dhcp_option_civic_location_ca_length,
9940
15
      { "CA Length", "dhcp.option.civic_location.ca_length",
9941
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
9942
15
        "Option 99: CA Length", HFILL }},
9943
9944
15
    { &hf_dhcp_option_civic_location_ca_value,
9945
15
      { "CA Value", "dhcp.option.civic_location.ca_value",
9946
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9947
15
        "Option 99: CA Value", HFILL }},
9948
9949
15
    { &hf_dhcp_option_tz_pcode,
9950
15
      { "TZ PCode", "dhcp.option.tz_pcode",
9951
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9952
15
        "Option 100: TZ PCode", HFILL  }},
9953
9954
15
    { &hf_dhcp_option_tz_tcode,
9955
15
      { "TZ TCode", "dhcp.option.tz_tcode",
9956
15
        FT_STRING, BASE_NONE, NULL, 0x0,
9957
15
        "Option 101: TZ TCode", HFILL  }},
9958
9959
15
    { &hf_dhcp_option_ipv6_only_preferred_wait_time,
9960
15
      { "IPv6-Only Preferred wait time", "dhcp.option.ipv6only_preferred_wait_time",
9961
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
9962
15
        "Option 108: IPv6-Only Preferred wait time", HFILL }},
9963
9964
15
    { &hf_dhcp_option_netinfo_parent_server_address,
9965
15
      { "NetInfo Parent Server Address", "dhcp.option.netinfo_parent_server_address",
9966
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
9967
15
        "Option 112: NetInfo Parent Server Address", HFILL }},
9968
9969
15
    { &hf_dhcp_option_netinfo_parent_server_tag,
9970
15
      { "NetInfo Parent Server Tag", "dhcp.option.netinfo_parent_server_tag",
9971
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9972
15
        "Option 113: NetInfo Parent Server Tag", HFILL }},
9973
9974
15
    { &hf_dhcp_option_dhcp_auto_configuration,
9975
15
      { "DHCP Auto-Configuration", "dhcp.option.dhcp_auto_configuration",
9976
15
        FT_UINT8, BASE_DEC, VALS(dhcp_autoconfig), 0x0,
9977
15
        "Option 116: DHCP Auto-Configuration", HFILL }},
9978
9979
15
    { &hf_dhcp_option_dhcp_name_service_search_option,
9980
15
      { "Name Service", "dhcp.option.dhcp_name_service_search_option",
9981
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9982
15
        "Option 117: Name Service", HFILL }},
9983
9984
15
    { &hf_dhcp_option_dhcp_dns_domain_search_list_fqdn,
9985
15
      { "FQDN", "dhcp.option.dhcp_dns_domain_search_list_fqdn",
9986
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9987
15
        "Option 119: FQDN", HFILL }},
9988
9989
15
    { &hf_dhcp_option_sip_server_enc,
9990
15
      { "SIP Server Encoding", "dhcp.option.sip_server.encoding",
9991
15
        FT_UINT8, BASE_DEC, VALS(sip_server_enc_vals), 0x0,
9992
15
        "Option 120: SIP Server encoding", HFILL }},
9993
9994
15
    { &hf_dhcp_option_sip_server_name,
9995
15
      { "SIP Server Name", "dhcp.option.sip_server.name",
9996
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
9997
15
        "Option 120: SIP Server Name", HFILL }},
9998
9999
15
    { &hf_dhcp_option_sip_server_address,
10000
15
      { "SIP Server Address", "dhcp.option.sip_server.address",
10001
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
10002
15
        "Option 120: SIP Server Address", HFILL }},
10003
10004
15
    { &hf_dhcp_option_classless_static_route,
10005
15
      { "Subnet/MaskWidth-Router", "dhcp.option.classless_static_route",
10006
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10007
15
        "Option 121: Subnet/MaskWidth-Router", HFILL }},
10008
10009
15
    { &hf_dhcp_option_rfc3825_error,
10010
15
      { "Error", "dhcp.option.rfc3825.error",
10011
15
        FT_UINT8, BASE_DEC, VALS(rfc3825_error_types), 0x0,
10012
15
        "Option 123: Error", HFILL }},
10013
10014
15
    { &hf_dhcp_option_rfc3825_latitude,
10015
15
      { "Latitude", "dhcp.option.rfc3825.latitude",
10016
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10017
15
        "Option 123: Latitude", HFILL }},
10018
10019
15
    { &hf_dhcp_option_rfc3825_longitude,
10020
15
      { "Longitude", "dhcp.option.rfc3825.longitude",
10021
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10022
15
        "Option 123: Longitude", HFILL }},
10023
10024
15
    { &hf_dhcp_option_rfc3825_latitude_res,
10025
15
      { "Latitude resolution", "dhcp.option.rfc3825.latitude_res",
10026
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10027
15
        "Option 123: Latitude resolution", HFILL }},
10028
10029
15
    { &hf_dhcp_option_rfc3825_longitude_res,
10030
15
      { "Longitude resolution", "dhcp.option.rfc3825.longitude_res",
10031
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10032
15
        "Option 123: Longitude resolution", HFILL }},
10033
10034
15
    { &hf_dhcp_option_rfc3825_altitude,
10035
15
      { "Altitude", "dhcp.option.rfc3825.altitude",
10036
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10037
15
        "Option 123: Altitude", HFILL }},
10038
10039
15
    { &hf_dhcp_option_rfc3825_altitude_res,
10040
15
      { "Altitude resolution", "dhcp.option.rfc3825.altitude_res",
10041
15
        FT_DOUBLE, BASE_NONE, NULL, 0x0,
10042
15
        "Option 123: Altitude resolution", HFILL }},
10043
10044
15
    { &hf_dhcp_option_rfc3825_altitude_type,
10045
15
      { "Altitude type", "dhcp.option.rfc3825.altitude_type",
10046
15
        FT_UINT8, BASE_DEC, VALS(altitude_type_values), 0x0,
10047
15
        "Option 123: Altitude type", HFILL }},
10048
10049
15
    { &hf_dhcp_option_rfc3825_map_datum,
10050
15
      { "Map Datum", "dhcp.option.rfc3825.map_datum",
10051
15
        FT_UINT8, BASE_DEC, VALS(map_datum_type_values), 0x0,
10052
15
        "Option 123: Map Datum", HFILL }},
10053
10054
15
    { &hf_dhcp_option_cl_dss_id_option,
10055
15
      { "DSS_ID Type", "dhcp.option.cl_dss_id.option",
10056
15
        FT_UINT8, BASE_DEC, VALS(cl_dss_id_type_vals), 0x0,
10057
15
        "Option 123:CL DSS_ID Type", HFILL }},
10058
10059
15
    { &hf_dhcp_option_cl_dss_id_len,
10060
15
      { "DSS_ID Length", "dhcp.option.cl_dss_id.len",
10061
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10062
15
        "Option 123:CL DSS_ID Length", HFILL }},
10063
10064
15
    { &hf_dhcp_option_cl_dss_id,
10065
15
      { "Country", "dhcp.option.cl_dss_id",
10066
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10067
15
        "Option 123:CL DSS_ID", HFILL }},
10068
10069
15
    { &hf_dhcp_option_vi_class_cl_address_mode,
10070
15
      { "CableLab Address Mode", "dhcp.option.vi_class.cl_address_mode",
10071
15
        FT_UINT8, BASE_DEC, VALS(cablelab_ipaddr_mode_vals), 0x0,
10072
15
        "Option 124: CableLab Address Mode", HFILL }},
10073
10074
15
    { &hf_dhcp_option_vi_class_enterprise,
10075
15
      { "Enterprise", "dhcp.option.vi_class.enterprise",
10076
15
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
10077
15
        "Option 124: Enterprise", HFILL }},
10078
10079
15
    { &hf_dhcp_option_vi_class_data_length,
10080
15
      { "Length", "dhcp.option.vi_class.length",
10081
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10082
15
        "Option 124: Length", HFILL }},
10083
10084
15
    { &hf_dhcp_option_vi_class_data_item_length,
10085
15
      { "Length", "dhcp.option.vi_class.vendor_class_data.item.length",
10086
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10087
15
        "Option 124: Length", HFILL }},
10088
10089
15
    { &hf_dhcp_option_vi_class_data_item_data,
10090
15
      { "Data", "dhcp.option.vi_class.vendor_class_data.item.data",
10091
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10092
15
        "Option 124: Data", HFILL }},
10093
10094
15
    { &hf_dhcp_option125_enterprise,
10095
15
      { "Enterprise", "dhcp.option.vi.enterprise",
10096
15
        FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x00,
10097
15
        "Option 125: Enterprise", HFILL }},
10098
10099
15
    { &hf_dhcp_option125_length,
10100
15
      { "Length", "dhcp.option.vi.length",
10101
15
        FT_UINT8, BASE_DEC, NULL, 0x00,
10102
15
        "Option 125: Length", HFILL }},
10103
10104
15
    { &hf_dhcp_option125_value,
10105
15
      { "Value", "dhcp.option.vi.value",
10106
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10107
15
        "Option 125: Suboption value", HFILL }},
10108
10109
15
    { &hf_dhcp_option125_value_8,
10110
15
      { "Value", "dhcp.option.vi.value.uint",
10111
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10112
15
        "Option 125: Suboption 8-bit value", HFILL }},
10113
10114
15
    { &hf_dhcp_option125_value_16,
10115
15
      { "Value", "dhcp.option.vi.value.uint",
10116
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
10117
15
        "Option 125: Suboption 16-bit value", HFILL }},
10118
10119
15
    { &hf_dhcp_option125_value_ip_address,
10120
15
      { "Value", "dhcp.option.vi.value.address",
10121
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10122
15
        "Option 125: Suboption IP address value", HFILL }},
10123
10124
15
    { &hf_dhcp_option125_value_stringz,
10125
15
      { "Value", "dhcp.option.vi.value.string",
10126
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10127
15
        "Option 125: Suboption Z-String value", HFILL }},
10128
10129
15
    { &hf_dhcp_option125_tr111_suboption,
10130
15
      { "Option 125 Suboption", "dhcp.option.vi.tr111.suboption",
10131
15
        FT_UINT8, BASE_DEC, VALS(option125_tr111_suboption_vals), 0x0,
10132
15
        "Option 125:TR 111 Suboption", HFILL }},
10133
10134
15
    { &hf_dhcp_option125_tr111_device_manufacturer_oui,
10135
15
      { "DeviceManufacturerOUI", "dhcp.option.vi.tr111.device_manufacturer_oui",
10136
15
        FT_UINT24, BASE_OUI, NULL, 0x0,
10137
15
        "Option 125:TR 111 1 DeviceManufacturerOUI", HFILL }},
10138
10139
15
    { &hf_dhcp_option125_tr111_device_serial_number,
10140
15
      { "DeviceSerialNumber", "dhcp.option.vi.tr111.device_serial_number",
10141
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10142
15
        "Option 125:TR 111 2 DeviceSerialNumber", HFILL }},
10143
10144
15
    { &hf_dhcp_option125_tr111_device_product_class,
10145
15
      { "DeviceProductClass", "dhcp.option.vi.tr111.device_product_class",
10146
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10147
15
        "Option 125:TR 111 3 DeviceProductClass", HFILL }},
10148
10149
15
    { &hf_dhcp_option125_tr111_gateway_manufacturer_oui,
10150
15
      { "GatewayManufacturerOUI", "dhcp.option.vi.tr111.gateway_manufacturer_oui",
10151
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10152
15
        "Option 125:TR 111 4 GatewayManufacturerOUI", HFILL }},
10153
10154
15
    { &hf_dhcp_option125_tr111_gateway_serial_number,
10155
15
      { "GatewaySerialNumber", "dhcp.option.vi.tr111.gateway_serial_number",
10156
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10157
15
        "Option 125:TR 111 5 GatewaySerialNumber", HFILL }},
10158
10159
15
    { &hf_dhcp_option125_tr111_gateway_product_class,
10160
15
      { "GatewayProductClass", "dhcp.option.vi.tr111.gateway_product_class",
10161
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10162
15
        "Option 125:TR 111 6 GatewayProductClass", HFILL }},
10163
10164
15
    { &hf_dhcp_option125_cl_suboption,
10165
15
      { "Option 125 Suboption", "dhcp.option.vi.cl.suboption",
10166
15
        FT_UINT8, BASE_DEC, VALS(option125_cl_suboption_vals), 0x0,
10167
15
        "Option 125:CL Suboption", HFILL }},
10168
10169
15
    { &hf_dhcp_option125_cl_option_request,
10170
15
      { "Option Request", "dhcp.option.vi.cl.option_request",
10171
15
        FT_BYTES, SEP_SPACE, NULL, 0x0,
10172
15
        "Option 125:CL 1 Option Request", HFILL }},
10173
10174
15
    { &hf_dhcp_option125_cl_tftp_server_addresses,
10175
15
      { "TFTP Server Addresses", "dhcp.option.vi.cl.tftp_server_addresses",
10176
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10177
15
        "Option 125:CL 2 TFTP Server Addresses", HFILL }},
10178
10179
15
    { &hf_dhcp_option125_cl_erouter_container_option,
10180
15
      { "eRouter Container Option", "dhcp.option.vi.cl.erouter_container_option",
10181
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10182
15
        "Option 125:CL 3 eRouter Container Option", HFILL }},
10183
10184
15
    { &hf_dhcp_option125_cl_mib_environment_indicator_option,
10185
15
      { "MIB Environment Indicator Option", "dhcp.option.vi.cl.mib_environment_indicator_option",
10186
15
        FT_UINT8, BASE_DEC, VALS(pkt_mib_env_ind_opt_vals), 0x0,
10187
15
        "Option 125:CL 4 MIB Environment Indicator Option", HFILL }},
10188
10189
15
    { &hf_dhcp_option125_cl_modem_capabilities,
10190
15
      { "Modem Capabilities", "dhcp.option.vi.cl.modem_capabilities",
10191
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10192
15
        "Option 125:CL 5 Modem Capabilities", HFILL }},
10193
10194
15
    { &hf_dhcp_option_subnet_selection_option,
10195
15
      { "Subnet Selection Option", "dhcp.option.subnet_selection_option",
10196
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10197
15
        "Option 118: Subnet Selection Option", HFILL }},
10198
10199
15
    { &hf_dhcp_option_pana_agent,
10200
15
      { "PAA IPv4 Address", "dhcp.option.pana_agent",
10201
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
10202
15
        "Protocol for Carrying Authentication for Network Access (PANA) Authentication Agents IPv4 Address", HFILL }},
10203
10204
15
    { &hf_dhcp_option_lost_server_domain_name,
10205
15
      { "LoST Server Domain Name", "dhcp.option.lost_server_domain_name",
10206
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10207
15
        "Option 137: LoST Server Domain Name", HFILL }},
10208
10209
15
    { &hf_dhcp_option_capwap_access_controller,
10210
15
      { "CAPWAP Access Controllers", "dhcp.option.capwap_access_controller",
10211
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10212
15
        "Option 138: CAPWAP Access Controllers", HFILL }},
10213
10214
15
    { &hf_dhcp_option_andsf_server,
10215
15
      { "ANDSF Server", "dhcp.option.andsf_server",
10216
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10217
15
        "ANDSF (Access Network Discovery and Selection Function) Server", HFILL }},
10218
10219
15
    { &hf_dhcp_option_forcerenew_nonce_algo,
10220
15
      { "Algorithm", "dhcp.option.forcerenew_nonce.algorithm",
10221
15
        FT_UINT8, BASE_DEC, VALS(forcerenew_nonce_algo_vals), 0x00,
10222
15
        "Forcenew Nonce Algorithm", HFILL }},
10223
10224
15
    { &hf_dhcp_option_rdnss_reserved,
10225
15
      { "Reserved", "dhcp.option.rdnss.reserved",
10226
15
        FT_UINT8, BASE_HEX, NULL, 0xfc,
10227
15
        "RDNSS Reserved", HFILL }},
10228
10229
15
    { &hf_dhcp_option_rdnss_pref,
10230
15
      { "Preference", "dhcp.option.rdnss.preference",
10231
15
        FT_UINT8, BASE_DEC, VALS(rdnss_pref_vals), 0x03,
10232
15
        "RDNSS (Recursive DNS Server) Preference", HFILL }},
10233
10234
15
    { &hf_dhcp_option_rdnss_prim_dns_server,
10235
15
      { "Primary DNS", "dhcp.option.rdnss.primary_dns",
10236
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10237
15
        "RDNSS Primary DNS-recursive-name-server's IPv4 address", HFILL }},
10238
10239
15
    { &hf_dhcp_option_rdnss_sec_dns_server,
10240
15
      { "Secondary DNS", "dhcp.option.rdnss.secondary_dns",
10241
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10242
15
        "RDNSS Secondary DNS-recursive-name-server's IPv4 address", HFILL }},
10243
10244
15
    { &hf_dhcp_option_rdnss_domain,
10245
15
      { "Domains and networks", "dhcp.option.rdnss.domain",
10246
15
        FT_STRING, BASE_NONE, NULL, 0x00,
10247
15
        "RDNSS Domains and networks", HFILL }},
10248
10249
15
    { &hf_dhcp_option_dots_ri,
10250
15
      { "DOTS Reference Identifier", "dhcp.option.dots.ri",
10251
15
        FT_STRING, BASE_NONE, NULL, 0x00,
10252
15
        "Peer DOTS Agent name", HFILL }},
10253
10254
15
    { &hf_dhcp_option_dots_address,
10255
15
      { "DOTS Address", "dhcp.option.dots.address",
10256
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10257
15
        "Peer DOTS Agent Address", HFILL }},
10258
10259
15
    { &hf_dhcp_option_tftp_server_address,
10260
15
      { "TFTP Server Address", "dhcp.option.tftp_server_address",
10261
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10262
15
        "Option 150: TFTP Server Address", HFILL }},
10263
10264
15
    { &hf_dhcp_option_bulk_lease_status_code,
10265
15
      { "Status Code", "dhcp.option.bulk_lease.status_code",
10266
15
        FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_status_code_vals), 0x00,
10267
15
        "DHCPv4 Bulk Leasequery Status Code", HFILL }},
10268
10269
15
    { &hf_dhcp_option_bulk_lease_status_message,
10270
15
      { "Status Code Message", "dhcp.option.bulk_lease.status_code_message",
10271
15
        FT_STRING, BASE_NONE, NULL, 0x00,
10272
15
        "DHCPv4 Bulk Leasequery Status Code Message", HFILL }},
10273
10274
15
    { &hf_dhcp_option_bulk_lease_base_time,
10275
15
      { "Base Time", "dhcp.option.bulk_lease.base_time",
10276
15
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10277
15
        "DHCPv4 Bulk Leasequery Base Time", HFILL }},
10278
10279
15
    { &hf_dhcp_option_bulk_lease_start_time_of_state,
10280
15
      { "Start Time Of State", "dhcp.option.bulk_lease.start_time_of_state",
10281
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10282
15
        "DHCPv4 Bulk Leasequery Start Time Of State", HFILL }},
10283
10284
15
    { &hf_dhcp_option_bulk_lease_query_start,
10285
15
      { "Query Start Time", "dhcp.option.bulk_lease.query_start_time",
10286
15
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10287
15
        "DHCPv4 Bulk Leasequery Query Start Time", HFILL }},
10288
10289
15
    { &hf_dhcp_option_bulk_lease_query_end,
10290
15
      { "Query End Time", "dhcp.option.bulk_lease.query_end_time",
10291
15
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00,
10292
15
        "DHCPv4 Bulk Leasequery Query End Time", HFILL }},
10293
10294
15
    { &hf_dhcp_option_bulk_lease_dhcp_state,
10295
15
      { "Dhcp State", "dhcp.option.bulk_lease.dhcp_state",
10296
15
        FT_UINT8, BASE_DEC, VALS(bulk_lease_dhcp_state_vals), 0x00,
10297
15
        "DHCPv4 Bulk Leasequery Dhcp State", HFILL }},
10298
10299
15
    { &hf_dhcp_option_bulk_lease_data_source,
10300
15
      { "Data Source", "dhcp.option.bulk_lease.data_source",
10301
15
        FT_BOOLEAN, BASE_NONE, TFS(&tfs_bulk_lease_data_source), 0x00,
10302
15
        "DHCPv4 Bulk Leasequery Data Source", HFILL }},
10303
10304
15
    { &hf_dhcp_option_pcp_list_length,
10305
15
      { "List-Length", "dhcp.option.pcp.list_length",
10306
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10307
15
        "Port Control Protocol (PCP) List Length", HFILL }},
10308
10309
15
    { &hf_dhcp_option_pcp_server,
10310
15
      { "PCP Server", "dhcp.option.pcp.server",
10311
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
10312
15
        "Port Control Protocol (PCP) Server", HFILL }},
10313
10314
15
    { &hf_dhcp_option_portparams_offset,
10315
15
      { "Offset", "dhcp.option.portparams.offset",
10316
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10317
15
        "Port Set ID (PSID) offset", HFILL }},
10318
10319
15
    { &hf_dhcp_option_portparams_psid_length,
10320
15
      { "PSID-Length", "dhcp.option.portparams.psid_length",
10321
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10322
15
        "Port Set ID (PSID) Length", HFILL }},
10323
10324
15
    { &hf_dhcp_option_portparams_psid,
10325
15
      { "PSID", "dhcp.option.portparams.psid",
10326
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10327
15
        "Port Set ID (PSID)", HFILL }},
10328
10329
15
    { &hf_dhcp_option_mudurl,
10330
15
      { "MUDURL", "dhcp.option.mudurl",
10331
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10332
15
        "Option 161: MUDURL", HFILL  }},
10333
10334
15
    { &hf_dhcp_dnr_instance,
10335
15
      { "Instance", "dhcp.option.dnr",
10336
15
        FT_NONE, BASE_NONE, NULL, 0x0,
10337
15
        "Option 162: DNR instance", HFILL }},
10338
10339
15
    { &hf_dhcp_dnr_instance_len,
10340
15
      { "Instance length", "dhcp.option.dnr.length",
10341
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
10342
15
        "Option 162: DNR instance length", HFILL }},
10343
10344
15
    { &hf_dhcp_dnr_svcpriority,
10345
15
      { "Service priority", "dhcp.option.dnr.svcpriority",
10346
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
10347
15
        "Option 162: DNR service priority", HFILL }},
10348
10349
15
    { &hf_dhcp_dnr_auth_domain_name_len,
10350
15
      { "Authentication domain name length", "dhcp.option.dnr.adn_len",
10351
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10352
15
        "Option 162: DNR authentication domain name length", HFILL }},
10353
10354
15
    { &hf_dhcp_dnr_auth_domain_name,
10355
15
      { "Authentication domain name", "dhcp.option.dnr.adn",
10356
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10357
15
        "Option 162: DNR authentication domain name", HFILL }},
10358
10359
15
    { &hf_dhcp_dnr_addrs_len,
10360
15
      { "Addresses length", "dhcp.option.dnr.addrs_len",
10361
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10362
15
        "Option 162: DNR addresses length", HFILL }},
10363
10364
15
    { &hf_dhcp_dnr_addrs,
10365
15
      { "Addresses", "dhcp.option.dnr.addrs",
10366
15
        FT_NONE, BASE_NONE, NULL, 0x0,
10367
15
        "Option 162: DNR addresses", HFILL }},
10368
10369
15
    { &hf_dhcp_dnr_addrs_ip,
10370
15
      { "Address", "dhcp.option.dnr.addrs.ip",
10371
15
        FT_IPv4, BASE_NONE, NULL, 0x0,
10372
15
        "Option 162: DNR address", HFILL }},
10373
10374
15
    { &hf_dhcp_option_pxe_config_file,
10375
15
      { "PXELINUX configuration file", "dhcp.option.pxe_config_file",
10376
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10377
15
        "Option 209: PXE Configuration File", HFILL }},
10378
10379
15
    { &hf_dhcp_option_pxe_path_prefix,
10380
15
      { "PXELINUX path prefix", "dhcp.option.pxe_path_prefix",
10381
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10382
15
        "Option 210: PXE Path Prefix", HFILL }},
10383
10384
15
    { &hf_dhcp_option_pxe_reboot_time,
10385
15
      { "PXELINUX Reboot Time", "dhcp.option.pxe_reboot_time",
10386
15
        FT_UINT32, BASE_CUSTOM, CF_FUNC(dhcp_time_in_u_secs_fmt), 0x0,
10387
15
        "Option 211: PXE Reboot Time", HFILL }},
10388
10389
15
    { &hf_dhcp_option_captive_portal,
10390
15
      { "Captive Portal", "dhcp.option.captive_portal",
10391
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10392
15
        "The contact URI for the captive portal that the user should connect to", HFILL }},
10393
10394
15
    { &hf_dhcp_option_6RD_ipv4_mask_len,
10395
15
      { "6RD IPv4 Mask Length", "dhcp.option.6RD.ipv4_mask_len",
10396
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10397
15
        "Option 212: 6RD IPv4 Mask Length", HFILL }},
10398
10399
15
    { &hf_dhcp_option_6RD_prefix_len,
10400
15
      { "6RD Prefix Length", "dhcp.option.6RD.prefix_len",
10401
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10402
15
        "Option 212: 6RD Prefix Length", HFILL }},
10403
10404
15
    { &hf_dhcp_option_6RD_prefix,
10405
15
      { "6RD Prefix", "dhcp.option.6RD.prefix",
10406
15
        FT_IPv6, BASE_NONE, NULL, 0x00,
10407
15
        "Option 212: 6RD Prefix", HFILL }},
10408
10409
15
    { &hf_dhcp_option_6RD_border_relay_ip,
10410
15
      { "Border Relay IP", "dhcp.option.6RD.border_relay_ip",
10411
15
        FT_IPv4, BASE_NONE, NULL, 0x00,
10412
15
        "Option 212: Border Relay IP", HFILL }},
10413
10414
15
    { &hf_dhcp_option_private_proxy_autodiscovery,
10415
15
      { "Private/Proxy autodiscovery", "dhcp.option.private_proxy_autodiscovery",
10416
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10417
15
        "Option 252: Private/Proxy autodiscovery", HFILL }},
10418
10419
15
    { &hf_dhcp_option_end,
10420
15
      { "Option End", "dhcp.option.end",
10421
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10422
15
        "Option 255: End", HFILL }},
10423
10424
15
    { &hf_dhcp_option_end_overload,
10425
15
      { "Option End (Overload)", "dhcp.option.end",
10426
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10427
15
        "Option 255: End (Overload)", HFILL }},
10428
10429
15
    { &hf_dhcp_vendor_unknown_suboption,
10430
15
      { "Option 125 Suboption", "dhcp.vendor.suboption",
10431
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10432
15
        NULL, HFILL }},
10433
10434
15
    { &hf_dhcp_suboption_data,
10435
15
      { "Data", "dhcp.vendor.data",
10436
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10437
15
        NULL, HFILL }},
10438
10439
15
    { &hf_dhcp_pc_ietf_ccc_suboption,
10440
15
      { "Suboption", "dhcp.vendor.pc.ietf_ccc.suboption",
10441
15
        FT_UINT8, BASE_DEC, VALS(pkt_draft5_ccc_opt_vals), 0x0,
10442
15
        NULL, HFILL }},
10443
10444
15
    { &hf_dhcp_pc_i05_ccc_suboption,
10445
15
      { "Suboption", "dhcp.vendor.pc.i05_ccc.suboption",
10446
15
        FT_UINT8, BASE_DEC, VALS(pkt_i05_ccc_opt_vals), 0x0,
10447
15
        NULL, HFILL }},
10448
10449
15
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_nom_timeout,
10450
15
      { "pktcMtaDevRealmUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_nom_timeout",
10451
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10452
15
        NULL, HFILL }},
10453
10454
15
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_timeout,
10455
15
      { "pktcMtaDevRealmUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_timeout",
10456
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10457
15
        NULL, HFILL }},
10458
10459
15
    { &hf_dhcp_cl_ietf_ccc_dev_realm_unc_key_max_retries,
10460
15
      { "pktcMtaDevRealmUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_realm_unc_key_max_retries",
10461
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10462
15
        NULL, HFILL }},
10463
10464
15
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_nom_timeout,
10465
15
      { "pktcMtaDevProvUnsolicitedKeyNomTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_nom_timeout",
10466
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10467
15
        NULL, HFILL }},
10468
10469
15
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_timeout,
10470
15
      { "pktcMtaDevProvUnsolicitedKeyMaxTimeout", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_timeout",
10471
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10472
15
        NULL, HFILL }},
10473
10474
15
    { &hf_dhcp_cl_ietf_ccc_dev_prov_unc_key_max_retries,
10475
15
      { "pktcMtaDevProvUnsolicitedKeyMaxRetries", "dhcp.cl.ietf_ccc.dev_prov_unc_key_max_retries",
10476
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10477
15
        NULL, HFILL }},
10478
10479
15
    { &hf_dhcp_ccc_ietf_sec_tkt_pc_provision_server,
10480
15
      { "Invalidate PacketCable Provisioning Server", "dhcp.ccc.ietf.sec_tkt.pc_provision_server",
10481
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
10482
15
        NULL, HFILL }},
10483
10484
15
    { &hf_dhcp_ccc_ietf_sec_tkt_all_pc_call_management,
10485
15
      { "Invalidate All PacketCable Call Management Servers", "dhcp.ccc.ietf.sec_tkt.all_pc_call_management",
10486
15
        FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
10487
15
        NULL, HFILL }},
10488
10489
15
    { &hf_dhcp_option242_avaya,
10490
15
      { "Private/Avaya IP Telephone",  "dhcp.option.vendor.avaya",
10491
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10492
15
        "Option 242: Private/Avaya IP Telephone", HFILL }},
10493
10494
15
    { &hf_dhcp_option242_avaya_tlssrvr,
10495
15
      { "TLSSRVR",  "dhcp.option.vendor.avaya.tlssrvr",
10496
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10497
15
        "Option 242: TLSSRVR (HTTPS server(s) to download configuration)", HFILL }},
10498
10499
15
    { &hf_dhcp_option242_avaya_httpsrvr,
10500
15
      { "HTTPSRVR",  "dhcp.option.vendor.avaya.httpsrvr",
10501
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10502
15
        "Option 242: HTTPSRVR (HTTP server(s) to download configuration)", HFILL }},
10503
10504
15
    { &hf_dhcp_option242_avaya_httpdir,
10505
15
      { "HTTPDIR",  "dhcp.option.vendor.avaya.httpdir",
10506
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10507
15
        "Option 242: HTTPDIR (Path to configuration files)", HFILL }},
10508
10509
15
    { &hf_dhcp_option242_avaya_static,
10510
15
      { "STATIC",  "dhcp.option.vendor.avaya.static",
10511
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10512
15
        "Option 242: STATIC (Static programming override flag)", HFILL }},
10513
10514
15
    { &hf_dhcp_option242_avaya_mcipadd,
10515
15
      { "MCIPADD",  "dhcp.option.vendor.avaya.mcipadd",
10516
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10517
15
        "Option 242: MCIPADD (List of CM server(s))", HFILL }},
10518
10519
15
    { &hf_dhcp_option242_avaya_dot1x,
10520
15
      { "DOT1X",  "dhcp.option.vendor.avaya.dot1x",
10521
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10522
15
        "Option 242: DOT1X (802.1X Supplicant operation mode)", HFILL }},
10523
10524
15
    { &hf_dhcp_option242_avaya_icmpdu,
10525
15
      { "ICMPDU",  "dhcp.option.vendor.avaya.icmpdu",
10526
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10527
15
        "Option 242: ICMPDU (ICMP Destination Unreachable processing)", HFILL }},
10528
10529
15
    { &hf_dhcp_option242_avaya_icmpred,
10530
15
      { "ICMPRED",  "dhcp.option.vendor.avaya.icmpred",
10531
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10532
15
        "Option 242: ICMPRED (ICMP Redirect handling)", HFILL }},
10533
10534
15
    { &hf_dhcp_option242_avaya_l2q,
10535
15
      { "L2Q",  "dhcp.option.vendor.avaya.l2q",
10536
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10537
15
        "Option 242: L2Q (Controls 802.1Q tagging)", HFILL }},
10538
10539
15
    { &hf_dhcp_option242_avaya_l2qvlan,
10540
15
      { "L2QVLAN",  "dhcp.option.vendor.avaya.l2qvlan",
10541
15
        FT_INT32, BASE_DEC, NULL, 0x0,
10542
15
        "Option 242: L2QVLAN (VLAN ID)", HFILL }},
10543
10544
15
    { &hf_dhcp_option242_avaya_loglocal,
10545
15
      { "LOGLOCAL",  "dhcp.option.vendor.avaya.loglocal",
10546
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10547
15
        "Option 242: LOGLOCAL (Log level)", HFILL }},
10548
10549
15
    { &hf_dhcp_option242_avaya_phy1stat,
10550
15
      { "PHY1STAT",  "dhcp.option.vendor.avaya.phy1stat",
10551
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10552
15
        "Option 242: PHY1STAT (Interface configuration)", HFILL }},
10553
10554
15
    { &hf_dhcp_option242_avaya_phy2stat,
10555
15
      { "PHY2STAT",  "dhcp.option.vendor.avaya.phy2stat",
10556
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10557
15
        "Option 242: PHY2STAT (Interface configuration)", HFILL }},
10558
10559
15
    { &hf_dhcp_option242_avaya_procpswd,
10560
15
      { "PROCPSWD",  "dhcp.option.vendor.avaya.procpswd",
10561
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10562
15
        "Option 242: PROCPSWD (Security string used to access local procedures)", HFILL }},
10563
10564
15
    { &hf_dhcp_option242_avaya_procstat,
10565
15
      { "PROCSTAT",  "dhcp.option.vendor.avaya.procstat",
10566
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10567
15
        "Option 242: PROCSTAT (Local (dialpad) Administrative access)", HFILL }},
10568
10569
15
    { &hf_dhcp_option242_avaya_snmpadd,
10570
15
      { "SNMPADD",  "dhcp.option.vendor.avaya.snmpadd",
10571
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10572
15
        "Option 242: SNMPADD (Allowable source IP Address(es) for SNMP queries)", HFILL }},
10573
10574
15
    { &hf_dhcp_option242_avaya_snmpstring,
10575
15
      { "SNMPSTRING",  "dhcp.option.vendor.avaya.snmpstring",
10576
15
        FT_STRINGZ, BASE_NONE, NULL, 0x0,
10577
15
        "Option 242: SNMPSTRING (SNMP community string)", HFILL }},
10578
10579
15
    { &hf_dhcp_option242_avaya_vlantest,
10580
15
      { "VLANTEST",  "dhcp.option.vendor.avaya.vlantest",
10581
15
        FT_INT32, BASE_DEC, NULL, 0x0,
10582
15
        "Option 242: VLANTEST (Timeout in seconds)", HFILL }},
10583
10584
    /* Cisco vendor suboptions */
10585
15
    { &hf_dhcp_option43_cisco_suboption,
10586
15
      { "Option 43 Suboption", "dhcp.option.vendor.cisco.suboption",
10587
15
        FT_UINT8, BASE_DEC, VALS(option43_cisco_suboption_vals), 0x0,
10588
15
        "Option 43:Cisco Suboption", HFILL }},
10589
10590
15
    { &hf_dhcp_option43_cisco_unknown,
10591
15
      { "Unknown", "dhcp.option.vendor.cisco.unknown",
10592
15
        FT_BYTES, BASE_NONE, NULL, 0x0,
10593
15
        NULL, HFILL }},
10594
10595
15
    { &hf_dhcp_option43_cisco_unknown1,
10596
15
      { "Unknown1", "dhcp.option.vendor.cisco.unknown1",
10597
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10598
15
        NULL, HFILL }},
10599
10600
15
    { &hf_dhcp_option43_cisco_unknown2,
10601
15
      { "Unknown2", "dhcp.option.vendor.cisco.unknown2",
10602
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10603
15
        NULL, HFILL }},
10604
10605
15
    { &hf_dhcp_option43_cisco_unknown3,
10606
15
      { "Unknown3", "dhcp.option.vendor.cisco.unknown3",
10607
15
        FT_UINT16, BASE_DEC, NULL, 0x0,
10608
15
        NULL, HFILL }},
10609
10610
15
    { &hf_dhcp_option43_cisco_nodeid,
10611
15
      { "Node ID", "dhcp.option.vendor.cisco.nodeid",
10612
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10613
15
        NULL, HFILL }},
10614
10615
15
    { &hf_dhcp_option43_cisco_unknown5,
10616
15
      { "Unknown5", "dhcp.option.vendor.cisco.unknown5",
10617
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10618
15
        NULL, HFILL }},
10619
10620
15
    { &hf_dhcp_option43_cisco_unknown6,
10621
15
      { "Unknown6", "dhcp.option.vendor.cisco.unknown6",
10622
15
        FT_UINT8, BASE_DEC, NULL, 0x0,
10623
15
        NULL, HFILL }},
10624
10625
15
    { &hf_dhcp_option43_cisco_model,
10626
15
      { "Model", "dhcp.option.vendor.cisco.model",
10627
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10628
15
        NULL, HFILL }},
10629
10630
15
    { &hf_dhcp_option43_cisco_apicuuid,
10631
15
      { "APIC UUID", "dhcp.option.vendor.cisco.apicuuid",
10632
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10633
15
        NULL, HFILL }},
10634
10635
15
    { &hf_dhcp_option43_cisco_fabricname,
10636
15
      { "Fabricname", "dhcp.option.vendor.cisco.fabricname",
10637
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10638
15
        NULL, HFILL }},
10639
10640
15
    { &hf_dhcp_option43_cisco_unknown10,
10641
15
      { "Unknown10", "dhcp.option.vendor.cisco.unknown10",
10642
15
        FT_UINT32, BASE_DEC, NULL, 0x0,
10643
15
        NULL, HFILL }},
10644
10645
15
    { &hf_dhcp_option43_cisco_serialno,
10646
15
      { "SerialNo", "dhcp.option.vendor.cisco.serialno",
10647
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10648
15
        NULL, HFILL }},
10649
10650
15
    { &hf_dhcp_option43_cisco_clientint,
10651
15
      { "Client Int", "dhcp.option.vendor.cisco.clientint",
10652
15
        FT_STRING, BASE_NONE, NULL, 0x0,
10653
15
        NULL, HFILL }},
10654
15
  };
10655
10656
15
  static uat_field_t dhcp_uat_flds[] = {
10657
15
    UAT_FLD_DEC(uat_dhcp_records, opt, "Option number", "Custom Option Number"),
10658
15
    UAT_FLD_CSTRING(uat_dhcp_records, text, "Option Name", "Custom Option Name"),
10659
15
    UAT_FLD_VS(uat_dhcp_records, ftype, "Option type", dhcp_custom_type_vals, "Option datatype"),
10660
15
    UAT_END_FIELDS
10661
15
  };
10662
10663
15
  static int *ett[] = {
10664
15
    &ett_dhcp,
10665
15
    &ett_dhcp_flags,
10666
15
    &ett_dhcp_option,
10667
15
    &ett_dhcp_option43_suboption,
10668
15
    &ett_dhcp_option43_suboption_discovery,
10669
15
    &ett_dhcp_option43_suboption_tree,
10670
15
    &ett_dhcp_option63_suboption,
10671
15
    &ett_dhcp_option77_instance,
10672
15
    &ett_dhcp_option82_suboption,
10673
15
    &ett_dhcp_option82_suboption9,
10674
15
    &ett_dhcp_option82_suboption10,
10675
15
    &ett_dhcp_option124_vendor_class_data_item,
10676
15
    &ett_dhcp_option125_suboption,
10677
15
    &ett_dhcp_option125_tr111_suboption,
10678
15
    &ett_dhcp_option125_cl_suboption,
10679
15
    &ett_dhcp_option242_suboption,
10680
15
    &ett_dhcp_fqdn,
10681
15
    &ett_dhcp_filename_option,
10682
15
    &ett_dhcp_server_hostname,
10683
15
    &ett_dhcp_fqdn_flags,
10684
15
    &ett_dhcp_isns_functions,
10685
15
    &ett_dhcp_isns_discovery_domain_access,
10686
15
    &ett_dhcp_isns_administrative_flags,
10687
15
    &ett_dhcp_isns_server_security_bitmap,
10688
15
    &ett_dhcp_isns_secondary_server_addr,
10689
15
    &ett_dhcp_o43_bsdp_boot_image,
10690
15
    &ett_dhcp_o43_bsdp_attributes,
10691
15
    &ett_dhcp_o43_bsdp_image_desc_list,
10692
15
    &ett_dhcp_o43_bsdp_image_desc,
10693
15
    &ett_dhcp_o43_bsdp_attributes_flags,
10694
15
    &ett_dhcp_option158_pcp_list,
10695
15
    &ett_dhcp_dnr_instance,
10696
15
    &ett_dhcp_dnr_instance_addrs,
10697
15
  };
10698
10699
15
  static ei_register_info ei[] = {
10700
15
    { &ei_dhcp_bad_length, { "dhcp.bad_length", PI_PROTOCOL, PI_ERROR, "length isn't 0", EXPFILL }},
10701
15
    { &ei_dhcp_bad_bitfield, { "dhcp.bad_bitfield", PI_PROTOCOL, PI_ERROR, "Bogus bitfield", EXPFILL }},
10702
15
    { &ei_dhcp_missing_subopt_length, { "dhcp.missing_subopt_length", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption length", EXPFILL }},
10703
15
    { &ei_dhcp_missing_subopt_value, { "dhcp.missing_subopt_value", PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value", EXPFILL }},
10704
15
    { &ei_dhcp_mal_duid, { "dhcp.malformed.duid", PI_PROTOCOL, PI_ERROR, "DUID: malformed option", EXPFILL }},
10705
15
    { &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 }},
10706
15
    { &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 }},
10707
15
    { &ei_dhcp_opt_overload_file_end_missing, { "dhcp.option.option_overload.file_end_missing", PI_PROTOCOL, PI_ERROR, "file overload end option missing", EXPFILL }},
10708
15
    { &ei_dhcp_opt_overload_sname_end_missing, { "dhcp.option.option_overload.sname_end_missing", PI_PROTOCOL, PI_ERROR, "sname overload end option missing", EXPFILL }},
10709
15
    { &ei_dhcp_subopt_unknown_type, { "dhcp.subopt.unknown_type", PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler", EXPFILL }},
10710
15
    { &ei_dhcp_option_civic_location_bad_cattype, { "dhcp.option.civic_location.bad_cattype", PI_PROTOCOL, PI_ERROR, "Error with CAType", EXPFILL }},
10711
15
    { &ei_dhcp_option_dhcp_name_service_invalid, { "dhcp.option.dhcp_name_service.invalid", PI_PROTOCOL, PI_ERROR, "Invalid Name Service", EXPFILL }},
10712
15
    { &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 }},
10713
15
    { &ei_dhcp_option_classless_static_route, { "dhcp.option.classless_static.route", PI_PROTOCOL, PI_ERROR, "Mask width > 32", EXPFILL }},
10714
15
    { &ei_dhcp_option125_enterprise_malformed, { "dhcp.option.enterprise.malformed", PI_PROTOCOL, PI_ERROR, "no room left in option for enterprise data", EXPFILL }},
10715
15
    { &ei_dhcp_option_6RD_malformed, { "dhcp.option.6RD.malformed", PI_PROTOCOL, PI_ERROR, "6RD: malformed option", EXPFILL }},
10716
15
    { &ei_dhcp_option82_vi_cl_tag_unknown, { "dhcp.option.option.vi.cl.tag_unknown", PI_PROTOCOL, PI_ERROR, "Unknown tag", EXPFILL }},
10717
15
    { &ei_dhcp_option_parse_err, { "dhcp.option.parse_err", PI_PROTOCOL, PI_ERROR, "Parse error", EXPFILL }},
10718
15
    { &ei_dhcp_nonstd_option_data, { "dhcp.option.nonstd_data", PI_PROTOCOL, PI_NOTE, "Non standard compliant option data", EXPFILL }},
10719
15
    { &ei_dhcp_suboption_invalid, { "dhcp.suboption_invalid", PI_PROTOCOL, PI_ERROR, "Invalid suboption", EXPFILL }},
10720
15
    { &ei_dhcp_secs_le, { "dhcp.secs_le", PI_PROTOCOL, PI_NOTE, "Seconds elapsed appears to be encoded as little-endian", EXPFILL }},
10721
15
    { &ei_dhcp_end_option_missing, { "dhcp.end_option_missing", PI_PROTOCOL, PI_ERROR, "End option missing", EXPFILL }},
10722
15
    { &ei_dhcp_client_address_not_given, { "dhcp.client_address_not_given", PI_PROTOCOL, PI_NOTE, "Client address not given", EXPFILL }},
10723
15
    { &ei_dhcp_server_name_overloaded_by_dhcp, { "dhcp.server_name_overloaded_by_dhcp", PI_PROTOCOL, PI_NOTE, "Server name option overloaded by DHCP", EXPFILL }},
10724
15
    { &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 }},
10725
15
    { &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 }},
10726
15
    { &ei_dhcp_option242_avaya_l2qvlan_invalid, { "dhcp.option.vendor.avaya.l2qvlan.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (L2QVLAN) invalid", EXPFILL }},
10727
15
    { &ei_dhcp_option242_avaya_vlantest_invalid, { "dhcp.option.vendor.avaya.vlantest.invalid", PI_PROTOCOL, PI_ERROR, "Option 242 (avaya vlantest) invalid", EXPFILL }},
10728
15
    { &ei_dhcp_option93_client_arch_ambiguous, { "dhcp.option.client_architecture.ambiguous", PI_PROTOCOL, PI_WARN, "Client Architecture ID may be ambiguous", EXPFILL }},
10729
15
    { &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 }},
10730
15
  };
10731
10732
15
  static tap_param dhcp_stat_params[] = {
10733
15
    { PARAM_FILTER, "filter", "Filter", NULL, true }
10734
15
  };
10735
10736
15
  static stat_tap_table_ui dhcp_stat_table = {
10737
15
    REGISTER_PACKET_STAT_GROUP_UNSORTED,
10738
15
    "DHCP (BOOTP) Statistics",
10739
15
    "dhcp",
10740
15
    "dhcp,stat",
10741
15
    dhcp_stat_init,
10742
15
    dhcp_stat_packet,
10743
15
    dhcp_stat_reset,
10744
15
    NULL,
10745
15
    NULL,
10746
15
    array_length(dhcp_stat_fields), dhcp_stat_fields,
10747
15
    array_length(dhcp_stat_params), dhcp_stat_params,
10748
15
    NULL,
10749
15
    0
10750
15
  };
10751
10752
15
  module_t *dhcp_module;
10753
15
  expert_module_t* expert_dhcp;
10754
10755
15
  proto_dhcp = proto_register_protocol("Dynamic Host Configuration Protocol", "DHCP/BOOTP", "dhcp");
10756
15
  proto_register_field_array(proto_dhcp, hf, array_length(hf));
10757
15
  proto_register_alias(proto_dhcp, "bootp");
10758
15
  proto_register_subtree_array(ett, array_length(ett));
10759
15
  dhcp_bootp_tap = register_tap("dhcp");
10760
10761
15
  expert_dhcp = expert_register_protocol(proto_dhcp);
10762
15
  expert_register_field_array(expert_dhcp, ei, array_length(ei));
10763
10764
15
  dhcp_option_table = register_dissector_table("dhcp.option", "BOOTP Options", proto_dhcp, FT_UINT8, BASE_DEC);
10765
15
  dhcp_vendor_id_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_id", "DHCP Vendor ID", proto_dhcp);
10766
15
  dhcp_vendor_info_subdissector = register_heur_dissector_list_with_description("dhcp.vendor_info", "DHCP Vendor Info", proto_dhcp);
10767
15
  dhcp_enterprise_class_table = register_dissector_table("dhcp.enterprise_class", "V-I Vendor Class Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10768
15
  dhcp_enterprise_specific_table = register_dissector_table("dhcp.enterprise", "V-I Vendor Specific Enterprise", proto_dhcp, FT_UINT32, BASE_DEC);
10769
10770
  /* register init/cleanup routine to handle the custom dhcp options */
10771
15
  register_init_routine(&dhcp_init_protocol);
10772
15
  register_cleanup_routine(&dhcp_cleanup_protocol);
10773
10774
  /* Allow dissector to find be found by name. */
10775
15
  dhcp_handle = register_dissector("dhcp", dissect_dhcp, proto_dhcp);
10776
10777
15
  dhcp_module = prefs_register_protocol(proto_dhcp, NULL);
10778
10779
15
  prefs_register_bool_preference(dhcp_module, "novellserverstring",
10780
15
               "Decode Option 85 as String",
10781
15
               "Novell Servers option 85 can be configured as a string instead of address",
10782
15
               &novell_string);
10783
10784
15
  prefs_register_enum_preference(dhcp_module, "pkt.ccc.protocol_version",
10785
15
               "PacketCable CCC protocol version",
10786
15
               "The PacketCable CCC protocol version",
10787
15
               &pkt_ccc_protocol_version,
10788
15
               pkt_ccc_protocol_versions,
10789
15
               false);
10790
10791
15
  prefs_register_uint_preference(dhcp_module, "pkt.ccc.option",
10792
15
               "PacketCable CCC option",
10793
15
               "Option Number for PacketCable CableLabs Client Configuration",
10794
15
               10,
10795
15
               &pkt_ccc_option);
10796
10797
15
  prefs_register_enum_preference(dhcp_module, "uuid.endian",
10798
15
               "Endianness of UUID",
10799
15
               "Endianness applied to UUID fields",
10800
15
               &dhcp_uuid_endian,
10801
15
               dhcp_uuid_endian_vals,
10802
15
               false);
10803
10804
15
  prefs_register_enum_preference(dhcp_module, "secs.endian",
10805
15
               "Endianness of seconds elapsed field",
10806
15
               "Endianness applied to seconds elapsed field",
10807
15
               &dhcp_secs_endian,
10808
15
               dhcp_secs_endian_vals,
10809
15
               false);
10810
10811
15
  prefs_register_obsolete_preference(dhcp_module, "displayasstring");
10812
10813
15
  dhcp_uat = uat_new("Custom DHCP/BootP Options (Excl. suboptions)",
10814
15
      sizeof(uat_dhcp_record_t), /* record size      */
10815
15
      "custom_bootp",      /* filename         */
10816
15
      true,        /* from_profile       */
10817
15
      &uat_dhcp_records,     /* data_ptr         */
10818
15
      &num_dhcp_records_uat,     /* numitems_ptr       */
10819
15
      UAT_AFFECTS_DISSECTION,    /* affects dissection of packets, but not set of named fields */
10820
15
      NULL,        /* help         */
10821
15
      uat_dhcp_record_copy_cb,   /* copy callback      */
10822
15
      uat_dhcp_record_update_cb, /* update callback      */
10823
15
      uat_dhcp_record_free_cb,   /* free callback      */
10824
15
      NULL,        /* post update callback   */
10825
15
      NULL,        /* reset callback   */
10826
15
      dhcp_uat_flds);      /* UAT field definitions  */
10827
10828
15
  prefs_register_uat_preference(dhcp_module,
10829
15
              "custom_dhcp_table",
10830
15
              "Custom DHCP/BootP Options (Excl. suboptions)",
10831
15
              "Custom DHCP/BootP Options (Excl. suboptions)",
10832
15
              dhcp_uat);
10833
10834
15
  register_stat_tap_table_ui(&dhcp_stat_table);
10835
15
}
10836
10837
void
10838
proto_reg_handoff_dhcp(void)
10839
15
{
10840
15
  range_t *dhcpopt_basictype_range;
10841
10842
15
  dissector_add_uint_range_with_preference("udp.port", DHCP_UDP_PORT_RANGE, dhcp_handle);
10843
10844
  /* Create dissection function handles for all DHCP/BOOTP options */
10845
15
  dhcpopt_basic_handle = create_dissector_handle( dissect_dhcpopt_basic_type, proto_dhcp );
10846
15
  range_convert_str(wmem_epan_scope(), &dhcpopt_basictype_range, DHCP_OPTION_BASICTYPE_RANGE, 0xFF);
10847
15
  dissector_add_uint_range("dhcp.option", dhcpopt_basictype_range, dhcpopt_basic_handle);
10848
10849
15
  dissector_add_uint("dhcp.option", 21, create_dissector_handle( dissect_dhcpopt_policy_filter, proto_dhcp ));
10850
15
  dissector_add_uint("dhcp.option", 33, create_dissector_handle( dissect_dhcpopt_static_route, proto_dhcp ));
10851
15
  dissector_add_uint("dhcp.option", 43, create_dissector_handle( dissect_dhcpopt_vendor_specific_info, proto_dhcp ));
10852
15
  dissector_add_uint("dhcp.option", 52, create_dissector_handle( dissect_dhcpopt_option_overload, proto_dhcp ));
10853
15
  dissector_add_uint("dhcp.option", 53, create_dissector_handle( dissect_dhcpopt_dhcp, proto_dhcp ));
10854
15
  dissector_add_uint("dhcp.option", 55, create_dissector_handle( dissect_dhcpopt_param_request_list, proto_dhcp ));
10855
15
  dissector_add_uint("dhcp.option", 60, create_dissector_handle( dissect_dhcpopt_vendor_class_identifier, proto_dhcp ));
10856
15
  dissector_add_uint("dhcp.option", 61, create_dissector_handle( dissect_dhcpopt_client_identifier, proto_dhcp ));
10857
15
  dissector_add_uint("dhcp.option", 63, create_dissector_handle( dissect_dhcpopt_netware_ip, proto_dhcp ));
10858
15
  dissector_add_uint("dhcp.option", 77, create_dissector_handle( dissect_dhcpopt_user_class_information, proto_dhcp ));
10859
15
  dissector_add_uint("dhcp.option", 78, create_dissector_handle( dissect_dhcpopt_slp_directory_agent, proto_dhcp ));
10860
15
  dissector_add_uint("dhcp.option", 79, create_dissector_handle( dissect_dhcpopt_slp_service_scope, proto_dhcp ));
10861
15
  dissector_add_uint("dhcp.option", 81, create_dissector_handle( dissect_dhcpopt_client_full_domain_name, proto_dhcp ));
10862
15
  dissector_add_uint("dhcp.option", 82, create_dissector_handle( dissect_dhcpopt_relay_agent_info, proto_dhcp ));
10863
15
  dissector_add_uint("dhcp.option", 83, create_dissector_handle( dissect_dhcpopt_isns, proto_dhcp ));
10864
15
  dissector_add_uint("dhcp.option", 85, create_dissector_handle( dissect_dhcpopt_novell_servers, proto_dhcp ));
10865
15
  dissector_add_uint("dhcp.option", 90, create_dissector_handle( dissect_dhcpopt_dhcp_authentication, proto_dhcp ));
10866
15
  dissector_add_uint("dhcp.option", 93, create_dissector_handle( dissect_dhcpopt_client_architecture, proto_dhcp ));
10867
15
  dissector_add_uint("dhcp.option", 94, create_dissector_handle( dissect_dhcpopt_client_network_interface_id, proto_dhcp ));
10868
15
  dissector_add_uint("dhcp.option", 97, create_dissector_handle( dissect_dhcpopt_client_identifier_uuid, proto_dhcp ));
10869
15
  dissector_add_uint("dhcp.option", 99, create_dissector_handle( dissect_dhcpopt_civic_location, proto_dhcp ));
10870
15
  dissector_add_uint("dhcp.option", 114, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10871
15
  dissector_add_uint("dhcp.option", 117, create_dissector_handle( dissect_dhcpopt_name_server_search, proto_dhcp ));
10872
15
  dissector_add_uint("dhcp.option", 119, create_dissector_handle( dissect_dhcpopt_dhcp_domain_search, proto_dhcp ));
10873
15
  dissector_add_uint("dhcp.option", 120, create_dissector_handle( dissect_dhcpopt_sip_servers, proto_dhcp ));
10874
15
  dissector_add_uint("dhcp.option", 121, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10875
  /* The PacketCable CCC option number can vary. Still handled through preference */
10876
15
  dissector_add_uint("dhcp.option", 122, create_dissector_handle( dissect_dhcpopt_packetcable_ccc, proto_dhcp ));
10877
10878
15
  dissector_add_uint("dhcp.option", 123, create_dissector_handle( dissect_dhcpopt_coordinate_based_location, proto_dhcp ));
10879
15
  dissector_add_uint("dhcp.option", 124, create_dissector_handle( dissect_dhcpopt_vi_vendor_class, proto_dhcp ));
10880
15
  dissector_add_uint("dhcp.option", 125, create_dissector_handle( dissect_dhcpopt_vi_vendor_specific_info, proto_dhcp ));
10881
15
  dissector_add_uint("dhcp.option", 145, create_dissector_handle( dissect_dhcpopt_forcerenew_nonce, proto_dhcp ));
10882
15
  dissector_add_uint("dhcp.option", 146, create_dissector_handle( dissect_dhcpopt_rdnss, proto_dhcp ));
10883
15
  dissector_add_uint("dhcp.option", 151, create_dissector_handle( dissect_dhcpopt_bulk_lease_status_code, proto_dhcp ));
10884
15
  dissector_add_uint("dhcp.option", 152, create_dissector_handle( dissect_dhcpopt_bulk_lease_base_time, proto_dhcp ));
10885
15
  dissector_add_uint("dhcp.option", 154, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_start, proto_dhcp ));
10886
15
  dissector_add_uint("dhcp.option", 155, create_dissector_handle( dissect_dhcpopt_bulk_lease_query_end, proto_dhcp ));
10887
15
  dissector_add_uint("dhcp.option", 158, create_dissector_handle( dissect_dhcpopt_pcp_server, proto_dhcp ));
10888
15
  dissector_add_uint("dhcp.option", 159, create_dissector_handle( dissect_dhcpopt_portparams, proto_dhcp ));
10889
15
  dissector_add_uint("dhcp.option", 160, create_dissector_handle( dissect_dhcpopt_dhcp_captive_portal, proto_dhcp ));
10890
15
  dissector_add_uint("dhcp.option", 162, create_dissector_handle( dissect_dhcpopt_dnr, proto_dhcp ));
10891
15
  dissector_add_uint("dhcp.option", 212, create_dissector_handle( dissect_dhcpopt_6RD_option, proto_dhcp ));
10892
15
  dissector_add_uint("dhcp.option", 242, create_dissector_handle( dissect_dhcpopt_avaya_ip_telephone, proto_dhcp ));
10893
15
  dissector_add_uint("dhcp.option", 249, create_dissector_handle( dissect_dhcpopt_classless_static_route, proto_dhcp ));
10894
10895
  /* Create heuristic dissection for DHCP vendor class id */
10896
15
  heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_mta_vendor_id_heur, "PacketCable MTA", "packetcable_mta_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10897
15
  heur_dissector_add( "dhcp.vendor_id", dissect_packetcable_cm_vendor_id_heur, "PacketCable CM", "packetcable_cm_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10898
15
  heur_dissector_add( "dhcp.vendor_id", dissect_apple_bsdp_vendor_id_heur, "Apple BSDP", "apple_bsdp_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10899
10900
  /* Create heuristic dissection for DHCP vendor specific information */
10901
10902
  /* Note that this is a rather weak (permissive) heuristic,
10903
     it's put first so it ends up at the end of the list, I guess this is OK.
10904
     Add any stronger (less permissive) heuristics after this!
10905
     XXX - Should we just disable by default? */
10906
15
  heur_dissector_add( "dhcp.vendor_info", dissect_alcatel_lucent_vendor_info_heur, "Alcatel-Lucent", "alcatel_lucent_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10907
10908
15
  heur_dissector_add( "dhcp.vendor_info", dissect_pxeclient_vendor_info_heur, "PXEClient", "pxeclient_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10909
15
  heur_dissector_add( "dhcp.vendor_info", dissect_cablelabs_vendor_info_heur, "CableLabs", "cablelabs_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10910
15
  heur_dissector_add( "dhcp.vendor_info", dissect_aruba_ap_vendor_info_heur, ARUBA_AP, "aruba_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10911
15
  heur_dissector_add( "dhcp.vendor_info", dissect_aruba_instant_ap_vendor_info_heur, ARUBA_INSTANT_AP, "aruba_instant_ap_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10912
15
  heur_dissector_add( "dhcp.vendor_info", dissect_apple_bsdp_vendor_info_heur, "Apple BSDP", "apple_bsdp_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10913
15
  heur_dissector_add( "dhcp.vendor_info", dissect_aerohive_vendor_info_heur, "AEROHIVE", "aerohive_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10914
15
  heur_dissector_add( "dhcp.vendor_info", dissect_cisco_vendor_info_heur, "Cisco", "cisco_info_dhcp", proto_dhcp, HEURISTIC_ENABLE );
10915
10916
  /* Create dissection function handles for DHCP Enterprise dissection */
10917
15
  dissector_add_uint("dhcp.enterprise", 4491, create_dissector_handle( dissect_vendor_cl_suboption, proto_dhcp ));
10918
15
  dissector_add_uint("dhcp.enterprise", 3561, create_dissector_handle( dissect_vendor_tr111_suboption, proto_dhcp ));
10919
10920
15
  svc_params_handle = find_dissector("svc_params");
10921
15
}
10922
10923
/*
10924
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
10925
 *
10926
 * Local variables:
10927
 * c-basic-offset: 8
10928
 * tab-width: 8
10929
 * indent-tabs-mode: t
10930
 * End:
10931
 *
10932
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
10933
 * :indentSize=8:tabSize=8:noTabs=false:
10934
 */