2 * Routines for ppp packet disassembly
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
8 * This file created and by Mike Hall <mlh@io.com>
11 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
18 #include <epan/capture_dissectors.h>
19 #include <epan/unit_strings.h>
20 #include <wsutil/pint.h>
21 #include <wsutil/str_util.h>
22 #include <epan/prefs.h>
23 #include "packet-ppp.h"
24 #include <epan/ppptypes.h>
25 #include <epan/etypes.h>
26 #include <epan/expert.h>
27 #include "packet-chdlc.h"
28 #include "packet-ip.h"
29 #include <epan/nlpid.h>
30 #include <epan/crc16-tvb.h>
31 #include <epan/crc32-tvb.h>
32 #include <epan/ipproto.h>
33 #include <epan/addr_resolv.h>
34 #include <epan/reassemble.h>
35 #include "packet-sll.h"
36 #include "packet-juniper.h"
37 #include "packet-sflow.h"
38 #include "packet-l2tp.h"
40 void proto_register_ppp_raw_hdlc(void);
41 void proto_reg_handoff_ppp_raw_hdlc(void);
42 void proto_register_ppp(void);
43 void proto_reg_handoff_ppp(void);
44 void proto_register_mp(void);
45 void proto_reg_handoff_mp(void);
46 void proto_register_lcp(void);
47 void proto_reg_handoff_lcp(void);
48 void proto_register_vsncp(void);
49 void proto_reg_handoff_vsncp(void);
50 void proto_register_vsnp(void);
51 void proto_reg_handoff_vsnp(void);
52 void proto_register_ipcp(void);
53 void proto_reg_handoff_ipcp(void);
54 void proto_register_bcp_bpdu(void);
55 void proto_reg_handoff_bcp_bpdu(void);
56 void proto_register_bcp_ncp(void);
57 void proto_reg_handoff_bcp_ncp(void);
58 void proto_register_osinlcp(void);
59 void proto_reg_handoff_bcp(void);
60 void proto_reg_handoff_osinlcp(void);
61 void proto_register_ccp(void);
62 void proto_reg_handoff_ccp(void);
63 void proto_register_cbcp(void);
64 void proto_reg_handoff_cbcp(void);
65 void proto_register_bacp(void);
66 void proto_reg_handoff_bacp(void);
67 void proto_register_bap(void);
68 void proto_reg_handoff_bap(void);
69 void proto_register_comp_data(void);
70 void proto_reg_handoff_comp_data(void);
71 void proto_register_pap(void);
72 void proto_reg_handoff_pap(void);
73 void proto_register_chap(void);
74 void proto_reg_handoff_chap(void);
75 void proto_register_pppmuxcp(void);
76 void proto_reg_handoff_pppmuxcp(void);
77 void proto_register_pppmux(void);
78 void proto_reg_handoff_pppmux(void);
79 void proto_register_mplscp(void);
80 void proto_reg_handoff_mplscp(void);
81 void proto_register_cdpcp(void);
82 void proto_reg_handoff_cdpcp(void);
83 void proto_register_ipv6cp(void);
84 void proto_reg_handoff_ipv6cp(void);
85 void proto_register_iphc_crtp(void);
86 void proto_reg_handoff_iphc_crtp(void);
89 static int hf_ppp_direction
;
90 static int hf_ppp_address
;
91 static int hf_ppp_control
;
92 static int hf_ppp_protocol
;
93 static int hf_ppp_code
;
94 static int hf_ppp_identifier
;
95 static int hf_ppp_length
;
96 static int hf_ppp_magic_number
;
97 static int hf_ppp_oui
;
98 static int hf_ppp_kind
;
99 static int hf_ppp_data
;
100 static int hf_ppp_fcs_16
;
101 static int hf_ppp_fcs_32
;
102 static int hf_ppp_fcs_status
;
105 static int ett_ppp_opt_type
;
106 static int ett_ppp_unknown_opt
;
108 static expert_field ei_ppp_opt_len_invalid
;
109 static expert_field ei_ppp_fcs
;
111 static int proto_ppp_hdlc
;
113 /* Generated from convert_proto_tree_add_text.pl */
114 static int hf_ppp_hdlc_data
;
115 static int hf_ppp_hdlc_fragment
;
117 static int ett_ppp_hdlc_data
;
119 static int proto_lcp
;
120 static int proto_lcp_option_vendor
;
121 static int proto_lcp_option_mru
;
122 static int proto_lcp_option_async_map
;
123 static int proto_lcp_option_authprot
;
124 static int proto_lcp_option_qualprot
;
125 static int proto_lcp_option_magicnumber
;
126 static int proto_lcp_option_linkqualmon
;
127 static int proto_lcp_option_field_compress
;
128 static int proto_lcp_option_addr_field_compress
;
129 static int proto_lcp_option_fcs_alternatives
;
130 static int proto_lcp_option_self_desc_pad
;
131 static int proto_lcp_option_numbered_mode
;
132 static int proto_lcp_option_callback
;
133 static int proto_lcp_option_compound_frames
;
134 static int proto_lcp_option_nomdataencap
;
135 static int proto_lcp_option_multilink_mrru
;
136 static int proto_lcp_option_multilink_ssnh
;
137 static int proto_lcp_option_multilink_ep_disc
;
138 static int proto_lcp_option_dce_identifier
;
139 static int proto_lcp_option_multilink_pp
;
140 static int proto_lcp_option_link_discrim
;
141 static int proto_lcp_option_auth
;
142 static int proto_lcp_option_cobs
;
143 static int proto_lcp_option_prefix_elision
;
144 static int proto_lcp_option_multilink_hdr_fmt
;
145 static int proto_lcp_option_internationalization
;
146 static int proto_lcp_option_sonet_sdh
;
149 static int ett_lcp_options
;
150 static int ett_lcp_vendor_opt
;
151 static int ett_lcp_mru_opt
;
152 static int ett_lcp_asyncmap_opt
;
153 static int ett_lcp_authprot_opt
;
154 static int ett_lcp_qualprot_opt
;
155 static int ett_lcp_magicnumber_opt
;
156 static int ett_lcp_linkqualmon_opt
;
157 static int ett_lcp_pcomp_opt
;
158 static int ett_lcp_acccomp_opt
;
159 static int ett_lcp_fcs_alternatives_opt
;
160 static int ett_lcp_self_desc_pad_opt
;
161 static int ett_lcp_numbered_mode_opt
;
162 static int ett_lcp_callback_opt
;
163 static int ett_lcp_compound_frames_opt
;
164 static int ett_lcp_nomdataencap_opt
;
165 static int ett_lcp_multilink_mrru_opt
;
166 static int ett_lcp_multilink_ssnh_opt
;
167 static int ett_lcp_multilink_ep_disc_opt
;
168 static int ett_lcp_magic_block
;
169 static int ett_lcp_dce_identifier_opt
;
170 static int ett_lcp_multilink_pp_opt
;
171 static int ett_lcp_bacp_link_discrim_opt
;
172 static int ett_lcp_auth_opt
;
173 static int ett_lcp_cobs_opt
;
174 static int ett_lcp_prefix_elision_opt
;
175 static int ett_multilink_hdr_fmt_opt
;
176 static int ett_lcp_internationalization_opt
;
177 static int ett_lcp_sonet_sdh_opt
;
179 static dissector_table_t lcp_option_table
;
181 static int proto_ipcp
;
182 static int proto_ipcp_option_addrs
;
183 static int proto_ipcp_option_compress
;
184 static int proto_ipcp_option_addr
;
185 static int proto_ipcp_option_mobileipv4
;
186 static int proto_ipcp_option_pri_dns
;
187 static int proto_ipcp_option_pri_nbns
;
188 static int proto_ipcp_option_sec_dns
;
189 static int proto_ipcp_option_sec_nbns
;
190 static int proto_ipcp_rohc_option_profiles
;
191 static int proto_ipcp_iphc_option_rtp_compress
;
192 static int proto_ipcp_iphc_option_enhanced_rtp_compress
;
193 static int proto_ipcp_iphc_option_neghdrcomp
;
196 static int ett_ipcp_options
;
197 static int ett_ipcp_ipaddrs_opt
;
198 static int ett_ipcp_compress_opt
;
199 static int ett_ipcp_ipaddr_opt
;
200 static int ett_ipcp_mobileipv4_opt
;
201 static int ett_ipcp_pridns_opt
;
202 static int ett_ipcp_secdns_opt
;
203 static int ett_ipcp_prinbns_opt
;
204 static int ett_ipcp_secnbns_opt
;
206 static int ett_ipcp_iphc_rtp_compress_opt
;
207 static int ett_ipcp_iphc_enhanced_rtp_compress_opt
;
208 static int ett_ipcp_iphc_neghdrcomp_opt
;
209 static int ett_ipcp_rohc_profiles_opt
;
211 static dissector_table_t ipcp_option_table
;
212 static dissector_table_t ipcp_rohc_suboption_table
;
213 static dissector_table_t ipcp_iphc_suboption_table
;
215 static int proto_vsncp
;
216 static int proto_vsncp_option_pdnid
;
217 static int proto_vsncp_option_apname
;
218 static int proto_vsncp_option_pdntype
;
219 static int proto_vsncp_option_pdnaddress
;
220 static int proto_vsncp_option_pco
;
221 static int proto_vsncp_option_errorcode
;
222 static int proto_vsncp_option_attachtype
;
223 static int proto_vsncp_option_ipv4address
;
224 static int proto_vsncp_option_addressalloc
;
225 static int proto_vsncp_option_apn_ambr
;
226 static int proto_vsncp_option_ipv6_hsgw_lla_iid
;
228 static int hf_vsncp_opt_type
;
229 static int hf_vsncp_opt_length
;
230 /* Generated from convert_proto_tree_add_text.pl */
231 static int hf_vsncp_protocol_configuration_length
;
232 static int hf_vsncp_error_code
;
233 static int hf_vsncp_identifier
;
234 static int hf_vsncp_attach_type
;
235 static int hf_vsncp_protocol_configuration_data
;
236 static int hf_vsncp_default_router_address
;
237 static int hf_vsncp_pdn_identifier
;
238 static int hf_vsncp_address_allocation_cause
;
239 static int hf_vsncp_length
;
240 static int hf_vsncp_code
;
241 static int hf_vsncp_protocol
;
242 static int hf_vsncp_pdn_type
;
243 static int hf_vsncp_ipv6_interface_identifier
;
244 static int hf_vsncp_pdn_ipv4
;
245 static int hf_vsncp_access_point_name
;
246 static int hf_vsncp_ambr_data
;
247 static int hf_vsncp_pdn_ipv6
;
249 static int ett_vsncp
;
250 static int ett_vsncp_options
;
251 static int ett_vsncp_pdnid_opt
;
252 static int ett_vsncp_apname_opt
;
253 static int ett_vsncp_pdntype_opt
;
254 static int ett_vsncp_pdnaddress_opt
;
255 static int ett_vsncp_pco_opt
;
256 static int ett_vsncp_errorcode_opt
;
257 static int ett_vsncp_attachtype_opt
;
258 static int ett_vsncp_ipv4address_opt
;
259 static int ett_vsncp_addressalloc_opt
;
260 static int ett_vsncp_apn_ambr_opt
;
261 static int ett_vsncp_ipv6_hsgw_lla_iid_opt
;
263 static dissector_table_t vsncp_option_table
;
266 * VSNP (RFC3772) has no defined packet structure.
267 * The following organisations have defined their own VSNPs,
268 * any VSNCPs containing one of the below OUIs will result in the VSNP being parsed accordingly.
270 #define OUI_BBF 0x00256D /* Broadband Forum TR 456 */
271 #define OUI_3GPP 0xCF0002 /* 3GPP X.S0057-0 */
273 static uint32_t vsnp_oui
= -1;
274 static int proto_vsnp
;
277 static int hf_vsnp_3gpp_pdnid
;
284 static int proto_osinlcp
;
285 static int proto_osinlcp_option_align_npdu
;
287 static int ett_osinlcp
;
288 static int ett_osinlcp_options
;
289 static int ett_osinlcp_align_npdu_opt
;
291 static dissector_table_t osinlcp_option_table
;
293 static int proto_bcp_bpdu
;
294 static int hf_bcp_bpdu_flags
;
295 static int hf_bcp_bpdu_fcs_present
;
296 static int hf_bcp_bpdu_zeropad
;
297 static int hf_bcp_bpdu_bcontrol
;
298 static int hf_bcp_bpdu_pads
;
299 static int hf_bcp_bpdu_mac_type
;
300 static int hf_bcp_bpdu_pad
;
302 static int ett_bcp_bpdu
;
303 static int ett_bcp_bpdu_flags
;
305 static int proto_bcp_ncp
;
306 static int proto_bcp_ncp_option_bridge_id
;
307 static int proto_bcp_ncp_option_line_id
;
308 static int proto_bcp_ncp_option_mac_sup
;
309 static int proto_bcp_ncp_option_tinygram_comp
;
310 static int proto_bcp_ncp_option_lan_id
;
311 static int proto_bcp_ncp_option_mac_addr
;
312 static int proto_bcp_ncp_option_stp
;
313 static int proto_bcp_ncp_option_ieee_802_tagged_frame
;
314 static int proto_bcp_ncp_option_management_inline
;
315 static int proto_bcp_ncp_option_bcp_ind
;
317 static int hf_bcp_ncp_opt_type
;
318 static int hf_bcp_ncp_opt_length
;
319 static int hf_bcp_ncp_lan_seg_no
;
320 static int hf_bcp_ncp_bridge_no
;
321 static int hf_bcp_ncp_tinygram_comp
;
322 static int hf_bcp_ncp_mac
;
323 static int hf_bcp_ncp_mac_l
;
324 static int hf_bcp_ncp_mac_m
;
325 static int hf_bcp_ncp_stp_prot
;
326 static int hf_bcp_ncp_ieee_802_tagged_frame
;
328 static int ett_bcp_ncp
;
329 static int ett_bcp_ncp_options
;
330 static int ett_bcp_ncp_ieee_802_tagged_frame_opt
;
331 static int ett_bcp_ncp_management_inline_opt
;
332 static int ett_bcp_ncp_bcp_ind_opt
;
333 static int ett_bcp_ncp_bridge_id_opt
;
334 static int ett_bcp_ncp_line_id_opt
;
335 static int ett_bcp_ncp_mac_sup_opt
;
336 static int ett_bcp_ncp_tinygram_comp_opt
;
337 static int ett_bcp_ncp_lan_id_opt
;
338 static int ett_bcp_ncp_mac_addr_opt
;
339 static int ett_bcp_ncp_stp_opt
;
341 static dissector_table_t bcp_ncp_option_table
;
343 static int proto_ccp
;
344 static int proto_ccp_option_oui
;
345 static int proto_ccp_option_predict1
;
346 static int proto_ccp_option_predict2
;
347 static int proto_ccp_option_puddle
;
348 static int proto_ccp_option_hpppc
;
349 static int proto_ccp_option_stac
;
350 static int proto_ccp_option_stac_ascend
;
351 static int proto_ccp_option_mppe
;
352 static int proto_ccp_option_gfza
;
353 static int proto_ccp_option_v42bis
;
354 static int proto_ccp_option_bsdcomp
;
355 static int proto_ccp_option_lzsdcp
;
356 static int proto_ccp_option_mvrca
;
357 static int proto_ccp_option_dce
;
358 static int proto_ccp_option_deflate
;
359 static int proto_ccp_option_v44lzjh
;
362 static int ett_ccp_options
;
363 static int ett_ccp_oui_opt
;
364 static int ett_ccp_predict1_opt
;
365 static int ett_ccp_predict2_opt
;
366 static int ett_ccp_puddle_opt
;
367 static int ett_ccp_hpppc_opt
;
368 static int ett_ccp_stac_opt
;
369 static int ett_ccp_stac_opt_check_mode
;
370 static int ett_ccp_mppe_opt
;
371 static int ett_ccp_mppe_opt_supp_bits
;
372 static int ett_ccp_gfza_opt
;
373 static int ett_ccp_v42bis_opt
;
374 static int ett_ccp_bsdcomp_opt
;
375 static int ett_ccp_lzsdcp_opt
;
376 static int ett_ccp_mvrca_opt
;
377 static int ett_ccp_dce_opt
;
378 static int ett_ccp_deflate_opt
;
379 static int ett_ccp_v44lzjh_opt
;
381 static dissector_table_t ccp_option_table
;
383 static int proto_cbcp
;
384 static int proto_cbcp_option_no_callback
;
385 static int proto_cbcp_option_callback_user
;
386 static int proto_cbcp_option_callback_admin
;
387 static int proto_cbcp_option_callback_list
;
389 static int hf_cbcp_opt_type
;
390 static int hf_cbcp_opt_length
;
391 /* Generated from convert_proto_tree_add_text.pl */
392 static int hf_cbcp_address_type
;
393 static int hf_cbcp_address
;
394 static int hf_cbcp_callback_delay
;
395 static int hf_cbcp_no_callback
;
398 static int ett_cbcp_options
;
399 static int ett_cbcp_callback_opt
;
400 static int ett_cbcp_callback_opt_addr
;
401 static int ett_cbcp_no_callback
;
402 static int ett_cbcp_callback_user
;
403 static int ett_cbcp_callback_admin
;
404 static int ett_cbcp_callback_list
;
406 static expert_field ei_cbcp_address
;
408 static dissector_table_t cbcp_option_table
;
410 static int proto_bacp
;
411 static int proto_bacp_option_favored_peer
;
413 static int hf_bacp_opt_type
;
414 static int hf_bacp_opt_length
;
415 /* Generated from convert_proto_tree_add_text.pl */
416 static int hf_bacp_link_speed
;
417 static int hf_bacp_magic_number
;
418 static int hf_bacp_link_type
;
421 static int ett_bacp_options
;
422 static int ett_bacp_favored_peer_opt
;
424 static dissector_table_t bacp_option_table
;
426 static int proto_bap
;
427 static int proto_bap_option_link_type
;
428 static int proto_bap_option_phone_delta
;
429 static int proto_bap_option_no_phone
;
430 static int proto_bap_option_reason
;
431 static int proto_bap_option_link_disc
;
432 static int proto_bap_option_call_status
;
434 static int hf_bap_opt_type
;
435 static int hf_bap_opt_length
;
436 /* Generated from convert_proto_tree_add_text.pl */
437 static int hf_bap_sub_option_length
;
438 static int hf_bap_call_status
;
439 static int hf_bap_unknown_option_data
;
440 static int hf_bap_sub_option_type
;
441 static int hf_bap_reason
;
442 static int hf_bap_link_discriminator
;
443 static int hf_bap_unique_digit
;
444 static int hf_bap_type
;
445 static int hf_bap_identifier
;
446 static int hf_bap_subscriber_number
;
447 static int hf_bap_phone_number_sub_address
;
448 static int hf_bap_response_code
;
449 static int hf_bap_call_action
;
450 static int hf_bap_length
;
453 static int ett_bap_options
;
454 static int ett_bap_link_type_opt
;
455 static int ett_bap_phone_delta_opt
;
456 static int ett_bap_phone_delta_subopt
;
457 static int ett_bap_call_status_opt
;
458 static int ett_bap_no_phone_opt
;
459 static int ett_bap_reason_opt
;
460 static int ett_bap_link_disc_opt
;
462 static expert_field ei_bap_sub_option_length
;
464 static dissector_table_t bap_option_table
;
466 static dissector_handle_t ppp_hdlc_handle
, ppp_handle
;
467 static dissector_handle_t ppp_raw_hdlc_handle
;
468 static dissector_handle_t mp_handle
;
469 static dissector_handle_t lcp_handle
;
470 static dissector_handle_t vsncp_handle
;
471 static dissector_handle_t vsnp_handle
;
472 static dissector_handle_t ipcp_handle
;
473 static dissector_handle_t bcp_bpdu_handle
;
474 static dissector_handle_t bcp_ncp_handle
;
475 static dissector_handle_t osinlcp_handle
;
476 static dissector_handle_t ccp_handle
;
477 static dissector_handle_t cbcp_handle
;
478 static dissector_handle_t bacp_handle
;
479 static dissector_handle_t bap_handle
;
480 static dissector_handle_t comp_data_handle
;
481 static dissector_handle_t pap_handle
;
482 static dissector_handle_t chap_handle
;
483 static dissector_handle_t muxcp_handle
;
484 static dissector_handle_t pppmux_handle
;
485 static dissector_handle_t mplscp_handle
;
486 static dissector_handle_t cdpcp_handle
;
487 static dissector_handle_t ipv6cp_handle
;
488 static dissector_handle_t fh_handle
;
489 static dissector_handle_t cudp16_handle
;
490 static dissector_handle_t cudp8_handle
;
491 static dissector_handle_t cs_handle
;
492 static dissector_handle_t cntcp_handle
;
495 static int proto_comp_data
;
497 #if 0 /* see dissect_comp_data() */
498 static int ett_comp_data
;
500 static int proto_pppmuxcp
;
501 static int proto_pppmuxcp_option_def_pid
;
503 static int hf_pppmux_flags_pid
;
504 static int hf_pppmux_flags_field_length
;
505 static int hf_pppmuxcp_opt_type
;
506 static int hf_pppmuxcp_opt_length
;
507 /* Generated from convert_proto_tree_add_text.pl */
508 static int hf_pppmux_sub_frame_length
;
509 static int hf_pppmux_flags
;
510 static int hf_pppmux_def_prot_id
;
512 static int ett_pppmuxcp
;
513 static int ett_pppmuxcp_options
;
514 static int ett_pppmuxcp_def_pid_opt
;
516 static dissector_table_t pppmuxcp_option_table
;
518 static int proto_pppmux
;
519 static int hf_pppmux_protocol
;
521 static int ett_pppmux
;
522 static int ett_pppmux_subframe
;
523 static int ett_pppmux_subframe_hdr
;
524 static int ett_pppmux_subframe_flags
;
525 static int ett_pppmux_subframe_info
;
527 static reassembly_table mp_reassembly_table
;
530 static int hf_mp_frag
;
531 static int hf_mp_frag_short
;
532 static int hf_mp_frag_first
;
533 static int hf_mp_frag_last
;
534 static int hf_mp_sequence_num
;
535 static int hf_mp_sequence_num_cls
;
536 static int hf_mp_sequence_num_reserved
;
537 static int hf_mp_short_sequence_num
;
538 static int hf_mp_short_sequence_num_cls
;
539 static int hf_mp_payload
;
540 static int hf_mp_fragments
;
541 static int hf_mp_fragment
;
542 static int hf_mp_fragment_overlap
;
543 static int hf_mp_fragment_overlap_conflicts
;
544 static int hf_mp_fragment_multiple_tails
;
545 static int hf_mp_fragment_too_long_fragment
;
546 static int hf_mp_fragment_error
;
547 static int hf_mp_fragment_count
;
548 static int hf_mp_reassembled_in
;
549 static int hf_mp_reassembled_length
;
552 static int ett_mp_flags
;
553 static int ett_mp_fragment
;
554 static int ett_mp_fragments
;
556 static const fragment_items mp_frag_items
= {
557 /* Fragment subtrees */
560 /* Fragment fields */
563 &hf_mp_fragment_overlap
,
564 &hf_mp_fragment_overlap_conflicts
,
565 &hf_mp_fragment_multiple_tails
,
566 &hf_mp_fragment_too_long_fragment
,
567 &hf_mp_fragment_error
,
568 &hf_mp_fragment_count
,
569 /* Reassembled in field */
570 &hf_mp_reassembled_in
,
571 /* Reassembled length field */
572 &hf_mp_reassembled_length
,
573 /* Reassembled data field */
579 static int proto_mplscp
;
580 static int ett_mplscp
;
581 static int ett_mplscp_options
;
583 static int proto_cdpcp
;
584 static int ett_cdpcp
;
585 static int ett_cdpcp_options
;
587 static int proto_pap
; /* PAP vars */
589 static int ett_pap_data
;
591 static int hf_pap_code
;
592 static int hf_pap_identifier
;
593 static int hf_pap_length
;
594 static int hf_pap_data
;
595 static int hf_pap_peer_id
;
596 static int hf_pap_peer_id_length
;
597 static int hf_pap_password
;
598 static int hf_pap_password_length
;
599 static int hf_pap_message
;
600 static int hf_pap_message_length
;
601 static int hf_pap_stuff
;
603 static int proto_chap
; /* CHAP vars */
605 static int ett_chap_data
;
608 static int hf_chap_code
;
609 static int hf_chap_identifier
;
610 static int hf_chap_length
;
611 static int hf_chap_data
;
612 static int hf_chap_value_size
;
613 static int hf_chap_value
;
614 static int hf_chap_name
;
615 static int hf_chap_message
;
616 static int hf_chap_stuff
;
618 static int proto_ipv6cp
; /* IPv6CP vars */
619 static int proto_ipv6cp_option_if_id
;
620 static int proto_ipv6cp_option_compress
;
622 /* Generated from convert_proto_tree_add_text.pl */
623 static int hf_ipv6cp_opt_type
;
624 static int hf_ipv6cp_opt_length
;
625 static int hf_ipv6cp_interface_identifier
;
627 static int ett_ipv6cp
;
628 static int ett_ipv6cp_options
;
629 static int ett_ipv6cp_if_id_opt
;
630 static int ett_ipv6cp_compress_opt
;
632 static dissector_table_t ipv6cp_option_table
;
634 static int proto_iphc_crtp
; /* CRTP vars */
635 static int proto_iphc_crtp_cudp16
;
636 static int proto_iphc_crtp_cudp8
;
637 static int proto_iphc_crtp_cs
;
638 static int proto_iphc_crtp_cntcp
;
640 static int hf_iphc_crtp_cid8
;
641 static int hf_iphc_crtp_cid16
;
642 static int hf_iphc_crtp_gen
;
643 static int hf_iphc_crtp_seq
;
644 static int hf_iphc_crtp_fh_flags
;
645 static int hf_iphc_crtp_fh_cidlenflag
;
646 static int hf_iphc_crtp_fh_dataflag
;
647 static int hf_iphc_crtp_cs_flags
;
648 static int hf_iphc_crtp_cs_cnt
;
649 static int hf_iphc_crtp_cs_invalid
;
650 static int hf_iphc_crtp_ip_id
;
651 static int hf_iphc_crtp_data
;
653 static int ett_iphc_crtp
;
654 static int ett_iphc_crtp_hdr
;
655 static int ett_iphc_crtp_info
;
656 static int ett_iphc_crtp_fh_flags
;
658 static expert_field ei_iphc_crtp_ip_version
;
659 static expert_field ei_iphc_crtp_next_protocol
;
660 static expert_field ei_iphc_crtp_seq_nonzero
;
662 static dissector_table_t ppp_subdissector_table
;
663 static dissector_handle_t chdlc_handle
;
664 static dissector_handle_t eth_withfcs_handle
;
665 static dissector_handle_t eth_withoutfcs_handle
;
667 static capture_dissector_handle_t chdlc_cap_handle
;
669 static const value_string ppp_direction_vals
[] = {
670 {P2P_DIR_RECV
, "DCE->DTE"},
671 {P2P_DIR_SENT
, "DTE->DCE"},
676 static int ppp_fcs_decode
; /* 0 = No FCS, 1 = 16 bit FCS, 2 = 32 bit FCS */
681 const enum_val_t fcs_options
[] = {
682 {"none", "None", NO_FCS
},
683 {"16-bit", "16-Bit", FCS_16
},
684 {"32-bit", "32-Bit", FCS_32
},
689 * For Default Protocol ID negotiated with PPPMuxCP. We need to
690 * this ID so that if the first subframe doesn't have protocol
694 static unsigned pppmux_def_prot_id
;
696 /* PPP definitions */
699 * Used by the GTP dissector as well.
700 * www.iana.org/assignments/ppp-numbers
702 static const value_string ppp_vals
[] = {
703 {PPP_PADDING
, "Padding Protocol"},
704 {PPP_ROHC_SCID
, "ROHC small-CID"},
705 {PPP_ROHC_LCID
, "ROHC large-CID"},
706 {PPP_IP
, "Internet Protocol version 4"},
707 {PPP_OSI
, "OSI Network Layer"},
708 {PPP_XNSIDP
, "Xerox NS IDP"},
709 {PPP_DEC4
, "DECnet Phase IV"},
710 {PPP_AT
, "Appletalk"},
711 {PPP_IPX
, "Novell IPX"},
712 {PPP_VJC_COMP
, "Van Jacobson Compressed TCP/IP"},
713 {PPP_VJC_UNCOMP
, "Van Jacobson Uncompressed TCP/IP"},
714 {PPP_BCP_BPDU
, "Bridging PDU"},
715 {PPP_ST
, "Stream Protocol (ST-II)"},
716 {PPP_VINES
, "Banyan Vines"},
717 {PPP_AT_EDDP
, "AppleTalk EDDP"},
718 {PPP_AT_SB
, "AppleTalk SmartBuffered"},
719 {PPP_MP
, "Multi-Link"},
720 {PPP_NB
, "NETBIOS Framing"},
721 {PPP_CISCO
, "Cisco Systems"},
722 {PPP_ASCOM
, "Ascom Timeplex"},
723 {PPP_LBLB
, "Fujitsu Link Backup and Load Balancing (LBLB)"},
724 {PPP_RL
, "DCA Remote Lan"},
725 {PPP_SDTP
, "Serial Data Transport Protocol (PPP-SDTP)"},
726 {PPP_LLC
, "SNA over 802.2"},
728 {PPP_IPV6HC
, "IPv6 Header Compression "},
729 {PPP_KNX
, "KNX Bridging Data"},
730 {PPP_ENCRYPT
, "Encryption"},
731 {PPP_ILE
, "Individual Link Encryption"},
732 {PPP_IPV6
, "Internet Protocol version 6"},
733 {PPP_MUX
, "PPP Muxing"},
734 {PPP_VSNP
, "Vendor-Specific Network Protocol (VSNP)"},
735 {PPP_TNP
, "TRILL Network Protocol (TNP)"},
736 {PPP_RTP_FH
, "RTP IPHC Full Header"},
737 {PPP_RTP_CTCP
, "RTP IPHC Compressed TCP"},
738 {PPP_RTP_CNTCP
, "RTP IPHC Compressed Non TCP"},
739 {PPP_RTP_CUDP8
, "RTP IPHC Compressed UDP 8"},
740 {PPP_RTP_CRTP8
, "RTP IPHC Compressed RTP 8"},
741 {PPP_STAMPEDE
, "Stampede Bridging"},
742 {PPP_MPPLUS
, "MP+ Protocol"},
743 {PPP_NTCITS_IPI
, "NTCITS IPI"},
744 {PPP_ML_SLCOMP
, "Single link compression in multilink"},
745 {PPP_COMP
, "Compressed datagram"},
746 {PPP_STP_HELLO
, "802.1d Hello Packets"},
747 {PPP_IBM_SR
, "IBM Source Routing BPDU"},
748 {PPP_DEC_LB
, "DEC LANBridge100 Spanning Tree"},
749 {PPP_CDP
, "Cisco Discovery Protocol"},
750 {PPP_NETCS
, "Netcs Twin Routing"},
751 {PPP_STP
, "STP - Scheduled Transfer Protocol"},
752 {PPP_EDP
, "EDP - Extreme Discovery Protocol"},
753 {PPP_OSCP
, "Optical Supervisory Channel Protocol (OSCP)"},
754 {PPP_OSCP2
, "Optical Supervisory Channel Protocol (OSCP)"},
755 {PPP_LUXCOM
, "Luxcom"},
756 {PPP_SIGMA
, "Sigma Network Systems"},
757 {PPP_ACSP
, "Apple Client Server Protocol"},
758 {PPP_MPLS_UNI
, "MPLS Unicast"},
759 {PPP_MPLS_MULTI
, "MPLS Multicast"},
760 {PPP_P12844
, "IEEE p1284.4 standard - data packets"},
761 {PPP_TETRA
, "ETSI TETRA Network Protocol Type 1"},
762 {PPP_MFTP
, "Multichannel Flow Treatment Protocol"},
763 {PPP_RTP_CTCPND
, "RTP IPHC Compressed TCP No Delta"},
764 {PPP_RTP_CS
, "RTP IPHC Context State"},
765 {PPP_RTP_CUDP16
, "RTP IPHC Compressed UDP 16"},
766 {PPP_RTP_CRDP16
, "RTP IPHC Compressed RTP 16"},
767 {PPP_CCCP
, "Cray Communications Control Protocol"},
768 {PPP_CDPD_MNRP
, "CDPD Mobile Network Registration Protocol"},
769 {PPP_EXPANDAP
, "Expand accelerator protocol"},
770 {PPP_ODSICP
, "ODSICP NCP"},
771 {PPP_DOCSIS
, "DOCSIS DLL"},
772 {PPP_CETACEANNDP
, "Cetacean Network Detection Protocol"},
773 {PPP_LZS
, "Stacker LZS"},
774 {PPP_REFTEK
, "RefTek Protocol"},
775 {PPP_FC
, "Fibre Channel"},
776 {PPP_EMIT
, "EMIT Protocols"},
777 {PPP_VSP
, "Vendor-Specific Protocol (VSP)"},
778 {PPP_TLSP
, "TRILL Link State Protocol (TLSP)"},
779 {PPP_IPCP
, "Internet Protocol Control Protocol"},
780 {PPP_OSINLCP
, "OSI Network Layer Control Protocol"},
781 {PPP_XNSIDPCP
, "Xerox NS IDP Control Protocol"},
782 {PPP_DECNETCP
, "DECnet Phase IV Control Protocol"},
783 {PPP_ATCP
, "AppleTalk Control Protocol"},
784 {PPP_IPXCP
, "Novell IPX Control Protocol"},
785 {PPP_BCP_NCP
, "Bridging NCP"},
786 {PPP_SPCP
, "Stream Protocol Control Protocol"},
787 {PPP_BVCP
, "Banyan Vines Control Protocol"},
788 {PPP_MLCP
, "Multi-Link Control Protocol"},
789 {PPP_NBCP
, "NETBIOS Framing Control Protocol"},
790 {PPP_CISCOCP
, "Cisco Systems Control Protocol"},
791 {PPP_ASCOMCP
, "Ascom Timeplex"},
792 {PPP_LBLBCP
, "Fujitsu LBLB Control Protocol"},
793 {PPP_RLNCP
, "DCA Remote Lan Network Control Protocol (RLNCP)"},
794 {PPP_SDCP
, "Serial Data Control Protocol (PPP-SDCP)"},
795 {PPP_LLCCP
, "SNA over 802.2 Control Protocol"},
796 {PPP_SNACP
, "SNA Control Protocol"},
797 {PPP_IP6HCCP
, "IP6 Header Compression Control Protocol"},
798 {PPP_KNXCP
, "KNX Bridging Control Protocol"},
799 {PPP_ECP
, "Encryption Control Protocol"},
800 {PPP_ILECP
, "Individual Link Encryption Control Protocol"},
801 {PPP_IPV6CP
, "IPv6 Control Protocol"},
802 {PPP_MUXCP
, "PPP Muxing Control Protocol"},
803 {PPP_VSNCP
, "Vendor-Specific Network Control Protocol (VSNCP)"},
804 {PPP_TNCP
, "TRILL Network Control Protocol"},
805 {PPP_STAMPEDECP
, "Stampede Bridging Control Protocol"},
806 {PPP_MPPCP
, "MP+ Control Protocol"},
807 {PPP_IPICP
, "NTCITS IPI Control Protocol"},
808 {PPP_SLCC
, "Single link compression in multilink control"},
809 {PPP_CCP
, "Compression Control Protocol"},
810 {PPP_CDPCP
, "Cisco Discovery Protocol Control Protocol"},
811 {PPP_NETCSCP
, "Netcs Twin Routing"},
812 {PPP_STPCP
, "STP - Control Protocol"},
813 {PPP_EDPCP
, "EDPCP - Extreme Discovery Protocol Control Protocol"},
814 {PPP_ACSPC
, "Apple Client Server Protocol Control"},
815 {PPP_MPLSCP
, "MPLS Control Protocol"},
816 {PPP_P12844CP
, "IEEE p1284.4 standard - Protocol Control"},
817 {PPP_TETRACP
, "ETSI TETRA TNP1 Control Protocol"},
818 {PPP_MFTPCP
, "Multichannel Flow Treatment Protocol"},
819 {PPP_LCP
, "Link Control Protocol"},
820 {PPP_PAP
, "Password Authentication Protocol"},
821 {PPP_LQR
, "Link Quality Report"},
822 {PPP_SPAP
, "Shiva Password Authentication Protocol"},
823 {PPP_CBCP
, "Callback Control Protocol (CBCP)"},
824 {PPP_BACP
, "BACP Bandwidth Allocation Control Protocol"},
825 {PPP_BAP
, "BAP Bandwidth Allocation Protocol"},
826 {PPP_VSAP
, "Vendor-Specific Authentication Protocol (VSAP)"},
827 {PPP_CONTCP
, "Container Control Protocol"},
828 {PPP_CHAP
, "Challenge Handshake Authentication Protocol"},
829 {PPP_RSAAP
, "RSA Authentication Protocol"},
830 {PPP_EAP
, "Extensible Authentication Protocol"},
831 {PPP_SIEP
, "Mitsubishi Security Information Exchange Protocol (SIEP)"},
832 {PPP_SBAP
, "Stampede Bridging Authorization Protocol"},
833 {PPP_PRPAP
, "Proprietary Authentication Protocol"},
834 {PPP_PRPAP2
, "Proprietary Authentication Protocol"},
835 {PPP_PRPNIAP
, "Proprietary Node ID Authentication Protocol"},
838 value_string_ext ppp_vals_ext
= VALUE_STRING_EXT_INIT(ppp_vals
);
840 /* CP (LCP, CCP, IPCP, etc.) codes.
843 #define VNDRSPCFC 0 /* Vendor Specific: RFC 2153 */
844 #define CONFREQ 1 /* Configuration Request */
845 #define CONFACK 2 /* Configuration Ack */
846 #define CONFNAK 3 /* Configuration Nak */
847 #define CONFREJ 4 /* Configuration Reject */
848 #define TERMREQ 5 /* Termination Request */
849 #define TERMACK 6 /* Termination Ack */
850 #define CODEREJ 7 /* Code Reject */
852 static const value_string cp_vals
[] = {
853 {VNDRSPCFC
, "Vendor Specific"},
854 {CONFREQ
, "Configuration Request"},
855 {CONFACK
, "Configuration Ack"},
856 {CONFNAK
, "Configuration Nak"},
857 {CONFREJ
, "Configuration Reject"},
858 {TERMREQ
, "Termination Request"},
859 {TERMACK
, "Termination Ack"},
860 {CODEREJ
, "Code Reject"},
865 * LCP-specific packet types.
867 #define PROTREJ 8 /* Protocol Reject */
868 #define ECHOREQ 9 /* Echo Request */
869 #define ECHOREP 10 /* Echo Reply */
870 #define DISCREQ 11 /* Discard Request */
871 #define IDENT 12 /* Identification */
872 #define TIMEREMAIN 13 /* Time remaining */
875 * CCP-specific packet types.
877 #define RESETREQ 14 /* Reset Request */
878 #define RESETACK 15 /* Reset Ack */
881 * CBCP-specific packet types.
883 #define CBREQ 1 /* Callback Request */
884 #define CBRES 2 /* Callback Response */
885 #define CBACK 3 /* Callback Ack */
887 #define CBCP_OPT 6 /* Use callback control protocol */
890 * BAP-specific packet types.
892 #define BAP_CREQ 1 /* Call Request */
893 #define BAP_CRES 2 /* Call Response */
894 #define BAP_CBREQ 3 /* Callback Request */
895 #define BAP_CBRES 4 /* Callback Response */
896 #define BAP_LDQREQ 5 /* Link Drop Query Request */
897 #define BAP_LDQRES 6 /* Link Drop Query Response */
898 #define BAP_CSI 7 /* Call Status Indication */
899 #define BAP_CSRES 8 /* Call Status Response */
901 static const value_string lcp_vals
[] = {
902 {VNDRSPCFC
, "Vendor Specific"},
903 {CONFREQ
, "Configuration Request"},
904 {CONFACK
, "Configuration Ack"},
905 {CONFNAK
, "Configuration Nak"},
906 {CONFREJ
, "Configuration Reject"},
907 {TERMREQ
, "Termination Request"},
908 {TERMACK
, "Termination Ack"},
909 {CODEREJ
, "Code Reject"},
910 {PROTREJ
, "Protocol Reject"},
911 {ECHOREQ
, "Echo Request"},
912 {ECHOREP
, "Echo Reply"},
913 {DISCREQ
, "Discard Request"},
914 {IDENT
, "Identification"},
915 {TIMEREMAIN
, "Time Remaining"},
919 static const value_string ccp_vals
[] = {
920 {VNDRSPCFC
, "Vendor Specific"},
921 {CONFREQ
, "Configuration Request"},
922 {CONFACK
, "Configuration Ack"},
923 {CONFNAK
, "Configuration Nak"},
924 {CONFREJ
, "Configuration Reject"},
925 {TERMREQ
, "Termination Request"},
926 {TERMACK
, "Termination Ack"},
927 {CODEREJ
, "Code Reject"},
928 {RESETREQ
, "Reset Request"},
929 {RESETACK
, "Reset Ack"},
933 static const value_string cbcp_vals
[] = {
934 {CBREQ
, "Callback Request"},
935 {CBRES
, "Callback Response"},
936 {CBACK
, "Callback Ack"},
940 static const value_string bap_vals
[] = {
941 {BAP_CREQ
, "Call Request"},
942 {BAP_CRES
, "Call Response"},
943 {BAP_CBREQ
, "Callback Request"},
944 {BAP_CBRES
, "Callback Response"},
945 {BAP_LDQREQ
, "Link Drop Query Request"},
946 {BAP_LDQRES
, "Link Drop Query Response"},
947 {BAP_CSI
, "Call Status Indication"},
948 {BAP_CSRES
, "Call Status Response"},
952 #define BAP_RESP_CODE_REQACK 0x00
953 #define BAP_RESP_CODE_REQNAK 0x01
954 #define BAP_RESP_CODE_REQREJ 0x02
955 #define BAP_RESP_CODE_REQFULLNAK 0x03
956 static const value_string bap_resp_code_vals
[] = {
957 {BAP_RESP_CODE_REQACK
, "Request Ack"},
958 {BAP_RESP_CODE_REQNAK
, "Request Nak"},
959 {BAP_RESP_CODE_REQREJ
, "Request Rej"},
960 {BAP_RESP_CODE_REQFULLNAK
, "Request Full Nak"},
964 #define BAP_LINK_TYPE_ISDN 0 /* ISDN */
965 #define BAP_LINK_TYPE_X25 1 /* X.25 */
966 #define BAP_LINK_TYPE_ANALOG 2 /* Analog */
967 #define BAP_LINK_TYPE_SD 3 /* Switched Digital (non-ISDN) */
968 #define BAP_LINK_TYPE_ISDNOV 4 /* ISDN data over voice */
969 #define BAP_LINK_TYPE_RESV5 5 /* Reserved */
970 #define BAP_LINK_TYPE_RESV6 6 /* Reserved */
971 #define BAP_LINK_TYPE_RESV7 7 /* Reserved */
972 static const value_string bap_link_type_vals
[] = {
973 {BAP_LINK_TYPE_ISDN
, "ISDN"},
974 {BAP_LINK_TYPE_X25
, "X.25"},
975 {BAP_LINK_TYPE_ANALOG
, "Analog"},
976 {BAP_LINK_TYPE_SD
, "Switched Digital (non-ISDN)"},
977 {BAP_LINK_TYPE_ISDNOV
, "ISDN data over voice"},
978 {BAP_LINK_TYPE_RESV5
, "Reserved"},
979 {BAP_LINK_TYPE_RESV6
, "Reserved"},
980 {BAP_LINK_TYPE_RESV7
, "Reserved"},
984 #define BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT 1 /* Unique Digit */
985 #define BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM 2 /* Subscriber Number */
986 #define BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR 3 /* Phone Number Sub Address */
987 static const value_string bap_phone_delta_subopt_vals
[] = {
988 {BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT
, "Unique Digit"},
989 {BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM
, "Subscriber Number"},
990 {BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR
, "Phone Number Sub Address"},
995 * Cause codes for Cause.
997 * The following code table is taken from packet-q931.c but is slightly
998 * adapted to BAP protocol.
1000 static const value_string q931_cause_code_vals
[] = {
1001 {0x00, "Call successful"},
1002 {0x01, "Unallocated (unassigned) number"},
1003 {0x02, "No route to specified transit network"},
1004 {0x03, "No route to destination"},
1005 {0x04, "Send special information tone"},
1006 {0x05, "Misdialled trunk prefix"},
1007 {0x06, "Channel unacceptable"},
1008 {0x07, "Call awarded and being delivered in an established channel"},
1009 {0x08, "Prefix 0 dialed but not allowed"},
1010 {0x09, "Prefix 1 dialed but not allowed"},
1011 {0x0A, "Prefix 1 dialed but not required"},
1012 {0x0B, "More digits received than allowed, call is proceeding"},
1013 {0x10, "Normal call clearing"},
1014 {0x11, "User busy"},
1015 {0x12, "No user responding"},
1016 {0x13, "No answer from user (user alerted)"},
1017 {0x14, "Subscriber absent"},
1018 {0x15, "Call rejected"},
1019 {0x16, "Number changed"},
1020 {0x17, "Reverse charging rejected"},
1021 {0x18, "Call suspended"},
1022 {0x19, "Call resumed"},
1023 {0x1A, "Non-selected user clearing"},
1024 {0x1B, "Destination out of order"},
1025 {0x1C, "Invalid number format (incomplete number)"},
1026 {0x1D, "Facility rejected"},
1027 {0x1E, "Response to STATUS ENQUIRY"},
1028 {0x1F, "Normal unspecified"},
1029 {0x21, "Circuit out of order"},
1030 {0x22, "No circuit/channel available"},
1031 {0x23, "Destination unattainable"},
1032 {0x25, "Degraded service"},
1033 {0x26, "Network out of order"},
1034 {0x27, "Transit delay range cannot be achieved"},
1035 {0x28, "Throughput range cannot be achieved"},
1036 {0x29, "Temporary failure"},
1037 {0x2A, "Switching equipment congestion"},
1038 {0x2B, "Access information discarded"},
1039 {0x2C, "Requested circuit/channel not available"},
1040 {0x2D, "Pre-empted"},
1041 {0x2E, "Precedence call blocked"},
1042 {0x2F, "Resources unavailable, unspecified"},
1043 {0x31, "Quality of service unavailable"},
1044 {0x32, "Requested facility not subscribed"},
1045 {0x33, "Reverse charging not allowed"},
1046 {0x34, "Outgoing calls barred"},
1047 {0x35, "Outgoing calls barred within CUG"},
1048 {0x36, "Incoming calls barred"},
1049 {0x37, "Incoming calls barred within CUG"},
1050 {0x38, "Call waiting not subscribed"},
1051 {0x39, "Bearer capability not authorized"},
1052 {0x3A, "Bearer capability not presently available"},
1053 {0x3E, "Inconsistency in designated outgoing access information and subscriber class"},
1054 {0x3F, "Service or option not available, unspecified"},
1055 {0x41, "Bearer capability not implemented"},
1056 {0x42, "Channel type not implemented"},
1057 {0x43, "Transit network selection not implemented"},
1058 {0x44, "Message not implemented"},
1059 {0x45, "Requested facility not implemented"},
1060 {0x46, "Only restricted digital information bearer capability is available"},
1061 {0x4F, "Service or option not implemented, unspecified"},
1062 {0x51, "Invalid call reference value"},
1063 {0x52, "Identified channel does not exist"},
1064 {0x53, "Call identity does not exist for suspended call"},
1065 {0x54, "Call identity in use"},
1066 {0x55, "No call suspended"},
1067 {0x56, "Call having the requested call identity has been cleared"},
1068 {0x57, "Called user not member of CUG"},
1069 {0x58, "Incompatible destination"},
1070 {0x59, "Non-existent abbreviated address entry"},
1071 {0x5A, "Destination address missing, and direct call not subscribed"},
1072 {0x5B, "Invalid transit network selection (national use)"},
1073 {0x5C, "Invalid facility parameter"},
1074 {0x5D, "Mandatory information element is missing"},
1075 {0x5F, "Invalid message, unspecified"},
1076 {0x60, "Mandatory information element is missing"},
1077 {0x61, "Message type non-existent or not implemented"},
1078 {0x62, "Message not compatible with call state or message type non-existent or not implemented"},
1079 {0x63, "Information element non-existent or not implemented"},
1080 {0x64, "Invalid information element contents"},
1081 {0x65, "Message not compatible with call state"},
1082 {0x66, "Recovery on timer expiry"},
1083 {0x67, "Parameter non-existent or not implemented - passed on"},
1084 {0x6E, "Message with unrecognized parameter discarded"},
1085 {0x6F, "Protocol error, unspecified"},
1086 {0x7F, "Internetworking, unspecified"},
1087 {0xFF, "Non-specific failure"},
1090 static value_string_ext q931_cause_code_vals_ext
= VALUE_STRING_EXT_INIT(q931_cause_code_vals
);
1092 static const value_string bap_call_status_opt_action_vals
[] = {
1098 #define STAC_CM_NONE 0
1099 #define STAC_CM_LCB 1
1100 #define STAC_CM_CRC 2
1101 #define STAC_CM_SN 3
1102 #define STAC_CM_EXTMODE 4
1103 static const value_string stac_checkmode_vals
[] = {
1104 {STAC_CM_NONE
, "None"},
1105 {STAC_CM_LCB
, "LCB"},
1106 {STAC_CM_CRC
, "CRC"},
1107 {STAC_CM_SN
, "Sequence Number"},
1108 {STAC_CM_EXTMODE
, "Extended Mode"},
1112 #define LZSDCP_CM_NONE 0
1113 #define LZSDCP_CM_LCB 1
1114 #define LZSDCP_CM_SN 2
1115 #define LZSDCP_CM_SN_LCB 3
1116 static const value_string lzsdcp_checkmode_vals
[] = {
1117 {LZSDCP_CM_NONE
, "None"},
1118 {LZSDCP_CM_LCB
, "LCB"},
1119 {LZSDCP_CM_SN
, "Sequence Number"},
1120 {LZSDCP_CM_SN_LCB
, "Sequence Number + LCB (default)"},
1124 #define LZSDCP_PM_NONE 0
1125 #define LZSDCP_PM_PROC_UNCOMP 1
1126 static const value_string lzsdcp_processmode_vals
[] = {
1127 {LZSDCP_PM_NONE
, "None (default)"},
1128 {LZSDCP_PM_PROC_UNCOMP
, "Process-Uncompressed"},
1132 #define DCE_MODE_1 1
1133 #define DCE_MODE_2 2
1134 static const value_string dce_mode_vals
[] = {
1135 {DCE_MODE_1
, "No Additional Negotiation"},
1136 {DCE_MODE_2
, "Full PPP Negotiation and State Machine"},
1143 #define CI_VENDORSPECIFIC 0 /* Vendor Specific [RFC2153] */
1144 #define CI_MRU 1 /* Maximum Receive Unit [RFC1661] */
1145 #define CI_ASYNCMAP 2 /* Async Control Character Map */
1146 #define CI_AUTHPROT 3 /* Authentication Protocol [RFC1661] */
1147 #define CI_QUALITY 4 /* Quality Protocol [RFC1661] */
1148 #define CI_MAGICNUMBER 5 /* Magic Number [RFC1661] */
1149 #define CI_LINKQUALMON 6 /* DEPRECATED (Quality Protocol) [RFC1172] */
1150 #define CI_PCOMPRESSION 7 /* Protocol Field Compression [RFC1661] */
1151 #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression
1153 #define CI_FCS_ALTERNATIVES 9 /* FCS Alternatives [RFC1570] */
1154 #define CI_SELF_DESCRIBING_PAD 10 /* Self-Describing Pad [RFC1570] */
1155 #define CI_NUMBERED_MODE 11 /* Numbered Mode [RFC1663] */
1156 #define CI_MULTILINK_PROC 12 /* DEPRECATED (Multi-Link Procedure) */
1157 #define CI_CALLBACK 13 /* Callback [RFC1570] */
1158 #define CI_CONNECTTIME 14 /* DEPRECATED (Connect Time) */
1159 #define CI_COMPOUND_FRAMES 15 /* DEPRECATED (Compound Frames) [RFC1570] */
1160 #define CI_NOMDATAENCAP 16 /* DEPRECATED (Nominal Data Encapsulation) */
1161 /* NOTE: IANA lists CI_NOMDATAENCAP as 16, but it is listed as 14 in
1162 * https://tools.ietf.org/html/draft-ietf-pppext-dataencap-03.
1163 * Which is correct is anyone's guess. */
1164 #define CI_MULTILINK_MRRU 17 /* Multilink MRRU [RFC1990] */
1165 #define CI_MULTILINK_SSNH 18 /* Multilink Short Sequence Number Header
1167 #define CI_MULTILINK_EP_DISC 19 /* Multilink Endpoint Discriminator
1169 #define CI_PROP_KEN 20 /* Proprietary [Ken Culbert] ken@funk.com */
1170 #define CI_DCE_IDENTIFIER 21 /* DCE Identifier [RFC1976]: Warning:
1171 Option type 25 in the RFC is incorrect */
1172 #define CI_MULTILINK_PLUS_PROC 22 /* Multilink Plus Procedure [RFC1934] */
1173 #define CI_LINK_DISC_FOR_BACP 23 /* Link Discriminator for BACP [RFC2125] */
1174 #define CI_LCP_AUTHENTICATION 24 /* LCP Authentication Option [Culbert] */
1175 #define CI_COBS 25 /* Consistent Overhead Byte Stuffing (COBS)
1177 #define CI_PREFIX_ELISION 26 /* Prefix elision [RFC2686][RFC2687] */
1178 #define CI_MULTILINK_HDR_FMT 27 /* Multilink header format
1179 [RFC2686][RFC2687] */
1180 #define CI_INTERNATIONALIZATION 28 /* Internationalization [RFC2484] */
1181 #define CI_SDL_ON_SONET_SDH 29 /* Simple Data Link on SONET/SDH
1183 #define CI_UNASSIGNED 30 /* Unassigned ... but so are 31-255, so
1184 why do they bother specifically
1185 mentioning this one, I wonder? */
1187 static int hf_lcp_magic_number
;
1188 static int hf_lcp_data
;
1189 static int hf_lcp_message
;
1190 static int hf_lcp_secs_remaining
;
1191 static int hf_lcp_rej_proto
;
1192 static int hf_lcp_opt_type
;
1193 static int hf_lcp_opt_length
;
1194 static int hf_lcp_opt_oui
;
1195 static int hf_lcp_opt_kind
;
1196 static int hf_lcp_opt_data
;
1197 static int hf_lcp_opt_mru
;
1198 static int hf_lcp_opt_asyncmap
;
1199 static int hf_lcp_opt_asyncmap_nul
;
1200 static int hf_lcp_opt_asyncmap_soh
;
1201 static int hf_lcp_opt_asyncmap_stx
;
1202 static int hf_lcp_opt_asyncmap_etx
;
1203 static int hf_lcp_opt_asyncmap_eot
;
1204 static int hf_lcp_opt_asyncmap_enq
;
1205 static int hf_lcp_opt_asyncmap_ack
;
1206 static int hf_lcp_opt_asyncmap_bel
;
1207 static int hf_lcp_opt_asyncmap_bs
;
1208 static int hf_lcp_opt_asyncmap_ht
;
1209 static int hf_lcp_opt_asyncmap_lf
;
1210 static int hf_lcp_opt_asyncmap_vt
;
1211 static int hf_lcp_opt_asyncmap_ff
;
1212 static int hf_lcp_opt_asyncmap_cr
;
1213 static int hf_lcp_opt_asyncmap_so
;
1214 static int hf_lcp_opt_asyncmap_si
;
1215 static int hf_lcp_opt_asyncmap_dle
;
1216 static int hf_lcp_opt_asyncmap_dc1
;
1217 static int hf_lcp_opt_asyncmap_dc2
;
1218 static int hf_lcp_opt_asyncmap_dc3
;
1219 static int hf_lcp_opt_asyncmap_dc4
;
1220 static int hf_lcp_opt_asyncmap_nak
;
1221 static int hf_lcp_opt_asyncmap_syn
;
1222 static int hf_lcp_opt_asyncmap_etb
;
1223 static int hf_lcp_opt_asyncmap_can
;
1224 static int hf_lcp_opt_asyncmap_em
;
1225 static int hf_lcp_opt_asyncmap_sub
;
1226 static int hf_lcp_opt_asyncmap_esc
;
1227 static int hf_lcp_opt_asyncmap_fs
;
1228 static int hf_lcp_opt_asyncmap_gs
;
1229 static int hf_lcp_opt_asyncmap_rs
;
1230 static int hf_lcp_opt_asyncmap_us
;
1231 static int hf_lcp_opt_auth_protocol
;
1232 static int hf_lcp_opt_algorithm
;
1233 static int hf_lcp_opt_quality_protocol
;
1234 static int hf_lcp_opt_magic_number
;
1235 static int hf_lcp_opt_reportingperiod
;
1236 static int hf_lcp_opt_fcs_alternatives
;
1237 static int hf_lcp_opt_fcs_alternatives_null
;
1238 static int hf_lcp_opt_fcs_alternatives_ccitt16
;
1239 static int hf_lcp_opt_fcs_alternatives_ccitt32
;
1240 static int hf_lcp_opt_maximum
;
1241 static int hf_lcp_opt_window
;
1242 static int hf_lcp_opt_hdlc_address
;
1243 static int hf_lcp_opt_operation
;
1244 static int hf_lcp_opt_message
;
1245 static int hf_lcp_opt_mrru
;
1246 static int hf_lcp_opt_ep_disc_class
;
1247 static int hf_lcp_opt_ip_address
;
1248 static int hf_lcp_opt_802_1_address
;
1249 static int hf_lcp_opt_magic_block
;
1250 static int hf_lcp_opt_psndn
;
1251 static int hf_lcp_opt_mode
;
1252 static int hf_lcp_opt_unused
;
1253 static int hf_lcp_opt_link_discrim
;
1254 static int hf_lcp_opt_id
;
1255 static int hf_lcp_opt_cobs_flags
;
1256 static int hf_lcp_opt_cobs_flags_res
;
1257 static int hf_lcp_opt_cobs_flags_pre
;
1258 static int hf_lcp_opt_cobs_flags_zxe
;
1259 static int hf_lcp_opt_class
;
1260 static int hf_lcp_opt_prefix
;
1261 static int hf_lcp_opt_code
;
1262 static int hf_lcp_opt_max_susp_classes
;
1263 static int hf_lcp_opt_MIBenum
;
1264 static int hf_lcp_opt_language_tag
;
1267 ppp_option_len_check(proto_tree
* tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int proto
, unsigned len
, unsigned optlen
)
1269 if (len
!= optlen
) {
1270 /* Bogus - option length isn't what it's supposed to be for this option. */
1271 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, len
,
1272 "%s (with option length = %u byte%s; should be %u)",
1273 proto_get_protocol_short_name(find_protocol_by_id(proto
)),
1274 len
, plurality(len
, "", "s"), optlen
);
1281 /* Started as a copy of dissect_ip_tcp_options(), but was changed to support
1282 options as a dissector table */
1284 ppp_dissect_options(tvbuff_t
*tvb
, int offset
, unsigned length
, dissector_table_t
const option_dissectors
,
1285 packet_info
*pinfo
, proto_tree
*opt_tree
)
1290 dissector_handle_t option_dissector
= NULL
;
1293 while (length
> 0) {
1294 opt
= tvb_get_uint8(tvb
, offset
);
1295 --length
; /* account for type byte */
1296 if (option_dissectors
!= NULL
) {
1297 option_dissector
= dissector_get_uint_handle(option_dissectors
, opt
);
1298 if (option_dissector
== NULL
) {
1299 name
= wmem_strdup_printf(pinfo
->pool
, "Unknown (0x%02x)", opt
);
1301 name
= dissector_handle_get_protocol_short_name(option_dissector
);
1304 name
= wmem_strdup_printf(pinfo
->pool
, "Unknown (0x%02x)", opt
);
1307 /* Option has a length. Is it in the packet? */
1309 /* Bogus - packet must at least include option code byte and
1311 proto_tree_add_expert_format(opt_tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, offset
, 1,
1312 "%s (length byte past end of options)", name
);
1316 optlen
= tvb_get_uint8(tvb
, offset
+ 1); /* total including type, len */
1317 --length
; /* account for length byte */
1320 /* Bogus - option length is too short to include option code and
1322 proto_tree_add_expert_format(opt_tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, offset
, 2,
1323 "%s (with too-short option length = %u byte%s)",
1324 name
, optlen
, plurality(optlen
, "", "s"));
1326 } else if (optlen
- 2 > length
) {
1327 /* Bogus - option goes past the end of the header. */
1328 proto_tree_add_expert_format(opt_tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, offset
, length
,
1329 "%s (option length = %u byte%s says option goes past end of options)",
1330 name
, optlen
, plurality(optlen
, "", "s"));
1334 if (option_dissector
== NULL
) {
1335 proto_tree_add_subtree_format(opt_tree
, tvb
, offset
, optlen
, ett_ppp_unknown_opt
, NULL
, "%s (%u byte%s)",
1336 name
, optlen
, plurality(optlen
, "", "s"));
1338 next_tvb
= tvb_new_subset_length(tvb
, offset
, optlen
);
1339 call_dissector(option_dissector
, next_tvb
, pinfo
, opt_tree
);
1340 proto_item_append_text(proto_tree_get_parent(opt_tree
), ", %s", name
);
1343 length
-= (optlen
-2); //already accounted for type and len bytes
1348 dissect_lcp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
1353 type
= tvb_get_uint8(tvb
, offset
);
1354 proto_tree_add_uint_format_value(tree
, hf_lcp_opt_type
, tvb
, offset
, 1,
1355 type
, "%s (%u)", name
, type
);
1356 proto_tree_add_item(tree
, hf_lcp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
1360 dissect_lcp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1361 int proto
, int ett
, int expected_length
,
1362 proto_tree
** ret_tree
, proto_item
** ret_item
)
1364 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
1367 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
1368 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
1370 dissect_lcp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
1375 dissect_lcp_var_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1376 int proto
, int ett
, int expected_length
,
1377 proto_tree
** ret_tree
, proto_item
** ret_item
)
1379 int len
= tvb_reported_length(tvb
);
1381 if (len
< expected_length
) {
1382 /* Bogus - option length isn't what it's supposed to be for this option. */
1383 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, len
,
1384 "%s (with option length = %u byte%s; should be at least %u)",
1385 proto_get_protocol_short_name(find_protocol_by_id(proto_lcp_option_vendor
)),
1386 len
, plurality(len
, "", "s"), 6);
1390 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, -1, ENC_NA
);
1391 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
1393 dissect_lcp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
1398 * Protocol Field Compression
1399 * Address and Control Field Compression
1400 * Compound Frames (Deprecated)
1401 * Nominal Data Encapsulation (Deprecated)
1402 * Multilink Short Sequence Number Header
1403 * Simple Data Link on SONET/SDH
1406 dissect_lcp_simple_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int proto
, int ett
)
1408 proto_tree
*field_tree
;
1411 dissect_lcp_fixed_opt(tvb
, pinfo
, tree
, proto
, ett
, 2, &field_tree
, &ti
);
1412 return tvb_captured_length(tvb
);
1415 /* 3GPP2 X.S0057-B v1.0
1416 * 9.1.4.1 3GPP2 VSNCP Configuration Options
1420 #define CI_PDN_IDENTIFIER 1
1421 #define CI_ACCESS_POINT_NM 2
1422 #define CI_PDN_TYPE 3
1423 #define CI_PDN_ADDRESS 4
1424 #define CI_PROTOCOL_CONFIG 5
1425 #define CI_ERROR_CODE 6
1426 #define CI_ATTACH_TYPE 7
1427 #define CI_IPv4DEFAULT_ROUTER 8
1428 #define CI_ADDRESS_ALLOC 9
1429 #define CI_APN_AMBR 10
1430 #define CI_IPv6_HSGW_LLA_IID 11
1436 #define CHAP_ALG_MD5 5 /* CHAP with MD5 */
1437 #define CHAP_AGL_SHA1 6 /* CHAP with SHA-1 [Black] */
1438 /* 7-127: Unassigned */
1439 #define CHAP_ALG_MSV1 128 /* MS-CHAP */
1440 #define CHAP_ALG_MSV2 129 /* MS-CHAP-2 */
1442 static const range_string chap_alg_rvals
[] = {
1444 {CHAP_ALG_MD5
, CHAP_ALG_MD5
, "CHAP with MD5"},
1445 {CHAP_AGL_SHA1
, CHAP_AGL_SHA1
, "CHAP with SHA-1"},
1446 {CHAP_ALG_MSV1
, CHAP_ALG_MSV1
, "MS-CHAP"},
1447 {CHAP_ALG_MSV2
, CHAP_ALG_MSV2
, "MS-CHAP-2"},
1454 * https://tools.ietf.org/html/rfc1172
1455 * https://tools.ietf.org/html/rfc1332
1456 * https://tools.ietf.org/html/rfc1877
1457 * https://tools.ietf.org/html/rfc2290
1458 * https://tools.ietf.org/html/rfc3241
1459 * https://tools.ietf.org/html/rfc3545
1461 #define CI_ADDRS 1 /* IP Addresses (deprecated) (RFC 1172) */
1462 #define CI_COMPRESS_PROTO 2 /* Compression Protocol (RFC 1332) */
1463 #define CI_ADDR 3 /* IP Address (RFC 1332) */
1464 #define CI_MOBILE_IPv4 4 /* Mobile IPv4 (RFC 2290) */
1465 #define CI_PRI_DNS 129 /* Primary DNS value (RFC 1877) */
1466 #define CI_PRI_NBNS 130 /* Primary NBNS value (RFC 1877) */
1467 #define CI_SEC_DNS 131 /* Secondary DNS value (RFC 1877) */
1468 #define CI_SEC_NBNS 132 /* Secondary NBNS value (RFC 1877) */
1470 static int hf_ipcp_opt_type
;
1471 static int hf_ipcp_opt_length
;
1472 static int hf_ipcp_opt_src_address
;
1473 static int hf_ipcp_opt_dst_address
;
1474 static int hf_ipcp_opt_compress_proto
;
1475 static int hf_ipcp_opt_max_cid
;
1476 static int hf_ipcp_opt_mrru
;
1477 static int hf_ipcp_opt_max_slot_id
;
1478 static int hf_ipcp_opt_comp_slot_id
;
1479 static int hf_ipcp_opt_tcp_space
;
1480 static int hf_ipcp_opt_non_tcp_space
;
1481 static int hf_ipcp_opt_f_max_period
;
1482 static int hf_ipcp_opt_f_max_time
;
1483 static int hf_ipcp_opt_max_header
;
1484 static int hf_ipcp_data
;
1485 static int hf_ipcp_opt_ip_address
;
1486 static int hf_ipcp_opt_mobilenodehomeaddr
;
1487 static int hf_ipcp_opt_pri_dns_address
;
1488 static int hf_ipcp_opt_pri_nbns_address
;
1489 static int hf_ipcp_opt_sec_dns_address
;
1490 static int hf_ipcp_opt_sec_nbns_address
;
1492 static int hf_ipcp_opt_rohc_type
;
1493 static int hf_ipcp_opt_rohc_length
;
1494 static int hf_ipcp_opt_rohc_profile
;
1495 static int hf_ipcp_opt_iphc_type
;
1496 static int hf_ipcp_opt_iphc_length
;
1497 static int hf_ipcp_opt_iphc_param
;
1500 * IP Compression options
1502 #define IPCP_ROHC 0x0003 /* RFC3241 */
1503 #define IPCP_COMPRESS_VJ_1172 0x0037 /* value defined in RFC1172 (typo) */
1504 #define IPCP_COMPRESS_VJ 0x002d /* value defined in RFC1332 (correct) */
1505 #define IPCP_COMPRESS_IPHC 0x0061 /* RFC3544 (and RFC2509) */
1507 static const value_string ipcp_compress_proto_vals
[] = {
1508 {IPCP_ROHC
, "Robust Header Compression (ROHC)"},
1509 {IPCP_COMPRESS_VJ
, "VJ compression"},
1510 {IPCP_COMPRESS_VJ_1172
, "VJ compression (RFC1172-typo)"},
1511 {IPCP_COMPRESS_IPHC
, "IPHC compression"},
1515 /* IPHC suboptions (RFC2508, 3544) */
1516 #define IPCP_IPHC_CRTP 1
1517 #define IPCP_IPHC_ECRTP 2
1518 #define IPCP_IPHC_NEGHC 3
1520 static const value_string ipcp_iphc_parameter_vals
[] = {
1521 {1, "The number of contexts for TCP Space is 0"},
1522 {2, "The number of contexts for Non TCP Space is 0"},
1527 /* ROHC suboptions */
1528 #define IPCP_ROHC_PROFILES 1
1530 /* From https://tools.ietf.org/html/rfc3095 */
1531 static const value_string ipcp_rohc_profile_vals
[] = {
1532 {0x0000, "ROHC uncompressed -- no compression"},
1533 {0x0002, "ROHC UDP -- non-RTP UDP/IP compression"},
1534 {0x0003, "ROHC ESP -- ESP/IP compression"},
1539 * Options. (bcp_ncp)
1540 1 Bridge-Identification
1541 2 Line-Identification
1543 4 Tinygram-Compression
1544 5 LAN-Identification (obsoleted)
1546 7 Spanning-Tree-Protocol (old formatted)
1547 8 IEEE 802 Tagged Frame
1549 10 Bridge Control Packet Indicator
1552 #define CI_BCPNCP_BRIDGE_ID 1
1553 #define CI_BCPNCP_LINE_ID 2
1554 #define CI_BCPNCP_MAC_SUPPORT 3
1555 #define CI_BCPNCP_TINYGRAM_COMP 4
1556 #define CI_BCPNCP_LAN_ID 5
1557 #define CI_BCPNCP_MAC_ADDRESS 6
1558 #define CI_BCPNCP_STP 7
1559 #define CI_BCPNCP_IEEE_802_TAGGED_FRAME 8
1560 #define CI_BCPNCP_MANAGEMENT_INLINE 9
1561 #define CI_BCPNCP_BCP_IND 10
1564 * Options. (OSINLCP)
1566 #define CI_OSINLCP_ALIGN_NPDU 1 /* Alignment of the OSI NPDU (RFC 1377) */
1568 static int hf_osinlcp_opt_type
;
1569 static int hf_osinlcp_opt_length
;
1570 static int hf_osinlcp_opt_alignment
;
1575 #define CI_CCP_OUI 0 /* OUI (RFC1962) */
1576 #define CI_CCP_PREDICT1 1 /* Predictor type 1 (RFC1962) */
1577 #define CI_CCP_PREDICT2 2 /* Predictor type 2 (RFC1962) */
1578 #define CI_CCP_PUDDLE 3 /* Puddle Jumper (RFC1962) */
1579 #define CI_CCP_HPPPC 16 /* Hewlett-Packard PPC (RFC1962) */
1580 #define CI_CCP_STAC 17 /* stac Electronics LZS (RFC1974) */
1581 #define CI_CCP_MPPE 18 /* Microsoft PPE/C (RFC2118/3078) */
1582 #define CI_CCP_GFZA 19 /* Gandalf FZA (RFC1962) */
1583 #define CI_CCP_V42BIS 20 /* V.42bis compression */
1584 #define CI_CCP_BSDLZW 21 /* BSD LZW Compress (RFC1977) */
1585 #define CI_CCP_LZSDCP 23 /* LZS-DCP (RFC1967) */
1586 #define CI_CCP_MVRCA 24 /* MVRCA (Magnalink) (RFC1975) */
1587 #define CI_CCP_DCE 25 /* DCE (RFC1976) */
1588 #define CI_CCP_DEFLATE 26 /* Deflate (RFC1979) */
1589 #define CI_CCP_V44LZJH 27 /* V.44/LZJH (https://tools.ietf.org/html/draft-heath-ppp-v44-01) */
1590 #define CI_CCP_RESERVED 255 /* Reserved (RFC1962) */
1592 static int hf_ccp_opt_type
;
1593 static int hf_ccp_opt_length
;
1594 static int hf_ccp_opt_oui
;
1595 static int hf_ccp_opt_subtype
;
1596 static int hf_ccp_opt_data
;
1597 static int hf_ccp_opt_history_count
;
1598 static int hf_ccp_opt_cm
;
1599 static int hf_ccp_opt_cm_reserved
;
1600 static int hf_ccp_opt_cm_check_mode
;
1601 static int hf_ccp_opt_supported_bits
;
1602 static int hf_ccp_opt_supported_bits_h
;
1603 static int hf_ccp_opt_supported_bits_m
;
1604 static int hf_ccp_opt_supported_bits_s
;
1605 static int hf_ccp_opt_supported_bits_l
;
1606 static int hf_ccp_opt_supported_bits_d
;
1607 static int hf_ccp_opt_supported_bits_c
;
1608 static int hf_ccp_opt_history
;
1609 static int hf_ccp_opt_version
;
1610 static int hf_ccp_opt_vd
;
1611 static int hf_ccp_opt_vd_vers
;
1612 static int hf_ccp_opt_vd_dict
;
1613 static int hf_ccp_opt_check_mode
;
1614 static int hf_ccp_opt_process_mode
;
1615 static int hf_ccp_opt_fe
;
1616 static int hf_ccp_opt_p
;
1617 static int hf_ccp_opt_History
; /* Different than hf_ccp_opt_history */
1618 static int hf_ccp_opt_contexts
;
1619 static int hf_ccp_opt_mode
;
1620 static int hf_ccp_opt_window
;
1621 static int hf_ccp_opt_method
;
1622 static int hf_ccp_opt_mbz
;
1623 static int hf_ccp_opt_chk
;
1624 static int hf_ccp_opt_mode_dictcount
;
1625 static int hf_ccp_opt_dict_size
;
1626 static int hf_ccp_opt_history_length
;
1631 #define CI_CBCP_NO_CALLBACK 1 /* No callback */
1632 #define CI_CBCP_CB_USER 2 /* Callback to a user-specified number */
1633 #define CI_CBCP_CB_PRE 3 /* Callback to a pre-specified or
1634 administrator specified number */
1635 #define CI_CBCP_CB_ANY 4 /* Callback to any of a list of numbers */
1640 #define CI_BACP_FAVORED_PEER 1 /* Favored-Peer */
1645 #define CI_BAP_LINK_TYPE 1 /* Link Type */
1646 #define CI_BAP_PHONE_DELTA 2 /* Phone-Delta */
1647 #define CI_BAP_NO_PHONE_NUM_NEEDED 3 /* No Phone Number Needed */
1648 #define CI_BAP_REASON 4 /* Reason */
1649 #define CI_BAP_LINK_DISC 5 /* Link Discriminator */
1650 #define CI_BAP_CALL_STATUS 6 /* Call Status */
1652 static int dissect_ppp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
);
1654 static const value_string pap_vals
[] = {
1655 {CONFREQ
, "Authenticate-Request"},
1656 {CONFACK
, "Authenticate-Ack"},
1657 {CONFNAK
, "Authenticate-Nak"},
1661 #define CHAP_CHAL 1 /* CHAP Challenge */
1662 #define CHAP_RESP 2 /* CHAP Response */
1663 #define CHAP_SUCC 3 /* CHAP Success */
1664 #define CHAP_FAIL 4 /* CHAP Failure */
1666 static const value_string chap_vals
[] = {
1667 {CHAP_CHAL
, "Challenge"},
1668 {CHAP_RESP
, "Response"},
1669 {CHAP_SUCC
, "Success"},
1670 {CHAP_FAIL
, "Failure"},
1674 static const value_string pppmuxcp_vals
[] = {
1675 {CONFREQ
, "Configuration Request"},
1676 {CONFACK
, "Configuration Ack"},
1684 #define CI_DEFAULT_PID 1
1686 static const true_false_string tfs_pppmux_length_field
= { "2 bytes", "1 byte" };
1691 #define CI_IPV6CP_IF_ID 1 /* Interface Identifier (RFC 2472) */
1692 #define CI_IPV6CP_COMPRESSTYPE 2 /* Compression Type (RFC 2472) */
1695 *******************************************************************************
1696 * DETAILS : Calculate a new FCS-16 given the current FCS-16 and the new data.
1697 *******************************************************************************
1700 fcs16(tvbuff_t
*tvbuff
)
1702 unsigned len
= tvb_reported_length(tvbuff
) - 2;
1704 /* Check for Invalid Length */
1707 return crc16_ccitt_tvb(tvbuff
, len
);
1711 *******************************************************************************
1712 * DETAILS : Calculate a new FCS-32 given the current FCS-32 and the new data.
1713 *******************************************************************************
1716 fcs32(tvbuff_t
*tvbuff
)
1718 unsigned len
= tvb_reported_length(tvbuff
) - 4;
1720 /* Check for invalid Length */
1722 return (0x00000000);
1723 return crc32_ccitt_tvb(tvbuff
, len
);
1727 decode_fcs(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*fh_tree
, int fcs_decode
, int proto_offset
)
1730 int len
, reported_len
;
1733 * Remove the FCS, if any, from the packet data.
1735 switch (fcs_decode
) {
1738 next_tvb
= tvb_new_subset_remaining(tvb
, proto_offset
);
1743 * Do we have the entire packet, and does it include a 2-byte FCS?
1745 len
= tvb_captured_length_remaining(tvb
, proto_offset
);
1746 reported_len
= tvb_reported_length_remaining(tvb
, proto_offset
);
1747 if (reported_len
< 2 || len
< 0) {
1749 * The packet is claimed not to even have enough data for a 2-byte
1750 * FCS, or we're already past the end of the captured data.
1751 * Don't slice anything off.
1753 next_tvb
= tvb_new_subset_remaining(tvb
, proto_offset
);
1754 } else if (len
< reported_len
) {
1756 * The packet is claimed to have enough data for a 2-byte FCS, but
1757 * we didn't capture all of the packet.
1758 * Slice off the 2-byte FCS from the reported length, and trim the
1759 * captured length so it's no more than the reported length; that
1760 * will slice off what of the FCS, if any, is in the captured
1764 if (len
> reported_len
)
1766 next_tvb
= tvb_new_subset_length_caplen(tvb
, proto_offset
, len
, reported_len
);
1769 * We have the entire packet, and it includes a 2-byte FCS.
1774 next_tvb
= tvb_new_subset_length_caplen(tvb
, proto_offset
, len
, reported_len
);
1777 * Compute the FCS and put it into the tree.
1779 proto_tree_add_checksum(fh_tree
, tvb
, proto_offset
+ len
, hf_ppp_fcs_16
, hf_ppp_fcs_status
, &ei_ppp_fcs
, pinfo
, fcs16(tvb
),
1780 ENC_LITTLE_ENDIAN
, PROTO_CHECKSUM_VERIFY
);
1786 * Do we have the entire packet, and does it include a 4-byte FCS?
1788 len
= tvb_captured_length_remaining(tvb
, proto_offset
);
1789 reported_len
= tvb_reported_length_remaining(tvb
, proto_offset
);
1790 if (reported_len
< 4) {
1792 * The packet is claimed not to even have enough data for a 4-byte
1793 * FCS. Just pass on the tvbuff as is.
1795 next_tvb
= tvb_new_subset_remaining(tvb
, proto_offset
);
1796 } else if (len
< reported_len
) {
1798 * The packet is claimed to have enough data for a 4-byte FCS, but
1799 * we didn't capture all of the packet.
1800 * Slice off the 4-byte FCS from the reported length, and trim the
1801 * captured length so it's no more than the reported length; that
1802 * will slice off what of the FCS, if any, is in the captured
1806 if (len
> reported_len
)
1808 next_tvb
= tvb_new_subset_length_caplen(tvb
, proto_offset
, len
, reported_len
);
1811 * We have the entire packet, and it includes a 4-byte FCS.
1816 next_tvb
= tvb_new_subset_length_caplen(tvb
, proto_offset
, len
, reported_len
);
1819 * Compute the FCS and put it into the tree.
1821 proto_tree_add_checksum(fh_tree
, tvb
, proto_offset
+ len
, hf_ppp_fcs_32
, hf_ppp_fcs_status
, &ei_ppp_fcs
, pinfo
, fcs32(tvb
),
1822 ENC_LITTLE_ENDIAN
, PROTO_CHECKSUM_VERIFY
);
1827 DISSECTOR_ASSERT_NOT_REACHED();
1836 capture_ppp_hdlc(const unsigned char *pd
, int offset
, int len
, capture_packet_info_t
*cpinfo
, const union wtap_pseudo_header
*pseudo_header _U_
)
1838 if (!BYTES_ARE_IN_FRAME(offset
, len
, 2))
1841 if (pd
[0] == CHDLC_ADDR_UNICAST
|| pd
[0] == CHDLC_ADDR_MULTICAST
)
1842 return call_capture_dissector(chdlc_cap_handle
, pd
, offset
, len
, cpinfo
, pseudo_header
);
1844 if (!BYTES_ARE_IN_FRAME(offset
, len
, 4))
1847 return try_capture_dissector("ppp_hdlc", pntoh16(&pd
[offset
+ 2]), pd
, offset
+ 4, len
, cpinfo
, pseudo_header
);
1851 dissect_lcp_vendor_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1853 proto_tree
*field_tree
;
1856 int len
= tvb_reported_length(tvb
);
1858 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_vendor
, ett_lcp_vendor_opt
, 6,
1860 return tvb_captured_length(tvb
);
1862 proto_tree_add_item(field_tree
, hf_lcp_opt_oui
, tvb
, offset
+ 2, 3, ENC_BIG_ENDIAN
);
1864 proto_tree_add_item(field_tree
, hf_lcp_opt_kind
, tvb
, offset
+ 5, 1,
1867 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
+ 6,
1871 return tvb_captured_length(tvb
);
1875 dissect_lcp_mru_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1877 proto_tree
*field_tree
;
1882 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
1883 proto_lcp_option_mru
, ett_lcp_mru_opt
, 4,
1885 return tvb_captured_length(tvb
);
1887 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_mru
, tvb
, offset
+ 2, 2,
1888 ENC_BIG_ENDIAN
, &mru
);
1889 proto_item_append_text(ti
, ": %u", mru
);
1890 return tvb_captured_length(tvb
);
1894 dissect_lcp_async_map_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1896 proto_tree
*field_tree
;
1897 proto_item
*tf
, *ti
;
1899 static int * const asyncmap_fields
[] = {
1900 &hf_lcp_opt_asyncmap_us
, &hf_lcp_opt_asyncmap_rs
,
1901 &hf_lcp_opt_asyncmap_gs
, &hf_lcp_opt_asyncmap_fs
,
1902 &hf_lcp_opt_asyncmap_esc
, &hf_lcp_opt_asyncmap_sub
,
1903 &hf_lcp_opt_asyncmap_em
, &hf_lcp_opt_asyncmap_can
,
1904 &hf_lcp_opt_asyncmap_etb
, &hf_lcp_opt_asyncmap_syn
,
1905 &hf_lcp_opt_asyncmap_nak
, &hf_lcp_opt_asyncmap_dc4
,
1906 &hf_lcp_opt_asyncmap_dc3
, &hf_lcp_opt_asyncmap_dc2
,
1907 &hf_lcp_opt_asyncmap_dc1
, &hf_lcp_opt_asyncmap_dle
,
1908 &hf_lcp_opt_asyncmap_si
, &hf_lcp_opt_asyncmap_so
,
1909 &hf_lcp_opt_asyncmap_cr
, &hf_lcp_opt_asyncmap_ff
,
1910 &hf_lcp_opt_asyncmap_vt
, &hf_lcp_opt_asyncmap_lf
,
1911 &hf_lcp_opt_asyncmap_ht
, &hf_lcp_opt_asyncmap_bs
,
1912 &hf_lcp_opt_asyncmap_bel
, &hf_lcp_opt_asyncmap_ack
,
1913 &hf_lcp_opt_asyncmap_enq
, &hf_lcp_opt_asyncmap_eot
,
1914 &hf_lcp_opt_asyncmap_etx
, &hf_lcp_opt_asyncmap_stx
,
1915 &hf_lcp_opt_asyncmap_soh
, &hf_lcp_opt_asyncmap_nul
,
1919 static const char *ctrlchars
[32] = {
1920 "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
1921 "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
1922 "DLE", "DC1 (XON)", "DC2", "DC3 (XOFF)", "DC4", "NAK", "SYN", "ETB",
1923 "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
1930 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
1931 proto_lcp_option_async_map
, ett_lcp_asyncmap_opt
, 6,
1933 return tvb_captured_length(tvb
);
1935 map
= tvb_get_ntohl(tvb
, offset
+ 2);
1936 proto_item_append_text(tf
, ": 0x%08x", map
);
1938 ti
= proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 2,
1939 hf_lcp_opt_asyncmap
, ett_lcp_asyncmap_opt
, asyncmap_fields
,
1942 if (map
== 0x00000000) {
1943 proto_item_append_text(tf
, " (None)");
1944 proto_item_append_text(ti
, " (None)");
1945 } else if (map
== 0xffffffff) {
1946 proto_item_append_text(tf
, " (All)");
1947 proto_item_append_text(ti
, " (All)");
1949 for (anyctrlchars
= false, i
= 31; i
>= 0; i
--) {
1950 if (map
& (1 << i
)) {
1952 proto_item_append_text(tf
, ", %s", ctrlchars
[i
]);
1954 anyctrlchars
= true;
1955 proto_item_append_text(tf
, "%s", ctrlchars
[i
]);
1959 proto_item_append_text(tf
, ")");
1962 return tvb_captured_length(tvb
);
1966 dissect_lcp_authprot_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1968 proto_tree
*field_tree
;
1972 int length
= tvb_reported_length(tvb
);
1974 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_authprot
, ett_lcp_authprot_opt
, 4,
1976 return tvb_captured_length(tvb
);
1978 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_auth_protocol
, tvb
, offset
+ 2,
1979 2, ENC_BIG_ENDIAN
, &protocol
);
1980 proto_item_append_text(ti
, ": %s (0x%02x)", val_to_str_ext_const(protocol
, &ppp_vals_ext
, "Unknown"),
1986 if (protocol
== PPP_CHAP
) {
1987 proto_tree_add_item(field_tree
, hf_lcp_opt_algorithm
, tvb
, offset
,
1990 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
,
1991 offset
+ 1, length
- 1, ENC_NA
);
1994 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
1999 return tvb_captured_length(tvb
);
2003 dissect_lcp_qualprot_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2005 proto_tree
*field_tree
;
2009 int length
= tvb_reported_length(tvb
);
2011 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_qualprot
, ett_lcp_qualprot_opt
, 4,
2013 return tvb_captured_length(tvb
);
2015 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_quality_protocol
, tvb
, offset
+ 2,
2016 2, ENC_BIG_ENDIAN
, &protocol
);
2017 proto_item_append_text(ti
, ": %s (0x%02x)", val_to_str_ext_const(protocol
, &ppp_vals_ext
, "Unknown"),
2021 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
+ 4,
2022 length
+ 4, ENC_NA
);
2025 return tvb_captured_length(tvb
);
2029 dissect_lcp_magicnumber_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2031 proto_tree
*field_tree
;
2033 uint32_t magic_number
;
2036 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2037 proto_lcp_option_magicnumber
, ett_lcp_magicnumber_opt
, 6,
2039 return tvb_captured_length(tvb
);
2041 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_magic_number
, tvb
, offset
+ 2,
2042 4, ENC_BIG_ENDIAN
, &magic_number
);
2043 proto_item_append_text(ti
, ": 0x%08x", magic_number
);
2045 return tvb_captured_length(tvb
);
2049 dissect_lcp_linkqualmon_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2051 proto_tree
*field_tree
;
2052 proto_item
*ti
, *tf
;
2053 uint32_t reportingperiod
;
2056 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2057 proto_lcp_option_linkqualmon
, ett_lcp_linkqualmon_opt
, 6,
2059 return tvb_captured_length(tvb
);
2061 ti
= proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_reportingperiod
,
2062 tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
, &reportingperiod
);
2063 proto_item_append_text(tf
, ": %u microsecond%s", reportingperiod
, plurality(reportingperiod
, "", "s"));
2064 if (reportingperiod
== 0)
2066 proto_item_append_text(ti
, " [illegal]");
2067 proto_item_append_text(tf
, " [illegal]");
2070 return tvb_captured_length(tvb
);
2074 dissect_lcp_field_compress(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2076 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_field_compress
, ett_lcp_pcomp_opt
);
2080 dissect_lcp_addr_field_compress(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2082 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_addr_field_compress
, ett_lcp_acccomp_opt
);
2086 dissect_lcp_fcs_alternatives_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2088 proto_tree
*field_tree
;
2091 static int * const fcs_alternatives_fields
[] = {
2092 &hf_lcp_opt_fcs_alternatives_ccitt32
,
2093 &hf_lcp_opt_fcs_alternatives_ccitt16
,
2094 &hf_lcp_opt_fcs_alternatives_null
,
2098 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2099 proto_lcp_option_fcs_alternatives
, ett_lcp_fcs_alternatives_opt
, 3,
2101 return tvb_captured_length(tvb
);
2103 proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 2,
2104 hf_lcp_opt_fcs_alternatives
, ett_lcp_fcs_alternatives_opt
,
2105 fcs_alternatives_fields
, ENC_NA
);
2106 proto_item_append_text(tf
, ": 0x%02x", tvb_get_uint8(tvb
, offset
+ 2));
2107 return tvb_captured_length(tvb
);
2111 dissect_lcp_self_describing_pad_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2113 proto_tree
*field_tree
;
2114 proto_item
*tf
, *ti
;
2118 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2119 proto_lcp_option_self_desc_pad
, ett_lcp_self_desc_pad_opt
, 3,
2121 return tvb_captured_length(tvb
);
2123 ti
= proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_maximum
, tvb
,
2124 offset
+ 2, 1, ENC_BIG_ENDIAN
, &maximum
);
2125 proto_item_append_text(tf
, ": %u octet%s", maximum
, plurality(maximum
, "", "s"));
2128 proto_item_append_text(ti
, " [invalid]");
2129 proto_item_append_text(tf
, " [invalid]");
2132 return tvb_captured_length(tvb
);
2136 dissect_lcp_numbered_mode_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2138 proto_tree
*field_tree
;
2139 proto_item
*tf
, *ti
;
2142 int length
= tvb_reported_length(tvb
);
2144 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_numbered_mode
, ett_lcp_numbered_mode_opt
, 3,
2146 return tvb_captured_length(tvb
);
2148 ti
= proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_window
, tvb
,
2149 offset
+ 2, 1, ENC_BIG_ENDIAN
, &window
);
2150 proto_item_append_text(tf
, ": %u frame%s", window
, plurality(window
, "", "s"));
2151 if (window
== 0 || window
> 127)
2153 proto_item_append_text(ti
, " [invalid]");
2154 proto_item_append_text(tf
, " [invalid]");
2157 proto_tree_add_item(field_tree
, hf_lcp_opt_hdlc_address
, tvb
,
2158 offset
+ 3, length
- 3, ENC_NA
);
2161 return tvb_captured_length(tvb
);
2164 /* https://tools.ietf.org/html/rfc1570#section-2.3 only lists 0-4, but
2165 * https://tools.ietf.org/html/draft-ietf-pppext-callback-ds-02 lists 5 as
2166 * "E.165 number", rather than "unassigned", and
2167 * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cbcp/efee6372-3251-471e-a141-71d1e7fef21f
2168 * does indicate 6 as below. Since 5 is only mentioned in the draft, leave it
2171 static const value_string callback_op_vals
[] = {
2172 {0, "Location is determined by user authentication"},
2173 {1, "Message is dialing string"},
2174 {2, "Message is location identifier"},
2175 {3, "Message is E.164"},
2176 {4, "Message is distinguished name"},
2177 {5, "unassigned"}, /* "Message is E.165"? */
2178 {6, "Location is determined during CBCP negotiation"},
2183 dissect_lcp_callback_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2185 proto_tree
*field_tree
;
2189 int length
= tvb_reported_length(tvb
);
2191 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_callback
, ett_lcp_callback_opt
, 3,
2193 return tvb_captured_length(tvb
);
2195 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_operation
, tvb
, offset
+ 2, 1,
2196 ENC_BIG_ENDIAN
, &operation
);
2197 proto_item_append_text(tf
, ": %s", val_to_str_const(operation
, callback_op_vals
, "Unknown"));
2200 proto_tree_add_item(field_tree
, hf_lcp_opt_message
, tvb
, offset
+ 3,
2201 length
- 3, ENC_NA
);
2203 return tvb_captured_length(tvb
);
2207 dissect_lcp_compound_frames_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2209 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_compound_frames
, ett_lcp_compound_frames_opt
);
2213 dissect_lcp_nomdataencap_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2215 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_nomdataencap
, ett_lcp_nomdataencap_opt
);
2218 /* https://tools.ietf.org/html/rfc1990#section-5.1.1 */
2220 dissect_lcp_multilink_mrru_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2222 proto_tree
*field_tree
;
2227 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2228 proto_lcp_option_multilink_mrru
, ett_lcp_multilink_mrru_opt
, 4,
2230 return tvb_captured_length(tvb
);
2232 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_mrru
, tvb
, offset
+ 2, 2,
2233 ENC_BIG_ENDIAN
, &mrru
);
2234 proto_item_append_text(tf
, ": %u", mrru
);
2235 return tvb_captured_length(tvb
);
2239 dissect_lcp_multilink_ssnh_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2241 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_multilink_ssnh
, ett_lcp_multilink_ssnh_opt
);
2244 #define CLASS_NULL 0
2245 #define CLASS_LOCAL 1
2247 #define CLASS_IEEE_802_1 3
2248 #define CLASS_PPP_MAGIC_NUMBER 4
2249 #define CLASS_PSDN_DIRECTORY_NUMBER 5
2251 static const value_string multilink_ep_disc_class_vals
[] = {
2252 {CLASS_NULL
, "Null"},
2253 {CLASS_LOCAL
, "Locally assigned address"},
2254 {CLASS_IP
, "Internet Protocol (IP) address"},
2255 {CLASS_IEEE_802_1
, "IEEE 802.1 globally assigned MAC address"},
2256 {CLASS_PPP_MAGIC_NUMBER
, "PPP magic-number block"},
2257 {CLASS_PSDN_DIRECTORY_NUMBER
, "Public switched network directory number"},
2262 dissect_lcp_multilink_ep_disc_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2264 proto_tree
*field_tree
, *magic_tree
;
2265 proto_item
*tf
, *tm
;
2266 uint32_t ep_disc_class
;
2268 int length
= tvb_reported_length(tvb
);
2270 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_multilink_ep_disc
, ett_lcp_multilink_ep_disc_opt
, 3,
2272 return tvb_captured_length(tvb
);
2274 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_ep_disc_class
, tvb
, offset
+ 2,
2275 1, ENC_BIG_ENDIAN
, &ep_disc_class
);
2276 proto_item_append_text(tf
, ": Class: %s", val_to_str_const(ep_disc_class
, multilink_ep_disc_class_vals
, "Unknown"));
2279 return tvb_captured_length(tvb
);
2283 switch (ep_disc_class
) {
2288 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
2289 length
<= 20 ? length
: 20, ENC_NA
);
2294 proto_tree_add_item(field_tree
, hf_lcp_opt_ip_address
, tvb
, offset
,
2297 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
2302 case CLASS_IEEE_802_1
:
2304 proto_tree_add_item(field_tree
, hf_lcp_opt_802_1_address
, tvb
,
2307 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
2312 case CLASS_PPP_MAGIC_NUMBER
:
2314 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
2317 tm
= proto_tree_add_item(field_tree
, hf_lcp_opt_magic_block
, tvb
,
2318 offset
, length
<= 20 ? length
: 20, ENC_NA
);
2319 magic_tree
= proto_item_add_subtree(tm
, ett_lcp_magic_block
);
2320 for ( ; length
>= 4; length
-= 4, offset
+= 4) {
2321 proto_tree_add_item(magic_tree
, hf_lcp_opt_magic_number
, tvb
,
2322 offset
, 4, ENC_BIG_ENDIAN
);
2327 case CLASS_PSDN_DIRECTORY_NUMBER
:
2328 proto_tree_add_item(field_tree
, hf_lcp_opt_psndn
, tvb
, offset
,
2329 length
> 15 ? 15 : length
, ENC_NA
);
2333 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
, length
,
2337 return tvb_captured_length(tvb
);
2340 static const value_string dce_id_mode_vals
[] = {
2341 {1, "Mode-1 (No Additional Negotiation)"},
2342 {2, "Mode-2 (Full PPP Negotiation and State Machine)"},
2347 dissect_lcp_dce_identifier_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2349 proto_tree
*field_tree
;
2354 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2355 proto_lcp_option_dce_identifier
, ett_lcp_dce_identifier_opt
, 3,
2357 return tvb_captured_length(tvb
);
2359 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_mode
, tvb
, offset
+ 2, 1,
2360 ENC_BIG_ENDIAN
, &mode
);
2361 proto_item_append_text(tf
, ": %s", val_to_str_const(mode
, dce_id_mode_vals
, "Unknown"));
2363 return tvb_captured_length(tvb
);
2367 dissect_lcp_multilink_pp_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2369 proto_tree
*field_tree
;
2373 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2374 proto_lcp_option_multilink_pp
, ett_lcp_multilink_pp_opt
, 4,
2376 return tvb_captured_length(tvb
);
2378 proto_tree_add_item(field_tree
, hf_lcp_opt_unused
, tvb
, offset
+ 2, 2, ENC_NA
);
2379 return tvb_captured_length(tvb
);
2383 dissect_lcp_bacp_link_discriminator_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2385 proto_tree
*field_tree
;
2388 uint32_t link_discrim
;
2390 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2391 proto_lcp_option_link_discrim
, ett_lcp_bacp_link_discrim_opt
, 4,
2393 return tvb_captured_length(tvb
);
2395 proto_tree_add_item_ret_uint(field_tree
, hf_lcp_opt_link_discrim
, tvb
, offset
+ 2,
2396 2, ENC_BIG_ENDIAN
, &link_discrim
);
2397 proto_item_append_text(tf
, ": %u (0x%04x)", link_discrim
, link_discrim
);
2398 return tvb_captured_length(tvb
);
2401 /* Assuming it's this one:
2402 * https://tools.ietf.org/html/draft-ietf-pppext-link-negot-00
2405 dissect_lcp_auth_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2407 proto_tree
*field_tree
;
2413 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_auth
, ett_lcp_auth_opt
, 3,
2415 return tvb_captured_length(tvb
);
2418 proto_tree_add_item_ret_length(field_tree
, hf_lcp_opt_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &id_len
);
2420 length
= tvb_reported_length_remaining(tvb
, offset
);
2421 if ((int)id_len
< length
) {
2424 proto_tree_add_item(field_tree
, hf_lcp_opt_data
, tvb
, offset
,
2427 return tvb_captured_length(tvb
);
2430 /* Assuming it's this one:
2431 * https://tools.ietf.org/html/draft-ietf-pppext-cobs-00
2434 dissect_lcp_cobs_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2436 proto_tree
*field_tree
;
2439 static int * const cobs_flags_fields
[] = {
2440 &hf_lcp_opt_cobs_flags_res
,
2441 &hf_lcp_opt_cobs_flags_pre
,
2442 &hf_lcp_opt_cobs_flags_zxe
,
2446 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2447 proto_lcp_option_cobs
, ett_lcp_cobs_opt
, 3,
2449 return tvb_captured_length(tvb
);
2451 proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 2, hf_lcp_opt_cobs_flags
,
2452 ett_lcp_cobs_opt
, cobs_flags_fields
, ENC_NA
);
2453 return tvb_captured_length(tvb
);
2457 dissect_lcp_prefix_elision_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2459 proto_tree
*field_tree
;
2463 int length
= tvb_reported_length(tvb
);
2465 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_prefix_elision
, ett_lcp_prefix_elision_opt
, 2,
2467 return tvb_captured_length(tvb
);
2472 while (length
>= 2) {
2473 proto_tree_add_item(field_tree
, hf_lcp_opt_class
, tvb
, offset
, 1,
2475 pre_len
= tvb_get_uint8(tvb
, offset
+ 1);
2476 if (pre_len
+ 2 <= length
) {
2477 proto_tree_add_item(field_tree
, hf_lcp_opt_prefix
, tvb
,
2478 offset
+ 2, 1, ENC_NA
);
2479 length
-= (2 + pre_len
);
2481 /* Prefix length doesn't make sense, so bail out */
2487 return tvb_captured_length(tvb
);
2490 static const value_string ml_hdr_fmt_code_vals
[] = {
2491 {2, "Long sequence number fragment format with classes"},
2492 {6, "Short sequence number fragment format with classes"},
2497 dissect_lcp_multilink_hdr_fmt_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2499 proto_tree
*field_tree
;
2503 if (!dissect_lcp_fixed_opt(tvb
, pinfo
, tree
,
2504 proto_lcp_option_multilink_hdr_fmt
, ett_multilink_hdr_fmt_opt
, 4,
2506 return tvb_captured_length(tvb
);
2508 proto_tree_add_item(field_tree
, hf_lcp_opt_code
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
2509 proto_tree_add_item(field_tree
, hf_lcp_opt_max_susp_classes
, tvb
,
2510 offset
+ 3, 1, ENC_BIG_ENDIAN
);
2511 return tvb_captured_length(tvb
);
2515 /* Character sets from https://www.iana.org/assignments/character-sets. */
2516 static const value_string charset_vals
[] = {
2517 {3, "ANSI_X3.4-1968"},
2518 {4, "ISO_8859-1:1987"},
2519 {5, "ISO_8859-2:1987"},
2520 {6, "ISO_8859-3:1988"},
2521 {7, "ISO_8859-4:1988"},
2522 {8, "ISO_8859-5:1988"},
2523 {9, "ISO_8859-6:1987"},
2524 {10, "ISO_8859-7:1987"},
2525 {11, "ISO_8859-8:1988"},
2526 {12, "ISO_8859-9:1989"},
2527 {13, "ISO-8859-10"},
2528 {14, "ISO_6937-2-add"},
2530 {16, "JIS_Encoding"},
2532 {18, "Extended_UNIX_Code_Packed_Format_for_Japanese"},
2533 {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
2535 {21, "SEN_850200_C"},
2540 {26, "NF_Z_62-010"},
2541 {27, "ISO-10646-UTF-1"},
2542 {28, "ISO_646.basic:1983"},
2544 {30, "ISO_646.irv:1983"},
2546 {32, "NATS-SEFI-ADD"},
2548 {34, "NATS-DANO-ADD"},
2549 {35, "SEN_850200_B"},
2550 {36, "KS_C_5601-1987"},
2551 {37, "ISO-2022-KR"},
2553 {39, "ISO-2022-JP"},
2554 {40, "ISO-2022-JP-2"},
2555 {41, "JIS_C6220-1969-jp"},
2556 {42, "JIS_C6220-1969-ro"},
2559 {45, "latin-greek"},
2560 {46, "NF_Z_62-010_(1973)"},
2561 {47, "Latin-greek-1"},
2563 {49, "JIS_C6226-1978"},
2564 {50, "BS_viewdata"},
2567 {53, "INIS-cyrillic"},
2568 {54, "ISO_5427:1981"},
2569 {55, "ISO_5428:1980"},
2573 {59, "videotex-suppl"},
2577 {63, "JIS_C6226-1983"},
2581 {67, "JIS_C6229-1984-a"},
2582 {68, "JIS_C6229-1984-b"},
2583 {69, "JIS_C6229-1984-b-add"},
2584 {70, "JIS_C6229-1984-hand"},
2585 {71, "JIS_C6229-1984-hand-add"},
2586 {72, "JIS_C6229-1984-kana"},
2587 {73, "ISO_2033-1983"},
2588 {74, "ANSI_X3.110-1983"},
2591 {77, "ECMA-cyrillic"},
2592 {78, "CSA_Z243.4-1985-1"},
2593 {79, "CSA_Z243.4-1985-2"},
2594 {80, "CSA_Z243.4-1985-gr"},
2595 {81, "ISO_8859-6-E"},
2596 {82, "ISO_8859-6-I"},
2598 {84, "ISO_8859-8-E"},
2599 {85, "ISO_8859-8-I"},
2601 {87, "JUS_I.B1.002"},
2603 {89, "JUS_I.B1.003-serb"},
2604 {90, "JUS_I.B1.003-mac"},
2605 {91, "greek-ccitt"},
2606 {92, "NC_NC00-10:81"},
2607 {93, "ISO_6937-2-25"},
2608 {94, "GOST_19768-74"},
2609 {95, "ISO_8859-supp"},
2610 {96, "ISO_10367-box"},
2612 {98, "JIS_X0212-1990"},
2617 {103, "UNICODE-1-1-UTF-7"},
2618 {104, "ISO-2022-CN"},
2619 {105, "ISO-2022-CN-EXT"},
2621 {109, "ISO-8859-13"},
2622 {110, "ISO-8859-14"},
2623 {111, "ISO-8859-15"},
2624 {112, "ISO-8859-16"},
2627 {115, "OSD_EBCDIC_DF04_15"},
2628 {116, "OSD_EBCDIC_DF03_IRV"},
2629 {117, "OSD_EBCDIC_DF04_1"},
2630 {118, "ISO-11548-1"},
2632 {1000, "ISO-10646-UCS-2"},
2633 {1001, "ISO-10646-UCS-4"},
2634 {1002, "ISO-10646-UCS-Basic"},
2635 {1003, "ISO-10646-Unicode-Latin1"},
2636 {1004, "ISO-10646-J-1"},
2637 {1005, "ISO-Unicode-IBM-1261"},
2638 {1006, "ISO-Unicode-IBM-1268"},
2639 {1007, "ISO-Unicode-IBM-1276"},
2640 {1008, "ISO-Unicode-IBM-1264"},
2641 {1009, "ISO-Unicode-IBM-1265"},
2642 {1010, "UNICODE-1-1"},
2653 {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
2654 {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
2655 {2002, "ISO-8859-2-Windows-Latin-2"},
2656 {2003, "ISO-8859-9-Windows-Latin-5"},
2657 {2004, "hp-roman8"},
2658 {2005, "Adobe-Standard-Encoding"},
2659 {2006, "Ventura-US"},
2660 {2007, "Ventura-International"},
2665 {2012, "PC8-Danish-Norwegian"},
2667 {2014, "PC8-Turkish"},
2668 {2015, "IBM-Symbols"},
2671 {2018, "HP-Pi-font"},
2673 {2020, "Adobe-Symbol-Encoding"},
2674 {2021, "HP-DeskTop"},
2675 {2022, "Ventura-Math"},
2676 {2023, "Microsoft-Publishing"},
2677 {2024, "Windows-31J"},
2680 {2027, "macintosh"},
2717 {2064, "EBCDIC-AT-DE"},
2718 {2065, "EBCDIC-AT-DE-A"},
2719 {2066, "EBCDIC-CA-FR"},
2720 {2067, "EBCDIC-DK-NO"},
2721 {2068, "EBCDIC-DK-NO-A"},
2722 {2069, "EBCDIC-FI-SE"},
2723 {2070, "EBCDIC-FI-SE-A"},
2724 {2071, "EBCDIC-FR"},
2725 {2072, "EBCDIC-IT"},
2726 {2073, "EBCDIC-PT"},
2727 {2074, "EBCDIC-ES"},
2728 {2075, "EBCDIC-ES-A"},
2729 {2076, "EBCDIC-ES-S"},
2730 {2077, "EBCDIC-UK"},
2731 {2078, "EBCDIC-US"},
2732 {2079, "UNKNOWN-8BIT"},
2738 {2085, "HZ-GB-2312"},
2754 {2101, "Big5-HKSCS"},
2757 {2104, "Amiga-1251"},
2758 {2105, "KOI7-switched"},
2762 {2109, "windows-874"},
2763 {2250, "windows-1250"},
2764 {2251, "windows-1251"},
2765 {2252, "windows-1252"},
2766 {2253, "windows-1253"},
2767 {2254, "windows-1254"},
2768 {2255, "windows-1255"},
2769 {2256, "windows-1256"},
2770 {2257, "windows-1257"},
2771 {2258, "windows-1258"},
2776 static value_string_ext charset_vals_ext
= VALUE_STRING_EXT_INIT(charset_vals
);
2779 dissect_lcp_internationalization_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2781 proto_tree
*field_tree
;
2784 int length
= tvb_reported_length(tvb
);
2786 if (!dissect_lcp_var_opt(tvb
, pinfo
, tree
, proto_lcp_option_internationalization
, ett_lcp_internationalization_opt
, 7,
2788 return tvb_captured_length(tvb
);
2790 proto_tree_add_item(field_tree
, hf_lcp_opt_MIBenum
, tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
2791 proto_tree_add_item(field_tree
, hf_lcp_opt_language_tag
, tvb
, offset
+ 6,
2792 length
- 6, ENC_ASCII
);
2794 return tvb_captured_length(tvb
);
2798 dissect_lcp_sonet_sdh_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2800 return dissect_lcp_simple_opt(tvb
, pinfo
, tree
, proto_lcp_option_sonet_sdh
, ett_lcp_sonet_sdh_opt
);
2804 dissect_ipcp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
2809 type
= tvb_get_uint8(tvb
, offset
);
2810 proto_tree_add_uint_format_value(tree
, hf_ipcp_opt_type
, tvb
, offset
, 1,
2811 type
, "%s (%u)", name
, type
);
2812 proto_tree_add_item(tree
, hf_ipcp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
2816 dissect_ipcp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2817 int proto
, int ett
, int expected_length
,
2818 proto_tree
** ret_tree
, proto_item
** ret_item
)
2820 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
2823 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
2824 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
2826 dissect_ipcp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
2830 /* https://tools.ietf.org/html/rfc1172#section-5.1 */
2832 dissect_ipcp_addrs_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2834 proto_tree
*field_tree
;
2838 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_addrs
, ett_ipcp_ipaddrs_opt
, 10,
2840 return tvb_captured_length(tvb
);
2842 proto_tree_add_item(field_tree
, hf_ipcp_opt_src_address
, tvb
, offset
+ 2,
2844 proto_tree_add_item(field_tree
, hf_ipcp_opt_dst_address
, tvb
, offset
+ 6,
2846 return tvb_captured_length(tvb
);
2849 static const true_false_string tfs_comp_slot_id
= {
2850 "The slot identifier may be compressed",
2851 "The slot identifier must not be compressed"
2854 /* https://tools.ietf.org/html/rfc1332#section-3.2 */
2856 dissect_ipcp_compress_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2858 proto_tree
*field_tree
;
2861 int length
= tvb_reported_length(tvb
);
2864 tf
= proto_tree_add_item(tree
, proto_ipcp_option_compress
, tvb
, 0, length
, ENC_NA
);
2865 field_tree
= proto_item_add_subtree(tf
, ett_ipcp_compress_opt
);
2867 dissect_ipcp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_ipcp_option_compress
));
2868 proto_tree_add_item(field_tree
, hf_ipcp_opt_compress_proto
, tvb
,
2869 offset
+ 2, 2, ENC_BIG_ENDIAN
);
2870 us
= tvb_get_ntohs(tvb
, offset
+ 2);
2873 proto_tree_add_item(field_tree
, hf_ipcp_opt_max_cid
, tvb
, offset
+ 4,
2875 proto_tree_add_item(field_tree
, hf_ipcp_opt_mrru
, tvb
, offset
+ 6, 2,
2877 proto_tree_add_item(field_tree
, hf_ipcp_opt_max_header
, tvb
,
2878 offset
+ 8, 2, ENC_BIG_ENDIAN
);
2881 proto_tree
*subopt_tree
;
2886 subopt_tree
= proto_tree_add_subtree_format(field_tree
, tvb
, offset
, length
,
2887 ett_ipcp_compress_opt
, NULL
, "Suboptions: (%u byte%s)", length
, plurality(length
, "", "s"));
2889 ppp_dissect_options(tvb
, offset
, length
, ipcp_rohc_suboption_table
, pinfo
, subopt_tree
);
2893 case IPCP_COMPRESS_VJ_1172
:
2894 case IPCP_COMPRESS_VJ
:
2895 proto_tree_add_item(field_tree
, hf_ipcp_opt_max_slot_id
, tvb
,
2896 offset
+ 4, 1, ENC_BIG_ENDIAN
);
2897 proto_tree_add_item(field_tree
, hf_ipcp_opt_comp_slot_id
, tvb
,
2898 offset
+ 5, 1, ENC_NA
);
2901 case IPCP_COMPRESS_IPHC
:
2902 proto_tree_add_item(field_tree
, hf_ipcp_opt_tcp_space
, tvb
, offset
+ 4,
2904 proto_tree_add_item(field_tree
, hf_ipcp_opt_non_tcp_space
, tvb
,
2905 offset
+ 6, 2, ENC_BIG_ENDIAN
);
2906 us
= tvb_get_ntohs(tvb
, offset
+ 8);
2907 proto_tree_add_uint_format_value(field_tree
, hf_ipcp_opt_f_max_period
,
2908 tvb
, offset
+ 8, 2, us
, "%u%s", us
,
2909 (us
== 0) ? " (infinity)" : "");
2910 us
= tvb_get_ntohs(tvb
, offset
+ 10);
2911 proto_tree_add_uint_format_value(field_tree
, hf_ipcp_opt_f_max_time
,
2912 tvb
, offset
+ 10, 2, us
, "%u%s", us
,
2913 (us
== 0) ? " (infinity)" : "");
2914 proto_tree_add_item(field_tree
, hf_ipcp_opt_max_header
, tvb
,
2915 offset
+ 12, 2, ENC_BIG_ENDIAN
);
2917 if ( length
> 14 ) {
2918 proto_tree
*subopt_tree
;
2923 subopt_tree
= proto_tree_add_subtree_format(field_tree
, tvb
, offset
, length
,
2924 ett_ipcp_compress_opt
, NULL
, "Suboptions: (%u byte%s)", length
, plurality(length
, "", "s"));
2925 ppp_dissect_options(tvb
, offset
, length
, ipcp_iphc_suboption_table
, pinfo
, subopt_tree
);
2931 proto_tree_add_item(field_tree
, hf_ipcp_data
, tvb
, offset
+ 4,
2932 length
- 4, ENC_NA
);
2937 return tvb_captured_length(tvb
);
2941 dissect_ipcp_opt_rohc_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
2946 type
= tvb_get_uint8(tvb
, offset
);
2947 proto_tree_add_uint_format_value(tree
, hf_ipcp_opt_rohc_type
, tvb
, offset
,
2948 1, type
, "%s (%u)", name
, type
);
2949 proto_tree_add_item(tree
, hf_ipcp_opt_rohc_length
, tvb
, offset
+ 1, 1,
2954 dissect_ipcp_rohc_profiles_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
2956 proto_tree
*field_tree
;
2958 int length
= tvb_reported_length(tvb
);
2961 tf
= proto_tree_add_item(tree
, proto_ipcp_rohc_option_profiles
, tvb
, offset
, length
, ENC_NA
);
2962 field_tree
= proto_item_add_subtree(tf
, ett_ipcp_rohc_profiles_opt
);
2964 dissect_ipcp_opt_rohc_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_ipcp_rohc_option_profiles
));
2966 return tvb_captured_length(tvb
);
2968 for (offset
+= 2, length
-= 2; length
>= 2; length
-= 2, offset
+= 2) {
2969 proto_tree_add_item(field_tree
, hf_ipcp_opt_rohc_profile
, tvb
,
2970 offset
, 2, ENC_BIG_ENDIAN
);
2972 return tvb_captured_length(tvb
);
2976 dissect_ipcp_opt_iphc_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
2981 type
= tvb_get_uint8(tvb
, offset
);
2982 proto_tree_add_uint_format_value(tree
, hf_ipcp_opt_iphc_type
, tvb
, offset
,
2983 1, type
, "%s (%u)", name
, type
);
2984 proto_tree_add_item(tree
, hf_ipcp_opt_iphc_length
, tvb
, offset
+ 1, 1,
2989 dissect_ipcp_iphc_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2990 int proto
, int ett
, int expected_length
,
2991 proto_tree
** ret_tree
, proto_item
** ret_item
)
2993 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
2996 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
2997 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
2999 dissect_ipcp_opt_iphc_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3004 dissect_ipcp_iphc_rtp_compress(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3006 proto_tree
*field_tree
;
3009 dissect_ipcp_iphc_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_iphc_option_rtp_compress
, ett_ipcp_iphc_rtp_compress_opt
, 2,
3011 return tvb_captured_length(tvb
);
3015 dissect_ipcp_iphc_enhanced_rtp_compress(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3017 proto_tree
*field_tree
;
3020 dissect_ipcp_iphc_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_iphc_option_enhanced_rtp_compress
, ett_ipcp_iphc_enhanced_rtp_compress_opt
, 2,
3022 return tvb_captured_length(tvb
);
3026 dissect_ipcp_iphc_neghdrcomp_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3028 proto_tree
*field_tree
;
3032 if (!dissect_ipcp_iphc_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_iphc_option_neghdrcomp
, ett_ipcp_iphc_neghdrcomp_opt
, 3,
3034 return tvb_captured_length(tvb
);
3036 proto_tree_add_item(field_tree
, hf_ipcp_opt_iphc_param
, tvb
, offset
+ 2, 1,
3038 return tvb_captured_length(tvb
);
3042 dissect_ipcp_addr_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3044 proto_tree
*field_tree
;
3048 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_addr
, ett_ipcp_ipaddr_opt
, 6,
3050 return tvb_captured_length(tvb
);
3052 proto_tree_add_item(field_tree
, hf_ipcp_opt_ip_address
, tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
3053 return tvb_captured_length(tvb
);
3057 dissect_ipcp_mobileipv4_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3059 proto_tree
*field_tree
;
3063 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_mobileipv4
, ett_ipcp_mobileipv4_opt
, 6,
3065 return tvb_captured_length(tvb
);
3067 proto_tree_add_item(field_tree
, hf_ipcp_opt_mobilenodehomeaddr
, tvb
,
3068 offset
+ 2, 4, ENC_BIG_ENDIAN
);
3069 return tvb_captured_length(tvb
);
3073 dissect_ipcp_pri_dns_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3075 proto_tree
*field_tree
;
3079 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_pri_dns
, ett_ipcp_pridns_opt
, 6,
3081 return tvb_captured_length(tvb
);
3083 proto_tree_add_item(field_tree
, hf_ipcp_opt_pri_dns_address
, tvb
,
3084 offset
+ 2, 4, ENC_BIG_ENDIAN
);
3085 return tvb_captured_length(tvb
);
3089 dissect_ipcp_pri_nbns_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3091 proto_tree
*field_tree
;
3095 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_pri_nbns
, ett_ipcp_prinbns_opt
, 6,
3097 return tvb_captured_length(tvb
);
3099 proto_tree_add_item(field_tree
, hf_ipcp_opt_pri_nbns_address
, tvb
,
3100 offset
+ 2, 4, ENC_BIG_ENDIAN
);
3101 return tvb_captured_length(tvb
);
3105 dissect_ipcp_sec_dns_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3107 proto_tree
*field_tree
;
3111 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_sec_dns
, ett_ipcp_secdns_opt
, 6,
3113 return tvb_captured_length(tvb
);
3115 proto_tree_add_item(field_tree
, hf_ipcp_opt_sec_dns_address
, tvb
,
3116 offset
+ 2, 4, ENC_BIG_ENDIAN
);
3117 return tvb_captured_length(tvb
);
3121 dissect_ipcp_sec_nbns_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3123 proto_tree
*field_tree
;
3127 if (!dissect_ipcp_fixed_opt(tvb
, pinfo
, tree
, proto_ipcp_option_sec_nbns
, ett_ipcp_secnbns_opt
, 6,
3129 return tvb_captured_length(tvb
);
3131 proto_tree_add_item(field_tree
, hf_ipcp_opt_sec_nbns_address
, tvb
,
3132 offset
+ 2, 4, ENC_BIG_ENDIAN
);
3133 return tvb_captured_length(tvb
);
3137 dissect_bcp_ncp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
3142 type
= tvb_get_uint8(tvb
, offset
);
3143 proto_tree_add_uint_format_value(tree
, hf_bcp_ncp_opt_type
, tvb
, offset
, 1,
3144 type
, "%s (%u)", name
, type
);
3146 proto_tree_add_item(tree
, hf_bcp_ncp_opt_length
, tvb
, offset
, 1,
3151 dissect_bcp_ncp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
3152 int proto
, int ett
, int expected_length
,
3153 proto_tree
** ret_tree
, proto_item
** ret_item
)
3155 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
3158 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
3159 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
3161 dissect_bcp_ncp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3167 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
3168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3169 | Type | Length | LAN Segment Number |Bridge#|
3170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3174 dissect_bcp_ncp_bridge_id(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3176 proto_tree
* field_tree
;
3180 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_bridge_id
, ett_bcp_ncp_bridge_id_opt
, 4,
3182 return tvb_captured_length(tvb
);
3184 proto_tree_add_item(field_tree
, hf_bcp_ncp_lan_seg_no
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
3185 proto_tree_add_item(field_tree
, hf_bcp_ncp_bridge_no
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
3187 return tvb_captured_length(tvb
);
3192 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
3193 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3194 | Type | Length | LAN Segment Number |Bridge#|
3195 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3198 dissect_bcp_ncp_line_id(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3200 proto_tree
* field_tree
;
3204 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_line_id
, ett_bcp_ncp_line_id_opt
, 4,
3206 return tvb_captured_length(tvb
);
3208 proto_tree_add_item(field_tree
, hf_bcp_ncp_lan_seg_no
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
3209 proto_tree_add_item(field_tree
, hf_bcp_ncp_bridge_no
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
3210 return tvb_captured_length(tvb
);
3215 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
3216 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3217 | Type | Length | MAC Type |
3218 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3222 1: IEEE 802.3/Ethernet with canonical addresses
3223 2: IEEE 802.4 with canonical addresses
3224 3: IEEE 802.5 with non-canonical addresses
3225 4: FDDI with non-canonical addresses
3227 11: IEEE 802.5 with canonical addresses
3228 12: FDDI with canonical addresses
3232 dissect_bcp_ncp_mac_sup(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3234 proto_tree
* field_tree
;
3238 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_mac_sup
, ett_bcp_ncp_mac_sup_opt
, 3,
3240 return tvb_captured_length(tvb
);
3242 proto_tree_add_item(field_tree
, hf_bcp_bpdu_mac_type
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
3243 return tvb_captured_length(tvb
);
3248 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
3249 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3250 | Type | Length | Enable/Disable|
3251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3255 dissect_bcp_ncp_tinygram_comp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3257 proto_tree
* field_tree
;
3261 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_tinygram_comp
, ett_bcp_ncp_tinygram_comp_opt
, 3,
3263 return tvb_captured_length(tvb
);
3265 proto_tree_add_item(field_tree
, hf_bcp_ncp_tinygram_comp
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
3266 return tvb_captured_length(tvb
);
3270 dissect_bcp_ncp_lan_id(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3272 proto_tree
* field_tree
;
3275 dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_lan_id
, ett_bcp_ncp_lan_id_opt
, 3,
3277 /* XXX - missing a field? */
3278 return tvb_captured_length(tvb
);
3283 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
3284 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3285 | Type | Length |MAC byte 1 |L|M| MAC byte 2 |
3286 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3287 | MAC byte 3 | MAC byte 4 | MAC byte 5 | MAC byte 6 |
3288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3291 dissect_bcp_ncp_mac_addr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3293 proto_tree
* field_tree
;
3297 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_mac_addr
, ett_bcp_ncp_mac_addr_opt
, 8,
3299 return tvb_captured_length(tvb
);
3301 proto_tree_add_item(field_tree
, hf_bcp_ncp_mac
, tvb
, offset
+2, 6, ENC_NA
);
3302 proto_tree_add_item(field_tree
, hf_bcp_ncp_mac_l
, tvb
, offset
+2, 6, ENC_BIG_ENDIAN
);
3303 proto_tree_add_item(field_tree
, hf_bcp_ncp_mac_m
, tvb
, offset
+2, 6, ENC_BIG_ENDIAN
);
3304 return tvb_captured_length(tvb
);
3309 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
3310 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
3311 | Type | Length | Protocol 1 | Protocol 2 | ..
3312 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
3316 static const value_string bcp_ncp_stp_prot_vals
[] = {
3317 { 0, "Null (no Spanning Tree protocol supported)" },
3318 { 1, "IEEE 802.1D spanning tree" },
3319 { 2, "IEEE 802.1G extended spanning tree protocol" },
3320 { 3, "IBM Source Route Spanning tree protocol" },
3321 { 4, "DEC LANbridge 100 Spanning tree protocol" },
3326 dissect_bcp_ncp_stp(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
3328 proto_tree
*field_tree
;
3331 int length
= tvb_reported_length(tvb
);
3333 tf
= proto_tree_add_item(tree
, proto_bcp_ncp_option_stp
, tvb
, offset
, length
, ENC_NA
);
3334 field_tree
= proto_item_add_subtree(tf
, ett_bcp_ncp_stp_opt
);
3336 dissect_bcp_ncp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_bcp_ncp_option_stp
));
3340 while (length
!= 0) {
3341 proto_tree_add_item(field_tree
, hf_bcp_ncp_stp_prot
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3345 return tvb_captured_length(tvb
);
3350 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
3351 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3352 | Type | Length | Enable/Disable|
3353 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3357 dissect_bcp_ncp_ieee_802_tagged_frame(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3359 proto_tree
* field_tree
;
3363 if (!dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_ieee_802_tagged_frame
,
3364 ett_bcp_ncp_ieee_802_tagged_frame_opt
, 3, &field_tree
, &tf
))
3365 return tvb_captured_length(tvb
);
3367 proto_tree_add_item(field_tree
, hf_bcp_ncp_ieee_802_tagged_frame
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
3368 return tvb_captured_length(tvb
);
3373 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
3374 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3376 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3380 dissect_bcp_ncp_management_inline(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3382 proto_tree
* field_tree
;
3385 dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_management_inline
, ett_bcp_ncp_management_inline_opt
, 3,
3387 return tvb_captured_length(tvb
);
3392 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
3393 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3395 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3399 dissect_bcp_ncp_bcp_ncp_bcp_ind(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3401 proto_tree
* field_tree
;
3404 dissect_bcp_ncp_fixed_opt(tvb
, pinfo
, tree
, proto_bcp_ncp_option_bcp_ind
, ett_bcp_ncp_bcp_ind_opt
, 3,
3406 return tvb_captured_length(tvb
);
3411 dissect_osinlcp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
3416 type
= tvb_get_uint8(tvb
, offset
);
3417 proto_tree_add_uint_format_value(tree
, hf_osinlcp_opt_type
, tvb
, offset
, 1,
3418 type
, "%s (%u)", name
, type
);
3419 proto_tree_add_item(tree
, hf_osinlcp_opt_length
, tvb
, offset
+ 1, 1,
3424 dissect_osinlcp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
3425 int proto
, int ett
, int expected_length
,
3426 proto_tree
** ret_tree
, proto_item
** ret_item
)
3428 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
3431 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
3432 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
3434 dissect_osinlcp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3439 dissect_osinlcp_align_npdu_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3441 proto_tree
*field_tree
;
3445 if (!dissect_osinlcp_fixed_opt(tvb
, pinfo
, tree
, proto_osinlcp_option_align_npdu
, ett_osinlcp_align_npdu_opt
, 3,
3447 return tvb_captured_length(tvb
);
3449 proto_tree_add_item(field_tree
, hf_osinlcp_opt_alignment
, tvb
, offset
+ 2,
3451 return tvb_captured_length(tvb
);
3455 dissect_pppmuxcp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
3460 type
= tvb_get_uint8(tvb
, offset
);
3461 proto_tree_add_uint_format_value(tree
, hf_pppmuxcp_opt_type
, tvb
, offset
, 1,
3462 type
, "%s (%u)", name
, type
);
3463 proto_tree_add_item(tree
, hf_pppmuxcp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
3467 dissect_pppmuxcp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
3468 int proto
, int ett
, int expected_length
,
3469 proto_tree
** ret_tree
, proto_item
** ret_item
)
3471 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
3474 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
3475 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
3477 dissect_pppmuxcp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3482 dissect_pppmuxcp_def_pid_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3484 proto_tree
* field_tree
;
3488 if (!dissect_pppmuxcp_fixed_opt(tvb
, pinfo
, tree
, proto_pppmuxcp_option_def_pid
, ett_pppmuxcp_def_pid_opt
, 4,
3490 return tvb_captured_length(tvb
);
3492 proto_tree_add_item_ret_uint(tree
, hf_pppmux_def_prot_id
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
, &pppmux_def_prot_id
);
3493 return tvb_captured_length(tvb
);
3498 dissect_ccp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
3503 type
= tvb_get_uint8(tvb
, offset
);
3504 proto_tree_add_uint_format_value(tree
, hf_ccp_opt_type
, tvb
, offset
, 1,
3505 type
, "%s (%u)", name
, type
);
3506 proto_tree_add_item(tree
, hf_ccp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
3510 dissect_ccp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
3511 int proto
, int ett
, int expected_length
,
3512 proto_tree
** ret_tree
, proto_item
** ret_item
)
3514 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
3517 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
3518 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
3520 dissect_ccp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3525 dissect_ccp_var_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
3526 int proto
, int ett
, int expected_length
,
3527 proto_tree
** ret_tree
, proto_item
** ret_item
)
3529 int len
= tvb_reported_length(tvb
);
3531 if (len
< expected_length
) {
3532 /* Bogus - option length isn't what it's supposed to be for this option. */
3533 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, len
,
3534 "%s (with option length = %u byte%s; should be at least %u)",
3535 proto_get_protocol_short_name(find_protocol_by_id(proto
)),
3536 len
, plurality(len
, "", "s"), expected_length
);
3540 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, -1, ENC_NA
);
3541 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
3543 dissect_ccp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
3548 /* https://tools.ietf.org/html/rfc1962 */
3549 static int dissect_ccp_oui_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3551 proto_tree
*field_tree
;
3554 int length
= tvb_reported_length(tvb
);
3556 if (!dissect_ccp_var_opt(tvb
, pinfo
, tree
, proto_ccp_option_oui
, ett_ccp_oui_opt
, 6,
3558 return tvb_captured_length(tvb
);
3560 proto_tree_add_item(field_tree
, hf_ccp_opt_oui
, tvb
, offset
+ 2, 3, ENC_BIG_ENDIAN
);
3562 proto_tree_add_item(field_tree
, hf_ccp_opt_subtype
, tvb
, offset
+ 5, 1,
3565 proto_tree_add_item(field_tree
, hf_ccp_opt_data
, tvb
, offset
+ 6,
3566 length
- 6, ENC_NA
);
3568 return tvb_captured_length(tvb
);
3571 /* The following configuration option types are mentioned at
3572 * https://www.iana.org/assignments/ppp-numbers/ppp-numbers.xhtml as referencing RFC1962; however,
3573 * RFC1962 only mentions Proprietary Compression OUI in section 4.1. These
3574 * others are therefore being treated as section 4.2 "Other Compression Types",
3575 * in terms of how they are dissected:
3576 * 1) Predictor type 1
3577 * 2) Predictor type 2
3579 * 16) Hewlett-Packard PPC
3580 * 20) V.42bis compression
3582 static int dissect_ccp_other_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int proto
, int ett
)
3584 proto_tree
*field_tree
;
3587 int length
= tvb_reported_length(tvb
);
3589 tf
= proto_tree_add_item(tree
, proto
, tvb
, 0, length
, ENC_NA
);
3590 field_tree
= proto_item_add_subtree(tf
, ett
);
3592 dissect_ccp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto
));
3595 proto_tree_add_item(field_tree
, hf_ccp_opt_data
, tvb
, offset
+ 2,
3596 length
- 2, ENC_NA
);
3599 return tvb_captured_length(tvb
);
3602 static int dissect_ccp_predict1_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3604 return dissect_ccp_other_opt(tvb
, pinfo
, tree
, proto_ccp_option_predict1
, ett_ccp_predict1_opt
);
3607 static int dissect_ccp_predict2_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3609 return dissect_ccp_other_opt(tvb
, pinfo
, tree
, proto_ccp_option_predict2
, ett_ccp_predict2_opt
);
3612 static int dissect_ccp_puddle_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3614 return dissect_ccp_other_opt(tvb
, pinfo
, tree
, proto_ccp_option_puddle
, ett_ccp_puddle_opt
);
3617 static int dissect_ccp_hpppc_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3619 return dissect_ccp_other_opt(tvb
, pinfo
, tree
, proto_ccp_option_hpppc
, ett_ccp_hpppc_opt
);
3622 /* https://tools.ietf.org/html/rfc1974 */
3624 dissect_ccp_stac_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3626 proto_tree
*field_tree
;
3629 int length
= tvb_reported_length(tvb
);
3630 static int * const check_mode_fields
[] = {
3631 &hf_ccp_opt_cm_reserved
,
3632 &hf_ccp_opt_cm_check_mode
,
3636 /* In RFC 1974, this is a fixed-length field of size 5, but in
3637 * Ascend Proprietary STAC compression this field is 6 octets. */
3639 if (!dissect_ccp_var_opt(tvb
, pinfo
, tree
,
3640 (length
== 6) ? proto_ccp_option_stac_ascend
: proto_ccp_option_stac
,
3641 ett_ccp_stac_opt
, 5, &field_tree
, &tf
))
3642 return tvb_captured_length(tvb
);
3646 /* We don't know how to decode the following 4 octets, since
3647 there are no public documents that describe their usage. */
3648 proto_tree_add_item(field_tree
, hf_ccp_opt_data
, tvb
, offset
+ 2,
3649 length
- 2, ENC_NA
);
3651 proto_tree_add_item(field_tree
, hf_ccp_opt_history_count
, tvb
,
3652 offset
+ 2, 2, ENC_BIG_ENDIAN
);
3653 proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 4, hf_ccp_opt_cm
,
3654 ett_ccp_stac_opt_check_mode
, check_mode_fields
, ENC_NA
);
3656 return tvb_captured_length(tvb
);
3660 * Microsoft Point-To-Point Compression (MPPC) and Encryption (MPPE)
3663 #define MPPC_SUPPORTED_BITS_C 0x00000001 /* MPPC negotiation */
3664 #define MPPE_SUPPORTED_BITS_D 0x00000010 /* Obsolete */
3665 #define MPPE_SUPPORTED_BITS_L 0x00000020 /* 40-bit encryption */
3666 #define MPPE_SUPPORTED_BITS_S 0x00000040 /* 128-bit encryption */
3667 #define MPPE_SUPPORTED_BITS_M 0x00000080 /* 56-bit encryption */
3668 #define MPPE_SUPPORTED_BITS_H 0x01000000 /* stateless mode */
3670 static const true_false_string ccp_mppe_h_tfs
= {
3671 "Stateless mode ON",
3672 "Stateless mode OFF"
3674 static const true_false_string ccp_mppe_m_tfs
= {
3675 "56-bit encryption ON",
3676 "56-bit encryption OFF"
3678 static const true_false_string ccp_mppe_s_tfs
= {
3679 "128-bit encryption ON",
3680 "128-bit encryption OFF"
3682 static const true_false_string ccp_mppe_l_tfs
= {
3683 "40-bit encryption ON",
3684 "40-bit encryption OFF"
3686 static const true_false_string ccp_mppe_d_tfs
= {
3687 "Obsolete (should NOT be 1)",
3688 "Obsolete (should ALWAYS be 0)"
3690 static const true_false_string ccp_mppe_c_tfs
= {
3691 "Desire to negotiate MPPC",
3692 "No desire to negotiate MPPC"
3695 /* https://tools.ietf.org/html/rfc2118,
3696 * https://tools.ietf.org/html/rfc3078 */
3698 dissect_ccp_mppe_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3700 proto_tree
*field_tree
;
3703 static int * const supported_bits_fields
[] = {
3704 &hf_ccp_opt_supported_bits_h
,
3705 &hf_ccp_opt_supported_bits_m
,
3706 &hf_ccp_opt_supported_bits_s
,
3707 &hf_ccp_opt_supported_bits_l
,
3708 &hf_ccp_opt_supported_bits_d
,
3709 &hf_ccp_opt_supported_bits_c
,
3713 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_mppe
, ett_ccp_mppe_opt
, 6,
3715 return tvb_captured_length(tvb
);
3717 proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 2,
3718 hf_ccp_opt_supported_bits
, ett_ccp_mppe_opt_supp_bits
,
3719 supported_bits_fields
, ENC_BIG_ENDIAN
);
3720 return tvb_captured_length(tvb
);
3723 /* https://tools.ietf.org/html/rfc1993 */
3724 static int dissect_ccp_gfza_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3726 proto_tree
*field_tree
;
3729 int length
= tvb_reported_length(tvb
);
3731 if (!dissect_ccp_var_opt(tvb
, pinfo
, tree
, proto_ccp_option_gfza
, ett_ccp_gfza_opt
, 3,
3733 return tvb_captured_length(tvb
);
3735 proto_tree_add_item(field_tree
, hf_ccp_opt_history
, tvb
, offset
+ 2, 1,
3739 proto_tree_add_item(field_tree
, hf_ccp_opt_version
, tvb
, offset
+ 3,
3740 length
- 3, ENC_NA
);
3742 return tvb_captured_length(tvb
);
3745 static int dissect_ccp_v42bis_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3747 return dissect_ccp_other_opt(tvb
, pinfo
, tree
, proto_ccp_option_v42bis
, ett_ccp_v42bis_opt
);
3750 /* https://tools.ietf.org/html/rfc1977 */
3752 dissect_ccp_bsdcomp_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3754 proto_tree
*field_tree
;
3757 static int * const vd_fields
[] = {
3758 &hf_ccp_opt_vd_vers
,
3759 &hf_ccp_opt_vd_dict
,
3763 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_bsdcomp
, ett_ccp_bsdcomp_opt
, 3,
3765 return tvb_captured_length(tvb
);
3767 proto_tree_add_bitmask(field_tree
, tvb
, offset
+ 2, hf_ccp_opt_vd
,
3768 ett_ccp_bsdcomp_opt
, vd_fields
, ENC_BIG_ENDIAN
);
3769 return tvb_captured_length(tvb
);
3772 /* https://tools.ietf.org/html/rfc1967 */
3774 dissect_ccp_lzsdcp_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3776 proto_tree
*field_tree
;
3780 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_lzsdcp
, ett_ccp_lzsdcp_opt
, 6,
3782 return tvb_captured_length(tvb
);
3784 proto_tree_add_item(field_tree
, hf_ccp_opt_history_count
, tvb
,
3785 offset
+ 2, 2, ENC_BIG_ENDIAN
);
3786 proto_tree_add_item(field_tree
, hf_ccp_opt_check_mode
, tvb
, offset
+ 4, 1,
3788 proto_tree_add_item(field_tree
, hf_ccp_opt_process_mode
, tvb
, offset
+ 5,
3790 return tvb_captured_length(tvb
);
3793 /* https://tools.ietf.org/html/rfc1975 */
3795 dissect_ccp_mvrca_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3797 proto_tree
*field_tree
;
3801 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_mvrca
, ett_ccp_mvrca_opt
, 4,
3803 return tvb_captured_length(tvb
);
3805 proto_tree_add_item(field_tree
, hf_ccp_opt_fe
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
3806 proto_tree_add_item(field_tree
, hf_ccp_opt_p
, tvb
, offset
+ 2, 1, ENC_NA
);
3807 proto_tree_add_item(field_tree
, hf_ccp_opt_History
, tvb
, offset
+ 2, 1,
3809 proto_tree_add_item(field_tree
, hf_ccp_opt_contexts
, tvb
, offset
+ 3, 1,
3811 return tvb_captured_length(tvb
);
3814 /* https://tools.ietf.org/html/rfc1976 */
3816 dissect_ccp_dce_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3818 proto_tree
*field_tree
;
3822 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_dce
, ett_ccp_dce_opt
, 3,
3824 return tvb_captured_length(tvb
);
3826 proto_tree_add_item(field_tree
, hf_ccp_opt_mode
, tvb
, offset
+ 2, 1,
3828 return tvb_captured_length(tvb
);
3831 static const value_string deflate_method_vals
[] = {
3832 {8, "zlib compression"},
3836 static const value_string deflate_chk_vals
[] = {
3837 {0, "sequence number check method"},
3841 /* https://tools.ietf.org/html/rfc1979 */
3843 dissect_ccp_deflate_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3845 proto_tree
*field_tree
;
3850 /* RFC1979 says the length is 3 but it's actually 4. */
3851 if (!dissect_ccp_fixed_opt(tvb
, pinfo
, tree
, proto_ccp_option_deflate
, ett_ccp_deflate_opt
, 4,
3853 return tvb_captured_length(tvb
);
3855 window
= tvb_get_uint8(tvb
, offset
+ 2);
3856 proto_tree_add_uint_format_value(field_tree
, hf_ccp_opt_window
, tvb
,
3857 offset
+ 2, 1, window
, "%u", 1 << (hi_nibble(window
) + 8));
3858 proto_tree_add_item(field_tree
, hf_ccp_opt_method
, tvb
, offset
+ 2, 1,
3860 proto_tree_add_item(field_tree
, hf_ccp_opt_mbz
, tvb
, offset
+ 3, 1,
3862 proto_tree_add_item(field_tree
, hf_ccp_opt_chk
, tvb
, offset
+ 3, 1,
3864 return tvb_captured_length(tvb
);
3867 static const range_string v44lzjh_mode_dict_rvals
[] = {
3868 {0, 0, "Datagram Mode (one dictionary and no history)"},
3869 {1, 1, "Multi-Datagram Mode (one dictionary with history)"},
3870 {2, UINT16_MAX
, "Individual Link Mode" /* "(and proposed number of
3871 dictionaries each with a
3872 corresponding history" */},
3876 /* https://tools.ietf.org/html/draft-heath-ppp-v44-01 */
3877 static int dissect_ccp_v44lzjh_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3879 proto_tree
*field_tree
;
3882 int length
= tvb_reported_length(tvb
);
3884 if (!dissect_ccp_var_opt(tvb
, pinfo
, tree
, proto_ccp_option_v44lzjh
, ett_ccp_v44lzjh_opt
, 4,
3886 return tvb_captured_length(tvb
);
3888 proto_tree_add_item(field_tree
, hf_ccp_opt_mode_dictcount
, tvb
, offset
+ 2,
3892 proto_tree_add_item(field_tree
, hf_ccp_opt_dict_size
, tvb
, offset
+ 4,
3895 proto_tree_add_item(field_tree
, hf_ccp_opt_history_length
, tvb
,
3896 offset
+ 6, 2, ENC_BIG_ENDIAN
);
3899 return tvb_captured_length(tvb
);
3903 dissect_cbcp_callback_opt_common(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, int length
)
3905 proto_tree
*addr_tree
;
3910 proto_tree_add_item(tree
, hf_cbcp_callback_delay
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
3914 while (length
> 0) {
3915 addr_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, length
,
3916 ett_cbcp_callback_opt_addr
, NULL
, "Callback Address");
3917 addr_type
= tvb_get_uint8(tvb
, offset
);
3918 ti
= proto_tree_add_uint_format_value(addr_tree
, hf_cbcp_address_type
, tvb
, offset
, 1, addr_type
,
3919 "%s (%u)", ((addr_type
== 1) ? "PSTN/ISDN" : "Other"), addr_type
);
3922 addr_len
= tvb_strsize(tvb
, offset
);
3923 if (addr_len
> (unsigned)length
) {
3924 expert_add_info(pinfo
, ti
, &ei_cbcp_address
);
3927 proto_tree_add_item(addr_tree
, hf_cbcp_address
, tvb
, offset
, addr_len
, ENC_NA
|ENC_ASCII
);
3932 return tvb_captured_length(tvb
);
3936 dissect_cbcp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
3941 type
= tvb_get_uint8(tvb
, offset
);
3942 proto_tree_add_uint_format_value(tree
, hf_cbcp_opt_type
, tvb
, offset
, 1,
3943 type
, "%s (%u)", name
, type
);
3944 proto_tree_add_item(tree
, hf_cbcp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
3948 dissect_cbcp_no_callback_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
3950 proto_tree
* field_tree
;
3953 int length
= tvb_reported_length(tvb
);
3955 tf
= proto_tree_add_item(tree
, proto_cbcp_option_no_callback
, tvb
, offset
, length
, ENC_NA
);
3956 field_tree
= proto_item_add_subtree(tf
, ett_cbcp_no_callback
);
3958 dissect_cbcp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_cbcp_option_no_callback
));
3959 proto_tree_add_item(field_tree
, hf_cbcp_no_callback
, tvb
, offset
+2, length
-2, ENC_NA
);
3961 return tvb_captured_length(tvb
);
3965 dissect_cbcp_callback_user_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3967 proto_tree
* field_tree
;
3970 int length
= tvb_reported_length(tvb
);
3973 /* Bogus - option length isn't what it's supposed to be for this option. */
3974 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, length
,
3975 "%s (with option length = %u byte%s; should be at least %u)",
3976 proto_get_protocol_short_name(find_protocol_by_id(proto_cbcp_option_callback_user
)),
3977 length
, plurality(length
, "", "s"), 4);
3978 return tvb_captured_length(tvb
);
3981 tf
= proto_tree_add_item(tree
, proto_cbcp_option_callback_user
, tvb
, offset
, length
, ENC_NA
);
3982 field_tree
= proto_item_add_subtree(tf
, ett_cbcp_callback_user
);
3984 dissect_cbcp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_cbcp_option_callback_user
));
3986 return dissect_cbcp_callback_opt_common(tvb
, pinfo
, tree
, 0, tvb_reported_length(tvb
));
3990 dissect_cbcp_callback_admin_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3992 proto_tree
* field_tree
;
3996 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto_cbcp_option_callback_admin
, tvb_reported_length(tvb
), 4))
3997 return tvb_captured_length(tvb
);
3999 tf
= proto_tree_add_item(tree
, proto_cbcp_option_callback_admin
, tvb
, offset
, -1, ENC_NA
);
4000 field_tree
= proto_item_add_subtree(tf
, ett_cbcp_callback_admin
);
4002 dissect_cbcp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_cbcp_option_callback_admin
));
4004 return dissect_cbcp_callback_opt_common(tvb
, pinfo
, tree
, 0, tvb_reported_length(tvb
));
4008 dissect_cbcp_callback_list_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4010 proto_tree
* field_tree
;
4013 int length
= tvb_reported_length(tvb
);
4016 /* Bogus - option length isn't what it's supposed to be for this option. */
4017 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, length
,
4018 "%s (with option length = %u byte%s; should be at least %u)",
4019 proto_get_protocol_short_name(find_protocol_by_id(proto_cbcp_option_callback_list
)),
4020 length
, plurality(length
, "", "s"), 4);
4021 return tvb_captured_length(tvb
);
4024 tf
= proto_tree_add_item(tree
, proto_cbcp_option_callback_list
, tvb
, offset
, length
, ENC_NA
);
4025 field_tree
= proto_item_add_subtree(tf
, ett_cbcp_callback_list
);
4027 dissect_cbcp_opt_type_len(tvb
, offset
, field_tree
, proto_registrar_get_name(proto_cbcp_option_callback_list
));
4029 return dissect_cbcp_callback_opt_common(tvb
, pinfo
, tree
, 0, tvb_reported_length(tvb
));
4033 dissect_bacp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
4038 type
= tvb_get_uint8(tvb
, offset
);
4039 proto_tree_add_uint_format_value(tree
, hf_bacp_opt_type
, tvb
, offset
, 1,
4040 type
, "%s (%u)", name
, type
);
4041 proto_tree_add_item(tree
, hf_bacp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4045 dissect_bacp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4046 int proto
, int ett
, int expected_length
,
4047 proto_tree
** ret_tree
, proto_item
** ret_item
)
4049 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
4052 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
4053 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
4055 dissect_bacp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
4060 dissect_bacp_favored_peer_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4062 proto_tree
* field_tree
;
4066 if (!dissect_bacp_fixed_opt(tvb
, pinfo
, tree
, proto_bacp_option_favored_peer
, ett_bacp_favored_peer_opt
, 6,
4068 return tvb_captured_length(tvb
);
4070 proto_tree_add_item(field_tree
, hf_bacp_magic_number
, tvb
, offset
+ 2, 4, ENC_BIG_ENDIAN
);
4071 return tvb_captured_length(tvb
);
4075 dissect_bap_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
4080 type
= tvb_get_uint8(tvb
, offset
);
4081 proto_tree_add_uint_format_value(tree
, hf_bap_opt_type
, tvb
, offset
, 1,
4082 type
, "%s (%u)", name
, type
);
4083 proto_tree_add_item(tree
, hf_bap_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4087 dissect_bap_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4088 int proto
, int ett
, int expected_length
,
4089 proto_tree
** ret_tree
, proto_item
** ret_item
)
4091 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
4094 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
4095 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
4097 dissect_bap_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
4102 dissect_bap_var_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4103 int proto
, int ett
, int expected_length
,
4104 proto_tree
** ret_tree
, proto_item
** ret_item
)
4106 int len
= tvb_reported_length(tvb
);
4108 if (len
< expected_length
) {
4109 /* Bogus - option length isn't what it's supposed to be for this option. */
4110 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, len
,
4111 "%s (with option length = %u byte%s; should be at least %u)",
4112 proto_get_protocol_short_name(find_protocol_by_id(proto
)),
4113 len
, plurality(len
, "", "s"), expected_length
);
4117 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, -1, ENC_NA
);
4118 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
4120 dissect_bap_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
4125 dissect_bap_link_type_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4127 proto_tree
* field_tree
;
4131 if (!dissect_bap_fixed_opt(tvb
, pinfo
, tree
, proto_bap_option_link_type
, ett_bap_link_type_opt
, 5,
4133 return tvb_captured_length(tvb
);
4135 proto_tree_add_item(field_tree
, hf_bacp_link_speed
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
4136 proto_tree_add_item(field_tree
, hf_bacp_link_type
, tvb
, offset
+ 4, 1, ENC_BIG_ENDIAN
);
4137 return tvb_captured_length(tvb
);
4141 dissect_bap_phone_delta_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4143 proto_tree
*field_tree
;
4144 proto_tree
*suboption_tree
;
4145 proto_item
*tf
, *ti
;
4147 int length
= tvb_reported_length(tvb
);
4148 uint8_t subopt_type
;
4151 if (!dissect_bap_var_opt(tvb
, pinfo
, tree
, proto_bap_option_phone_delta
, ett_bap_phone_delta_opt
, 4,
4153 return tvb_captured_length(tvb
);
4158 while (length
> 0) {
4159 subopt_type
= tvb_get_uint8(tvb
, offset
);
4160 subopt_len
= tvb_get_uint8(tvb
, offset
+ 1);
4161 suboption_tree
= proto_tree_add_subtree_format(field_tree
, tvb
, offset
, subopt_len
,
4162 ett_bap_phone_delta_subopt
, NULL
, "Sub-Option (%u byte%s)", subopt_len
,
4163 plurality(subopt_len
, "", "s"));
4165 proto_tree_add_item(suboption_tree
, hf_bap_sub_option_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4166 ti
= proto_tree_add_item(suboption_tree
, hf_bap_sub_option_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4168 if (subopt_len
< 2) {
4169 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4170 "Sub-Option Length invalid, must be >= 2");
4173 if (subopt_len
> length
) {
4174 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4175 "Sub-Option Length invalid, must be <= length remaining in option %u)", length
);
4179 switch (subopt_type
) {
4180 case BAP_PHONE_DELTA_SUBOPT_UNIQ_DIGIT
:
4181 if (subopt_len
== 3) {
4182 proto_tree_add_item(suboption_tree
, hf_bap_unique_digit
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
4184 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4185 "Invalid suboption length: %u (must be == 3)", subopt_len
);
4188 case BAP_PHONE_DELTA_SUBOPT_SUBSC_NUM
:
4189 if (subopt_len
> 2) {
4190 proto_tree_add_item(suboption_tree
, hf_bap_subscriber_number
, tvb
, offset
+ 2, subopt_len
- 2, ENC_NA
|ENC_ASCII
);
4192 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4193 "Invalid suboption length: %u (must be > 2)", subopt_len
);
4196 case BAP_PHONE_DELTA_SUBOPT_PHONENUM_SUBADDR
:
4197 if (subopt_len
> 2) {
4198 proto_tree_add_item(suboption_tree
, hf_bap_phone_number_sub_address
, tvb
, offset
+ 2, subopt_len
- 2, ENC_NA
|ENC_ASCII
);
4200 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4201 "Invalid suboption length: %u (must be > 2)", subopt_len
);
4205 if (subopt_len
> 2) {
4206 proto_tree_add_item(suboption_tree
, hf_bap_unknown_option_data
, tvb
, offset
+ 2, subopt_len
- 2, ENC_NA
);
4208 expert_add_info_format(pinfo
, ti
, &ei_bap_sub_option_length
,
4209 "Invalid suboption length: %u (must be > 2)", subopt_len
);
4213 offset
+= subopt_len
;
4214 length
-= subopt_len
;
4216 return tvb_captured_length(tvb
);
4220 dissect_bap_no_phone_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4222 proto_tree
* field_tree
;
4225 dissect_bap_fixed_opt(tvb
, pinfo
, tree
, proto_bap_option_no_phone
, ett_bap_no_phone_opt
, 2,
4227 return tvb_captured_length(tvb
);
4231 dissect_bap_reason_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4233 proto_tree
* field_tree
;
4236 int length
= tvb_reported_length(tvb
);
4238 if (!dissect_bap_var_opt(tvb
, pinfo
, tree
, proto_bap_option_reason
, ett_bap_reason_opt
, 2,
4240 return tvb_captured_length(tvb
);
4242 proto_tree_add_item(field_tree
, hf_bap_reason
, tvb
, offset
+2, length
-2, ENC_NA
|ENC_ASCII
);
4243 return tvb_captured_length(tvb
);
4247 dissect_bap_link_disc_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4249 proto_tree
* field_tree
;
4253 if (!dissect_bap_fixed_opt(tvb
, pinfo
, tree
, proto_bap_option_link_disc
, ett_bap_link_disc_opt
, 4,
4255 return tvb_captured_length(tvb
);
4257 proto_tree_add_item(field_tree
, hf_bap_link_discriminator
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
4258 return tvb_captured_length(tvb
);
4262 dissect_bap_call_status_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4264 proto_tree
* field_tree
;
4268 if (!dissect_bap_fixed_opt(tvb
, pinfo
, tree
, proto_bap_option_call_status
, ett_bap_call_status_opt
, 4,
4270 return tvb_captured_length(tvb
);
4272 proto_tree_add_item(field_tree
, hf_bap_call_status
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
4273 proto_tree_add_item(field_tree
, hf_bap_call_action
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
4274 return tvb_captured_length(tvb
);
4278 dissect_vsncp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
4283 type
= tvb_get_uint8(tvb
, offset
);
4284 proto_tree_add_uint_format_value(tree
, hf_vsncp_opt_type
, tvb
, offset
, 1,
4285 type
, "%s (%u)", name
, type
);
4286 proto_tree_add_item(tree
, hf_vsncp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
4290 dissect_vsncp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4291 int proto
, int ett
, int expected_length
,
4292 proto_tree
** ret_tree
, proto_item
** ret_item
)
4294 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
4297 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
4298 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
4300 dissect_vsncp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
4305 dissect_vsncp_pdnid_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4307 proto_tree
*field_tree
;
4311 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4312 proto_vsncp_option_pdnid
, ett_vsncp_pdnid_opt
, 3,
4314 return tvb_captured_length(tvb
);
4316 proto_tree_add_item(field_tree
, hf_vsncp_pdn_identifier
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
4317 return tvb_captured_length(tvb
);
4320 static const value_string vsncp_attach_vals
[] = {
4321 {1, "Initial Attach"},
4322 {3, "Handover Attach"},
4327 dissect_vsncp_attachtype_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4329 proto_tree
*field_tree
;
4333 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4334 proto_vsncp_option_attachtype
, ett_vsncp_attachtype_opt
, 3,
4336 return tvb_captured_length(tvb
);
4338 proto_tree_add_item(field_tree
, hf_vsncp_attach_type
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
4339 return tvb_captured_length(tvb
);
4342 static const value_string vsncp_pdntype_vals
[] = {
4343 {0, "Initial Request by UE"},
4351 dissect_vsncp_pdntype_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4353 proto_tree
*field_tree
;
4357 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4358 proto_vsncp_option_pdntype
, ett_vsncp_pdntype_opt
, 3,
4360 return tvb_captured_length(tvb
);
4362 proto_tree_add_item(field_tree
, hf_vsncp_pdn_type
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
4363 return tvb_captured_length(tvb
);
4366 static const value_string vsncp_errorcode_vals
[] = {
4367 {0, "General Error"},
4368 {1, "Unauthorized APN"},
4369 {2, "PDN Limit Exceeded"},
4370 {3, "NO PG-W Available"},
4371 {4, "P-GW Unreachable"},
4373 {6, "Insufficient Parameters"},
4374 {7, "Resource Unavailable"},
4375 {8, "Admin Prohibited"},
4376 {9, "PDN-ID Already in Use"},
4377 {10, "Subscription Limitation"},
4378 {11, "PDN connection already exists for APN"},
4379 {12, "Emergency services not supported"},
4380 {13, "Reconnect to this APN not allowed"},
4381 {14, "APN congested"},
4386 dissect_vsncp_errorcode_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4388 proto_tree
*field_tree
;
4391 int length
= tvb_reported_length(tvb
);
4394 /* Bogus - option length isn't what it's supposed to be for this option. */
4395 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, length
,
4396 "%s (with option length = %u byte%s; should be at least %u)",
4397 proto_get_protocol_short_name(find_protocol_by_id(proto_vsncp_option_errorcode
)),
4398 length
, plurality(length
, "", "s"), 3);
4399 return tvb_captured_length(tvb
);
4402 tf
= proto_tree_add_item(tree
, proto_vsncp_option_errorcode
, tvb
, 0, length
, ENC_NA
);
4403 field_tree
= proto_item_add_subtree(tf
, ett_vsncp_errorcode_opt
);
4405 dissect_vsncp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_vsncp_option_pdnaddress
));
4407 proto_tree_add_item(field_tree
, hf_vsncp_error_code
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
4408 return tvb_captured_length(tvb
);
4412 dissect_vsncp_pdnaddress_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4414 proto_tree
*field_tree
;
4417 int length
= tvb_reported_length(tvb
);
4418 uint32_t pdnaddtype
;
4421 /* Bogus - option length isn't what it's supposed to be for this option. */
4422 proto_tree_add_expert_format(tree
, pinfo
, &ei_ppp_opt_len_invalid
, tvb
, 0, length
,
4423 "%s (with option length = %u byte%s; should be at least %u)",
4424 proto_get_protocol_short_name(find_protocol_by_id(proto_vsncp_option_pdnaddress
)),
4425 length
, plurality(length
, "", "s"), 3);
4426 return tvb_captured_length(tvb
);
4429 tf
= proto_tree_add_item(tree
, proto_vsncp_option_pdnaddress
, tvb
, 0, length
, ENC_NA
);
4430 field_tree
= proto_item_add_subtree(tf
, ett_vsncp_pdnaddress_opt
);
4432 dissect_vsncp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_vsncp_option_pdnaddress
));
4434 proto_tree_add_item_ret_uint(field_tree
, hf_vsncp_pdn_type
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
, &pdnaddtype
);
4436 switch (pdnaddtype
) {
4438 proto_tree_add_ipv4_format(field_tree
, hf_vsncp_pdn_ipv4
, tvb
, offset
+ 3, 4,
4439 tvb_get_ntohl(tvb
, offset
+ 3), "%s: %s",
4440 val_to_str_const(pdnaddtype
, vsncp_pdntype_vals
, "Unknown"),
4441 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+ 3));
4446 ws_in6_addr
*ad
= wmem_new0(pinfo
->pool
,ws_in6_addr
);
4449 tvb_memcpy(tvb
, &ad
->bytes
[8], offset
+ 3, 8);
4450 set_address(&addr
, AT_IPv6
, 16, ad
->bytes
);
4451 proto_tree_add_ipv6_format(field_tree
, hf_vsncp_pdn_ipv6
, tvb
, offset
+ 3, length
- 3, ad
,
4452 "%s: %s", val_to_str_const(pdnaddtype
, vsncp_pdntype_vals
, "Unknown"),
4453 address_to_str(pinfo
->pool
, &addr
));
4459 ws_in6_addr
*ad
= wmem_new0(pinfo
->pool
, ws_in6_addr
);
4462 tvb_memcpy(tvb
, &ad
->bytes
[8], offset
+ 3, 8);
4463 set_address(&addr
, AT_IPv6
, 16, ad
->bytes
);
4464 proto_tree_add_ipv6_format(field_tree
, hf_vsncp_pdn_ipv6
, tvb
, offset
+ 3, length
- 3, ad
,
4465 "%s: %s", val_to_str_const(pdnaddtype
, vsncp_pdntype_vals
, "Unknown"),
4466 address_to_str(pinfo
->pool
, &addr
));
4467 proto_tree_add_ipv4_format(field_tree
, hf_vsncp_pdn_ipv4
, tvb
, offset
+ 11, length
- 11,
4468 tvb_get_ntohl(tvb
, offset
+ 11), "%s: %s", val_to_str_const(pdnaddtype
, vsncp_pdntype_vals
, "Unknown"),
4469 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+ 11));
4477 return tvb_captured_length(tvb
);
4481 dissect_vsncp_ipv4address_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4483 proto_tree
*field_tree
;
4487 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4488 proto_vsncp_option_ipv4address
, ett_vsncp_ipv4address_opt
, 6,
4490 return tvb_captured_length(tvb
);
4492 proto_tree_add_item(field_tree
, hf_vsncp_default_router_address
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
4493 return tvb_captured_length(tvb
);
4497 dissect_vsncp_apname_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
4499 proto_tree
*field_tree
;
4502 int length
= tvb_reported_length(tvb
);
4504 tf
= proto_tree_add_item(tree
, proto_vsncp_option_apname
, tvb
, 0, length
, ENC_NA
);
4505 field_tree
= proto_item_add_subtree(tf
, ett_vsncp_apname_opt
);
4507 dissect_vsncp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_vsncp_option_apname
));
4512 uint8_t lengthofapn
;
4513 int off
= offset
+ 2;
4515 while (i
< (length
- 2)) {
4516 lengthofapn
= tvb_get_uint8(tvb
, off
++);
4517 proto_tree_add_string_format(field_tree
, hf_vsncp_access_point_name
, tvb
, off
, lengthofapn
,
4518 tvb_get_string_enc(pinfo
->pool
, tvb
, off
, lengthofapn
, ENC_ASCII
),
4519 "Label%d (%d byte%s): %s", j
++, lengthofapn
,
4520 plurality(lengthofapn
, "", "s"),
4521 tvb_format_text(pinfo
->pool
, tvb
, off
, lengthofapn
));
4523 i
+= lengthofapn
+ 1;
4526 return tvb_captured_length(tvb
);
4529 static const value_string vsncp_alloc_vals
[] = {
4530 {0, "Null Value (Attach or Handover)"},
4531 {18, "New PDN type due to network preference"},
4537 dissect_vsncp_addressalloc_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4539 proto_tree
*field_tree
;
4543 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4544 proto_vsncp_option_addressalloc
, ett_vsncp_addressalloc_opt
, 3,
4546 return tvb_captured_length(tvb
);
4548 proto_tree_add_item(field_tree
, hf_vsncp_address_allocation_cause
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
4549 return tvb_captured_length(tvb
);
4553 dissect_vsncp_apn_ambr_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
4555 proto_tree
*field_tree
;
4558 int length
= tvb_reported_length(tvb
);
4560 tf
= proto_tree_add_item(tree
, proto_vsncp_option_apn_ambr
, tvb
, 0, length
, ENC_NA
);
4561 field_tree
= proto_item_add_subtree(tf
, ett_vsncp_apn_ambr_opt
);
4563 dissect_vsncp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_vsncp_option_apn_ambr
));
4564 proto_tree_add_item(field_tree
, hf_vsncp_ambr_data
, tvb
, offset
+2, length
-2, ENC_NA
);
4566 return tvb_captured_length(tvb
);
4570 dissect_vsncp_ipv6_hsgw_lla_iid_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4572 proto_tree
*field_tree
;
4576 if (!dissect_vsncp_fixed_opt(tvb
, pinfo
, tree
,
4577 proto_vsncp_option_ipv6_hsgw_lla_iid
, ett_vsncp_ipv6_hsgw_lla_iid_opt
, 10,
4579 return tvb_captured_length(tvb
);
4581 proto_tree_add_item(field_tree
, hf_vsncp_ipv6_interface_identifier
, tvb
, offset
+2, 8, ENC_NA
);
4582 return tvb_captured_length(tvb
);
4585 /* Ch 10.5.6.3 3GPP TS 24.008 version 11.5.0 Release 11 */
4586 static const value_string vsncp_pco_vals
[] = {
4587 {0x8021, "IPCP (DNS Address Request)"},
4588 {0x0001, "P-CSCF Address Request (IPv6)"},
4589 {0x0005, "MS Support of Network Requested Bearer Control indicator"},
4590 {0x0003, "DNS Server Address (IPv6)"},
4591 {0x000A, "IP address allocation via NAS signalling"},
4592 {0x000B, "IPv4 address allocation via DHCPv4"},
4593 {0x000D, "DNS Server IPv4 Address Request"},
4598 dissect_vsncp_pco_opt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
4601 proto_tree
*field_tree
;
4603 int length
= tvb_reported_length(tvb
);
4607 tf
= proto_tree_add_item(tree
, proto_vsncp_option_pco
, tvb
, 0, length
, ENC_NA
);
4608 field_tree
= proto_item_add_subtree(tf
, ett_vsncp_pco_opt
);
4610 dissect_vsncp_opt_type_len(tvb
, 0, field_tree
, proto_registrar_get_name(proto_vsncp_option_pco
));
4612 while (i
< (length
- 3)) {
4613 len
= tvb_get_uint8(tvb
, (offset
+ 2));
4614 proto_tree_add_item(field_tree
, hf_vsncp_protocol
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4615 proto_tree_add_item(field_tree
, hf_vsncp_protocol_configuration_length
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
4617 proto_tree_add_item(field_tree
, hf_vsncp_protocol_configuration_data
, tvb
, offset
+ 3, len
, ENC_NA
);
4624 return tvb_captured_length(tvb
);
4628 dissect_cp(tvbuff_t
*tvb
, int proto_id
, int proto_subtree_index
,
4629 const value_string
*proto_vals
, int options_subtree_index
,
4630 dissector_table_t option_table
, packet_info
*pinfo
, proto_tree
*tree
)
4633 proto_tree
*fh_tree
;
4638 uint32_t secs_remaining
;
4640 code
= tvb_get_uint8(tvb
, 0);
4641 length
= tvb_get_ntohs(tvb
, 2);
4643 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
,
4644 proto_get_protocol_short_name(find_protocol_by_id(proto_id
)));
4645 col_set_str(pinfo
->cinfo
, COL_INFO
,
4646 val_to_str_const(code
, proto_vals
, "Unknown"));
4648 ti
= proto_tree_add_item(tree
, proto_id
, tvb
, 0, length
, ENC_NA
);
4649 fh_tree
= proto_item_add_subtree(ti
, proto_subtree_index
);
4650 proto_tree_add_uint_format_value(fh_tree
, hf_ppp_code
, tvb
, 0, 1, code
,
4651 "%s (%u)", val_to_str_const(code
, proto_vals
, "Unknown"), code
);
4652 proto_tree_add_item(fh_tree
, hf_ppp_identifier
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
4653 proto_tree_add_item(fh_tree
, hf_ppp_length
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
4660 proto_tree_add_item(fh_tree
, hf_ppp_magic_number
, tvb
, offset
, 4,
4662 oui
= tvb_get_ntoh24(tvb
, offset
+ 4);
4663 ti
= proto_tree_add_uint_format_value(fh_tree
, hf_ppp_oui
, tvb
,
4664 offset
+ 4, 3, oui
, "%02x:%02x:%02x", (oui
>> 16) & 0xff,
4665 (oui
>> 8) & 0xff, oui
& 0xff);
4666 manuf
= uint_get_manuf_name_if_known(oui
);
4668 proto_item_append_text(ti
, "(%s)", manuf
);
4670 proto_tree_add_item(fh_tree
, hf_ppp_kind
, tvb
, offset
+ 7, 1,
4673 proto_tree_add_item(fh_tree
, hf_ppp_data
, tvb
, offset
+ 8,
4674 length
- 8, ENC_NA
);
4683 proto_tree
*field_tree
;
4685 field_tree
= proto_tree_add_subtree_format(fh_tree
, tvb
, offset
, length
,
4686 options_subtree_index
, NULL
, "Options: (%d byte%s)", length
, plurality(length
, "", "s"));
4687 ppp_dissect_options(tvb
, offset
, length
, option_table
, pinfo
, field_tree
);
4693 /* TODO: Decode the rejected packet here ... but wait until we have
4694 * a valid capture file with a CODEREJ, since the only capture file
4695 * with CODEREJ packets in it that I know of is pppoe.dump.gz from
4696 * the menagerie, and that file appears to have malformed CODEREJ
4697 * packets as they don't include the Code, Identifier or Length
4698 * fields so it's impossible to do the decode. */
4699 proto_tree_add_bytes_format(fh_tree
, hf_ppp_data
, tvb
, offset
,
4700 length
, NULL
, "Rejected Packet (%d byte%s): %s", length
,
4701 plurality(length
, "", "s"),
4702 tvb_bytes_to_str(pinfo
->pool
, tvb
, offset
, length
));
4706 case PROTREJ
: /* LCP only: RFC 1661 */
4707 proto_tree_add_item(fh_tree
, hf_lcp_rej_proto
, tvb
, offset
, 2,
4710 bool save_in_error_pkt
;
4714 protocol
= tvb_get_ntohs(tvb
, offset
);
4719 * Save the current value of the "we're inside an error packet"
4720 * flag, and set that flag; subdissectors may treat packets that
4721 * are the payload of error packets differently from "real"
4724 save_in_error_pkt
= pinfo
->flags
.in_error_pkt
;
4725 pinfo
->flags
.in_error_pkt
= true;
4727 /* Decode the rejected packet. */
4728 next_tvb
= tvb_new_subset_length(tvb
, offset
, length
);
4729 if (!dissector_try_uint(ppp_subdissector_table
, protocol
, next_tvb
,
4731 call_data_dissector(next_tvb
, pinfo
, fh_tree
);
4734 /* Restore the "we're inside an error packet" flag. */
4735 pinfo
->flags
.in_error_pkt
= save_in_error_pkt
;
4739 case ECHOREQ
: /* All 3 are LCP only: RFC 1661 */
4742 proto_tree_add_item(fh_tree
, hf_lcp_magic_number
, tvb
, offset
, 4,
4745 proto_tree_add_item(fh_tree
, hf_lcp_data
, tvb
, offset
+ 4,
4746 length
- 4, ENC_NA
);
4750 case IDENT
: /* LCP only: RFC 1570 */
4751 proto_tree_add_item(fh_tree
, hf_lcp_magic_number
, tvb
, offset
, 4,
4754 proto_tree_add_item(fh_tree
, hf_lcp_message
, tvb
, offset
+ 4,
4755 length
- 4, ENC_ASCII
);
4759 case TIMEREMAIN
: /* LCP only: RFC 1570 */
4760 proto_tree_add_item(fh_tree
, hf_lcp_magic_number
, tvb
, offset
, 4,
4762 secs_remaining
= tvb_get_ntohl(tvb
, offset
+ 4);
4763 proto_tree_add_uint_format_value(fh_tree
, hf_lcp_secs_remaining
,
4764 tvb
, offset
+ 4, 4, secs_remaining
, "%u %s", secs_remaining
,
4765 (secs_remaining
== 0xffffffff) ? "(forever)" : "seconds");
4767 proto_tree_add_item(fh_tree
, hf_lcp_message
, tvb
, offset
+ 8,
4768 length
- 8, ENC_ASCII
);
4774 case RESETREQ
: /* RESETREQ and RESETACK are CCP only: RFC 1962 */
4778 proto_tree_add_item(fh_tree
, hf_ppp_data
, tvb
, offset
, length
,
4785 /* Protocol field compression */
4786 #define PFC_BIT 0x01
4789 dissect_ppp_common(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4790 proto_tree
*fh_tree
, proto_item
*ti
, int proto_offset
)
4796 /* Make direction information filterable */
4797 if (pinfo
->p2p_dir
== P2P_DIR_RECV
|| pinfo
->p2p_dir
== P2P_DIR_SENT
) {
4798 proto_item
*direction_ti
= proto_tree_add_uint(fh_tree
, hf_ppp_direction
,
4799 tvb
, 0, 0, pinfo
->p2p_dir
);
4800 proto_item_set_generated(direction_ti
);
4803 ppp_prot
= tvb_get_uint8(tvb
, 0);
4804 if (ppp_prot
& PFC_BIT
) {
4805 /* Compressed protocol field - just the byte we fetched. */
4808 /* Uncompressed protocol field - fetch all of it. */
4809 ppp_prot
= tvb_get_ntohs(tvb
, 0);
4813 /* If "ti" is not null, it refers to the top-level "proto_ppp" item
4814 for PPP, and proto_offset is the length of any stuff in the header
4815 preceding the protocol type, e.g. an HDLC header; add the length
4816 of the protocol type field to it, and set the length of that item
4818 proto_item_set_len(ti
, proto_offset
+ proto_len
);
4820 proto_tree_add_uint(fh_tree
, hf_ppp_protocol
, tvb
, 0, proto_len
,
4823 next_tvb
= tvb_new_subset_remaining(tvb
, proto_len
);
4825 /* do lookup with the subdissector table */
4826 if (!dissector_try_uint(ppp_subdissector_table
, ppp_prot
, next_tvb
, pinfo
,
4828 col_add_fstr(pinfo
->cinfo
, COL_PROTOCOL
, "0x%04x", ppp_prot
);
4829 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "PPP %s (0x%04x)",
4830 val_to_str_ext_const(ppp_prot
, &ppp_vals_ext
, "Unknown"),
4832 call_data_dissector(next_tvb
, pinfo
, tree
);
4837 dissect_lcp_options(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4839 ppp_dissect_options(tvb
, 0, tvb_reported_length(tvb
), lcp_option_table
, pinfo
, tree
);
4840 return tvb_captured_length(tvb
);
4844 * RFC's 1661, 2153 and 1570.
4847 dissect_lcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4849 dissect_cp(tvb
, proto_lcp
, ett_lcp
, lcp_vals
, ett_lcp_options
, lcp_option_table
, pinfo
, tree
);
4850 return tvb_captured_length(tvb
);
4854 dissect_vsncp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4857 proto_tree
*fh_tree
;
4858 proto_tree
*field_tree
;
4862 code
= tvb_get_uint8(tvb
, 0);
4863 length
= tvb_get_ntohs(tvb
, 2);
4864 vsnp_oui
= tvb_get_uint24(tvb
, 4, ENC_NA
);
4866 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "VSNCP");
4867 col_set_str(pinfo
->cinfo
, COL_INFO
,
4868 val_to_str_const(code
, cp_vals
, "Unknown"));
4870 ti
= proto_tree_add_item(tree
, proto_vsncp
, tvb
, 0, length
, ENC_NA
);
4871 fh_tree
= proto_item_add_subtree(ti
, ett_vsncp
);
4872 proto_tree_add_item(fh_tree
, hf_vsncp_code
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
4873 proto_tree_add_item(fh_tree
, hf_vsncp_identifier
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
4874 proto_tree_add_item(fh_tree
, hf_vsncp_length
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
4875 proto_tree_add_item(fh_tree
, hf_ppp_oui
, tvb
, 4, 3, ENC_BIG_ENDIAN
);
4888 field_tree
= proto_tree_add_subtree_format(fh_tree
, tvb
, offset
, length
,
4889 ett_vsncp_options
, NULL
, "Options: (%d byte%s)", length
,
4890 plurality(length
, "", "s"));
4891 ppp_dissect_options(tvb
, offset
, length
, vsncp_option_table
, pinfo
, field_tree
);
4899 return tvb_captured_length(tvb
);
4903 dissect_vsnp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4905 proto_item
*vsnp_item
;
4906 proto_tree
*vsnp_tree
;
4910 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "VSNP");
4911 col_clear(pinfo
->cinfo
, COL_INFO
);
4913 vsnp_item
= proto_tree_add_item(tree
, proto_vsnp
, tvb
, 0, -1, ENC_NA
);
4914 vsnp_tree
= proto_item_add_subtree(vsnp_item
, ett_vsnp
);
4918 col_set_str(pinfo
->cinfo
, COL_INFO
, "Broadband Forum Session Data");
4919 /* TO DO: Add support for Broadband Forum's VSNP */
4922 col_set_str(pinfo
->cinfo
, COL_INFO
, "3GPP Session Data");
4925 /* dissect 3GPP packet */
4926 proto_tree_add_item(vsnp_tree
, hf_vsnp_3gpp_pdnid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4927 next_tvb
= tvb_new_subset_remaining(tvb
, 1);
4928 if (!dissector_try_uint(ppp_subdissector_table
, PPP_IP
, next_tvb
, pinfo
, tree
)) {
4929 col_add_fstr(pinfo
->cinfo
, COL_PROTOCOL
, "0x%04x", PPP_IP
);
4930 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "PPP %s (0x%04x)",
4931 val_to_str_ext_const(PPP_IP
, &ppp_vals_ext
, "Unknown"), PPP_IP
);
4932 call_data_dissector(next_tvb
, pinfo
, tree
);
4938 return tvb_captured_length(tvb
);
4945 dissect_ipcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4947 dissect_cp(tvb
, proto_ipcp
, ett_ipcp
, cp_vals
, ett_ipcp_options
, ipcp_option_table
,
4949 return tvb_captured_length(tvb
);
4955 #define BCP_FCS_PRESENT 0x80
4956 #define BCP_ZEROPAD 0x20
4957 #define BCP_IS_BCONTROL 0x10
4958 #define BCP_PADS_MASK 0x0f
4960 #define BCP_MACT_ETHERNET 1
4961 #define BCP_MACT_802_4 2
4962 #define BCP_MACT_802_5_NONCANON 3
4963 #define BCP_MACT_FDDI_NONCANON 4
4964 #define BCP_MACT_802_5_CANON 11
4965 #define BCP_MACT_FDDI_CANON 12
4967 static const value_string bcp_bpdu_mac_type_vals
[] = {
4968 {BCP_MACT_ETHERNET
, "IEEE 802.3/Ethernet"},
4969 {BCP_MACT_802_4
, "IEEE 802.4"},
4970 {BCP_MACT_802_5_NONCANON
, "IEEE 802.5, non-canonical addresses"},
4971 {BCP_MACT_FDDI_NONCANON
, "FDDI, non-canonical addresses"},
4972 {BCP_MACT_802_5_CANON
, "IEEE 802.5, canonical addresses"},
4973 {BCP_MACT_FDDI_CANON
, "FDDI, canonical addresses"},
4978 dissect_bcp_bpdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4981 proto_tree
*bcp_bpdu_tree
;
4985 int captured_length
, reported_length
, pad_length
;
4987 static int * const bcp_bpdu_flags
[] = {
4988 &hf_bcp_bpdu_fcs_present
,
4989 &hf_bcp_bpdu_zeropad
,
4990 &hf_bcp_bpdu_bcontrol
,
4995 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP BCP");
4996 col_clear(pinfo
->cinfo
, COL_INFO
);
4998 ti
= proto_tree_add_item(tree
, proto_bcp_bpdu
, tvb
, 0, -1, ENC_NA
);
4999 bcp_bpdu_tree
= proto_item_add_subtree(ti
, ett_bcp_bpdu
);
5001 flags
= tvb_get_uint8(tvb
, offset
);
5002 if (flags
& BCP_IS_BCONTROL
) {
5003 col_set_str(pinfo
->cinfo
, COL_INFO
, "Bridge control");
5006 proto_tree_add_bitmask(bcp_bpdu_tree
, tvb
, offset
, hf_bcp_bpdu_flags
, ett_bcp_bpdu_flags
, bcp_bpdu_flags
, ENC_NA
);
5009 mac_type
= tvb_get_uint8(tvb
, offset
);
5010 if (!(flags
& BCP_IS_BCONTROL
)) {
5011 col_add_str(pinfo
->cinfo
, COL_INFO
,
5012 val_to_str(mac_type
, bcp_bpdu_mac_type_vals
,
5013 "Unknown MAC type %u"));
5015 proto_tree_add_uint(bcp_bpdu_tree
, hf_bcp_bpdu_mac_type
, tvb
, offset
, 1, mac_type
);
5020 case BCP_MACT_802_4
:
5021 case BCP_MACT_802_5_NONCANON
:
5022 case BCP_MACT_FDDI_NONCANON
:
5023 case BCP_MACT_802_5_CANON
:
5024 case BCP_MACT_FDDI_CANON
:
5025 proto_tree_add_item(bcp_bpdu_tree
, hf_bcp_bpdu_pad
, tvb
, offset
, 1, ENC_NA
);
5034 proto_item_set_len(ti
, offset
);
5036 if (!(flags
& BCP_IS_BCONTROL
)) {
5037 captured_length
= tvb_captured_length_remaining(tvb
, offset
);
5038 reported_length
= tvb_reported_length_remaining(tvb
, offset
);
5039 pad_length
= flags
& BCP_PADS_MASK
;
5040 if (reported_length
>= pad_length
) {
5041 reported_length
-= pad_length
;
5042 if (captured_length
> reported_length
)
5043 captured_length
= reported_length
;
5044 next_tvb
= tvb_new_subset_length_caplen(tvb
, offset
, captured_length
,
5048 case BCP_MACT_ETHERNET
:
5049 if (flags
& BCP_FCS_PRESENT
) {
5050 call_dissector(eth_withfcs_handle
, next_tvb
, pinfo
, tree
);
5052 call_dissector(eth_withoutfcs_handle
, next_tvb
, pinfo
,
5057 case BCP_MACT_802_4
:
5058 case BCP_MACT_802_5_NONCANON
:
5059 case BCP_MACT_FDDI_NONCANON
:
5060 case BCP_MACT_802_5_CANON
:
5061 case BCP_MACT_FDDI_CANON
:
5065 call_data_dissector(next_tvb
, pinfo
, tree
);
5070 return tvb_captured_length(tvb
);
5074 * 4. A PPP Network Control Protocol for Bridging
5076 * The Bridging Control Protocol is exactly the same as the Link Control
5077 * Protocol [6] with the following exceptions...
5079 * ---the PPP Protocol field indicates type hex 8031 (BCP).
5082 dissect_bcp_ncp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5084 dissect_cp(tvb
, proto_bcp_ncp
, ett_bcp_ncp
, lcp_vals
, ett_bcp_ncp_options
,
5085 bcp_ncp_option_table
, pinfo
, tree
);
5086 return tvb_captured_length(tvb
);
5093 dissect_osinlcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5095 dissect_cp(tvb
, proto_osinlcp
, ett_osinlcp
, cp_vals
, ett_osinlcp_options
, osinlcp_option_table
,
5097 return tvb_captured_length(tvb
);
5104 dissect_ccp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5106 dissect_cp(tvb
, proto_ccp
, ett_ccp
, ccp_vals
, ett_ccp_options
, ccp_option_table
, pinfo
, tree
);
5107 return tvb_captured_length(tvb
);
5111 * Callback Control Protocol - see
5113 * https://tools.ietf.org/html/draft-gidwani-ppp-callback-cp-00
5116 dissect_cbcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5118 dissect_cp(tvb
, proto_cbcp
, ett_cbcp
, cbcp_vals
, ett_cbcp_options
,
5119 cbcp_option_table
, pinfo
, tree
);
5120 return tvb_captured_length(tvb
);
5124 * RFC 2125 (BACP and BAP).
5127 dissect_bacp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5129 dissect_cp(tvb
, proto_bacp
, ett_bacp
, cp_vals
, ett_bacp_options
, bacp_option_table
,
5131 return tvb_captured_length(tvb
);
5135 dissect_bap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5138 proto_tree
*fh_tree
;
5139 proto_tree
*field_tree
;
5143 type
= tvb_get_uint8(tvb
, 0);
5144 length
= tvb_get_ntohs(tvb
, 2);
5146 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP BAP");
5147 col_set_str(pinfo
->cinfo
, COL_INFO
,
5148 val_to_str_const(type
, bap_vals
, "Unknown"));
5150 ti
= proto_tree_add_item(tree
, proto_bap
, tvb
, 0, length
, ENC_NA
);
5151 fh_tree
= proto_item_add_subtree(ti
, ett_bap_options
);
5152 proto_tree_add_item(fh_tree
, hf_bap_type
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
5153 proto_tree_add_item(fh_tree
, hf_bap_identifier
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
5154 proto_tree_add_item(fh_tree
, hf_bap_length
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
5159 if (type
== BAP_CRES
|| type
== BAP_CBRES
||
5160 type
== BAP_LDQRES
|| type
== BAP_CSRES
) {
5161 proto_tree_add_item(fh_tree
, hf_bap_response_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5167 field_tree
= proto_tree_add_subtree_format(fh_tree
, tvb
, offset
, length
,
5168 ett_bap_options
, NULL
, "Data (%d byte%s)", length
, plurality(length
, "", "s"));
5169 ppp_dissect_options(tvb
, offset
, length
, bap_option_table
, pinfo
, field_tree
);
5171 return tvb_captured_length(tvb
);
5176 dissect_comp_data(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5179 proto_tree
*comp_data_tree
;
5181 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP Comp");
5182 col_set_str(pinfo
->cinfo
, COL_INFO
, "Compressed data");
5184 ti
= proto_tree_add_item(tree
, proto_comp_data
, tvb
, 0, -1, ENC_NA
);
5185 comp_data_tree
= proto_item_add_subtree(ti
, ett_comp_data
);
5187 return tvb_captured_length(tvb
);
5191 dissect_comp_data(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5193 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP Comp");
5194 col_set_str(pinfo
->cinfo
, COL_INFO
, "Compressed data");
5196 proto_tree_add_item(tree
, proto_comp_data
, tvb
, 0, -1, ENC_NA
);
5197 return tvb_captured_length(tvb
);
5202 * RFC 3153 (both PPPMuxCP and PPPMux).
5205 dissect_pppmuxcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5207 dissect_cp(tvb
, proto_pppmuxcp
, ett_pppmuxcp
, pppmuxcp_vals
,
5208 ett_pppmuxcp_options
, pppmuxcp_option_table
, pinfo
, tree
);
5209 return tvb_captured_length(tvb
);
5212 #define PPPMUX_FLAGS_MASK 0xc0
5213 #define PPPMUX_PFF_BIT_SET 0x80
5214 #define PPPMUX_LXT_BIT_SET 0x40
5217 dissect_pppmux(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5219 proto_tree
*mux_tree
, *hdr_tree
, *sub_tree
;
5220 proto_tree
*info_tree
;
5221 proto_item
*ti
= NULL
;
5222 uint8_t flags
, byte
;
5224 static uint16_t pid
;
5226 int offset
= 0, length_remaining
;
5227 int length_field
, pid_field
, hdr_length
;
5228 static int * const subframe_flags
[] = {
5229 &hf_pppmux_flags_pid
,
5230 &hf_pppmux_flags_field_length
,
5234 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "PPP PPPMux");
5235 col_set_str(pinfo
->cinfo
, COL_INFO
, "PPP Multiplexing");
5237 length_remaining
= tvb_reported_length(tvb
);
5239 ti
= proto_tree_add_item(tree
, proto_pppmux
, tvb
, 0, -1, ENC_NA
);
5240 mux_tree
= proto_item_add_subtree(ti
, ett_pppmux
);
5242 while (length_remaining
> 0) {
5243 flags
= tvb_get_uint8(tvb
,offset
) & PPPMUX_FLAGS_MASK
;
5245 if (flags
& PPPMUX_LXT_BIT_SET
) {
5246 length
= tvb_get_ntohs(tvb
,offset
) & 0x3fff;
5249 length
= tvb_get_uint8(tvb
,offset
) & 0x3f;
5253 if (flags
& PPPMUX_PFF_BIT_SET
) {
5254 byte
= tvb_get_uint8(tvb
,offset
+ length_field
);
5255 if (byte
& PFC_BIT
) { /* Compressed PID field */
5258 } else { /* PID field is 2 bytes */
5259 pid
= tvb_get_ntohs(tvb
,offset
+ length_field
);
5263 pid_field
= 0; /* PID field is 0 bytes */
5264 if (!pid
) { /* No Last PID, hence use the default */
5265 if (pppmux_def_prot_id
)
5266 pid
= pppmux_def_prot_id
;
5270 hdr_length
= length_field
+ pid_field
;
5272 sub_tree
= proto_tree_add_subtree(mux_tree
, tvb
, offset
, length
+ length_field
,
5273 ett_pppmux_subframe
, NULL
, "PPPMux Sub-frame");
5274 hdr_tree
= proto_tree_add_subtree(sub_tree
, tvb
, offset
, hdr_length
,
5275 ett_pppmux_subframe_hdr
, NULL
, "Header field");
5277 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_pppmux_flags
, ett_pppmux_subframe_flags
, subframe_flags
, ENC_BIG_ENDIAN
);
5278 proto_tree_add_uint(hdr_tree
, hf_pppmux_sub_frame_length
, tvb
,offset
, length_field
, length
);
5280 ti
= proto_tree_add_uint(hdr_tree
, hf_pppmux_protocol
, tvb
,
5281 offset
+ length_field
, pid_field
, pid
);
5283 /* if protocol is not present in the sub-frame */
5284 if (!(flags
& PPPMUX_PFF_BIT_SET
)) {
5285 /* mark this item as generated */
5286 proto_item_set_generated(ti
);
5289 offset
+= hdr_length
;
5290 length_remaining
-= hdr_length
;
5291 length
-= pid_field
;
5293 tvb_ensure_bytes_exist (tvb
, offset
, length
);
5294 info_tree
= proto_tree_add_subtree(sub_tree
, tvb
,offset
, length
,
5295 ett_pppmux_subframe_info
, NULL
, "Information Field");
5296 next_tvb
= tvb_new_subset_length(tvb
, offset
, length
);
5298 if (!dissector_try_uint(ppp_subdissector_table
, pid
, next_tvb
, pinfo
,
5300 call_data_dissector(next_tvb
, pinfo
, info_tree
);
5303 length_remaining
-= length
;
5305 return tvb_captured_length(tvb
);
5309 * RFC 2507 / RFC 2508 Internet Protocol Header Compression
5311 #define IPHC_CRTP_FH_FLAG_MASK 0xc0
5312 #define IPHC_CRTP_FH_CIDLEN_FLAG 0x80
5313 #define IPHC_CRTP_FH_DATA_FLAG 0x40
5315 #define IPHC_CRTP_CS_CID8 1
5316 #define IPHC_CRTP_CS_CID16 2
5318 static int * const iphc_crtp_fh_flags_fields
[] = {
5319 &hf_iphc_crtp_fh_cidlenflag
,
5320 &hf_iphc_crtp_fh_dataflag
,
5324 static const true_false_string iphc_crtp_fh_cidlenflag
= {
5329 static const value_string iphc_crtp_cs_flags
[] = {
5330 {IPHC_CRTP_CS_CID8
, "8-bit Context Id"},
5331 {IPHC_CRTP_CS_CID16
, "16-bit Context Id"},
5335 static const crumb_spec_t iphc_crtp_cntcp_cid16_crumbs
[] = {
5342 * 0x61 Packets: Full IP/UDP Header
5345 dissect_iphc_crtp_fh(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5347 proto_tree
*fh_tree
, *info_tree
;
5349 unsigned ip_hdr_len
, flags
, seq
;
5356 uint8_t next_protocol
;
5357 unsigned char *ip_packet
;
5359 length
= tvb_reported_length(tvb
);
5361 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "CRTP");
5362 col_set_str(pinfo
->cinfo
, COL_INFO
, "Full Header");
5364 /* only dissect IPv4 and UDP */
5365 ip_version
= tvb_get_uint8(tvb
, 0) >> 4;
5366 flags
= (tvb_get_uint8(tvb
, 2) & IPHC_CRTP_FH_FLAG_MASK
);
5367 next_protocol
= tvb_get_uint8(tvb
, 9);
5369 ti
= proto_tree_add_protocol_format(tree
, proto_iphc_crtp
, tvb
, 0, -1,
5370 "%s", val_to_str_ext_const(PPP_RTP_FH
, &ppp_vals_ext
, "Unknown"));
5371 fh_tree
= proto_item_add_subtree(ti
, ett_iphc_crtp
);
5373 proto_tree_add_bitmask_with_flags(fh_tree
, tvb
, 2, hf_iphc_crtp_fh_flags
,
5374 ett_iphc_crtp_fh_flags
, iphc_crtp_fh_flags_fields
, ENC_BIG_ENDIAN
,
5376 proto_tree_add_item(fh_tree
, hf_iphc_crtp_gen
, tvb
, 2, 1,
5379 /* calculate length of IP header, assume IPv4 */
5380 ip_hdr_len
= (tvb_get_uint8(tvb
, 0) & 0x0f) * 4;
5382 /* calculate total hdr length, assume UDP */
5383 hdr_len
= ip_hdr_len
+ 8;
5385 if (ip_version
!= 4) {
5386 proto_tree_add_expert_format(fh_tree
, pinfo
, &ei_iphc_crtp_ip_version
, tvb
, 3, -1,
5387 "IP version is %u: the only supported version is 4",
5392 if (next_protocol
!= IP_PROTO_UDP
) {
5393 proto_tree_add_expert_format(fh_tree
, pinfo
, &ei_iphc_crtp_next_protocol
, tvb
, 3, -1,
5394 "Next protocol is %s (%u): the only supported protocol is UDP",
5395 ipprotostr(next_protocol
), next_protocol
);
5399 /* context id and sequence fields */
5400 if (flags
& IPHC_CRTP_FH_CIDLEN_FLAG
) {
5402 offset_cid
= ip_hdr_len
+ 4;
5403 if (flags
& IPHC_CRTP_FH_DATA_FLAG
) {
5404 proto_tree_add_item(fh_tree
, hf_iphc_crtp_seq
, tvb
, offset_seq
, 1,
5407 seq
= tvb_get_uint8(tvb
, offset_seq
);
5409 ti
= proto_tree_add_item(fh_tree
, hf_iphc_crtp_seq
, tvb
, offset_seq
,
5411 expert_add_info(pinfo
, ti
, &ei_iphc_crtp_seq_nonzero
);
5414 proto_tree_add_item(fh_tree
, hf_iphc_crtp_cid16
, tvb
, offset_cid
,
5418 offset_seq
= ip_hdr_len
+ 5;
5419 proto_tree_add_item(fh_tree
, hf_iphc_crtp_cid8
, tvb
, offset_cid
, 1,
5421 if (flags
& IPHC_CRTP_FH_DATA_FLAG
) {
5422 proto_tree_add_item(fh_tree
, hf_iphc_crtp_seq
, tvb
, offset_seq
, 1,
5425 seq
= tvb_get_uint8(tvb
, offset_seq
);
5427 ti
= proto_tree_add_item(fh_tree
, hf_iphc_crtp_seq
, tvb
, offset_seq
,
5429 expert_add_info(pinfo
, ti
, &ei_iphc_crtp_seq_nonzero
);
5434 /* information field */
5435 info_tree
= proto_tree_add_subtree(fh_tree
, tvb
, 0, length
, ett_iphc_crtp_info
, NULL
, "Information Field");
5437 /* XXX: 1: May trap above; 2: really only need to check for ip_hdr_len+6 ?? */
5438 tvb_ensure_bytes_exist (tvb
, 0, hdr_len
); /* ip_hdr_len + 8 */
5440 /* allocate a copy of the IP packet */
5441 ip_packet
= (unsigned char *)tvb_memdup(pinfo
->pool
, tvb
, 0, length
);
5443 /* restore the proper values to the IP and UDP length fields */
5444 ip_packet
[2] = length
>> 8;
5445 ip_packet
[3] = length
;
5447 ip_packet
[ip_hdr_len
+ 4] = (length
- ip_hdr_len
) >> 8;
5448 ip_packet
[ip_hdr_len
+ 5] = (length
- ip_hdr_len
);
5450 next_tvb
= tvb_new_child_real_data(tvb
, ip_packet
, length
, length
);
5451 add_new_data_source(pinfo
, next_tvb
, "Decompressed Data");
5453 if (!dissector_try_uint(ppp_subdissector_table
, PPP_IP
, next_tvb
, pinfo
,
5455 call_data_dissector(next_tvb
, pinfo
, info_tree
);
5457 return tvb_captured_length(tvb
);
5461 * 0x2067 Packets: Compressed UDP with 16-bit Context Identifier
5464 dissect_iphc_crtp_cudp16(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5466 proto_tree
*cudp_tree
;
5469 unsigned hdr_length
;
5472 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "CRTP");
5473 col_set_str(pinfo
->cinfo
, COL_INFO
, "Compressed UDP 16");
5475 length
= tvb_reported_length(tvb
);
5477 ti
= proto_tree_add_protocol_format(tree
, proto_iphc_crtp
, tvb
, 0, -1,
5479 val_to_str_ext_const(PPP_RTP_CUDP16
, &ppp_vals_ext
, "Unknown"));
5480 cudp_tree
= proto_item_add_subtree(ti
, ett_iphc_crtp
);
5484 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_cid16
, tvb
, 0, 2,
5486 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_seq
, tvb
, 2, 1,
5489 offset
+= hdr_length
;
5490 length
-= hdr_length
;
5492 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_data
, tvb
, offset
, length
, ENC_NA
);
5494 return tvb_captured_length(tvb
);
5498 * 0x67 Packets: Compressed UDP with 8-bit Context Identifier
5501 dissect_iphc_crtp_cudp8(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5503 proto_tree
*cudp_tree
;
5506 unsigned hdr_length
;
5509 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "CRTP");
5510 col_set_str(pinfo
->cinfo
, COL_INFO
, "Compressed UDP 8");
5512 length
= tvb_reported_length(tvb
);
5514 ti
= proto_tree_add_protocol_format(tree
, proto_iphc_crtp
, tvb
, 0, -1,
5516 val_to_str_ext_const(PPP_RTP_CUDP8
, &ppp_vals_ext
, "Unknown"));
5517 cudp_tree
= proto_item_add_subtree(ti
, ett_iphc_crtp
);
5521 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_cid8
, tvb
, 0, 1,
5523 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_seq
, tvb
, 1, 1,
5526 offset
+= hdr_length
;
5527 length
-= hdr_length
;
5529 proto_tree_add_item(cudp_tree
, hf_iphc_crtp_data
, tvb
, offset
, length
, ENC_NA
);
5531 return tvb_captured_length(tvb
);
5536 * 0x2065 Packets: Context State
5539 dissect_iphc_crtp_cs(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5541 proto_tree
*cs_tree
;
5542 proto_item
*ti
= NULL
;
5544 unsigned length
, cid_size
;
5545 unsigned offset
= 2, hf
;
5547 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "CRTP");
5548 col_set_str(pinfo
->cinfo
, COL_INFO
, "Context State");
5550 ti
= proto_tree_add_protocol_format(tree
, proto_iphc_crtp
, tvb
, 0, -1,
5551 "%s", val_to_str_ext_const(PPP_RTP_CS
, &ppp_vals_ext
, "Unknown"));
5553 cs_tree
= proto_item_add_subtree(ti
, ett_iphc_crtp
);
5555 proto_tree_add_item(cs_tree
, hf_iphc_crtp_cs_flags
, tvb
, 0, 1,
5557 proto_tree_add_item(cs_tree
, hf_iphc_crtp_cs_cnt
, tvb
, 1, 1,
5560 /* calculate required length */
5561 flags
= tvb_get_uint8(tvb
, 0);
5562 cnt
= tvb_get_uint8(tvb
, 1);
5564 if (flags
== IPHC_CRTP_CS_CID8
) {
5565 hf
= hf_iphc_crtp_cid8
;
5569 hf
= hf_iphc_crtp_cid16
;
5574 while (offset
< length
) {
5575 proto_tree_add_item(cs_tree
, hf
, tvb
, offset
, cid_size
,
5578 proto_tree_add_item(cs_tree
, hf_iphc_crtp_cs_invalid
, tvb
, offset
,
5580 proto_tree_add_item(cs_tree
, hf_iphc_crtp_seq
, tvb
, offset
, 1,
5583 proto_tree_add_item(cs_tree
, hf_iphc_crtp_gen
, tvb
, offset
, 1,
5588 return tvb_captured_length(tvb
);
5592 * 0x65 Packets: Compressed Non TCP
5595 dissect_iphc_crtp_cntcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5597 proto_tree
*cntcp_tree
;
5599 unsigned length
, flags
;
5600 unsigned hdr_length
;
5603 col_set_str(pinfo
->cinfo
,COL_PROTOCOL
, "CRTP");
5604 col_set_str(pinfo
->cinfo
, COL_INFO
, "Compressed Non TCP");
5606 length
= tvb_reported_length(tvb
);
5608 flags
= (tvb_get_uint8(tvb
, 1) & IPHC_CRTP_FH_FLAG_MASK
);
5610 ti
= proto_tree_add_protocol_format(tree
, proto_iphc_crtp
, tvb
, 0, -1,
5612 val_to_str_ext_const(PPP_RTP_CNTCP
, &ppp_vals_ext
, "Unknown"));
5613 cntcp_tree
= proto_item_add_subtree(ti
, ett_iphc_crtp
);
5615 if (flags
& IPHC_CRTP_FH_CIDLEN_FLAG
) {
5616 /* RFC 2507 6. Compressed Header Formats
5617 * d) Compressed non-TCP header, 16 bit CID:
5628 * | RANDOM fields, if any (section 7) (implied)
5631 proto_tree_add_split_bits_item_ret_val(cntcp_tree
, hf_iphc_crtp_cid16
, tvb
, 0,
5632 iphc_crtp_cntcp_cid16_crumbs
, NULL
);
5634 /* c) Compressed non-TCP header, 8 bit CID:
5643 * | RANDOM fields, if any (section 7) (implied)
5647 proto_tree_add_item(cntcp_tree
, hf_iphc_crtp_cid8
, tvb
, 0, 1,
5650 proto_tree_add_bitmask_with_flags(cntcp_tree
, tvb
, 1, hf_iphc_crtp_fh_flags
,
5651 ett_iphc_crtp_fh_flags
, iphc_crtp_fh_flags_fields
, ENC_BIG_ENDIAN
,
5653 proto_tree_add_item(cntcp_tree
, hf_iphc_crtp_gen
, tvb
, 1, 1,
5656 if (flags
& IPHC_CRTP_FH_DATA_FLAG
) {
5657 proto_tree_add_item(cntcp_tree
, hf_iphc_crtp_seq
, tvb
, hdr_length
++,
5661 offset
+= hdr_length
;
5662 length
-= hdr_length
;
5664 /* The IPv4 Identification Field is RANDOM and thus included in a
5665 * compressed Non TCP packet (RFC 2507 6a, 7.13a). Only IPv4 is
5666 * supported in this dissector, so we don't worry about the IPv6
5667 * case, which is different (RFC 2507 7.1)."
5669 proto_tree_add_item(cntcp_tree
, hf_iphc_crtp_ip_id
, tvb
, offset
,
5674 proto_tree_add_item(cntcp_tree
, hf_iphc_crtp_data
, tvb
, offset
, length
, ENC_NA
);
5676 return tvb_captured_length(tvb
);
5683 dissect_mplscp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5685 dissect_cp(tvb
, proto_mplscp
, ett_mplscp
, cp_vals
, ett_mplscp_options
,
5687 return tvb_captured_length(tvb
);
5691 * Cisco Discovery Protocol Control Protocol.
5692 * XXX - where is this documented?
5695 dissect_cdpcp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5697 dissect_cp(tvb
, proto_cdpcp
, ett_cdpcp
, cp_vals
, ett_cdpcp_options
, NULL
,
5699 return tvb_captured_length(tvb
);
5702 /* PPP Multilink Protcol (RFC 1990) and
5703 * the Multiclass Extension to Multi-Link PPP (RFC 2686)
5705 static bool mp_short_seqno
; /* Default to long sequence numbers */
5706 static unsigned mp_max_fragments
= 6;
5707 /* Maximum fragments to try to reassemble. This affects performance and
5708 * memory use significantly. */
5709 static unsigned mp_fragment_aging
= 4000; /* Short sequence numbers only 12 bit */
5711 #define MP_FRAG_MASK 0xFF
5712 #define MP_FRAG_MASK_SHORT 0xF0
5713 #define MP_FRAG_FIRST 0x80
5714 #define MP_FRAG_LAST 0x40
5715 #define MP_FRAG_CLS 0x3C
5716 #define MP_FRAG_RESERVED 0x03
5717 #define MP_FRAG_CLS_SHORT 0x30
5719 /* According to RFC 1990, the length the MP header isn't indicated anywhere
5720 in the header itself. It starts out at four bytes and can be
5721 negotiated down to two using LCP. We currently have a preference
5722 to select short headers. - gcc & gh
5726 dissect_mp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5728 proto_tree
*mp_tree
;
5730 bool save_fragmented
;
5732 uint32_t cls
; /* 32 bit since we shift it left and XOR with seqnum */
5735 fragment_head
*frag_mp
;
5737 static int * const mp_flags
[] = {
5740 &hf_mp_sequence_num_cls
,
5741 &hf_mp_sequence_num_reserved
,
5744 static int * const mp_short_flags
[] = {
5747 &hf_mp_short_sequence_num_cls
,
5751 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP MP");
5752 col_set_str(pinfo
->cinfo
, COL_INFO
, "PPP Multilink");
5754 save_fragmented
= pinfo
->fragmented
;
5755 flags
= tvb_get_uint8(tvb
, 0);
5757 ti
= proto_tree_add_item(tree
, proto_mp
, tvb
, 0,
5758 mp_short_seqno
? 2 : 4, ENC_NA
);
5759 mp_tree
= proto_item_add_subtree(ti
, ett_mp
);
5761 if (mp_short_seqno
) {
5762 proto_tree_add_bitmask(mp_tree
, tvb
, 0, hf_mp_frag_short
, ett_mp_flags
, mp_short_flags
, ENC_NA
);
5763 proto_tree_add_item_ret_uint(mp_tree
, hf_mp_short_sequence_num
, tvb
, 0, 2, ENC_BIG_ENDIAN
, &seqnum
);
5765 proto_tree_add_bitmask(mp_tree
, tvb
, 0, hf_mp_frag
, ett_mp_flags
, mp_flags
, ENC_NA
);
5766 proto_tree_add_item_ret_uint(mp_tree
, hf_mp_sequence_num
, tvb
, 1, 3, ENC_BIG_ENDIAN
, &seqnum
);
5769 hdrlen
= mp_short_seqno
? 2 : 4;
5770 if (mp_short_seqno
) {
5771 cls
= (flags
& MP_FRAG_CLS_SHORT
) >> 4;
5773 cls
= (flags
& MP_FRAG_CLS
) >> 2;
5775 if (tvb_reported_length_remaining(tvb
, hdrlen
) > 0) {
5776 pinfo
->fragmented
= true;
5778 if (!pinfo
->fd
->visited
) {
5779 frag_mp
= fragment_add_seq_single_aging(&mp_reassembly_table
,
5780 tvb
, hdrlen
, pinfo
, seqnum
^ (cls
<< 24), NULL
,
5781 tvb_captured_length_remaining(tvb
, hdrlen
),
5782 flags
& MP_FRAG_FIRST
, flags
& MP_FRAG_LAST
,
5783 mp_max_fragments
, mp_fragment_aging
);
5785 frag_mp
= fragment_get_reassembled_id(&mp_reassembly_table
, pinfo
, seqnum
^ (cls
<< 24));
5787 next_tvb
= process_reassembled_data(tvb
, hdrlen
, pinfo
,
5788 "Reassembled PPP MP payload", frag_mp
, &mp_frag_items
,
5793 dissect_ppp(next_tvb
, pinfo
, tree
, NULL
);
5795 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
5796 " (PPP MP reassembled in packet %u)",
5797 frag_mp
->reassembled_in
);
5798 proto_tree_add_item(mp_tree
, hf_mp_payload
, tvb
, hdrlen
, -1, ENC_NA
);
5801 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
5802 " (PPP MP Unreassembled fragment %u)",
5804 proto_tree_add_item(mp_tree
, hf_mp_payload
, tvb
, hdrlen
, -1, ENC_NA
);
5808 pinfo
->fragmented
= save_fragmented
;
5809 return tvb_captured_length(tvb
);
5813 * Handles PPP without HDLC framing, just a protocol field (RFC 1661).
5816 dissect_ppp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5819 proto_tree
*fh_tree
;
5821 ti
= proto_tree_add_item(tree
, proto_ppp
, tvb
, 0, -1, ENC_NA
);
5822 fh_tree
= proto_item_add_subtree(ti
, ett_ppp
);
5824 dissect_ppp_common(tvb
, pinfo
, tree
, fh_tree
, ti
, 0);
5825 return tvb_captured_length(tvb
);
5829 dissect_ppp_hdlc_common(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
5832 proto_tree
*fh_tree
;
5837 byte0
= tvb_get_uint8(tvb
, 0);
5839 /* PPP HDLC encapsulation */
5843 /* address and control are compressed (NULL) */
5847 /* load the top pane info. This should be overwritten by
5848 the next protocol in the stack */
5849 ti
= proto_tree_add_item(tree
, proto_ppp
, tvb
, 0, -1, ENC_NA
);
5850 fh_tree
= proto_item_add_subtree(ti
, ett_ppp
);
5851 if (byte0
== 0xff) {
5852 proto_tree_add_item(fh_tree
, hf_ppp_address
, tvb
, 0, 1,
5854 proto_tree_add_item(fh_tree
, hf_ppp_control
, tvb
, 1, 1,
5858 next_tvb
= decode_fcs(tvb
, pinfo
, fh_tree
, ppp_fcs_decode
, proto_offset
);
5859 dissect_ppp_common(next_tvb
, pinfo
, tree
, fh_tree
, ti
, proto_offset
);
5863 * Handles link-layer encapsulations where the frame might be
5864 * a PPP in HDLC-like Framing frame (RFC 1662) or a Cisco HDLC frame.
5867 dissect_ppp_hdlc(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5871 byte0
= tvb_get_uint8(tvb
, 0);
5872 if (byte0
== CHDLC_ADDR_UNICAST
|| byte0
== CHDLC_ADDR_MULTICAST
) {
5873 /* Cisco HDLC encapsulation */
5874 return call_dissector(chdlc_handle
, tvb
, pinfo
, tree
);
5878 * XXX - should we have an exported dissector that always dissects
5879 * PPP-in-HDLC-like-framing, without checking for Cisco HDLC, for
5880 * use when we know the packets are PPP, not Cisco HDLC?
5882 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP");
5883 switch (pinfo
->p2p_dir
) {
5886 col_set_str(pinfo
->cinfo
, COL_RES_DL_SRC
, "DTE");
5887 col_set_str(pinfo
->cinfo
, COL_RES_DL_DST
, "DCE");
5891 col_set_str(pinfo
->cinfo
, COL_RES_DL_SRC
, "DCE");
5892 col_set_str(pinfo
->cinfo
, COL_RES_DL_DST
, "DTE");
5896 col_set_str(pinfo
->cinfo
, COL_RES_DL_SRC
, "N/A");
5897 col_set_str(pinfo
->cinfo
, COL_RES_DL_DST
, "N/A");
5901 dissect_ppp_hdlc_common(tvb
, pinfo
, tree
);
5902 return tvb_captured_length(tvb
);
5906 remove_escape_chars(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int length
)
5910 int scanned_len
= 0;
5914 buff
= (uint8_t *)wmem_alloc(pinfo
->pool
, length
);
5916 while (scanned_len
< length
) {
5917 octet
= tvb_get_uint8(tvb
, offset
);
5918 if (octet
== 0x7d) {
5921 if (scanned_len
>= length
)
5923 octet
= tvb_get_uint8(tvb
, offset
);
5924 buff
[i
] = octet
^ 0x20;
5935 next_tvb
= tvb_new_child_real_data(tvb
, buff
, i
, i
);
5941 * Handles link-layer encapsulations where we have a raw RFC 1662
5942 * HDLC-like asynchronous framing byte stream, and have to
5943 * break the byte stream into frames and remove escapes.
5946 dissect_ppp_raw_hdlc( tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5949 proto_tree
*bs_tree
;
5950 int offset
, end_offset
, data_offset
;
5951 int length
, data_length
;
5955 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP");
5957 ti
= proto_tree_add_item(tree
, proto_ppp_hdlc
, tvb
, 0, -1, ENC_NA
);
5958 bs_tree
= proto_item_add_subtree(ti
, ett_ppp_hdlc_data
);
5961 * XXX - this needs to handle a PPP frame split over multiple higher-level
5966 * Look for a frame delimiter.
5968 offset
= tvb_find_uint8(tvb
, 0, -1, 0x7e);
5971 * None found - this is presumably continued from an earlier
5972 * packet and continued in a later packet.
5974 col_set_str(pinfo
->cinfo
, COL_INFO
, "PPP Fragment");
5975 proto_tree_add_item(bs_tree
, hf_ppp_hdlc_fragment
, tvb
, offset
, -1, ENC_NA
);
5977 length
= tvb_captured_length_remaining(tvb
,offset
);
5978 ppp_tvb
= remove_escape_chars(tvb
, pinfo
, offset
,length
);
5979 if (ppp_tvb
!= NULL
) {
5980 add_new_data_source(pinfo
, ppp_tvb
, "PPP Fragment");
5981 call_data_dissector(ppp_tvb
, pinfo
, tree
);
5983 return tvb_captured_length(tvb
);
5987 * We have some data preceding the first PPP packet;
5988 * mark it as a PPP fragment.
5990 col_set_str(pinfo
->cinfo
, COL_INFO
, "PPP Fragment");
5992 proto_tree_add_item(bs_tree
, hf_ppp_hdlc_fragment
, tvb
, 0, length
, ENC_NA
);
5993 ppp_tvb
= remove_escape_chars(tvb
, pinfo
, 0, length
- 1);
5994 if (ppp_tvb
!= NULL
) {
5995 add_new_data_source(pinfo
, ppp_tvb
, "PPP Fragment");
5996 call_data_dissector(ppp_tvb
, pinfo
, tree
);
6000 /* These frames within the byte stream need to be treated like independent
6001 * frames / PDUs, not encapsulated in each other, which means that much of
6002 * the various information stored in the packet_info struct should be reset
6004 * In particular, the "most recent conservation" elements should be reset
6005 * at the start of a new frame, if that frame is dissected, and possibly
6006 * for fragments that are put on a reassembly table (if the reassembly
6007 * functions use elements from the pinfo struct for matching). (#18278)
6008 * On the other hand, we do want to keep the last set information for use
6009 * in displaying the address of the packet, conversation filtering, etc.
6011 bool save_use_conv_addr_port_endpoints
;
6012 struct conversation_addr_port_endpoints
*save_conv_addr_port_endpoints
;
6013 struct conversation_element
*save_conv_elements
;
6015 save_use_conv_addr_port_endpoints
= pinfo
->use_conv_addr_port_endpoints
;
6016 save_conv_addr_port_endpoints
= pinfo
->conv_addr_port_endpoints
;
6017 save_conv_elements
= pinfo
->conv_elements
;
6019 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
6022 * Look for the next frame delimiter.
6024 end_offset
= tvb_find_uint8(tvb
, offset
+ 1, -1, 0x7e);
6025 if (end_offset
== -1) {
6027 * We didn't find one. This is probably continued in a later
6031 col_set_str(pinfo
->cinfo
, COL_INFO
, "PPP Fragment");
6032 proto_tree_add_item(bs_tree
, hf_ppp_hdlc_fragment
, tvb
, offset
, -1, ENC_NA
);
6034 length
= tvb_captured_length_remaining(tvb
, offset
);
6035 ppp_tvb
= remove_escape_chars(tvb
, pinfo
, offset
, length
);
6036 if (ppp_tvb
!= NULL
) {
6037 add_new_data_source(pinfo
, ppp_tvb
, "PPP Fragment");
6038 call_data_dissector(ppp_tvb
, pinfo
, tree
);
6040 return tvb_captured_length(tvb
);
6043 data_offset
= offset
+ 1; /* skip starting frame delimiter */
6044 data_length
= end_offset
- data_offset
;
6047 * Is that frame delimiter immediately followed by another one?
6048 * Some PPP implementations put a frame delimiter at the
6049 * beginning and the end of each frame, although RFC 1662
6050 * appears only to require that there be one frame delimiter
6051 * between adjacent frames:
6053 * Each frame begins and ends with a Flag Sequence, which is the
6054 * binary sequence 01111110 (hexadecimal 0x7e). All implementations
6055 * continuously check for this flag, which is used for frame
6058 * Only one Flag Sequence is required between two frames. Two
6059 * consecutive Flag Sequences constitute an empty frame, which is
6060 * silently discarded, and not counted as a FCS error.
6062 * If the delimiter at the end of this frame is followed by
6063 * another delimiter, we consider the first delimiter part
6066 if (tvb_offset_exists(tvb
, end_offset
+ 1) &&
6067 tvb_get_uint8(tvb
, end_offset
+1) == 0x7e) {
6070 length
= end_offset
- offset
;
6071 proto_tree_add_item(bs_tree
, hf_ppp_hdlc_data
, tvb
, offset
, length
, ENC_NA
);
6073 ppp_tvb
= remove_escape_chars(tvb
, pinfo
, data_offset
, data_length
);
6074 if (ppp_tvb
!= NULL
) {
6075 pinfo
->use_conv_addr_port_endpoints
= save_use_conv_addr_port_endpoints
;
6076 pinfo
->conv_addr_port_endpoints
= save_conv_addr_port_endpoints
;
6077 pinfo
->conv_elements
= save_conv_elements
;
6078 add_new_data_source(pinfo
, ppp_tvb
, "PPP Message");
6079 dissect_ppp_hdlc_common(ppp_tvb
, pinfo
, tree
);
6083 offset
= end_offset
;
6085 return tvb_captured_length(tvb
);
6089 * At least for the PPP/USB captures I've seen, the data either starts with
6090 * 0x7eff03 or 0x7eff7d23 or 0xff03, so this function performs that heuristic
6091 * matching first before calling dissect_ppp_raw_hdlc(). Otherwise, if we call
6092 * it directly for USB captures, some captures like the following will not be
6093 * dissected correctly:
6094 * https://gitlab.com/wireshark/wireshark/-/wikis/SampleCaptures#head-886e340c31ca977f321c921f81cbec4c21bb7738
6097 dissect_ppp_usb( tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
6100 * In some cases, the 0x03 normally in byte 3 is escaped so we must look
6101 * for the 2 byte sequence of 0x7d23 instead of 0x03. The 0x23 is
6102 * generated by 0x20^0x03 per section 4.2 of:
6103 * https://tools.ietf.org/html/rfc1662.html.
6105 static const unsigned char buf1
[3] = {0x7e, 0xff, 0x03};
6106 static const unsigned char buf2
[4] = {0x7e, 0xff, 0x7d, 0x23};
6109 if ((tvb_memeql(tvb
, 0, buf2
, sizeof(buf2
)) == 0) ||
6110 (tvb_memeql(tvb
, 0, buf1
, sizeof(buf1
)) == 0)) {
6111 dissect_ppp_raw_hdlc(tvb
, pinfo
, tree
, data
);
6112 } else if ((tvb_memeql(tvb
, 0, &buf1
[1], sizeof(buf1
) - 1) == 0) ||
6113 (tvb_memeql(tvb
, 0, &buf2
[1], sizeof(buf2
) - 1) == 0)) {
6114 /* It's missing the 0x7e framing character. What TODO?
6115 * Should we try faking it by sticking 0x7e in front? Or try telling
6116 * dissect_ppp_raw_hdlc() NOT to look for the 0x7e frame delimiter?
6117 * Or is this a bug in libpcap (used 1.1.0)?
6118 * Or a bug in the Linux kernel (tested with 2.6.24.4) Or a bug in
6119 * usbmon? Or is the data we're looking at really just part of the
6120 * payload and not control data? Well, at least in my case it's
6121 * definitely not, but not sure if this is always the case. Is this
6122 * issue applicable only to PPP/USB or PPP/XYZ, in which case a more
6123 * general solution should be found?
6125 /* For now, just try skipping the framing I guess??? */
6126 if (tvb_get_uint8(tvb
, 1) == 0x03)
6127 next_tvb
= tvb_new_subset_remaining(tvb
, 2);
6129 next_tvb
= tvb_new_subset_remaining(tvb
, 3);
6130 dissect_ppp(next_tvb
, pinfo
, tree
, data
);
6131 } else if (tvb_get_uint8(tvb
, 0) == 0x7e) {
6132 /* Well, let's guess that since the 1st byte is 0x7e that it really is
6133 * a PPP frame, and the address and control bytes are compressed (NULL)
6134 * per https://tools.ietf.org/html/rfc1662, section 3.2, which means
6135 * that they're omitted from the packet. */
6136 next_tvb
= tvb_new_subset_remaining(tvb
, 1);
6137 dissect_ppp_hdlc_common(next_tvb
, pinfo
, tree
);
6144 proto_register_ppp_raw_hdlc(void)
6146 static hf_register_info hf
[] = {
6147 /* Generated from convert_proto_tree_add_text.pl */
6148 { &hf_ppp_hdlc_fragment
, { "PPP Fragment", "ppp_hdlc.fragment", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
6149 { &hf_ppp_hdlc_data
, { "PPP Data", "ppp_hdlc.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
6152 static int *ett
[] = {
6156 proto_ppp_hdlc
= proto_register_protocol("PPP In HDLC-Like Framing", "PPP-HDLC", "ppp_hdlc");
6157 ppp_raw_hdlc_handle
= register_dissector("ppp_raw_hdlc", dissect_ppp_raw_hdlc
, proto_ppp_hdlc
);
6158 proto_register_subtree_array(ett
, array_length(ett
));
6159 proto_register_field_array(proto_ppp_hdlc
, hf
, array_length(hf
));
6161 register_capture_dissector_table("ppp_hdlc", "PPP-HDLC");
6162 register_capture_dissector("ppp_hdlc", capture_ppp_hdlc
, proto_ppp_hdlc
);
6166 proto_reg_handoff_ppp_raw_hdlc(void)
6168 capture_dissector_handle_t ppp_hdlc_cap_handle
;
6170 dissector_add_uint("gre.proto", ETHERTYPE_CDMA2000_A10_UBS
, ppp_raw_hdlc_handle
);
6171 dissector_add_uint("gre.proto", ETHERTYPE_3GPP2
, ppp_raw_hdlc_handle
);
6174 * The heuristic checks are rather weak. Each payload starting with
6175 * 0x7e is accepted as a PPP over USB frame, this creates a lot of
6176 * false positives. We disable the heuristic subdissector by
6179 heur_dissector_add("usb.bulk", dissect_ppp_usb
,
6180 "PPP USB bulk endpoint", "ppp_usb_bulk", proto_ppp
, HEURISTIC_DISABLE
);
6182 ppp_hdlc_cap_handle
= find_capture_dissector("ppp_hdlc");
6183 capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_PPP
, ppp_hdlc_cap_handle
);
6184 capture_dissector_add_uint("sll.ltype", LINUX_SLL_P_PPPHDLC
, ppp_hdlc_cap_handle
);
6185 capture_dissector_add_uint("fr.nlpid", NLPID_PPP
, ppp_hdlc_cap_handle
);
6187 chdlc_cap_handle
= find_capture_dissector("chdlc");
6191 * Handles PAP just as a protocol field
6194 dissect_pap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
6196 proto_item
*ti
, *data_ti
;
6197 proto_tree
*fh_tree
, *data_tree
= NULL
;
6199 char *peer_id
, *password
, *message
;
6200 uint8_t peer_id_length
, password_length
, message_length
;
6203 code
= tvb_get_uint8(tvb
, 0);
6205 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP PAP");
6206 col_set_str(pinfo
->cinfo
, COL_INFO
,
6207 val_to_str_const(code
, pap_vals
, "Unknown"));
6209 ti
= proto_tree_add_item(tree
, proto_pap
, tvb
, 0, -1, ENC_NA
);
6210 fh_tree
= proto_item_add_subtree(ti
, ett_pap
);
6212 proto_tree_add_item(fh_tree
, hf_pap_code
, tvb
, offset
, 1,
6216 proto_tree_add_item(fh_tree
, hf_pap_identifier
, tvb
, offset
, 1,
6220 proto_tree_add_item(fh_tree
, hf_pap_length
, tvb
, offset
, 2,
6224 data_ti
= proto_tree_add_item(fh_tree
, hf_pap_data
, tvb
, offset
, -1,
6226 data_tree
= proto_item_add_subtree(data_ti
, ett_pap_data
);
6230 proto_tree_add_item(data_tree
, hf_pap_peer_id_length
, tvb
, offset
,
6232 peer_id_length
= tvb_get_uint8(tvb
, offset
);
6235 proto_tree_add_item(data_tree
, hf_pap_peer_id
, tvb
, offset
,
6236 peer_id_length
, ENC_ASCII
);
6237 peer_id
= tvb_format_text(pinfo
->pool
, tvb
, offset
, peer_id_length
);
6238 offset
+= peer_id_length
;
6240 proto_tree_add_item(data_tree
, hf_pap_password_length
, tvb
, offset
,
6242 password_length
= tvb_get_uint8(tvb
, offset
);
6245 proto_tree_add_item(data_tree
, hf_pap_password
, tvb
, offset
,
6246 password_length
, ENC_ASCII
);
6247 password
= tvb_format_text(pinfo
->pool
, tvb
, offset
, password_length
);
6249 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
6250 " (Peer-ID='%s', Password='%s')", peer_id
, password
);
6255 proto_tree_add_item(data_tree
, hf_pap_message_length
, tvb
, offset
,
6257 message_length
= tvb_get_uint8(tvb
, offset
);
6260 proto_tree_add_item(data_tree
, hf_pap_message
, tvb
, offset
,
6261 message_length
, ENC_ASCII
);
6262 message
= tvb_format_text(pinfo
->pool
, tvb
, offset
, message_length
);
6264 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " (Message='%s')",
6269 proto_tree_add_item(data_tree
, hf_pap_stuff
, tvb
, offset
, -1,
6273 return tvb_captured_length(tvb
);
6278 * Handles CHAP just as a protocol field
6281 dissect_chap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
6284 proto_tree
*fh_tree
;
6286 proto_tree
*field_tree
;
6287 uint8_t code
, value_size
;
6291 code
= tvb_get_uint8(tvb
, 0);
6292 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPP CHAP");
6293 col_set_str(pinfo
->cinfo
, COL_INFO
,
6294 val_to_str_const(code
, chap_vals
, "Unknown"));
6297 /* Create CHAP protocol tree */
6298 ti
= proto_tree_add_item(tree
, proto_chap
, tvb
, 0, -1, ENC_NA
);
6299 fh_tree
= proto_item_add_subtree(ti
, ett_chap
);
6301 proto_tree_add_item(fh_tree
, hf_chap_code
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
6302 proto_tree_add_item(fh_tree
, hf_chap_identifier
, tvb
, 1, 1,
6305 /* Length - make sure it's valid */
6306 length
= tvb_get_ntohs(tvb
, 2);
6308 proto_tree_add_uint_format_value(fh_tree
, hf_chap_length
, tvb
, 2, 2,
6309 length
, "%u (invalid, must be >= 4)", length
);
6312 proto_item_set_len(ti
, length
);
6313 proto_tree_add_item(fh_tree
, hf_chap_length
, tvb
, 2, 2,
6316 offset
= 4; /* Offset moved to after length field */
6317 length
-= 4; /* Length includes previous 4 bytes, subtract */
6320 /* Challenge or Response data */
6324 unsigned value_offset
= 0;
6325 unsigned name_offset
= 0, name_size
= 0;
6327 /* Create data subtree */
6328 tf
= proto_tree_add_item(fh_tree
, hf_chap_data
, tvb
, offset
,
6330 field_tree
= proto_item_add_subtree(tf
, ett_chap_data
);
6334 value_size
= tvb_get_uint8(tvb
, offset
);
6335 if (value_size
> length
) {
6336 proto_tree_add_uint_format_value(field_tree
, hf_chap_value_size
, tvb
, offset
, 1,
6337 value_size
, "%d byte%s (invalid, must be <= %u)",
6338 value_size
, plurality(value_size
, "", "s"), length
);
6341 proto_tree_add_item(field_tree
, hf_chap_value_size
, tvb
,
6342 offset
, 1, ENC_BIG_ENDIAN
);
6347 value_offset
= offset
;
6348 proto_tree_add_item(field_tree
, hf_chap_value
, tvb
, offset
,
6349 value_size
, ENC_NA
);
6351 /* Move along value_size bytes */
6352 offset
+= value_size
;
6353 length
-= value_size
;
6355 /* Find name in remaining bytes */
6357 proto_tree_add_item(field_tree
, hf_chap_name
, tvb
,
6358 offset
, length
, ENC_ASCII
);
6359 name_offset
= offset
;
6363 /* Show name and value in info column */
6364 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
6365 " (NAME='%s%s', VALUE=0x%s)",
6366 tvb_format_text(pinfo
->pool
, tvb
, name_offset
,
6367 (name_size
> 20) ? 20 : name_size
),
6368 (name_size
> 20) ? "..." : "",
6369 (value_size
> 0) ? tvb_bytes_to_str(pinfo
->pool
, tvb
, value_offset
, value_size
) : "");
6374 /* Success or Failure data */
6378 proto_tree_add_item(fh_tree
, hf_chap_message
, tvb
, offset
,
6382 /* Show message in info column */
6383 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " (MESSAGE='%s')",
6384 tvb_format_text(pinfo
->pool
, tvb
, offset
, length
));
6387 /* Code from unknown code type... */
6390 proto_tree_add_item(fh_tree
, hf_chap_stuff
, tvb
, offset
, length
, ENC_NA
);
6393 return tvb_captured_length(tvb
);
6400 dissect_ipv6cp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
6402 dissect_cp(tvb
, proto_ipv6cp
, ett_ipv6cp
, cp_vals
, ett_ipv6cp_options
, ipv6cp_option_table
, pinfo
, tree
);
6403 return tvb_captured_length(tvb
);
6407 dissect_ipv6cp_opt_type_len(tvbuff_t
*tvb
, int offset
, proto_tree
*tree
,
6412 type
= tvb_get_uint8(tvb
, offset
);
6413 proto_tree_add_uint_format_value(tree
, hf_ipv6cp_opt_type
, tvb
, offset
, 1,
6414 type
, "%s (%u)", name
, type
);
6415 proto_tree_add_item(tree
, hf_ipv6cp_opt_length
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
6419 dissect_ipv6cp_fixed_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
6420 int proto
, int ett
, int expected_length
,
6421 proto_tree
** ret_tree
, proto_item
** ret_item
)
6423 if (!ppp_option_len_check(tree
, pinfo
, tvb
, proto
, tvb_reported_length(tvb
), expected_length
))
6426 *ret_item
= proto_tree_add_item(tree
, proto
, tvb
, 0, expected_length
, ENC_NA
);
6427 *ret_tree
= proto_item_add_subtree(*ret_item
, ett
);
6429 dissect_ipv6cp_opt_type_len(tvb
, 0, *ret_tree
, proto_registrar_get_name(proto
));
6434 dissect_ipv6cp_if_id_opt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
6436 proto_tree
* field_tree
;
6440 if (!dissect_ipv6cp_fixed_opt(tvb
, pinfo
, tree
, proto_ipv6cp_option_if_id
, ett_ipv6cp_if_id_opt
, 10,
6442 return tvb_captured_length(tvb
);
6444 proto_tree_add_item(field_tree
, hf_ipv6cp_interface_identifier
, tvb
, offset
+2, 8, ENC_NA
);
6445 return tvb_captured_length(tvb
);
6449 proto_register_ppp(void)
6451 static hf_register_info hf
[] = {
6452 { &hf_ppp_direction
,
6453 { "Direction", "ppp.direction", FT_UINT8
, BASE_DEC
,
6454 VALS(ppp_direction_vals
), 0x0, "PPP direction", HFILL
}},
6456 { "Address", "ppp.address", FT_UINT8
, BASE_HEX
,
6457 NULL
, 0x0, NULL
, HFILL
}},
6459 { "Control", "ppp.control", FT_UINT8
, BASE_HEX
,
6460 NULL
, 0x0, NULL
, HFILL
}},
6462 { "Protocol", "ppp.protocol", FT_UINT16
, BASE_HEX
|BASE_EXT_STRING
,
6463 &ppp_vals_ext
, 0x0, NULL
, HFILL
}},
6465 { "Code", "ppp.code", FT_UINT8
, BASE_DEC
,
6466 NULL
, 0x0, NULL
, HFILL
}},
6467 { &hf_ppp_identifier
,
6468 { "Identifier", "ppp.identifier", FT_UINT8
, BASE_DEC_HEX
,
6469 NULL
, 0x0, NULL
, HFILL
}},
6471 { "Length", "ppp.length", FT_UINT16
, BASE_DEC
,
6472 NULL
, 0x0, NULL
, HFILL
}},
6473 { &hf_ppp_magic_number
,
6474 { "Magic Number", "ppp.magic_number", FT_UINT32
, BASE_HEX
,
6475 NULL
, 0x0, NULL
, HFILL
}},
6477 { "OUI", "ppp.oui", FT_UINT24
, BASE_OUI
,
6478 NULL
, 0x0, NULL
, HFILL
}},
6480 { "Kind", "ppp.kind", FT_UINT8
, BASE_DEC_HEX
,
6481 NULL
, 0x0, NULL
, HFILL
}},
6483 { "Data", "ppp.data", FT_BYTES
, BASE_NONE
,
6484 NULL
, 0x0, NULL
, HFILL
}},
6486 { "FCS 16", "ppp.fcs_16", FT_UINT16
, BASE_HEX
,
6487 NULL
, 0x0, NULL
, HFILL
}},
6489 { "FCS 32", "ppp.fcs_32", FT_UINT32
, BASE_HEX
,
6490 NULL
, 0x0, NULL
, HFILL
}},
6491 { &hf_ppp_fcs_status
,
6492 { "FCS Status", "ppp.fcs.status", FT_UINT8
, BASE_NONE
,
6493 VALS(proto_checksum_vals
), 0x0, NULL
, HFILL
}},
6495 static int *ett
[] = {
6498 &ett_ppp_unknown_opt
6500 static ei_register_info ei
[] = {
6501 { &ei_ppp_opt_len_invalid
, { "ppp.opt.len.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid length for option", EXPFILL
}},
6502 { &ei_ppp_fcs
, { "ppp.bad_checksum", PI_CHECKSUM
, PI_ERROR
, "Bad checksum", EXPFILL
}},
6505 module_t
*ppp_module
;
6506 expert_module_t
* expert_ppp
;
6508 proto_ppp
= proto_register_protocol("Point-to-Point Protocol", "PPP", "ppp");
6509 proto_register_field_array(proto_ppp
, hf
, array_length(hf
));
6510 proto_register_subtree_array(ett
, array_length(ett
));
6511 expert_ppp
= expert_register_protocol(proto_ppp
);
6512 expert_register_field_array(expert_ppp
, ei
, array_length(ei
));
6514 /* subdissector code */
6515 ppp_subdissector_table
= register_dissector_table("ppp.protocol",
6516 "PPP protocol", proto_ppp
, FT_UINT16
, BASE_HEX
);
6518 ppp_hdlc_handle
= register_dissector("ppp_hdlc", dissect_ppp_hdlc
, proto_ppp
);
6519 register_dissector("ppp_lcp_options", dissect_lcp_options
, proto_ppp
);
6520 ppp_handle
= register_dissector("ppp", dissect_ppp
, proto_ppp
);
6522 /* Register the preferences for the ppp protocol */
6523 ppp_module
= prefs_register_protocol(proto_ppp
, NULL
);
6525 prefs_register_enum_preference(ppp_module
, "fcs_type",
6526 "PPP Frame Checksum Type",
6527 "The type of PPP frame checksum (none, 16-bit, 32-bit)",
6528 &ppp_fcs_decode
, fcs_options
, false);
6529 prefs_register_obsolete_preference(ppp_module
, "decompress_vj");
6530 prefs_register_uint_preference(ppp_module
, "default_proto_id",
6531 "PPPMuxCP Default PID (in hex)",
6532 "Default Protocol ID to be used for PPPMuxCP",
6533 16, &pppmux_def_prot_id
);
6537 proto_reg_handoff_ppp(void)
6540 * Get a handle for the CHDLC dissector.
6542 chdlc_handle
= find_dissector_add_dependency("chdlc", proto_ppp
);
6544 dissector_add_uint("fr.nlpid", NLPID_PPP
, ppp_handle
);
6546 dissector_add_uint("wtap_encap", WTAP_ENCAP_PPP
, ppp_hdlc_handle
);
6547 dissector_add_uint("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR
,
6549 dissector_add_uint("sll.ltype", LINUX_SLL_P_PPPHDLC
, ppp_hdlc_handle
);
6550 dissector_add_uint("osinl.excl", NLPID_PPP
, ppp_handle
);
6551 dissector_add_uint("gre.proto", ETHERTYPE_PPP
, ppp_hdlc_handle
);
6552 dissector_add_uint("juniper.proto", JUNIPER_PROTO_PPP
, ppp_handle
);
6553 dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_PPP
, ppp_hdlc_handle
);
6554 dissector_add_uint("l2tp.pw_type", L2TPv3_PW_PPP
, ppp_hdlc_handle
);
6558 proto_register_mp(void)
6560 static hf_register_info hf
[] = {
6562 { "Fragment", "mp.frag", FT_UINT8
, BASE_HEX
,
6563 NULL
, MP_FRAG_MASK
, NULL
, HFILL
}},
6564 { &hf_mp_frag_short
,
6565 { "Fragment", "mp.frag", FT_UINT8
, BASE_HEX
,
6566 NULL
, MP_FRAG_MASK_SHORT
, NULL
, HFILL
}},
6567 { &hf_mp_frag_first
,
6568 { "First fragment", "mp.first", FT_BOOLEAN
, 8,
6569 TFS(&tfs_yes_no
), MP_FRAG_FIRST
, NULL
, HFILL
}},
6571 { "Last fragment", "mp.last", FT_BOOLEAN
, 8,
6572 TFS(&tfs_yes_no
), MP_FRAG_LAST
, NULL
, HFILL
}},
6573 { &hf_mp_sequence_num
,
6574 { "Sequence number", "mp.seq", FT_UINT24
, BASE_DEC
,
6575 NULL
, 0x0, NULL
, HFILL
}},
6576 { &hf_mp_sequence_num_cls
,
6577 { "Class", "mp.sequence_num_cls", FT_UINT8
, BASE_DEC
,
6578 NULL
, MP_FRAG_CLS
, NULL
, HFILL
}},
6579 { &hf_mp_sequence_num_reserved
,
6580 { "Reserved", "mp.sequence_num_reserved", FT_BOOLEAN
, 8,
6581 NULL
, MP_FRAG_RESERVED
, NULL
, HFILL
}},
6582 { &hf_mp_short_sequence_num
,
6583 { "Short Sequence number", "mp.sseq", FT_UINT16
, BASE_DEC
,
6584 NULL
, 0x0FFF, NULL
, HFILL
}},
6585 { &hf_mp_short_sequence_num_cls
,
6586 { "Class", "mp.short_sequence_num_cls", FT_UINT8
, BASE_DEC
,
6587 NULL
, MP_FRAG_CLS_SHORT
, NULL
, HFILL
}},
6589 {"Payload", "mp.payload", FT_BYTES
, BASE_NONE
,
6590 NULL
, 0x00, NULL
, HFILL
}},
6592 {"Message fragments", "mp.fragments", FT_NONE
, BASE_NONE
,
6593 NULL
, 0x00, NULL
, HFILL
}},
6595 {"Message fragment", "mp.fragment", FT_FRAMENUM
, BASE_NONE
,
6596 NULL
, 0x00, NULL
, HFILL
}},
6597 { &hf_mp_fragment_overlap
,
6598 {"Message fragment overlap", "mp.fragment.overlap",
6599 FT_BOOLEAN
, BASE_NONE
,
6600 NULL
, 0x00, NULL
, HFILL
}},
6601 { &hf_mp_fragment_overlap_conflicts
,
6602 {"Message fragment overlapping with conflicting data", "mp.fragment.overlap.conflicts",
6603 FT_BOOLEAN
, BASE_NONE
,
6604 NULL
, 0x00, NULL
, HFILL
}},
6605 { &hf_mp_fragment_multiple_tails
,
6606 {"Message has multiple tail fragments", "mp.fragment.multiple_tails",
6607 FT_BOOLEAN
, BASE_NONE
,
6608 NULL
, 0x00, NULL
, HFILL
}},
6609 { &hf_mp_fragment_too_long_fragment
,
6610 {"Message fragment too long", "mp.fragment.too_long_fragment",
6611 FT_BOOLEAN
, BASE_NONE
,
6612 NULL
, 0x00, NULL
, HFILL
}},
6613 { &hf_mp_fragment_error
,
6614 {"Message defragmentation error", "mp.fragment.error",
6615 FT_FRAMENUM
, BASE_NONE
,
6616 NULL
, 0x00, NULL
, HFILL
}},
6617 { &hf_mp_fragment_count
,
6618 {"Message fragment count", "mp.fragment.count", FT_UINT32
, BASE_DEC
,
6619 NULL
, 0x00, NULL
, HFILL
}},
6620 { &hf_mp_reassembled_in
,
6621 {"Reassembled in", "mp.reassembled.in", FT_FRAMENUM
, BASE_NONE
,
6622 NULL
, 0x00, NULL
, HFILL
}},
6623 { &hf_mp_reassembled_length
,
6624 {"Reassembled length", "mp.reassembled.length", FT_UINT32
, BASE_DEC
,
6625 NULL
, 0x00, NULL
, HFILL
}}
6627 static int *ett
[] = {
6634 module_t
*mp_module
;
6636 proto_mp
= proto_register_protocol("PPP Multilink Protocol", "PPP MP", "mp");
6637 mp_handle
= register_dissector("mp", dissect_mp
, proto_mp
);
6638 proto_register_field_array(proto_mp
, hf
, array_length(hf
));
6639 proto_register_subtree_array(ett
, array_length(ett
));
6640 reassembly_table_register(&mp_reassembly_table
,
6641 &addresses_reassembly_table_functions
);
6643 /* Register the preferences for the PPP multilink protocol */
6644 mp_module
= prefs_register_protocol(proto_mp
, NULL
);
6646 prefs_register_bool_preference(mp_module
, "short_seqno",
6647 "Short sequence numbers",
6648 "Whether PPP Multilink frames use 12-bit sequence numbers",
6650 prefs_register_uint_preference(mp_module
, "max_fragments",
6651 "Maximum fragments",
6652 "Maximum number of PPP Multilink fragments to try to reassemble into one frame",
6653 10, &mp_max_fragments
);
6654 prefs_register_uint_preference(mp_module
, "fragment_aging",
6655 "Max unreassembled fragment age",
6656 "Age off unreassembled fragments after this many packets",
6657 10, &mp_fragment_aging
);
6661 proto_reg_handoff_mp(void)
6663 dissector_add_uint("ppp.protocol", PPP_MP
, mp_handle
);
6667 proto_register_lcp(void)
6669 static hf_register_info hf
[] = {
6670 { &hf_lcp_magic_number
,
6671 { "Magic Number", "lcp.magic_number", FT_UINT32
, BASE_HEX
,
6672 NULL
, 0x0, NULL
, HFILL
}},
6674 { "Data", "lcp.data", FT_BYTES
, BASE_NONE
,
6675 NULL
, 0x0, NULL
, HFILL
}},
6677 { "Message", "lcp.message", FT_STRING
, BASE_NONE
,
6678 NULL
, 0x0, NULL
, HFILL
}},
6679 { &hf_lcp_secs_remaining
,
6680 { "Seconds Remaining", "lcp.secs_remaining", FT_UINT32
, BASE_DEC
,
6681 NULL
, 0x0, NULL
, HFILL
}},
6682 { &hf_lcp_rej_proto
,
6683 { "Rejected Protocol", "lcp.rej_proto", FT_UINT16
,
6684 BASE_HEX
| BASE_EXT_STRING
, &ppp_vals_ext
, 0x0, NULL
, HFILL
}},
6686 { "Type", "lcp.opt.type", FT_UINT8
, BASE_DEC
,
6687 NULL
, 0x0, NULL
, HFILL
}},
6688 { &hf_lcp_opt_length
,
6689 { "Length", "lcp.opt.length", FT_UINT8
, BASE_DEC
,
6690 NULL
, 0x0, NULL
, HFILL
}},
6692 { "OUI", "lcp.opt.oui", FT_UINT24
, BASE_OUI
,
6693 NULL
, 0x0, NULL
, HFILL
}},
6695 { "Kind", "lcp.opt.kind", FT_UINT8
, BASE_DEC_HEX
,
6696 NULL
, 0x0, NULL
, HFILL
}},
6698 { "Data", "lcp.opt.data", FT_BYTES
, BASE_NONE
,
6699 NULL
, 0x0, NULL
, HFILL
}},
6701 { "Maximum Receive Unit", "lcp.opt.mru", FT_UINT16
, BASE_DEC
,
6702 NULL
, 0x0, NULL
, HFILL
}},
6703 { &hf_lcp_opt_asyncmap
,
6704 { "Async Control Character Map", "lcp.opt.asyncmap", FT_UINT32
,
6705 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
6706 { &hf_lcp_opt_asyncmap_nul
,
6707 { "NUL", "lcp.opt.asyncmap.nul", FT_BOOLEAN
, 32,
6708 NULL
, 0x00000001, NULL
, HFILL
}},
6709 { &hf_lcp_opt_asyncmap_soh
,
6710 { "SOH", "lcp.opt.asyncmap.soh", FT_BOOLEAN
, 32,
6711 NULL
, 0x00000002, NULL
, HFILL
}},
6712 { &hf_lcp_opt_asyncmap_stx
,
6713 { "STX", "lcp.opt.asyncmap.stx", FT_BOOLEAN
, 32,
6714 NULL
, 0x00000004, NULL
, HFILL
}},
6715 { &hf_lcp_opt_asyncmap_etx
,
6716 { "ETX", "lcp.opt.asyncmap.etx", FT_BOOLEAN
, 32,
6717 NULL
, 0x00000008, NULL
, HFILL
}},
6718 { &hf_lcp_opt_asyncmap_eot
,
6719 { "EOT", "lcp.opt.asyncmap.eot", FT_BOOLEAN
, 32,
6720 NULL
, 0x00000010, NULL
, HFILL
}},
6721 { &hf_lcp_opt_asyncmap_enq
,
6722 { "ENQ", "lcp.opt.asyncmap.enq", FT_BOOLEAN
, 32,
6723 NULL
, 0x00000020, NULL
, HFILL
}},
6724 { &hf_lcp_opt_asyncmap_ack
,
6725 { "ACK", "lcp.opt.asyncmap.ack", FT_BOOLEAN
, 32,
6726 NULL
, 0x00000040, NULL
, HFILL
}},
6727 { &hf_lcp_opt_asyncmap_bel
,
6728 { "BEL", "lcp.opt.asyncmap.bel", FT_BOOLEAN
, 32,
6729 NULL
, 0x00000080, NULL
, HFILL
}},
6730 { &hf_lcp_opt_asyncmap_bs
,
6731 { "BS", "lcp.opt.asyncmap.bs", FT_BOOLEAN
, 32,
6732 NULL
, 0x00000100, NULL
, HFILL
}},
6733 { &hf_lcp_opt_asyncmap_ht
,
6734 { "HT", "lcp.opt.asyncmap.ht", FT_BOOLEAN
, 32,
6735 NULL
, 0x00000200, NULL
, HFILL
}},
6736 { &hf_lcp_opt_asyncmap_lf
,
6737 { "LF", "lcp.opt.asyncmap.lf", FT_BOOLEAN
, 32,
6738 NULL
, 0x00000400, NULL
, HFILL
}},
6739 { &hf_lcp_opt_asyncmap_vt
,
6740 { "VT", "lcp.opt.asyncmap.vt", FT_BOOLEAN
, 32,
6741 NULL
, 0x00000800, NULL
, HFILL
}},
6742 { &hf_lcp_opt_asyncmap_ff
,
6743 { "FF", "lcp.opt.asyncmap.ff", FT_BOOLEAN
, 32,
6744 NULL
, 0x00001000, NULL
, HFILL
}},
6745 { &hf_lcp_opt_asyncmap_cr
,
6746 { "CR", "lcp.opt.asyncmap.cr", FT_BOOLEAN
, 32,
6747 NULL
, 0x00002000, NULL
, HFILL
}},
6748 { &hf_lcp_opt_asyncmap_so
,
6749 { "SO", "lcp.opt.asyncmap.so", FT_BOOLEAN
, 32,
6750 NULL
, 0x00004000, NULL
, HFILL
}},
6751 { &hf_lcp_opt_asyncmap_si
,
6752 { "SI", "lcp.opt.asyncmap.si", FT_BOOLEAN
, 32,
6753 NULL
, 0x00008000, NULL
, HFILL
}},
6754 { &hf_lcp_opt_asyncmap_dle
,
6755 { "DLE", "lcp.opt.asyncmap.dle", FT_BOOLEAN
, 32,
6756 NULL
, 0x00010000, NULL
, HFILL
}},
6757 { &hf_lcp_opt_asyncmap_dc1
,
6758 { "DC1 (XON)", "lcp.opt.asyncmap.dc1", FT_BOOLEAN
, 32,
6759 NULL
, 0x00020000, NULL
, HFILL
}},
6760 { &hf_lcp_opt_asyncmap_dc2
,
6761 { "DC2", "lcp.opt.asyncmap.dc2", FT_BOOLEAN
, 32,
6762 NULL
, 0x00040000, NULL
, HFILL
}},
6763 { &hf_lcp_opt_asyncmap_dc3
,
6764 { "DC3 (XOFF)", "lcp.opt.asyncmap.dc3", FT_BOOLEAN
, 32,
6765 NULL
, 0x00080000, NULL
, HFILL
}},
6766 { &hf_lcp_opt_asyncmap_dc4
,
6767 { "DC4", "lcp.opt.asyncmap.dc4", FT_BOOLEAN
, 32,
6768 NULL
, 0x00100000, NULL
, HFILL
}},
6769 { &hf_lcp_opt_asyncmap_nak
,
6770 { "NAK", "lcp.opt.asyncmap.nak", FT_BOOLEAN
, 32,
6771 NULL
, 0x00200000, NULL
, HFILL
}},
6772 { &hf_lcp_opt_asyncmap_syn
,
6773 { "SYN", "lcp.opt.asyncmap.syn", FT_BOOLEAN
, 32,
6774 NULL
, 0x00400000, NULL
, HFILL
}},
6775 { &hf_lcp_opt_asyncmap_etb
,
6776 { "ETB", "lcp.opt.asyncmap.etb", FT_BOOLEAN
, 32,
6777 NULL
, 0x00800000, NULL
, HFILL
}},
6778 { &hf_lcp_opt_asyncmap_can
,
6779 { "CAN", "lcp.opt.asyncmap.can", FT_BOOLEAN
, 32,
6780 NULL
, 0x01000000, NULL
, HFILL
}},
6781 { &hf_lcp_opt_asyncmap_em
,
6782 { "EM", "lcp.opt.asyncmap.em", FT_BOOLEAN
, 32,
6783 NULL
, 0x02000000, NULL
, HFILL
}},
6784 { &hf_lcp_opt_asyncmap_sub
,
6785 { "SUB", "lcp.opt.asyncmap.sub", FT_BOOLEAN
, 32,
6786 NULL
, 0x04000000, NULL
, HFILL
}},
6787 { &hf_lcp_opt_asyncmap_esc
,
6788 { "ESC", "lcp.opt.asyncmap.esc", FT_BOOLEAN
, 32,
6789 NULL
, 0x08000000, NULL
, HFILL
}},
6790 { &hf_lcp_opt_asyncmap_fs
,
6791 { "FS", "lcp.opt.asyncmap.fs", FT_BOOLEAN
, 32,
6792 NULL
, 0x10000000, NULL
, HFILL
}},
6793 { &hf_lcp_opt_asyncmap_gs
,
6794 { "GS", "lcp.opt.asyncmap.gs", FT_BOOLEAN
, 32,
6795 NULL
, 0x20000000, NULL
, HFILL
}},
6796 { &hf_lcp_opt_asyncmap_rs
,
6797 { "RS", "lcp.opt.asyncmap.rs", FT_BOOLEAN
, 32,
6798 NULL
, 0x40000000, NULL
, HFILL
}},
6799 { &hf_lcp_opt_asyncmap_us
,
6800 { "US", "lcp.opt.asyncmap.us", FT_BOOLEAN
, 32,
6801 NULL
, 0x80000000, NULL
, HFILL
}},
6802 { &hf_lcp_opt_auth_protocol
,
6803 { "Authentication Protocol", "lcp.opt.auth_protocol", FT_UINT16
,
6804 BASE_HEX
| BASE_EXT_STRING
, &ppp_vals_ext
, 0x0, NULL
, HFILL
}},
6805 { &hf_lcp_opt_algorithm
,
6806 { "Algorithm", "lcp.opt.algorithm", FT_UINT8
,
6807 BASE_DEC
| BASE_RANGE_STRING
, &chap_alg_rvals
,
6808 0x0, NULL
, HFILL
}},
6809 { &hf_lcp_opt_quality_protocol
,
6810 { "Quality Protocol", "lcp.opt.quality_protocol", FT_UINT16
,
6811 BASE_HEX
| BASE_EXT_STRING
, &ppp_vals_ext
, 0x0, NULL
, HFILL
}},
6812 { &hf_lcp_opt_magic_number
,
6813 { "Magic Number", "lcp.opt.magic_number", FT_UINT32
, BASE_HEX
,
6814 NULL
, 0x0, NULL
, HFILL
}},
6815 { &hf_lcp_opt_reportingperiod
,
6816 { "Reporting Period", "lcp.opt.reporting_period", FT_UINT32
,
6817 BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_microsecond_microseconds
), 0x0,
6818 "Maximum time in micro-seconds that the remote end should "
6819 "wait between transmission of LCP Link-Quality-Report packets",
6821 { &hf_lcp_opt_fcs_alternatives
,
6822 { "FCS Alternatives", "lcp.opt.fcs_alternatives", FT_UINT8
,
6823 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
6824 { &hf_lcp_opt_fcs_alternatives_null
,
6825 { "NULL FCS", "lcp.opt.fcs_alternatives.null", FT_BOOLEAN
, 8,
6826 NULL
, 0x01, NULL
, HFILL
}},
6827 { &hf_lcp_opt_fcs_alternatives_ccitt16
,
6828 { "CCITT 16-bit", "lcp.opt.fcs_alternatives.ccitt16", FT_BOOLEAN
,
6829 8, NULL
, 0x02, NULL
, HFILL
}},
6830 { &hf_lcp_opt_fcs_alternatives_ccitt32
,
6831 { "CCITT 32-bit", "lcp.opt.fcs_alternatives.ccitt32", FT_BOOLEAN
,
6832 8, NULL
, 0x04, NULL
, HFILL
}},
6833 { &hf_lcp_opt_maximum
,
6834 { "Maximum", "lcp.opt.maximum", FT_UINT8
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_octet_octets
), 0x0,
6835 "The largest number of padding octets which may be added "
6836 "to the frame.", HFILL
}},
6837 { &hf_lcp_opt_window
,
6838 { "Window", "lcp.opt.window", FT_UINT8
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_frame_frames
), 0x0,
6839 "The number of frames the receiver will buffer.", HFILL
}},
6840 { &hf_lcp_opt_hdlc_address
,
6841 { "Address", "lcp.opt.hdlc_address", FT_BYTES
, BASE_NONE
, NULL
,
6842 0x0, "An HDLC Address as specified in ISO 3309.", HFILL
}},
6843 { &hf_lcp_opt_operation
,
6844 { "Operation", "lcp.opt.operation", FT_UINT8
, BASE_DEC
,
6845 VALS(callback_op_vals
), 0x0, NULL
, HFILL
}},
6846 { &hf_lcp_opt_message
,
6847 { "Message", "lcp.opt.message", FT_BYTES
, BASE_NONE
,
6848 NULL
, 0x0, NULL
, HFILL
}},
6850 { "MRRU", "lcp.opt.mrru", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6851 "Maximum Receive Reconstructed Unit", HFILL
}},
6852 { &hf_lcp_opt_ep_disc_class
,
6853 { "Class", "lcp.opt.ep_disc_class", FT_UINT8
, BASE_DEC
,
6854 VALS(multilink_ep_disc_class_vals
), 0x0, NULL
, HFILL
}},
6855 { &hf_lcp_opt_ip_address
,
6856 { "IP Address", "lcp.opt.ip_address", FT_IPv4
, BASE_NONE
,
6857 NULL
, 0x0, NULL
, HFILL
}},
6858 { &hf_lcp_opt_802_1_address
,
6859 { "IEEE 802.1 Address", "lcp.opt.802_1_address", FT_ETHER
,
6860 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
6861 { &hf_lcp_opt_magic_block
,
6862 { "PPP Magic-Number Block", "lcp.opt.magic_block", FT_BYTES
,
6863 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
6864 { &hf_lcp_opt_psndn
,
6865 { "Public Switched Network Directory Number", "lcp.opt.psndn",
6866 FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
6868 { "Mode", "lcp.opt.mode", FT_UINT8
, BASE_DEC
,
6869 VALS(dce_id_mode_vals
), 0x0, NULL
, HFILL
}},
6870 { &hf_lcp_opt_unused
,
6871 { "Unused", "lcp.opt.unused", FT_BYTES
, BASE_NONE
,
6872 NULL
, 0x0, NULL
, HFILL
}},
6873 { &hf_lcp_opt_link_discrim
,
6874 { "Link Discriminator", "lcp.opt.link_discrim", FT_UINT16
,
6875 BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
6877 { "Identification", "lcp.opt.id", FT_UINT_BYTES
, BASE_NONE
,
6878 NULL
, 0x0, NULL
, HFILL
}},
6879 { &hf_lcp_opt_cobs_flags
,
6880 { "Flags", "lcp.opt.flags", FT_UINT8
, BASE_HEX
,
6881 NULL
, 0x0, NULL
, HFILL
}},
6882 { &hf_lcp_opt_cobs_flags_res
,
6883 { "Reserved", "lcp.opt.flags.reserved", FT_UINT8
, BASE_HEX
,
6884 NULL
, 0xFC, NULL
, HFILL
}},
6885 { &hf_lcp_opt_cobs_flags_pre
,
6886 { "PRE", "lcp.opt.flags.pre", FT_BOOLEAN
, 8,
6887 NULL
, 0x02, "Preemption", HFILL
}},
6888 { &hf_lcp_opt_cobs_flags_zxe
,
6889 { "ZXE", "lcp.opt.flags.zxe", FT_BOOLEAN
, 8,
6890 NULL
, 0x01, "Zero pair/run elimination", HFILL
}},
6891 { &hf_lcp_opt_class
,
6892 { "Class", "lcp.opt.class", FT_UINT8
, BASE_DEC
,
6893 NULL
, 0x0, NULL
, HFILL
}},
6894 { &hf_lcp_opt_prefix
,
6895 { "Prefix", "lcp.opt.prefix", FT_UINT_BYTES
, BASE_NONE
,
6896 NULL
, 0x0, NULL
, HFILL
}},
6898 { "Code", "lcp.opt.code", FT_UINT8
, BASE_DEC
,
6899 VALS(ml_hdr_fmt_code_vals
), 0x0, NULL
, HFILL
}},
6900 { &hf_lcp_opt_max_susp_classes
,
6901 { "Max suspendable classes", "lcp.opt.max_susp_classes",
6902 FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
6903 { &hf_lcp_opt_MIBenum
,
6904 { "MIBenum", "lcp.opt.MIBenum", FT_UINT32
,
6905 BASE_DEC
| BASE_EXT_STRING
, &charset_vals_ext
, 0x0,
6906 "A unique integer value identifying a charset", HFILL
}},
6907 { &hf_lcp_opt_language_tag
,
6908 { "Language-Tag", "lcp.opt.language_tag", FT_STRING
, BASE_NONE
,
6909 NULL
, 0x0, NULL
, HFILL
}}
6912 static int *ett
[] = {
6915 &ett_lcp_vendor_opt
,
6917 &ett_lcp_asyncmap_opt
,
6918 &ett_lcp_authprot_opt
,
6919 &ett_lcp_qualprot_opt
,
6920 &ett_lcp_magicnumber_opt
,
6921 &ett_lcp_linkqualmon_opt
,
6923 &ett_lcp_acccomp_opt
,
6924 &ett_lcp_fcs_alternatives_opt
,
6925 &ett_lcp_self_desc_pad_opt
,
6926 &ett_lcp_numbered_mode_opt
,
6927 &ett_lcp_callback_opt
,
6928 &ett_lcp_compound_frames_opt
,
6929 &ett_lcp_nomdataencap_opt
,
6930 &ett_lcp_multilink_mrru_opt
,
6931 &ett_lcp_multilink_ssnh_opt
,
6932 &ett_lcp_multilink_ep_disc_opt
,
6933 &ett_lcp_magic_block
,
6934 &ett_lcp_dce_identifier_opt
,
6935 &ett_lcp_multilink_pp_opt
,
6936 &ett_lcp_bacp_link_discrim_opt
,
6939 &ett_lcp_prefix_elision_opt
,
6940 &ett_multilink_hdr_fmt_opt
,
6941 &ett_lcp_internationalization_opt
,
6942 &ett_lcp_sonet_sdh_opt
6945 proto_lcp
= proto_register_protocol("PPP Link Control Protocol", "PPP LCP", "lcp");
6946 lcp_handle
= register_dissector("lcp", dissect_lcp
, proto_lcp
);
6947 proto_register_field_array(proto_lcp
, hf
, array_length(hf
));
6948 proto_register_subtree_array(ett
, array_length(ett
));
6950 lcp_option_table
= register_dissector_table("lcp.option", "PPP LCP Options", proto_lcp
, FT_UINT8
, BASE_DEC
);
6952 /* Register LCP options as their own protocols so we can get the name of the option */
6953 proto_lcp_option_vendor
= proto_register_protocol_in_name_only("Vendor Specific", "Vendor Specific", "lcp.opt.vendor", proto_lcp
, FT_BYTES
);
6954 proto_lcp_option_mru
= proto_register_protocol_in_name_only("Maximum Receive Unit", "Maximum Receive Unit", "lcp.opt.mtu_bytes", proto_lcp
, FT_BYTES
);
6955 proto_lcp_option_async_map
= proto_register_protocol_in_name_only("Async Control Character Map", "Async Control Character Map", "lcp.opt.asyncmap_bytes", proto_lcp
, FT_BYTES
);
6956 proto_lcp_option_authprot
= proto_register_protocol_in_name_only("Authentication Protocol", "Authentication Protocol", "lcp.opt.auth_protocol_bytes", proto_lcp
, FT_BYTES
);
6957 proto_lcp_option_qualprot
= proto_register_protocol_in_name_only("Quality Protocol", "Quality Protocol", "lcp.opt.quality_protocol_bytes", proto_lcp
, FT_BYTES
);
6958 proto_lcp_option_magicnumber
= proto_register_protocol_in_name_only("Magic Number", "Magic Number", "lcp.opt.magic_number_bytes", proto_lcp
, FT_BYTES
);
6959 proto_lcp_option_linkqualmon
= proto_register_protocol_in_name_only("Link Quality Monitoring", "Link Quality Monitoring", "lcp.opt.linkqualmon", proto_lcp
, FT_BYTES
);
6960 proto_lcp_option_field_compress
= proto_register_protocol_in_name_only("Protocol Field Compression", "Protocol Field Compression", "lcp.opt.field_compress", proto_lcp
, FT_BYTES
);
6961 proto_lcp_option_addr_field_compress
= proto_register_protocol_in_name_only("Address and Control Field Compression", "Address and Control Field Compression", "lcp.opt.addr_field_compress", proto_lcp
, FT_BYTES
);
6962 proto_lcp_option_fcs_alternatives
= proto_register_protocol_in_name_only("FCS Alternatives", "FCS Alternatives", "lcp.opt.fcs_alternatives_bytes", proto_lcp
, FT_BYTES
);
6963 proto_lcp_option_self_desc_pad
= proto_register_protocol_in_name_only("Self Describing Pad", "Self Describing Pad", "lcp.opt.self_desc_pad", proto_lcp
, FT_BYTES
);
6964 proto_lcp_option_numbered_mode
= proto_register_protocol_in_name_only("Numbered Mode", "Numbered Mode", "lcp.opt.numbered_mode", proto_lcp
, FT_BYTES
);
6965 /* TODO? CI_MULTILINK_PROC */
6966 proto_lcp_option_callback
= proto_register_protocol_in_name_only("Callback", "Callback", "lcp.opt.callback", proto_lcp
, FT_BYTES
);
6967 /* TODO? CI_CONNECTTIME */
6968 proto_lcp_option_compound_frames
= proto_register_protocol_in_name_only("Compound Frames (Deprecated)", "Compound Frames (Deprecated)", "lcp.opt.compound_frames", proto_lcp
, FT_BYTES
);
6969 proto_lcp_option_nomdataencap
= proto_register_protocol_in_name_only("Nominal Data Encapsulation (Deprecated)", "Nominal Data Encapsulation (Deprecated)", "lcp.opt.nomdataencap", proto_lcp
, FT_BYTES
);
6970 proto_lcp_option_multilink_mrru
= proto_register_protocol_in_name_only("Multilink MRRU", "Multilink MRRU", "lcp.opt.multilink_mrru", proto_lcp
, FT_BYTES
);
6971 proto_lcp_option_multilink_ssnh
= proto_register_protocol_in_name_only("Multilink Short Sequence Number Header", "Multilink Short Sequence Number Header", "lcp.opt.multilink_ssnh", proto_lcp
, FT_BYTES
);
6972 proto_lcp_option_multilink_ep_disc
= proto_register_protocol_in_name_only("Multilink Endpoint Discriminator", "Multilink Endpoint Discriminator", "lcp.opt.multilink_ep_disc", proto_lcp
, FT_BYTES
);
6973 /* TODO? CI_PROP_KEN: ken@funk.com: www.funk.com => www.juniper.net */
6974 proto_lcp_option_dce_identifier
= proto_register_protocol_in_name_only("DCE Identifier", "DCE Identifier", "lcp.opt.dce_identifier", proto_lcp
, FT_BYTES
);
6975 proto_lcp_option_multilink_pp
= proto_register_protocol_in_name_only("Multi Link Plus Procedure", "Multi Link Plus Procedure", "lcp.opt.multilink_pp", proto_lcp
, FT_BYTES
);
6976 proto_lcp_option_link_discrim
= proto_register_protocol_in_name_only("Link Discriminator for BACP", "Link Discriminator for BACP", "lcp.opt.link_discrim_bytes", proto_lcp
, FT_BYTES
);
6977 proto_lcp_option_auth
= proto_register_protocol_in_name_only("Authentication Option", "Authentication Option", "lcp.opt.auth", proto_lcp
, FT_BYTES
);
6978 proto_lcp_option_cobs
= proto_register_protocol_in_name_only("Consistent Overhead Byte Stuffing (COBS)", "Consistent Overhead Byte Stuffing (COBS)", "lcp.opt.cobs", proto_lcp
, FT_BYTES
);
6979 proto_lcp_option_prefix_elision
= proto_register_protocol_in_name_only("Prefix Elision", "Prefix Elision", "lcp.opt.prefix_elision", proto_lcp
, FT_BYTES
);
6980 proto_lcp_option_multilink_hdr_fmt
= proto_register_protocol_in_name_only("Multilink header format", "Multilink header format", "lcp.opt.multilink_hdr_fmt", proto_lcp
, FT_BYTES
);
6981 proto_lcp_option_internationalization
= proto_register_protocol_in_name_only("Internationalization", "Internationalization", "lcp.opt.internationalization", proto_lcp
, FT_BYTES
);
6982 proto_lcp_option_sonet_sdh
= proto_register_protocol_in_name_only("Simple Data Link on SONET/SDH", "Simple Data Link on SONET/SDH", "lcp.opt.sonet_sdh", proto_lcp
, FT_BYTES
);
6986 proto_reg_handoff_lcp(void)
6988 dissector_add_uint("ppp.protocol", PPP_LCP
, lcp_handle
);
6991 * NDISWAN on Windows translates Ethernet frames from higher-level
6992 * protocols into PPP frames to hand to the PPP driver, and translates
6993 * PPP frames from the PPP driver to hand to the higher-level protocols.
6995 * Apparently the PPP driver, on at least some versions of Windows,
6996 * passes frames for internal-to-PPP protocols up through NDISWAN;
6997 * the protocol type field appears to be passed through unchanged
6998 * (unlike what's done with, for example, the protocol type field
6999 * for IP, which is mapped from its PPP value to its Ethernet value).
7001 * This means that we may see, on Ethernet captures, frames for
7002 * protocols internal to PPP, so we register PPP_LCP with the
7003 * "ethertype" dissector table as well as the PPP protocol dissector
7006 dissector_add_uint("ethertype", PPP_LCP
, lcp_handle
);
7009 * for GSM-A / MobileL3 / GPRS SM / PCO
7011 dissector_add_uint("sm_pco.protocol", PPP_LCP
, lcp_handle
);
7013 /* Create dissection function handles for all LCP options */
7014 dissector_add_uint("lcp.option", CI_VENDORSPECIFIC
, create_dissector_handle( dissect_lcp_vendor_opt
, proto_lcp_option_vendor
));
7015 dissector_add_uint("lcp.option", CI_MRU
, create_dissector_handle( dissect_lcp_mru_opt
, proto_lcp_option_mru
));
7016 dissector_add_uint("lcp.option", CI_ASYNCMAP
, create_dissector_handle( dissect_lcp_async_map_opt
, proto_lcp_option_async_map
));
7017 dissector_add_uint("lcp.option", CI_AUTHPROT
, create_dissector_handle( dissect_lcp_authprot_opt
, proto_lcp_option_authprot
));
7018 dissector_add_uint("lcp.option", CI_QUALITY
, create_dissector_handle( dissect_lcp_qualprot_opt
, proto_lcp_option_qualprot
));
7019 dissector_add_uint("lcp.option", CI_MAGICNUMBER
, create_dissector_handle( dissect_lcp_magicnumber_opt
, proto_lcp_option_magicnumber
));
7020 dissector_add_uint("lcp.option", CI_LINKQUALMON
, create_dissector_handle( dissect_lcp_linkqualmon_opt
, proto_lcp_option_linkqualmon
));
7021 dissector_add_uint("lcp.option", CI_PCOMPRESSION
, create_dissector_handle( dissect_lcp_field_compress
, proto_lcp_option_field_compress
));
7022 dissector_add_uint("lcp.option", CI_ACCOMPRESSION
, create_dissector_handle( dissect_lcp_addr_field_compress
, proto_lcp_option_addr_field_compress
));
7023 dissector_add_uint("lcp.option", CI_FCS_ALTERNATIVES
, create_dissector_handle( dissect_lcp_fcs_alternatives_opt
, proto_lcp_option_fcs_alternatives
));
7024 dissector_add_uint("lcp.option", CI_SELF_DESCRIBING_PAD
, create_dissector_handle( dissect_lcp_self_describing_pad_opt
, proto_lcp_option_self_desc_pad
));
7025 dissector_add_uint("lcp.option", CI_NUMBERED_MODE
, create_dissector_handle( dissect_lcp_numbered_mode_opt
, proto_lcp_option_numbered_mode
));
7026 /* TODO? CI_MULTILINK_PROC */
7027 dissector_add_uint("lcp.option", CI_CALLBACK
, create_dissector_handle( dissect_lcp_callback_opt
, proto_lcp_option_callback
));
7028 /* TODO? CI_CONNECTTIME */
7029 dissector_add_uint("lcp.option", CI_COMPOUND_FRAMES
, create_dissector_handle( dissect_lcp_compound_frames_opt
, proto_lcp_option_compound_frames
));
7030 dissector_add_uint("lcp.option", CI_NOMDATAENCAP
, create_dissector_handle( dissect_lcp_nomdataencap_opt
, proto_lcp_option_nomdataencap
));
7031 dissector_add_uint("lcp.option", CI_MULTILINK_MRRU
, create_dissector_handle( dissect_lcp_multilink_mrru_opt
, proto_lcp_option_multilink_mrru
));
7032 dissector_add_uint("lcp.option", CI_MULTILINK_SSNH
, create_dissector_handle( dissect_lcp_multilink_ssnh_opt
, proto_lcp_option_multilink_ssnh
));
7033 dissector_add_uint("lcp.option", CI_MULTILINK_EP_DISC
, create_dissector_handle( dissect_lcp_multilink_ep_disc_opt
, proto_lcp_option_multilink_ep_disc
));
7034 /* TODO? CI_PROP_KEN: ken@funk.com: www.funk.com => www.juniper.net */
7035 dissector_add_uint("lcp.option", CI_DCE_IDENTIFIER
, create_dissector_handle( dissect_lcp_dce_identifier_opt
, proto_lcp_option_dce_identifier
));
7036 dissector_add_uint("lcp.option", CI_MULTILINK_PLUS_PROC
, create_dissector_handle( dissect_lcp_multilink_pp_opt
, proto_lcp_option_multilink_pp
));
7037 dissector_add_uint("lcp.option", CI_LINK_DISC_FOR_BACP
, create_dissector_handle( dissect_lcp_bacp_link_discriminator_opt
, proto_lcp_option_link_discrim
));
7038 dissector_add_uint("lcp.option", CI_LCP_AUTHENTICATION
, create_dissector_handle( dissect_lcp_auth_opt
, proto_lcp_option_auth
));
7039 dissector_add_uint("lcp.option", CI_COBS
, create_dissector_handle( dissect_lcp_cobs_opt
, proto_lcp_option_cobs
));
7040 dissector_add_uint("lcp.option", CI_PREFIX_ELISION
, create_dissector_handle( dissect_lcp_prefix_elision_opt
, proto_lcp_option_prefix_elision
));
7041 dissector_add_uint("lcp.option", CI_MULTILINK_HDR_FMT
, create_dissector_handle( dissect_lcp_multilink_hdr_fmt_opt
, proto_lcp_option_multilink_hdr_fmt
));
7042 dissector_add_uint("lcp.option", CI_INTERNATIONALIZATION
, create_dissector_handle( dissect_lcp_internationalization_opt
, proto_lcp_option_internationalization
));
7043 dissector_add_uint("lcp.option", CI_SDL_ON_SONET_SDH
, create_dissector_handle( dissect_lcp_sonet_sdh_opt
, proto_lcp_option_sonet_sdh
));
7047 proto_register_vsncp(void)
7049 static hf_register_info hf
[] = {
7050 { &hf_vsncp_opt_type
, { "Type", "vsncp.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7051 { &hf_vsncp_opt_length
, { "Length", "vsncp.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7052 /* Generated from convert_proto_tree_add_text.pl */
7053 { &hf_vsncp_pdn_identifier
, { "PDN Identifier", "vsncp.pdn_identifier", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7054 { &hf_vsncp_attach_type
, { "Attach Type", "vsncp.attach_type", FT_UINT8
, BASE_HEX
, VALS(vsncp_attach_vals
), 0x0, NULL
, HFILL
}},
7055 { &hf_vsncp_pdn_type
, { "PDN Type", "vsncp.pdn_type", FT_UINT8
, BASE_HEX
, VALS(vsncp_pdntype_vals
), 0x0, NULL
, HFILL
}},
7056 { &hf_vsncp_error_code
, { "Error Code", "vsncp.error_code", FT_UINT8
, BASE_HEX
, VALS(vsncp_errorcode_vals
), 0x0, NULL
, HFILL
}},
7057 { &hf_vsncp_pdn_ipv4
, { "PDN IPv4", "vsncp.pdn_ipv4", FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7058 { &hf_vsncp_pdn_ipv6
, { "PDN IPv6", "vsncp.pdn_ipv6", FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7059 { &hf_vsncp_default_router_address
, { "IPv4 Default Router Address", "vsncp.default_router_address", FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7060 { &hf_vsncp_access_point_name
, { "Access Point Name Label", "vsncp.access_point_name", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7061 { &hf_vsncp_address_allocation_cause
, { "Address Allocation Cause", "vsncp.address_allocation_cause", FT_UINT8
, BASE_HEX
, VALS(vsncp_alloc_vals
), 0x0, NULL
, HFILL
}},
7062 { &hf_vsncp_ambr_data
, { "AMBR Data", "vsncp.ambr_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7063 { &hf_vsncp_ipv6_interface_identifier
, { "IPv6 interface identifier", "vsncp.ipv6_interface_identifier", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7064 { &hf_vsncp_protocol
, { "Protocol", "vsncp.protocol", FT_UINT16
, BASE_HEX
, VALS(vsncp_pco_vals
), 0x0, NULL
, HFILL
}},
7065 { &hf_vsncp_protocol_configuration_length
, { "Length", "vsncp.protocol_configuration_length", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7066 { &hf_vsncp_protocol_configuration_data
, { "Data", "vsncp.protocol_configuration_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7067 { &hf_vsncp_code
, { "Code", "vsncp.code", FT_UINT8
, BASE_HEX
, VALS(cp_vals
), 0x0, NULL
, HFILL
}},
7068 { &hf_vsncp_identifier
, { "Identifier", "vsncp.identifier", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7069 { &hf_vsncp_length
, { "Length", "vsncp.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7072 static int *ett
[] = {
7075 &ett_vsncp_pdnid_opt
,
7076 &ett_vsncp_apname_opt
,
7077 &ett_vsncp_pdntype_opt
,
7078 &ett_vsncp_pdnaddress_opt
,
7080 &ett_vsncp_errorcode_opt
,
7081 &ett_vsncp_attachtype_opt
,
7082 &ett_vsncp_ipv4address_opt
,
7083 &ett_vsncp_addressalloc_opt
,
7084 &ett_vsncp_apn_ambr_opt
,
7085 &ett_vsncp_ipv6_hsgw_lla_iid_opt
,
7088 proto_vsncp
= proto_register_protocol("Vendor Specific Control Protocol", "VSNCP", "vsncp");
7089 vsncp_handle
= register_dissector("vsncp", dissect_vsncp
, proto_vsncp
);
7090 proto_register_subtree_array(ett
, array_length(ett
));
7091 proto_register_field_array(proto_vsncp
, hf
, array_length(hf
));
7093 vsncp_option_table
= register_dissector_table("vsncp.option", "PPP VSNCP Options", proto_vsncp
, FT_UINT8
, BASE_DEC
);
7095 /* Register VSNCP options as their own protocols so we can get the name of the option */
7096 proto_vsncp_option_pdnid
= proto_register_protocol_in_name_only("PDN Identifier", "PDN Identifier", "vsncp.opt.pdnid", proto_vsncp
, FT_BYTES
);
7097 proto_vsncp_option_apname
= proto_register_protocol_in_name_only("Access Point Name", "Access Point Name", "vsncp.opt.apname", proto_vsncp
, FT_BYTES
);
7098 proto_vsncp_option_pdntype
= proto_register_protocol_in_name_only("PDN Type", "PDN Type", "vsncp.opt.pdntype", proto_vsncp
, FT_BYTES
);
7099 proto_vsncp_option_pdnaddress
= proto_register_protocol_in_name_only("PDN Address", "PDN Address", "vsncp.opt.pdnaddress", proto_vsncp
, FT_BYTES
);
7100 proto_vsncp_option_pco
= proto_register_protocol_in_name_only("Protocol Configuration Options", "Protocol Configuration Options", "vsncp.opt.pco", proto_vsncp
, FT_BYTES
);
7101 proto_vsncp_option_errorcode
= proto_register_protocol_in_name_only("Error Code", "Error Code", "vsncp.opt.errorcode", proto_vsncp
, FT_BYTES
);
7102 proto_vsncp_option_attachtype
= proto_register_protocol_in_name_only("Attach Type", "Attach Type", "vsncp.opt.attachtype", proto_vsncp
, FT_BYTES
);
7103 proto_vsncp_option_ipv4address
= proto_register_protocol_in_name_only("IPv4 Default Router Address", "IPv4 Default Router Address", "vsncp.opt.ipv4address", proto_vsncp
, FT_BYTES
);
7104 proto_vsncp_option_addressalloc
= proto_register_protocol_in_name_only("Address Allocation Cause", "Address Allocation Cause", "vsncp.opt.addressalloc", proto_vsncp
, FT_BYTES
);
7105 proto_vsncp_option_apn_ambr
= proto_register_protocol_in_name_only("APN Aggregate Maximum Bit Rate(APN-AMBR)", "APN Aggregate Maximum Bit Rate(APN-AMBR)", "vsncp.opt.apn_ambr", proto_vsncp
, FT_BYTES
);
7106 proto_vsncp_option_ipv6_hsgw_lla_iid
= proto_register_protocol_in_name_only("IPv6 HSGW Link Local Address IID", "IPv6 HSGW Link Local Address IID", "vsncp.opt.ipv6_hsgw_lla_iid", proto_vsncp
, FT_BYTES
);
7110 proto_reg_handoff_vsncp(void)
7112 dissector_add_uint("ppp.protocol", PPP_VSNCP
, vsncp_handle
);
7114 dissector_add_uint("vsncp.option", CI_PDN_IDENTIFIER
, create_dissector_handle( dissect_vsncp_pdnid_opt
, proto_vsncp_option_pdnid
));
7115 dissector_add_uint("vsncp.option", CI_ACCESS_POINT_NM
, create_dissector_handle( dissect_vsncp_apname_opt
, proto_vsncp_option_apname
));
7116 dissector_add_uint("vsncp.option", CI_PDN_TYPE
, create_dissector_handle( dissect_vsncp_pdntype_opt
, proto_vsncp_option_pdntype
));
7117 dissector_add_uint("vsncp.option", CI_PDN_ADDRESS
, create_dissector_handle( dissect_vsncp_pdnaddress_opt
, proto_vsncp_option_pdnaddress
));
7118 dissector_add_uint("vsncp.option", CI_PROTOCOL_CONFIG
, create_dissector_handle( dissect_vsncp_pco_opt
, proto_vsncp_option_pco
));
7119 dissector_add_uint("vsncp.option", CI_ERROR_CODE
, create_dissector_handle( dissect_vsncp_errorcode_opt
, proto_vsncp_option_errorcode
));
7120 dissector_add_uint("vsncp.option", CI_ATTACH_TYPE
, create_dissector_handle( dissect_vsncp_attachtype_opt
, proto_vsncp_option_attachtype
));
7121 dissector_add_uint("vsncp.option", CI_IPv4DEFAULT_ROUTER
, create_dissector_handle( dissect_vsncp_ipv4address_opt
, proto_vsncp_option_ipv4address
));
7122 dissector_add_uint("vsncp.option", CI_ADDRESS_ALLOC
, create_dissector_handle( dissect_vsncp_addressalloc_opt
, proto_vsncp_option_addressalloc
));
7123 dissector_add_uint("vsncp.option", CI_APN_AMBR
, create_dissector_handle( dissect_vsncp_apn_ambr_opt
, proto_vsncp_option_apn_ambr
));
7124 dissector_add_uint("vsncp.option", CI_IPv6_HSGW_LLA_IID
, create_dissector_handle( dissect_vsncp_ipv6_hsgw_lla_iid_opt
, proto_vsncp_option_ipv6_hsgw_lla_iid
));
7128 proto_register_vsnp(void)
7130 static int *ett
[] = {
7134 static hf_register_info hf
[] = {
7135 { &hf_vsnp_3gpp_pdnid
,
7136 { "PDN ID", "vsnp.3gpp.pdnid", FT_UINT8
, BASE_HEX
,
7137 NULL
, 0x0, NULL
, HFILL
}}
7140 proto_vsnp
= proto_register_protocol("Vendor Specific Network Protocol",
7141 "PPP VSNP", "vsnp");
7142 vsnp_handle
= register_dissector("vsnp", dissect_vsnp
, proto_vsnp
);
7143 proto_register_subtree_array(ett
, array_length(ett
));
7144 proto_register_field_array(proto_vsnp
, hf
, array_length(hf
));
7148 proto_reg_handoff_vsnp(void)
7150 dissector_add_uint("ppp.protocol", PPP_VSNP
, vsnp_handle
);
7154 proto_register_ipcp(void)
7156 static hf_register_info hf
[] = {
7157 { &hf_ipcp_opt_type
,
7158 { "Type", "ipcp.opt.type", FT_UINT8
, BASE_DEC
,
7159 NULL
, 0x0, NULL
, HFILL
}},
7160 { &hf_ipcp_opt_length
,
7161 { "Length", "ipcp.opt.length", FT_UINT8
, BASE_DEC
,
7162 NULL
, 0x0, NULL
, HFILL
}},
7163 { &hf_ipcp_opt_src_address
,
7164 { "Source IP Address", "ipcp.opt.src_address", FT_IPv4
, BASE_NONE
,
7165 NULL
, 0x0, NULL
, HFILL
}},
7166 { &hf_ipcp_opt_dst_address
,
7167 { "Destination IP Address", "ipcp.opt.dst_address", FT_IPv4
,
7168 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7169 { &hf_ipcp_opt_compress_proto
,
7170 { "IP Compression Protocol", "ipcp.opt.compress_proto", FT_UINT16
,
7171 BASE_HEX
, VALS(ipcp_compress_proto_vals
), 0x0, NULL
, HFILL
}},
7172 { &hf_ipcp_opt_max_cid
,
7173 { "Max CID", "ipcp.opt.max_cid", FT_UINT16
, BASE_DEC
,
7174 NULL
, 0x0, "Maximum value of a context identifier", HFILL
}},
7175 { &hf_ipcp_opt_mrru
,
7176 { "MRRU", "ipcp.opt.mrru", FT_UINT16
, BASE_DEC
,
7177 NULL
, 0x0, "Maximum Reconstructed Reception Unit", HFILL
}},
7178 { &hf_ipcp_opt_max_slot_id
,
7179 { "Max Slot ID", "ipcp.opt.max_slot_id", FT_UINT8
, BASE_DEC
,
7180 NULL
, 0x0, NULL
, HFILL
}},
7181 { &hf_ipcp_opt_comp_slot_id
,
7182 { "Comp Slot ID", "ipcp.opt.comp_slot_id", FT_BOOLEAN
, 8,
7183 TFS(&tfs_comp_slot_id
), 0x01, NULL
, HFILL
}},
7184 { &hf_ipcp_opt_tcp_space
,
7185 { "TCP Space", "ipcp.opt.tcp_space", FT_UINT16
, BASE_DEC
,
7186 NULL
, 0x0, NULL
, HFILL
}},
7187 { &hf_ipcp_opt_non_tcp_space
,
7188 { "Non TCP Space", "ipcp.opt.non_tcp_space", FT_UINT16
, BASE_DEC
,
7189 NULL
, 0x0, NULL
, HFILL
}},
7190 { &hf_ipcp_opt_f_max_period
,
7191 { "F Max Period", "ipcp.opt.f_max_period", FT_UINT16
, BASE_DEC
,
7192 NULL
, 0x0, "Maximum interval between full headers", HFILL
}},
7193 { &hf_ipcp_opt_f_max_time
,
7194 { "F Max Time", "ipcp.opt.f_max_time", FT_UINT16
, BASE_DEC
, NULL
,
7195 0x0, "Maximum time interval between full headers", HFILL
}},
7196 { &hf_ipcp_opt_max_header
,
7197 { "Max Header", "ipcp.opt.max_header", FT_UINT16
, BASE_DEC
, NULL
,
7199 "The largest header size in octets that may be compressed",
7202 { "Data", "ipcp.data", FT_BYTES
, BASE_NONE
,
7203 NULL
, 0x0, NULL
, HFILL
}},
7204 { &hf_ipcp_opt_ip_address
,
7205 { "IP Address", "ipcp.opt.ip_address", FT_IPv4
, BASE_NONE
,
7206 NULL
, 0x0, NULL
, HFILL
}},
7207 { &hf_ipcp_opt_mobilenodehomeaddr
,
7208 { "Mobile Node's Home Address", "ipcp.opt.mobilenodehomeaddress",
7209 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7210 { &hf_ipcp_opt_pri_dns_address
,
7211 { "Primary DNS Address", "ipcp.opt.pri_dns_address",
7212 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7213 { &hf_ipcp_opt_pri_nbns_address
,
7214 { "Primary NBNS Address", "ipcp.opt.pri_nbns_address",
7215 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7216 { &hf_ipcp_opt_sec_dns_address
,
7217 { "Secondary DNS Address", "ipcp.opt.sec_dns_address",
7218 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7219 { &hf_ipcp_opt_sec_nbns_address
,
7220 { "Secondary NBNS Address", "ipcp.opt.sec_nbns_address",
7221 FT_IPv4
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7222 { &hf_ipcp_opt_rohc_type
,
7223 { "Type", "ipcp.opt.rohc.type", FT_UINT8
, BASE_DEC
,
7224 NULL
, 0x0, NULL
, HFILL
}},
7225 { &hf_ipcp_opt_rohc_length
,
7226 { "Length", "ipcp.opt.rohc.length", FT_UINT8
, BASE_DEC
,
7227 NULL
, 0x0, NULL
, HFILL
}},
7228 { &hf_ipcp_opt_rohc_profile
,
7229 { "Profile", "ipcp.opt.rohc.profile", FT_UINT16
, BASE_HEX
,
7230 VALS(ipcp_rohc_profile_vals
), 0x0, NULL
, HFILL
}},
7231 { &hf_ipcp_opt_iphc_type
,
7232 { "Type", "ipcp.opt.iphc.type", FT_UINT8
, BASE_DEC
,
7233 NULL
, 0x0, NULL
, HFILL
}},
7234 { &hf_ipcp_opt_iphc_length
,
7235 { "Length", "ipcp.opt.iphc.length", FT_UINT8
, BASE_DEC
,
7236 NULL
, 0x0, NULL
, HFILL
}},
7237 { &hf_ipcp_opt_iphc_param
,
7238 { "Parameter", "ipcp.opt.iphc.param", FT_UINT8
, BASE_DEC
,
7239 VALS(ipcp_iphc_parameter_vals
), 0x0, NULL
, HFILL
}}
7242 static int *ett
[] = {
7245 &ett_ipcp_ipaddrs_opt
,
7246 &ett_ipcp_compress_opt
,
7247 &ett_ipcp_ipaddr_opt
,
7248 &ett_ipcp_mobileipv4_opt
,
7249 &ett_ipcp_pridns_opt
,
7250 &ett_ipcp_secdns_opt
,
7251 &ett_ipcp_prinbns_opt
,
7252 &ett_ipcp_secnbns_opt
,
7253 &ett_ipcp_iphc_rtp_compress_opt
,
7254 &ett_ipcp_iphc_enhanced_rtp_compress_opt
,
7255 &ett_ipcp_iphc_neghdrcomp_opt
,
7256 &ett_ipcp_rohc_profiles_opt
7259 proto_ipcp
= proto_register_protocol("PPP IP Control Protocol", "PPP IPCP", "ipcp");
7260 ipcp_handle
= register_dissector("ipcp", dissect_ipcp
, proto_ipcp
);
7261 proto_register_field_array(proto_ipcp
, hf
, array_length(hf
));
7262 proto_register_subtree_array(ett
, array_length(ett
));
7264 ipcp_option_table
= register_dissector_table("ipcp.option", "PPP IPCP Options", proto_ipcp
, FT_UINT8
, BASE_DEC
);
7265 ipcp_rohc_suboption_table
= register_dissector_table("ipcp.rohc.option", "PPP IPCP ROHC Options", proto_ipcp
, FT_UINT8
, BASE_DEC
);
7266 ipcp_iphc_suboption_table
= register_dissector_table("ipcp.iphc.option", "PPP IPCP IPHC Options", proto_ipcp
, FT_UINT8
, BASE_DEC
);
7268 /* Register IPCP options as their own protocols so we can get the name of the option */
7269 proto_ipcp_option_addrs
= proto_register_protocol_in_name_only("IP Addresses (deprecated)", "IP Addresses (deprecated)", "ipcp.opt.addrs", proto_ipcp
, FT_BYTES
);
7270 proto_ipcp_option_compress
= proto_register_protocol_in_name_only("IP Compression Protocol", "IP Compression Protocol", "ipcp.opt.compress", proto_ipcp
, FT_BYTES
);
7271 proto_ipcp_option_addr
= proto_register_protocol_in_name_only("IP Address", "IP Address", "ipcp.opt.addr", proto_ipcp
, FT_BYTES
);
7272 proto_ipcp_option_mobileipv4
= proto_register_protocol_in_name_only("Mobile Node's Home IP Address", "Mobile Node's Home IP Address", "ipcp.opt.mobileipv4", proto_ipcp
, FT_BYTES
);
7273 proto_ipcp_option_pri_dns
= proto_register_protocol_in_name_only("Primary DNS Server IP Address", "Primary DNS Server IP Address", "ipcp.opt.pri_dns", proto_ipcp
, FT_BYTES
);
7274 proto_ipcp_option_pri_nbns
= proto_register_protocol_in_name_only("Primary NBNS Server IP Address", "Primary NBNS Server IP Address", "ipcp.opt.pri_nbns", proto_ipcp
, FT_BYTES
);
7275 proto_ipcp_option_sec_dns
= proto_register_protocol_in_name_only("Secondary DNS Server IP Address", "Secondary DNS Server IP Address", "ipcp.opt.sec_dns", proto_ipcp
, FT_BYTES
);
7276 proto_ipcp_option_sec_nbns
= proto_register_protocol_in_name_only("Secondary NBNS Server IP Address", "Secondary NBNS Server IP Address", "ipcp.opt.sec_nbns", proto_ipcp
, FT_BYTES
);
7278 proto_ipcp_rohc_option_profiles
= proto_register_protocol_in_name_only("Profiles (RFC3241)", "Profiles (RFC3241)", "ipcp.opt.rohc.profile_bytes", proto_ipcp
, FT_BYTES
);
7280 proto_ipcp_iphc_option_rtp_compress
= proto_register_protocol_in_name_only("RTP compression (RFC2508)", "RTP compression (RFC2508)", "ipcp.opt.iphc.rtp_compress", proto_ipcp
, FT_BYTES
);
7281 proto_ipcp_iphc_option_enhanced_rtp_compress
= proto_register_protocol_in_name_only("Enhanced RTP compression (RFC3545)", "Enhanced RTP compression (RFC3545)", "ipcp.opt.iphc.enhanced_rtp_compress", proto_ipcp
, FT_BYTES
);
7282 proto_ipcp_iphc_option_neghdrcomp
= proto_register_protocol_in_name_only("Negotiating header compression (RFC3545)", "Negotiating header compression (RFC3545)", "ipcp.opt.iphc.neghdrcomp", proto_ipcp
, FT_BYTES
);
7286 proto_reg_handoff_ipcp(void)
7288 dissector_add_uint("ppp.protocol", PPP_IPCP
, ipcp_handle
);
7291 * See above comment about NDISWAN for an explanation of why we're
7292 * registering with the "ethertype" dissector table.
7294 dissector_add_uint("ethertype", PPP_IPCP
, ipcp_handle
);
7297 * for GSM-A / MobileL3 / GPRS SM / PCO
7299 dissector_add_uint("sm_pco.protocol", PPP_IPCP
, ipcp_handle
);
7301 dissector_add_uint("ipcp.option", CI_ADDRS
, create_dissector_handle( dissect_ipcp_addrs_opt
, proto_ipcp_option_addrs
));
7302 dissector_add_uint("ipcp.option", CI_COMPRESS_PROTO
, create_dissector_handle( dissect_ipcp_compress_opt
, proto_ipcp_option_compress
));
7303 dissector_add_uint("ipcp.option", CI_ADDR
, create_dissector_handle( dissect_ipcp_addr_opt
, proto_ipcp_option_addr
));
7304 dissector_add_uint("ipcp.option", CI_MOBILE_IPv4
, create_dissector_handle( dissect_ipcp_mobileipv4_opt
, proto_ipcp_option_mobileipv4
));
7305 dissector_add_uint("ipcp.option", CI_PRI_DNS
, create_dissector_handle( dissect_ipcp_pri_dns_opt
, proto_ipcp_option_pri_dns
));
7306 dissector_add_uint("ipcp.option", CI_PRI_NBNS
, create_dissector_handle( dissect_ipcp_pri_nbns_opt
, proto_ipcp_option_pri_nbns
));
7307 dissector_add_uint("ipcp.option", CI_SEC_DNS
, create_dissector_handle( dissect_ipcp_sec_dns_opt
, proto_ipcp_option_sec_dns
));
7308 dissector_add_uint("ipcp.option", CI_SEC_NBNS
, create_dissector_handle( dissect_ipcp_sec_nbns_opt
, proto_ipcp_option_sec_nbns
));
7310 dissector_add_uint("ipcp.rohc.option", IPCP_ROHC_PROFILES
, create_dissector_handle( dissect_ipcp_rohc_profiles_opt
, proto_ipcp_rohc_option_profiles
));
7312 dissector_add_uint("ipcp.iphc.option", IPCP_IPHC_CRTP
, create_dissector_handle( dissect_ipcp_iphc_rtp_compress
, proto_ipcp_iphc_option_rtp_compress
));
7313 dissector_add_uint("ipcp.iphc.option", IPCP_IPHC_ECRTP
, create_dissector_handle( dissect_ipcp_iphc_enhanced_rtp_compress
, proto_ipcp_iphc_option_enhanced_rtp_compress
));
7314 dissector_add_uint("ipcp.iphc.option", IPCP_IPHC_NEGHC
, create_dissector_handle( dissect_ipcp_iphc_neghdrcomp_opt
, proto_ipcp_iphc_option_neghdrcomp
));
7318 proto_register_bcp_bpdu(void)
7320 static hf_register_info hf
[] = {
7321 { &hf_bcp_bpdu_flags
,
7322 { "Flags", "bcp_bpdu.flags", FT_UINT8
, BASE_HEX
,
7323 NULL
, 0x0, NULL
, HFILL
}},
7324 { &hf_bcp_bpdu_fcs_present
,
7325 { "LAN FCS present", "bcp_bpdu.flags.fcs_present", FT_BOOLEAN
, 8,
7326 TFS(&tfs_yes_no
), BCP_FCS_PRESENT
, NULL
, HFILL
}},
7327 { &hf_bcp_bpdu_zeropad
,
7328 { "802.3 pad zero-filled", "bcp_bpdu.flags.zeropad", FT_BOOLEAN
, 8,
7329 TFS(&tfs_yes_no
), BCP_ZEROPAD
, NULL
, HFILL
}},
7330 { &hf_bcp_bpdu_bcontrol
,
7331 { "Bridge control", "bcp_bpdu.flags.bcontrol", FT_BOOLEAN
, 8,
7332 TFS(&tfs_yes_no
), BCP_IS_BCONTROL
, NULL
, HFILL
}},
7333 { &hf_bcp_bpdu_pads
,
7334 { "Pads", "bcp_bpdu.pads", FT_UINT8
, BASE_DEC
,
7335 NULL
, BCP_PADS_MASK
, NULL
, HFILL
}},
7336 { &hf_bcp_bpdu_mac_type
,
7337 { "MAC Type", "bcp_bpdu.mac_type", FT_UINT8
, BASE_DEC
,
7338 VALS(bcp_bpdu_mac_type_vals
), 0x0, NULL
, HFILL
}},
7340 { "Pad", "bcp_bpdu.pad", FT_BYTES
, BASE_NONE
,
7341 NULL
, 0x0, NULL
, HFILL
}},
7344 static int *ett
[] = {
7346 &ett_bcp_bpdu_flags
,
7349 proto_bcp_bpdu
= proto_register_protocol("PPP Bridging Control Protocol Bridged PDU",
7350 "PPP BCP BPDU", "bcp_bpdu");
7351 bcp_bpdu_handle
= register_dissector("bcp_bpdu", dissect_bcp_bpdu
, proto_bcp_bpdu
);
7352 proto_register_field_array(proto_bcp_bpdu
, hf
, array_length(hf
));
7353 proto_register_subtree_array(ett
, array_length(ett
));
7357 proto_reg_handoff_bcp_bpdu(void)
7359 eth_withfcs_handle
= find_dissector_add_dependency("eth_withfcs", proto_bcp_bpdu
);
7360 eth_withoutfcs_handle
= find_dissector_add_dependency("eth_withoutfcs", proto_bcp_bpdu
);
7362 dissector_add_uint("ppp.protocol", PPP_BCP_BPDU
, bcp_bpdu_handle
);
7366 proto_register_bcp_ncp(void)
7368 static hf_register_info hf
[] = {
7369 { &hf_bcp_ncp_opt_type
,
7370 { "Type", "bcp_ncp.lcp.opt.type", FT_UINT8
, BASE_DEC
,
7371 NULL
, 0x0, NULL
, HFILL
} },
7372 { &hf_bcp_ncp_opt_length
,
7373 { "Length", "bcp_ncp.lcp.opt.length", FT_UINT8
, BASE_DEC
,
7374 NULL
, 0x0, NULL
, HFILL
} },
7375 { &hf_bcp_ncp_lan_seg_no
,
7376 { "LAN Segment Number", "bcp_ncp.lcp.lan_seg_no", FT_UINT16
, BASE_DEC
,
7377 NULL
, 0xfff0, NULL
, HFILL
} },
7378 { &hf_bcp_ncp_bridge_no
,
7379 { "Bridge Number", "bcp_ncp.lcp.bridge_no", FT_UINT16
, BASE_DEC
,
7380 NULL
, 0x000f, NULL
, HFILL
} },
7381 { &hf_bcp_ncp_tinygram_comp
,
7382 { "Tinygram-Compression", "bcp_ncp.lcp.tinygram_comp", FT_BOOLEAN
, BASE_NONE
,
7383 TFS(&tfs_enabled_disabled
), 0x0, NULL
, HFILL
} },
7385 { "MAC Address", "bcp_ncp.lcp.mac_address", FT_ETHER
, BASE_NONE
,
7386 NULL
, 0x0, NULL
, HFILL
} },
7387 { &hf_bcp_ncp_mac_l
,
7388 { "L bit", "bcp_ncp.lcp.mac_l", FT_UINT48
, BASE_HEX
,
7389 NULL
, UINT64_C(0x0200000000), NULL
, HFILL
} },
7390 { &hf_bcp_ncp_mac_m
,
7391 { "M bit", "bcp_ncp.lcp.mac_m", FT_UINT48
, BASE_HEX
,
7392 NULL
, UINT64_C(0x0100000000), NULL
, HFILL
} },
7393 { &hf_bcp_ncp_stp_prot
,
7394 { "Protocol", "bcp_ncp.lcp.stp_protocol", FT_UINT8
, BASE_DEC
,
7395 VALS(bcp_ncp_stp_prot_vals
), 0x0, NULL
, HFILL
} },
7396 { &hf_bcp_ncp_ieee_802_tagged_frame
,
7397 { "IEEE-802-Tagged-Frame", "bcp_ncp.ieee_802_tagged_frame", FT_BOOLEAN
, BASE_NONE
,
7398 TFS(&tfs_enabled_disabled
), 0x0, NULL
, HFILL
} },
7402 static int *ett
[] = {
7404 &ett_bcp_ncp_options
,
7405 &ett_bcp_ncp_ieee_802_tagged_frame_opt
,
7406 &ett_bcp_ncp_management_inline_opt
,
7407 &ett_bcp_ncp_bcp_ind_opt
,
7408 &ett_bcp_ncp_bridge_id_opt
,
7409 &ett_bcp_ncp_line_id_opt
,
7410 &ett_bcp_ncp_mac_sup_opt
,
7411 &ett_bcp_ncp_tinygram_comp_opt
,
7412 &ett_bcp_ncp_lan_id_opt
,
7413 &ett_bcp_ncp_mac_addr_opt
,
7414 &ett_bcp_ncp_stp_opt
7417 proto_bcp_ncp
= proto_register_protocol("PPP Bridging Control Protocol Network Control Protocol", "PPP BCP NCP", "bcp_ncp");
7418 bcp_ncp_handle
= register_dissector("bcp_ncp", dissect_bcp_ncp
, proto_bcp_ncp
);
7419 proto_register_field_array(proto_bcp_ncp
, hf
, array_length(hf
));
7420 proto_register_subtree_array(ett
, array_length(ett
));
7422 bcp_ncp_option_table
= register_dissector_table("bcp_ncp.option", "PPP BCP NCP Options", proto_bcp_ncp
, FT_UINT8
, BASE_DEC
);
7424 /* Register BCP NCP options as their own protocols so we can get the name of the option */
7425 proto_bcp_ncp_option_bridge_id
= proto_register_protocol_in_name_only("Bridge-Identification", "Bridge-Identification", "bcp_ncp.opt.bridge_id", proto_bcp_ncp
, FT_BYTES
);
7426 proto_bcp_ncp_option_line_id
= proto_register_protocol_in_name_only("Line-Identification", "Line-Identification", "bcp_ncp.opt.line_id", proto_bcp_ncp
, FT_BYTES
);
7427 proto_bcp_ncp_option_mac_sup
= proto_register_protocol_in_name_only("MAC-Support", "MAC-Support", "bcp_ncp.opt.mac_sup", proto_bcp_ncp
, FT_BYTES
);
7428 proto_bcp_ncp_option_tinygram_comp
= proto_register_protocol_in_name_only("Tinygram-Compression", "Tinygram-Compression", "bcp_ncp.opt.tinygram_comp", proto_bcp_ncp
, FT_BYTES
);
7429 proto_bcp_ncp_option_lan_id
= proto_register_protocol_in_name_only("LAN-Identification (obsoleted)", "LAN-Identification (obsoleted)", "bcp_ncp.opt.lan_id", proto_bcp_ncp
, FT_BYTES
);
7430 proto_bcp_ncp_option_mac_addr
= proto_register_protocol_in_name_only("MAC-Address", "MAC-Address", "bcp_ncp.opt.mac_addr", proto_bcp_ncp
, FT_BYTES
);
7431 proto_bcp_ncp_option_stp
= proto_register_protocol_in_name_only("Spanning-Tree-Protocol (old formatted)", "Spanning-Tree-Protocol (old formatted)", "bcp_ncp.opt.stp", proto_bcp_ncp
, FT_BYTES
);
7432 proto_bcp_ncp_option_ieee_802_tagged_frame
= proto_register_protocol_in_name_only("IEEE 802 Tagged Frame", "IEEE 802 Tagged Frame", "bcp_ncp.opt.ieee_802_tagged_frame", proto_bcp_ncp
, FT_BYTES
);
7433 proto_bcp_ncp_option_management_inline
= proto_register_protocol_in_name_only("Management Inline", "Management Inline", "bcp_ncp.opt.management_inline", proto_bcp_ncp
, FT_BYTES
);
7434 proto_bcp_ncp_option_bcp_ind
= proto_register_protocol_in_name_only("Bridge Control Packet Indicator", "Bridge Control Packet Indicator", "bcp_ncp.opt.bcp_ind", proto_bcp_ncp
, FT_BYTES
);
7438 proto_reg_handoff_bcp_ncp(void)
7440 dissector_add_uint("ppp.protocol", PPP_BCP_NCP
, bcp_ncp_handle
);
7442 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_BRIDGE_ID
, create_dissector_handle( dissect_bcp_ncp_bridge_id
, proto_bcp_ncp_option_bridge_id
));
7443 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_LINE_ID
, create_dissector_handle( dissect_bcp_ncp_line_id
, proto_bcp_ncp_option_line_id
));
7444 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_MAC_SUPPORT
, create_dissector_handle( dissect_bcp_ncp_mac_sup
, proto_bcp_ncp_option_mac_sup
));
7445 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_TINYGRAM_COMP
, create_dissector_handle( dissect_bcp_ncp_tinygram_comp
, proto_bcp_ncp_option_tinygram_comp
));
7446 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_LAN_ID
, create_dissector_handle( dissect_bcp_ncp_lan_id
, proto_bcp_ncp_option_lan_id
));
7447 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_MAC_ADDRESS
, create_dissector_handle( dissect_bcp_ncp_mac_addr
, proto_bcp_ncp_option_mac_addr
));
7448 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_STP
, create_dissector_handle( dissect_bcp_ncp_stp
, proto_bcp_ncp_option_stp
));
7449 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_IEEE_802_TAGGED_FRAME
, create_dissector_handle( dissect_bcp_ncp_ieee_802_tagged_frame
, proto_bcp_ncp_option_ieee_802_tagged_frame
));
7450 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_MANAGEMENT_INLINE
, create_dissector_handle( dissect_bcp_ncp_management_inline
, proto_bcp_ncp_option_management_inline
));
7451 dissector_add_uint("bcp_ncp.option", CI_BCPNCP_BCP_IND
, create_dissector_handle( dissect_bcp_ncp_bcp_ncp_bcp_ind
, proto_bcp_ncp_option_bcp_ind
));
7455 proto_register_osinlcp(void)
7457 static hf_register_info hf
[] = {
7458 { &hf_osinlcp_opt_type
,
7459 { "Type", "osinlcp.opt.type", FT_UINT8
, BASE_DEC
,
7460 NULL
, 0x0, NULL
, HFILL
} },
7461 { &hf_osinlcp_opt_length
,
7462 { "Length", "osinlcp.opt.length", FT_UINT8
, BASE_DEC
,
7463 NULL
, 0x0, NULL
, HFILL
} },
7464 { &hf_osinlcp_opt_alignment
,
7465 { "Alignment", "osinlcp.opt.alignment", FT_UINT8
, BASE_DEC
,
7466 NULL
, 0x0, NULL
, HFILL
} }
7469 static int *ett
[] = {
7471 &ett_osinlcp_options
,
7472 &ett_osinlcp_align_npdu_opt
7475 proto_osinlcp
= proto_register_protocol("PPP OSI Network Layer Control Protocol", "PPP OSINLCP", "osinlcp");
7476 osinlcp_handle
= register_dissector("osinlcp", dissect_osinlcp
, proto_osinlcp
);
7477 proto_register_field_array(proto_osinlcp
, hf
, array_length(hf
));
7478 proto_register_subtree_array(ett
, array_length(ett
));
7480 osinlcp_option_table
= register_dissector_table("osinlcp.option", "PPP OSINLCP Options", proto_osinlcp
, FT_UINT8
, BASE_DEC
);
7482 /* Register OSINLCP options as their own protocols so we can get the name of the option */
7483 proto_osinlcp_option_align_npdu
= proto_register_protocol_in_name_only("Align-NPDU", "Align-NPDU", "osinlcp.opt.def_pid", proto_osinlcp
, FT_BYTES
);
7488 proto_reg_handoff_osinlcp(void)
7490 dissector_add_uint("ppp.protocol", PPP_OSINLCP
, osinlcp_handle
);
7493 * See above comment about NDISWAN for an explanation of why we're
7494 * registering with the "ethertype" dissector table.
7496 dissector_add_uint("ethertype", PPP_OSINLCP
, osinlcp_handle
);
7498 dissector_add_uint("osinlcp.option", CI_OSINLCP_ALIGN_NPDU
, create_dissector_handle( dissect_osinlcp_align_npdu_opt
, proto_osinlcp_option_align_npdu
));
7502 proto_register_ccp(void)
7504 static hf_register_info hf
[] = {
7506 { "Type", "ccp.opt.type", FT_UINT8
, BASE_DEC
,
7507 NULL
, 0x0, NULL
, HFILL
}},
7508 { &hf_ccp_opt_length
,
7509 { "Length", "ccp.opt.length", FT_UINT8
, BASE_DEC
,
7510 NULL
, 0x0, NULL
, HFILL
}},
7512 { "OUI", "ccp.opt.oui", FT_UINT24
, BASE_OUI
,
7513 NULL
, 0x0, NULL
, HFILL
}},
7514 { &hf_ccp_opt_subtype
,
7515 { "Subtype", "ccp.opt.subtype", FT_UINT8
, BASE_DEC_HEX
,
7516 NULL
, 0x0, NULL
, HFILL
}},
7517 { &hf_ccp_opt_history_count
,
7518 { "History Count", "ccp.opt.history_count", FT_UINT16
, BASE_DEC
,
7519 NULL
, 0x0, "The maximum number of compression histories",
7522 { "Check Mode Field", "ccp.opt.cm", FT_UINT8
, BASE_DEC
,
7523 NULL
, 0x0, NULL
, HFILL
}},
7524 { &hf_ccp_opt_cm_reserved
,
7525 { "Reserved", "ccp.opt.cm.reserved", FT_UINT8
, BASE_DEC
,
7526 NULL
, 0xF8, NULL
, HFILL
}},
7527 { &hf_ccp_opt_cm_check_mode
,
7528 { "Check Mode", "ccp.opt.cm.check_mode", FT_UINT8
, BASE_DEC
,
7529 VALS(stac_checkmode_vals
), 0x07, NULL
, HFILL
}},
7530 { &hf_ccp_opt_supported_bits
,
7531 { "Supported Bits", "ccp.opt.supported_bits", FT_UINT32
, BASE_HEX
,
7532 NULL
, 0x0, NULL
, HFILL
}},
7533 { &hf_ccp_opt_supported_bits_h
,
7534 { "H", "ccp.opt.supported_bits.h", FT_BOOLEAN
, 32,
7535 TFS(&ccp_mppe_h_tfs
), MPPE_SUPPORTED_BITS_H
, NULL
, HFILL
}},
7536 { &hf_ccp_opt_supported_bits_m
,
7537 { "M", "ccp.opt.supported_bits.m", FT_BOOLEAN
, 32,
7538 TFS(&ccp_mppe_m_tfs
), MPPE_SUPPORTED_BITS_M
, NULL
, HFILL
}},
7539 { &hf_ccp_opt_supported_bits_s
,
7540 { "S", "ccp.opt.supported_bits.s", FT_BOOLEAN
, 32,
7541 TFS(&ccp_mppe_s_tfs
), MPPE_SUPPORTED_BITS_S
, NULL
, HFILL
}},
7542 { &hf_ccp_opt_supported_bits_l
,
7543 { "L", "ccp.opt.supported_bits.l", FT_BOOLEAN
, 32,
7544 TFS(&ccp_mppe_l_tfs
), MPPE_SUPPORTED_BITS_L
, NULL
, HFILL
}},
7545 { &hf_ccp_opt_supported_bits_d
,
7546 { "D", "ccp.opt.supported_bits.d", FT_BOOLEAN
, 32,
7547 TFS(&ccp_mppe_d_tfs
), MPPE_SUPPORTED_BITS_D
, NULL
, HFILL
}},
7548 { &hf_ccp_opt_supported_bits_c
,
7549 { "C", "ccp.opt.supported_bits.c", FT_BOOLEAN
, 32,
7550 TFS(&ccp_mppe_c_tfs
), MPPC_SUPPORTED_BITS_C
, NULL
, HFILL
}},
7551 { &hf_ccp_opt_history
,
7552 { "History", "ccp.opt.history", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7553 "Maximum size of the compression history in powers of 2",
7555 { &hf_ccp_opt_version
,
7556 { "Version", "ccp.opt.version", FT_BYTES
, BASE_NONE
,
7557 NULL
, 0x0, NULL
, HFILL
}},
7559 { "Vers/Dict", "ccp.opt.vd", FT_UINT8
, BASE_HEX
,
7560 NULL
, 0x0, NULL
, HFILL
}},
7561 { &hf_ccp_opt_vd_vers
,
7562 { "Vers", "ccp.opt.vd.vers", FT_UINT8
, BASE_DEC
,
7563 NULL
, 0xE0, NULL
, HFILL
}},
7564 { &hf_ccp_opt_vd_dict
,
7565 { "Dict", "ccp.opt.vd.dict", FT_UINT8
, BASE_DEC
, NULL
,
7566 0x1F, "The size in bits of the largest code used", HFILL
}},
7567 { &hf_ccp_opt_check_mode
,
7568 { "Check Mode", "ccp.opt.check_mode", FT_UINT8
, BASE_DEC
,
7569 VALS(lzsdcp_checkmode_vals
), 0x0, NULL
, HFILL
}},
7570 { &hf_ccp_opt_process_mode
,
7571 { "Process Mode", "ccp.opt.process_mode", FT_UINT8
, BASE_DEC
,
7572 VALS(lzsdcp_processmode_vals
), 0x0, NULL
, HFILL
}},
7574 { "Features", "ccp.opt.fe", FT_UINT8
, BASE_DEC
,
7575 NULL
, 0xC0, NULL
, HFILL
}},
7577 { "Packet by Packet flag", "ccp.opt.p", FT_BOOLEAN
, 8,
7578 TFS(&tfs_enabled_disabled
), 0x20, NULL
, HFILL
}},
7579 { &hf_ccp_opt_History
,
7580 { "History", "ccp.opt.History", FT_UINT8
, BASE_DEC
,
7581 NULL
, 0x1F, NULL
, HFILL
}},
7582 { &hf_ccp_opt_contexts
,
7583 { "# Contexts", "ccp.opt.contexts", FT_UINT8
, BASE_DEC
,
7584 NULL
, 0x0, NULL
, HFILL
}},
7586 { "Mode", "ccp.opt.mode", FT_UINT8
, BASE_DEC
,
7587 VALS(dce_mode_vals
), 0x0, NULL
, HFILL
}},
7588 { &hf_ccp_opt_window
,
7589 { "Window", "ccp.opt.window", FT_UINT8
, BASE_DEC
,
7590 NULL
, 0xF0, NULL
, HFILL
}},
7591 { &hf_ccp_opt_method
,
7592 { "Method", "ccp.opt.method", FT_UINT8
, BASE_DEC
,
7593 VALS(deflate_method_vals
), 0x0F, NULL
, HFILL
}},
7595 { "MBZ", "ccp.opt.mbz", FT_UINT8
, BASE_DEC
,
7596 NULL
, 0xFC, NULL
, HFILL
}},
7598 { "Chk", "ccp.opt.chk", FT_UINT8
, BASE_DEC
,
7599 VALS(deflate_chk_vals
), 0x03, NULL
, HFILL
}},
7600 { &hf_ccp_opt_mode_dictcount
,
7601 { "Mode/Dictionary Count", "ccp.opt.mode_dictcount", FT_UINT16
,
7602 BASE_DEC
| BASE_RANGE_STRING
, RVALS(v44lzjh_mode_dict_rvals
),
7603 0x0, NULL
, HFILL
}},
7604 { &hf_ccp_opt_dict_size
,
7605 { "Dictionary Size", "ccp.opt.dict_size", FT_UINT16
, BASE_DEC
,
7606 NULL
, 0x0, NULL
, HFILL
}},
7607 { &hf_ccp_opt_history_length
,
7608 { "History Length", "ccp.opt.history_length", FT_UINT16
, BASE_DEC
,
7609 NULL
, 0x0, NULL
, HFILL
}},
7611 { "Data", "ccp.opt.data", FT_BYTES
, BASE_NONE
,
7612 NULL
, 0x0, NULL
, HFILL
}},
7614 static int *ett
[] = {
7618 &ett_ccp_predict1_opt
,
7619 &ett_ccp_predict2_opt
,
7620 &ett_ccp_puddle_opt
,
7623 &ett_ccp_stac_opt_check_mode
,
7625 &ett_ccp_mppe_opt_supp_bits
,
7627 &ett_ccp_v42bis_opt
,
7628 &ett_ccp_bsdcomp_opt
,
7629 &ett_ccp_lzsdcp_opt
,
7632 &ett_ccp_deflate_opt
,
7633 &ett_ccp_v44lzjh_opt
7636 proto_ccp
= proto_register_protocol("PPP Compression Control Protocol", "PPP CCP", "ccp");
7637 ccp_handle
= register_dissector("ccp", dissect_ccp
, proto_ccp
);
7638 proto_register_field_array(proto_ccp
, hf
, array_length(hf
));
7639 proto_register_subtree_array(ett
, array_length(ett
));
7641 ccp_option_table
= register_dissector_table("ccp.option", "PPP CCP Options", proto_ccp
, FT_UINT8
, BASE_DEC
);
7643 /* Register CCP options as their own protocols so we can get the name of the option */
7644 proto_ccp_option_oui
= proto_register_protocol_in_name_only("OUI", "OUI", "ccp.opt_oui", proto_ccp
, FT_BYTES
);
7645 proto_ccp_option_predict1
= proto_register_protocol_in_name_only("Predictor type 1", "Predictor type 1", "ccp.opt.predict1", proto_ccp
, FT_BYTES
);
7646 proto_ccp_option_predict2
= proto_register_protocol_in_name_only("Predictor type 2", "Predictor type 2", "ccp.opt.predict2", proto_ccp
, FT_BYTES
);
7647 proto_ccp_option_puddle
= proto_register_protocol_in_name_only("Puddle Jumper", "Puddle Jumper", "ccp.opt.puddle", proto_ccp
, FT_BYTES
);
7648 proto_ccp_option_hpppc
= proto_register_protocol_in_name_only("Hewlett-Packard PPC", "Hewlett-Packard PPC", "ccp.opt.hpppc", proto_ccp
, FT_BYTES
);
7649 proto_ccp_option_stac
= proto_register_protocol_in_name_only("Stac Electronics LZS", "Stac Electronics LZS", "ccp.opt.stac", proto_ccp
, FT_BYTES
);
7650 proto_ccp_option_stac_ascend
= proto_register_protocol_in_name_only("Stac Electronics LZS (Ascend Proprietary version)", "Stac Electronics LZS (Ascend Proprietary version)", "ccp.opt.stac_ascend", proto_ccp
, FT_BYTES
);
7651 proto_ccp_option_mppe
= proto_register_protocol_in_name_only("Microsoft PPE/PPC", "Microsoft PPE/PPC", "ccp.opt.mppe", proto_ccp
, FT_BYTES
);
7652 proto_ccp_option_gfza
= proto_register_protocol_in_name_only("Gandalf FZA", "Gandalf FZA", "ccp.opt.gfza", proto_ccp
, FT_BYTES
);
7653 proto_ccp_option_v42bis
= proto_register_protocol_in_name_only("V.42bis compression", "V.42bis compression", "ccp.opt.v42bis", proto_ccp
, FT_BYTES
);
7654 proto_ccp_option_bsdcomp
= proto_register_protocol_in_name_only("BSD LZW Compress", "BSD LZW Compress", "ccp.opt.bsdcomp", proto_ccp
, FT_BYTES
);
7655 proto_ccp_option_lzsdcp
= proto_register_protocol_in_name_only("LZS-DCP", "LZS-DCP", "ccp.opt.lzsdcp", proto_ccp
, FT_BYTES
);
7656 proto_ccp_option_mvrca
= proto_register_protocol_in_name_only("MVRCA (Magnalink)", "MVRCA (Magnalink)", "ccp.opt.mvrca", proto_ccp
, FT_BYTES
);
7657 proto_ccp_option_dce
= proto_register_protocol_in_name_only("PPP for Data Compression in Data Circuit-Terminating Equipment (DCE)", "PPP for Data Compression in Data Circuit-Terminating Equipment (DCE)", "ccp.opt.dce", proto_ccp
, FT_BYTES
);
7658 proto_ccp_option_deflate
= proto_register_protocol_in_name_only("Deflate", "Deflate", "ccp.opt.deflate", proto_ccp
, FT_BYTES
);
7659 proto_ccp_option_v44lzjh
= proto_register_protocol_in_name_only("V.44/LZJH compression", "V.44/LZJH compression", "ccp.opt.v44lzjh", proto_ccp
, FT_BYTES
);
7663 proto_reg_handoff_ccp(void)
7665 dissector_add_uint("ppp.protocol", PPP_CCP
, ccp_handle
);
7668 * See above comment about NDISWAN for an explanation of why we're
7669 * registering with the "ethertype" dissector table.
7671 dissector_add_uint("ethertype", PPP_CCP
, ccp_handle
);
7673 dissector_add_uint("ccp.option", CI_CCP_OUI
, create_dissector_handle( dissect_ccp_oui_opt
, proto_ccp_option_oui
));
7674 dissector_add_uint("ccp.option", CI_CCP_PREDICT1
, create_dissector_handle( dissect_ccp_predict1_opt
, proto_ccp_option_predict1
));
7675 dissector_add_uint("ccp.option", CI_CCP_PREDICT2
, create_dissector_handle( dissect_ccp_predict2_opt
, proto_ccp_option_predict2
));
7676 dissector_add_uint("ccp.option", CI_CCP_PUDDLE
, create_dissector_handle( dissect_ccp_puddle_opt
, proto_ccp_option_puddle
));
7677 dissector_add_uint("ccp.option", CI_CCP_HPPPC
, create_dissector_handle( dissect_ccp_hpppc_opt
, proto_ccp_option_hpppc
));
7678 dissector_add_uint("ccp.option", CI_CCP_STAC
, create_dissector_handle( dissect_ccp_stac_opt
, proto_ccp_option_stac
));
7679 dissector_add_uint("ccp.option", CI_CCP_MPPE
, create_dissector_handle( dissect_ccp_mppe_opt
, proto_ccp_option_mppe
));
7680 dissector_add_uint("ccp.option", CI_CCP_GFZA
, create_dissector_handle( dissect_ccp_gfza_opt
, proto_ccp_option_gfza
));
7681 dissector_add_uint("ccp.option", CI_CCP_V42BIS
, create_dissector_handle( dissect_ccp_v42bis_opt
, proto_ccp_option_v42bis
));
7682 dissector_add_uint("ccp.option", CI_CCP_BSDLZW
, create_dissector_handle( dissect_ccp_bsdcomp_opt
, proto_ccp_option_bsdcomp
));
7683 dissector_add_uint("ccp.option", CI_CCP_LZSDCP
, create_dissector_handle( dissect_ccp_lzsdcp_opt
, proto_ccp_option_lzsdcp
));
7684 dissector_add_uint("ccp.option", CI_CCP_MVRCA
, create_dissector_handle( dissect_ccp_mvrca_opt
, proto_ccp_option_mvrca
));
7685 dissector_add_uint("ccp.option", CI_CCP_DCE
, create_dissector_handle( dissect_ccp_dce_opt
, proto_ccp_option_dce
));
7686 dissector_add_uint("ccp.option", CI_CCP_DEFLATE
, create_dissector_handle( dissect_ccp_deflate_opt
, proto_ccp_option_deflate
));
7687 dissector_add_uint("ccp.option", CI_CCP_V44LZJH
, create_dissector_handle( dissect_ccp_v44lzjh_opt
, proto_ccp_option_v44lzjh
));
7691 proto_register_cbcp(void)
7693 static hf_register_info hf
[] = {
7694 { &hf_cbcp_opt_type
, { "Type", "cbcp.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7695 { &hf_cbcp_opt_length
, { "Length", "cbcp.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7696 /* Generated from convert_proto_tree_add_text.pl */
7697 { &hf_cbcp_callback_delay
, { "Callback delay", "cbcp.callback_delay", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7698 { &hf_cbcp_address_type
, { "Address Type", "cbcp.address_type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7699 { &hf_cbcp_address
, { "Address", "cbcp.address", FT_STRINGZ
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7700 { &hf_cbcp_no_callback
, { "No callback", "cbcp.no_callback", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7703 static int *ett
[] = {
7706 &ett_cbcp_callback_opt
,
7707 &ett_cbcp_callback_opt_addr
,
7708 &ett_cbcp_no_callback
,
7709 &ett_cbcp_callback_user
,
7710 &ett_cbcp_callback_admin
,
7711 &ett_cbcp_callback_list
,
7714 static ei_register_info ei
[] = {
7715 { &ei_cbcp_address
, { "cbcp.address.malformed", PI_MALFORMED
, PI_ERROR
, "Address runs past end of option", EXPFILL
}},
7718 expert_module_t
* expert_cbcp
;
7720 proto_cbcp
= proto_register_protocol("PPP Callback Control Protocol", "PPP CBCP", "cbcp");
7721 cbcp_handle
= register_dissector("cbcp", dissect_cbcp
, proto_cbcp
);
7722 proto_register_field_array(proto_cbcp
, hf
, array_length(hf
));
7723 proto_register_subtree_array(ett
, array_length(ett
));
7724 expert_cbcp
= expert_register_protocol(proto_cbcp
);
7725 expert_register_field_array(expert_cbcp
, ei
, array_length(ei
));
7727 cbcp_option_table
= register_dissector_table("cbcp.option", "PPP CBCP Options", proto_cbcp
, FT_UINT8
, BASE_DEC
);
7729 /* Register CBCP options as their own protocols so we can get the name of the option */
7730 proto_cbcp_option_no_callback
= proto_register_protocol_in_name_only("No callback", "No callback", "cbcp.opt.no_callback", proto_cbcp
, FT_BYTES
);
7731 proto_cbcp_option_callback_user
= proto_register_protocol_in_name_only("Callback to a user-specified number", "Callback to a user-specified number", "cbcp.opt.callback_user", proto_cbcp
, FT_BYTES
);
7732 proto_cbcp_option_callback_admin
= proto_register_protocol_in_name_only("Callback to a pre-specified or admin-specified number", "Callback to a pre-specified or admin-specified number", "cbcp.opt.callback_admin", proto_cbcp
, FT_BYTES
);
7733 proto_cbcp_option_callback_list
= proto_register_protocol_in_name_only("Callback to any of a list of numbers", "Callback to any of a list of numbers", "cbcp.opt.callback_list", proto_cbcp
, FT_BYTES
);
7737 proto_reg_handoff_cbcp(void)
7739 dissector_add_uint("ppp.protocol", PPP_CBCP
, cbcp_handle
);
7742 * See above comment about NDISWAN for an explanation of why we're
7743 * registering with the "ethertype" dissector table.
7745 dissector_add_uint("ethertype", PPP_CBCP
, cbcp_handle
);
7747 dissector_add_uint("cbcp.option", CI_CBCP_NO_CALLBACK
, create_dissector_handle( dissect_cbcp_no_callback_opt
, proto_cbcp_option_no_callback
));
7748 dissector_add_uint("cbcp.option", CI_CBCP_CB_USER
, create_dissector_handle( dissect_cbcp_callback_user_opt
, proto_cbcp_option_callback_user
));
7749 dissector_add_uint("cbcp.option", CI_CBCP_CB_PRE
, create_dissector_handle( dissect_cbcp_callback_admin_opt
, proto_cbcp_option_callback_admin
));
7750 dissector_add_uint("cbcp.option", CI_CBCP_CB_ANY
, create_dissector_handle( dissect_cbcp_callback_list_opt
, proto_cbcp_option_callback_list
));
7754 proto_register_bacp(void)
7756 static hf_register_info hf
[] = {
7757 { &hf_bacp_opt_type
, { "Type", "bacp.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7758 { &hf_bacp_opt_length
, { "Length", "bacp.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7759 /* Generated from convert_proto_tree_add_text.pl */
7760 { &hf_bacp_magic_number
, { "Magic number", "bacp.magic_number", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7761 { &hf_bacp_link_speed
, { "Link Speed", "bacp.link_speed", FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_kbps
), 0x0, NULL
, HFILL
}},
7762 { &hf_bacp_link_type
, { "Link Type", "bacp.link_type", FT_UINT8
, BASE_DEC
, VALS(bap_link_type_vals
), 0x0, NULL
, HFILL
}},
7765 static int *ett
[] = {
7768 &ett_bacp_favored_peer_opt
7771 proto_bacp
= proto_register_protocol("PPP Bandwidth Allocation Control Protocol", "PPP BACP", "bacp");
7772 bacp_handle
= register_dissector("bacp", dissect_bacp
, proto_bacp
);
7773 proto_register_field_array(proto_bacp
, hf
, array_length(hf
));
7774 proto_register_subtree_array(ett
, array_length(ett
));
7776 bacp_option_table
= register_dissector_table("bacp.option", "PPP BACP Options", proto_bacp
, FT_UINT8
, BASE_DEC
);
7778 /* Register BACP options as their own protocols so we can get the name of the option */
7779 proto_bacp_option_favored_peer
= proto_register_protocol_in_name_only("Favored-Peer", "Favored-Peer", "bacp.opt.favored_peer", proto_bacp
, FT_BYTES
);
7783 proto_reg_handoff_bacp(void)
7785 dissector_add_uint("ppp.protocol", PPP_BACP
, bacp_handle
);
7788 * See above comment about NDISWAN for an explanation of why we're
7789 * registering with the "ethertype" dissector table.
7791 dissector_add_uint("ethertype", PPP_BACP
, bacp_handle
);
7793 dissector_add_uint("bacp.option", CI_BACP_FAVORED_PEER
, create_dissector_handle( dissect_bacp_favored_peer_opt
, proto_bacp_option_favored_peer
));
7797 proto_register_bap(void)
7799 static hf_register_info hf
[] = {
7800 { &hf_bap_opt_type
, { "Type", "bap.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7801 { &hf_bap_opt_length
, { "Length", "bap.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7802 /* Generated from convert_proto_tree_add_text.pl */
7803 { &hf_bap_sub_option_type
, { "Sub-Option Type", "bap.sub_option_type", FT_UINT8
, BASE_DEC
, VALS(bap_phone_delta_subopt_vals
), 0x0, NULL
, HFILL
}},
7804 { &hf_bap_sub_option_length
, { "Sub-Option Length", "bap.sub_option_length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7805 { &hf_bap_unique_digit
, { "Unique Digit", "bap.unique_digit", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7806 { &hf_bap_subscriber_number
, { "Subscriber Number", "bap.subscriber_number", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7807 { &hf_bap_phone_number_sub_address
, { "Phone Number Sub Address", "bap.phone_number_sub_address", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7808 { &hf_bap_unknown_option_data
, { "Unknown", "bap.unknown_option_data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7809 { &hf_bap_reason
, { "Reason", "bap.reason", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7810 { &hf_bap_link_discriminator
, { "Link Discriminator", "bap.link_discriminator", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7811 { &hf_bap_call_status
, { "Status", "bap.call_status", FT_UINT8
, BASE_HEX
|BASE_EXT_STRING
, &q931_cause_code_vals_ext
, 0x0, NULL
, HFILL
}},
7812 { &hf_bap_call_action
, { "Action", "bap.call_action", FT_UINT8
, BASE_HEX
, VALS(bap_call_status_opt_action_vals
), 0x0, NULL
, HFILL
}},
7813 { &hf_bap_type
, { "Type", "bap.type", FT_UINT8
, BASE_HEX
, VALS(bap_vals
), 0x0, NULL
, HFILL
}},
7814 { &hf_bap_identifier
, { "Identifier", "bap.identifier", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7815 { &hf_bap_length
, { "Length", "bap.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7816 { &hf_bap_response_code
, { "Response Code", "bap.response_code", FT_UINT8
, BASE_HEX
, VALS(bap_resp_code_vals
), 0x0, NULL
, HFILL
}},
7819 static int *ett
[] = {
7822 &ett_bap_link_type_opt
,
7823 &ett_bap_phone_delta_opt
,
7824 &ett_bap_phone_delta_subopt
,
7825 &ett_bap_call_status_opt
,
7826 &ett_bap_no_phone_opt
,
7827 &ett_bap_reason_opt
,
7828 &ett_bap_link_disc_opt
,
7831 static ei_register_info ei
[] = {
7832 { &ei_bap_sub_option_length
, { "bap.sub_option_length.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid length", EXPFILL
}},
7835 expert_module_t
* expert_bap
;
7837 proto_bap
= proto_register_protocol("PPP Bandwidth Allocation Protocol", "PPP BAP", "bap");
7838 bap_handle
= register_dissector("bap", dissect_bap
, proto_bap
);
7839 proto_register_field_array(proto_bap
, hf
, array_length(hf
));
7840 proto_register_subtree_array(ett
, array_length(ett
));
7841 expert_bap
= expert_register_protocol(proto_bap
);
7842 expert_register_field_array(expert_bap
, ei
, array_length(ei
));
7844 bap_option_table
= register_dissector_table("bap.option", "PPP BAP Options", proto_bap
, FT_UINT8
, BASE_DEC
);
7846 /* Register BAP options as their own protocols so we can get the name of the option */
7847 proto_bap_option_link_type
= proto_register_protocol_in_name_only("Link Type", "Link Type", "bap.opt.link_type", proto_bap
, FT_BYTES
);
7848 proto_bap_option_phone_delta
= proto_register_protocol_in_name_only("Phone Delta", "Phone Delta", "bap.opt.phone_delta", proto_bap
, FT_BYTES
);
7849 proto_bap_option_no_phone
= proto_register_protocol_in_name_only("No Phone Number Needed", "No Phone Number Needed", "bap.opt.no_phone", proto_bap
, FT_BYTES
);
7850 proto_bap_option_reason
= proto_register_protocol_in_name_only("Reason", "Reason", "bap.opt.reason", proto_bap
, FT_BYTES
);
7851 proto_bap_option_link_disc
= proto_register_protocol_in_name_only("Link Discriminator", "Link Discriminator", "bap.opt.link_disc", proto_bap
, FT_BYTES
);
7852 proto_bap_option_call_status
= proto_register_protocol_in_name_only("Call Status", "Call Status", "bap.opt.call_status", proto_bap
, FT_BYTES
);
7856 proto_reg_handoff_bap(void)
7858 dissector_add_uint("ppp.protocol", PPP_BAP
, bap_handle
);
7861 * See above comment about NDISWAN for an explanation of why we're
7862 * registering with the "ethertype" dissector table.
7864 dissector_add_uint("ethertype", PPP_BAP
, bap_handle
);
7866 dissector_add_uint("bap.option", CI_BAP_LINK_TYPE
, create_dissector_handle( dissect_bap_link_type_opt
, proto_bap_option_link_type
));
7867 dissector_add_uint("bap.option", CI_BAP_PHONE_DELTA
, create_dissector_handle( dissect_bap_phone_delta_opt
, proto_bap_option_phone_delta
));
7868 dissector_add_uint("bap.option", CI_BAP_NO_PHONE_NUM_NEEDED
, create_dissector_handle( dissect_bap_no_phone_opt
, proto_bap_option_no_phone
));
7869 dissector_add_uint("bap.option", CI_BAP_REASON
, create_dissector_handle( dissect_bap_reason_opt
, proto_bap_option_reason
));
7870 dissector_add_uint("bap.option", CI_BAP_LINK_DISC
, create_dissector_handle( dissect_bap_link_disc_opt
, proto_bap_option_link_disc
));
7871 dissector_add_uint("bap.option", CI_BAP_CALL_STATUS
, create_dissector_handle( dissect_bap_call_status_opt
, proto_bap_option_call_status
));
7875 proto_register_comp_data(void)
7877 #if 0 /* See dissect_comp_data() */
7878 static int *ett
[] = {
7883 proto_comp_data
= proto_register_protocol("PPP Compressed Datagram",
7884 "PPP Comp", "comp_data");
7885 comp_data_handle
= register_dissector("ppp_comp", dissect_comp_data
,
7888 proto_register_subtree_array(ett
, array_length(ett
));
7893 proto_reg_handoff_comp_data(void)
7895 dissector_add_uint("ppp.protocol", PPP_COMP
, comp_data_handle
);
7898 * See above comment about NDISWAN for an explanation of why we're
7899 * registering with the "ethertype" dissector table.
7901 dissector_add_uint("ethertype", PPP_COMP
, comp_data_handle
);
7905 proto_register_pap(void)
7907 static int *ett
[] = {
7912 static hf_register_info hf
[] = {
7914 { "Code", "pap.code", FT_UINT8
, BASE_DEC
, VALS(pap_vals
), 0x0,
7915 "The Code field is one octet and identifies the type of PAP "
7917 { &hf_pap_identifier
,
7918 { "Identifier", "pap.identifier", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7919 "The Identifier field is one octet and aids in matching "
7920 "requests and replies.", HFILL
}},
7922 { "Length", "pap.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7923 "The Length field is two octets and indicates the length of "
7924 "the PAP packet", HFILL
}},
7926 { "Data", "pap.data", FT_NONE
, BASE_NONE
, NULL
, 0x0,
7927 "The format of the Data field is determined by the Code field",
7929 { &hf_pap_peer_id_length
,
7930 { "Peer-ID-Length", "pap.peer_id.length",
7931 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7932 "The Peer-ID-Length field is one octet and indicates the "
7933 "length of the Peer-ID field", HFILL
}},
7935 { "Peer-ID", "pap.peer_id", FT_STRING
, BASE_NONE
, NULL
, 0x0,
7936 "The Peer-ID field is zero or more octets and indicates the "
7937 "name of the peer to be authenticated", HFILL
}},
7938 { &hf_pap_password_length
,
7939 { "Password-Length", "pap.password.length",
7940 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7941 "The Password-Length field is one octet and indicates the "
7942 "length of the Password field", HFILL
}},
7944 { "Password", "pap.password", FT_STRING
, BASE_NONE
, NULL
, 0x0,
7945 "The Password field is zero or more octets and indicates the "
7946 "password to be used for authentication", HFILL
}},
7947 { &hf_pap_message_length
,
7948 { "Message-Length", "pap.message.length",
7949 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7950 "The Message-Length field is one octet and indicates the "
7951 "length of the Message field", HFILL
}},
7953 { "Message", "pap.message", FT_STRING
, BASE_NONE
, NULL
, 0x0,
7954 "The Message field is zero or more octets, and its contents "
7955 "are implementation dependent.", HFILL
}},
7957 { "stuff", "pap.stuff", FT_BYTES
, BASE_NONE
,
7958 NULL
, 0x0, NULL
, HFILL
}}
7961 proto_pap
= proto_register_protocol("PPP Password Authentication Protocol",
7963 pap_handle
= register_dissector("pap", dissect_pap
, proto_pap
);
7964 proto_register_field_array(proto_pap
, hf
, array_length(hf
));
7965 proto_register_subtree_array(ett
, array_length(ett
));
7969 proto_reg_handoff_pap(void)
7971 dissector_add_uint("ppp.protocol", PPP_PAP
, pap_handle
);
7974 * See above comment about NDISWAN for an explanation of why we're
7975 * registering with the "ethertype" dissector table.
7977 dissector_add_uint("ethertype", PPP_PAP
, pap_handle
);
7980 * for GSM-A / MobileL3 / GPRS SM / PCO
7982 dissector_add_uint("sm_pco.protocol", PPP_PAP
, pap_handle
);
7986 proto_register_chap(void)
7988 static int *ett
[] = {
7993 static hf_register_info hf
[] = {
7995 { "Code", "chap.code", FT_UINT8
, BASE_DEC
, VALS(chap_vals
), 0x0,
7996 "CHAP code", HFILL
}},
7997 { &hf_chap_identifier
,
7998 { "Identifier", "chap.identifier", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7999 "CHAP identifier", HFILL
}},
8001 { "Length", "chap.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
8002 "CHAP length", HFILL
}},
8004 { "Data", "chap.data", FT_NONE
, BASE_NONE
, NULL
, 0x0,
8005 "CHAP Data", HFILL
}},
8006 { &hf_chap_value_size
,
8007 { "Value Size", "chap.value_size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
8008 "CHAP value size", HFILL
}},
8010 { "Value", "chap.value", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
8011 "CHAP value data", HFILL
}},
8013 { "Name", "chap.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
8014 "CHAP name", HFILL
}},
8016 { "Message", "chap.message", FT_STRING
, BASE_NONE
, NULL
, 0x0,
8017 "CHAP message", HFILL
}},
8019 { "Stuff", "chap.stuff", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
8023 proto_chap
= proto_register_protocol("PPP Challenge Handshake Authentication Protocol", "PPP CHAP", "chap");
8024 chap_handle
= register_dissector("chap", dissect_chap
,
8026 proto_register_field_array(proto_chap
, hf
, array_length(hf
));
8027 proto_register_subtree_array(ett
, array_length(ett
));
8031 proto_reg_handoff_chap(void)
8033 dissector_add_uint("ppp.protocol", PPP_CHAP
, chap_handle
);
8036 * See above comment about NDISWAN for an explanation of why we're
8037 * registering with the "ethertype" dissector table.
8039 dissector_add_uint("ethertype", PPP_CHAP
, chap_handle
);
8042 * for GSM-A / MobileL3 / GPRS SM / PCO
8044 dissector_add_uint("sm_pco.protocol", PPP_CHAP
, chap_handle
);
8048 proto_register_pppmuxcp(void)
8050 static hf_register_info hf
[] = {
8051 { &hf_pppmux_flags_pid
,
8052 { "PID", "pppmuxcp.flags.pid", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
8054 { &hf_pppmux_flags_field_length
,
8055 { "Length field", "pppmuxcp.flags.field_length", FT_BOOLEAN
, 8, TFS(&tfs_pppmux_length_field
), 0x40,
8057 { &hf_pppmuxcp_opt_type
,
8058 { "Type", "pppmuxcp.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
8060 { &hf_pppmuxcp_opt_length
,
8061 { "Length", "pppmuxcp.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
8064 /* Generated from convert_proto_tree_add_text.pl */
8065 { &hf_pppmux_flags
, { "PFF/LXT", "pppmuxcp.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
8066 { &hf_pppmux_sub_frame_length
, { "Sub-frame Length", "pppmuxcp.sub_frame_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
8067 { &hf_pppmux_def_prot_id
, { "Default Protocol ID", "pppmuxcp.def_prot_id", FT_UINT16
, BASE_HEX
|BASE_EXT_STRING
, &ppp_vals_ext
, 0x0, NULL
, HFILL
}},
8070 static int *ett
[] = {
8072 &ett_pppmuxcp_options
,
8073 &ett_pppmuxcp_def_pid_opt
8076 proto_pppmuxcp
= proto_register_protocol("PPPMux Control Protocol", "PPP PPPMuxCP", "pppmuxcp");
8077 muxcp_handle
= register_dissector("pppmuxcp", dissect_pppmuxcp
, proto_pppmuxcp
);
8078 proto_register_field_array(proto_pppmuxcp
, hf
, array_length(hf
));
8079 proto_register_subtree_array(ett
, array_length(ett
));
8081 pppmuxcp_option_table
= register_dissector_table("pppmuxcp.option", "PPP PPPMuxCP Options", proto_pppmuxcp
, FT_UINT8
, BASE_DEC
);
8083 /* Register PPPMuxCP options as their own protocols so we can get the name of the option */
8084 proto_pppmuxcp_option_def_pid
= proto_register_protocol_in_name_only("Default Protocol ID", "Default Protocol ID", "pppmuxcp.opt.def_pid", proto_pppmuxcp
, FT_BYTES
);
8089 proto_reg_handoff_pppmuxcp(void)
8091 dissector_add_uint("ppp.protocol", PPP_MUXCP
, muxcp_handle
);
8094 * See above comment about NDISWAN for an explanation of why we're
8095 * registering with the "ethertype" dissector table.
8097 dissector_add_uint("ethertype", PPP_MUXCP
, muxcp_handle
);
8099 dissector_add_uint("pppmuxcp.option", CI_DEFAULT_PID
, create_dissector_handle( dissect_pppmuxcp_def_pid_opt
, proto_pppmuxcp_option_def_pid
));
8104 proto_register_pppmux(void)
8106 static hf_register_info hf
[] = {
8107 { &hf_pppmux_protocol
,
8108 { "Protocol", "pppmux.protocol", FT_UINT16
,
8109 BASE_HEX
|BASE_EXT_STRING
, &ppp_vals_ext
, 0x0,
8110 "The protocol of the sub-frame.", HFILL
}}
8113 static int *ett
[] = {
8115 &ett_pppmux_subframe
,
8116 &ett_pppmux_subframe_hdr
,
8117 &ett_pppmux_subframe_flags
,
8118 &ett_pppmux_subframe_info
8121 proto_pppmux
= proto_register_protocol("PPP Multiplexing", "PPP PPPMux",
8123 pppmux_handle
= register_dissector("pppmux", dissect_pppmux
, proto_pppmux
);
8124 proto_register_field_array(proto_pppmux
, hf
, array_length(hf
));
8125 proto_register_subtree_array(ett
, array_length(ett
));
8129 proto_reg_handoff_pppmux(void)
8131 dissector_add_uint("ppp.protocol", PPP_MUX
, pppmux_handle
);
8134 * See above comment about NDISWAN for an explanation of why we're
8135 * registering with the "ethertype" dissector table.
8137 dissector_add_uint("ethertype", PPP_MUX
, pppmux_handle
);
8141 proto_register_mplscp(void)
8143 static int *ett
[] = {
8148 proto_mplscp
= proto_register_protocol("PPP MPLS Control Protocol",
8149 "PPP MPLSCP", "mplscp");
8150 mplscp_handle
= register_dissector("mplscp", dissect_mplscp
, proto_mplscp
);
8151 proto_register_subtree_array(ett
, array_length(ett
));
8155 proto_reg_handoff_mplscp(void)
8157 dissector_add_uint("ppp.protocol", PPP_MPLSCP
, mplscp_handle
);
8160 * See above comment about NDISWAN for an explanation of why we're
8161 * registering with the "ethertype" dissector table.
8163 dissector_add_uint("ethertype", PPP_MPLSCP
, mplscp_handle
);
8167 proto_register_cdpcp(void)
8169 static int *ett
[] = {
8174 proto_cdpcp
= proto_register_protocol("PPP CDP Control Protocol",
8175 "PPP CDPCP", "cdpcp");
8176 cdpcp_handle
= register_dissector("cdpcp", dissect_cdpcp
, proto_cdpcp
);
8177 proto_register_subtree_array(ett
, array_length(ett
));
8181 proto_reg_handoff_cdpcp(void)
8183 dissector_add_uint("ppp.protocol", PPP_CDPCP
, cdpcp_handle
);
8186 * See above comment about NDISWAN for an explanation of why we're
8187 * registering with the "ethertype" dissector table.
8189 dissector_add_uint("ethertype", PPP_CDPCP
, cdpcp_handle
);
8193 proto_register_ipv6cp(void)
8195 static hf_register_info hf
[] = {
8196 { &hf_ipv6cp_opt_type
, { "Type", "ipv6cp.opt.type", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
8197 { &hf_ipv6cp_opt_length
, { "Length", "ipv6cp.opt.length", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
8198 /* Generated from convert_proto_tree_add_text.pl */
8199 { &hf_ipv6cp_interface_identifier
, { "Interface Identifier", "ipv6cp.interface_identifier", FT_BYTES
, SEP_COLON
, NULL
, 0x0, NULL
, HFILL
}},
8201 static int *ett
[] = {
8203 &ett_ipv6cp_options
,
8204 &ett_ipv6cp_if_id_opt
,
8205 &ett_ipv6cp_compress_opt
8208 proto_ipv6cp
= proto_register_protocol("PPP IPv6 Control Protocol", "PPP IPV6CP", "ipv6cp");
8209 ipv6cp_handle
= register_dissector("ipv6cp", dissect_ipv6cp
, proto_ipv6cp
);
8210 proto_register_field_array(proto_ipv6cp
, hf
, array_length(hf
));
8211 proto_register_subtree_array(ett
, array_length(ett
));
8213 ipv6cp_option_table
= register_dissector_table("ipv6cp.option", "PPP IPV6CP Options", proto_ipv6cp
, FT_UINT8
, BASE_DEC
);
8215 /* Register IPV6CP options as their own protocols so we can get the name of the option */
8216 proto_ipv6cp_option_if_id
= proto_register_protocol_in_name_only("Interface Identifier", "Interface Identifier", "ipv6cp.opt.interface_identifier", proto_ipv6cp
, FT_BYTES
);
8217 proto_ipv6cp_option_compress
= proto_register_protocol_in_name_only("IPv6 compression", "IPv6 compression", "ipv6cp.opt.compress", proto_ipv6cp
, FT_BYTES
);
8221 proto_reg_handoff_ipv6cp(void)
8223 dissector_add_uint("ppp.protocol", PPP_IPV6CP
, ipv6cp_handle
);
8226 * See above comment about NDISWAN for an explanation of why we're
8227 * registering with the "ethertype" dissector table.
8229 dissector_add_uint("ethertype", PPP_IPV6CP
, ipv6cp_handle
);
8232 * for GSM-A / MobileL3 / GPRS SM / PCO
8234 dissector_add_uint("sm_pco.protocol", PPP_IPV6CP
, ipv6cp_handle
);
8236 dissector_add_uint("ipv6cp.option", CI_IPV6CP_IF_ID
, create_dissector_handle( dissect_ipv6cp_if_id_opt
, proto_ipv6cp_option_if_id
));
8237 dissector_add_uint("ipv6cp.option", CI_COMPRESS_PROTO
, create_dissector_handle( dissect_ipcp_compress_opt
, proto_ipv6cp_option_compress
));
8241 proto_register_iphc_crtp(void)
8243 static hf_register_info hf
[] = {
8244 { &hf_iphc_crtp_cid16
,
8245 { "Context Id", "crtp.cid", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
8246 "The context identifier of the compressed packet.", HFILL
}},
8247 { &hf_iphc_crtp_cid8
,
8248 { "Context Id", "crtp.cid", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
8249 "The context identifier of the compressed packet.", HFILL
}},
8250 { &hf_iphc_crtp_gen
,
8251 { "Generation", "crtp.gen", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
8252 "The generation of the compressed packet.", HFILL
}},
8253 { &hf_iphc_crtp_seq
,
8254 { "Sequence (Data)", "crtp.seq", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
8255 "The sequence of the compressed packet.", HFILL
}},
8256 { &hf_iphc_crtp_fh_flags
,
8257 { "Flags", "crtp.fh_flags", FT_UINT8
, BASE_HEX
, NULL
,
8258 IPHC_CRTP_FH_FLAG_MASK
,
8259 "The flags of the full header packet.", HFILL
}},
8260 { &hf_iphc_crtp_fh_cidlenflag
,
8261 { "CID Length", "crtp.fh_flags.cidlen", FT_BOOLEAN
, 8, TFS(&iphc_crtp_fh_cidlenflag
),
8262 IPHC_CRTP_FH_CIDLEN_FLAG
, "A flag which is not set for 8-bit Context Ids and set for 16-bit Context Ids.", HFILL
}},
8263 { &hf_iphc_crtp_fh_dataflag
,
8264 { "Sequence (Data)", "crtp.fh_flags.data", FT_BOOLEAN
, 8,
8265 TFS(&tfs_present_absent
), IPHC_CRTP_FH_DATA_FLAG
,
8266 "This indicates the presence of a nonzero data field, usually meaning the low nibble is a sequence number.", HFILL
}},
8267 { &hf_iphc_crtp_cs_flags
,
8268 { "Flags", "crtp.cs_flags", FT_UINT8
, BASE_DEC
, VALS(iphc_crtp_cs_flags
),
8269 0x0, "The flags of the context state packet.", HFILL
}},
8270 { &hf_iphc_crtp_cs_cnt
,
8271 { "Count", "crtp.cnt", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
8272 "The count of the context state packet.", HFILL
}},
8273 { &hf_iphc_crtp_cs_invalid
,
8274 { "Invalid", "crtp.invalid", FT_BOOLEAN
, 8, NULL
, 0x80,
8275 "The invalid bit of the context state packet.", HFILL
}},
8276 { &hf_iphc_crtp_ip_id
,
8277 { "IP-ID", "crtp.ip-id", FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0,
8278 "The IPv4 Identification Field is RANDOM and thus included in a compressed Non TCP packet (RFC 2507 6a, 7.13a). Only IPv4 is supported in this dissector.", HFILL
}},
8279 { &hf_iphc_crtp_data
,
8280 { "Data", "crtp.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
8284 static int *ett
[] = {
8287 &ett_iphc_crtp_info
,
8288 &ett_iphc_crtp_fh_flags
8291 static ei_register_info ei
[] = {
8292 { &ei_iphc_crtp_ip_version
, { "crtp.ip_version_unsupported", PI_PROTOCOL
, PI_WARN
, "IP version is unsupported", EXPFILL
}},
8293 { &ei_iphc_crtp_next_protocol
, { "crtp.next_protocol_unsupported", PI_PROTOCOL
, PI_WARN
, "Next protocol is unsupported", EXPFILL
}},
8294 { &ei_iphc_crtp_seq_nonzero
, { "crtp.seq_nonzero", PI_PROTOCOL
, PI_WARN
, "Sequence (Data) field is nonzero despite D bit not set", EXPFILL
}}
8297 expert_module_t
* expert_iphc_crtp
;
8299 proto_iphc_crtp
= proto_register_protocol("CRTP", "CRTP", "crtp");
8300 fh_handle
= register_dissector("crtp", dissect_iphc_crtp_fh
, proto_iphc_crtp
);
8301 /* Created to remove Decode As confusion */
8302 proto_iphc_crtp_cudp16
= proto_register_protocol_in_name_only("CRTP (CUDP 16)", "CRTP (CUDP 16)", "crtp_cudp16", proto_iphc_crtp
, FT_PROTOCOL
);
8303 cudp16_handle
= register_dissector("crtp_cudp16", dissect_iphc_crtp_cudp16
, proto_iphc_crtp_cudp16
);
8304 proto_iphc_crtp_cudp8
= proto_register_protocol_in_name_only("CRTP (CUDP 8)", "CRTP (CUDP 8)", "crtp_cudp8", proto_iphc_crtp
, FT_PROTOCOL
);
8305 cudp8_handle
= register_dissector("crtp_cudp8", dissect_iphc_crtp_cudp8
, proto_iphc_crtp_cudp8
);
8306 proto_iphc_crtp_cs
= proto_register_protocol_in_name_only("CRTP (CS)", "CRTP (CS)", "crtp_cs", proto_iphc_crtp
, FT_PROTOCOL
);
8307 cs_handle
= register_dissector("crtp_cs", dissect_iphc_crtp_cs
, proto_iphc_crtp_cs
);
8308 proto_iphc_crtp_cntcp
= proto_register_protocol_in_name_only("CRTP (CNTCP)", "CRTP (CNTCP)", "crtp_cntcp", proto_iphc_crtp
, FT_PROTOCOL
);
8309 cntcp_handle
= register_dissector("crtp_cntcp", dissect_iphc_crtp_cntcp
, proto_iphc_crtp_cntcp
);
8311 proto_register_field_array(proto_iphc_crtp
, hf
, array_length(hf
));
8312 proto_register_subtree_array(ett
, array_length(ett
));
8313 expert_iphc_crtp
= expert_register_protocol(proto_iphc_crtp
);
8314 expert_register_field_array(expert_iphc_crtp
, ei
, array_length(ei
));
8318 proto_reg_handoff_iphc_crtp(void)
8320 dissector_add_uint("ppp.protocol", PPP_RTP_FH
, fh_handle
);
8321 dissector_add_uint("ppp.protocol", PPP_RTP_CUDP16
, cudp16_handle
);
8322 dissector_add_uint("ppp.protocol", PPP_RTP_CUDP8
, cudp8_handle
);
8323 dissector_add_uint("ppp.protocol", PPP_RTP_CS
, cs_handle
);
8324 dissector_add_uint("ppp.protocol", PPP_RTP_CNTCP
, cntcp_handle
);
8327 * See above comment about NDISWAN for an explanation of why we're
8328 * registering with the "ethertype" dissector table.
8330 dissector_add_uint("ethertype", PPP_RTP_FH
, fh_handle
);
8331 dissector_add_uint("ethertype", PPP_RTP_CUDP16
, cudp16_handle
);
8332 dissector_add_uint("ethertype", PPP_RTP_CUDP8
, cudp8_handle
);
8333 dissector_add_uint("ethertype", PPP_RTP_CS
, cs_handle
);
8334 dissector_add_uint("ethertype", PPP_RTP_CNTCP
, cntcp_handle
);
8338 * Editor modelines - https://www.wireshark.org/tools/modelines.html
8343 * indent-tabs-mode: nil
8346 * vi: set shiftwidth=4 tabstop=8 expandtab:
8347 * :indentSize=4:tabSize=8:noTabs=true: