2 * Routines for BOOTP/DHCP packet disassembly
3 * Copyright 1998, Gilbert Ramirez <gram@alumni.rice.edu>
4 * Copyright 2004, Thomas Anders <thomas.anders [AT] blue-cable.de>
6 * Added option field filters
7 * Copyright 2011, Michael Mann
11 * The information used comes from:
12 * RFC 951: Bootstrap Protocol
13 * RFC 1497: BOOTP extensions
14 * RFC 1542: Clarifications and Extensions for the Bootstrap Protocol
15 * RFC 2131: Dynamic Host Configuration Protocol
16 * RFC 2132: DHCP Options and BOOTP Vendor Extensions
17 * RFC 2241: DHCP Options for Novell Directory Services
18 * RFC 2242: NetWare/IP Domain Name and Information
19 * RFC 2489: Procedure for Defining New DHCP Options
20 * RFC 2610: DHCP Options for Service Location Protocol
21 * RFC 3046: DHCP Relay Agent Information Option
22 * RFC 3118: Authentication for DHCP Messages
23 * RFC 3203: DHCP reconfigure extension
24 * RFC 3315: Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
25 * RFC 3495: DHCP Option (122) for CableLabs Client Configuration
26 * RFC 3594: PacketCable Security Ticket Control Sub-Option (122.9)
27 * RFC 3442: Classless Static Route Option for DHCP version 4
28 * RFC 3825: Dynamic Host Configuration Protocol Option for Coordinate-based Location Configuration Information
29 * RFC 3925: Vendor-Identifying Vendor Options for Dynamic Host Configuration Protocol version 4 (DHCPv4)
30 * RFC 3942: Reclassifying DHCPv4 Options
31 * RFC 4243: Vendor-Specific Information Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Option
32 * RFC 4361: Node-specific Client Identifiers for Dynamic Host Configuration Protocol Version Four (DHCPv4)
33 * RFC 4388: Dynamic Host Configuration Protocol (DHCP) Leasequery
34 * RFC 4578: Dynamic Host Configuration Protocol (DHCP) Options for PXE
35 * RFC 4776: Dynamic Host Configuration Protocol (DHCPv4 and DHCPv6) Option for Civic Addresses Configuration Information
36 * RFC 5223: Discovering Location-to-Service Translation (LoST) Servers Using the Dynamic Host Configuration Protocol (DHCP)
37 * RFC 5417: CAPWAP Access Controller DHCP Option
38 * RFC 5969: IPv6 Rapid Deployment on IPv4 Infrastructures (6rd)
39 * draft-ietf-dhc-fqdn-option-07.txt
40 * TFTP Server Address Option for DHCPv4 [draft-raj-dhc-tftp-addr-option-06.txt: http://tools.ietf.org/html/draft-raj-dhc-tftp-addr-option-06]
41 * BOOTP and DHCP Parameters
42 * http://www.iana.org/assignments/bootp-dhcp-parameters
43 * DOCSIS(TM) 2.0 Radio Frequency Interface Specification
44 * http://www.cablelabs.com/specifications/CM-SP-RFI2.0-I11-060602.pdf
45 * PacketCable(TM) 1.0 MTA Device Provisioning Specification
46 * http://www.cablelabs.com/packetcable/downloads/specs/PKT-SP-PROV-I11-050812.pdf
47 * http://www.cablelabs.com/specifications/archives/PKT-SP-PROV-I05-021127.pdf (superseded by above)
48 * PacketCable(TM) 1.5 MTA Device Provisioning Specification
49 * http://www.cablelabs.com/packetcable/downloads/specs/PKT-SP-PROV1.5-I02-050812.pdf
50 * PacketCable(TM) 2.0 EUE Device Provisioning Specification
51 * http://www.cablelabs.com/specifications/PKT-SP-EUE-DATA-I03-090528.pdf
52 * Business Services over DOCSIS(R) Layer 2 Virtual Private Networks
53 * http://www.cablelabs.com/specifications/CM-SP-L2VPN-I09-100611.pdf
54 * CableHome(TM) 1.1 Specification
55 * http://www.cablelabs.com/projects/cablehome/downloads/specs/CH-SP-CH1.1-I11-060407.pdf
56 * Broadband Forum TR-111
57 * http://www.broadband-forum.org/technical/download/TR-111.pdf
59 * Wireshark - Network traffic analyzer
60 * By Gerald Combs <gerald@wireshark.org>
61 * Copyright 1998 Gerald Combs
63 * This program is free software; you can redistribute it and/or
64 * modify it under the terms of the GNU General Public License
65 * as published by the Free Software Foundation; either version 2
66 * of the License, or (at your option) any later version.
68 * This program is distributed in the hope that it will be useful,
69 * but WITHOUT ANY WARRANTY; without even the implied warranty of
70 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71 * GNU General Public License for more details.
73 * You should have received a copy of the GNU General Public License
74 * along with this program; if not, write to the Free Software
75 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
79 * Some of the development of the BOOTP/DHCP protocol decoder was sponsored by
80 * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
81 * CableLabs' specifications. Your license and use of this protocol decoder
82 * does not mean that you are licensed to use the CableLabs'
83 * specifications. If you have questions about this protocol, contact
84 * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
99 #include <epan/packet.h>
100 #include "packet-arp.h"
101 #include "packet-dns.h" /* for get_dns_name() */
102 #include <epan/addr_resolv.h>
103 #include <epan/prefs.h>
104 #include <epan/tap.h>
105 #include <epan/strutil.h>
106 #include <epan/arptypes.h>
107 #include <epan/sminmpec.h>
108 #include <epan/expert.h>
109 #include <epan/uat.h>
112 static int bootp_dhcp_tap = -1;
113 static int proto_bootp = -1;
114 static int hf_bootp_type = -1;
115 static int hf_bootp_hw_type = -1;
116 static int hf_bootp_hw_len = -1;
117 static int hf_bootp_hops = -1;
118 static int hf_bootp_id = -1;
119 static int hf_bootp_secs = -1;
120 static int hf_bootp_flags = -1;
121 static int hf_bootp_flags_broadcast = -1;
122 static int hf_bootp_flags_reserved = -1;
123 static int hf_bootp_ip_client = -1;
124 static int hf_bootp_ip_your = -1;
125 static int hf_bootp_ip_server = -1;
126 static int hf_bootp_ip_relay = -1;
127 static int hf_bootp_hw_addr = -1;
128 static int hf_bootp_hw_addr_padding = -1;
129 static int hf_bootp_hw_ether_addr = -1;
130 static int hf_bootp_server = -1;
131 static int hf_bootp_file = -1;
132 static int hf_bootp_cookie = -1;
133 static int hf_bootp_vendor = -1;
134 static int hf_bootp_dhcp = -1;
135 static int hf_bootp_fqdn_s = -1;
136 static int hf_bootp_fqdn_o = -1;
137 static int hf_bootp_fqdn_e = -1;
138 static int hf_bootp_fqdn_n = -1;
139 static int hf_bootp_fqdn_mbz = -1;
140 static int hf_bootp_fqdn_rcode1 = -1;
141 static int hf_bootp_fqdn_rcode2 = -1;
142 static int hf_bootp_fqdn_name = -1;
143 static int hf_bootp_fqdn_asciiname = -1;
144 static int hf_bootp_pkt_mta_cap_len = -1;
145 static int hf_bootp_docsis_cm_cap_type = -1;
146 static int hf_bootp_docsis_cm_cap_len = -1;
147 static int hf_bootp_client_identifier_uuid = -1;
148 static int hf_bootp_option_type = -1;
149 static int hf_bootp_option_length = -1;
150 static int hf_bootp_option_value = -1;
151 static int hf_bootp_option_value_8 = -1;
152 static int hf_bootp_option_value_16 = -1;
153 static int hf_bootp_option_value_u32 = -1;
154 static int hf_bootp_option_value_i32 = -1;
155 static int hf_bootp_option_value_stringz = -1;
156 static int hf_bootp_option_value_ip_address = -1;
157 static int hf_bootp_option_value_boolean = -1;
158 static int hf_bootp_suboption_length = -1;
160 static int hf_bootp_option_padding = -1; /* 0 */
161 static int hf_bootp_option_subnet_mask = -1; /* 1 */
162 static int hf_bootp_option_time_offset = -1; /* 2 */
163 static int hf_bootp_option_router = -1; /* 3 */
164 static int hf_bootp_option_time_server = -1; /* 4 */
165 static int hf_bootp_option_name_server = -1; /* 5 */
166 static int hf_bootp_option_domain_name_server = -1; /* 6 */
167 static int hf_bootp_option_log_server = -1; /* 7 */
168 static int hf_bootp_option_quotes_server = -1; /* 8 */
169 static int hf_bootp_option_lpr_server = -1; /* 9 */
170 static int hf_bootp_option_impress_server = -1; /* 10 */
171 static int hf_bootp_option_resource_location_server = -1; /* 11 */
172 static int hf_bootp_option_hostname = -1; /* 12 */
173 static int hf_bootp_option_boot_file_size = -1; /* 13 */
174 static int hf_bootp_option_merit_dump_file = -1; /* 14 */
175 static int hf_bootp_option_domain_name = -1; /* 15 */
176 static int hf_bootp_option_swap_server = -1; /* 16 */
177 static int hf_bootp_option_root_path = -1; /* 17 */
178 static int hf_bootp_option_extension_path = -1; /* 18 */
179 static int hf_bootp_option_ip_forwarding = -1; /* 19 */
180 static int hf_bootp_option_non_local_source_routing = -1; /* 20 */
181 static int hf_bootp_option_policy_filter_ip = -1; /* 21 - IP address */
182 static int hf_bootp_option_policy_filter_subnet_mask = -1; /* 21 - Subnet mask */
183 static int hf_bootp_option_max_datagram_reassembly_size = -1; /* 22 */
184 static int hf_bootp_option_default_ip_ttl = -1; /* 23 */
185 static int hf_bootp_option_path_mtu_aging_timeout = -1; /* 24 */
186 static int hf_bootp_option_path_mtu_plateau_table_item = -1; /* 25 */
187 static int hf_bootp_option_interface_mtu = -1; /* 26 */
188 static int hf_bootp_option_all_subnets_are_local = -1; /* 27 */
189 static int hf_bootp_option_broadcast_address = -1; /* 28 */
190 static int hf_bootp_option_perform_mask_discovery = -1; /* 29 */
191 static int hf_bootp_option_mask_supplier = -1; /* 30 */
192 static int hf_bootp_option_perform_router_discover = -1; /* 31 */
193 static int hf_bootp_option_router_solicitation_address = -1; /* 32 */
194 static int hf_bootp_option_static_route_ip = -1; /* 33 - Destination IP */
195 static int hf_bootp_option_static_route_router = -1; /* 33 - Router */
196 static int hf_bootp_option_trailer_encapsulation = -1; /* 34 */
197 static int hf_bootp_option_arp_cache_timeout = -1; /* 35 */
198 static int hf_bootp_option_ethernet_encapsulation = -1; /* 36 */
199 static int hf_bootp_option_tcp_default_ttl = -1; /* 37 */
200 static int hf_bootp_option_tcp_keepalive_interval = -1; /* 38 */
201 static int hf_bootp_option_tcp_keepalive_garbage = -1; /* 39 */
202 static int hf_bootp_option_nis_domain = -1; /* 40 */
203 static int hf_bootp_option_nis_server = -1; /* 41 */
204 static int hf_bootp_option_ntp_server = -1; /* 42 */
206 static int hf_bootp_option43_value = -1; /* 43 suboption value */
207 static int hf_bootp_option43_value_8 = -1; /* 43 suboption value */
208 static int hf_bootp_option43_value_16 = -1; /* 43 suboption value */
209 static int hf_bootp_option43_value_32 = -1; /* 43 suboption value */
210 static int hf_bootp_option43_value_stringz = -1; /* 43 suboption value */
211 static int hf_bootp_option43_value_ip_address = -1; /* 43 suboption value */
213 static int hf_bootp_option43_pxeclient_suboption = -1; /* 43 suboption */
214 static int hf_bootp_option43_pxeclient_padding = -1; /* 43:0 PXE */
215 static int hf_bootp_option43_pxeclient_mtftp_ip = -1; /* 43:1 PXE */
216 static int hf_bootp_option43_pxeclient_mtftp_client_port = -1; /* 43:2 PXE */
217 static int hf_bootp_option43_pxeclient_mtftp_server_port = -1; /* 43:3 PXE */
218 static int hf_bootp_option43_pxeclient_mtftp_timeout = -1; /* 43:4 PXE */
219 static int hf_bootp_option43_pxeclient_mtftp_delay = -1; /* 43:5 PXE */
220 static int hf_bootp_option43_pxeclient_discovery_control = -1; /* 43:6 PXE */
221 static int hf_bootp_option43_pxeclient_multicast_address = -1; /* 43:7 PXE */
222 static int hf_bootp_option43_pxeclient_boot_servers = -1; /* 43:8 PXE */
223 static int hf_bootp_option43_pxeclient_boot_menu = -1; /* 43:9 PXE */
224 static int hf_bootp_option43_pxeclient_menu_prompt = -1; /* 43:10 PXE */
225 static int hf_bootp_option43_pxeclient_multicast_address_alloc = -1; /* 43:11 PXE */
226 static int hf_bootp_option43_pxeclient_credential_types = -1; /* 43:12 PXE */
227 static int hf_bootp_option43_pxeclient_boot_item = -1; /* 43:71 PXE */
228 static int hf_bootp_option43_pxeclient_end = -1; /* 43:255 PXE */
230 static int hf_bootp_option43_cl_suboption = -1; /* 43 suboption */
231 static int hf_bootp_option43_cl_padding = -1; /* 43:0 CL */
232 static int hf_bootp_option43_cl_suboption_request_list = -1; /* 43:1 CL */
233 static int hf_bootp_option43_cl_device_type = -1; /* 43:2 CL */
234 static int hf_bootp_option43_cl_esafe_type = -1; /* 43:3 CL */
235 static int hf_bootp_option43_cl_serial_number = -1; /* 43:4 CL */
236 static int hf_bootp_option43_cl_hardware_version = -1; /* 43:5 CL */
237 static int hf_bootp_option43_cl_software_version = -1; /* 43:6 CL */
238 static int hf_bootp_option43_cl_boot_rom_version = -1; /* 43:7 CL */
239 static int hf_bootp_option43_cl_oui_bytes = -1; /* 43:8 CL */
240 static int hf_bootp_option43_cl_oui_string = -1; /* 43:8 CL */
241 static int hf_bootp_option43_cl_model_number = -1; /* 43:9 CL */
242 static int hf_bootp_option43_cl_vendor_name10 = -1; /* 43:10 CL */
243 static int hf_bootp_option43_cl_address_realm = -1; /* 43:11 CL */
244 static int hf_bootp_option43_cl_cm_ps_system_desc = -1; /* 43:12 CL */
245 static int hf_bootp_option43_cl_cm_ps_firmware_revision = -1; /* 43:13 CL */
246 static int hf_bootp_option43_cl_firewall_policy_file_version = -1; /* 43:14 CL */
247 static int hf_bootp_option43_cl_esafe_config_file_devices = -1; /* 43:15 CL */
248 static int hf_bootp_option43_cl_video_security_tape = -1; /* 43:18 CL */
249 static int hf_bootp_option43_cl_mta_mac_address = -1; /* 43:31 CL */
250 static int hf_bootp_option43_cl_correlation_ID = -1; /* 43:32 CL */
251 static int hf_bootp_option43_cl_vendor_name51 = -1; /* 43:51 CL */
252 static int hf_bootp_option43_cl_cablecard_capability = -1; /* 43:52 CL */
253 static int hf_bootp_option43_cl_device_id_ca = -1; /* 43:53 CL */
254 static int hf_bootp_option43_cl_device_id_x509 = -1; /* 43:54 CL */
255 static int hf_bootp_option43_cl_end = -1; /* 43:255 CL */
257 static int hf_bootp_option43_alcatel_suboption = -1; /* 43 suboption */
258 static int hf_bootp_option43_alcatel_padding = -1; /* 43:0 Alcatel */
259 static int hf_bootp_option43_alcatel_vlan_id = -1; /* 43:58 Alcatel */
260 static int hf_bootp_option43_alcatel_tftp1 = -1; /* 43:64 Alcatel */
261 static int hf_bootp_option43_alcatel_tftp2 = -1; /* 43:65 Alcatel */
262 static int hf_bootp_option43_alcatel_app_type = -1; /* 43:66 Alcatel */
263 static int hf_bootp_option43_alcatel_sip_url = -1; /* 43:67 Alcatel */
264 static int hf_bootp_option43_alcatel_end = -1; /* 43:255 Alcatel */
267 static int hf_bootp_option_netbios_over_tcpip_name_server = -1; /* 44 */
268 static int hf_bootp_option_netbios_over_tcpip_dd_name_server = -1; /* 45 */
269 static int hf_bootp_option_netbios_over_tcpip_node_type = -1; /* 46 */
270 static int hf_bootp_option_netbios_over_tcpip_scope = -1; /* 47 */
271 static int hf_bootp_option_xwindows_system_font_server = -1; /* 48 */
272 static int hf_bootp_option_xwindows_system_display_manager = -1; /* 49 */
273 static int hf_bootp_option_requested_ip_address = -1; /* 50 */
274 static int hf_bootp_option_ip_address_lease_time = -1; /* 51 */
275 static int hf_bootp_option_option_overload = -1; /* 52 */
276 static int hf_bootp_option_dhcp = -1; /* 53 */
277 static int hf_bootp_option_dhcp_server_id = -1; /* 54 */
278 static int hf_bootp_option_parameter_request_list_item = -1; /* 55 */
279 static int hf_bootp_option_message = -1; /* 56 */
280 static int hf_bootp_option_dhcp_max_message_size = -1; /* 57 */
281 static int hf_bootp_option_renewal_time_value = -1; /* 58 */
282 static int hf_bootp_option_rebinding_time_value = -1; /* 59 */
283 static int hf_bootp_option_vendor_class_id = -1; /* 60 */
285 static int hf_bootp_option_novell_netware_ip_domain = -1; /* 62 */
287 static int hf_bootp_option63_suboption = -1; /* 63 suboption */
288 static int hf_bootp_option63_value = -1; /* 63 suboption value */
289 static int hf_bootp_option63_value_8 = -1; /* 63 suboption value */
290 static int hf_bootp_option63_value_ip_address = -1; /* 63 suboption value */
291 static int hf_bootp_option63_value_boolean = -1; /* 63 suboption value */
292 static int hf_bootp_option63_broadcast = -1; /* 63:5 */
293 static int hf_bootp_option63_preferred_dss_server = -1; /* 63:6 */
294 static int hf_bootp_option63_nearest_nwip_server = -1; /* 63:7 */
295 static int hf_bootp_option63_autoretries = -1; /* 63:8 */
296 static int hf_bootp_option63_autoretry_delay = -1; /* 63:9 */
297 static int hf_bootp_option63_support_netware_v1_1 = -1; /* 63:10 */
298 static int hf_bootp_option63_primary_dss = -1; /* 63:11 */
300 static int hf_bootp_option_nis_plus_domain = -1; /* 64 */
301 static int hf_bootp_option_nis_plus_server = -1; /* 65 */
302 static int hf_bootp_option_tftp_server_name = -1; /* 66 */
303 static int hf_bootp_option_bootfile_name = -1; /* 67 */
304 static int hf_bootp_option_mobile_ip_home_agent = -1; /* 68 */
305 static int hf_bootp_option_smtp_server = -1; /* 69 */
306 static int hf_bootp_option_pop3_server = -1; /* 70 */
307 static int hf_bootp_option_nntp_server = -1; /* 71 */
308 static int hf_bootp_option_default_www_server = -1; /* 72 */
309 static int hf_bootp_option_default_finger_server = -1; /* 73 */
310 static int hf_bootp_option_default_irc_server = -1; /* 74 */
311 static int hf_bootp_option_streettalk_server = -1; /* 75 */
312 static int hf_bootp_option_streettalk_da_server = -1; /* 76 */
313 static int hf_bootp_option_slp_directory_agent_value = -1; /* 78 */
314 static int hf_bootp_option_slp_directory_agent_slpda_address = -1; /* 78 */
315 static int hf_bootp_option_slp_service_scope_value = -1; /* 79 */
316 static int hf_bootp_option_slp_service_scope_string = -1; /* 79 */
318 static int hf_bootp_option82_suboption = -1; /* 82 suboption */
319 static int hf_bootp_option82_value = -1; /* 82 suboption value */
320 static int hf_bootp_option82_value_8 = -1; /* 82 suboption value */
321 static int hf_bootp_option82_value_32 = -1; /* 82 suboption value */
322 static int hf_bootp_option82_value_ip_address = -1; /* 82 suboption value */
323 static int hf_bootp_option82_value_stringz = -1; /* 82 suboption value */
324 static int hf_bootp_option82_padding = -1; /* 82:0 */
325 static int hf_bootp_option82_agent_circuit_id = -1; /* 82:1 */
326 static int hf_bootp_option82_agent_remote_id = -1; /* 82:2 */
327 static int hf_bootp_option82_reserved = -1; /* 82:3 */
328 static int hf_bootp_option82_docsis_device_class = -1; /* 82:4 */
329 static int hf_bootp_option82_link_selection = -1; /* 82:5 */
330 static int hf_bootp_option82_subscriber_id = -1; /* 82:6 */
331 static int hf_bootp_option82_radius_attributes = -1; /* 82:7 */
332 static int hf_bootp_option82_authentication = -1; /* 82:8 */
333 static int hf_bootp_option82_vi = -1; /* 82:9 */
334 /* 82:9 suboptions */
335 static int hf_bootp_option82_vi_enterprise = -1;
336 static int hf_bootp_option82_vi_data_length = -1;
337 static int hf_bootp_option82_vi_cl_option = -1;
338 static int hf_bootp_option82_vi_cl_length = -1;
339 static int hf_bootp_option82_vi_cl_tag = -1;
340 static int hf_bootp_option82_vi_cl_tag_length = -1;
341 static int hf_bootp_option82_vi_cl_docsis_version = -1;
342 /* 82:9 suboptions end */
343 static int hf_bootp_option82_flags = -1; /* 82:10 */
344 static int hf_bootp_option82_server_id_override = -1; /* 82:11 */
346 static int hf_bootp_option_novell_dss_string = -1; /* 85 */
347 static int hf_bootp_option_novell_dss_ip = -1; /* 85 */
348 static int hf_bootp_option_novell_ds_tree_name = -1; /* 86 */
349 static int hf_bootp_option_novell_ds_context = -1; /* 87 */
350 static int hf_bootp_option_dhcp_authentication_protocol = -1; /* 90 */
351 static int hf_bootp_option_dhcp_authentication_alg_delay = -1; /* 90 */
352 static int hf_bootp_option_dhcp_authentication_algorithm = -1; /* 90 */
353 static int hf_bootp_option_dhcp_authentication_rdm = -1; /* 90 */
354 static int hf_bootp_option_dhcp_authentication_rdm_replay_detection = -1; /* 90 */
355 static int hf_bootp_option_dhcp_authentication_rdm_rdv = -1; /* 90 */
356 static int hf_bootp_option_dhcp_authentication_secret_id = -1; /* 90 */
357 static int hf_bootp_option_dhcp_authentication_hmac_md5_hash = -1; /* 90 */
358 static int hf_bootp_option_dhcp_authentication_information = -1; /* 90 */
359 static int hf_bootp_option_client_last_transaction_time = -1; /* 91 */
360 static int hf_bootp_option_associated_ip_option = -1; /* 92 */
361 static int hf_bootp_option_client_system_architecture = -1; /* 93 */
362 static int hf_bootp_option_client_network_id_major_ver = -1; /* 94 */
363 static int hf_bootp_option_client_network_id_minor_ver = -1; /* 94 */
364 static int hf_bootp_option_civic_location_what = -1; /* 99 */
365 static int hf_bootp_option_civic_location_country = -1; /* 99 */
366 static int hf_bootp_option_civic_location_ca_type = -1; /* 99 */
367 static int hf_bootp_option_civic_location_ca_length = -1; /* 99 */
368 static int hf_bootp_option_civic_location_ca_value = -1; /* 99 */
369 static int hf_bootp_option_netinfo_parent_server_address = -1; /* 112 */
370 static int hf_bootp_option_netinfo_parent_server_tag = -1; /* 113 */
371 static int hf_bootp_option_dhcp_auto_configuration = -1; /* 116 */
372 static int hf_bootp_option_cl_dss_id_option = -1; /* 123 CL */
373 static int hf_bootp_option_cl_dss_id_len = -1; /* 123 CL */
374 static int hf_bootp_option_cl_dss_id = -1; /* 123 CL */
375 static int hf_bootp_option_vi_class_cl_address_mode = -1; /* 124 */
376 static int hf_bootp_option_vi_class_enterprise = -1; /* 124 */
377 static int hf_bootp_option_vi_class_data_length = -1; /* 124 */
378 static int hf_bootp_option_vi_class_data = -1; /* 124 */
380 static int hf_bootp_option125_enterprise = -1;
381 static int hf_bootp_option125_value = -1; /* 125 suboption value */
382 static int hf_bootp_option125_value_8 = -1; /* 125 suboption value */
383 static int hf_bootp_option125_value_16 = -1; /* 125 suboption value */
384 static int hf_bootp_option125_value_ip_address = -1; /* 125 suboption value */
385 static int hf_bootp_option125_value_stringz = -1; /* 125 suboption value */
386 static int hf_bootp_option125_tr111_suboption = -1; /* 125 suboption */
387 static int hf_bootp_option125_tr111_device_manufacturer_oui = -1; /* 125:TR-111 1 */
388 static int hf_bootp_option125_tr111_device_serial_number = -1; /* 125:TR-111 2 */
389 static int hf_bootp_option125_tr111_device_product_class = -1; /* 125:TR-111 3 */
390 static int hf_bootp_option125_tr111_gateway_manufacturer_oui = -1; /* 125:TR-111 4 */
391 static int hf_bootp_option125_tr111_gateway_serial_number = -1; /* 125:TR-111 5 */
392 static int hf_bootp_option125_tr111_gateway_product_class = -1; /* 125:TR-111 6 */
393 static int hf_bootp_option125_cl_suboption = -1; /* 125 suboption */
394 static int hf_bootp_option125_cl_option_request = -1; /* 125:CL 1 */
395 static int hf_bootp_option125_cl_tftp_server_addresses = -1; /* 125:CL 1 */
396 static int hf_bootp_option125_cl_erouter_container_option = -1; /* 125:CL 1 */
397 static int hf_bootp_option125_cl_mib_environment_indicator_option = -1; /* 125:CL 1 */
398 static int hf_bootp_option125_cl_modem_capabilities = -1; /* 125:CL 1 */
400 static int hf_bootp_option_subnet_selection_option = -1; /* 118 */
401 static int hf_bootp_option_lost_server_domain_name = -1; /* 137 */
402 static int hf_bootp_option_capwap_access_controller = -1; /* 138 */
403 static int hf_bootp_option_tftp_server_address = -1; /* 150 */
404 static int hf_bootp_option_6RD_ipv4_mask_len = -1; /* 212 */
405 static int hf_bootp_option_6RD_prefix_len = -1; /* 212 */
406 static int hf_bootp_option_6RD_prefix = -1; /* 212 */
407 static int hf_bootp_option_6RD_border_relay_ip = -1; /* 212 */
408 static int hf_bootp_option_private_proxy_autodiscovery = -1; /* 252 */
409 static int hf_bootp_option_end = -1; /* 255 */
410 static int hf_bootp_option_end_overload = -1; /* 255 (with overload)*/
415 static gint ett_bootp = -1;
416 static gint ett_bootp_flags = -1;
417 static gint ett_bootp_option = -1;
418 static gint ett_bootp_option43_suboption = -1;
419 static gint ett_bootp_option63_suboption = -1;
420 static gint ett_bootp_option82_suboption = -1;
421 static gint ett_bootp_option82_suboption9 = -1;
422 static gint ett_bootp_option125_suboption = -1;
423 static gint ett_bootp_fqdn = -1;
425 /* RFC3825decoder error codes of the conversion function */
426 #define RFC3825_NOERROR 0
427 #define RFC3825_LATITUDE_OUTOFRANGE 1
428 #define RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE 2
429 #define RFC3825_LONGITUDE_OUTOFRANGE 3
430 #define RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE 4
431 #define RFC3825_ALTITUDE_OUTOFRANGE 5
432 #define RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE 6
433 #define RFC3825_ALTITUDE_TYPE_OUTOFRANGE 7
434 #define RFC3825_DATUM_TYPE_OUTOFRANGE 8
440 struct rfc3825_location_fixpoint_t {
442 gint64 latitude; /* latitude in degrees, allowed range from -90deg to 90deg.
443 Fixpoint A(8,25) with 34 bits */
444 guint8 latitude_res; /* the resolution of the latitude in bits, allowed range is from 0 to 34.
446 gint64 longitude; /* longitude in degrees, range from -180deg to 180deg.
447 Fixpoint A(8,25) with 34 bits */
448 guint8 longitude_res; /* the resolution of the longitude in bits, allowed range is from 0 to 34.
450 gint32 altitude; /* the altitude, 30 bits.
451 Depending on alt_type this are meters or floors, no range limit.
452 altitude_type==1: A(13,8) with 22 bits
453 altitude_type==2: A(13,8) with 22 bits */
454 guint8 altitude_res; /* the resolution of the altitude in bits, allowed range is from 0 to 30.
456 altitude_type==1: any value between 0 and 30
457 altitude_type==2: either 0 (floor unknown) or 30 */
458 guint8 altitude_type; /* the type of the altitude, 4 bits. allowed values are:
460 1: altitude in meters
461 2: altitude in floors */
462 guint8 datum_type; /* the map datum used for the coordinates. 8 bits.
463 All values are allowed although currently only the
464 following ones are defined:
470 /* The rfc3825_location_decimal_t structure holds the location parameters
471 * in decimal (floating point) format.
473 struct rfc3825_location_decimal_t {
475 double latitude; /* latitude in degrees, allowed range from -90deg to 90deg */
476 double latitude_res; /* the uncertainty of the latitude in grad, "0.01" means +-0.01deg
477 from the altitude. During conversion this will be rounded to
478 next smaller value which can be respresented in fixpoint arithmetic */
479 double longitude; /* longitude in degrees, range from -180deg to 180deg */
480 double longitude_res; /* the uncertainty of the longitude in grad, "0.01" means +-0.01deg
481 from the longitude. During conversion this will be rounded to
482 next smaller value which can be respresented in fixpoint arithmetic */
483 double altitude; /* the altitude, depending on alt_type this are meters or floors, no range limit */
484 double altitude_res; /* the uncertainty of the altitude in either:
485 - altitude-type=meters: "10" means 10 meters which means +-10 meters from the altitude
486 - altitude-type=floors: either 0 (unknown) or 30 (exact) */
487 int altitude_type; /* the type of the altitude, allowed values are
489 1: altitude in meters
490 2: altitude in floors */
491 int datum_type; /* the map datum used for the coordinates.
492 All values are allowed although currently only the
493 following ones are defined:
499 /* converts fixpoint presentation into decimal presentation
500 also converts values which are out of range to allow decoding of received data */
501 static int rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal);
503 /* decodes the LCI string received from DHCP into the fixpoint values */
504 static void rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint);
507 /* Map Datum Types used for the coordinates (RFC 3825) */
508 static const value_string map_datum_type_values[] = {
510 { 2, "NAD83 (NAVD88)" },
511 { 3, "NAD83 (MLLW)" },
516 /* Altitude Types used for the coordinates (RFC 3825) */
517 static const value_string altitude_type_values[] = {
523 /* AutoConfigure (RFC 2563) */
524 static const value_string dhcp_autoconfig[] = {
525 {0, "DoNotAutoConfigure"},
526 {1, "AutoConfigure"},
530 /* Error Types for RFC 3825 coordinate location decoding */
531 static const value_string rfc3825_error_types[] = {
532 {1, "Latitude is out of range [-90,90]"},
533 {2, "Latitude Uncertainty is out of range [0,90]"},
534 {3, "Longitude is out of range [-180,180]"},
535 {4, "Longitude Uncertainty is out of range [0,180]"},
536 {5, "Altitude is out of range [-(2^21),(2^21)-1]"},
537 {6, "Altitude Uncertainty is out of range [0,2^20]"},
538 {7, "Altitude Type is out of range [0,2]"},
539 {8, "Datum is out of range [1,3]"},
545 /* Civic Address What field (RFC 4776) */
546 static const value_string civic_address_what_values[] = {
547 { 0, "Location of the DHCP server" },
548 { 1, "Location of the network element believed to be closest to the client" },
549 { 2, "Location of the client"},
553 /* Civic Address Type field (RFC 4119, RFC 4776, RFC 5139) */
554 static const value_string civic_address_type_values[] = {
562 { 16, "PRD (Leading street direction)" },
563 { 17, "POD (Trailing street suffix)" },
564 { 18, "STS (Street suffix)" },
565 { 19, "HNO (House number)" },
566 { 20, "HNS (House number suffix)" },
567 { 21, "LMK (Landmark or vanity address)" },
568 { 22, "LOC (Additional location information)" },
570 { 24, "PC (Postal/ZIP code)" },
571 { 25, "BLD (Building)" },
573 { 27, "FLR (Floor)" },
575 { 29, "PLC (Place-type)" },
576 { 30, "PCN (Postal community name)" },
578 { 32, "ADDCODE (Additional Code)" },
580 { 34, "RD (Primary road or street)" },
581 { 35, "RDSEC (Road section)" },
582 { 36, "RDBR (Road branch)" },
583 { 37, "RDSUBBR (Road sub-branch)" },
584 { 38, "PRM (Road pre-modifier)" },
585 { 39, "POM (Road post-modifier" },
590 static const value_string cablelab_ipaddr_mode_vals[] = {
596 static const value_string duidtype_vals[] =
598 { DUID_LLT, "link-layer address plus time" },
599 { DUID_EN, "assigned by vendor based on Enterprise number" },
600 { DUID_LL, "link-layer address" },
604 static gboolean novell_string = FALSE;
606 #define UDP_PORT_BOOTPS 67
607 #define UDP_PORT_BOOTPC 68
609 #define BOOTP_BC 0x8000
610 #define BOOTP_MBZ 0x7FFF
613 #define F_FQDN_S 0x01
614 #define F_FQDN_O 0x02
615 #define F_FQDN_E 0x04
616 #define F_FQDN_N 0x08
617 #define F_FQDN_MBZ 0xf0
619 static const true_false_string tfs_fqdn_s = {
624 static const true_false_string tfs_fqdn_o = {
629 static const true_false_string tfs_fqdn_e = {
634 static const true_false_string tfs_fqdn_n = {
636 "Some server updates"
643 ipv4, /* single IPv4 address */
644 ipv4_list, /* list of IPv4 addresses */
654 time_in_s_secs, /* Signed */
655 time_in_u_secs, /* Unsigned (not micro) */
662 enum field_type ftype;
666 static const true_false_string flag_set_broadcast = {
672 /* PacketCable/DOCSIS definitions */
673 #define PACKETCABLE_MTA_CAP10 "pktc1.0:"
674 #define PACKETCABLE_MTA_CAP15 "pktc1.5:"
675 #define PACKETCABLE_MTA_CAP20 "pktc2.0:"
676 #define PACKETCABLE_CM_CAP11 "docsis1.1:"
677 #define PACKETCABLE_CM_CAP20 "docsis2.0:"
678 #define PACKETCABLE_CM_CAP30 "docsis3.0:"
680 #define PACKETCABLE_CCC_I05 1
681 #define PACKETCABLE_CCC_DRAFT5 2
682 #define PACKETCABLE_CCC_RFC_3495 3
684 static enum_val_t pkt_ccc_protocol_versions[] = {
685 { "ccc_i05", "PKT-SP-PROV-I05-021127", PACKETCABLE_CCC_I05 },
686 { "ccc_draft_5", "IETF Draft 5", PACKETCABLE_CCC_DRAFT5 },
687 { "rfc_3495", "RFC 3495", PACKETCABLE_CCC_RFC_3495 },
691 static gint pkt_ccc_protocol_version = PACKETCABLE_CCC_RFC_3495;
692 static guint pkt_ccc_option = 122;
695 static int dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
696 tvbuff_t *tvb, int optoff, int optend);
697 static int dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
698 tvbuff_t *tvb, int optoff, int optend);
699 static int dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
700 tvbuff_t *tvb, int optoff, int optend);
701 static int dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
702 tvbuff_t *tvb, int optoff, int optend);
703 static int dissect_vendor_tr111_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
704 tvbuff_t *tvb, int optoff, int optend);
705 static int bootp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
706 tvbuff_t *tvb, int optoff, int optend);
707 static void dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb,
709 static void dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb,
710 int voff, int len, gboolean opt125);
711 static int dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
712 tvbuff_t *tvb, int optoff, int optend);
713 static int dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
714 tvbuff_t *tvb, int optoff, int optend, int revision);
715 static int dissect_vendor_cl_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
716 tvbuff_t *tvb, int optoff, int optend);
718 #define OPT53_DISCOVER "Discover"
719 /* http://www.iana.org/assignments/bootp-dhcp-parameters */
720 static const value_string opt53_text[] = {
721 { 1, OPT53_DISCOVER },
729 { 9, "Force Renew" },
730 { 10, "Lease query" }, /* RFC4388 */
731 { 11, "Lease Unassigned" }, /* RFC4388 */
732 { 12, "Lease Unknown" }, /* RFC4388 */
733 { 13, "Lease Active" }, /* RFC4388 */
734 /* draft-ietf-dhc-leasequery-09.txt
735 { 13, "Lease query" }, */
736 { 14, "Lease known" },
737 { 15, "Lease unknown" },
738 { 16, "Lease active" },
739 { 17, "Unimplemented" },
744 /* DHCP Authentication protocols */
745 #define AUTHEN_PROTO_CONFIG_TOKEN 0
746 #define AUTHEN_PROTO_DELAYED_AUTHEN 1
748 /* DHCP Authentication algorithms for delayed authentication */
749 #define AUTHEN_DELAYED_ALGO_HMAC_MD5 1
751 /* DHCP Authentication Replay Detection Methods */
752 #define AUTHEN_RDM_MONOTONIC_COUNTER 0x00
754 /* DHCP Option Overload (option code 52) */
755 #define OPT_OVERLOAD_FILE 1
756 #define OPT_OVERLOAD_SNAME 2
757 #define OPT_OVERLOAD_BOTH 3
759 /* Server name and boot file offsets and lengths */
760 #define SERVER_NAME_OFFSET 44
761 #define SERVER_NAME_LEN 64
762 #define FILE_NAME_OFFSET 108
763 #define FILE_NAME_LEN 128
764 #define VENDOR_INFO_OFFSET 236
766 static const value_string bootp_nbnt_vals[] = {
774 static const value_string bootp_client_arch[] = {
775 { 0x0000, "IA x86 PC" },
776 { 0x0001, "NEC/PC98" },
777 { 0x0002, "IA64 PC" },
778 { 0x0003, "DEC Alpha" },
779 { 0x0004, "ArcX86" },
780 { 0x0005, "Intel Lean Client" },
781 { 0x0006, "EFI IA32" },
782 { 0x0007, "EFI BC" },
783 { 0x0008, "EFI Xscale" },
784 { 0x0009, "EFI x86-64" },
788 static const value_string opt_overload_vals[] = {
789 { OPT_OVERLOAD_FILE, "Boot file name holds options", },
790 { OPT_OVERLOAD_SNAME, "Server host name holds options", },
791 { OPT_OVERLOAD_BOTH, "Boot file and server host names hold options" },
794 static const value_string slpda_vals[] = {
795 {0x00, "Dynamic Discovery" },
796 {0x01, "Static Discovery" },
797 {0x80, "Backwards compatibility" },
800 static const value_string slp_scope_vals[] = {
801 {0x00, "Preferred Scope" },
802 {0x01, "Mandatory Scope" },
805 static const value_string authen_protocol_vals[] = {
806 {AUTHEN_PROTO_CONFIG_TOKEN, "configuration token" },
807 {AUTHEN_PROTO_DELAYED_AUTHEN, "delayed authentication" },
810 static const value_string authen_da_algo_vals[] = {
811 {AUTHEN_DELAYED_ALGO_HMAC_MD5, "HMAC_MD5" },
814 static const value_string authen_rdm_vals[] = {
815 {AUTHEN_RDM_MONOTONIC_COUNTER, "Monotonically-increasing counter" },
818 static const value_string cl_dss_id_type_vals[] = {
819 {1, "Primary DSS_ID" },
820 {2, "Secondary DSS_ID" },
824 /* bootp options administration */
825 #define BOOTP_OPT_NUM 256
827 /* Re-define structure. Values to be upated by bootp_init_protocol */
828 static struct opt_info bootp_opt[BOOTP_OPT_NUM];
830 static struct opt_info default_bootp_opt[BOOTP_OPT_NUM] = {
831 /* 0 */ { "Padding", none, &hf_bootp_option_padding },
832 /* 1 */ { "Subnet Mask", ipv4, &hf_bootp_option_subnet_mask },
833 /* 2 */ { "Time Offset", time_in_s_secs, &hf_bootp_option_time_offset },
834 /* 3 */ { "Router", ipv4_list, &hf_bootp_option_router },
835 /* 4 */ { "Time Server", ipv4_list, &hf_bootp_option_time_server },
836 /* 5 */ { "Name Server", ipv4_list, &hf_bootp_option_name_server },
837 /* 6 */ { "Domain Name Server", ipv4_list, &hf_bootp_option_domain_name_server },
838 /* 7 */ { "Log Server", ipv4_list, &hf_bootp_option_log_server },
839 /* 8 */ { "Quotes Server", ipv4_list, &hf_bootp_option_quotes_server },
840 /* 9 */ { "LPR Server", ipv4_list, &hf_bootp_option_lpr_server },
841 /* 10 */ { "Impress Server", ipv4_list, &hf_bootp_option_impress_server },
842 /* 11 */ { "Resource Location Server", ipv4_list, &hf_bootp_option_resource_location_server },
843 /* 12 */ { "Host Name", string, &hf_bootp_option_hostname },
844 /* 13 */ { "Boot File Size", val_u_short, &hf_bootp_option_boot_file_size },
845 /* 14 */ { "Merit Dump File", string, &hf_bootp_option_merit_dump_file },
846 /* 15 */ { "Domain Name", string, &hf_bootp_option_domain_name },
847 /* 16 */ { "Swap Server", ipv4, &hf_bootp_option_swap_server },
848 /* 17 */ { "Root Path", string, &hf_bootp_option_root_path },
849 /* 18 */ { "Extensions Path", string, &hf_bootp_option_extension_path },
850 /* 19 */ { "IP Forwarding", val_boolean, &hf_bootp_option_ip_forwarding },
851 /* 20 */ { "Non-Local Source Routing", val_boolean, &hf_bootp_option_non_local_source_routing },
852 /* 21 */ { "Policy Filter", special, NULL },
853 /* 22 */ { "Maximum Datagram Reassembly Size", val_u_short, &hf_bootp_option_max_datagram_reassembly_size },
854 /* 23 */ { "Default IP Time-to-Live", val_u_byte, &hf_bootp_option_default_ip_ttl },
855 /* 24 */ { "Path MTU Aging Timeout", time_in_u_secs, &hf_bootp_option_path_mtu_aging_timeout },
856 /* 25 */ { "Path MTU Plateau Table", val_u_short_list, &hf_bootp_option_path_mtu_plateau_table_item },
857 /* 26 */ { "Interface MTU", val_u_short, &hf_bootp_option_interface_mtu },
858 /* 27 */ { "All Subnets are Local", val_boolean, &hf_bootp_option_all_subnets_are_local },
859 /* 28 */ { "Broadcast Address", ipv4, &hf_bootp_option_broadcast_address },
860 /* 29 */ { "Perform Mask Discovery", val_boolean, &hf_bootp_option_perform_mask_discovery },
861 /* 30 */ { "Mask Supplier", val_boolean, &hf_bootp_option_mask_supplier },
862 /* 31 */ { "Perform Router Discover", val_boolean, &hf_bootp_option_perform_router_discover },
863 /* 32 */ { "Router Solicitation Address", ipv4, &hf_bootp_option_router_solicitation_address },
864 /* 33 */ { "Static Route", special, NULL },
865 /* 34 */ { "Trailer Encapsulation", val_boolean, &hf_bootp_option_trailer_encapsulation },
866 /* 35 */ { "ARP Cache Timeout", time_in_u_secs, &hf_bootp_option_arp_cache_timeout },
867 /* 36 */ { "Ethernet Encapsulation", val_boolean, &hf_bootp_option_ethernet_encapsulation },
868 /* 37 */ { "TCP Default TTL", val_u_byte, &hf_bootp_option_tcp_default_ttl },
869 /* 38 */ { "TCP Keepalive Interval", time_in_u_secs, &hf_bootp_option_tcp_keepalive_interval },
870 /* 39 */ { "TCP Keepalive Garbage", val_boolean, &hf_bootp_option_tcp_keepalive_garbage },
871 /* 40 */ { "Network Information Service Domain", string, &hf_bootp_option_nis_domain },
872 /* 41 */ { "Network Information Service Servers", ipv4_list, &hf_bootp_option_nis_server },
873 /* 42 */ { "Network Time Protocol Servers", ipv4_list, &hf_bootp_option_ntp_server },
874 /* 43 */ { "Vendor-Specific Information", special, NULL },
875 /* 44 */ { "NetBIOS over TCP/IP Name Server", ipv4_list, &hf_bootp_option_netbios_over_tcpip_name_server },
876 /* 45 */ { "NetBIOS over TCP/IP Datagram Distribution Name Server", ipv4_list, &hf_bootp_option_netbios_over_tcpip_dd_name_server },
877 /* 46 */ { "NetBIOS over TCP/IP Node Type", val_u_byte, &hf_bootp_option_netbios_over_tcpip_node_type },
878 /* 47 */ { "NetBIOS over TCP/IP Scope", string, &hf_bootp_option_netbios_over_tcpip_scope },
879 /* 48 */ { "X Window System Font Server", ipv4_list, &hf_bootp_option_xwindows_system_font_server },
880 /* 49 */ { "X Window System Display Manager", ipv4_list, &hf_bootp_option_xwindows_system_display_manager },
881 /* 50 */ { "Requested IP Address", ipv4, &hf_bootp_option_requested_ip_address },
882 /* 51 */ { "IP Address Lease Time", time_in_u_secs, &hf_bootp_option_ip_address_lease_time },
883 /* 52 */ { "Option Overload", special, &hf_bootp_option_option_overload },
884 /* 53 */ { "DHCP Message Type", val_u_byte, &hf_bootp_option_dhcp },
885 /* 54 */ { "DHCP Server Identifier", ipv4, &hf_bootp_option_dhcp_server_id },
886 /* 55 */ { "Parameter Request List", special, &hf_bootp_option_parameter_request_list_item },
887 /* 56 */ { "Message", string, &hf_bootp_option_message },
888 /* 57 */ { "Maximum DHCP Message Size", val_u_short, &hf_bootp_option_dhcp_max_message_size },
889 /* 58 */ { "Renewal Time Value", time_in_u_secs, &hf_bootp_option_renewal_time_value },
890 /* 59 */ { "Rebinding Time Value", time_in_u_secs, &hf_bootp_option_rebinding_time_value },
891 /* 60 */ { "Vendor class identifier", special, NULL },
892 /* 61 */ { "Client identifier", special, NULL },
893 /* 62 */ { "Novell/Netware IP domain", string, &hf_bootp_option_novell_netware_ip_domain },
894 /* 63 */ { "Novell Options", special, NULL },
895 /* 64 */ { "Network Information Service+ Domain", string, &hf_bootp_option_nis_plus_domain },
896 /* 65 */ { "Network Information Service+ Servers", ipv4_list, &hf_bootp_option_nis_plus_server },
897 /* 66 */ { "TFTP Server Name", string, &hf_bootp_option_tftp_server_name },
898 /* 67 */ { "Bootfile name", string, &hf_bootp_option_bootfile_name },
899 /* 68 */ { "Mobile IP Home Agent", ipv4_list, &hf_bootp_option_mobile_ip_home_agent },
900 /* 69 */ { "SMTP Server", ipv4_list, &hf_bootp_option_smtp_server },
901 /* 70 */ { "POP3 Server", ipv4_list, &hf_bootp_option_pop3_server },
902 /* 71 */ { "NNTP Server", ipv4_list, &hf_bootp_option_nntp_server },
903 /* 72 */ { "Default WWW Server", ipv4_list, &hf_bootp_option_default_www_server },
904 /* 73 */ { "Default Finger Server", ipv4_list, &hf_bootp_option_default_finger_server },
905 /* 74 */ { "Default IRC Server", ipv4_list, &hf_bootp_option_default_irc_server },
906 /* 75 */ { "StreetTalk Server", ipv4_list, &hf_bootp_option_streettalk_server },
907 /* 76 */ { "StreetTalk Directory Assistance Server", ipv4_list, &hf_bootp_option_streettalk_da_server },
908 /* 77 */ { "User Class Information", opaque, NULL },
909 /* 78 */ { "Directory Agent Information", special, NULL },
910 /* 79 */ { "Service Location Agent Scope", special, NULL },
911 /* 80 */ { "Rapid commit", opaque, NULL },
912 /* 81 */ { "Client Fully Qualified Domain Name", special, NULL},
913 /* 82 */ { "Agent Information Option", special, NULL},
914 /* 83 */ { "iSNS [TODO:RFC4174]", opaque, NULL },
915 /* 84 */ { "Removed/Unassigned", opaque, NULL },
916 /* 85 */ { "Novell Directory Services Servers", special, NULL},
917 /* 86 */ { "Novell Directory Services Tree Name", string, &hf_bootp_option_novell_ds_tree_name },
918 /* 87 */ { "Novell Directory Services Context", string, &hf_bootp_option_novell_ds_context },
919 /* 88 */ { "BCMCS Controller Domain Name [TODO:RFC4280]", opaque, NULL },
920 /* 89 */ { "BCMCS Controller IPv4 address [TODO:RFC4280]", opaque, NULL },
921 /* 90 */ { "Authentication", special, NULL},
922 /* 91 */ { "Client last transaction time", time_in_u_secs, &hf_bootp_option_client_last_transaction_time },
923 /* 92 */ { "Associated IP option", ipv4_list, &hf_bootp_option_associated_ip_option },
924 /* 93 */ { "Client System Architecture", val_u_short, &hf_bootp_option_client_system_architecture },
925 /* 94 */ { "Client Network Device Interface", special, NULL},
926 /* 95 */ { "LDAP [TODO:RFC3679]", opaque, NULL },
927 /* 96 */ { "Removed/Unassigend", opaque, NULL },
928 /* 97 */ { "UUID/GUID-based Client Identifier", special, NULL},
929 /* 98 */ { "Open Group's User Authentication [TODO:RFC2485]", opaque, NULL },
930 /* 99 */ { "Civic Addresses Configuration", special, NULL},
931 /* 100 */ { "PCode [TODO:RFC4833]", opaque, NULL },
932 /* 101 */ { "TCode [TODO:RFC4833]", opaque, NULL },
933 /* 102 */ { "Removed/unassigned", opaque, NULL },
934 /* 103 */ { "Removed/unassigned", opaque, NULL },
935 /* 104 */ { "Removed/unassigned", opaque, NULL },
936 /* 105 */ { "Removed/unassigned", opaque, NULL },
937 /* 106 */ { "Removed/unassigned", opaque, NULL },
938 /* 107 */ { "Removed/unassigned", opaque, NULL },
939 /* 108 */ { "Removed/Unassigend", opaque, NULL },
940 /* 109 */ { "Unassigned", opaque, NULL },
941 /* 110 */ { "Removed/Uassigend", opaque, NULL },
942 /* 111 */ { "Unassigned", opaque, NULL },
943 /* 112 */ { "NetInfo Parent Server Address", ipv4_list, &hf_bootp_option_netinfo_parent_server_address },
944 /* 113 */ { "NetInfo Parent Server Tag", string, &hf_bootp_option_netinfo_parent_server_tag },
945 /* 114 */ { "URL [TODO:RFC3679]", opaque, NULL },
946 /* 115 */ { "Removed/Unassigend", opaque, NULL },
947 /* 116 */ { "DHCP Auto-Configuration", val_u_byte, &hf_bootp_option_dhcp_auto_configuration },
948 /* 117 */ { "Name Service Search [TODO:RFC2937]", opaque, NULL },
949 /* 118 */ { "Subnet Selection Option", ipv4_list, &hf_bootp_option_subnet_selection_option },
950 /* 119 */ { "Domain Search [TODO:RFC3397]", opaque, NULL },
951 /* 120 */ { "SIP Servers [TODO:RFC3361]", opaque, NULL },
952 /* 121 */ { "Classless Static Route", special, NULL},
953 /* 122 */ { "CableLabs Client Configuration [TODO:RFC3495]", opaque, NULL },
954 /* 123 */ { "Coordinate-based Location Configuration", special, NULL},
955 /* 124 */ { "V-I Vendor Class", special, NULL},
956 /* 125 */ { "V-I Vendor-specific Information", special, NULL},
957 /* 126 */ { "Removed/Unassigned", opaque, NULL },
958 /* 127 */ { "Removed/Unassigend", opaque, NULL },
959 /* 128 */ { "DOCSIS full security server IP [TODO]", opaque, NULL },
960 /* 129 */ { "PXE - undefined (vendor specific)", opaque, NULL },
961 /* 130 */ { "PXE - undefined (vendor specific)", opaque, NULL },
962 /* 131 */ { "PXE - undefined (vendor specific)", opaque, NULL },
963 /* 132 */ { "PXE - undefined (vendor specific)", opaque, NULL },
964 /* 133 */ { "PXE - undefined (vendor specific)", opaque, NULL },
965 /* 134 */ { "PXE - undefined (vendor specific)", opaque, NULL },
966 /* 135 */ { "PXE - undefined (vendor specific)", opaque, NULL },
967 /* 136 */ { "OPTION_PANA_AGENT [TODO:RFC5192]", opaque, NULL },
968 /* 137 */ { "LoST Server Domain Name", string, &hf_bootp_option_lost_server_domain_name },
969 /* 138 */ { "CAPWAP Access Controllers", ipv4_list, &hf_bootp_option_capwap_access_controller },
970 /* 139 */ { "IPv4 Address-MoS", opaque, NULL },
971 /* 140 */ { "IPv4 FQDN-MoS", opaque, NULL },
972 /* 141 */ { "SIP UA Configuration Domains", opaque, NULL },
973 /* 142 */ { "Unassigned", opaque, NULL },
974 /* 143 */ { "Unassigned", opaque, NULL },
975 /* 144 */ { "Unassigned", opaque, NULL },
976 /* 145 */ { "Unassigned", opaque, NULL },
977 /* 146 */ { "Unassigned", opaque, NULL },
978 /* 147 */ { "Unassigned", opaque, NULL },
979 /* 148 */ { "Unassigned", opaque, NULL },
980 /* 149 */ { "Unassigned", opaque, NULL },
981 /* 150 */ { "TFTP Server Address", ipv4_list, &hf_bootp_option_tftp_server_address },
982 /* 151 */ { "Unassigned", opaque, NULL },
983 /* 152 */ { "Unassigned", opaque, NULL },
984 /* 153 */ { "Unassigned", opaque, NULL },
985 /* 154 */ { "Unassigned", opaque, NULL },
986 /* 155 */ { "Unassigned", opaque, NULL },
987 /* 156 */ { "Unassigned", opaque, NULL },
988 /* 157 */ { "Unassigned", opaque, NULL },
989 /* 158 */ { "Unassigned", opaque, NULL },
990 /* 159 */ { "Unassigned", opaque, NULL },
991 /* 160 */ { "Unassigned", opaque, NULL },
992 /* 161 */ { "Unassigned", opaque, NULL },
993 /* 162 */ { "Unassigned", opaque, NULL },
994 /* 163 */ { "Unassigned", opaque, NULL },
995 /* 164 */ { "Unassigned", opaque, NULL },
996 /* 165 */ { "Unassigned", opaque, NULL },
997 /* 166 */ { "Unassigned", opaque, NULL },
998 /* 167 */ { "Unassigned", opaque, NULL },
999 /* 168 */ { "Unassigned", opaque, NULL },
1000 /* 169 */ { "Unassigned", opaque, NULL },
1001 /* 170 */ { "Unassigned", opaque, NULL },
1002 /* 171 */ { "Unassigned", opaque, NULL },
1003 /* 172 */ { "Unassigned", opaque, NULL },
1004 /* 173 */ { "Unassigned", opaque, NULL },
1005 /* 174 */ { "Unassigned", opaque, NULL },
1006 /* 175 */ { "Etherboot", opaque, NULL },
1007 /* 176 */ { "IP Telephone", opaque, NULL },
1008 /* 177 */ { "Etherboot", opaque, NULL },
1009 /* 178 */ { "Unassigned", opaque, NULL },
1010 /* 179 */ { "Unassigned", opaque, NULL },
1011 /* 180 */ { "Unassigned", opaque, NULL },
1012 /* 181 */ { "Unassigned", opaque, NULL },
1013 /* 182 */ { "Unassigned", opaque, NULL },
1014 /* 183 */ { "Unassigned", opaque, NULL },
1015 /* 184 */ { "Unassigned", opaque, NULL },
1016 /* 185 */ { "Unassigned", opaque, NULL },
1017 /* 186 */ { "Unassigned", opaque, NULL },
1018 /* 187 */ { "Unassigned", opaque, NULL },
1019 /* 188 */ { "Unassigned", opaque, NULL },
1020 /* 189 */ { "Unassigned", opaque, NULL },
1021 /* 190 */ { "Unassigned", opaque, NULL },
1022 /* 191 */ { "Unassigned", opaque, NULL },
1023 /* 192 */ { "Unassigned", opaque, NULL },
1024 /* 193 */ { "Unassigned", opaque, NULL },
1025 /* 194 */ { "Unassigned", opaque, NULL },
1026 /* 195 */ { "Unassigned", opaque, NULL },
1027 /* 196 */ { "Unassigned", opaque, NULL },
1028 /* 197 */ { "Unassigned", opaque, NULL },
1029 /* 198 */ { "Unassigned", opaque, NULL },
1030 /* 199 */ { "Unassigned", opaque, NULL },
1031 /* 200 */ { "Unassigned", opaque, NULL },
1032 /* 201 */ { "Unassigned", opaque, NULL },
1033 /* 202 */ { "Unassigned", opaque, NULL },
1034 /* 203 */ { "Unassigned", opaque, NULL },
1035 /* 204 */ { "Unassigned", opaque, NULL },
1036 /* 205 */ { "Unassigned", opaque, NULL },
1037 /* 206 */ { "Unassigned", opaque, NULL },
1038 /* 207 */ { "Unassigned", opaque, NULL },
1039 /* 208 */ { "PXELINUX Magic", opaque, NULL },
1040 /* 209 */ { "Configuration file", opaque, NULL },
1041 /* 210 */ { "Authentication", special, NULL}, /* Path Prefix rfc5071 */
1042 /* 211 */ { "Reboot Time", opaque, NULL },
1043 /* 212 */ { "6RD", opaque, NULL },
1044 /* 213 */ { "V4 Access Domain", opaque, NULL },
1045 /* 214 */ { "Unassigned", opaque, NULL },
1046 /* 215 */ { "Unassigned", opaque, NULL },
1047 /* 216 */ { "Unassigned", opaque, NULL },
1048 /* 217 */ { "Unassigned", opaque, NULL },
1049 /* 218 */ { "Unassigned", opaque, NULL },
1050 /* 219 */ { "Unassigned", opaque, NULL },
1051 /* 220 */ { "Subnet Allocation", opaque, NULL },
1052 /* 221 */ { "Virtual Subnet Selection", opaque, NULL },
1053 /* 222 */ { "Unassigned", opaque, NULL },
1054 /* 223 */ { "Unassigned", opaque, NULL },
1055 /* 224 */ { "Private", opaque, NULL },
1056 /* 225 */ { "Private", opaque, NULL },
1057 /* 226 */ { "Private", opaque, NULL },
1058 /* 227 */ { "Private", opaque, NULL },
1059 /* 228 */ { "Private", opaque, NULL },
1060 /* 229 */ { "Private", opaque, NULL },
1061 /* 230 */ { "Private", opaque, NULL },
1062 /* 231 */ { "Private", opaque, NULL },
1063 /* 232 */ { "Private", opaque, NULL },
1064 /* 233 */ { "Private", opaque, NULL },
1065 /* 234 */ { "Private", opaque, NULL },
1066 /* 235 */ { "Private", opaque, NULL },
1067 /* 236 */ { "Private", opaque, NULL },
1068 /* 237 */ { "Private", opaque, NULL },
1069 /* 238 */ { "Private", opaque, NULL },
1070 /* 239 */ { "Private", opaque, NULL },
1071 /* 240 */ { "Private", opaque, NULL },
1072 /* 241 */ { "Private", opaque, NULL },
1073 /* 242 */ { "Private", opaque, NULL },
1074 /* 243 */ { "Private", opaque, NULL },
1075 /* 244 */ { "Private", opaque, NULL },
1076 /* 245 */ { "Private", opaque, NULL },
1077 /* 246 */ { "Private", opaque, NULL },
1078 /* 247 */ { "Private", opaque, NULL },
1079 /* 248 */ { "Private", opaque, NULL },
1080 /* 249 */ { "Private/Classless Static Route (Microsoft)", special, NULL},
1081 /* 250 */ { "Private", opaque, NULL },
1082 /* 251 */ { "Private", opaque, NULL },
1083 /* 252 */ { "Private/Proxy autodiscovery", string, &hf_bootp_option_private_proxy_autodiscovery },
1084 /* 253 */ { "Private", opaque, NULL },
1085 /* 254 */ { "Private", opaque, NULL },
1086 /* 255 */ { "End", opaque, NULL }
1089 /*-------------------------------------
1091 *-------------------------------------
1093 /* UAT entry structure. */
1097 enum field_type ftype;
1099 } uat_bootp_record_t;
1101 static uat_bootp_record_t *uat_bootp_records = NULL;
1102 static uat_t * bootp_uat = NULL;
1103 static guint num_bootp_records_uat = 0;
1105 static void* uat_bootp_record_copy_cb(void* n, const void* o, size_t siz _U_) {
1106 uat_bootp_record_t* new_record = (uat_bootp_record_t *)n;
1107 const uat_bootp_record_t* old_record = (uat_bootp_record_t *)o;
1109 if (old_record->text) {
1110 new_record->text = g_strdup(old_record->text);
1112 new_record->text = NULL;
1118 static void uat_bootp_record_update_cb(void* r, const char** err) {
1119 uat_bootp_record_t* rec = (uat_bootp_record_t *)r;
1121 if ((rec->opt == 0) || (rec->opt >=BOOTP_OPT_NUM-1))
1122 *err = ep_strdup_printf("Option must be between 1 and %d", BOOTP_OPT_NUM-2);
1125 static void uat_bootp_record_free_cb(void*r) {
1126 uat_bootp_record_t* rec = (uat_bootp_record_t *)r;
1128 if (rec->text) g_free(rec->text);
1131 UAT_DEC_CB_DEF(uat_bootp_records, opt, uat_bootp_record_t)
1132 UAT_CSTRING_CB_DEF(uat_bootp_records, text, uat_bootp_record_t)
1133 UAT_VS_DEF(uat_bootp_records, ftype, uat_bootp_record_t, 0, "string")
1136 static struct opt_info* bootp_get_opt(unsigned int idx)
1138 if(idx>=BOOTP_OPT_NUM)
1141 return &bootp_opt[idx];
1145 bootp_get_opt_text(unsigned int idx)
1147 if(idx>=BOOTP_OPT_NUM)
1149 return bootp_opt[idx].text;
1152 struct basic_types_hfs {
1160 gint* val_u_short_list;
1162 gint* time_in_s_secs;
1163 gint* time_in_u_secs;
1166 /* Handle "basic" datatypes adding to a tree */
1168 bootp_handle_basic_types(packet_info *pinfo, proto_tree *tree, proto_item *item, tvbuff_t *tvb,
1169 enum field_type ftype, int offset, int total_len,
1170 gint *hf, struct basic_types_hfs* hf_default)
1174 guint32 time_u_secs;
1180 proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1181 else if (hf_default->bytes != NULL)
1182 proto_tree_add_item(tree, *hf_default->bytes, tvb, offset, total_len, ENC_BIG_ENDIAN);
1183 consumed = total_len;
1187 if (total_len != 4) {
1188 expert_add_info_format(pinfo, item, PI_PROTOCOL,
1189 PI_ERROR, "length isn't 4");
1194 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1195 else if (hf_default->ipv4 != NULL)
1196 proto_tree_add_item(tree, *hf_default->ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1201 for (i = offset, left = total_len; left > 0; i += 4, left -= 4) {
1203 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "Option length isn't a multiple of 4");
1208 proto_tree_add_item(tree, *hf, tvb, i, 4, ENC_BIG_ENDIAN);
1209 else if (hf_default->ipv4_list != NULL)
1210 proto_tree_add_item(tree, *hf_default->ipv4_list, tvb, i, 4, ENC_BIG_ENDIAN);
1218 proto_tree_add_item(tree, *hf, tvb, offset, total_len, ENC_BIG_ENDIAN);
1219 else if (hf_default->string != NULL)
1220 proto_tree_add_item(tree, *hf_default->string, tvb, offset, total_len, ENC_BIG_ENDIAN);
1221 consumed = total_len;
1225 if (total_len != 1) {
1226 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 1");
1231 proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1232 else if (hf_default->val_boolean != NULL)
1233 proto_tree_add_item(tree, *hf_default->val_boolean, tvb, offset, 1, ENC_BIG_ENDIAN);
1238 if (total_len != 1) {
1239 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 1");
1244 proto_tree_add_item(tree, *hf, tvb, offset, 1, ENC_BIG_ENDIAN);
1245 else if (hf_default->val_u_byte != NULL)
1246 proto_tree_add_item(tree, *hf_default->val_u_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
1251 if (total_len != 2) {
1252 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 2");
1257 proto_tree_add_item(tree, *hf, tvb, offset, 2, ENC_BIG_ENDIAN);
1258 else if (hf_default->val_u_short != NULL)
1259 proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, ENC_BIG_ENDIAN);
1263 case val_u_le_short:
1264 if (total_len != 2) {
1265 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 2");
1270 proto_tree_add_item(tree, *hf, tvb, offset, 2, TRUE);
1271 else if (hf_default->val_u_short != NULL)
1272 proto_tree_add_item(tree, *hf_default->val_u_short, tvb, offset, 2, TRUE);
1276 case val_u_short_list:
1277 for (i = offset, left = total_len; left > 0; i += 2, left -= 2) {
1279 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "Option length isn't a multiple of 2");
1284 proto_tree_add_item(tree, *hf, tvb, i, 2, ENC_BIG_ENDIAN);
1285 else if (hf_default->val_u_short_list != NULL)
1286 proto_tree_add_item(tree, *hf_default->val_u_short_list, tvb, i, 2, ENC_BIG_ENDIAN);
1292 if (total_len != 4) {
1293 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 4");
1298 proto_tree_add_item(tree, *hf, tvb, offset, 4, ENC_BIG_ENDIAN);
1299 else if (hf_default->val_u_long != NULL)
1300 proto_tree_add_item(tree, *hf_default->val_u_long, tvb, offset, 4, ENC_BIG_ENDIAN);
1304 case time_in_s_secs:
1305 if (total_len != 4) {
1306 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 4");
1311 time_s_secs = (gint32) tvb_get_ntohl(tvb, offset);
1312 proto_tree_add_int_format_value(tree, *hf,
1313 tvb, offset, 4, time_s_secs, "(%ds) %s", time_s_secs, time_secs_to_str(time_s_secs));
1315 else if (hf_default->time_in_s_secs != NULL)
1316 proto_tree_add_item(tree, *hf_default->time_in_s_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1321 case time_in_u_secs:
1322 if (total_len != 4) {
1323 expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_ERROR, "length isn't 4");
1328 time_u_secs = tvb_get_ntohl(tvb, offset);
1329 proto_tree_add_uint_format_value(tree, *hf,
1330 tvb, offset, 4, time_u_secs, "(%us) %s", time_u_secs,
1331 ((time_u_secs == 0xffffffff) ? "infinity" : time_secs_to_str_unsigned(time_u_secs)));
1333 else if (hf_default->time_in_u_secs != NULL)
1334 proto_tree_add_item(tree, *hf_default->time_in_u_secs, tvb, offset, 4, ENC_BIG_ENDIAN);
1338 /* Ignore other field_types */
1345 /* Returns the number of bytes consumed by this option. */
1347 bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, int voff,
1348 int eoff, gboolean first_pass, gboolean *at_end, const char **dhcp_type_p,
1349 const guint8 **vendor_class_id_p, guint8 *overload_p)
1351 struct opt_info* opt;
1352 enum field_type ftype;
1353 guchar code = tvb_get_guint8(tvb, voff);
1356 int i, consumed, basictype_consumed;
1357 int optoff, optleft, optend;
1364 int o52voff, o52eoff;
1368 const guchar *dns_name;
1369 gboolean option_handled = TRUE;
1370 struct basic_types_hfs default_hfs = {&hf_bootp_option_value, &hf_bootp_option_value_ip_address, &hf_bootp_option_value_ip_address,
1371 &hf_bootp_option_value_stringz, &hf_bootp_option_value_boolean, &hf_bootp_option_value_8,
1372 &hf_bootp_option_value_16, &hf_bootp_option_value_16,
1373 &hf_bootp_option_value_u32, &hf_bootp_option_value_i32, &hf_bootp_option_value_u32 };
1375 /* Options whose length isn't "optlen + 2". */
1378 case 0: /* Padding */
1379 /* check how much padding we have */
1380 for (i = voff + 1; i < eoff; i++ ) {
1381 if (tvb_get_guint8(tvb, i) != 0) {
1387 if (bp_tree != NULL) {
1388 vti = proto_tree_add_uint_format_value(bp_tree, hf_bootp_option_type,
1389 tvb, voff, 1, 0, "(0) Padding");
1390 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
1391 proto_tree_add_item(v_tree, hf_bootp_option_padding, tvb, voff, i, ENC_NA);
1397 case 255: /* End Option */
1399 if (bp_tree != NULL) {
1400 vti = proto_tree_add_uint_format_value(bp_tree, hf_bootp_option_type,
1401 tvb, voff, 1, 0, "(255) End");
1402 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
1404 proto_tree_add_item(v_tree, hf_bootp_option_end_overload, tvb, voff, 1, ENC_BIG_ENDIAN);
1406 proto_tree_add_item(v_tree, hf_bootp_option_end, tvb, voff, 1, ENC_BIG_ENDIAN);
1415 * Get the length of the option, and the number of bytes it
1416 * consumes (the length doesn't include the option code or
1419 * On the first pass, check first whether we have the length
1420 * byte, so that we don't throw an exception; if we throw an
1421 * exception in the first pass, which is only checking for options
1422 * whose values we need in order to properly dissect the packet
1423 * on the second pass, we won't actually dissect the options, so
1424 * you won't be able to see which option had the problem.
1427 if (!tvb_bytes_exist(tvb, voff+1, 1)) {
1429 * We don't have the length byte; just return 1
1430 * as the number of bytes we consumed, to count
1436 optlen = tvb_get_guint8(tvb, voff+1);
1437 consumed = optlen + 2;
1440 * In the first pass, we don't put anything into the protocol
1441 * tree; we just check for some options we have to look at
1442 * in order to properly process the packet:
1444 * 52 (Overload) - we need this to properly dissect the
1445 * file and sname fields
1447 * 53 (DHCP message type) - if this is present, this is DHCP
1449 * 60 (Vendor class identifier) - we need this in order to
1450 * interpret the vendor-specific info
1452 * We also check, before fetching anything, to make sure we
1453 * have the entire item we're fetching, so that we don't throw
1457 if (tvb_bytes_exist(tvb, voff+2, consumed-2)) {
1461 *overload_p = tvb_get_guint8(tvb, voff+2);
1466 val_to_str(tvb_get_guint8(tvb, voff+2),
1468 "Unknown Message Type (0x%02x)");
1472 *vendor_class_id_p =
1473 tvb_get_ptr(tvb, voff+2, consumed-2);
1479 * We don't do anything else here.
1485 opt = bootp_get_opt(code);
1488 /* THIS SHOULD NEVER HAPPEN!!! */
1492 /* function type may be overriden and that shouldn't be a 'saved' change */
1497 vti = proto_tree_add_uint_format_value(bp_tree, hf_bootp_option_type,
1498 tvb, voff, consumed, code, "(%d) %s", code, opt->text);
1499 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
1500 proto_tree_add_item(v_tree, hf_bootp_option_length, tvb, voff+1, 1, ENC_BIG_ENDIAN);
1505 case 21: /* Policy Filter */
1506 for (i = optoff, optleft = optlen;
1507 optleft > 0; i += 8, optleft -= 8) {
1509 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't a multiple of 8");
1513 proto_tree_add_item(v_tree, hf_bootp_option_policy_filter_ip, tvb, i, 4, ENC_BIG_ENDIAN);
1514 proto_tree_add_item(v_tree, hf_bootp_option_policy_filter_subnet_mask, tvb, i+4, 4, ENC_BIG_ENDIAN);
1518 case 33: /* Static Route */
1519 for (i = optoff, optleft = optlen;
1520 optleft > 0; i += 8, optleft -= 8) {
1522 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't a multiple of 8");
1526 proto_tree_add_item(v_tree, hf_bootp_option_static_route_ip, tvb, i, 4, ENC_BIG_ENDIAN);
1527 proto_tree_add_item(v_tree, hf_bootp_option_static_route_router, tvb, i+4, 4, ENC_BIG_ENDIAN);
1531 case 43: /* Vendor-Specific Info */
1532 s_option = tvb_get_guint8(tvb, optoff);
1534 /* PXE protocol 2.1 as described in the intel specs */
1535 if (*vendor_class_id_p != NULL &&
1536 strncmp((const gchar*)*vendor_class_id_p, "PXEClient", strlen("PXEClient")) == 0) {
1537 proto_item_append_text(vti, " (PXEClient)");
1538 v_tree = proto_item_add_subtree(vti, ett_bootp_option);
1540 optend = optoff + optlen;
1541 while (optoff < optend) {
1542 optoff = dissect_vendor_pxeclient_suboption(pinfo, vti, v_tree,
1543 tvb, optoff, optend);
1545 } else if (*vendor_class_id_p != NULL &&
1546 ((strncmp((const gchar*)*vendor_class_id_p, "pktc", strlen("pktc")) == 0) ||
1547 (strncmp((const gchar*)*vendor_class_id_p, "docsis", strlen("docsis")) == 0) ||
1548 (strncmp((const gchar*)*vendor_class_id_p, "OpenCable2.0", strlen("OpenCable2.0")) == 0) ||
1549 (strncmp((const gchar*)*vendor_class_id_p, "CableHome", strlen("CableHome")) == 0))) {
1550 /* CableLabs standard - see www.cablelabs.com/projects */
1551 proto_item_append_text(vti, " (CableLabs)");
1553 optend = optoff + optlen;
1554 while (optoff < optend) {
1555 optoff = dissect_vendor_cablelabs_suboption(pinfo, vti, v_tree,
1556 tvb, optoff, optend);
1558 } else if (s_option==58 || s_option==64 || s_option==65
1559 || s_option==66 || s_option==67) {
1560 /* Note that this is a rather weak (permissive) heuristic, */
1561 /* but since it comes last, i guess this is ok. */
1562 /* Add any stronger (less permissive) heuristics before this! */
1563 /* Alcatel-Lucent DHCP Extensions */
1564 proto_item_append_text(vti, " (Alcatel-Lucent)");
1565 optend = optoff + optlen;
1566 while (optoff < optend) {
1567 optoff = dissect_vendor_alcatel_suboption(pinfo, vti, v_tree,
1568 tvb, optoff, optend);
1573 case 52: /* Option Overload */
1575 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't >= 1");
1579 byte = tvb_get_guint8(tvb, optoff);
1580 proto_tree_add_item(v_tree, *opt->phf, tvb, optoff, 1, ENC_BIG_ENDIAN);
1582 /* Just in case we find an option 52 in sname or file */
1583 if (voff > VENDOR_INFO_OFFSET && byte >= 1 && byte <= 3) {
1584 if (byte & OPT_OVERLOAD_FILE) {
1586 oti = proto_tree_add_text (bp_tree, tvb,
1587 FILE_NAME_OFFSET, FILE_NAME_LEN,
1588 "Boot file name option overload");
1589 o52voff = FILE_NAME_OFFSET;
1590 o52eoff = FILE_NAME_OFFSET + FILE_NAME_LEN;
1592 while (o52voff < o52eoff && !o52at_end) {
1593 o52voff += bootp_option(tvb, pinfo, bp_tree, o52voff,
1594 o52eoff, FALSE, &o52at_end,
1595 dhcp_type_p, vendor_class_id_p,
1600 expert_add_info_format(pinfo, oti, PI_PROTOCOL,
1601 PI_ERROR, "file overload end option missing");
1604 if (byte & OPT_OVERLOAD_SNAME) {
1606 oti = proto_tree_add_text (bp_tree, tvb,
1607 SERVER_NAME_OFFSET, SERVER_NAME_LEN,
1608 "Server host name option overload");
1609 o52voff = SERVER_NAME_OFFSET;
1610 o52eoff = SERVER_NAME_OFFSET + SERVER_NAME_LEN;
1612 while (o52voff < o52eoff && !o52at_end) {
1613 o52voff += bootp_option(tvb, pinfo, bp_tree, o52voff,
1614 o52eoff, FALSE, &o52at_end,
1615 dhcp_type_p, vendor_class_id_p,
1620 expert_add_info_format(pinfo, oti, PI_PROTOCOL,
1621 PI_ERROR, "sname overload end option missing");
1624 /* The final end option is not in overload */
1629 case 55: /* Parameter Request List */
1630 for (i = 0; i < optlen; i++) {
1631 byte = tvb_get_guint8(tvb, optoff+i);
1632 proto_tree_add_uint_format_value(v_tree, hf_bootp_option_parameter_request_list_item,
1633 tvb, optoff+i, 1, byte, "(%d) %s", byte, bootp_get_opt_text(byte));
1637 case 60: /* Vendor class identifier */
1639 * XXX - RFC 2132 says this is a string of octets;
1640 * should we check for non-printables?
1643 proto_tree_add_item(v_tree, hf_bootp_option_vendor_class_id, tvb, optoff, consumed-2, ENC_ASCII|ENC_NA);
1644 if ((tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_MTA_CAP10,
1645 (int)strlen(PACKETCABLE_MTA_CAP10)) == 0)
1647 (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_MTA_CAP15,
1648 (int)strlen(PACKETCABLE_MTA_CAP15)) == 0)
1650 (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_MTA_CAP20,
1651 (int)strlen(PACKETCABLE_MTA_CAP20)) == 0))
1653 dissect_packetcable_mta_cap(v_tree, tvb, optoff, optlen);
1655 if ((tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_CM_CAP11,
1656 (int)strlen(PACKETCABLE_CM_CAP11)) == 0)
1658 (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_CM_CAP20,
1659 (int)strlen(PACKETCABLE_CM_CAP20)) == 0 ))
1661 dissect_docsis_cm_cap(v_tree, tvb, optoff, optlen, ENC_BIG_ENDIAN);
1663 if (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_CM_CAP30,
1664 (int)strlen(PACKETCABLE_CM_CAP30)) == 0 )
1666 proto_tree_add_text(v_tree, tvb, optoff, optlen,
1667 "vendor-class-data: \"%s\"", tvb_format_stringzpad(tvb, optoff, optlen));
1671 case 61: /* Client Identifier */
1673 byte = tvb_get_guint8(tvb, optoff);
1677 /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
1678 guess that the first is the hwtype, and the last 6
1680 /* See http://www.iana.org/assignments/arp-parameters */
1681 /* RFC2132 9.14 Client-identifier has the following to say:
1682 A hardware type of 0 (zero) should be used when the value
1683 field contains an identifier other than a hardware address
1684 (e.g. a fully qualified domain name). */
1686 if (optlen == 7 && byte > 0 && byte < 48) {
1687 proto_tree_add_text(v_tree, tvb, optoff, 1,
1688 "Hardware type: %s",
1689 arphrdtype_to_str(byte,
1690 "Unknown (0x%02x)"));
1691 if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
1692 proto_tree_add_item(v_tree,
1693 hf_bootp_hw_ether_addr, tvb, optoff+1, 6,
1696 proto_tree_add_text(v_tree, tvb, optoff+1, 6,
1697 "Client hardware address: %s",
1698 tvb_arphrdaddr_to_str(tvb, optoff+1, 6, byte));
1699 } else if (optlen == 17 && byte == 0) {
1700 /* Identifier is a UUID */
1701 proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid,
1702 tvb, optoff + 1, 16, ENC_LITTLE_ENDIAN);
1703 /* From RFC 4631 paragraph 6.1 DHCPv4 Client Behavior:
1704 To send an RFC 3315-style binding identifier in a DHCPv4 'client
1705 identifier' option, the type of the 'client identifier' option is set
1707 } else if (byte == 255) {
1713 /* The type field is immediately followed by the IAID, which is
1714 an opaque 32-bit quantity */
1715 proto_tree_add_text(v_tree, tvb, optoff+1, 4,
1717 tvb_arphrdaddr_to_str(tvb, optoff+1, 4, byte));
1718 optoff = optoff + 5;
1719 duidtype = tvb_get_ntohs(tvb, optoff);
1720 proto_tree_add_text(v_tree, tvb, optoff, 2,
1721 "DUID type: %s (%u)",
1722 val_to_str(duidtype,
1723 duidtype_vals, "Unknown"),
1728 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "DUID: malformed option");
1731 hwtype=tvb_get_ntohs(tvb, optoff + 2);
1732 proto_tree_add_text(v_tree, tvb, optoff + 2, 2,
1733 "Hardware type: %s (%u)", arphrdtype_to_str(hwtype, "Unknown"),
1735 /* XXX seconds since Jan 1 2000 */
1736 proto_tree_add_text(v_tree, tvb, optoff + 4, 4,
1737 "Time: %u", tvb_get_ntohl(tvb, optoff + 4));
1739 proto_tree_add_text(v_tree, tvb, optoff + 8,
1740 optlen - 13, "Link-layer address: %s",
1741 tvb_arphrdaddr_to_str(tvb, optoff+8, optlen-13, hwtype));
1746 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "DUID: malformed option");
1749 enterprise = tvb_get_ntohl(tvb, optoff+2);
1750 proto_tree_add_text(v_tree, tvb, optoff + 2, 4,
1751 "Enterprise-number: %s (%u)",
1752 val_to_str_ext_const( enterprise, &sminmpec_values_ext, "Unknown"),
1755 buf = tvb_bytes_to_str(tvb, optoff + 6, optlen - 11);
1756 proto_tree_add_text(v_tree, tvb, optoff + 6,
1757 optlen - 11, "identifier: %s", buf);
1762 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "DUID: malformed option");
1765 hwtype=tvb_get_ntohs(tvb, optoff + 2);
1766 proto_tree_add_text(v_tree, tvb, optoff + 2, 2,
1767 "Hardware type: %s (%u)",
1768 arphrdtype_to_str(hwtype, "Unknown"),
1771 proto_tree_add_text(v_tree, tvb, optoff + 4,
1772 optlen - 9, "Link-layer address: %s",
1773 tvb_arphrdaddr_to_str(tvb, optoff+4, optlen-9, hwtype));
1778 /* otherwise, it's opaque data */
1782 case 97: /* Client Identifier (UUID) */
1784 byte = tvb_get_guint8(tvb, optoff);
1788 /* We *MAY* use hwtype/hwaddr. If we have 7 bytes, I'll
1789 guess that the first is the hwtype, and the last 6
1791 /* See http://www.iana.org/assignments/arp-parameters */
1792 /* RFC2132 9.14 Client-identifier has the following to say:
1793 A hardware type of 0 (zero) should be used when the value
1794 field contains an identifier other than a hardware address
1795 (e.g. a fully qualified domain name). */
1797 if (optlen == 7 && byte > 0 && byte < 48) {
1798 proto_tree_add_text(v_tree, tvb, optoff, 1,
1799 "Hardware type: %s",
1800 arphrdtype_to_str(byte,
1801 "Unknown (0x%02x)"));
1802 if (byte == ARPHRD_ETHER || byte == ARPHRD_IEEE802)
1803 proto_tree_add_item(v_tree,
1804 hf_bootp_hw_ether_addr, tvb, optoff+1, 6,
1807 proto_tree_add_text(v_tree, tvb, optoff+1, 6,
1808 "Client hardware address: %s",
1809 tvb_arphrdaddr_to_str(tvb, optoff+1, 6, byte));
1810 } else if (optlen == 17 && byte == 0) {
1811 /* Identifier is a UUID */
1812 proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid,
1813 tvb, optoff + 1, 16, ENC_LITTLE_ENDIAN);
1815 /* otherwise, it's opaque data */
1819 case 63: /* NetWare/IP options (RFC 2242) */
1821 optend = optoff + optlen;
1822 while (optoff < optend)
1823 optoff = dissect_netware_ip_suboption(pinfo, vti, v_tree, tvb, optoff, optend);
1826 case 78: /* SLP Directory Agent Option RFC2610 Added by Greg Morris (gmorris@novell.com)*/
1828 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't >= 1");
1832 byte = tvb_get_guint8(tvb, optoff);
1833 proto_tree_add_item(v_tree, hf_bootp_option_slp_directory_agent_value, tvb, optoff, 1, ENC_BIG_ENDIAN);
1843 for (i = optoff; optleft > 0; i += 4, optleft -= 4) {
1845 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't a multiple of 4");
1849 proto_tree_add_item(v_tree, hf_bootp_option_slp_directory_agent_slpda_address, tvb, i, 4, ENC_BIG_ENDIAN);
1853 case 79: /* SLP Service Scope Option RFC2610 Added by Greg Morris (gmorris@novell.com)*/
1854 byte = tvb_get_guint8(tvb, optoff);
1855 proto_tree_add_item(v_tree, hf_bootp_option_slp_service_scope_value, tvb, optoff, 1, ENC_BIG_ENDIAN);
1858 optleft = optlen - 1;
1859 proto_tree_add_item(v_tree, hf_bootp_option_slp_service_scope_string, tvb, optoff, optleft, ENC_ASCII|ENC_NA);
1862 case 81: /* Client Fully Qualified Domain Name */
1864 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't >= 3");
1867 fqdn_flags = tvb_get_guint8(tvb, optoff);
1868 proto_tree_add_text(v_tree, tvb, optoff, 1, "Flags: 0x%02x", fqdn_flags);
1869 proto_tree_add_item(v_tree, hf_bootp_fqdn_mbz, tvb, optoff, 1, ENC_BIG_ENDIAN);
1870 proto_tree_add_item(v_tree, hf_bootp_fqdn_n, tvb, optoff, 1, ENC_BIG_ENDIAN);
1871 proto_tree_add_item(v_tree, hf_bootp_fqdn_e, tvb, optoff, 1, ENC_BIG_ENDIAN);
1872 proto_tree_add_item(v_tree, hf_bootp_fqdn_o, tvb, optoff, 1, ENC_BIG_ENDIAN);
1873 proto_tree_add_item(v_tree, hf_bootp_fqdn_s, tvb, optoff, 1, ENC_BIG_ENDIAN);
1874 /* XXX: use code from packet-dns for return code decoding */
1875 proto_tree_add_item(v_tree, hf_bootp_fqdn_rcode1, tvb, optoff+1, 1, ENC_BIG_ENDIAN);
1876 /* XXX: use code from packet-dns for return code decoding */
1877 proto_tree_add_item(v_tree, hf_bootp_fqdn_rcode2, tvb, optoff+2, 1, ENC_BIG_ENDIAN);
1879 if (fqdn_flags & F_FQDN_E) {
1880 get_dns_name(tvb, optoff+3, optlen-3, optoff+3, &dns_name);
1881 proto_tree_add_string(v_tree, hf_bootp_fqdn_name,
1882 tvb, optoff+3, optlen-3, dns_name);
1884 proto_tree_add_item(v_tree, hf_bootp_fqdn_asciiname,
1885 tvb, optoff+3, optlen-3, ENC_ASCII|ENC_NA);
1890 case 82: /* Relay Agent Information Option */
1891 optend = optoff + optlen;
1892 while (optoff < optend)
1893 optoff = bootp_dhcp_decode_agent_info(pinfo, vti, v_tree, tvb, optoff, optend);
1896 case 85: /* Novell Servers (RFC 2241) */
1897 /* Option 85 can be sent as a string */
1898 /* Added by Greg Morris (gmorris[AT]novell.com) */
1899 if (novell_string) {
1900 proto_tree_add_item(v_tree, hf_bootp_option_novell_dss_string, tvb, optoff, optlen, ENC_ASCII|ENC_NA);
1903 for (i = optoff, optleft = optlen; optleft > 0;
1904 i += 4, optleft -= 4) {
1906 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't a multiple of 4");
1910 proto_tree_add_item(v_tree, hf_bootp_option_novell_dss_ip, tvb, i, 4, ENC_BIG_ENDIAN);
1915 case 94: { /* Client network interface identifier */
1918 id_type = tvb_get_guint8(tvb, optoff);
1920 if (id_type == 0x01) {
1921 proto_tree_add_item(v_tree, hf_bootp_option_client_network_id_major_ver,
1922 tvb, optoff + 1, 1, ENC_LITTLE_ENDIAN);
1923 proto_tree_add_item(v_tree, hf_bootp_option_client_network_id_minor_ver,
1924 tvb, optoff + 2, 1, ENC_LITTLE_ENDIAN);
1930 case 90: /* DHCP Authentication */
1931 case 210: /* Was this used for authentication at one time? */
1933 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't >= 11");
1937 protocol = tvb_get_guint8(tvb, optoff);
1939 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_protocol, tvb, optoff, 1, ENC_BIG_ENDIAN);
1943 algorithm = tvb_get_guint8(tvb, optoff);
1946 case AUTHEN_PROTO_DELAYED_AUTHEN:
1947 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_alg_delay, tvb, optoff, 1, ENC_BIG_ENDIAN);
1951 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_algorithm, tvb, optoff, 1, ENC_BIG_ENDIAN);
1957 rdm = tvb_get_guint8(tvb, optoff);
1958 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_rdm, tvb, optoff, 1, ENC_BIG_ENDIAN);
1964 case AUTHEN_RDM_MONOTONIC_COUNTER:
1965 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_rdm_replay_detection, tvb, optoff, 8, ENC_BIG_ENDIAN);
1969 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_rdm_rdv, tvb, optoff, 8, ENC_ASCII|ENC_NA);
1977 case AUTHEN_PROTO_DELAYED_AUTHEN:
1978 switch (algorithm) {
1980 case AUTHEN_DELAYED_ALGO_HMAC_MD5:
1981 if (*dhcp_type_p && !strcmp(*dhcp_type_p, OPT53_DISCOVER)) {
1982 /* Discover has no Secret ID nor HMAC MD5 Hash */
1986 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't >= 31");
1990 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_secret_id, tvb, optoff, 4, ENC_BIG_ENDIAN);
1993 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_hmac_md5_hash, tvb, optoff, 16, ENC_ASCII|ENC_NA);
2001 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_information, tvb, optoff, optleft, ENC_ASCII|ENC_NA);
2010 proto_tree_add_item(v_tree, hf_bootp_option_dhcp_authentication_information, tvb, optoff, optleft, ENC_ASCII|ENC_NA);
2015 case 99: /* civic location (RFC 4776) */
2020 proto_tree_add_item(v_tree, hf_bootp_option_civic_location_what, tvb, optoff, 1, ENC_BIG_ENDIAN);
2021 proto_tree_add_item(v_tree, hf_bootp_option_civic_location_country, tvb, optoff+1, 2, ENC_ASCII|ENC_NA);
2022 optleft = optleft - 3;
2023 optoff = optoff + 3;
2025 while (optleft >= 2)
2027 int calength = tvb_get_guint8(tvb, optoff+1);
2028 proto_tree_add_item(v_tree, hf_bootp_option_civic_location_ca_type, tvb, optoff, 1, ENC_BIG_ENDIAN);
2029 proto_tree_add_item(v_tree, hf_bootp_option_civic_location_ca_length, tvb, optoff+1, 1, ENC_BIG_ENDIAN);
2037 if (optleft >= calength)
2039 proto_tree_add_item(v_tree, hf_bootp_option_civic_location_ca_value, tvb, optoff, calength, ENC_ASCII|ENC_NA);
2041 optoff = optoff + calength;
2042 optleft = optleft - calength;
2047 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Error with CAType");
2053 case 121: /* Classless Static Route */
2054 case 249: { /* Classless Static Route (Microsoft) */
2055 int mask_width, significant_octets;
2056 optend = optoff + optlen;
2057 /* minimum length is 5 bytes */
2059 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length < 5 bytes");
2062 while (optoff < optend) {
2063 mask_width = tvb_get_guint8(tvb, optoff);
2064 /* mask_width <= 32 */
2065 if (mask_width > 32) {
2066 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Mask width (%d) > 32", mask_width);
2069 significant_octets = (mask_width + 7) / 8;
2070 vti = proto_tree_add_text(v_tree, tvb, optoff,
2071 1 + significant_octets + 4,
2072 "Subnet/MaskWidth-Router: ");
2074 /* significant octets + router(4) */
2075 if (optend < optoff + significant_octets + 4) {
2076 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Remaining length (%d) < %d bytes", optend - optoff, significant_octets + 4);
2080 proto_item_append_text(vti, "default");
2082 for(i = 0 ; i < significant_octets ; i++) {
2084 proto_item_append_text(vti, ".");
2085 byte = tvb_get_guint8(tvb, optoff++);
2086 proto_item_append_text(vti, "%d", byte);
2088 for(i = significant_octets ; i < 4 ; i++)
2089 proto_item_append_text(vti, ".0");
2090 proto_item_append_text(vti, "/%d", mask_width);
2092 proto_item_append_text(vti, "-%s", tvb_ip_to_str(tvb, optoff));
2098 case 123: /* coordinate based location RFC 3825 or CableLabs DSS_ID */
2101 unsigned char lci[16];
2102 struct rfc3825_location_fixpoint_t location_fp;
2103 struct rfc3825_location_decimal_t location;
2105 for (c=0; c < 16;c++)
2106 lci[c] = (unsigned char) tvb_get_guint8(tvb, optoff + c);
2108 /* convert lci encoding into fixpoint location */
2109 rfc3825_lci_to_fixpoint(lci, &location_fp);
2111 /* convert location from decimal to fixpoint */
2112 i = rfc3825_fixpoint_to_decimal(&location_fp, &location);
2114 if (i != RFC3825_NOERROR) {
2115 proto_tree_add_text(v_tree, tvb, optoff, optlen, "Error: %s", val_to_str(i, rfc3825_error_types, "Unknown"));
2117 proto_tree_add_text(v_tree, tvb, optoff, 5, "Latitude: %15.10f", location.latitude);
2118 proto_tree_add_text(v_tree, tvb, optoff+5, 5, "Longitude: %15.10f", location.longitude);
2119 proto_tree_add_text(v_tree, tvb, optoff, 1, "Latitude resolution: %15.10f", location.latitude_res);
2120 proto_tree_add_text(v_tree, tvb, optoff+5, 1, "Longitude resolution: %15.10f", location.longitude_res);
2121 proto_tree_add_text(v_tree, tvb, optoff+12, 4, "Altitude: %15.10f", location.altitude);
2122 proto_tree_add_text(v_tree, tvb, optoff+10, 2, "Altitude resolution: %15.10f", location.altitude_res);
2123 proto_tree_add_text(v_tree, tvb, optoff+10, 1, "Altitude type: %s (%d)", val_to_str(location.altitude_type, altitude_type_values, "Unknown"), location.altitude_type);
2124 proto_tree_add_text(v_tree, tvb, optoff+15, 1, "Map Datum: %s (%d)", val_to_str(location.datum_type, map_datum_type_values, "Unknown"), location.datum_type);
2126 } else if (optlen < 69) { /* CableLabs DSS_ID */
2128 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id_option, tvb, optoff, 1, ENC_BIG_ENDIAN);
2129 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id_len, tvb, optoff+1, 1, ENC_BIG_ENDIAN);
2130 s_len = tvb_get_guint8(tvb, optoff+1);
2131 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id, tvb, optoff+2, s_len, ENC_ASCII|ENC_NA);
2133 if (optlen > s_len+2) { /* Second DSS_ID*/
2135 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id_option, tvb, optoff+2+s_len, 1, ENC_BIG_ENDIAN);
2136 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id_len, tvb, optoff+1+2+s_len, 1, ENC_BIG_ENDIAN);
2137 s_len = tvb_get_guint8(tvb, optoff+1+2+s_len);
2138 proto_tree_add_item(v_tree, hf_bootp_option_cl_dss_id, tvb, optoff+2+2+s_len, s_len, ENC_ASCII|ENC_NA);
2141 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Invalid length of DHCP option!");
2145 case 124: { /* V-I Vendor Class */
2149 /* CableLab specific */
2150 proto_tree_add_item(v_tree, hf_bootp_option_vi_class_cl_address_mode, tvb, optoff, optlen, ENC_BIG_ENDIAN);
2154 optend = optoff + optlen;
2157 while (optleft > 0) {
2160 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Vendor Class: malformed option");
2164 proto_tree_add_item(v_tree, hf_bootp_option_vi_class_enterprise, tvb, optoff, 4, ENC_BIG_ENDIAN);
2165 proto_tree_add_item(v_tree, hf_bootp_option_vi_class_data_length, tvb, optoff, 1, ENC_BIG_ENDIAN);
2166 data_len = tvb_get_guint8(tvb, optoff + 4);
2171 proto_tree_add_item(v_tree, hf_bootp_option_vi_class_data, tvb, optoff, data_len, ENC_ASCII|ENC_NA);
2173 /* look for next enterprise number */
2175 optleft -= data_len;
2180 case 125: { /* V-I Vendor-specific Information */
2183 int s_option_len = 0;
2184 proto_tree *e_tree = 0;
2186 optend = optoff + optlen;
2189 while (optleft > 0) {
2192 expert_add_info_format(pinfo, vti, PI_PROTOCOL,
2193 PI_ERROR, "Vendor-specific Information: malformed option");
2197 enterprise = tvb_get_ntohl(tvb, optoff);
2198 vti = proto_tree_add_item(v_tree, hf_bootp_option125_enterprise, tvb, optoff, 4, ENC_BIG_ENDIAN);
2200 s_option_len = tvb_get_guint8(tvb, optoff + 4);
2205 /* Handle DSL Forum TR-111 Option 125 */
2206 switch (enterprise) {
2208 case 3561: /* ADSL Forum */
2209 s_end = optoff + s_option_len;
2210 if ( s_end > optend ) {
2211 expert_add_info_format(pinfo, vti, PI_PROTOCOL,
2212 PI_ERROR, "no room left in option for enterprise %u data", enterprise);
2216 e_tree = proto_item_add_subtree(vti, ett_bootp_option);
2217 while (optoff < s_end) {
2219 optoff = dissect_vendor_tr111_suboption(pinfo, vti, e_tree, tvb, optoff, s_end);
2223 case 4491: /* CableLab */
2224 s_end = optoff + s_option_len;
2225 if ( s_end > optend ) {
2226 expert_add_info_format(pinfo, vti, PI_PROTOCOL,
2227 PI_ERROR, "no room left in option for enterprise %u data", enterprise);
2231 e_tree = proto_item_add_subtree(vti, ett_bootp_option);
2232 while (optoff < s_end) {
2233 optoff = dissect_vendor_cl_suboption(pinfo, vti, e_tree, tvb, optoff, s_end);
2238 /* skip over the data and look for next enterprise number */
2239 optoff += s_option_len;
2242 optleft -= s_option_len;
2247 case 212: { /* 6RD option (RFC 5969) */
2249 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "6RD: malformed option");
2253 proto_tree_add_item(v_tree, hf_bootp_option_6RD_ipv4_mask_len, tvb, optoff, 1, ENC_BIG_ENDIAN);
2254 proto_tree_add_item(v_tree, hf_bootp_option_6RD_prefix_len, tvb, optoff+1, 1, ENC_BIG_ENDIAN);
2255 proto_tree_add_item(v_tree, hf_bootp_option_6RD_prefix, tvb, optoff+2, 16, ENC_NA);
2256 proto_tree_add_item(v_tree, hf_bootp_option_6RD_border_relay_ip, tvb, optoff+18, 4, ENC_BIG_ENDIAN);
2258 /* More Border Relay IPv4 addresses included */
2261 for (i = optoff, optleft = optlen - 22; optleft > 0; i += 4, optleft -= 4) {
2263 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Border Relay length isn't a multiple of 4");
2267 proto_tree_add_item(v_tree, hf_bootp_option_6RD_border_relay_ip, tvb, i, 4, ENC_BIG_ENDIAN);
2273 default: /* not special */
2274 /* The PacketCable CCC option number can vary. If this is a CCC option,
2275 handle it as a special.
2277 if (code == pkt_ccc_option) {
2279 proto_item_append_text(vti,
2280 "CableLabs Client Configuration (%d bytes)",
2282 optend = optoff + optlen;
2283 while (optoff < optend) {
2284 switch (pkt_ccc_protocol_version) {
2286 case PACKETCABLE_CCC_I05:
2287 optoff = dissect_packetcable_i05_ccc(pinfo, vti, v_tree, tvb, optoff, optend);
2289 case PACKETCABLE_CCC_DRAFT5:
2290 case PACKETCABLE_CCC_RFC_3495:
2291 optoff = dissect_packetcable_ietf_ccc(pinfo, vti, v_tree, tvb, optoff, optend, pkt_ccc_protocol_version);
2293 default: /* XXX Should we do something here? */
2298 option_handled = FALSE;
2304 basictype_consumed = bootp_handle_basic_types(pinfo, v_tree, vti, tvb, ftype,
2305 optoff, optlen, opt->phf, &default_hfs);
2307 if ((basictype_consumed == 0) && (option_handled == FALSE) &&
2308 (opt->phf == NULL) && (optlen > 0)) {
2309 proto_tree_add_item(v_tree, hf_bootp_option_value, tvb, voff+2, optlen, ENC_NA);
2315 static const value_string option82_suboption_vals[] = {
2317 { 1, "Agent Circuit ID" },
2318 { 2, "Agent Remote ID" },
2320 { 4, "DOCSIS Device Class" },
2321 { 5, "Link selection" },
2322 { 6, "Subscriber ID" },
2323 { 7, "RADIUS Attributes" },
2324 { 8, "Authentication" },
2325 { 9, "Vendor-Specific Information" },
2327 { 11, "Server ID Override" },
2332 bootp_dhcp_decode_agent_info(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree, tvbuff_t *tvb, int optoff,
2335 int suboptoff = optoff;
2336 guint8 subopt, vs_opt, vs_len;
2337 int subopt_len, datalen;
2340 proto_tree *o82_v_tree, *o82_9_tree;
2341 guint8 tag, tag_len;
2342 struct basic_types_hfs default_hfs = {&hf_bootp_option82_value, &hf_bootp_option82_value_ip_address, &hf_bootp_option82_value_ip_address,
2343 &hf_bootp_option82_value_stringz, NULL, &hf_bootp_option82_value_8,
2344 NULL, NULL, &hf_bootp_option82_value_32, NULL, NULL};
2346 static struct opt_info o82_opt[]= {
2347 /* 0 */ {"nop", bytes, &hf_bootp_option82_padding}, /* dummy */
2348 /* 1 */ {"Agent Circuit ID", bytes, &hf_bootp_option82_agent_circuit_id}, /* [RFC3046] */
2349 /* 2 */ {"Agent Remote ID", bytes, &hf_bootp_option82_agent_remote_id}, /* [RFC3046] */
2350 /* 3 */ {"Reserved", bytes, &hf_bootp_option82_reserved},
2351 /* 4 */ {"DOCSIS Device Class", val_u_long, &hf_bootp_option82_docsis_device_class}, /* [RFC3256] */
2352 /* 5 */ {"Link selection", ipv4, &hf_bootp_option82_link_selection}, /* [RFC3527] */
2353 /* 6 */ {"Subscriber ID", string, &hf_bootp_option82_subscriber_id}, /* [RFC3993] */ /***** CHECK STRING TYPE */
2354 /* 7 */ {"RADIUS Attributes", bytes, &hf_bootp_option82_radius_attributes}, /* [RFC4014] */
2355 /* 8 */ {"Authentication", bytes, &hf_bootp_option82_authentication}, /* [RFC4030] */
2356 /* 9 */ {"Vendor-Specific Information", special, &hf_bootp_option82_vi}, /* [RFC 4243] */
2357 /* 10 */ {"Flags", val_u_byte, &hf_bootp_option82_flags}, /* [RFC5010] */
2358 /* 11 */ {"Server ID Override", ipv4, &hf_bootp_option82_server_id_override}, /* [RFC 5107] */
2361 subopt = tvb_get_guint8(tvb, optoff);
2364 if (suboptoff >= optend) {
2365 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
2366 "Suboption %d: no room left in option for suboption length", subopt);
2370 subopt_len = tvb_get_guint8(tvb, suboptoff);
2371 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option82_suboption,
2372 tvb, optoff, subopt_len+2, subopt, "(%d) %s", subopt, val_to_str(subopt, option82_suboption_vals, "Unknown"));
2374 o82_v_tree = proto_item_add_subtree(vti, ett_bootp_option82_suboption);
2375 proto_tree_add_item(o82_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2378 if (suboptoff+subopt_len > optend) {
2379 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
2380 "Suboption %d: no room left in option for suboption value", subopt);
2384 if ( (subopt < 1 ) || (subopt >= array_length(o82_opt)) ) {
2385 proto_tree_add_item(o82_v_tree, hf_bootp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
2386 } else if (o82_opt[subopt].ftype == special) {
2390 while (suboptoff < optend) {
2391 enterprise = tvb_get_ntohl(tvb, suboptoff);
2392 vti = proto_tree_add_item(o82_v_tree, hf_bootp_option82_vi_enterprise, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
2395 o82_9_tree = proto_item_add_subtree(vti, ett_bootp_option82_suboption9);
2396 datalen = tvb_get_guint8(tvb, suboptoff);
2397 proto_tree_add_item(o82_9_tree, hf_bootp_option82_vi_data_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2400 switch (enterprise) {
2401 case 4491: /* CableLab */
2402 vs_opt = tvb_get_guint8(tvb, suboptoff);
2403 proto_tree_add_item(o82_9_tree, hf_bootp_option82_vi_cl_option, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2405 vs_len = tvb_get_guint8(tvb, suboptoff);
2406 proto_tree_add_item(o82_9_tree, hf_bootp_option82_vi_cl_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2413 tag = tvb_get_guint8(tvb, suboptoff);
2414 proto_tree_add_item(o82_9_tree, hf_bootp_option82_vi_cl_tag, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2415 tag_len = tvb_get_guint8(tvb, suboptoff+1);
2416 proto_tree_add_item(o82_9_tree, hf_bootp_option82_vi_cl_tag_length, tvb, suboptoff+1, 1, ENC_BIG_ENDIAN);
2419 proto_tree_add_uint_format_value(o82_9_tree, hf_bootp_option82_vi_cl_docsis_version,
2420 tvb, suboptoff, 2, 0, "%d.%d",
2421 tvb_get_guint8(tvb, suboptoff), tvb_get_guint8(tvb, suboptoff+1));
2424 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
2425 "Unknown tag %d (%d bytes)", tag, tag_len);
2426 suboptoff += tag_len;
2429 suboptoff += vs_len;
2434 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
2435 "Invalid suboption %d (%d bytes)", vs_opt, vs_len);
2436 suboptoff += vs_len;
2441 proto_tree_add_item(o82_v_tree, hf_bootp_option82_value, tvb, suboptoff, datalen, ENC_NA);
2442 suboptoff += datalen;
2448 if (o82_opt[subopt].phf != NULL)
2449 proto_tree_add_item(o82_v_tree, *o82_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
2451 proto_tree_add_item(o82_v_tree, hf_bootp_option82_value, tvb, suboptoff, subopt_len, ENC_NA);
2456 if (bootp_handle_basic_types(pinfo, o82_v_tree, vti, tvb, o82_opt[subopt].ftype,
2457 suboptoff, subopt_len, o82_opt[subopt].phf, &default_hfs) == 0) {
2458 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler %d", subopt);
2462 optoff += (subopt_len + 2);
2466 static const value_string option43_pxeclient_suboption_vals[] = {
2468 { 1, "PXE mtftp IP" },
2469 { 2, "PXE mtftp client port" },
2470 { 3, "PXE mtftp server port" },
2471 { 4, "PXE mtftp timeout" },
2472 { 5, "PXE mtftp delay" },
2473 { 6, "PXE discovery control" },
2474 { 7, "PXE multicast address" },
2475 { 8, "PXE boot servers" },
2476 { 9, "PXE boot menu" },
2477 { 10, "PXE menu prompt" },
2478 { 11, "PXE multicast address alloc", },
2479 { 12, "PXE credential types" },
2480 { 71, "PXE boot item" },
2486 dissect_vendor_pxeclient_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
2487 tvbuff_t *tvb, int optoff, int optend)
2489 int suboptoff = optoff;
2492 proto_tree *o43pxeclient_v_tree;
2494 struct basic_types_hfs default_hfs = {NULL, &hf_bootp_option43_value_ip_address, &hf_bootp_option43_value_ip_address,
2495 NULL, NULL, &hf_bootp_option43_value_8,
2496 NULL, NULL, NULL, NULL, NULL};
2498 static struct opt_info o43pxeclient_opt[]= {
2499 /* 0 */ {"nop", special, &hf_bootp_option43_pxeclient_padding}, /* dummy */
2500 /* 1 */ {"PXE mtftp IP", ipv4_list, &hf_bootp_option43_pxeclient_mtftp_ip},
2501 /* 2 */ {"PXE mtftp client port", val_u_le_short, &hf_bootp_option43_pxeclient_mtftp_client_port},
2502 /* 3 */ {"PXE mtftp server port",val_u_le_short, &hf_bootp_option43_pxeclient_mtftp_server_port},
2503 /* 4 */ {"PXE mtftp timeout", val_u_byte, &hf_bootp_option43_pxeclient_mtftp_timeout},
2504 /* 5 */ {"PXE mtftp delay", val_u_byte, &hf_bootp_option43_pxeclient_mtftp_delay},
2505 /* 6 */ {"PXE discovery control", val_u_byte, &hf_bootp_option43_pxeclient_discovery_control},
2507 * Correct: b0 (lsb): disable broadcast discovery
2508 * b1: disable multicast discovery
2509 * b2: only use/accept servers in boot servers
2510 * b3: download bootfile without prompt/menu/disc
2512 /* 7 */ {"PXE multicast address", ipv4_list, &hf_bootp_option43_pxeclient_multicast_address},
2513 /* 8 */ {"PXE boot servers", special, &hf_bootp_option43_pxeclient_boot_servers},
2514 /* 9 */ {"PXE boot menu", special, &hf_bootp_option43_pxeclient_boot_menu},
2515 /* 10 */ {"PXE menu prompt", special, &hf_bootp_option43_pxeclient_menu_prompt},
2516 /* 11 */ {"PXE multicast address alloc", special, &hf_bootp_option43_pxeclient_multicast_address_alloc},
2517 /* 12 */ {"PXE credential types", special, &hf_bootp_option43_pxeclient_credential_types}
2518 /* 71 {"PXE boot item", bytes, &hf_bootp_option43_pxeclient_boot_item}, */
2519 /* 255 {"PXE end options", special, &hf_bootp_option43_pxeclient_end} */
2522 subopt = tvb_get_guint8(tvb, optoff);
2526 proto_tree_add_item(v_tree, hf_bootp_option43_pxeclient_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
2528 } else if (subopt == 255) { /* End Option */
2529 proto_tree_add_item(v_tree, hf_bootp_option43_pxeclient_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
2530 /* Make sure we skip any junk left this option */
2534 if (suboptoff >= optend) {
2535 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
2536 "Suboption %d: no room left in option for suboption length", subopt);
2540 subopt_len = tvb_get_guint8(tvb, suboptoff);
2541 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_pxeclient_suboption,
2542 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
2543 subopt, val_to_str(subopt, option43_pxeclient_suboption_vals, "Unknown"));
2545 o43pxeclient_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
2546 proto_tree_add_item(o43pxeclient_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2549 if ( subopt == 71 ) { /* 71 {"PXE boot item", special} */
2551 /* I may need to decode that properly one day */
2552 proto_tree_add_item(o43pxeclient_v_tree, hf_bootp_option43_pxeclient_boot_item, tvb, suboptoff, subopt_len, ENC_NA);
2553 } else if ((subopt < 1) || (subopt >= array_length(o43pxeclient_opt))) {
2554 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Unknown suboption %d (%d bytes)", subopt, subopt_len);
2555 } else if (o43pxeclient_opt[subopt].ftype == special) {
2556 /* I may need to decode that properly one day */
2557 if (o43pxeclient_opt[subopt].phf != NULL)
2558 proto_tree_add_item(o43pxeclient_v_tree, *o43pxeclient_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
2560 proto_tree_add_item(o43pxeclient_v_tree, hf_bootp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2562 if (bootp_handle_basic_types(pinfo, o43pxeclient_v_tree, vti, tvb, o43pxeclient_opt[subopt].ftype,
2563 suboptoff, subopt_len, o43pxeclient_opt[subopt].phf, &default_hfs) == 0)
2565 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler %d", subopt);
2569 optoff += (subopt_len + 2);
2573 /* RFC3825Decoder: http://www.enum.at/rfc3825encoder.529.0.html */
2575 rfc3825_lci_to_fixpoint(const unsigned char lci[16], struct rfc3825_location_fixpoint_t *fixpoint)
2577 fixpoint->latitude_res = (lci[0]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
2578 if (lci[0] & 2) { /* LSB<<1 contains the sign of the latitude */
2579 /* Latitude is negative, expand two's complement */
2580 fixpoint->latitude = (((gint64)lci[0] & 3)<<32) | ((gint64)lci[1]<<24) |
2581 ((gint64)lci[2]<<16) | ((gint64)lci[3]<<8) |
2582 (gint64)lci[4] | ((gint64)0x3FFFFFFF<<34);
2585 /* Latitude is positive */
2586 fixpoint->latitude = (((gint64)lci[0] & 3)<<32) | ((gint64)lci[1]<<24) |
2587 ((gint64)lci[2]<<16) | ((gint64)lci[3]<<8) |
2590 fixpoint->longitude_res = (lci[5]>>2) & 0x3F; /* make sure that right-shift does not copy sign bit */
2591 if (lci[5] & 2) { /* LSB<<1 contains the sign of the latitude */
2592 /* Longitude is negative, expand two's complement */
2593 fixpoint->longitude = (((gint64)lci[5] & 3)<<32) | ((gint64)lci[6]<<24) |
2594 ((gint64)lci[7]<<16) | ((gint64)lci[8]<<8) |
2595 (gint64)lci[9] | ((gint64)0x3FFFFFFF<<34);
2598 /* Longitude is positive */
2599 fixpoint->longitude = (((gint64)lci[5] & 3)<<32) | ((gint64)lci[6]<<24) |
2600 ((gint64)lci[7]<<16) | ((gint64)lci[8]<<8) |
2603 fixpoint->altitude_type = (lci[10]>>4) & 0x0F; /* make sure that right-shift does not copy sign bit */
2604 fixpoint->altitude_res = ((lci[10] & 0x0F) << 2) | ((lci[11]>>6) & 0x03);
2605 if (lci[11] & 0x20) { /* LSB<<1 contains the sign of the latitude */
2606 /* Altitude is negative, expand two's complement */
2607 fixpoint->altitude = (((gint32)lci[11] & 0x3F)<<24) | ((gint32)lci[12]<<16) |
2608 ((gint32)lci[13]<<8) | ((gint32)lci[14]) |
2612 /* Altitudee is positive */
2613 fixpoint->altitude = (((gint32)lci[11] & 0x3F)<<24) | ((gint32)lci[12]<<16) |
2614 ((gint32)lci[13]<<8) | ((gint32)lci[14]);
2617 fixpoint->datum_type = lci[15];
2621 /* RFC3825Decoder: http://www.enum.at/rfc3825encoder.529.0.html */
2623 rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct rfc3825_location_decimal_t *decimal)
2626 decimal->latitude = (double) fixpoint->latitude / (1 << 25);
2627 if ((decimal->latitude > 90) || (decimal->latitude < -90)) {
2628 return RFC3825_LATITUDE_OUTOFRANGE;
2631 /* Latitude Uncertainty */
2632 if (fixpoint->latitude_res > 34) {
2633 return RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE;
2635 if (fixpoint->latitude_res > 8 ) {
2636 decimal->latitude_res = (double) 1 / (1 << (fixpoint->latitude_res - 8));
2638 decimal->latitude_res = 1 << (8 - fixpoint->latitude_res);
2642 decimal->longitude = (double) fixpoint->longitude / (1 << 25);
2643 if ((decimal->longitude > 180) || (decimal->longitude < -180)) {
2644 return RFC3825_LONGITUDE_OUTOFRANGE;
2647 /* Longitude Uncertainty */
2648 if (fixpoint->longitude_res > 34) {
2649 return RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE;
2651 if (fixpoint->longitude_res > 8 ) {
2652 decimal->longitude_res = (double) 1 / (1 << (fixpoint->longitude_res - 8));
2654 decimal->longitude_res = 1 << (8 - fixpoint->longitude_res);
2658 decimal->altitude_type = fixpoint->altitude_type;
2659 decimal->altitude = 0;
2660 decimal->altitude_res = 0;
2662 if (decimal->altitude_type == 0) { /* Unknown */
2663 } else if (decimal->altitude_type == 1) { /* Meters */
2665 decimal->altitude = (double) fixpoint->altitude / (1 << 8);
2666 if ((decimal->altitude > ((gint32) 1<<21)-1) || (decimal->altitude < ((gint32) -(1<<21))))
2667 return RFC3825_ALTITUDE_OUTOFRANGE;
2669 /* Altitude Uncertainty */
2670 if (fixpoint->altitude_res > 30) {
2671 return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
2673 if (fixpoint->altitude_res > 21 ) {
2674 decimal->altitude_res = (double) 1 / (1 << (fixpoint->altitude_res - 21));
2676 decimal->altitude_res = 1 << (21 - fixpoint->altitude_res);
2678 } else if (decimal->altitude_type == 2) { /* Floors */
2680 if ((fixpoint->altitude_res != 30) && (fixpoint->altitude_res != 0)) {
2681 return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE;
2683 decimal->altitude = (double) fixpoint->altitude / (1 << 8);
2684 } else { /* invalid type */
2685 return RFC3825_ALTITUDE_TYPE_OUTOFRANGE;
2689 decimal->datum_type = 0;
2690 if ((fixpoint->datum_type > 3) || (fixpoint->datum_type < 1)) {
2691 return RFC3825_DATUM_TYPE_OUTOFRANGE;
2693 decimal->datum_type = fixpoint->datum_type;
2695 return RFC3825_NOERROR;
2698 static const value_string option43_cl_suboption_vals[] = {
2700 { 1, "Suboption Request List" },
2701 { 2, "Device Type" },
2702 { 3, "eSAFE Types" },
2703 { 4, "Serial Number" },
2704 { 5, "Hardware Version" },
2705 { 6, "Software Version" },
2706 { 7, "Boot ROM version" },
2707 { 8, "Organizationally Unique Identifier" },
2708 { 9, "Model Number" },
2709 { 10, "Vendor Name" },
2710 { 11, "Address Realm" },
2711 { 12, "CM/PS System Description" },
2712 { 13, "CM/PS Firmware Revision" },
2713 { 14, "Firewall Policy File Version" },
2714 { 15, "eSafe Config File Devices" },
2715 { 18, "Video Security Type" },
2716 { 31, "MTA MAC Address" },
2717 { 32, "Correlation ID" },
2718 { 51, "Vendor Name" },
2719 { 52, "CableCARD Capability" },
2720 { 53, "Device Identification (CA)" },
2721 { 54, "Device Identification (X.509)" },
2726 static const value_string cablehome_subopt11_vals[] = {
2727 { 1, "PS WAN-Man" },
2728 { 2, "PS WAN-Data" },
2733 dissect_vendor_cablelabs_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
2734 tvbuff_t *tvb, int optoff, int optend)
2736 int suboptoff = optoff;
2739 proto_tree *o43cl_v_tree;
2741 struct basic_types_hfs default_hfs = {&hf_bootp_option43_value, NULL, NULL,
2742 &hf_bootp_option43_value_stringz, NULL, &hf_bootp_option43_value_8,
2743 NULL, NULL, &hf_bootp_option43_value_32, NULL, NULL};
2745 static struct opt_info o43cablelabs_opt[]= {
2746 /* 0 */ {"nop", special, &hf_bootp_option43_cl_padding}, /* dummy */
2747 /* 1 */ {"Suboption Request List", string, &hf_bootp_option43_cl_suboption_request_list},
2748 /* 2 */ {"Device Type", string, &hf_bootp_option43_cl_device_type},
2749 /* 3 */ {"eSAFE Types", string, &hf_bootp_option43_cl_esafe_type},
2750 /* 4 */ {"Serial Number", string, &hf_bootp_option43_cl_serial_number},
2751 /* 5 */ {"Hardware Version", string, &hf_bootp_option43_cl_hardware_version},
2752 /* 6 */ {"Software Version", string, &hf_bootp_option43_cl_software_version},
2753 /* 7 */ {"Boot ROM version", string, &hf_bootp_option43_cl_boot_rom_version},
2754 /* 8 */ {"Organizationally Unique Identifier", special, &hf_bootp_option43_cl_oui_bytes},
2755 /* 9 */ {"Model Number", string, &hf_bootp_option43_cl_model_number},
2756 /* 10 */ {"Vendor Name", string, &hf_bootp_option43_cl_vendor_name10},
2757 /* *** 11-30: CableHome *** */
2758 /* 11 */ {"Address Realm", val_u_byte, &hf_bootp_option43_cl_address_realm},
2759 /* 12 */ {"CM/PS System Description", string, &hf_bootp_option43_cl_cm_ps_system_desc},
2760 /* 13 */ {"CM/PS Firmware Revision", string, &hf_bootp_option43_cl_cm_ps_firmware_revision},
2761 /* 14 */ {"Firewall Policy File Version", string, &hf_bootp_option43_cl_firewall_policy_file_version},
2762 /* 15 */ {"eSafe Config File Devices", string, &hf_bootp_option43_cl_esafe_config_file_devices},
2763 /* 16 */ {"Unassigned (CableHome)", special, NULL},
2764 /* 17 */ {"Unassigned (CableHome)", special, NULL},
2765 /* 18 */ {"Video Security Type", string, &hf_bootp_option43_cl_video_security_tape},
2766 /* 19 */ {"Unassigned (CableHome)", special, NULL},
2767 /* 20 */ {"Unassigned (CableHome)", special, NULL},
2768 /* 21 */ {"Unassigned (CableHome)", special, NULL},
2769 /* 22 */ {"Unassigned (CableHome)", special, NULL},
2770 /* 23 */ {"Unassigned (CableHome)", special, NULL},
2771 /* 24 */ {"Unassigned (CableHome)", special, NULL},
2772 /* 25 */ {"Unassigned (CableHome)", special, NULL},
2773 /* 26 */ {"Unassigned (CableHome)", special, NULL},
2774 /* 27 */ {"Unassigned (CableHome)", special, NULL},
2775 /* 28 */ {"Unassigned (CableHome)", special, NULL},
2776 /* 29 */ {"Unassigned (CableHome)", special, NULL},
2777 /* 30 */ {"Unassigned (CableHome)", special, NULL},
2778 /* *** 31-50: PacketCable *** */
2779 /* 31 */ {"MTA MAC Address", special, &hf_bootp_option43_cl_mta_mac_address},
2780 /* 32 */ {"Correlation ID", val_u_long, &hf_bootp_option43_cl_correlation_ID},
2781 /* 33 */ {"Unassigned (PacketCable)", special, NULL},
2782 /* 34 */ {"Unassigned (PacketCable)", special, NULL},
2783 /* 35 */ {"Unassigned (PacketCable)", special, NULL},
2784 /* 36 */ {"Unassigned (PacketCable)", special, NULL},
2785 /* 37 */ {"Unassigned (PacketCable)", special, NULL},
2786 /* 38 */ {"Unassigned (PacketCable)", special, NULL},
2787 /* 39 */ {"Unassigned (PacketCable)", special, NULL},
2788 /* 40 */ {"Unassigned (PacketCable)", special, NULL},
2789 /* 41 */ {"Unassigned (PacketCable)", special, NULL},
2790 /* 42 */ {"Unassigned (PacketCable)", special, NULL},
2791 /* 43 */ {"Unassigned (PacketCable)", special, NULL},
2792 /* 44 */ {"Unassigned (PacketCable)", special, NULL},
2793 /* 45 */ {"Unassigned (PacketCable)", special, NULL},
2794 /* 46 */ {"Unassigned (PacketCable)", special, NULL},
2795 /* 47 */ {"Unassigned (PacketCable)", special, NULL},
2796 /* 48 */ {"Unassigned (PacketCable)", special, NULL},
2797 /* 49 */ {"Unassigned (PacketCable)", special, NULL},
2798 /* 50 */ {"Unassigned (PacketCable)", special, NULL},
2799 /* *** 51-127: CableLabs *** */
2800 /* 51 */ {"Vendor Name", string, &hf_bootp_option43_cl_vendor_name51},
2801 /* 52 */ {"CableCARD Capability", special, &hf_bootp_option43_cl_cablecard_capability},
2802 /* 53 */ {"Device Identification (CA)", special, &hf_bootp_option43_cl_device_id_ca},
2803 /* 54 */ {"Device Identification (X.509)", string, &hf_bootp_option43_cl_device_id_x509},
2804 /* 55 */ {"Unassigned (CableLabs)", special, NULL},
2805 /* *** 128-254: Vendors *** */
2806 /* 128-254 {"Unassigned (Vendors)", special, NULL}, */
2807 /* 255 {"end options", special, &hf_bootp_option43_cl_end} */
2810 subopt = tvb_get_guint8(tvb, optoff);
2814 proto_tree_add_item(v_tree, hf_bootp_option43_cl_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
2816 } else if (subopt == 255) { /* End Option */
2817 proto_tree_add_item(v_tree, hf_bootp_option43_cl_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
2818 /* Make sure we skip any junk left this option */
2822 if (suboptoff >= optend) {
2823 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
2824 "Suboption %d: no room left in option for suboption length", subopt);
2828 subopt_len = tvb_get_guint8(tvb, suboptoff);
2829 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_cl_suboption,
2830 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
2831 subopt, val_to_str(subopt, option43_cl_suboption_vals, "Unknown"));
2833 o43cl_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
2834 proto_tree_add_item(o43cl_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2837 if (suboptoff+subopt_len > optend) {
2838 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Suboption %d: no room left in option for suboption value", subopt);
2842 if ( (subopt < 1 ) || (subopt >= array_length(o43cablelabs_opt)) ) {
2843 proto_tree_add_item(o43cl_v_tree, hf_bootp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2844 } else if (o43cablelabs_opt[subopt].ftype == special) {
2848 /* CableLabs specs treat 43.8 inconsistently
2849 * as either binary (3b) or string (6b) */
2850 if (subopt_len == 3) {
2851 proto_tree_add_bytes_format_value(o43cl_v_tree, hf_bootp_option43_cl_oui_bytes, tvb, suboptoff, subopt_len, NULL,
2852 "%02x:%02x:%02x", tvb_get_guint8(tvb, suboptoff), tvb_get_guint8(tvb, suboptoff+1), tvb_get_guint8(tvb, suboptoff+2));
2853 } else if (subopt_len == 6) {
2854 proto_tree_add_item(o43cl_v_tree, hf_bootp_option43_cl_oui_string, tvb, suboptoff, subopt_len, ENC_ASCII|ENC_NA);
2856 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 3 or 6");
2859 case 31: /* MTA MAC address */
2860 if (subopt_len != 6) {
2861 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 6");
2865 proto_tree_add_item(o43cl_v_tree, hf_bootp_option43_cl_mta_mac_address, tvb, suboptoff, 6, ENC_NA);
2868 if (o43cablelabs_opt[subopt].phf != NULL)
2869 proto_tree_add_item(o43cl_v_tree, *o43cablelabs_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
2871 proto_tree_add_item(o43cl_v_tree, hf_bootp_option43_value, tvb, suboptoff, subopt_len, ENC_NA);
2875 if (bootp_handle_basic_types(pinfo, o43cl_v_tree, vti, tvb, o43cablelabs_opt[subopt].ftype,
2876 suboptoff, subopt_len, o43cablelabs_opt[subopt].phf, &default_hfs) == 0) {
2877 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler %d", subopt);
2881 optoff += (subopt_len + 2);
2885 static const value_string option43_alcatel_suboption_vals[] = {
2887 { 58, "Voice VLAN ID" },
2888 { 64, "Spatial Redundancy TFTP1" },
2889 { 65, "Spatial Redundancy TFTP2" },
2890 { 66, "Application Type" },
2892 { 255, "Alcatel-Lucent End" },
2896 static const value_string option43_alcatel_app_type_vals[] = {
2903 dissect_vendor_alcatel_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
2904 tvbuff_t *tvb, int optoff, int optend)
2906 int suboptoff = optoff;
2910 proto_tree *o43alcatel_v_tree;
2912 subopt = tvb_get_guint8(tvb, optoff);
2916 proto_tree_add_item(v_tree, hf_bootp_option43_alcatel_padding, tvb, optoff, 1, ENC_BIG_ENDIAN);
2918 } else if (subopt == 255) { /* End Option */
2919 proto_tree_add_item(v_tree, hf_bootp_option43_alcatel_end, tvb, optoff, 1, ENC_BIG_ENDIAN);
2920 /* Make sure we skip any junk left this option */
2924 if (suboptoff >= optend) {
2925 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
2926 "Suboption %d: no room left in option for suboption length", subopt);
2930 subopt_len = tvb_get_guint8(tvb, suboptoff);
2931 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option43_alcatel_suboption,
2932 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
2933 subopt, val_to_str(subopt, option43_alcatel_suboption_vals, "Unknown"));
2935 o43alcatel_v_tree = proto_item_add_subtree(vti, ett_bootp_option43_suboption);
2936 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2939 if (suboptoff+subopt_len > optend) {
2940 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "Suboption %d: no room left in option for suboption value", subopt);
2946 case 58: /* 0x3A - Alcatel-Lucent AVA VLAN Id */
2947 if (subopt_len != 2) {
2948 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 2");
2952 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_option43_alcatel_vlan_id, tvb, suboptoff, 2, ENC_BIG_ENDIAN);
2954 case 64: /* 0x40 - Alcatel-Lucent TFTP1 */
2955 if (subopt_len != 4) {
2956 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 4");
2960 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_option43_alcatel_tftp1, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
2962 case 65: /* 0x41 - Alcatel-Lucent TFTP2 */
2963 if (subopt_len != 4) {
2964 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 4");
2968 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_option43_alcatel_tftp2, tvb, suboptoff, 4, ENC_BIG_ENDIAN);
2970 case 66: /* 0x42 - Alcatel-Lucent APPLICATION TYPE */
2971 if (subopt_len != 1) {
2972 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "length isn't 1");
2975 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_option43_alcatel_app_type, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
2977 case 67: /* 0x43 - Alcatel-Lucent SIP URL */
2978 proto_tree_add_item(o43alcatel_v_tree, hf_bootp_option43_alcatel_sip_url, tvb, suboptoff, subopt_len, ENC_ASCII|ENC_NA);
2981 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "ERROR, please report: Unknown subopt type handler %d", subopt);
2985 optoff += (subopt_len + 2);
2989 static const value_string option63_suboption_vals[] = {
2990 { 1, "NWIP does not exist on subnet" },
2991 { 2, "NWIP exists in options area" },
2992 { 3, "NWIP exists in sname/file" },
2993 { 4, "NWIP exists, but too big" },
2994 { 5, "Broadcast for nearest Netware server" },
2995 { 6, "Preferred DSS server" },
2996 { 7, "Nearest NWIP server" },
2997 { 8, "Autoretries" },
2998 { 9, "Autoretry delay, secs" },
2999 { 10, "Support NetWare/IP v1.1" },
3000 { 11, "Primary DSS" },
3005 dissect_netware_ip_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3006 tvbuff_t *tvb, int optoff, int optend)
3008 int suboptoff = optoff;
3009 guint8 subopt, subopt_len;
3010 proto_tree *o63_v_tree;
3012 struct basic_types_hfs default_hfs = {NULL, &hf_bootp_option63_value_ip_address, &hf_bootp_option63_value_ip_address,
3013 NULL, &hf_bootp_option63_value_boolean, &hf_bootp_option63_value_8,
3014 NULL, NULL, NULL, NULL, NULL};
3016 static struct opt_info o63_opt[]= {
3017 /* 0 */ {"",none,NULL},
3018 /* 1 */ {"NWIP does not exist on subnet",presence,NULL},
3019 /* 2 */ {"NWIP exists in options area",presence,NULL},
3020 /* 3 */ {"NWIP exists in sname/file",presence,NULL},
3021 /* 4 */ {"NWIP exists, but too big",presence,NULL},
3022 /* 5 */ {"Broadcast for nearest Netware server",val_boolean, &hf_bootp_option63_broadcast},
3023 /* 6 */ {"Preferred DSS server",ipv4_list,&hf_bootp_option63_preferred_dss_server},
3024 /* 7 */ {"Nearest NWIP server",ipv4_list,&hf_bootp_option63_nearest_nwip_server},
3025 /* 8 */ {"Autoretries",val_u_byte,&hf_bootp_option63_autoretries},
3026 /* 9 */ {"Autoretry delay, secs",val_u_byte,&hf_bootp_option63_autoretry_delay},
3027 /* 10*/ {"Support NetWare/IP v1.1",val_boolean,&hf_bootp_option63_support_netware_v1_1},
3028 /* 11*/ {"Primary DSS",ipv4,&hf_bootp_option63_primary_dss}
3031 subopt = tvb_get_guint8(tvb, optoff);
3034 if (suboptoff >= optend) {
3035 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
3036 "Suboption %d: no room left in option for suboption length", subopt);
3040 subopt_len = tvb_get_guint8(tvb, suboptoff);
3041 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option63_suboption,
3042 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
3043 subopt, val_to_str(subopt, option63_suboption_vals, "Unknown"));
3045 o63_v_tree = proto_item_add_subtree(vti, ett_bootp_option63_suboption);
3046 proto_tree_add_item(o63_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3049 if (subopt < array_length(o63_opt)) {
3050 if (bootp_handle_basic_types(pinfo, o63_v_tree, vti, tvb, o63_opt[subopt].ftype,
3051 suboptoff, subopt_len, o63_opt[subopt].phf, &default_hfs) == 0) {
3052 switch(o63_opt[subopt].ftype)
3055 if (subopt_len != 0) {
3056 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
3057 "Suboption %d: length isn't 0", subopt);
3061 if (o63_opt[subopt].phf == NULL)
3062 proto_tree_add_item(o63_v_tree, hf_bootp_option63_value, tvb, suboptoff, subopt_len, ENC_NA);
3067 optoff += (subopt_len + 2);
3071 static const value_string option125_tr111_suboption_vals[] = {
3072 { 1, "DeviceManufacturerOUI" },
3073 { 2, "DeviceSerialNumber" },
3074 { 3, "DeviceProductClass" },
3075 { 4, "GatewayManufacturerOUI" },
3076 { 5, "GatewaySerialNumber" },
3077 { 6, "GatewayProductClass" },
3082 dissect_vendor_tr111_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3083 tvbuff_t *tvb, int optoff, int optend)
3085 int suboptoff = optoff;
3086 proto_tree *o125_v_tree;
3088 guint8 subopt, subopt_len;
3089 struct basic_types_hfs default_hfs = {NULL, NULL, NULL,
3090 &hf_bootp_option125_value_stringz, NULL, NULL,
3091 NULL, NULL, NULL, NULL, NULL};
3093 /* Reference: TR-111 DHCP Option 125 Sub-Option Data Fields
3097 static struct opt_info o125_tr111_opt[]= {
3098 /* 0 */ {"nop", special, NULL}, /* dummy */
3099 /* 1 */ {"DeviceManufacturerOUI", string, &hf_bootp_option125_tr111_device_manufacturer_oui},
3100 /* 2 */ {"DeviceSerialNumber", string, &hf_bootp_option125_tr111_device_serial_number},
3101 /* 3 */ {"DeviceProductClass", string, &hf_bootp_option125_tr111_device_product_class},
3102 /* 4 */ {"GatewayManufacturerOUI", string, &hf_bootp_option125_tr111_gateway_manufacturer_oui},
3103 /* 5 */ {"GatewaySerialNumber", string, &hf_bootp_option125_tr111_gateway_serial_number},
3104 /* 6 */ {"GatewayProductClass", string, &hf_bootp_option125_tr111_gateway_product_class},
3107 subopt = tvb_get_guint8(tvb, optoff);
3110 if (suboptoff >= optend) {
3111 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
3112 "Suboption %d: no room left in option for suboption length", subopt);
3116 subopt_len = tvb_get_guint8(tvb, suboptoff);
3117 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option125_tr111_suboption,
3118 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
3119 subopt, val_to_str(subopt, option125_tr111_suboption_vals, "Unknown"));
3121 o125_v_tree = proto_item_add_subtree(vti, hf_bootp_option125_tr111_suboption);
3122 proto_tree_add_item(o125_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3125 if (suboptoff+subopt_len > optend) {
3126 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
3127 "Suboption %d: no room left in option for suboption value", subopt);
3131 if (subopt < array_length(o125_tr111_opt)) {
3132 if (bootp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_tr111_opt[subopt].ftype,
3133 suboptoff, subopt_len, o125_tr111_opt[subopt].phf, &default_hfs) == 0) {
3134 if (o125_tr111_opt[subopt].ftype == special) {
3135 if (o125_tr111_opt[subopt].phf != NULL)
3136 proto_tree_add_item(v_tree, *o125_tr111_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
3138 proto_tree_add_item(v_tree, hf_bootp_option125_value, tvb, suboptoff, subopt_len, ENC_NA);
3139 } else if (o125_tr111_opt[subopt].phf == NULL)
3140 proto_tree_add_item(v_tree, hf_bootp_option125_value, tvb, suboptoff, subopt_len, ENC_NA);
3144 optoff += (subopt_len + 2);
3148 static const value_string option125_cl_suboption_vals[] = {
3149 { 1, "Option Request" },
3150 { 2, "TFTP Server Addresses" },
3151 { 3, "eRouter Container Option" },
3152 { 4, "MIB Environment Indicator Option" },
3153 { 5, "Modem Capabilities" },
3157 static const value_string pkt_mib_env_ind_opt_vals[] = {
3158 { 0x00, "Reserved" },
3159 { 0x01, "CableLabs" },
3161 { 0x03, "EuroCableLabs" },
3166 dissect_vendor_cl_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
3167 tvbuff_t *tvb, int optoff, int optend)
3169 int suboptoff = optoff;
3170 guint8 subopt, subopt_len;
3171 proto_tree *o125_v_tree;
3173 struct basic_types_hfs default_hfs = {&hf_bootp_option125_value, &hf_bootp_option125_value_ip_address, &hf_bootp_option125_value_ip_address,
3174 &hf_bootp_option125_value_stringz, NULL, &hf_bootp_option125_value_8,
3175 &hf_bootp_option125_value_16, NULL, NULL, NULL, NULL};
3177 static struct opt_info o125_cl_opt[]= {
3178 /* 0 */ {"nop", special, NULL}, /* dummy */
3179 /* 1 */ {"Option Request = ", val_u_byte, &hf_bootp_option125_cl_option_request},
3180 /* 2 */ {"TFTP Server Addresses : ", ipv4_list, &hf_bootp_option125_cl_tftp_server_addresses},
3181 /* 3 */ {"eRouter Container Option : ", bytes, &hf_bootp_option125_cl_erouter_container_option},
3182 /* 4 */ {"MIB Environment Indicator Option = ", val_u_byte, &hf_bootp_option125_cl_mib_environment_indicator_option},
3183 /* 5 */ {"Modem Capabilities : ", special, &hf_bootp_option125_cl_modem_capabilities},
3186 subopt = tvb_get_guint8(tvb, optoff);
3189 if (suboptoff >= optend) {
3190 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
3191 "Suboption %d: no room left in option for suboption length", subopt);
3195 subopt_len = tvb_get_guint8(tvb, suboptoff);
3196 vti = proto_tree_add_uint_format_value(v_tree, hf_bootp_option125_cl_suboption,
3197 tvb, optoff, subopt_len+2, subopt, "(%d) %s",
3198 subopt, val_to_str(subopt, option125_cl_suboption_vals, "Unknown"));
3200 o125_v_tree = proto_item_add_subtree(vti, hf_bootp_option125_cl_suboption);
3201 proto_tree_add_item(o125_v_tree, hf_bootp_suboption_length, tvb, suboptoff, 1, ENC_BIG_ENDIAN);
3204 if (suboptoff+subopt_len > optend) {
3205 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR,
3206 "Suboption %d: no room left in option for suboption value", subopt);
3210 if (subopt < array_length(o125_cl_opt)) {
3211 if (bootp_handle_basic_types(pinfo, o125_v_tree, vti, tvb, o125_cl_opt[subopt].ftype,
3212 suboptoff, subopt_len, o125_cl_opt[subopt].phf, &default_hfs) == 0) {
3214 switch(o125_cl_opt[subopt].ftype) {
3216 if (o125_cl_opt[subopt].phf != NULL)
3217 proto_tree_add_item(o125_v_tree, *o125_cl_opt[subopt].phf, tvb, suboptoff, subopt_len, ENC_BIG_ENDIAN);
3219 proto_tree_add_item(o125_v_tree, hf_bootp_option125_value, tvb, suboptoff, subopt_len, ENC_NA);
3221 dissect_docsis_cm_cap(o125_v_tree, tvb, optoff, subopt_len+2, TRUE);
3224 if (o125_cl_opt[subopt].phf == NULL)
3225 proto_tree_add_item(o125_v_tree, hf_bootp_option125_value, tvb, suboptoff, subopt_len, ENC_NA);
3231 optoff += (subopt_len + 2);
3235 /* PacketCable Multimedia Terminal Adapter device capabilities (option 60).
3236 Ref: PKT-SP-I05-021127 sections 8.2 and 10 */
3238 #define PKT_MDC_TLV_OFF 10
3241 /* These are ASCII-encoded hexadecimal digits. We use the raw hex equivalent for
3243 #define PKT_MDC_VERSION 0x3031 /* "01" */
3244 #define PKT_MDC_TEL_END 0x3032 /* "02" */
3245 #define PKT_MDC_TGT 0x3033 /* "03" */
3246 #define PKT_MDC_HTTP_ACC 0x3034 /* "04" */
3247 #define PKT_MDC_SYSLOG 0x3035 /* "05" */
3248 #define PKT_MDC_NCS 0x3036 /* "06" */
3249 #define PKT_MDC_PRI_LINE 0x3037 /* "07" */
3250 #define PKT_MDC_VENDOR_TLV 0x3038 /* "08" */
3251 #define PKT_MDC_NVRAM_STOR 0x3039 /* "09" */
3252 #define PKT_MDC_PROV_REP 0x3041 /* "0A" */
3253 #define PKT_MDC_PROV_REP_LC 0x3061 /* "0a" */
3254 #define PKT_MDC_SUPP_CODECS 0x3042 /* "0B" */
3255 #define PKT_MDC_SUPP_CODECS_LC 0x3062 /* "0b" */
3256 #define PKT_MDC_SILENCE 0x3043 /* "0C" */
3257 #define PKT_MDC_SILENCE_LC 0x3063 /* "0c" */
3258 #define PKT_MDC_ECHO_CANCEL 0x3044 /* "0D" */
3259 #define PKT_MDC_ECHO_CANCEL_LC 0x3064 /* "0d" */
3260 #define PKT_MDC_RSVP 0x3045 /* "0E" */
3261 #define PKT_MDC_RSVP_LC 0x3065 /* "0e" */
3262 #define PKT_MDC_UGS_AD 0x3046 /* "0F" */
3263 #define PKT_MDC_UGS_AD_LC 0x3066 /* "0f" */
3264 #define PKT_MDC_IF_INDEX 0x3130 /* "10" */
3265 #define PKT_MDC_FLOW_LOG 0x3131 /* "11" */
3266 #define PKT_MDC_PROV_FLOWS 0x3132 /* "12" */
3267 /* PacketCable 1.5: */
3268 #define PKT_MDC_T38_VERSION 0x3133 /* "13" */
3269 #define PKT_MDC_T38_EC 0x3134 /* "14" */
3270 #define PKT_MDC_RFC2833_DTMF 0x3135 /* "15" */
3271 #define PKT_MDC_VOICE_METRICS 0x3136 /* "16" */
3272 #define PKT_MDC_MIBS 0x3137 /* "17" */
3273 #define PKT_MDC_MGPI 0x3138 /* "18" */
3274 #define PKT_MDC_V152 0x3139 /* "19" */
3275 #define PKT_MDC_CBS 0x3141 /* "1A" */
3276 #define PKT_MDC_CBS_LC 0x3161 /* "1a" */
3278 static const value_string pkt_mdc_type_vals[] = {
3279 { PKT_MDC_VERSION, "PacketCable Version" },
3280 { PKT_MDC_TEL_END, "Number Of Telephony Endpoints" },
3281 { PKT_MDC_TGT, "TGT Support" },
3282 { PKT_MDC_HTTP_ACC, "HTTP Download File Access Method Support" },
3283 { PKT_MDC_SYSLOG, "MTA-24 Event SYSLOG Notification Support" },
3284 { PKT_MDC_NCS, "NCS Service Flow Support" },
3285 { PKT_MDC_PRI_LINE, "Primary Line Support" },
3286 { PKT_MDC_VENDOR_TLV, "Vendor Specific TLV Type(s)" },
3287 { PKT_MDC_NVRAM_STOR, "NVRAM Ticket/Session Keys Storage Support" },
3288 { PKT_MDC_PROV_REP, "Provisioning Event Reporting Support" },
3289 { PKT_MDC_PROV_REP_LC, "Provisioning Event Reporting Support" },
3290 { PKT_MDC_SUPP_CODECS, "Supported CODEC(s)" },
3291 { PKT_MDC_SUPP_CODECS_LC, "Supported CODEC(s)" },
3292 { PKT_MDC_SILENCE, "Silence Suppression Support" },
3293 { PKT_MDC_SILENCE_LC, "Silence Suppression Support" },
3294 { PKT_MDC_ECHO_CANCEL, "Echo Cancellation Support" },
3295 { PKT_MDC_ECHO_CANCEL_LC, "Echo Cancellation Support" },
3296 { PKT_MDC_RSVP, "RSVP Support/ Reserved" },
3297 { PKT_MDC_RSVP_LC, "RSVP Support/ Reserved" },
3298 { PKT_MDC_UGS_AD, "UGS-AD Support" },
3299 { PKT_MDC_UGS_AD_LC, "UGS-AD Support" },
3300 { PKT_MDC_IF_INDEX, "MTA's \"ifIndex\" starting number in \"ifTable\"" },
3301 { PKT_MDC_FLOW_LOG, "Provisioning Flow Logging Support" },
3302 { PKT_MDC_PROV_FLOWS, "Supported Provisioning Flows" },
3303 /* PacketCable 1.5: */
3304 { PKT_MDC_T38_VERSION, "T38 Version Support" },
3305 { PKT_MDC_T38_EC, "T38 Error Correction Support" },
3306 { PKT_MDC_RFC2833_DTMF, "RFC 2833 DTMF Support" },
3307 { PKT_MDC_VOICE_METRICS, "Voice Metrics Support" },
3308 { PKT_MDC_MIBS, "MIB Support" },
3309 { PKT_MDC_MGPI, "Multiple Grants Per Interval Support" },
3310 { PKT_MDC_V152, "V.152 Support" },
3311 /* PacketCable 2.0: */
3312 { PKT_MDC_CBS, "Certificate Bootstrapping Support" },
3313 { PKT_MDC_CBS_LC, "Certificate Bootstrapping Support" },
3317 static const value_string pkt_mdc_version_vals[] = {
3318 { 0x3030, "PacketCable 1.0" },
3319 { 0x3031, "PacketCable 1.1/1.5" }, /* 1.5 replaces 1.1-1.3 */
3320 { 0x3032, "PacketCable 2.0" },
3324 static const value_string pkt_mdc_boolean_vals[] = {
3330 static const value_string pkt_mdc_codec_vals[] = {
3331 { 0x3031, "other" }, /* "01" */
3332 { 0x3032, "unknown" },
3333 { 0x3033, "G.729" },
3334 { 0x3034, "reserved" },
3335 { 0x3035, "G.729E" },
3337 { 0x3037, "G.726-32" },
3338 { 0x3038, "G.728" },
3339 { 0x3039, "PCMA" }, /* "09" */
3340 { 0x3041, "G.726-16" }, /* "0A" */
3341 { 0x3042, "G.726-24" },
3342 { 0x3043, "G.726-40" },
3345 { 0x3046, "telephone-event" }, /* "0F" */
3349 static const value_string pkt_mdc_t38_version_vals[] = {
3350 { 0x3030, "Unsupported" },
3351 { 0x3031, "T.38 Version Zero" }, /* default */
3352 { 0x3032, "T.38 Version One" },
3353 { 0x3033, "T.38 Version Two" },
3354 { 0x3035, "T.38 Version Three" },
3358 static const value_string pkt_mdc_t38_ec_vals[] = {
3360 { 0x3031, "Redundancy" }, /* default */
3365 static const value_string pkt_mdc_mib_orgs[] = {
3366 { 0x3030, "CableLabs" },
3368 { 0x3032, "EuroCableLabs" },
3369 { 0x3033, "Reserved" },
3370 { 0x3034, "Reserved" },
3371 { 0x3035, "Reserved" },
3372 { 0x3036, "Reserved" },
3373 { 0x3037, "Reserved" },
3374 { 0x3038, "Reserved" },
3375 { 0x3039, "Reserved" },
3379 static const value_string pkt_mdc_supp_flow_vals[] = {
3380 { 1 << 0, "Secure Flow (Full Secure Provisioning Flow)" },
3381 { 1 << 1, "Hybrid Flow" },
3382 { 1 << 2, "Basic Flow" },
3386 #define PKT_MDC_MIB_CL 0x3030
3387 static const value_string pkt_mdc_cl_mib_vals[] = {
3388 { 1 << 0, "PacketCable 1.5 MTA MIB" },
3389 { 1 << 1, "PacketCable 1.5 Signaling MIB" },
3390 { 1 << 2, "PacketCable 1.5 Management Event MIB" },
3391 { 1 << 3, "PacketCable 1.5 MTA Extension MIB" },
3392 { 1 << 4, "PacketCable 1.5 Signaling Extension MIB" },
3393 { 1 << 5, "PacketCable 1.5 MEM Extension MIB" },
3394 { 1 << 6, "Reserved" },
3395 { 1 << 7, "Reserved" },
3399 #define PKT_MDC_MIB_IETF 0x3031
3400 static const value_string pkt_mdc_ietf_mib_vals[] = {
3401 { 1 << 0, "IETF MTA MIB" },
3402 { 1 << 1, "IETF Signaling MIB" },
3403 { 1 << 2, "IETF Management Event MIB" },
3404 { 1 << 3, "Reserved" },
3405 { 1 << 4, "Reserved" },
3406 { 1 << 5, "Reserved" },
3407 { 1 << 6, "Reserved" },
3408 { 1 << 7, "Reserved" },
3412 #define PKT_MDC_MIB_EURO 0x3032
3413 static const value_string pkt_mdc_euro_mib_vals[] = {
3414 { 1 << 0, "PacketCable 1.5 MTA MIB" },
3415 { 1 << 1, "PacketCable 1.5 Signaling MIB" },
3416 { 1 << 2, "PacketCable 1.5 Management Event MIB" },
3417 { 1 << 3, "PacketCable 1.5 MTA Extension MIB" },
3418 { 1 << 4, "PacketCable 1.5 Signaling Extension MIB" },
3419 { 1 << 5, "PacketCable 1.5 MEM Extension MIB" },
3420 { 1 << 6, "Reserved" },
3421 { 1 << 7, "Reserved" },
3427 dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len)
3430 unsigned long flow_val = 0;
3431 int off = PKT_MDC_TLV_OFF + voff;
3432 int subopt_off, max_len;
3433 guint tlv_len, i, mib_val;
3434 guint8 asc_val[3] = " ", flow_val_str[5];
3436 proto_item *ti, *mib_ti;
3437 proto_tree *subtree, *subtree2;
3439 tvb_memcpy (tvb, asc_val, off, 2);
3440 if (sscanf((gchar*)asc_val, "%x", &tlv_len) != 1 || tlv_len > 0xff) {
3441 proto_tree_add_text(v_tree, tvb, off, len - off,
3442 "Bogus length: %s", asc_val);
3445 proto_tree_add_uint_format_value(v_tree, hf_bootp_pkt_mta_cap_len, tvb, off, 2,
3446 tlv_len, "%d", tlv_len);
3449 while (off - voff < len) {
3451 raw_val = tvb_get_ntohs (tvb, off);
3454 tvb_memcpy(tvb, asc_val, off + 2, 2);
3455 if (sscanf((gchar*)asc_val, "%x", &tlv_len) != 1
3456 || tlv_len < 1 || tlv_len > G_MAXUINT16) {
3457 proto_tree_add_text(v_tree, tvb, off, len - off,
3458 "[Bogus length: %s]", asc_val);
3463 ti = proto_tree_add_text(v_tree,
3464 tvb, off, (tlv_len * 2) + 4,
3466 tvb_format_text(tvb, off, 2),
3467 val_to_str(raw_val, pkt_mdc_type_vals, "unknown"));
3470 case PKT_MDC_VERSION:
3471 raw_val = tvb_get_ntohs(tvb, off + 4);
3472 proto_item_append_text(ti,
3474 val_to_str(raw_val, pkt_mdc_version_vals, "Reserved"),
3475 tvb_format_stringzpad(tvb, off + 4, 2) );
3478 case PKT_MDC_TEL_END:
3479 case PKT_MDC_IF_INDEX:
3480 proto_item_append_text(ti,
3482 tvb_format_stringzpad(tvb, off + 4, 2) );
3486 case PKT_MDC_HTTP_ACC:
3487 case PKT_MDC_SYSLOG:
3489 case PKT_MDC_PRI_LINE:
3490 case PKT_MDC_NVRAM_STOR:
3491 case PKT_MDC_PROV_REP:
3492 case PKT_MDC_PROV_REP_LC:
3493 case PKT_MDC_SILENCE:
3494 case PKT_MDC_SILENCE_LC:
3495 case PKT_MDC_ECHO_CANCEL:
3496 case PKT_MDC_ECHO_CANCEL_LC:
3498 case PKT_MDC_RSVP_LC:
3499 case PKT_MDC_UGS_AD:
3500 case PKT_MDC_UGS_AD_LC:
3501 case PKT_MDC_FLOW_LOG:
3502 case PKT_MDC_RFC2833_DTMF:
3503 case PKT_MDC_VOICE_METRICS:
3507 case PKT_MDC_CBS_LC:
3508 raw_val = tvb_get_ntohs(tvb, off + 4);
3509 proto_item_append_text(ti,
3511 val_to_str(raw_val, pkt_mdc_boolean_vals, "unknown"),
3512 tvb_format_stringzpad(tvb, off + 4, 2) );
3515 case PKT_MDC_SUPP_CODECS:
3516 case PKT_MDC_SUPP_CODECS_LC:
3517 for (i = 0; i < tlv_len; i++) {
3518 raw_val = tvb_get_ntohs(tvb, off + 4 + (i * 2) );
3519 proto_item_append_text(ti,
3521 plurality(i + 1, "", ", "),
3522 val_to_str(raw_val, pkt_mdc_codec_vals, "unknown"),
3523 tvb_format_stringzpad(tvb, off + 4 + (i * 2), 2) );
3527 case PKT_MDC_PROV_FLOWS:
3528 tvb_memcpy(tvb, flow_val_str, off + 4, 4);
3529 flow_val_str[4] = '\0';
3530 flow_val = strtoul((gchar*)flow_val_str, NULL, 16);
3531 proto_item_append_text(ti,
3532 "0x%04lx", flow_val);
3535 case PKT_MDC_T38_VERSION:
3536 raw_val = tvb_get_ntohs(tvb, off + 4);
3537 proto_item_append_text(ti,
3539 val_to_str(raw_val, pkt_mdc_t38_version_vals, "unknown"),
3540 tvb_format_stringzpad(tvb, off + 4, 2) );
3543 case PKT_MDC_T38_EC:
3544 raw_val = tvb_get_ntohs(tvb, off + 4);
3545 proto_item_append_text(ti,
3547 val_to_str(raw_val, pkt_mdc_t38_ec_vals, "unknown"),
3548 tvb_format_stringzpad(tvb, off + 4, 2) );
3554 case PKT_MDC_VENDOR_TLV:
3556 proto_item_append_text(ti,
3558 tvb_format_stringzpad(tvb, off + 4, tlv_len * 2) );
3562 subtree = proto_item_add_subtree(ti, ett_bootp_option);
3563 if (raw_val == PKT_MDC_PROV_FLOWS) {
3564 for (i = 0 ; i < 3; i++) {
3565 if (flow_val & pkt_mdc_supp_flow_vals[i].value) {
3566 decode_bitfield_value(bit_fld, flow_val, pkt_mdc_supp_flow_vals[i].value, 16);
3567 proto_tree_add_text(subtree, tvb, off + 4, 4, "%s%s",
3568 bit_fld, pkt_mdc_supp_flow_vals[i].strptr);
3571 } else if (raw_val == PKT_MDC_MIBS) {
3572 /* 17 06 02 00 38 02 01 07 */
3573 subopt_off = off + 4;
3574 max_len = subopt_off + (tlv_len * 2);
3575 while (subopt_off < max_len) {
3576 raw_val = tvb_get_ntohs(tvb, subopt_off);
3577 if (raw_val != 0x3032) { /* We only know how to handle a length of 2 */
3578 tvb_memcpy(tvb, asc_val, subopt_off, 2);
3579 proto_tree_add_text(subtree, tvb, subopt_off, 2,
3580 "[Bogus length: %s]", asc_val);
3585 raw_val = tvb_get_ntohs(tvb, subopt_off);
3586 tvb_memcpy(tvb, asc_val, subopt_off, 2);
3588 mib_ti = proto_tree_add_text(subtree, tvb, subopt_off, 2, "%s (%s)",
3589 val_to_str(raw_val, pkt_mdc_mib_orgs, "Unknown"), asc_val);
3590 if (subopt_off > off + 4 + 2) {
3591 proto_item_append_text(ti, ", ");
3593 proto_item_append_text(ti, "%s", val_to_str(raw_val, pkt_mdc_mib_orgs, "Unknown"));
3596 tvb_memcpy(tvb, asc_val, subopt_off, 2);
3597 if (sscanf((gchar*)asc_val, "%x", &mib_val) != 1) {
3598 proto_tree_add_text(v_tree, tvb, subopt_off, 2,
3599 "[Bogus bitfield: %s]", asc_val);
3604 case PKT_MDC_MIB_CL:
3605 subtree2 = proto_item_add_subtree(mib_ti, ett_bootp_option);
3607 for (i = 0; i < 8; i++) {
3608 if (mib_val & pkt_mdc_cl_mib_vals[i].value) {
3609 decode_bitfield_value(bit_fld, mib_val, pkt_mdc_cl_mib_vals[i].value, 8);
3610 proto_tree_add_text(subtree2, tvb, subopt_off, 2,
3611 "%s%s", bit_fld, pkt_mdc_cl_mib_vals[i].strptr);
3616 case PKT_MDC_MIB_IETF:
3617 subtree2 = proto_item_add_subtree(mib_ti, ett_bootp_option);
3619 for (i = 0; i < 8; i++) {
3620 if (mib_val & pkt_mdc_ietf_mib_vals[i].value) {
3621 decode_bitfield_value(bit_fld, mib_val, pkt_mdc_ietf_mib_vals[i].value, 8);
3622 proto_tree_add_text(subtree2, tvb, subopt_off, 2,
3623 "%s%s", bit_fld, pkt_mdc_ietf_mib_vals[i].strptr);
3628 case PKT_MDC_MIB_EURO:
3629 subtree2 = proto_item_add_subtree(mib_ti, ett_bootp_option);
3631 for (i = 0; i < 8; i++) {
3632 if (mib_val & pkt_mdc_euro_mib_vals[i].value) {
3633 decode_bitfield_value(bit_fld, mib_val, pkt_mdc_euro_mib_vals[i].value, 8);
3634 proto_tree_add_text(subtree2, tvb, subopt_off, 2,
3635 "%s%s", bit_fld, pkt_mdc_euro_mib_vals[i].strptr);
3647 off += (tlv_len * 2) + 4;
3652 /* DOCSIS Cable Modem device capabilities (option 60/option 125). */
3653 #define DOCSIS_CM_CAP_TLV_OFF 12
3655 #define DOCSIS_CM_CAP_CONCAT_SUP 0x01
3656 #define DOCSIS_CM_CAP_DOCSIS_VER 0x02
3657 #define DOCSIS_CM_CAP_FRAG_SUP 0x03
3658 #define DOCSIS_CM_CAP_PHS_SUP 0x04
3659 #define DOCSIS_CM_CAP_IGMP_SUP 0x05
3660 #define DOCSIS_CM_CAP_PRIV_SUP 0x06
3661 #define DOCSIS_CM_CAP_DSAID_SUP 0x07
3662 #define DOCSIS_CM_CAP_USID_SUP 0x08
3663 #define DOCSIS_CM_CAP_FILT_SUP 0x09
3664 #define DOCSIS_CM_CAP_TET_MI 0x0a
3665 #define DOCSIS_CM_CAP_TET 0x0b
3666 #define DOCSIS_CM_CAP_DCC_SUP 0x0c
3667 #define DOCSIS_CM_CAP_IPFILT_SUP 0x0d
3668 #define DOCSIS_CM_CAP_LLCFILT_SUP 0x0e
3669 #define DOCSIS_CM_CAP_EXPUNI_SPACE 0x0f
3670 #define DOCSIS_CM_CAP_RNGHLDOFF_SUP 0x10
3671 #define DOCSIS_CM_CAP_L2VPN_SUP 0x11
3672 #define DOCSIS_CM_CAP_L2VPN_HOST_SUP 0x12
3673 #define DOCSIS_CM_CAP_DUTFILT_SUP 0x13
3674 #define DOCSIS_CM_CAP_USFREQRNG_SUP 0x14
3675 #define DOCSIS_CM_CAP_USSYMRATE_SUP 0x15
3676 #define DOCSIS_CM_CAP_SACM2_SUP 0x16
3677 #define DOCSIS_CM_CAP_SACM2HOP_SUP 0x17
3678 #define DOCSIS_CM_CAP_MULTTXCHAN_SUP 0x18
3679 #define DOCSIS_CM_CAP_512USTXCHAN_SUP 0x19
3680 #define DOCSIS_CM_CAP_256USTXCHAN_SUP 0x1a
3681 #define DOCSIS_CM_CAP_TOTALSIDCLU_SUP 0x1b
3682 #define DOCSIS_CM_CAP_SIDCLUPERSF_SUP 0x1c
3683 #define DOCSIS_CM_CAP_MULTRXCHAN_SUP 0x1d
3684 #define DOCSIS_CM_CAP_TOTALDSID_SUP 0x1e
3685 #define DOCSIS_CM_CAP_RESEQDSID_SUP 0x1f
3686 #define DOCSIS_CM_CAP_MULTDSID_SUP 0x20
3687 #define DOCSIS_CM_CAP_MULTDSIDFW_SUP 0x21
3688 #define DOCSIS_CM_CAP_FCTF_SUP 0x22
3689 #define DOCSIS_CM_CAP_DPV_SUP 0x23
3690 #define DOCSIS_CM_CAP_UGSPERUSFLOW_SUP 0x24
3691 #define DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP 0x25
3692 #define DOCSIS_CM_CAP_USDROPCLASSIF_SUP 0x26
3693 #define DOCSIS_CM_CAP_IPV6_SUP 0x27
3695 static const value_string docsis_cm_cap_type_vals[] = {
3696 { DOCSIS_CM_CAP_CONCAT_SUP, "Concatenation Support" },
3697 { DOCSIS_CM_CAP_DOCSIS_VER, "DOCSIS Version" },
3698 { DOCSIS_CM_CAP_FRAG_SUP, "Fragmentation Support" },
3699 { DOCSIS_CM_CAP_PHS_SUP, "PHS Support" },
3700 { DOCSIS_CM_CAP_IGMP_SUP, "IGMP Support" },
3701 { DOCSIS_CM_CAP_PRIV_SUP, "Privacy Support" },
3702 { DOCSIS_CM_CAP_DSAID_SUP, "Downstream SAID Support" },
3703 { DOCSIS_CM_CAP_USID_SUP, "Upstream SID Support" },
3704 { DOCSIS_CM_CAP_FILT_SUP, "Optional Filtering Support" },
3705 { DOCSIS_CM_CAP_TET_MI, "Transmit Equalizer Taps per Modulation Interval" },
3706 { DOCSIS_CM_CAP_TET, "Number of Transmit Equalizer Taps" },
3707 { DOCSIS_CM_CAP_DCC_SUP, "DCC Support" },
3708 { DOCSIS_CM_CAP_IPFILT_SUP, "IP Filters Support" },
3709 { DOCSIS_CM_CAP_LLCFILT_SUP, "LLC Filters Support" },
3710 { DOCSIS_CM_CAP_EXPUNI_SPACE, "Expanded Unicast SID Space" },
3711 { DOCSIS_CM_CAP_RNGHLDOFF_SUP, "Ranging Hold-Off Support" },
3712 { DOCSIS_CM_CAP_L2VPN_SUP, "L2VPN Capability" },
3713 { DOCSIS_CM_CAP_L2VPN_HOST_SUP, "eSAFE Host Capability" },
3714 { DOCSIS_CM_CAP_DUTFILT_SUP, "DUT Filtering" },
3715 { DOCSIS_CM_CAP_USFREQRNG_SUP, "Upstream Frequency Range Support" },
3716 { DOCSIS_CM_CAP_USSYMRATE_SUP, "Upstream Symbol Rate Support" },
3717 { DOCSIS_CM_CAP_SACM2_SUP, "Selectable Active Code Mode 2 Support" },
3718 { DOCSIS_CM_CAP_SACM2HOP_SUP, "Code Hopping SAC Mode 2 is supported" },
3719 { DOCSIS_CM_CAP_MULTTXCHAN_SUP, "Multiple Transmit Channel Support" },
3720 { DOCSIS_CM_CAP_512USTXCHAN_SUP, "5.12 Msps Upstream Transmit Channel Support" },
3721 { DOCSIS_CM_CAP_256USTXCHAN_SUP, "2.56 Msps Upstream Transmit Channel Support" },
3722 { DOCSIS_CM_CAP_TOTALSIDCLU_SUP, "Total SID Cluster Support" },
3723 { DOCSIS_CM_CAP_SIDCLUPERSF_SUP, "SID Clusters per Service Flow Support" },
3724 { DOCSIS_CM_CAP_MULTRXCHAN_SUP, "Multiple Receive Channel Support" },
3725 { DOCSIS_CM_CAP_TOTALDSID_SUP, "Total Downstream Service ID (DSID) Support" },
3726 { DOCSIS_CM_CAP_RESEQDSID_SUP, "Resequencing Downstream Service ID (DSID) Support" },
3727 { DOCSIS_CM_CAP_MULTDSID_SUP, "Multicast Downstream Service ID (DSID) Support" },
3728 { DOCSIS_CM_CAP_MULTDSIDFW_SUP, "Multicast DSID Forwarding" },
3729 { DOCSIS_CM_CAP_FCTF_SUP, "Frame Control Type Forwarding Capability" },
3730 { DOCSIS_CM_CAP_DPV_SUP, "DPV Capability" },
3731 { DOCSIS_CM_CAP_UGSPERUSFLOW_SUP, "Unsolicited Grant Service/Upstream Service Flow Support" },
3732 { DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP, "MAP and UCD Receipt Support" },
3733 { DOCSIS_CM_CAP_USDROPCLASSIF_SUP, "Upstream Drop Classifier Support" },
3734 { DOCSIS_CM_CAP_IPV6_SUP, "IPv6 Support" },
3738 static const value_string docsis_cm_cap_supported_vals[] = {
3739 { 0x00, "Not Support" },
3740 { 0x01, "Supported" },
3744 static const value_string docsis_cm_cap_version_vals[] = {
3745 { 0x00, "DOCSIS 1.0" },
3746 { 0x01, "DOCSIS 1.1" },
3747 { 0x02, "DOCSIS 2.0" },
3748 { 0x03, "DOCSIS 3.0" },
3752 static const value_string docsis_cm_cap_privacy_vals[] = {
3753 { 0x00, "BPI Support" },
3754 { 0x01, "BPI Plus Support" },
3758 static const value_string docsis_cm_cap_ranging_hold_off_vals[] = {
3760 { 1 << 1, "ePS or eRouter" },
3761 { 1 << 2, "EMTA or EDVA" },
3762 { 1 << 3, "DSG/eSTB" },
3766 static const value_string docsis_cm_cap_l2vpn_vals[] = {
3767 { 0x00, "CM not compliant with DOCSIS L2VPN Section 7 (default)" },
3768 { 0x01, "CM compliant with DOCSIS L2VPN Section 7" },
3772 static const value_string docsis_cm_cap_filt_vals[] = {
3774 { 0x01, "802.1p Filtering" },
3775 { 0x01, "802.1Q Filtering" },
3779 static const value_string docsis_cm_cap_usfreqrng_vals[] = {
3780 { 0x00, "Standard Upstream Frequency Range" },
3781 { 0x01, "Standard Upstream Frequency Range and Extended Upstream Frequency Range" },
3785 static const value_string docsis_cm_cap_map_ucd_receipt_vals[] = {
3786 { 0x00, "CM cannot support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
3787 { 0x01, "CM can support the receipt of MAPs and UCDs on downstreams other than the Primary Downstream Channel" },
3791 static const value_string docsis_cm_cap_map_dpv_support_vals[] = {
3792 { 0x00, "U1 supported as a Start Reference Point for DPV per Path" },
3793 { 0x01, "U1 supported as a Start Reference Point for DPV per Path" },
3797 static const value_string docsis_cm_cap_map_multDsidForward_support_vals[] = {
3798 { 0x00, "No support for multicast DSID forwarding" },
3799 { 0x01, "Support for GMAC explicit multicast DSID forwarding" },
3800 { 0x02, "Support for GMAC promiscuous multicast DSID forwarding" },
3804 static const value_string docsis_cm_cap_map_fctfc_support_vals[] = {
3805 { 0x00, "Isolation Packet PDU MAC Header (FC_Type of 10) is not forwarded" },
3806 { 0x01, "Isolation Packet PDU MAC Header (FC_Type of 10) is forwarded" },
3810 static const value_string docsis_cm_cap_map_l2vpn_esafe_index_support_vals[] = {
3811 { 0x01, "ePs or eRouter" },
3813 { 0x11, "eSTB-IP" },
3814 { 0x12, "eSTB-DSG" },
3819 static const value_string docsis_cm_cap_ussymrate_vals[] = {
3820 { 1 << 0, "160 ksps symbol rate supported" },
3821 { 1 << 1, "320 ksps symbol rate supported" },
3822 { 1 << 2, "640 ksps symbol rate supported" },
3823 { 1 << 3, "1280 ksps symbol rate supported" },
3824 { 1 << 4, "2560 ksps symbol rate supported" },
3825 { 1 << 5, "5120 ksps symbol rate supported" },
3830 display_uint_with_range_checking(proto_item *ti, guint8 val_byte, guint16 val_uint16, int min_value, int max_value)
3842 proto_item_append_text(ti, "%i", value);
3843 if ((value < min_value) ||
3844 (value > max_value))
3846 proto_item_append_text(ti, " (Value Out-of-Range [%i..%i])", min_value, max_value);
3850 static void get_opt125_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tlvlen, guint8 **value)
3853 *tlvtype = tvb_get_guint8(tvb, off);
3855 *tlvlen = tvb_get_guint8(tvb, off+1);
3857 *value = ep_tvb_memdup(tvb, off + 2, *tlvlen);
3860 static void get_opt60_tlv(tvbuff_t *tvb, guint off, guint8 *tlvtype, guint8 *tlvlen, guint8 **value)
3864 val_asc = (guint8 *)ep_alloc0(4);
3866 tvb_memcpy(tvb, val_asc, off, 2);
3867 *tlvtype = (guint8)strtoul((gchar*)val_asc, NULL, 16);
3869 tvb_memcpy(tvb, val_asc, off + 2, 2);
3870 *tlvlen = (guint8)strtoul((gchar*)val_asc, NULL, 16);
3872 *value = (guint8 *)ep_alloc0(*tlvlen);
3873 for (i=0; i<*tlvlen; i++)
3875 memset(val_asc, 0, 4);
3876 tvb_memcpy(tvb, val_asc, off + ((i*2) + 4), 2);
3877 (*value)[i] = (guint8)strtoul((gchar*)val_asc, NULL, 16);
3882 dissect_docsis_cm_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len, gboolean opt125)
3887 proto_tree *subtree;
3891 guint8 val_byte = 0;
3892 guint16 val_uint16 = 0;
3893 guint8 *val_other = NULL;
3896 asc_val = ep_alloc0(4);
3900 /* Option 125 is formatted as uint8's */
3902 tlv_type = tvb_get_guint8(tvb, off);
3904 tlv_len = tvb_get_guint8(tvb, off+1);
3905 proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cm_cap_len, tvb, off+1, 1,
3906 tlv_len, "%d", tlv_len);
3910 /* Option 60 is formatted as an ascii string.
3911 Since the capabilities are the same for both options
3912 I am converting the Option 60 values from ascii to
3913 uint8s to allow the same parser to work for both */
3914 off += DOCSIS_CM_CAP_TLV_OFF;
3915 tvb_memcpy (tvb, asc_val, off, 2);
3916 tlv_len = (guint8)strtoul((gchar*)asc_val, NULL, 16);
3917 proto_tree_add_uint_format_value(v_tree, hf_bootp_docsis_cm_cap_len, tvb, off+2, 2,
3918 tlv_len, "%d", tlv_len);
3923 while (off - ((guint) voff) < ((guint) len))
3932 get_opt125_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
3933 ti = proto_tree_add_uint_format(v_tree, hf_bootp_docsis_cm_cap_type, tvb, off,
3938 val_to_str(tlv_type, docsis_cm_cap_type_vals, "unknown"));
3942 /* Option 60 is formatted as an ascii string. Since the capabilities
3943 are the same for both options I am converting the Option 60 values
3944 from ascii to uint8s to allow the same parser to work for both */
3945 get_opt60_tlv(tvb, off, &tlv_type, &tlv_len, &val_other);
3946 ti = proto_tree_add_uint_format(v_tree, hf_bootp_docsis_cm_cap_type, tvb, off,
3951 val_to_str(tlv_type, docsis_cm_cap_type_vals, "unknown"));
3956 /* The value refers to a byte. */
3957 val_byte = val_other[0];
3963 /* The value refers to a uint16. */
3964 val_uint16 = (val_other[0] << 8) + val_other[1];
3970 case DOCSIS_CM_CAP_CONCAT_SUP:
3971 case DOCSIS_CM_CAP_FRAG_SUP:
3972 case DOCSIS_CM_CAP_PHS_SUP:
3973 case DOCSIS_CM_CAP_IGMP_SUP:
3974 case DOCSIS_CM_CAP_DCC_SUP:
3975 case DOCSIS_CM_CAP_EXPUNI_SPACE:
3976 case DOCSIS_CM_CAP_DUTFILT_SUP:
3977 case DOCSIS_CM_CAP_SACM2_SUP:
3978 case DOCSIS_CM_CAP_SACM2HOP_SUP:
3979 case DOCSIS_CM_CAP_IPV6_SUP:
3980 proto_item_append_text(ti,
3982 val_to_str(val_byte, docsis_cm_cap_supported_vals, "Reserved"));
3984 case DOCSIS_CM_CAP_DOCSIS_VER:
3985 proto_item_append_text(ti,
3987 val_to_str(val_byte, docsis_cm_cap_version_vals, "Reserved"));
3989 case DOCSIS_CM_CAP_PRIV_SUP:
3990 proto_item_append_text(ti,
3992 val_to_str(val_byte, docsis_cm_cap_privacy_vals, "Reserved"));
3994 case DOCSIS_CM_CAP_FILT_SUP:
3995 proto_item_append_text(ti,
3997 val_to_str(val_byte, docsis_cm_cap_filt_vals, "Reserved"));
3999 case DOCSIS_CM_CAP_L2VPN_SUP:
4000 proto_item_append_text(ti,
4002 val_to_str(val_byte, docsis_cm_cap_l2vpn_vals, "Reserved"));
4004 case DOCSIS_CM_CAP_L2VPN_HOST_SUP:
4006 proto_item_append_text(ti,
4007 "eSAFE ifIndex %s (%i)/eSAFE MAC %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
4008 val_to_str(val_other[0], docsis_cm_cap_map_l2vpn_esafe_index_support_vals, "Reserved"),
4017 proto_item_append_text(ti,
4018 "Invalid (length should be 7, is %d)",
4022 case DOCSIS_CM_CAP_USFREQRNG_SUP:
4023 proto_item_append_text(ti,
4025 val_to_str(val_byte, docsis_cm_cap_usfreqrng_vals, "Reserved"));
4027 case DOCSIS_CM_CAP_MAPUCDRECEIPT_SUP:
4028 proto_item_append_text(ti,
4030 val_to_str(val_byte, docsis_cm_cap_map_ucd_receipt_vals, "Reserved"));
4032 case DOCSIS_CM_CAP_DPV_SUP:
4033 proto_item_append_text(ti,
4035 val_to_str(val_byte, docsis_cm_cap_map_dpv_support_vals, "Reserved"));
4037 case DOCSIS_CM_CAP_DSAID_SUP:
4038 case DOCSIS_CM_CAP_MULTTXCHAN_SUP:
4039 case DOCSIS_CM_CAP_512USTXCHAN_SUP:
4040 case DOCSIS_CM_CAP_256USTXCHAN_SUP:
4041 case DOCSIS_CM_CAP_TOTALSIDCLU_SUP:
4042 case DOCSIS_CM_CAP_MULTRXCHAN_SUP:
4043 case DOCSIS_CM_CAP_UGSPERUSFLOW_SUP:
4044 display_uint_with_range_checking(ti, val_byte, val_uint16, 0, 255);
4046 case DOCSIS_CM_CAP_USID_SUP:
4047 display_uint_with_range_checking(ti, val_byte, val_uint16,1, 255);
4049 case DOCSIS_CM_CAP_RESEQDSID_SUP:
4050 case DOCSIS_CM_CAP_MULTDSID_SUP:
4051 display_uint_with_range_checking(ti, val_byte, val_uint16, 16, 255);
4053 case DOCSIS_CM_CAP_SIDCLUPERSF_SUP:
4054 display_uint_with_range_checking(ti, val_byte, val_uint16, 2, 8);
4056 case DOCSIS_CM_CAP_TOTALDSID_SUP:
4057 display_uint_with_range_checking(ti, val_byte, val_uint16, 3, 255);
4059 case DOCSIS_CM_CAP_TET:
4060 display_uint_with_range_checking(ti, val_byte, val_uint16, 8, 64);
4062 case DOCSIS_CM_CAP_TET_MI:
4063 if ((val_byte == 1) ||
4067 proto_item_append_text(ti,
4073 proto_item_append_text(ti,
4074 " (Invalid Value %i : Should be [1,2,4]",
4078 case DOCSIS_CM_CAP_IPFILT_SUP:
4079 case DOCSIS_CM_CAP_USDROPCLASSIF_SUP:
4080 display_uint_with_range_checking(ti, val_byte, val_uint16, 64, 65535);
4082 case DOCSIS_CM_CAP_LLCFILT_SUP:
4083 display_uint_with_range_checking(ti, val_byte, val_uint16, 10, 65535);
4085 case DOCSIS_CM_CAP_RNGHLDOFF_SUP:
4086 proto_item_append_text(ti,
4088 proto_item_append_text(ti,
4089 "(0x%04x)", (val_other[0] << sizeof(guint8)) + val_other[1]);
4090 proto_item_append_text(ti,
4091 " Component Bit Mask ");
4092 proto_item_append_text(ti,
4093 "(0x%04x)", (val_other[2] << sizeof(guint8)) + val_other[3]);
4095 case DOCSIS_CM_CAP_USSYMRATE_SUP:
4096 proto_item_append_text(ti,
4097 "0x%02x", val_byte);
4099 case DOCSIS_CM_CAP_FCTF_SUP:
4100 proto_item_append_text(ti,
4102 val_to_str(val_byte, docsis_cm_cap_map_fctfc_support_vals, "Reserved"));
4104 case DOCSIS_CM_CAP_MULTDSIDFW_SUP:
4105 proto_item_append_text(ti,
4107 val_to_str(val_byte, docsis_cm_cap_map_multDsidForward_support_vals, "Reserved"));
4111 subtree = proto_item_add_subtree(ti, ett_bootp_option);
4112 if (tlv_type == DOCSIS_CM_CAP_RNGHLDOFF_SUP)
4114 for (i = 0 ; i < 4; i++)
4116 decode_bitfield_value(bit_fld,
4117 (val_other[2] << sizeof(guint8)) + val_other[3],
4118 docsis_cm_cap_ranging_hold_off_vals[i].value,
4120 proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
4121 bit_fld, docsis_cm_cap_ranging_hold_off_vals[i].strptr);
4124 if (tlv_type == DOCSIS_CM_CAP_USSYMRATE_SUP)
4126 for (i = 0 ; i < 6; i++)
4128 decode_bitfield_value(bit_fld, val_byte,docsis_cm_cap_ussymrate_vals[i].value, 16);
4129 proto_tree_add_text(subtree, tvb, off + 1, 4, "%s%s",
4130 bit_fld, docsis_cm_cap_ussymrate_vals[i].strptr);
4136 off += (tlv_len) + 2;
4140 off += (tlv_len *2) + 4;
4146 /* Definitions specific to PKT-SP-PROV-I05-021127 begin with "PKT_CCC_I05".
4147 Definitions specific to IETF draft 5 and RFC 3495 begin with "PKT_CCC_IETF".
4148 Shared definitions begin with "PKT_CCC".
4150 #define PKT_CCC_PRI_DHCP 1
4151 #define PKT_CCC_SEC_DHCP 2
4152 #define PKT_CCC_I05_SNMP 3
4153 #define PKT_CCC_IETF_PROV_SRV 3
4154 #define PKT_CCC_I05_PRI_DNS 4
4155 #define PKT_CCC_IETF_AS_KRB 4
4156 #define PKT_CCC_I05_SEC_DNS 5
4157 #define PKT_CCC_IETF_AP_KRB 5
4158 #define PKT_CCC_KRB_REALM 6
4159 #define PKT_CCC_TGT_FLAG 7
4160 #define PKT_CCC_PROV_TIMER 8
4161 #define PKT_CCC_CMS_FQDN 9
4162 #define PKT_CCC_IETF_SEC_TKT 9
4163 #define PKT_CCC_AS_KRB 10
4164 #define PKT_CCC_AP_KRB 11
4165 #define PKT_CCC_MTA_KRB_CLEAR 12
4167 static const value_string pkt_i05_ccc_opt_vals[] = {
4168 { PKT_CCC_PRI_DHCP, "Primary DHCP Server" },
4169 { PKT_CCC_SEC_DHCP, "Secondary DHCP Server" },
4170 { PKT_CCC_I05_SNMP, "SNMP Entity" },
4171 { PKT_CCC_I05_PRI_DNS, "Primary DNS Server" },
4172 { PKT_CCC_I05_SEC_DNS, "Secondary DNS Server" },
4173 { PKT_CCC_KRB_REALM, "Kerberos Realm" },
4174 { PKT_CCC_TGT_FLAG, "MTA should fetch TGT?" },
4175 { PKT_CCC_PROV_TIMER, "Provisioning Timer" },
4176 { PKT_CCC_CMS_FQDN, "CMS FQDN" },
4177 { PKT_CCC_AS_KRB, "AS-REQ/AS-REP Backoff and Retry" },
4178 { PKT_CCC_AP_KRB, "AP-REQ/AP-REP Backoff and Retry" },
4179 { PKT_CCC_MTA_KRB_CLEAR, "MTA should clear Kerberos tickets?" },
4183 static const value_string pkt_draft5_ccc_opt_vals[] = {
4184 { PKT_CCC_PRI_DHCP, "TSP's Primary DHCP Server" },
4185 { PKT_CCC_SEC_DHCP, "TSP's Secondary DHCP Server" },
4186 { PKT_CCC_IETF_PROV_SRV, "TSP's Provisioning Server" },
4187 { PKT_CCC_IETF_AS_KRB, "TSP's AS-REQ/AS-REP Backoff and Retry" },
4188 { PKT_CCC_IETF_AP_KRB, "TSP's AP-REQ/AP-REP Backoff and Retry" },
4189 { PKT_CCC_KRB_REALM, "TSP's Kerberos Realm Name" },
4190 { PKT_CCC_TGT_FLAG, "TSP's Ticket Granting Server Utilization" },
4191 { PKT_CCC_PROV_TIMER, "TSP's Provisioning Timer Value" },
4192 { PKT_CCC_IETF_SEC_TKT, "PacketCable Security Ticket Control" },
4196 static const value_string pkt_i05_ccc_ticket_ctl_vals[] = {
4197 { 1, "Invalidate Provisioning Application Server's ticket" },
4198 { 2, "Invalidate all CMS Application Server tickets" },
4199 { 3, "Invalidate all Application Server tickets" },
4204 dissect_packetcable_i05_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4205 tvbuff_t *tvb, int optoff, int optend)
4207 int suboptoff = optoff;
4208 guint8 subopt, subopt_len, fetch_tgt, timer_val, ticket_ctl;
4209 proto_tree *pkt_s_tree;
4212 subopt = tvb_get_guint8(tvb, optoff);
4215 if (suboptoff >= optend) {
4216 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR, "Suboption %d: no room left in option for suboption length", subopt);
4220 subopt_len = tvb_get_guint8(tvb, optoff);
4223 vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
4224 "Suboption %u: %s: ", subopt,
4225 val_to_str(subopt, pkt_i05_ccc_opt_vals, "unknown/reserved") );
4229 case PKT_CCC_PRI_DHCP: /* String values */
4230 case PKT_CCC_SEC_DHCP:
4231 case PKT_CCC_I05_SNMP:
4232 case PKT_CCC_I05_PRI_DNS:
4233 case PKT_CCC_I05_SEC_DNS:
4234 case PKT_CCC_KRB_REALM:
4235 case PKT_CCC_CMS_FQDN:
4236 proto_item_append_text(vti, "%s (%u byte%s)",
4237 tvb_format_stringzpad(tvb, suboptoff, subopt_len),
4239 plurality(subopt_len, "", "s") );
4240 suboptoff += subopt_len;
4243 case PKT_CCC_TGT_FLAG:
4244 if (suboptoff+1 > optend) {
4245 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4248 fetch_tgt = tvb_get_guint8(tvb, suboptoff);
4249 proto_item_append_text(vti, "%s (%u byte%s%s)",
4250 fetch_tgt ? "Yes" : "No",
4252 plurality(subopt_len, "", "s"),
4253 subopt_len != 1 ? " [Invalid]" : "");
4254 suboptoff += subopt_len;
4257 case PKT_CCC_PROV_TIMER:
4258 if (suboptoff+1 > optend) {
4259 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4262 timer_val = tvb_get_guint8(tvb, suboptoff);
4263 proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
4264 timer_val > 30 ? " [Invalid]" : "",
4266 plurality(subopt_len, "", "s"),
4267 subopt_len != 1 ? " [Invalid]" : "");
4268 suboptoff += subopt_len;
4271 case PKT_CCC_AS_KRB:
4272 if (suboptoff+12 > optend) {
4273 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4276 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
4277 plurality(subopt_len, "", "s"),
4278 subopt_len != 12 ? " [Invalid]" : "");
4279 if (subopt_len == 12) {
4280 pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
4281 proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
4282 "pktcMtaDevRealmUnsolicitedKeyNomTimeout: %u",
4283 tvb_get_ntohl(tvb, suboptoff));
4284 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 4, 4,
4285 "pktcMtaDevRealmUnsolicitedKeyMaxTimeout: %u",
4286 tvb_get_ntohl(tvb, suboptoff + 4));
4287 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 8, 4,
4288 "pktcMtaDevRealmUnsolicitedKeyMaxRetries: %u",
4289 tvb_get_ntohl(tvb, suboptoff + 8));
4291 suboptoff += subopt_len;
4294 case PKT_CCC_AP_KRB:
4295 if (suboptoff+12 > optend) {
4296 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4299 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
4300 plurality(subopt_len, "", "s"),
4301 subopt_len != 12 ? " [Invalid]" : "");
4302 if (subopt_len == 12) {
4303 pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
4304 proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
4305 "pktcMtaDevProvUnsolicitedKeyNomTimeout: %u",
4306 tvb_get_ntohl(tvb, suboptoff));
4307 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 4, 4,
4308 "pktcMtaDevProvUnsolicitedKeyMaxTimeout: %u",
4309 tvb_get_ntohl(tvb, suboptoff + 4));
4310 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 8, 4,
4311 "pktcMtaDevProvUnsolicitedKeyMaxRetries: %u",
4312 tvb_get_ntohl(tvb, suboptoff + 8));
4314 suboptoff += subopt_len;
4317 case PKT_CCC_MTA_KRB_CLEAR:
4318 if (suboptoff+1 > optend) {
4319 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4322 ticket_ctl = tvb_get_guint8(tvb, suboptoff);
4323 proto_item_append_text(vti, "%s (%u) (%u byte%s%s)",
4324 val_to_str (ticket_ctl, pkt_i05_ccc_ticket_ctl_vals, "unknown/invalid"),
4327 plurality(subopt_len, "", "s"),
4328 subopt_len != 1 ? " [Invalid]" : "");
4329 suboptoff += subopt_len;
4333 suboptoff += subopt_len;
4341 static const value_string sec_tcm_vals[] = {
4342 { 1 << 0, "PacketCable Provisioning Server" },
4343 { 1 << 1, "All PacketCable Call Management Servers" },
4348 dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
4349 tvbuff_t *tvb, int optoff, int optend, int revision)
4351 int suboptoff = optoff;
4352 guint8 subopt, subopt_len;
4354 guint8 prov_type, fetch_tgt, timer_val;
4356 proto_tree *pkt_s_tree;
4358 int max_timer_val = 255, i;
4359 const guchar *dns_name;
4362 subopt = tvb_get_guint8(tvb, suboptoff);
4365 if (suboptoff >= optend) {
4366 expert_add_info_format(pinfo, v_ti, PI_PROTOCOL, PI_ERROR,
4367 "Suboption %d: no room left in option for suboption length", subopt);
4370 subopt_len = tvb_get_guint8(tvb, suboptoff);
4373 vti = proto_tree_add_text(v_tree, tvb, optoff, subopt_len + 2,
4374 "Suboption %u: %s: ", subopt,
4375 val_to_str(subopt, pkt_draft5_ccc_opt_vals, "unknown/reserved") );
4379 case PKT_CCC_PRI_DHCP: /* IPv4 values */
4380 case PKT_CCC_SEC_DHCP:
4381 if (suboptoff+4 > optend) {
4382 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4385 ipv4addr = tvb_get_ipv4(tvb, suboptoff);
4386 proto_item_append_text(vti, "%s (%u byte%s%s)",
4387 ip_to_str((guint8 *)&ipv4addr),
4389 plurality(subopt_len, "", "s"),
4390 subopt_len != 4 ? " [Invalid]" : "");
4391 suboptoff += subopt_len;
4394 case PKT_CCC_IETF_PROV_SRV:
4395 if (suboptoff+1 > optend) {
4396 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4399 prov_type = tvb_get_guint8(tvb, suboptoff);
4401 switch (prov_type) {
4404 get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name);
4405 proto_item_append_text(vti, "%s (%u byte%s)", dns_name,
4406 subopt_len - 1, plurality(subopt_len, "", "s") );
4410 if (suboptoff+4 > optend) {
4411 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4414 ipv4addr = tvb_get_ipv4(tvb, suboptoff);
4415 proto_item_append_text(vti, "%s (%u byte%s%s)",
4416 ip_to_str((guint8 *)&ipv4addr),
4418 plurality(subopt_len, "", "s"),
4419 subopt_len != 5 ? " [Invalid]" : "");
4423 proto_item_append_text(vti, "Invalid type: %u (%u byte%s)",
4426 plurality(subopt_len, "", "s") );
4429 suboptoff += subopt_len - 1;
4432 case PKT_CCC_IETF_AS_KRB:
4433 if (suboptoff+12 > optend) {
4434 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4437 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
4438 plurality(subopt_len, "", "s"),
4439 subopt_len != 12 ? " [Invalid]" : "");
4440 if (subopt_len == 12) {
4441 pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
4442 proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
4443 "pktcMtaDevRealmUnsolicitedKeyNomTimeout: %u",
4444 tvb_get_ntohl(tvb, suboptoff));
4445 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 4, 4,
4446 "pktcMtaDevRealmUnsolicitedKeyMaxTimeout: %u",
4447 tvb_get_ntohl(tvb, suboptoff + 4));
4448 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 8, 4,
4449 "pktcMtaDevRealmUnsolicitedKeyMaxRetries: %u",
4450 tvb_get_ntohl(tvb, suboptoff + 8));
4452 suboptoff += subopt_len;
4455 case PKT_CCC_IETF_AP_KRB:
4456 proto_item_append_text(vti, "(%u byte%s%s)", subopt_len,
4457 plurality(subopt_len, "", "s"),
4458 subopt_len != 12 ? " [Invalid]" : "");
4459 if (subopt_len == 12) {
4460 pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
4461 proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 4,
4462 "pktcMtaDevProvUnsolicitedKeyNomTimeout: %u",
4463 tvb_get_ntohl(tvb, suboptoff));
4464 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 4, 4,
4465 "pktcMtaDevProvUnsolicitedKeyMaxTimeout: %u",
4466 tvb_get_ntohl(tvb, suboptoff + 4));
4467 proto_tree_add_text(pkt_s_tree, tvb, suboptoff + 8, 4,
4468 "pktcMtaDevProvUnsolicitedKeyMaxRetries: %u",
4469 tvb_get_ntohl(tvb, suboptoff + 8));
4471 suboptoff += subopt_len;
4474 case PKT_CCC_KRB_REALM: /* String values */
4475 get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name);
4476 proto_item_append_text(vti, "%s (%u byte%s)", dns_name,
4477 subopt_len, plurality(subopt_len, "", "s") );
4478 suboptoff += subopt_len;
4481 case PKT_CCC_TGT_FLAG:
4482 if (suboptoff+1 > optend) {
4483 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4486 fetch_tgt = tvb_get_guint8(tvb, suboptoff);
4487 proto_item_append_text(vti, "%s (%u byte%s%s)",
4488 fetch_tgt ? "Yes" : "No",
4490 plurality(subopt_len, "", "s"),
4491 subopt_len != 1 ? " [Invalid]" : "");
4495 case PKT_CCC_PROV_TIMER:
4496 if (suboptoff+1 > optend) {
4497 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4500 if (revision == PACKETCABLE_CCC_DRAFT5)
4502 timer_val = tvb_get_guint8(tvb, suboptoff);
4503 proto_item_append_text(vti, "%u%s (%u byte%s%s)", timer_val,
4504 timer_val > max_timer_val ? " [Invalid]" : "",
4506 plurality(subopt_len, "", "s"),
4507 subopt_len != 1 ? " [Invalid]" : "");
4511 case PKT_CCC_IETF_SEC_TKT:
4512 if (suboptoff+2 > optend) {
4513 expert_add_info_format(pinfo, vti, PI_PROTOCOL, PI_ERROR, "no room left in option for suboption value");
4516 sec_tcm = tvb_get_ntohs(tvb, suboptoff);
4517 proto_item_append_text(vti, "0x%04x (%u byte%s%s)", sec_tcm, subopt_len,
4518 plurality(subopt_len, "", "s"),
4519 subopt_len != 2 ? " [Invalid]" : "");
4520 if (subopt_len == 2) {
4521 pkt_s_tree = proto_item_add_subtree(vti, ett_bootp_option);
4522 for (i = 0; i < 2; i++) {
4523 if (sec_tcm & sec_tcm_vals[i].value) {
4524 decode_bitfield_value(bit_fld, sec_tcm, sec_tcm_vals[i].value, 16);
4525 proto_tree_add_text(pkt_s_tree, tvb, suboptoff, 2, "%sInvalidate %s",
4526 bit_fld, sec_tcm_vals[i].strptr);
4530 suboptoff += subopt_len;
4534 suboptoff += subopt_len;
4540 #define BOOTREQUEST 1
4543 static const value_string op_vals[] = {
4544 { BOOTREQUEST, "Boot Request" },
4545 { BOOTREPLY, "Boot Reply" },
4550 dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4552 proto_tree *bp_tree;
4554 proto_tree *flag_tree;
4555 proto_item *fi, *hidden_item;
4558 int voff, eoff, tmpvoff; /* vendor offset, end offset */
4561 const char *dhcp_type = NULL;
4562 const guint8 *vendor_class_id = NULL;
4563 guint16 flags, secs;
4565 guint8 overload = 0; /* DHCP option overload */
4567 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BOOTP");
4569 * In case we throw an exception fetching the opcode, etc.
4571 col_clear(pinfo->cinfo, COL_INFO);
4573 op = tvb_get_guint8(tvb, 0);
4574 htype = tvb_get_guint8(tvb, 1);
4575 hlen = tvb_get_guint8(tvb, 2);
4579 if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
4581 col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s (%s)",
4582 tvb_arphrdaddr_to_str(tvb, 28, hlen, htype),
4583 get_ether_name(tvb_get_ptr(tvb, 28, hlen)));
4586 col_add_fstr(pinfo->cinfo, COL_INFO, "Boot Request from %s",
4587 tvb_arphrdaddr_to_str(tvb, 28, hlen, htype));
4592 col_set_str(pinfo->cinfo, COL_INFO, "Boot Reply");
4596 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown BOOTP message type (%u)", op);
4600 voff = VENDOR_INFO_OFFSET;
4602 /* rfc2132 says it SHOULD exist, not that it MUST exist */
4603 if (tvb_bytes_exist(tvb, voff, 4) &&
4604 (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
4609 eoff = tvb_reported_length(tvb);
4612 * In the first pass, we just look for the DHCP message type
4613 * and Vendor class identifier options.
4617 while (tmpvoff < eoff && !at_end) {
4618 offset_delta = bootp_option(tvb, pinfo, 0, tmpvoff, eoff, TRUE, &at_end,
4619 &dhcp_type, &vendor_class_id, &overload);
4620 if (offset_delta <= 0) {
4621 THROW(ReportedBoundsError);
4623 tmpvoff += offset_delta;
4627 * If there was a DHCP message type option, flag this packet
4630 if (dhcp_type != NULL) {
4632 * Yes, this is a DHCP packet, and "dhcp_type" is the
4635 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCP");
4637 col_add_fstr(pinfo->cinfo, COL_INFO, "DHCP %-8s - Transaction ID 0x%x",
4638 dhcp_type, tvb_get_ntohl(tvb, 4));
4639 tap_queue_packet( bootp_dhcp_tap, pinfo, dhcp_type);
4643 * OK, now build the protocol tree.
4646 ti = proto_tree_add_item(tree, proto_bootp, tvb, 0, -1, ENC_NA);
4647 bp_tree = proto_item_add_subtree(ti, ett_bootp);
4649 proto_tree_add_uint(bp_tree, hf_bootp_type, tvb,
4652 proto_tree_add_uint_format_value(bp_tree, hf_bootp_hw_type, tvb,
4656 arphrdtype_to_str(htype,
4657 "Unknown (0x%02x)"));
4658 proto_tree_add_uint(bp_tree, hf_bootp_hw_len, tvb,
4660 proto_tree_add_item(bp_tree, hf_bootp_hops, tvb,
4661 3, 1, ENC_BIG_ENDIAN);
4662 proto_tree_add_item(bp_tree, hf_bootp_id, tvb,
4663 4, 4, ENC_BIG_ENDIAN);
4665 * Windows (98, XP and Vista tested) sends the "secs" value on
4666 * the wire formatted as little-endian. See if the LE value
4669 secs = tvb_get_letohs(tvb, 8);
4670 if (secs > 0 && secs <= 0xff) {
4671 ti = proto_tree_add_uint_format_value(bp_tree, hf_bootp_secs, tvb,
4672 8, 2, secs, "%u", secs);
4673 expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_NOTE,
4674 "Seconds elapsed (%u) appears to be encoded as little-endian", secs);
4676 proto_tree_add_item(bp_tree, hf_bootp_secs, tvb,
4677 8, 2, ENC_BIG_ENDIAN);
4679 flags = tvb_get_ntohs(tvb, 10);
4680 fi = proto_tree_add_uint(bp_tree, hf_bootp_flags, tvb,
4682 proto_item_append_text(fi, " (%s)",
4683 (flags & BOOTP_BC) ? "Broadcast" : "Unicast");
4684 flag_tree = proto_item_add_subtree(fi, ett_bootp_flags);
4685 proto_tree_add_boolean(flag_tree, hf_bootp_flags_broadcast, tvb,
4687 proto_tree_add_uint(flag_tree, hf_bootp_flags_reserved, tvb,
4689 proto_tree_add_item(bp_tree, hf_bootp_ip_client, tvb,
4690 12, 4, ENC_BIG_ENDIAN);
4691 proto_tree_add_item(bp_tree, hf_bootp_ip_your, tvb,
4692 16, 4, ENC_BIG_ENDIAN);
4693 proto_tree_add_item(bp_tree, hf_bootp_ip_server, tvb,
4694 20, 4, ENC_BIG_ENDIAN);
4695 proto_tree_add_item(bp_tree, hf_bootp_ip_relay, tvb,
4696 24, 4, ENC_BIG_ENDIAN);
4698 if (hlen > 0 && hlen <= 16) {
4699 if ((htype == ARPHRD_ETHER || htype == ARPHRD_IEEE802)
4701 proto_tree_add_item(bp_tree, hf_bootp_hw_ether_addr, tvb, 28, 6, ENC_NA);
4703 /* The chaddr element is 16 bytes in length,
4704 although only the first hlen bytes are used */
4705 proto_tree_add_bytes_format_value(bp_tree, hf_bootp_hw_addr, tvb, 28, 16,
4706 NULL, "%s", tvb_arphrdaddr_to_str(tvb, 28, hlen, htype));
4707 if ((16 - hlen) > 0)
4708 proto_tree_add_item(bp_tree, hf_bootp_hw_addr_padding, tvb, 28+hlen, 16-hlen, ENC_NA);
4710 proto_tree_add_text(bp_tree, tvb,
4711 28, 16, "Client address not given");
4714 if (overload & OPT_OVERLOAD_SNAME) {
4715 proto_tree_add_text (bp_tree, tvb,
4716 SERVER_NAME_OFFSET, SERVER_NAME_LEN,
4717 "Server name option overloaded by DHCP");
4719 /* The server host name is optional */
4720 if (tvb_get_guint8(tvb, SERVER_NAME_OFFSET) != '\0') {
4721 proto_tree_add_item(bp_tree, hf_bootp_server, tvb,
4723 SERVER_NAME_LEN, ENC_ASCII|ENC_NA);
4726 proto_tree_add_string_format(bp_tree, hf_bootp_server, tvb,
4729 "", "Server host name not given");
4733 if (overload & OPT_OVERLOAD_FILE) {
4734 proto_tree_add_text (bp_tree, tvb,
4735 FILE_NAME_OFFSET, FILE_NAME_LEN,
4736 "Boot file name option overloaded by DHCP");
4738 /* Boot file is optional */
4739 if (tvb_get_guint8(tvb, FILE_NAME_OFFSET) != '\0') {
4740 proto_tree_add_item(bp_tree, hf_bootp_file, tvb,
4742 FILE_NAME_LEN, ENC_ASCII|ENC_NA);
4744 proto_tree_add_string_format(bp_tree, hf_bootp_file, tvb,
4747 "", "Boot file name not given");
4751 voff = VENDOR_INFO_OFFSET;
4752 if (dhcp_type != NULL) {
4753 hidden_item = proto_tree_add_boolean(bp_tree, hf_bootp_dhcp, tvb, 0, 0, 1);
4754 PROTO_ITEM_SET_HIDDEN(hidden_item);
4756 if (tvb_bytes_exist(tvb, voff, 4) &&
4757 (tvb_get_ntohl(tvb, voff) == 0x63825363)) {
4758 ip_addr = tvb_get_ipv4(tvb, voff);
4759 proto_tree_add_ipv4_format_value(bp_tree, hf_bootp_cookie, tvb,
4760 voff, 4, ip_addr, "DHCP");
4763 proto_tree_add_text(bp_tree, tvb,
4764 voff, 64, "Bootp vendor specific options");
4769 while (voff < eoff && !at_end) {
4770 offset_delta = bootp_option(tvb, pinfo, bp_tree, voff, eoff, FALSE, &at_end,
4771 &dhcp_type, &vendor_class_id, &overload);
4772 if (offset_delta <= 0) {
4773 THROW(ReportedBoundsError);
4775 voff += offset_delta;
4777 if ((dhcp_type != NULL) && (!at_end))
4779 expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_ERROR, "End option missing");
4783 * Padding after the end option.
4785 proto_tree_add_text(bp_tree, tvb, voff, eoff - voff, "Padding");
4790 bootp_init_protocol(void)
4794 /* first copy default_bootp_opt[] to bootp_opt[]. This resets all values to default */
4795 for(i=0; i<BOOTP_OPT_NUM; i++)
4797 bootp_opt[i].text = default_bootp_opt[i].text;
4798 bootp_opt[i].ftype = default_bootp_opt[i].ftype;
4799 bootp_opt[i].phf = default_bootp_opt[i].phf;
4802 /* Now apply the custom options */
4803 for (i = 0; i < num_bootp_records_uat; i++)
4805 bootp_opt[uat_bootp_records[i].opt].text = se_strdup(uat_bootp_records[i].text);
4806 bootp_opt[uat_bootp_records[i].opt].ftype = uat_bootp_records[i].ftype;
4807 bootp_opt[uat_bootp_records[i].opt].phf = NULL;
4812 proto_register_bootp(void)
4814 static const value_string bootp_custom_type_vals[] = {
4815 { ipv4, "IP Address"},
4816 { ipv4_list, "IP Address List" },
4817 { string, "string" },
4819 { val_boolean, "boolean" },
4820 { val_u_byte, "byte" },
4821 { val_u_short, "unsigned short" },
4822 { val_u_short_list, "unsigned short list" },
4823 { val_u_long, "unsigned long" },
4824 { time_in_s_secs, "integer time in seconds" },
4825 { time_in_u_secs, "unsigned integer time in seconds" },
4829 static hf_register_info hf[] = {
4831 { "Frame is DHCP", "bootp.dhcp", FT_BOOLEAN,
4832 BASE_NONE, NULL, 0x0,
4836 { "Message type", "bootp.type", FT_UINT8,
4837 BASE_DEC, VALS(op_vals), 0x0,
4840 { &hf_bootp_hw_type,
4841 { "Hardware type", "bootp.hw.type", FT_UINT8,
4842 BASE_HEX, NULL, 0x0,
4846 { "Hardware address length", "bootp.hw.len", FT_UINT8,
4847 BASE_DEC, NULL, 0x0,
4851 { "Hops", "bootp.hops", FT_UINT8,
4852 BASE_DEC, NULL, 0x0,
4856 { "Transaction ID", "bootp.id", FT_UINT32,
4857 BASE_HEX, NULL, 0x0,
4861 { "Seconds elapsed", "bootp.secs", FT_UINT16,
4862 BASE_DEC, NULL, 0x0,
4866 { "Bootp flags", "bootp.flags", FT_UINT16,
4867 BASE_HEX, NULL, 0x0,
4870 { &hf_bootp_flags_broadcast,
4871 { "Broadcast flag", "bootp.flags.bc", FT_BOOLEAN,
4872 16, TFS(&flag_set_broadcast), BOOTP_BC,
4875 { &hf_bootp_flags_reserved,
4876 { "Reserved flags", "bootp.flags.reserved", FT_UINT16,
4877 BASE_HEX, NULL, BOOTP_MBZ,
4880 { &hf_bootp_ip_client,
4881 { "Client IP address", "bootp.ip.client",FT_IPv4,
4882 BASE_NONE, NULL, 0x0,
4885 { &hf_bootp_ip_your,
4886 { "Your (client) IP address", "bootp.ip.your", FT_IPv4,
4887 BASE_NONE, NULL, 0x0,
4890 { &hf_bootp_ip_server,
4891 { "Next server IP address", "bootp.ip.server",FT_IPv4,
4892 BASE_NONE, NULL, 0x0,
4895 { &hf_bootp_ip_relay,
4896 { "Relay agent IP address", "bootp.ip.relay", FT_IPv4,
4897 BASE_NONE, NULL, 0x0,
4900 { &hf_bootp_hw_addr,
4901 { "Client hardware address", "bootp.hw.addr", FT_BYTES,
4902 BASE_NONE, NULL, 0x0,
4905 { &hf_bootp_hw_addr_padding,
4906 { "Client hardware address padding", "bootp.hw.addr_padding", FT_BYTES,
4907 BASE_NONE, NULL, 0x0,
4910 { &hf_bootp_hw_ether_addr,
4911 { "Client MAC address", "bootp.hw.mac_addr", FT_ETHER,
4912 BASE_NONE, NULL, 0x0,
4916 { "Server host name", "bootp.server", FT_STRING,
4917 BASE_NONE, NULL, 0x0,
4921 { "Boot file name", "bootp.file", FT_STRING,
4922 BASE_NONE, NULL, 0x0,
4926 { "Magic cookie", "bootp.cookie", FT_IPv4,
4927 BASE_NONE, NULL, 0x0,
4931 { "Bootp Vendor Options", "bootp.vendor", FT_BYTES,
4932 BASE_NONE, NULL, 0x0,
4936 { "Server", "bootp.fqdn.s", FT_BOOLEAN,
4937 8, TFS(&tfs_fqdn_s), F_FQDN_S,
4938 "If true, server should do DDNS update", HFILL }},
4941 { "Server overrides", "bootp.fqdn.o", FT_BOOLEAN,
4942 8, TFS(&tfs_fqdn_o), F_FQDN_O,
4943 "If true, server insists on doing DDNS update", HFILL }},
4946 { "Encoding", "bootp.fqdn.e", FT_BOOLEAN,
4947 8, TFS(&tfs_fqdn_e), F_FQDN_E,
4948 "If true, name is binary encoded", HFILL }},
4951 { "Server DDNS", "bootp.fqdn.n", FT_BOOLEAN,
4952 8, TFS(&tfs_fqdn_n), F_FQDN_N,
4953 "If true, server should not do any DDNS updates", HFILL }},
4955 { &hf_bootp_fqdn_mbz,
4956 { "Reserved flags", "bootp.fqdn.mbz",FT_UINT8,
4957 BASE_HEX, NULL, F_FQDN_MBZ,
4960 { &hf_bootp_fqdn_rcode1,
4961 { "A-RR result", "bootp.fqdn.rcode1", FT_UINT8,
4962 BASE_DEC, NULL, 0x0,
4963 "Result code of A-RR update", HFILL }},
4965 { &hf_bootp_fqdn_rcode2,
4966 { "PTR-RR result", "bootp.fqdn.rcode2", FT_UINT8,
4967 BASE_DEC, NULL, 0x0,
4968 "Result code of PTR-RR update", HFILL }},
4970 { &hf_bootp_fqdn_name,
4971 { "Client name", "bootp.fqdn.name", FT_STRING,
4972 BASE_NONE, NULL, 0x0,
4973 "Name to register via DDNS", HFILL }},
4975 { &hf_bootp_fqdn_asciiname,
4976 { "Client name", "bootp.fqdn.name", FT_STRING,
4977 BASE_NONE, NULL, 0x0,
4978 "Name to register via DDNS", HFILL }},
4980 { &hf_bootp_pkt_mta_cap_len,
4981 { "MTA DC Length", "bootp.vendor.pktc.mta_cap_len", FT_UINT8,
4982 BASE_DEC, NULL, 0x0,
4983 "PacketCable MTA Device Capabilities Length", HFILL }},
4985 { &hf_bootp_docsis_cm_cap_len,
4986 { "CM DC Length", "bootp.vendor.docsis.cm_cap_len", FT_UINT8,
4987 BASE_DEC, NULL, 0x0,
4988 "DOCSIS Cable Modem Device Capabilities Length", HFILL }},
4990 { &hf_bootp_docsis_cm_cap_type,
4991 { "CM DC Type", "bootp.docsis_cm_cap_type", FT_UINT16,
4992 BASE_DEC, VALS(docsis_cm_cap_type_vals), 0x0,
4993 "Docsis Cable Modem Device Capability type", HFILL }},
4995 { &hf_bootp_client_identifier_uuid,
4996 { "Client Identifier (UUID)", "bootp.client_id_uuid", FT_GUID,
4997 BASE_NONE, NULL, 0x0,
4998 "Client Machine Identifier (UUID)", HFILL }},
5000 { &hf_bootp_option_type,
5001 { "Option", "bootp.option.type", FT_UINT8,
5002 BASE_DEC, NULL, 0x0,
5003 "Bootp/Dhcp option type", HFILL }},
5005 { &hf_bootp_option_length,
5006 { "Length", "bootp.option.length", FT_UINT8,
5007 BASE_DEC, NULL, 0x0,
5008 "Bootp/Dhcp option length", HFILL }},
5010 { &hf_bootp_suboption_length,
5011 { "Length", "bootp.option.suboption_length", FT_UINT8,
5012 BASE_DEC, NULL, 0x0,
5013 "Suboption length", HFILL }},
5015 { &hf_bootp_option_value, { "Value", "bootp.option.value", FT_BYTES, BASE_NONE, NULL, 0x0, "Bootp/Dhcp option value", HFILL }},
5016 { &hf_bootp_option_value_8, { "Value", "bootp.option.value", FT_UINT8, BASE_DEC, NULL, 0x0, "8-bit Bootp/Dhcp option value", HFILL }},
5017 { &hf_bootp_option_value_16, { "Value", "bootp.option.value", FT_UINT16, BASE_DEC, NULL, 0x0, "16-bit Bootp/Dhcp option value", HFILL }},
5018 { &hf_bootp_option_value_u32, { "Value", "bootp.option.value", FT_UINT32, BASE_HEX, NULL, 0x0, "32-bit Bootp/Dhcp option value", HFILL }},
5019 { &hf_bootp_option_value_i32, { "Value", "bootp.option.value", FT_INT32, BASE_DEC, NULL, 0x0, "32-bit Bootp/Dhcp option value", HFILL }},
5020 { &hf_bootp_option_value_stringz, { "Value", "bootp.option.value", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Z-String Bootp/Dhcp option value", HFILL }},
5021 { &hf_bootp_option_value_ip_address, { "Value", "bootp.option.value", FT_IPv4, BASE_NONE, NULL, 0x00, "IP address Bootp/Dhcp option value", HFILL }},
5022 { &hf_bootp_option_value_boolean, { "Value", "bootp.option.value", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x00, "Boolean Bootp/Dhcp option value", HFILL }},
5023 { &hf_bootp_option_padding, { "Padding", "bootp.option.padding", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 0: Padding", HFILL }},
5024 { &hf_bootp_option_subnet_mask, { "Subnet Mask", "bootp.option.subnet_mask", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 1: Subnet Mask", HFILL }},
5025 { &hf_bootp_option_time_offset, { "Time Offset", "bootp.option.time_offset", FT_INT32, BASE_DEC, NULL, 0x00, "Option 2: Time Offset", HFILL }},
5026 { &hf_bootp_option_router, { "Router", "bootp.option.router", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 3: Router", HFILL }},
5027 { &hf_bootp_option_time_server, { "Time Server", "bootp.option.time_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 4: Time Server", HFILL }},
5028 { &hf_bootp_option_name_server, { "Name Server", "bootp.option.name_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 5: Name Server", HFILL }},
5029 { &hf_bootp_option_domain_name_server, { "Domain Name Server", "bootp.option.domain_name_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 6: Domain Name Server", HFILL }},
5030 { &hf_bootp_option_log_server, { "Log Server", "bootp.option.log_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 7: Log Server", HFILL }},
5031 { &hf_bootp_option_quotes_server, { "Quotes Server", "bootp.option.quotes_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 8: Quotes Server", HFILL }},
5032 { &hf_bootp_option_lpr_server, { "LPR Server", "bootp.option.lpr_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 9: LPR Server", HFILL }},
5033 { &hf_bootp_option_impress_server, { "Impress Server", "bootp.option.impress_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 10: Impress Server", HFILL }},
5034 { &hf_bootp_option_resource_location_server, { "Resource Location Server", "bootp.option.resource_location_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 11: Resource Location Server", HFILL }},
5035 { &hf_bootp_option_hostname, { "Host Name", "bootp.option.hostname", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 12: Host Name", HFILL }},
5036 { &hf_bootp_option_boot_file_size, { "Boot File Size", "bootp.option.boot_file_size", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 13: Boot File Size", HFILL }},
5037 { &hf_bootp_option_merit_dump_file, { "Merit Dump File", "bootp.option.merit_dump_file", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 14: Merit Dump File", HFILL }},
5038 { &hf_bootp_option_domain_name, { "Domain Name", "bootp.option.domain_name", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 15: Domain Name", HFILL }},
5039 { &hf_bootp_option_swap_server, { "Swap Server", "bootp.option.swap_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 16: Swap Server", HFILL }},
5040 { &hf_bootp_option_root_path, { "Root Path", "bootp.option.root_path", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 17: Root Path", HFILL }},
5041 { &hf_bootp_option_extension_path, { "Extensions Path", "bootp.option.extension_path", FT_STRINGZ, BASE_NONE, NULL, 0x0,"Option 18: Extensions Path", HFILL }},
5042 { &hf_bootp_option_ip_forwarding, { "IP Forwarding", "bootp.option.ip_forwarding", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 19: IP Forwarding", HFILL }},
5043 { &hf_bootp_option_policy_filter_ip, { "IP Address", "bootp.option.policy_filter.ip", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 21: IP address", HFILL }},
5044 { &hf_bootp_option_policy_filter_subnet_mask, { "Subnet Mask", "bootp.option.policy_filter.subnet_mask", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 21: Subnet Mask", HFILL }},
5045 { &hf_bootp_option_non_local_source_routing, { "Non-Local Source Routing", "bootp.option.non_local_source_routing", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 20: Non-Local Source Routing", HFILL }},
5046 { &hf_bootp_option_max_datagram_reassembly_size, { "Maximum Datagram Reassembly Size", "bootp.option.max_datagram_reassembly_size", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 22: Maximum Datagram Reassembly Size", HFILL }},
5047 { &hf_bootp_option_default_ip_ttl, { "Default IP Time-to-Live", "bootp.option.default_ip_ttl", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 23: Default IP Time-to-Live", HFILL }},
5048 { &hf_bootp_option_path_mtu_aging_timeout, { "Path MTU Aging Timeout", "bootp.option.path_mtu_aging_timeout", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 24: Path MTU Aging Timeout", HFILL }},
5049 { &hf_bootp_option_path_mtu_plateau_table_item, { "Path MTU Plateau Table Item", "bootp.option.path_mtu_plateau_table_item", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 25: Path MTU Plateau Table Item", HFILL }},
5050 { &hf_bootp_option_interface_mtu, { "Interface MTU", "bootp.option.interface_mtu", FT_UINT16, BASE_DEC, NULL, 0x0,"Option 26: Interface MTU", HFILL }},
5051 { &hf_bootp_option_all_subnets_are_local, { "All Subnets are Local", "bootp.option.all_subnets_are_local", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x00, "Option 27: All Subnets are Local", HFILL }},
5052 { &hf_bootp_option_broadcast_address, { "Broadcast Address", "bootp.option.broadcast_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 28: Broadcast Address", HFILL }},
5053 { &hf_bootp_option_perform_mask_discovery, { "Perform Mask Discovery", "bootp.option.perform_mask_discovery", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 29: Perform Mask Discovery", HFILL }},
5054 { &hf_bootp_option_mask_supplier, { "Mask Supplier", "bootp.option.mask_supplier", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x00, "Option 30: Mask Supplier", HFILL }},
5055 { &hf_bootp_option_perform_router_discover, { "Perform Router Discover", "bootp.option.perform_router_discover", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 31: Perform Router Discover", HFILL }},
5056 { &hf_bootp_option_router_solicitation_address, { "Router Solicitation Address", "bootp.option.router_solicitation_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 32: Router Solicitation Address", HFILL }},
5057 { &hf_bootp_option_static_route_ip, { "Destination IP Address", "bootp.option.static_route.ip", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 33: Destination IP address", HFILL }},
5058 { &hf_bootp_option_static_route_router, { "Destination Router", "bootp.option.static_route.router", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 33: Destination Router", HFILL }},
5059 { &hf_bootp_option_trailer_encapsulation, { "Trailer Encapsulation", "bootp.option.trailer_encapsulation", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 34: Trailer Encapsulation", HFILL }},
5060 { &hf_bootp_option_arp_cache_timeout, { "ARP Cache Timeout", "bootp.option.arp_cache_timeout", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 35: ARP Cache Timeout", HFILL }},
5061 { &hf_bootp_option_ethernet_encapsulation, { "Ethernet Encapsulation", "bootp.option.ethernet_encapsulation", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 36: Ethernet Encapsulation", HFILL }},
5062 { &hf_bootp_option_tcp_default_ttl, { "TCP Default TTL", "bootp.option.tcp_default_ttl", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 37: TCP Default TTL", HFILL }},
5063 { &hf_bootp_option_tcp_keepalive_interval, { "TCP Keepalive Interval", "bootp.option.tcp_keepalive_interval", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 38: TCP Keepalive Interval", HFILL }},
5064 { &hf_bootp_option_tcp_keepalive_garbage, { "TCP Keepalive Garbage", "bootp.option.tcp_keepalive_garbage", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x00, "Option 39: TCP Keepalive Garbage", HFILL }},
5065 { &hf_bootp_option_nis_domain, { "Network Information Service Domain", "bootp.option.nis_domain", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 40: Network Information Service Domain", HFILL }},
5066 { &hf_bootp_option_nis_server, { "Network Information Service Server", "bootp.option.nis_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 41: Network Information Service Server", HFILL }},
5067 { &hf_bootp_option_ntp_server, { "Network Time Protocol Server", "bootp.option.ntp_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 42: Network Time Protocol Server", HFILL }},
5069 { &hf_bootp_option43_value, { "Value", "bootp.option.vendor.value", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43: Suboption value", HFILL }},
5070 { &hf_bootp_option43_value_8, { "Value", "bootp.option.vendor.value", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43: Suboption 8-bit value", HFILL }},
5071 { &hf_bootp_option43_value_16, { "Value", "bootp.option.vendor.value", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 43: Suboption 16-bit value", HFILL }},
5072 { &hf_bootp_option43_value_32, { "Value", "bootp.option.vendor.value", FT_UINT32, BASE_DEC, NULL, 0x0, "Option 43: Suboption 32-bit value", HFILL }},
5073 { &hf_bootp_option43_value_stringz, { "Value", "bootp.option.vendor.value", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43: Suboption Z-String value", HFILL }},
5074 { &hf_bootp_option43_value_ip_address, { "Value", "bootp.option.vendor.value", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 43: Suboption IP address", HFILL }},
5076 { &hf_bootp_option43_pxeclient_suboption, { "Option 43 Suboption", "bootp.option.vendor.pxeclient.suboption", FT_UINT8, BASE_DEC, VALS(option43_pxeclient_suboption_vals), 0x0, "Option 43:PXE Client Suboption", HFILL }},
5077 { &hf_bootp_option43_pxeclient_padding, { "Padding", "bootp.option.vendor.pxeclient.padding", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:PXE Client 0 Padding", HFILL }},
5078 { &hf_bootp_option43_pxeclient_mtftp_ip, { "mtftp IP", "bootp.option.vendor.pxeclient.mtftp_ip", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 43:PXE Client 1 mtftp IP", HFILL }},
5079 { &hf_bootp_option43_pxeclient_mtftp_client_port, { "mtftp IP", "bootp.option.vendor.pxeclient.mtftp_client_port", FT_UINT16, BASE_DEC, NULL, 0x00, "Option 43:PXE Client 2 mtftp client port", HFILL }},
5080 { &hf_bootp_option43_pxeclient_mtftp_server_port, { "mtftp IP", "bootp.option.vendor.pxeclient.mtftp_server_port", FT_UINT16, BASE_DEC, NULL, 0x00, "Option 43:PXE Client 3 mtftp server port", HFILL }},
5081 { &hf_bootp_option43_pxeclient_mtftp_timeout, { "mtftp timeout", "bootp.option.vendor.pxeclient.mtftp_timeout", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:PXE Client 4 mtftp timeout", HFILL }},
5082 { &hf_bootp_option43_pxeclient_mtftp_delay, { "mtftp delay", "bootp.option.vendor.pxeclient.mtftp_delay", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:PXE Client 5 mtftp delay", HFILL }},
5083 { &hf_bootp_option43_pxeclient_discovery_control, { "discovery control", "bootp.option.vendor.pxeclient.discovery_control", FT_UINT8, BASE_HEX, NULL, 0x0, "Option 43:PXE Client 6 discovery control", HFILL }},
5084 { &hf_bootp_option43_pxeclient_multicast_address, { "multicast address", "bootp.option.vendor.pxeclient.multicast_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 43:PXE Client 7 multicast address", HFILL }},
5085 { &hf_bootp_option43_pxeclient_boot_servers, { "boot servers", "bootp.option.vendor.pxeclient.boot_servers", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 8 boot servers", HFILL }},
5086 { &hf_bootp_option43_pxeclient_boot_menu, { "boot menu", "bootp.option.vendor.pxeclient.boot_menu", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 9 boot menu", HFILL }},
5087 { &hf_bootp_option43_pxeclient_menu_prompt, { "menu prompt", "bootp.option.vendor.pxeclient.menu_prompt", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 10 menu prompt", HFILL }},
5088 { &hf_bootp_option43_pxeclient_multicast_address_alloc, { "multicast address alloc", "bootp.option.vendor.pxeclient.multicast_address_alloc", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 11 multicast address alloc", HFILL }},
5089 { &hf_bootp_option43_pxeclient_credential_types, { "credential types", "bootp.option.vendor.pxeclient.credential_types", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 12 credential types", HFILL }},
5090 { &hf_bootp_option43_pxeclient_boot_item, { "boot item", "bootp.option.vendor.pxeclient.boot_item", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:PXE Client 71 boot item", HFILL }},
5091 { &hf_bootp_option43_pxeclient_end, { "PXE Client End", "bootp.option.vendor.pxeclient.end", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:PXE Client 255 End", HFILL }},
5094 { &hf_bootp_option43_cl_suboption, { "Option 43 Suboption", "bootp.option.vendor.cl.suboption", FT_UINT8, BASE_DEC, VALS(option43_cl_suboption_vals), 0x0, "Option 43:CL Suboption", HFILL }},
5095 { &hf_bootp_option43_cl_padding, { "Padding", "bootp.option.vendor.cl.padding", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:CL 0 Padding", HFILL }},
5096 { &hf_bootp_option43_cl_suboption_request_list, { "Suboption Request List", "bootp.option.vendor.cl.suboption_request_list", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 1 Suboption Request List", HFILL }},
5097 { &hf_bootp_option43_cl_device_type, { "Device Type", "bootp.option.vendor.cl.device_type", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 2 Device Type", HFILL }},
5098 { &hf_bootp_option43_cl_esafe_type, { "eSAFE Types", "bootp.option.vendor.cl.esafe_type", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 3 eSAFE Types", HFILL }},
5099 { &hf_bootp_option43_cl_serial_number, { "Serial Number", "bootp.option.vendor.cl.serial_number", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 4 Serial Number", HFILL }},
5100 { &hf_bootp_option43_cl_hardware_version, { "Hardware Version", "bootp.option.vendor.cl.hardware_version", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 5 Hardware Version", HFILL }},
5101 { &hf_bootp_option43_cl_software_version, { "Software Version", "bootp.option.vendor.cl.software_version", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 6 Software Version", HFILL }},
5102 { &hf_bootp_option43_cl_boot_rom_version, { "Boot ROM version", "bootp.option.vendor.cl.boot_rom_version", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 7 Boot ROM version", HFILL }},
5103 { &hf_bootp_option43_cl_oui_string, { "Organizationally Unique Identifier", "bootp.option.vendor.cl.oui_string", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
5104 { &hf_bootp_option43_cl_oui_bytes, { "Organizationally Unique Identifier", "bootp.option.vendor.cl.oui_string", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:CL 8 Organizationally Unique Identifier", HFILL }},
5105 { &hf_bootp_option43_cl_model_number, { "Model Number", "bootp.option.vendor.cl.model_number", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 9 Model Number", HFILL }},
5106 { &hf_bootp_option43_cl_vendor_name10, { "Vendor Name", "bootp.option.vendor.cl.vendor_name10", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 10 Vendor Name", HFILL }},
5107 { &hf_bootp_option43_cl_address_realm, { "Address Realm", "bootp.option.vendor.cl.address_realm", FT_UINT8, BASE_DEC, VALS(cablehome_subopt11_vals), 0x0, "Option 43:CL 11 Address Realm", HFILL }},
5108 { &hf_bootp_option43_cl_cm_ps_system_desc, { "CM/PS System Description", "bootp.option.vendor.cl.cm_ps_system_desc", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 12 CM/PS System Description", HFILL }},
5109 { &hf_bootp_option43_cl_cm_ps_firmware_revision, { "CM/PS Firmware Revision", "bootp.option.vendor.cl.cm_ps_firmware_revision", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 13 CM/PS Firmware Revision", HFILL }},
5110 { &hf_bootp_option43_cl_firewall_policy_file_version, { "Firewall Policy File Version", "bootp.option.vendor.cl.firewall_policy_file_version", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 14 Firewall Policy File Version", HFILL }},
5111 { &hf_bootp_option43_cl_esafe_config_file_devices, { "eSafe Config File Devices", "bootp.option.vendor.cl.esafe_config_file_devices", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 15 eSafe Config File Devices", HFILL }},
5112 { &hf_bootp_option43_cl_video_security_tape, { "Video Security Type", "bootp.option.vendor.cl.video_security_tape", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 18 Video Security Type", HFILL }},
5113 { &hf_bootp_option43_cl_mta_mac_address, { "MTA MAC Address", "bootp.option.vendor.cl.mta_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, "Option 43:CL 31 MTA MAC Address", HFILL }},
5114 { &hf_bootp_option43_cl_correlation_ID, { "Correlation ID", "bootp.option.vendor.cl.correlation_ID", FT_UINT32, BASE_DEC, NULL, 0x0, "Option 43: CL 32 Correlation ID", HFILL }},
5115 { &hf_bootp_option43_cl_vendor_name51, { "Vendor Name", "bootp.option.vendor.cl.vendor_name51", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 51 Vendor Name", HFILL }},
5116 { &hf_bootp_option43_cl_cablecard_capability, { "CableCARD Capability", "bootp.option.vendor.cl.cablecard_capability", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:CL 52 CableCARD Capability", HFILL }},
5117 { &hf_bootp_option43_cl_device_id_ca, { "Device Identification (CA)", "bootp.option.vendor.cl.device_id_ca", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 43:CL 53 Device Identification (CA)", HFILL }},
5118 { &hf_bootp_option43_cl_device_id_x509, { "Device Identification (X.509)", "bootp.option.vendor.cl.device_id_x509", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 43:CL 54 Device Identification (X.509)", HFILL }},
5119 { &hf_bootp_option43_cl_end, { "CL End", "bootp.option.vendor.cl.end", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:CL 255 End", HFILL }},
5121 { &hf_bootp_option43_alcatel_suboption, { "Option 43 Suboption", "bootp.option.vendor.alu.suboption", FT_UINT8, BASE_DEC, VALS(option43_alcatel_suboption_vals), 0x0, "Option 43:Alcatel Suboption", HFILL }},
5122 { &hf_bootp_option43_alcatel_padding, { "Padding", "bootp.option.vendor.alu.padding", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:Alcatel 0 Padding", HFILL }},
5123 { &hf_bootp_option43_alcatel_vlan_id, { "Voice VLAN ID", "bootp.option.vendor.alu.vid", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 43:Alcatel 58 Voice VLAN ID", HFILL }},
5124 { &hf_bootp_option43_alcatel_tftp1, { "Spatial Redundancy TFTP1", "bootp.option.vendor.alu.tftp1", FT_IPv4, BASE_NONE, NULL, 0x0, "Option 43:Alcatel 64 Spatial Redundancy TFTP1", HFILL }},
5125 { &hf_bootp_option43_alcatel_tftp2, { "Spatial Redundancy TFTP2", "bootp.option.vendor.alu.tftp2", FT_IPv4, BASE_NONE, NULL, 0x0, "Option 43:Alcatel 65 Spatial Redundancy TFTP2", HFILL }},
5126 { &hf_bootp_option43_alcatel_app_type, { "Application Type", "bootp.option.vendor.alu.app_type", FT_UINT8, BASE_DEC, VALS(option43_alcatel_app_type_vals), 0x0, "Option 43:Alcatel 66 Application Type", HFILL }},
5127 { &hf_bootp_option43_alcatel_sip_url, { "SIP URL", "bootp.option.vendor.alu.sip_url", FT_STRING, BASE_NONE, NULL, 0x0, "Option 43:Alcatel 67 SIP URL", HFILL }},
5128 { &hf_bootp_option43_alcatel_end, { "Alcatel End", "bootp.option.vendor.alu.end", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 43:Alcatel 255 End", HFILL }},
5130 { &hf_bootp_option_netbios_over_tcpip_name_server, { "NetBIOS over TCP/IP Name Server", "bootp.option.netbios_over_tcpip_name_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 44: NetBIOS over TCP/IP Name Server", HFILL }},
5131 { &hf_bootp_option_netbios_over_tcpip_dd_name_server, { "NetBIOS over TCP/IP Datagram Distribution Name Server", "bootp.option.netbios_over_tcpip_dd_name_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 45: NetBIOS over TCP/IP Datagram Distribution Name Server", HFILL }},
5132 { &hf_bootp_option_netbios_over_tcpip_node_type, { "NetBIOS over TCP/IP Node Type", "bootp.option.netbios_over_tcpip_node_type", FT_UINT8, BASE_DEC, VALS(bootp_nbnt_vals), 0x0, "Option 46: NetBIOS over TCP/IP Node Type", HFILL }},
5133 { &hf_bootp_option_netbios_over_tcpip_scope, { "NetBIOS over TCP/IP Scope", "bootp.option.netbios_over_tcpip_scope", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 47: NetBIOS over TCP/IP Scope", HFILL }},
5134 { &hf_bootp_option_xwindows_system_font_server, { "X Window System Font Server", "bootp.option.xwindows_system_font_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 48: X Window System Font Server", HFILL }},
5135 { &hf_bootp_option_xwindows_system_display_manager, { "X Window System Display Manager", "bootp.option.xwindows_system_display_manager", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 49: X Window System Display Manager", HFILL }},
5136 { &hf_bootp_option_requested_ip_address, { "Requested IP Address", "bootp.option.requested_ip_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 50: Requested IP Address", HFILL }},
5137 { &hf_bootp_option_ip_address_lease_time, { "IP Address Lease Time", "bootp.option.ip_address_lease_time", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 51: IP Address Lease Time", HFILL }},
5138 { &hf_bootp_option_option_overload, { "Option Overload", "bootp.option.option_overload", FT_UINT8, BASE_DEC, VALS(opt_overload_vals), 0x0, "Option 52: Option Overload", HFILL }},
5139 { &hf_bootp_option_dhcp, { "DHCP", "bootp.option.dhcp", FT_UINT8, BASE_DEC, VALS(opt53_text), 0x0, "Option 53: DHCP option", HFILL }},
5140 { &hf_bootp_option_dhcp_server_id, { "DHCP Server Identifier", "bootp.option.dhcp_server_id", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 54: DHCP Server Identifier", HFILL }},
5141 { &hf_bootp_option_parameter_request_list_item, { "Parameter Request List Item", "bootp.option.request_list_item", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 55: Parameter Request List Item", HFILL }},
5142 { &hf_bootp_option_message, { "Message", "bootp.option.message", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 56: Option message", HFILL }},
5143 { &hf_bootp_option_dhcp_max_message_size, { "Maximum DHCP Message Size", "bootp.option.dhcp_max_message_size", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 57: Maximum DHCP Message Size", HFILL }},
5144 { &hf_bootp_option_renewal_time_value, { "Renewal Time Value", "bootp.option.renewal_time_value", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 58: Renewal Time Value", HFILL }},
5145 { &hf_bootp_option_rebinding_time_value, { "Rebinding Time Value", "bootp.option.rebinding_time_value", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 59: Rebinding Time Value", HFILL }},
5146 { &hf_bootp_option_vendor_class_id, { "Vendor class identifier", "bootp.option.vendor_class_id", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 60: Vendor class identifier", HFILL }},
5147 { &hf_bootp_option_novell_netware_ip_domain, { "Novell/Netware IP domain", "bootp.option.novell_netware_ip_domain", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 62: Novell/Netware IP domain", HFILL }},
5149 { &hf_bootp_option63_suboption, { "Option 63 Suboption", "bootp.option.novell_options.suboption", FT_UINT8, BASE_DEC, VALS(option63_suboption_vals), 0x0, "Option 63: Suboption", HFILL }},
5150 { &hf_bootp_option63_value, { "Value", "bootp.option.novell_options.value", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 63: Suboption value", HFILL }},
5151 { &hf_bootp_option63_value_8, { "Value", "bootp.option.novell_options.value", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 63: Suboption 8-bit value", HFILL }},
5152 { &hf_bootp_option63_value_ip_address, { "Value", "bootp.option.novell_options.value", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 63: Suboption IP address", HFILL }},
5153 { &hf_bootp_option63_value_boolean, { "Value", "bootp.option.novell_options.value", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x00, "Option 63: Suboption Boolean value", HFILL }},
5154 { &hf_bootp_option63_broadcast, { "Broadcast for nearest Netware server", "bootp.option.novell_options.broadcast", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x00, "Option 63:5 Broadcast for nearest Netware server", HFILL }},
5155 { &hf_bootp_option63_preferred_dss_server, { "Preferred DSS server", "bootp.option.novell_options.preferred_dss_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 63:6 Preferred DSS server", HFILL }},
5156 { &hf_bootp_option63_nearest_nwip_server, { "Nearest NWIP server", "bootp.option.novell_options.nearest_nwip_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 63:7 Nearest NWIP server", HFILL }},
5157 { &hf_bootp_option63_autoretries, { "Autoretries", "bootp.option.novell_options.autoretries", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 63:8 Autoretries", HFILL }},
5158 { &hf_bootp_option63_autoretry_delay, { "Autoretry delay, sec", "bootp.option.novell_options.autoretry_delay", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 63:9 Autoretry delay, sec", HFILL }},
5159 { &hf_bootp_option63_support_netware_v1_1, { "Broadcast for nearest Netware server", "bootp.option.novell_options.support_netware_v1_1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x00, "Option 63:10 Broadcast for nearest Netware server", HFILL }},
5160 { &hf_bootp_option63_primary_dss, { "Primary DSS", "bootp.option.novell_options.primary_dss", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 63:11 Primary DSS", HFILL }},
5162 { &hf_bootp_option_nis_plus_domain, { "Network Information Service+ Domain", "bootp.option.nis_plus_domain", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 64: Network Information Service+ Domain", HFILL }},
5163 { &hf_bootp_option_nis_plus_server, { "Network Information Service+ Server", "bootp.option.nis_plus_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 65: Network Information Service+ Server", HFILL }},
5164 { &hf_bootp_option_tftp_server_name, { "TFTP Server Name", "bootp.option.tftp_server_name", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 66: TFTP Server Name", HFILL }},
5165 { &hf_bootp_option_bootfile_name, { "Bootfile name", "bootp.option.bootfile_name", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 67: Bootfile name", HFILL }},
5166 { &hf_bootp_option_mobile_ip_home_agent, { "Mobile IP Home Agent", "bootp.option.mobile_ip_home_agent", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 68: Mobile IP Home Agent", HFILL }},
5167 { &hf_bootp_option_smtp_server, { "SMTP Server", "bootp.option.smtp_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 69: SMTP Server", HFILL }},
5168 { &hf_bootp_option_pop3_server, { "POP3 Server", "bootp.option.pop3_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 70: POP3 Server", HFILL }},
5169 { &hf_bootp_option_nntp_server, { "NNTP Server", "bootp.option.nntp_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 71: NNTP Server", HFILL }},
5170 { &hf_bootp_option_default_www_server, { "Default WWW Server", "bootp.option.default_www_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 72: Default WWW Server", HFILL }},
5171 { &hf_bootp_option_default_finger_server, { "Default Finger Server", "bootp.option.default_finger_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 73: Default Finger Server", HFILL }},
5172 { &hf_bootp_option_default_irc_server, { "Default IRC Server", "bootp.option.default_irc_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 74: Default IRC Server", HFILL }},
5173 { &hf_bootp_option_streettalk_server, { "StreetTalk Server", "bootp.option.streettalk_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 75: StreetTalk Server", HFILL }},
5174 { &hf_bootp_option_streettalk_da_server, { "StreetTalk Directory Assistance Server", "bootp.option.streettalk_da_server", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 76: StreetTalk Directory Assistance Server", HFILL }},
5175 { &hf_bootp_option_slp_directory_agent_value, { "Value", "bootp.option.slp_directory_agent.value", FT_UINT8, BASE_DEC, VALS(slpda_vals), 0x0, "Option 78: SLPDA Value", HFILL }},
5176 { &hf_bootp_option_slp_directory_agent_slpda_address, { "IP Address", "bootp.option.slp_directory_agent.slpda_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 78: SLPDA Address", HFILL }},
5177 { &hf_bootp_option_slp_service_scope_value, { "Value", "bootp.option.slp_service_scope.value", FT_UINT8, BASE_DEC, VALS(slp_scope_vals), 0x0, "Option 79: SLP Service Scope Value", HFILL }},
5178 { &hf_bootp_option_slp_service_scope_string, { "SLP Service Scope", "bootp.option.slp_service_scope.string", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 79: SLP Service Scope", HFILL }},
5180 { &hf_bootp_option82_suboption, { "Option 82 Suboption", "bootp.option.agent_information_option.suboption", FT_UINT8, BASE_DEC, VALS(option82_suboption_vals), 0x0, "Option 82: Suboption", HFILL }},
5181 { &hf_bootp_option82_value, { "Value", "bootp.option.agent_information_option.value", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82: Suboption value", HFILL }},
5182 { &hf_bootp_option82_value_8, { "Value", "bootp.option.agent_information_option.value", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82: Suboption 8-bit value", HFILL }},
5183 { &hf_bootp_option82_value_32, { "Value", "bootp.option.agent_information_option.value", FT_UINT32, BASE_DEC, NULL, 0x0, "Option 82: Suboption 32-bit value", HFILL }},
5184 { &hf_bootp_option82_value_ip_address, { "Value", "bootp.option.agent_information_option.value", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 82: Suboption IP address", HFILL }},
5185 { &hf_bootp_option82_value_stringz, { "Value", "bootp.option.agent_information_option.value", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 82: Suboption Z-String value", HFILL }},
5186 { &hf_bootp_option82_padding, { "Padding", "bootp.option.agent_information_option.padding", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:0 Padding", HFILL }},
5187 { &hf_bootp_option82_agent_circuit_id, { "Agent Circuit ID", "bootp.option.agent_information_option.agent_circuit_id", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:1 Agent Circuit ID", HFILL }},
5188 { &hf_bootp_option82_agent_remote_id, { "Agent Remote ID", "bootp.option.agent_information_option.agent_remote_id", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:2 Agent Remote ID", HFILL }},
5189 { &hf_bootp_option82_reserved, { "Reserved", "bootp.option.agent_information_option.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:3 Reserved", HFILL }},
5190 { &hf_bootp_option82_docsis_device_class, { "DOCSIS Device Class", "bootp.option.agent_information_option.docsis_device_class", FT_UINT32, BASE_HEX, NULL, 0x0, "Option 82:4 DOCSIS Device Class", HFILL }},
5191 { &hf_bootp_option82_link_selection, { "Link selection", "bootp.option.agent_information_option.link_selection", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 82:5 Link selection", HFILL }},
5192 { &hf_bootp_option82_subscriber_id, { "Subscriber ID", "bootp.option.agent_information_option.subscriber_id", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 82:6 Subscriber ID", HFILL }},
5193 { &hf_bootp_option82_radius_attributes, { "RADIUS Attributes", "bootp.option.agent_information_option.radius_attributes", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:7 RADIUS Attributes", HFILL }},
5194 { &hf_bootp_option82_authentication, { "Authentication", "bootp.option.agent_information_option.authentication", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:8 Authentication", HFILL }},
5195 { &hf_bootp_option82_vi, { "Vendor-Specific Information", "bootp.option.agent_information_option.vi", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 82:9 Vendor-Specific Information", HFILL }},
5196 { &hf_bootp_option82_vi_enterprise, { "Enterprise", "bootp.option.agent_information_option.vi.enterprise", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0, "Option 82:9 VI Enterprise", HFILL }},
5197 { &hf_bootp_option82_vi_data_length, { "Data Length", "bootp.option.agent_information_option.vi.data_length", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:9 VI Data Length", HFILL }},
5198 { &hf_bootp_option82_vi_cl_option, { "Option", "bootp.option.agent_information_option.vi.cl.option", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:9 VI CL Option", HFILL }},
5199 { &hf_bootp_option82_vi_cl_length, { "Length", "bootp.option.agent_information_option.vi.cl.length", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:9 VI CL Length", HFILL }},
5200 { &hf_bootp_option82_vi_cl_tag, { "Tag", "bootp.option.agent_information_option.vi.cl.tag", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:9 VI CL Tag", HFILL }},
5201 { &hf_bootp_option82_vi_cl_tag_length, { "Tag Length", "bootp.option.agent_information_option.vi.cl.tag_length", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 82:9 VI CL Tag Length", HFILL }},
5202 { &hf_bootp_option82_vi_cl_docsis_version, { "DOCSIS Version Number", "bootp.option.agent_information_option.vi.cl.docsis_version", FT_UINT16, BASE_HEX, NULL, 0x0, "Option 82:9 VI CL DOCSIS Version Number", HFILL }},
5203 { &hf_bootp_option82_flags, { "Flags", "bootp.option.agent_information_option.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "Option 82:10 Flags", HFILL }},
5204 { &hf_bootp_option82_server_id_override, { "Server ID Override", "bootp.option.agent_information_option.server_id_override", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 82:11 Server ID Override", HFILL }},
5206 { &hf_bootp_option_novell_dss_string, { "Novell Directory Services Servers String", "bootp.option.novell_dss.string", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 85: Novell Directory Services Servers String", HFILL }},
5207 { &hf_bootp_option_novell_dss_ip, { "IP Address", "bootp.option.novell_dss.ip", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 85: Novell Directory Services Servers IP Address", HFILL }},
5208 { &hf_bootp_option_novell_ds_tree_name, { "Novell Directory Services Tree Name", "bootp.option.novell_ds_tree_name", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 86: Novell Directory Services Tree Name", HFILL }},
5209 { &hf_bootp_option_novell_ds_context, { "Novell Directory Services Context", "bootp.option.novell_ds_context", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 87: Novell Directory Services Context", HFILL }},
5210 { &hf_bootp_option_dhcp_authentication_protocol, { "Protocol", "bootp.option.dhcp_authentication.protocol", FT_UINT8, BASE_DEC, VALS(authen_protocol_vals), 0x0, "Option 90: Authentication Protocol", HFILL }},
5211 { &hf_bootp_option_dhcp_authentication_alg_delay, { "Delay Algorithm", "bootp.option.dhcp_authentication.alg_delay", FT_UINT8, BASE_DEC, VALS(authen_da_algo_vals), 0x0, "Option 90: Delayed Authentication Algorithm", HFILL }},
5212 { &hf_bootp_option_dhcp_authentication_algorithm, { "Algorithm", "bootp.option.dhcp_authentication.algorithm", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 90: Authentication Algorithm", HFILL }},
5213 { &hf_bootp_option_dhcp_authentication_rdm, { "Replay Detection Method", "bootp.option.dhcp_authentication.rdm", FT_UINT8, BASE_DEC, VALS(authen_rdm_vals), 0x0, "Option 90: Replay Detection Method", HFILL }},
5214 { &hf_bootp_option_dhcp_authentication_rdm_replay_detection, { "RDM Replay Detection Value", "bootp.option.dhcp_authentication.rdm_replay_detection", FT_UINT64, BASE_HEX, NULL, 0x0, "Option 90: RDM Replay Detection Value", HFILL }},
5215 { &hf_bootp_option_dhcp_authentication_rdm_rdv, { "Replay Detection Value", "bootp.option.dhcp_authentication.rdm_rdv", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 90: Replay Detection Value", HFILL }},
5216 { &hf_bootp_option_dhcp_authentication_secret_id, { "Secret ID", "bootp.option.dhcp_authentication.secret_id", FT_UINT32, BASE_HEX, NULL, 0x0, "Option 90: Secret ID", HFILL }},
5217 { &hf_bootp_option_dhcp_authentication_hmac_md5_hash, { "HMAC MD5 Hash", "bootp.option.dhcp_authentication.hmac_md5_hash", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 90: HMAC MD5 Hash", HFILL }},
5218 { &hf_bootp_option_dhcp_authentication_information, { "Authentication Information", "bootp.option.dhcp_authentication.information", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 90: Authentication Information", HFILL }},
5219 { &hf_bootp_option_client_last_transaction_time, { "Client last transaction time", "bootp.option.client_last_transaction_time", FT_UINT32, BASE_DEC, NULL, 0x00, "Option 91: Client last transaction time", HFILL }},
5220 { &hf_bootp_option_associated_ip_option, { "Associated IP option", "bootp.option.associated_ip_option", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 92: Associated IP option", HFILL }},
5221 { &hf_bootp_option_client_system_architecture, { "Client System Architecture", "bootp.option.client_system_architecture", FT_UINT16, BASE_DEC, VALS(bootp_client_arch), 0x0, "Option 93: Client System Architecture", HFILL }},
5222 { &hf_bootp_option_client_network_id_major_ver, { "Major Version", "bootp.client_network_id_major", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 94: Major Version", HFILL }},
5223 { &hf_bootp_option_client_network_id_minor_ver, { "Minor Version", "bootp.client_network_id_minor", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 94: Minor Version", HFILL }},
5224 { &hf_bootp_option_civic_location_what, { "What", "bootp.option.civic_location.what", FT_UINT8, BASE_DEC, VALS(civic_address_what_values), 0x0, "Option 99: What", HFILL }},
5225 { &hf_bootp_option_civic_location_country, { "Country", "bootp.option.civic_location.country", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 99: Country", HFILL }},
5226 { &hf_bootp_option_civic_location_ca_type, { "CA Type", "bootp.option.civic_location.ca_type", FT_UINT8, BASE_DEC, VALS(civic_address_type_values), 0x0, "Option 99: CA Type", HFILL }},
5227 { &hf_bootp_option_civic_location_ca_length, { "CA Length", "bootp.option.civic_location.ca_length", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 99: CA Length", HFILL }},
5228 { &hf_bootp_option_civic_location_ca_value, { "CA Value", "bootp.option.civic_location.ca_value", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 99: CA Value", HFILL }},
5229 { &hf_bootp_option_netinfo_parent_server_address, { "NetInfo Parent Server Address", "bootp.option.netinfo_parent_server_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 112: NetInfo Parent Server Address", HFILL }},
5230 { &hf_bootp_option_netinfo_parent_server_tag, { "NetInfo Parent Server Tag", "bootp.option.netinfo_parent_server_tag", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 113: NetInfo Parent Server Tag", HFILL }},
5231 { &hf_bootp_option_dhcp_auto_configuration, { "DHCP Auto-Configuration", "bootp.option.dhcp_auto_configuration", FT_UINT8, BASE_DEC, VALS(dhcp_autoconfig), 0x0, "Option 116: DHCP Auto-Configuration", HFILL }},
5232 { &hf_bootp_option_cl_dss_id_option, { "DSS_ID Type", "bootp.option.cl_dss_id.option", FT_UINT8, BASE_DEC, VALS(cl_dss_id_type_vals), 0x0, "Option 123:CL DSS_ID Type", HFILL }},
5233 { &hf_bootp_option_cl_dss_id_len, { "DSS_ID Length", "bootp.option.cl_dss_id.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 123:CL DSS_ID Length", HFILL }},
5234 { &hf_bootp_option_cl_dss_id, { "Country", "bootp.option.cl_dss_id", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 123:CL DSS_ID", HFILL }},
5235 { &hf_bootp_option_vi_class_cl_address_mode, { "CableLab Address Mode", "bootp.option.vi_class.cl_address_mode", FT_UINT8, BASE_DEC, VALS(cablelab_ipaddr_mode_vals), 0x0, "Option 124: CableLab Address Mode", HFILL }},
5236 { &hf_bootp_option_vi_class_enterprise, { "Enterprise", "bootp.option.vi_class.enterprise", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x00, "Option 124: Enterprise", HFILL }},
5237 { &hf_bootp_option_vi_class_data_length, { "CableLab Address Mode", "bootp.option.vi_class.length", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 124: Length", HFILL }},
5238 { &hf_bootp_option_vi_class_data, { "NetInfo Parent Server Tag", "bootp.option.vi_class.data", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 124: Data", HFILL }},
5240 { &hf_bootp_option125_enterprise, { "Enterprise", "bootp.option.vi.enterprise", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x00, "Option 125: Enterprise", HFILL }},
5241 { &hf_bootp_option125_value, { "Value", "bootp.option.vi.value", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 125: Suboption value", HFILL }},
5242 { &hf_bootp_option125_value_8, { "Value", "bootp.option.vi.value", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 125: Suboption 8-bit value", HFILL }},
5243 { &hf_bootp_option125_value_16, { "Value", "bootp.option.vi.value", FT_UINT16, BASE_DEC, NULL, 0x0, "Option 125: Suboption 16-bit value", HFILL }},
5244 { &hf_bootp_option125_value_ip_address, { "Value", "bootp.option.vi.value", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 125: Suboption IP address value", HFILL }},
5245 { &hf_bootp_option125_value_stringz, { "Value", "bootp.option.vi.value", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125: Suboption Z-String value", HFILL }},
5246 { &hf_bootp_option125_tr111_suboption, { "Option 125 Suboption", "bootp.option.vi.tr111.suboption", FT_UINT8, BASE_DEC, VALS(option125_tr111_suboption_vals), 0x0, "Option 125:TR 111 Suboption", HFILL }},
5247 { &hf_bootp_option125_tr111_device_manufacturer_oui, { "DeviceManufacturerOUI", "bootp.option.vi.tr111.device_manufacturer_oui", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 1 DeviceManufacturerOUI", HFILL }},
5248 { &hf_bootp_option125_tr111_device_serial_number, { "DeviceSerialNumber", "bootp.option.vi.tr111.device_serial_number", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 2 DeviceSerialNumber", HFILL }},
5249 { &hf_bootp_option125_tr111_device_product_class, { "DeviceProductClass", "bootp.option.vi.tr111.device_product_class", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 3 DeviceProductClass", HFILL }},
5250 { &hf_bootp_option125_tr111_gateway_manufacturer_oui, { "GatewayManufacturerOUI", "bootp.option.vi.tr111.gateway_manufacturer_oui", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 4 GatewayManufacturerOUI", HFILL }},
5251 { &hf_bootp_option125_tr111_gateway_serial_number, { "GatewaySerialNumber", "bootp.option.vi.tr111.gateway_serial_number", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 5 GatewaySerialNumber", HFILL }},
5252 { &hf_bootp_option125_tr111_gateway_product_class, { "GatewayProductClass", "bootp.option.vi.tr111.gateway_product_class", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 125:TR 111 6 GatewayProductClass", HFILL }},
5254 { &hf_bootp_option125_cl_suboption, { "Option 125 Suboption", "bootp.option.vi.cl.suboption", FT_UINT8, BASE_DEC, VALS(option125_cl_suboption_vals), 0x0, "Option 125:CL Suboption", HFILL }},
5255 { &hf_bootp_option125_cl_option_request, { "Option Request", "bootp.option.vi.cl.option_request", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 125:CL 1 Option Request", HFILL }},
5256 { &hf_bootp_option125_cl_tftp_server_addresses, { "TFTP Server Addresses", "bootp.option.vi.cl.tftp_server_addresses", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 125:CL 2 TFTP Server Addresses", HFILL }},
5257 { &hf_bootp_option125_cl_erouter_container_option, { "eRouter Container Option", "bootp.option.vi.cl.erouter_container_option", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 125:CL 3 eRouter Container Option", HFILL }},
5258 { &hf_bootp_option125_cl_mib_environment_indicator_option, { "MIB Environment Indicator Option", "bootp.option.vi.cl.suboption", FT_UINT8, BASE_DEC, VALS(pkt_mib_env_ind_opt_vals), 0x0, "Option 125:CL 4 MIB Environment Indicator Option", HFILL }},
5259 { &hf_bootp_option125_cl_modem_capabilities, { "Modem Capabilities", "bootp.option.vi.cl.modem_capabilities", FT_BYTES, BASE_NONE, NULL, 0x0, "Option 125:CL 5 Modem Capabilities", HFILL }},
5261 { &hf_bootp_option_subnet_selection_option, { "Subnet Selection Option", "bootp.option.subnet_selection_option", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 118: Subnet Selection Option", HFILL }},
5262 { &hf_bootp_option_lost_server_domain_name, { "LoST Server Domain Name", "bootp.option.lost_server_domain_name", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 137: LoST Server Domain Name", HFILL }},
5263 { &hf_bootp_option_capwap_access_controller, { "CAPWAP Access Controllers", "bootp.option.capwap_access_controller", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 138: CAPWAP Access Controllers", HFILL }},
5264 { &hf_bootp_option_tftp_server_address, { "TFTP Server Address", "bootp.option.tftp_server_address", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 150: TFTP Server Address", HFILL }},
5265 { &hf_bootp_option_6RD_ipv4_mask_len, { "6RD IPv4 Mask Length", "bootp.option.6RD.ipv4_mask_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 212: 6RD IPv4 Mask Length", HFILL }},
5266 { &hf_bootp_option_6RD_prefix_len, { "6RD Prefix Length", "bootp.option.6RD.prefix_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 212: 6RD Prefix Length", HFILL }},
5267 { &hf_bootp_option_6RD_prefix, { "6RD Prefix", "bootp.option.6RD.prefix", FT_IPv6, BASE_NONE, NULL, 0x00, "Option 212: 6RD Prefix", HFILL }},
5268 { &hf_bootp_option_6RD_border_relay_ip, { "Border Relay IP", "bootp.option.6RD.border_relay_ip", FT_IPv4, BASE_NONE, NULL, 0x00, "Option 212: Border Relay IP", HFILL }},
5269 { &hf_bootp_option_private_proxy_autodiscovery, { "Private/Proxy autodiscovery", "bootp.option.private_proxy_autodiscovery", FT_STRINGZ, BASE_NONE, NULL, 0x0, "Option 252: Private/Proxy autodiscovery", HFILL }},
5270 { &hf_bootp_option_end, { "Option End", "bootp.option.end", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 255: End", HFILL }},
5271 { &hf_bootp_option_end_overload, { "Option End (Overload)", "bootp.option.end", FT_UINT8, BASE_DEC, NULL, 0x0, "Option 255: End (Overload)", HFILL }},
5274 static uat_field_t bootp_uat_flds[] = {
5275 UAT_FLD_DEC(uat_bootp_records, opt, "Option number", "Custom Option Number"),
5276 UAT_FLD_CSTRING(uat_bootp_records, text, "Option Name", "Custom Option Name"),
5277 UAT_FLD_VS(uat_bootp_records, ftype, "Option type", bootp_custom_type_vals, "Option datatype"),
5281 static gint *ett[] = {
5285 &ett_bootp_option43_suboption,
5286 &ett_bootp_option63_suboption,
5287 &ett_bootp_option82_suboption,
5288 &ett_bootp_option82_suboption9,
5289 &ett_bootp_option125_suboption,
5293 module_t *bootp_module;
5295 proto_bootp = proto_register_protocol("Bootstrap Protocol", "BOOTP/DHCP",
5297 proto_register_field_array(proto_bootp, hf, array_length(hf));
5298 proto_register_subtree_array(ett, array_length(ett));
5299 bootp_dhcp_tap = register_tap("bootp");
5301 /* register init routine to setup the custom bootp options */
5302 register_init_routine(&bootp_init_protocol);
5304 /* Allow dissector to find be found by name. */
5305 register_dissector("bootp", dissect_bootp, proto_bootp);
5307 bootp_module = prefs_register_protocol(proto_bootp, NULL);
5309 prefs_register_bool_preference(bootp_module, "novellserverstring",
5310 "Decode Option 85 as String",
5311 "Novell Servers option 85 can be configured as a string instead of address",
5314 prefs_register_enum_preference(bootp_module, "pkt.ccc.protocol_version",
5315 "PacketCable CCC protocol version",
5316 "The PacketCable CCC protocol version",
5317 &pkt_ccc_protocol_version,
5318 pkt_ccc_protocol_versions,
5321 prefs_register_uint_preference(bootp_module, "pkt.ccc.option",
5322 "PacketCable CCC option",
5323 "Option Number for PacketCable CableLabs Client Configuration",
5327 prefs_register_obsolete_preference(bootp_module, "displayasstring");
5329 bootp_uat = uat_new("Custom BootP/DHCP Options (Excl. suboptions)",
5330 sizeof(uat_bootp_record_t), /* record size */
5331 "custom_bootp", /* filename */
5332 TRUE, /* from_profile */
5333 (void*) &uat_bootp_records, /* data_ptr */
5334 &num_bootp_records_uat, /* numitems_ptr */
5335 UAT_CAT_GENERAL, /* category */
5337 uat_bootp_record_copy_cb, /* copy callback */
5338 uat_bootp_record_update_cb, /* update callback */
5339 uat_bootp_record_free_cb, /* free callback */
5340 NULL, /* post update callback */
5341 bootp_uat_flds); /* UAT field definitions */
5343 prefs_register_uat_preference(bootp_module,
5344 "custom_bootp_table",
5345 "Custom BootP/DHCP Options (Excl. suboptions)",
5346 "Custom BootP/DHCP Options (Excl. suboptions)",
5351 proto_reg_handoff_bootp(void)
5353 dissector_handle_t bootp_handle;
5355 bootp_handle = create_dissector_handle(dissect_bootp, proto_bootp);
5356 dissector_add_uint("udp.port", UDP_PORT_BOOTPS, bootp_handle);
5357 dissector_add_uint("udp.port", UDP_PORT_BOOTPC, bootp_handle);