2 * Routines for Layer Two Tunnelling Protocol (L2TP) packet disassembly
3 * John Thomes <john@ensemblecom.com>
5 * Minor changes by: (2000-01-10)
6 * Laurent Cazalet <laurent.cazalet@mailclub.net>
7 * Thomas Parvais <thomas.parvais@advalvas.be>
9 * Added RFC 5515 by Uli Heilmeier <uh@heilmeier.eu>, 2016-02-29
11 * Ericsson L2TP by Harald Welte <laforge@gnumonks.org>, 2016-07-16
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
17 * SPDX-License-Identifier: GPL-2.0-or-later
22 * https://tools.ietf.org/html/rfc2661
25 * https://tools.ietf.org/html/rfc3931
27 * Layer Two Tunneling Protocol "L2TP" number assignments:
28 * http://www.iana.org/assignments/l2tp-parameters
32 * RFC 4591 for Frame Relay
33 * https://tools.ietf.org/html/rfc4591
36 * https://tools.ietf.org/html/rfc4454
38 * RFC 4719 for Ethernet
39 * https://tools.ietf.org/html/rfc4719
42 * https://tools.ietf.org/html/rfc4349
44 * XXX - what about LAPD?
49 #include <epan/packet.h>
50 #include <epan/ipproto.h>
51 #include <epan/sminmpec.h>
52 #include <epan/addr_resolv.h>
53 #include <epan/prefs.h>
54 #include <epan/conversation.h>
55 #include <epan/expert.h>
56 #include <epan/decode_as.h>
57 #include <epan/proto_data.h>
59 #include <wsutil/array.h>
60 #include <wsutil/wsgcrypt.h>
62 #include "packet-l2tp.h"
64 void proto_register_l2tp(void);
65 void proto_reg_handoff_l2tp(void);
67 static int proto_l2tp
;
68 static int hf_l2tp_flags
;
69 static int hf_l2tp_type
;
70 static int hf_l2tp_length_bit
;
71 static int hf_l2tp_seq_bit
;
72 static int hf_l2tp_offset_bit
;
73 static int hf_l2tp_priority
;
74 static int hf_l2tp_version
;
75 static int hf_l2tp_length
;
76 static int hf_l2tp_tunnel
;
77 static int hf_l2tp_session
;
78 static int hf_l2tp_Ns
;
79 static int hf_l2tp_Nr
;
80 static int hf_l2tp_offset
;
81 static int hf_l2tp_avp_mandatory
;
82 static int hf_l2tp_avp_hidden
;
83 static int hf_l2tp_avp_length
;
84 static int hf_l2tp_avp_vendor_id
;
85 static int hf_l2tp_avp_type
;
86 static int hf_l2tp_tie_breaker
;
87 static int hf_l2tp_sid
;
88 static int hf_l2tp_res
;
89 static int hf_l2tp_ccid
;
90 static int hf_l2tp_cookie
;
91 static int hf_l2tp_l2_spec_def
;
92 static int hf_l2tp_l2_spec_atm
;
93 static int hf_l2tp_l2_spec_docsis_dmpt
;
94 static int hf_l2tp_l2_spec_v
;
95 static int hf_l2tp_l2_spec_s
;
96 static int hf_l2tp_l2_spec_h
;
97 static int hf_l2tp_l2_spec_flow_id
;
98 static int hf_l2tp_l2_spec_sequence
;
99 static int hf_l2tp_l2_spec_t
;
100 static int hf_l2tp_l2_spec_g
;
101 static int hf_l2tp_l2_spec_c
;
102 static int hf_l2tp_l2_spec_u
;
103 static int hf_l2tp_cisco_avp_type
;
104 static int hf_l2tp_ericsson_avp_type
;
105 static int hf_l2tp_broadband_avp_type
;
106 static int hf_l2tp_cablelabs_avp_type
;
107 static int hf_l2tp_avp_message_type
;
108 static int hf_l2tp_avp_assigned_tunnel_id
;
109 static int hf_l2tp_avp_assigned_control_conn_id
;
110 static int hf_l2tp_avp_assigned_session_id
;
111 static int hf_l2tp_avp_remote_session_id
;
112 static int hf_l2tp_avp_local_session_id
;
113 static int hf_l2tp_avp_called_number
;
114 static int hf_l2tp_avp_calling_number
;
115 static int hf_l2tp_cisco_tie_breaker
;
116 static int hf_l2tp_cablel_avp_l_bit
;
117 static int hf_l2tp_cablel_avp_tsid_group_id
;
118 static int hf_l2tp_cablel_avp_frequency
;
119 static int hf_l2tp_cablel_avp_modulation
;
120 static int hf_l2tp_cablel_avp_m
;
121 static int hf_l2tp_cablel_avp_n
;
122 static int hf_l2tp_broadband_agent_circuit_id
;
123 static int hf_l2tp_broadband_agent_remote_id
;
124 static int hf_l2tp_broadband_actual_dr_up
;
125 static int hf_l2tp_broadband_actual_dr_down
;
126 static int hf_l2tp_broadband_minimum_dr_up
;
127 static int hf_l2tp_broadband_minimum_dr_down
;
128 static int hf_l2tp_broadband_attainable_dr_up
;
129 static int hf_l2tp_broadband_attainable_dr_down
;
130 static int hf_l2tp_broadband_maximum_dr_up
;
131 static int hf_l2tp_broadband_maximum_dr_down
;
132 static int hf_l2tp_broadband_minimum_dr_up_low_power
;
133 static int hf_l2tp_broadband_minimum_dr_down_low_power
;
134 static int hf_l2tp_broadband_maximum_interleaving_delay_up
;
135 static int hf_l2tp_broadband_actual_interleaving_delay_up
;
136 static int hf_l2tp_broadband_maximum_interleaving_delay_down
;
137 static int hf_l2tp_broadband_actual_interleaving_delay_down
;
138 static int hf_l2tp_broadband_access_loop_encapsulation
;
139 static int hf_l2tp_broadband_access_loop_encapsulation_data_link
;
140 static int hf_l2tp_broadband_access_loop_encapsulation_enc1
;
141 static int hf_l2tp_broadband_access_loop_encapsulation_enc2
;
142 static int hf_l2tp_broadband_ancp_access_line_type
;
143 static int hf_l2tp_broadband_iwf_session
;
144 static int hf_l2tp_avp_csu
;
145 static int hf_l2tp_avp_csu_res
;
146 static int hf_l2tp_avp_csu_remote_session_id_v2
;
147 static int hf_l2tp_avp_csu_current_tx_speed_v2
;
148 static int hf_l2tp_avp_csu_current_rx_speed_v2
;
149 static int hf_l2tp_avp_csu_remote_session_id_v3
;
150 static int hf_l2tp_avp_csu_current_tx_speed_v3
;
151 static int hf_l2tp_avp_csu_current_rx_speed_v3
;
153 static int hf_l2tp_ericsson_msg_type
;
154 static int hf_l2tp_ericsson_conn_type
;
155 static int hf_l2tp_ericsson_stn_name
;
156 static int hf_l2tp_ericsson_crc32_enable
;
157 static int hf_l2tp_ericsson_abis_lower_mode
;
158 static int hf_l2tp_ericsson_tc_overl_thresh
;
159 static int hf_l2tp_ericsson_tc_num_groups
;
160 static int hf_l2tp_ericsson_tcg_group_id
;
161 static int hf_l2tp_ericsson_tcg_num_sapis
;
162 static int hf_l2tp_ericsson_tcg_sapi
;
163 static int hf_l2tp_ericsson_tcg_ip
;
164 static int hf_l2tp_ericsson_tcg_dscp
;
165 static int hf_l2tp_ericsson_tcg_crc32_enable
;
166 static int hf_l2tp_ericsson_tcg_bundling_tout
;
167 static int hf_l2tp_ericsson_tcg_bundling_max_pkt
;
168 static int hf_l2tp_ericsson_tc_num_maps
;
169 static int hf_l2tp_ericsson_map_tei_low
;
170 static int hf_l2tp_ericsson_map_tei_high
;
171 static int hf_l2tp_ericsson_map_sc
;
172 static int hf_l2tp_ericsson_ver_pref
;
173 static int hf_l2tp_ericsson_ver_2
;
174 static int hf_l2tp_ericsson_ver_3
;
176 /* Generated from convert_proto_tree_add_text.pl */
177 static int hf_l2tp_cisco_pw_type
;
178 static int hf_l2tp_avp_error_code
;
179 static int hf_l2tp_avp_cause_msg
;
180 static int hf_l2tp_avp_host_name
;
181 static int hf_l2tp_avp_maximum_bps
;
182 static int hf_l2tp_avp_pseudowire_type
;
183 static int hf_l2tp_avp_minimum_bps
;
184 static int hf_l2tp_avp_nonce
;
185 static int hf_l2tp_avp_circuit_status
;
186 static int hf_l2tp_avp_receive_window_size
;
187 static int hf_l2tp_avp_vendor_name
;
188 static int hf_l2tp_avp_layer2_specific_sublayer
;
189 static int hf_l2tp_avp_disconnect_code
;
190 static int hf_l2tp_cisco_circuit_status
;
191 static int hf_l2tp_cisco_remote_session_id
;
192 static int hf_l2tp_avp_router_id
;
193 static int hf_l2tp_avp_send_accm
;
194 static int hf_l2tp_avp_last_sent_lcp_confreq
;
195 static int hf_l2tp_avp_sync_framing_supported
;
196 static int hf_l2tp_cisco_assigned_control_connection_id
;
197 static int hf_l2tp_avp_sync_framing_type
;
198 static int hf_l2tp_avp_assigned_cookie
;
199 static int hf_l2tp_avp_time_out_errors
;
200 static int hf_l2tp_avp_sub_address
;
201 static int hf_l2tp_avp_connect_speed
;
202 static int hf_l2tp_avp_analog_access_supported
;
203 static int hf_l2tp_avp_private_group_id
;
204 static int hf_l2tp_avp_proxy_authen_response
;
205 static int hf_l2tp_avp_chap_challenge
;
206 static int hf_l2tp_avp_call_serial_number
;
207 static int hf_l2tp_avp_digital_access_supported
;
208 static int hf_l2tp_avp_physical_channel
;
209 static int hf_l2tp_avp_advisory_msg
;
210 static int hf_l2tp_avp_data_sequencing
;
211 static int hf_l2tp_avp_control_protocol_number
;
212 static int hf_l2tp_avp_error_message
;
213 static int hf_l2tp_avp_initial_received_lcp_confreq
;
214 static int hf_l2tp_avp_async_framing_supported
;
215 static int hf_l2tp_cisco_message_digest
;
216 static int hf_l2tp_avp_circuit_type
;
217 static int hf_l2tp_cisco_circuit_type
;
218 static int hf_l2tp_avp_proxy_authen_challenge
;
219 static int hf_l2tp_cisco_assigned_cookie
;
220 static int hf_l2tp_avp_receive_accm
;
221 static int hf_l2tp_stop_ccn_result_code
;
222 static int hf_l2tp_avp_proxy_authen_id
;
223 static int hf_l2tp_avp_digital_bearer_type
;
224 static int hf_l2tp_avp_rx_connect_speed
;
225 static int hf_l2tp_cisco_nonce
;
226 static int hf_l2tp_avp_chap_challenge_response
;
227 static int hf_l2tp_avp_cause_code
;
228 static int hf_l2tp_avp_protocol_revision
;
229 static int hf_l2tp_avp_alignment_errors
;
230 static int hf_l2tp_avp_last_received_lcp_confreq
;
231 static int hf_l2tp_avp_crc_errors
;
232 static int hf_l2tp_avp_random_vector
;
233 static int hf_l2tp_avp_preferred_language
;
234 static int hf_l2tp_cisco_interface_mtu
;
235 static int hf_l2tp_avp_async_framing_type
;
236 static int hf_l2tp_avp_pw_type
;
237 static int hf_l2tp_cisco_local_session_id
;
238 static int hf_l2tp_avp_hardware_overruns
;
239 static int hf_l2tp_avp_proxy_authen_type
;
240 static int hf_l2tp_cisco_draft_avp_version
;
241 static int hf_l2tp_avp_protocol_version
;
242 static int hf_l2tp_result_code
;
243 static int hf_l2tp_avp_buffer_overruns
;
244 static int hf_l2tp_avp_remote_end_id
;
245 static int hf_l2tp_cisco_pseudowire_type
;
246 static int hf_l2tp_avp_message_digest
;
247 static int hf_l2tp_avp_proxy_authen_name
;
248 static int hf_l2tp_avp_analog_bearer_type
;
249 static int hf_l2tp_avp_cause_code_direction
;
250 static int hf_l2tp_avp_firmware_revision
;
251 static int hf_l2tp_avp_cause_code_message
;
252 static int hf_l2tp_avp_framing_errors
;
253 static int hf_l2tp_cisco_remote_end_id
;
254 static int hf_l2tp_avp_tx_connect_speed_v3
;
255 static int hf_l2tp_avp_rx_connect_speed_v3
;
256 static int hf_l2tp_lapd_info
;
257 static int hf_l2tp_zero_length_body_message
;
258 static int hf_l2tp_offset_padding
;
260 static dissector_table_t l2tp_vendor_avp_dissector_table
;
261 static dissector_table_t pw_type_table
;
263 #define UDP_PORT_L2TP 1701
265 #define CONTROL_BIT(msg_info) (msg_info & 0x8000) /* Type bit control = 1 data = 0 */
266 #define LENGTH_BIT(msg_info) (msg_info & 0x4000) /* Length bit = 1 */
267 #define RESERVE_BITS(msg_info) (msg_info &0x37F8) /* Reserved bit - unused */
268 #define SEQUENCE_BIT(msg_info) (msg_info & 0x0800) /* SEQUENCE bit = 1 Ns and Nr fields */
269 #define OFFSET_BIT(msg_info) (msg_info & 0x0200) /* Offset */
270 #define PRIORITY_BIT(msg_info) (msg_info & 0x0100) /* Priority */
271 #define L2TP_VERSION(msg_info) (msg_info & 0x000f) /* Version of l2tp */
272 #define MANDATORY_BIT(msg_info) (msg_info & 0x8000) /* Mandatory = 1 */
273 #define HIDDEN_BIT(msg_info) (msg_info & 0x4000) /* Hidden = 1 */
274 #define AVP_LENGTH(msg_info) (msg_info & 0x03ff) /* AVP Length */
275 #define FRAMING_SYNC(msg_info) (msg_info & 0x0001) /* SYNC Framing Type */
276 #define FRAMING_ASYNC(msg_info) (msg_info & 0x0002) /* ASYNC Framing Type */
277 #define BEARER_DIGITAL(msg_info) (msg_info & 0x0001) /* Digital Bearer Type */
278 #define BEARER_ANALOG(msg_info) (msg_info & 0x0002) /* Analog Bearer Type */
279 #define CIRCUIT_STATUS_BIT(msg_info) (msg_info & 0x0001) /* Circuit Status */
280 #define CIRCUIT_TYPE_BIT(msg_info) (msg_info & 0x0001) /* Circuit Condition */
282 /* DOCSIS DMPT Sub-Layer Header definitions */
283 #define FLOW_ID_MASK 0x0E
286 static int ett_l2tp_flags
;
287 static int ett_l2tp_avp
;
288 static int ett_l2tp_avp_sub
;
289 static int ett_l2tp_ale_sub
;
290 static int ett_l2tp_lcp
;
291 static int ett_l2tp_l2_spec
;
292 static int ett_l2tp_csu
;
293 static int ett_l2tp_ericsson_tcg
;
294 static int ett_l2tp_ericsson_map
;
296 static expert_field ei_l2tp_incorrect_digest
;
297 /* Generated from convert_proto_tree_add_text.pl */
298 static expert_field ei_l2tp_vendor_specific_avp_data
;
299 static expert_field ei_l2tp_avp_length
;
301 static const enum_val_t l2tpv3_cookies
[] = {
302 {"detect", "Detect", -1},
303 {"cookie0", "None", 0},
304 {"cookie4", "4 Byte Cookie", 4},
305 {"cookie8", "8 Byte Cookie", 8},
309 #define L2TPv3_COOKIE_DEFAULT 0
311 #define L2TPv3_L2_SPECIFIC_NONE 0
312 #define L2TPv3_L2_SPECIFIC_DEFAULT 1
313 #define L2TPv3_L2_SPECIFIC_ATM 2
314 #define L2TPv3_L2_SPECIFIC_LAPD 3
315 #define L2TPv3_L2_SPECIFIC_DOCSIS_DMPT 4
316 #define L2TPv3_L2_SPECIFIC_MAX (L2TPv3_L2_SPECIFIC_DOCSIS_DMPT + 1)
318 static const enum_val_t l2tpv3_l2_specifics
[] = {
319 {"detect", "Detect", -1},
320 {"none", "None", L2TPv3_L2_SPECIFIC_NONE
},
321 {"default", "Default L2-Specific", L2TPv3_L2_SPECIFIC_DEFAULT
},
322 {"atm", "ATM-Specific", L2TPv3_L2_SPECIFIC_ATM
},
323 {"lapd", "LAPD-Specific", L2TPv3_L2_SPECIFIC_LAPD
},
324 {"dmpt", "DOCSIS DMPT-Specific", L2TPv3_L2_SPECIFIC_DOCSIS_DMPT
},
328 static int l2tpv3_cookie
= -1;
329 static int l2tpv3_l2_specific
= -1;
331 #define MESSAGE_TYPE_SCCRQ 1
332 #define MESSAGE_TYPE_SCCRP 2
333 #define MESSAGE_TYPE_SCCCN 3
334 #define MESSAGE_TYPE_StopCCN 4
335 #define MESSAGE_TYPE_Reserved_5 5
336 #define MESSAGE_TYPE_HELLO 6
337 #define MESSAGE_TYPE_OCRQ 7
338 #define MESSAGE_TYPE_OCRP 8
339 #define MESSAGE_TYPE_OCCN 9
340 #define MESSAGE_TYPE_ICRQ 10
341 #define MESSAGE_TYPE_ICRP 11
342 #define MESSAGE_TYPE_ICCN 12
343 #define MESSAGE_TYPE_Reserved_13 13
344 #define MESSAGE_TYPE_CDN 14
345 #define MESSAGE_TYPE_WEN 15
346 #define MESSAGE_TYPE_SLI 16
347 #define MESSAGE_TYPE_MDMST 17
348 #define MESSAGE_TYPE_SRRQ 18
349 #define MESSAGE_TYPE_SRRP 19
350 #define MESSAGE_TYPE_ACK 20
351 #define MESSAGE_TYPE_FSQ 21
352 #define MESSAGE_TYPE_FSR 22
353 #define MESSAGE_TYPE_MSRQ 23
354 #define MESSAGE_TYPE_MSRP 24
355 #define MESSAGE_TYPE_MSE 25
356 #define MESSAGE_TYPE_MSI 26
357 #define MESSAGE_TYPE_MSEN 27
358 #define MESSAGE_TYPE_CSUN 28
359 #define MESSAGE_TYPE_CSURQ 29
361 static const value_string message_type_vals
[] = {
362 { MESSAGE_TYPE_SCCRQ
, "Start_Control_Request" },
363 { MESSAGE_TYPE_SCCRP
, "Start_Control_Reply" },
364 { MESSAGE_TYPE_SCCCN
, "Start_Control_Connected" },
365 { MESSAGE_TYPE_StopCCN
, "Stop_Control_Notification" },
366 { MESSAGE_TYPE_Reserved_5
, "Reserved" },
367 { MESSAGE_TYPE_HELLO
, "Hello" },
368 { MESSAGE_TYPE_OCRQ
, "Outgoing_Call_Request" },
369 { MESSAGE_TYPE_OCRP
, "Outgoing_Call_Reply" },
370 { MESSAGE_TYPE_OCCN
, "Outgoing_Call_Connected" },
371 { MESSAGE_TYPE_ICRQ
, "Incoming_Call_Request" },
372 { MESSAGE_TYPE_ICRP
, "Incoming_Call_Reply" },
373 { MESSAGE_TYPE_ICCN
, "Incoming_Call_Connected" },
374 { MESSAGE_TYPE_Reserved_13
, "Reserved" },
375 { MESSAGE_TYPE_CDN
, "Call_Disconnect_Notification" },
376 { MESSAGE_TYPE_WEN
, "WAN_Error_Notify" },
377 { MESSAGE_TYPE_SLI
, "Set_Link_Info" },
378 { MESSAGE_TYPE_MDMST
, "Modem_Status" },
379 { MESSAGE_TYPE_SRRQ
, "Service_Relay_Request_Msg" },
380 { MESSAGE_TYPE_SRRP
, "Service_Relay_Reply_Message" },
381 { MESSAGE_TYPE_ACK
, "Explicit_Acknowledgement" },
382 /* Fail Over Extensions - RFC4951 */
383 { MESSAGE_TYPE_FSQ
, "Failover_Session_Query_Message" },
384 { MESSAGE_TYPE_FSR
, "Failover_Session_Response_Message" },
385 /* Multicast Management - RFC4045 */
386 { MESSAGE_TYPE_MSRQ
, "Multicast-Session-Request" },
387 { MESSAGE_TYPE_MSRP
, "Multicast-Session-Response" },
388 { MESSAGE_TYPE_MSE
, "Multicast-Session-Establishment" },
389 { MESSAGE_TYPE_MSI
, "Multicast-Session-Information" },
390 { MESSAGE_TYPE_MSEN
, "Multicast-Session-End-Notify" },
391 { MESSAGE_TYPE_CSUN
, "Connect-Speed-Update-Notification" },
392 { MESSAGE_TYPE_CSURQ
, "Connect-Speed-Update-Request" },
395 static value_string_ext message_type_vals_ext
= VALUE_STRING_EXT_INIT(message_type_vals
);
397 static const value_string l2tp_message_type_short_str_vals
[] = {
398 { MESSAGE_TYPE_SCCRQ
, "SCCRQ" },
399 { MESSAGE_TYPE_SCCRP
, "SCCRP" },
400 { MESSAGE_TYPE_SCCCN
, "SCCCN" },
401 { MESSAGE_TYPE_StopCCN
, "StopCCN" },
403 { MESSAGE_TYPE_HELLO
, "Hello" },
404 { MESSAGE_TYPE_OCRQ
, "OCRQ" },
405 { MESSAGE_TYPE_OCRP
, "OCRP" },
406 { MESSAGE_TYPE_OCCN
, "OCCN" },
407 { MESSAGE_TYPE_ICRQ
, "ICRQ" },
408 { MESSAGE_TYPE_ICRP
, "ICRP" },
409 { MESSAGE_TYPE_ICCN
, "ICCN" },
411 { MESSAGE_TYPE_CDN
, "CDN" },
412 { MESSAGE_TYPE_WEN
, "WEN" },
413 { MESSAGE_TYPE_SLI
, "SLI" },
414 { MESSAGE_TYPE_MDMST
, "MDMST" },
415 { MESSAGE_TYPE_SRRQ
, "SRRQ" },
416 { MESSAGE_TYPE_SRRP
, "SRRP" },
417 { MESSAGE_TYPE_ACK
, "ACK" },
418 /* Fail Over Extensions - RFC4951 */
419 { MESSAGE_TYPE_FSQ
, "FSQ" },
420 { MESSAGE_TYPE_FSR
, "FSR" },
421 /* Multicast Management - RFC4045 */
422 { MESSAGE_TYPE_MSRQ
, "MSRQ" },
423 { MESSAGE_TYPE_MSRP
, "MSRP" },
424 { MESSAGE_TYPE_MSE
, "MSE" },
425 { MESSAGE_TYPE_MSI
, "MSI" },
426 { MESSAGE_TYPE_MSEN
, "MSEN" },
427 { MESSAGE_TYPE_CSUN
, "CSUN" },
428 { MESSAGE_TYPE_CSURQ
, "CSURQ" },
431 static value_string_ext l2tp_message_type_short_str_vals_ext
= VALUE_STRING_EXT_INIT(l2tp_message_type_short_str_vals
);
434 static const char *control_msg
= "Control Message";
435 static const char *data_msg
= "Data Message";
436 static const value_string l2tp_type_vals
[] = {
437 { 0, "Data Message" },
438 { 1, "Control Message" },
442 static const value_string cause_code_direction_vals
[] = {
443 { 0, "global error" },
449 static const true_false_string l2tp_length_bit_truth
=
450 { "Length field is present", "Length field is not present" };
452 static const true_false_string l2tp_seq_bit_truth
=
453 { "Ns and Nr fields are present", "Ns and Nr fields are not present" };
455 static const true_false_string l2tp_offset_bit_truth
=
456 { "Offset Size field is present", "Offset size field is not present" };
458 static const true_false_string l2tp_priority_truth
=
459 { "This data message has priority", "No priority" };
461 static const value_string authen_type_vals
[] = {
463 { 1, "Textual username/password exchange" },
466 { 4, "No Authentication" },
467 { 5, "Microsoft CHAP Version 1" },
473 static const value_string data_sequencing_vals
[] = {
474 { 0, "No incoming data packets require sequencing" },
475 { 1, "Only non-IP data packets require sequencing" },
476 { 2, "All incoming data packets require sequencing" },
480 static const value_string l2_sublayer_vals
[] = {
481 { 0, "No L2-Specific Sublayer" },
482 { 1, "Default L2-Specific Sublayer present" },
483 { 2, "ATM-Specific Sublayer present" },
484 { 3, "MPT-Specific Sublayer" },
485 { 4, "PSP-Specific Sublayer" },
489 /* Result Code values for the StopCCN message */
490 static const value_string result_code_stopccn_vals
[] = {
492 { 1, "General request to clear control connection", },
493 { 2, "General error, Error Code indicates the problem", },
494 { 3, "Control connection already exists", },
495 { 4, "Requester is not authorized to establish a control connection", },
496 { 5, "The protocol version of the requester is not supported", },
497 { 6, "Requester is being shut down", },
498 { 7, "Finite state machine error or timeout", },
499 { 8, "Control connection due to mismatching CCDS value", }, /* [RFC3308] */
503 /* Result Code values for the CDN message */
504 static const value_string result_code_cdn_vals
[] = {
506 { 1, "Session disconnected due to loss of carrier or circuit disconnect", },
507 { 2, "Session disconnected for the reason indicated in Error Code", },
508 { 3, "Session disconnected for administrative reasons", },
509 { 4, "Appropriate facilities unavailable (temporary condition)", },
510 { 5, "Appropriate facilities unavailable (permanent condition)", },
511 { 6, "Invalid destination", },
512 { 7, "Call failed due to no carrier detected", },
513 { 8, "Call failed due to detection of a busy signal", },
514 { 9, "Call failed due to lack of a dial tone", },
515 { 10, "Call was not established within time allotted by LAC", },
516 { 11, "Call was connected but no appropriate framing was detected", },
517 { 12, "Disconnecting call due to mismatching SDS value", },
518 { 13, "Session not established due to losing tie breaker", },
519 { 14, "Session not established due to unsupported PW type", },
520 { 15, "Session not established, sequencing required without valid L2-Specific Sublayer", },
521 { 16, "Finite state machine error or timeout", },
522 { 17, "FR PVC was deleted permanently (no longer provisioned) ", }, /* [RFC4591] */
523 { 18, "FR PVC has been INACTIVE for an extended period of time", }, /* [RFC4591] */
524 { 19, "Mismatched FR Header Length", }, /* [RFC4591] */
525 { 20, "HDLC Link was deleted permanently (no longer provisioned)", }, /* [RFC4349] */
526 { 21, "HDLC Link has been INACTIVE for an extended period of time", }, /* [RFC4349] */
527 { 22, "Session not established due to other LCCE can not support the OAM Cell Emulation", }, /* [RFC4454] */
528 { 23, "Mismatching interface MTU", }, /* [RFC4667] */
529 { 24, "Attempt to connect to non-existent forwarder", }, /* [RFC4667] */
530 { 25, "Attempt to connect to unauthorized forwarder", }, /* [RFC4667] */
531 { 26, "Loop Detected", }, /* [draft-ietf-l2tpext-tunnel-switching-06.txt] */
532 { 27, "Attachment Circuit bound to different PE", }, /* [RFC6074] */
533 { 28, "Attachment Circuit bound to different remote Attachment Circuit", }, /* [RFC6074] */
534 { 29, "Unassigned", },
535 { 30, "Return code to indicate connection was refused because of TDM PW parameters. The error code indicates the problem.", }, /* [RFC5611] */
536 { 31, "Sequencing not supported", }, /* [RFC6073] */
539 static value_string_ext result_code_cdn_vals_ext
= VALUE_STRING_EXT_INIT(result_code_cdn_vals
);
542 static const value_string error_code_vals
[] = {
543 { 0, "No General Error", },
544 { 1, "No control connection exists yet for this pair of LCCEs", },
545 { 2, "Length is wrong", },
546 { 3, "One of the field values was out of range", },
547 { 4, "Insufficient resources to handle this operation now", },
548 { 5, "Invalid Session ID", },
549 { 6, "A generic vendor-specific error occurred", },
550 { 7, "Try another", },
551 { 8, "Receipt of an unknown AVP with the M bit set", },
552 { 9, "Try another directed", },
553 { 10, "Next hop unreachable", },
554 { 11, "Next hop busy", },
559 #define CONTROL_MESSAGE 0
560 #define RESULT_ERROR_CODE 1
561 #define PROTOCOL_VERSION 2
562 #define FRAMING_CAPABILITIES 3
563 #define BEARER_CAPABILITIES 4
564 #define TIE_BREAKER 5
565 #define FIRMWARE_REVISION 6
567 #define VENDOR_NAME 8
568 #define ASSIGNED_TUNNEL_ID 9
569 #define RECEIVE_WINDOW_SIZE 10
571 #define CAUSE_CODE 12
572 #define CHALLENGE_RESPONSE 13
573 #define ASSIGNED_SESSION 14
574 #define CALL_SERIAL_NUMBER 15
575 #define MINIMUM_BPS 16
576 #define MAXIMUM_BPS 17
577 #define BEARER_TYPE 18
578 #define FRAMING_TYPE 19
579 #define CALLED_NUMBER 21
580 #define CALLING_NUMBER 22
581 #define SUB_ADDRESS 23
582 #define TX_CONNECT_SPEED 24
583 #define PHYSICAL_CHANNEL 25
584 #define INITIAL_RECEIVED_LCP_CONFREQ 26
585 #define LAST_SENT_LCP_CONFREQ 27
586 #define LAST_RECEIVED_LCP_CONFREQ 28
587 #define PROXY_AUTHEN_TYPE 29
588 #define PROXY_AUTHEN_NAME 30
589 #define PROXY_AUTHEN_CHALLENGE 31
590 #define PROXY_AUTHEN_ID 32
591 #define PROXY_AUTHEN_RESPONSE 33
592 #define CALL_STATUS_AVPS 34
594 #define RANDOM_VECTOR 36
595 #define PRIVATE_GROUP_ID 37
596 #define RX_CONNECT_SPEED 38
597 #define SEQUENCING_REQUIRED 39
598 #define PPP_DISCONNECT_CAUSE_CODE 46 /* RFC 3145 */
599 #define EXTENDED_VENDOR_ID 58
600 #define MESSAGE_DIGEST 59
602 #define ASSIGNED_CONTROL_CONN_ID 61
603 #define PW_CAPABILITY_LIST 62
604 #define LOCAL_SESSION_ID 63
605 #define REMOTE_SESSION_ID 64
606 #define ASSIGNED_COOKIE 65
607 #define REMOTE_END_ID 66
609 #define L2_SPECIFIC_SUBLAYER 69
610 #define DATA_SEQUENCING 70
611 #define CIRCUIT_STATUS 71
612 #define PREFERRED_LANGUAGE 72
613 #define CTL_MSG_AUTH_NONCE 73
614 #define TX_CONNECT_SPEED_V3 74
615 #define RX_CONNECT_SPEED_V3 75
616 #define CONNECT_SPEED_UPDATE 97
618 /* http://www.iana.org/assignments/l2tp-parameters/l2tp-parameters.xhtml */
619 #define NUM_AVP_TYPES 102
620 static const value_string avp_type_vals
[] = {
621 { CONTROL_MESSAGE
, "Control Message" },
622 { RESULT_ERROR_CODE
, "Result-Error Code" },
623 { PROTOCOL_VERSION
, "Protocol Version" },
624 { FRAMING_CAPABILITIES
, "Framing Capabilities" },
625 { BEARER_CAPABILITIES
, "Bearer Capabilities" },
626 { TIE_BREAKER
, "Tie Breaker" },
627 { FIRMWARE_REVISION
, "Firmware Revision" },
628 { HOST_NAME
, "Host Name" },
629 { VENDOR_NAME
, "Vendor Name" },
630 { ASSIGNED_TUNNEL_ID
, "Assigned Tunnel ID" },
631 { RECEIVE_WINDOW_SIZE
, "Receive Window Size" },
632 { CHALLENGE
, "Challenge" },
633 { CAUSE_CODE
, "Cause Code" },
634 { CHALLENGE_RESPONSE
, "Challenge Response" },
635 { ASSIGNED_SESSION
, "Assigned Session" },
636 { CALL_SERIAL_NUMBER
, "Call Serial Number" },
637 { MINIMUM_BPS
, "Minimum BPS" },
638 { MAXIMUM_BPS
, "Maximum BPS" },
639 { BEARER_TYPE
, "Bearer Type" },
640 { FRAMING_TYPE
, "Framing Type" },
642 { CALLED_NUMBER
, "Called Number" },
643 { CALLING_NUMBER
, "Calling Number" },
644 { SUB_ADDRESS
, "Sub-Address" },
645 { TX_CONNECT_SPEED
, "Connect Speed" },
646 { PHYSICAL_CHANNEL
, "Physical Channel" },
647 { INITIAL_RECEIVED_LCP_CONFREQ
, "Initial Received LCP CONFREQ" },
648 { LAST_SENT_LCP_CONFREQ
, "Last Sent LCP CONFREQ" },
649 { LAST_RECEIVED_LCP_CONFREQ
, "Last Received LCP CONFREQ" },
650 { PROXY_AUTHEN_TYPE
, "Proxy Authen Type" },
651 { PROXY_AUTHEN_NAME
, "Proxy Authen Name" },
652 { PROXY_AUTHEN_CHALLENGE
, "Proxy Authen Challenge" },
653 { PROXY_AUTHEN_ID
, "Proxy Authen ID" },
654 { PROXY_AUTHEN_RESPONSE
, "Proxy Authen Response" },
655 { CALL_STATUS_AVPS
, "Call status AVPs" },
657 { RANDOM_VECTOR
, "Random Vector" },
658 { PRIVATE_GROUP_ID
, "Private group ID" },
659 { RX_CONNECT_SPEED
, "RxConnect Speed" },
660 { SEQUENCING_REQUIRED
, "Sequencing Required" },
661 { PPP_DISCONNECT_CAUSE_CODE
, "PPP Disconnect Cause Code" },
662 { EXTENDED_VENDOR_ID
, "Extended Vendor ID" },
663 { MESSAGE_DIGEST
, "Message Digest" },
664 { ROUTER_ID
, "Router ID" },
665 { ASSIGNED_CONTROL_CONN_ID
, "Assigned Control Connection ID" },
666 { PW_CAPABILITY_LIST
, "Pseudowire Capability List" },
667 { LOCAL_SESSION_ID
, "Local Session ID" },
668 { REMOTE_SESSION_ID
, "Remote Session ID" },
669 { ASSIGNED_COOKIE
, "Assigned Cookie" },
670 { REMOTE_END_ID
, "Remote End ID" },
671 { PW_TYPE
, "Pseudowire Type" },
672 { L2_SPECIFIC_SUBLAYER
, "Layer2 Specific Sublayer" },
673 { DATA_SEQUENCING
, "Data Sequencing" },
674 { CIRCUIT_STATUS
, "Circuit Status" },
675 { PREFERRED_LANGUAGE
, "Preferred Language" },
676 { CTL_MSG_AUTH_NONCE
, "Control Message Authentication Nonce" },
677 { TX_CONNECT_SPEED_V3
, "Tx Connect Speed Version 3" },
678 { RX_CONNECT_SPEED_V3
, "Rx Connect Speed Version 3" },
679 { 76, "Failover Capability" }, /*[RFC4951] */
680 { 77, "Tunnel Recovery" }, /*[RFC4951] */
681 { 78, "Suggested Control Sequence" }, /*[RFC4951] */
682 { 79, "Failover Session State" }, /*[RFC4951] */
683 { 80, "Multicast Capability" }, /*[RFC4045] */
684 { 81, "New Outgoing Sessions" }, /*[RFC4045] */
685 { 82, "New Outgoing Sessions Acknowledgement" }, /*[RFC4045] */
686 { 83, "Withdraw Outgoing Sessions" }, /*[RFC4045] */
687 { 84, "Multicast Packets Priority" }, /*[RFC4045] */
688 { 85, "Frame-Relay Header Length" }, /*[RFC4591] */
689 { 86, "ATM Maximum Concatenated Cells" }, /*[RFC4454] */
690 { 87, "OAM Emulation Required" }, /*[RFC4454] */
691 { 88, "ATM Alarm Status" }, /*[RFC4454] */
692 /* Also, see ATM Alarm Status AVP Values below */
693 { 89, "Attachment Group Identifier" }, /*[RFC4667] */
694 { 90, "Local End Identifier" }, /*[RFC4667] */
695 { 91, "Interface Maximum Transmission Unit" }, /*[RFC4667] */
696 { 92, "FCS Retention" }, /*[RFC4720] */
697 { 93, "Tunnel Switching Aggregator ID" }, /*[draft-ietf-l2tpext-tunnel-switching-06.txt] */
698 { 94, "Maximum Receive Unit (MRU)" }, /*[RFC4623] */
699 { 95, "Maximum Reassembled Receive Unit (MRRU)" }, /*[RFC4623] */
700 { 96, "VCCV Capability" }, /*[RFC5085] */
701 { CONNECT_SPEED_UPDATE
, "Connect Speed Update" }, /*[RFC5515] */
702 { 98, "Connect Speed Update Enable" }, /*[RFC5515] */
703 { 99, "TDM Pseudowire" }, /*[RFC5611] */
704 { 100, "RTP AVP" }, /*[RFC5611] */
705 { 101, "PW Switching Point" }, /*[RFC6073] */
709 static value_string_ext avp_type_vals_ext
= VALUE_STRING_EXT_INIT(avp_type_vals
);
712 #define CISCO_ASSIGNED_CONNECTION_ID 1
713 #define CISCO_PW_CAPABILITY_LIST 2
714 #define CISCO_LOCAL_SESSION_ID 3
715 #define CISCO_REMOTE_SESSION_ID 4
716 #define CISCO_ASSIGNED_COOKIE 5
717 #define CISCO_REMOTE_END_ID 6
718 #define CISCO_PW_TYPE 7
719 #define CISCO_CIRCUIT_STATUS 8
720 #define CISCO_SESSION_TIE_BREAKER 9
721 #define CISCO_DRAFT_AVP_VERSION 10
722 #define CISCO_MESSAGE_DIGEST 12
723 #define CISCO_AUTH_NONCE 13
724 #define CISCO_INTERFACE_MTU 14
726 static const value_string cisco_avp_type_vals
[] = {
727 { CISCO_ACK
, "Cisco ACK" },
728 { CISCO_ASSIGNED_CONNECTION_ID
, "Assigned Connection ID" },
729 { CISCO_PW_CAPABILITY_LIST
, "Pseudowire Capabilities List" },
730 { CISCO_LOCAL_SESSION_ID
, "Local Session ID" },
731 { CISCO_REMOTE_SESSION_ID
, "Remote Session ID" },
732 { CISCO_ASSIGNED_COOKIE
, "Assigned Cookie" },
733 { CISCO_REMOTE_END_ID
, "Remote End ID" },
734 { CISCO_PW_TYPE
, "Pseudowire Type" },
735 { CISCO_CIRCUIT_STATUS
, "Circuit Status" },
736 { CISCO_SESSION_TIE_BREAKER
, "Session Tie Breaker" },
737 { CISCO_DRAFT_AVP_VERSION
, "Draft AVP Version" },
738 { CISCO_MESSAGE_DIGEST
, "Message Digest" },
739 { CISCO_AUTH_NONCE
, "Control Message Authentication Nonce" },
740 { CISCO_INTERFACE_MTU
, "Interface MTU" },
744 #define ERICSSON_MSG_TYPE 0
745 #define ERICSSON_TRANSPORT_CONFIG 1
746 #define ERICSSON_PACKET_LOSS 2
747 #define ERICSSON_PROTO_VERSION 3
748 #define ERICSSON_CONN_TYPE 4
749 #define ERICSSON_CRC_ENABLED 5
750 #define ERICSSON_STN_NAME 6
751 #define ERICSSON_ABIS_LOWER_MODE 7
752 #define ERICSSON_TEI_TO_SC_MAP 8
753 #define ERICSSON_CHAN_STATUS_LIST 9
754 #define ERICSSON_EXT_PROTO_VERSION 10
755 #define ERICSSON_CHAN_STATUS_LIST2 11
757 static const value_string ericsson_avp_type_vals
[] = {
758 { ERICSSON_MSG_TYPE
, "Message Type" },
759 { ERICSSON_TRANSPORT_CONFIG
, "Transport Configuration" },
760 { ERICSSON_PACKET_LOSS
, "Packet Loss" },
761 { ERICSSON_PROTO_VERSION
, "Protocol Version" },
762 { ERICSSON_CONN_TYPE
, "Connection Type" },
763 { ERICSSON_STN_NAME
, "STN Name" },
764 { ERICSSON_CRC_ENABLED
, "CRC32 Enabled" },
765 { ERICSSON_ABIS_LOWER_MODE
, "Abis Lower Mode" },
766 { ERICSSON_TEI_TO_SC_MAP
, "TEI to SC Map" },
767 { ERICSSON_CHAN_STATUS_LIST
, "Channel Status List" },
768 { ERICSSON_EXT_PROTO_VERSION
, "Extended Protocol Version" },
769 { ERICSSON_CHAN_STATUS_LIST2
, "Channel Status List 2" },
773 static const value_string ericsson_msg_type_vals
[] = {
774 { 0, "Transport Configuration Notification" },
775 { 1, "Performance Notification" },
776 { 2, "Transport Configuration Request" },
777 { 3, "Transport Configuration Response" },
778 { 4, "Abis Lower Transport Config Request" },
779 { 5, "Abis Lower Transport Config Response" },
780 { 6, "Local Connect Channel Status Notification" },
784 static const value_string ericsson_short_msg_type_vals
[] = {
795 static const value_string ericsson_conn_type_vals
[] = {
801 static const value_string ericsson_abis_lower_mode_vals
[] = {
802 { 0, "Single Timeslot" },
803 { 1, "Super Channel" },
807 #define BROADBAND_AGENT_CIRCUIT_ID 1
808 #define BROADBAND_AGENT_REMOTE_ID 2
809 #define BROADBAND_ACTUAL_DR_UP 129
810 #define BROADBAND_ACTUAL_DR_DOWN 130
811 #define BROADBAND_MINIMUM_DR_UP 131
812 #define BROADBAND_MINIMUM_DR_DOWN 132
813 #define BROADBAND_ATTAINABLE_DR_UP 133
814 #define BROADBAND_ATTAINABLE_DR_DOWN 134
815 #define BROADBAND_MAXIMUM_DR_UP 135
816 #define BROADBAND_MAXIMUM_DR_DOWN 136
817 #define BROADBAND_MINIMUM_DR_UP_LOW_POWER 137
818 #define BROADBAND_MINIMUM_DR_DOWN_LOW_POWER 138
819 #define BROADBAND_MAXIMUM_INTERLEAVING_DELAY_UP 139
820 #define BROADBAND_ACTUAL_INTERLEAVING_DELAY_UP 140
821 #define BROADBAND_MAXIMUM_INTERLEAVING_DELAY_DOWN 141
822 #define BROADBAND_ACTUAL_INTERLEAVING_DELAY_DOWN 142
823 #define BROADBAND_ACCESS_LOOP_ENCAPSULATION 144
824 #define BROADBAND_ANCP_ACCESS_LINE_TYPE 145
825 #define BROADBAND_IWF_SESSION 254
827 static const value_string broadband_avp_type_vals
[] = {
828 { BROADBAND_AGENT_CIRCUIT_ID
, "Agent-Circuit-Id" },
829 { BROADBAND_AGENT_REMOTE_ID
, "Agent-Remote-Id" },
830 { BROADBAND_ACTUAL_DR_UP
, "Actual-Data-Rate-Upstream" },
831 { BROADBAND_ACTUAL_DR_DOWN
, "Actual-Data-Rate-Downstream" },
832 { BROADBAND_MINIMUM_DR_UP
, "Minimum-Data-Rate-Upstream" },
833 { BROADBAND_MINIMUM_DR_DOWN
, "Minimum-Data-Rate-Downstream" },
834 { BROADBAND_ATTAINABLE_DR_UP
, "Attainable-Data-Rate-Upstream" },
835 { BROADBAND_ATTAINABLE_DR_DOWN
, "Attainable-Data-Rate-Downstream" },
836 { BROADBAND_MAXIMUM_DR_UP
, "Maximum-Data-Rate-Upstream" },
837 { BROADBAND_MAXIMUM_DR_DOWN
, "Maximum-Data-Rate-Downstream" },
838 { BROADBAND_MINIMUM_DR_UP_LOW_POWER
, "Minimum-Data-Rate-Upstream-Low-Power" },
839 { BROADBAND_MINIMUM_DR_DOWN_LOW_POWER
, "Minimum-Data-Rate-Downstream-Low-Power" },
840 { BROADBAND_MAXIMUM_INTERLEAVING_DELAY_UP
, "Maximum-Interleaving-Delay-Upstream" },
841 { BROADBAND_ACTUAL_INTERLEAVING_DELAY_UP
, "Actual-Interleaving-Delay-Upstream" },
842 { BROADBAND_MAXIMUM_INTERLEAVING_DELAY_DOWN
, "Maximum-Interleaving-Delay-Downstream" },
843 { BROADBAND_ACTUAL_INTERLEAVING_DELAY_DOWN
, "Actual-Interleaving-Delay-Downstream" },
844 { BROADBAND_ACCESS_LOOP_ENCAPSULATION
, "Access-Loop-Encapsulation" },
845 { BROADBAND_ANCP_ACCESS_LINE_TYPE
, "ANCP Access Line Type" },
846 { BROADBAND_IWF_SESSION
, "IWF-Session" },
850 static const value_string cablelabs_avp_type_vals
[] = {
851 /* 7.5.2 DEPI Specific AVPs */
853 { 1, "DEPI Result Code" },
854 { 2, "DEPI Resource Allocation Request" },
855 { 3, "DEPI Resource Allocation Reply" },
856 { 4, "DEPI Local MTU" },
857 { 5, "DOCSIS SYNC Control" },
858 { 6, "EQAM Capability Bits" },
859 { 7, "DEPI Remote MTU" },
860 { 8, "DEPI Local UDP Port" },
861 { 9, "DPR Session Type" },
862 { 10, "DPR Session Status" },
863 /* 7.5.3 QAM Channel PHY AVPs */
864 { 100, "Downstream QAM Channel TSID Group" },
865 { 101, "Downstream QAM Channel Frequency" },
866 { 102, "Downstream QAM Channel Power" },
867 { 103, "Downstream QAM Channel Modulation" },
868 { 104, "Downstream QAM Channel J.83 Annex" },
869 { 105, "Downstream QAM Channel Symbol Rate" },
870 { 106, "Downstream QAM Channel Interleave Depth" },
871 { 107, "Downstream QAM Channel RF Block Muting53" },
872 /* 7.5.4 DEPI Redundancy Capabilities AVPs */
873 { 200, "DEPI Redundancy Capabilities" },
877 static const value_string l2tp_cablel_modulation_vals
[] = {
883 static const value_string pw_types_vals
[] = {
884 { L2TPv3_PW_FR
, "Frame Relay DLCI" },
885 { L2TPv3_PW_AAL5
, "ATM AAL5 SDU VCC transport" },
886 { L2TPv3_PW_ATM_PORT
, "ATM Cell transparent Port Mode" },
887 { L2TPv3_PW_ETH_VLAN
, "Ethernet VLAN" },
888 { L2TPv3_PW_ETH
, "Ethernet" },
889 { L2TPv3_PW_CHDLC
, "HDLC" },
890 { L2TPv3_PW_PPP
, "PPP" }, /* Currently unassigned */
891 { L2TPv3_PW_ATM_VCC
, "ATM Cell transport VCC Mode" },
892 { L2TPv3_PW_ATM_VPC
, "ATM Cell transport VPC Mode" },
893 { L2TPv3_PW_IP
, "IP Transport" }, /* Currently unassigned */
894 { L2TPv3_PW_DOCSIS_DMPT
, "MPEG-TS Payload Type (MPTPW)" },
895 { L2TPv3_PW_DOCSIS_PSP
, "Packet Streaming Protocol (PSPPW)" },
896 /* 0x000E-0x0010 Unassigned */
897 { L2TPv3_PW_E1
, "Structure-agnostic E1 circuit" }, /* [RFC5611] */
898 { L2TPv3_PW_T1
, "Structure-agnostic T1 (DS1) circuit" }, /* [RFC5611] */
899 { L2TPv3_PW_E3
, "Structure-agnostic E3 circuit" }, /* [RFC5611] */
900 { L2TPv3_PW_T3
, "Structure-agnostic T3 (DS3) circuit" }, /* [RFC5611] */
901 { L2TPv3_PW_CESOPSN
, "CESoPSN basic mode" }, /* [RFC5611] */
902 { 0x0016, "Unassigned" },
903 { L2TPv3_PW_CESOPSN_CAS
, "CESoPSN TDM with CAS" }, /* [RFC5611] */
908 static const value_string ale_datalink_types_vals
[] = {
909 { 0x00, "ATM AAL5" },
910 { 0x01, "Ethernet" },
914 static const value_string ale_enc1_types_vals
[] = {
915 { 0x00, "NA - Not Available" },
916 { 0x01, "Untagged Ethernet" },
917 { 0x02, "Single-Tagged Ethernet" },
921 static const value_string ale_enc2_types_vals
[] = {
922 { 0x00, "NA - Not Available" },
923 { 0x01, "PPPoA LLC" },
924 { 0x02, "PPPoA Null" },
925 { 0x03, "IP over ATM (IPoA) LLC" },
926 { 0x04, "IPoA Null" },
927 { 0x05, "Ethernet over AAL5 LLC with Frame Check Sequence (FCS)" },
928 { 0x06, "Ethernet over AAL5 LLC without FCS" },
929 { 0x07, "Ethernet over AAL5 Null with FCS" },
930 { 0x08, "Ethernet over AAL5 Null without FCS" },
934 static const value_string ancp_types_vals
[] = {
945 static const value_string iwf_types_vals
[] = {
946 { 0x00, "IWF not performed" },
947 { 0x01, "IWF performed" },
951 static const val64_string unique_indeterminable_or_no_link
[] = {
952 { 0, "indeterminable or no physical p2p link" },
956 static const true_false_string tfs_new_existing
= { "New", "Existing" };
958 static dissector_handle_t ppp_hdlc_handle
;
959 static dissector_handle_t ppp_lcp_options_handle
;
961 static dissector_handle_t atm_oam_handle
;
962 static dissector_handle_t llc_handle
;
964 static dissector_handle_t l2tp_udp_handle
;
965 static dissector_handle_t l2tp_ip_handle
;
966 static dissector_handle_t atm_oam_llc_handle
;
968 #define L2TP_HMAC_MD5 0
969 #define L2TP_HMAC_SHA1 1
971 typedef struct l2tpv3_conversation
{
977 struct l2tpv3_tunnel
*tunnel
;
978 } l2tpv3_conversation_t
;
980 typedef struct l2tpv3_tunnel
{
981 l2tpv3_conversation_t
*conv
;
985 uint8_t *lcce1_nonce
;
990 uint8_t *lcce2_nonce
;
993 char *shared_key_secret
;
994 uint8_t shared_key
[HASH_MD5_LENGTH
];
999 typedef struct lcce_settings
{
1005 typedef struct l2tpv3_session
{
1006 lcce_settings_t lcce1
;
1007 lcce_settings_t lcce2
;
1012 static const char* shared_secret
= "";
1014 static GSList
*list_heads
;
1016 static void update_shared_key(l2tpv3_tunnel_t
*tunnel
)
1018 const char *secret
= "";
1020 /* There is at least one nonce in the packet, so we can do authentication,
1021 otherwise it's just a plain digest without nonces. */
1022 if (tunnel
->lcce1_nonce
!= NULL
|| tunnel
->lcce2_nonce
!= NULL
) {
1023 secret
= shared_secret
;
1026 /* If there's no shared key in the conversation context, or the secret has been changed */
1027 if (tunnel
->shared_key_secret
== NULL
|| strcmp(secret
, tunnel
->shared_key_secret
) != 0) {
1028 /* For secret specification, see RFC 3931 pg 37 */
1030 if (ws_hmac_buffer(GCRY_MD_MD5
, tunnel
->shared_key
, &data
, 1, secret
, strlen(secret
))) {
1033 tunnel
->shared_key_secret
= wmem_strdup(wmem_file_scope(), secret
);
1037 static void md5_hmac_digest(l2tpv3_tunnel_t
*tunnel
,
1046 uint8_t zero
[HASH_MD5_LENGTH
] = { 0 };
1047 gcry_md_hd_t hmac_handle
;
1051 if (tunnel
->conv
->pt
== PT_NONE
) /* IP encapsulated L2TPv3 */
1054 if (gcry_md_open(&hmac_handle
, GCRY_MD_MD5
, GCRY_MD_FLAG_HMAC
)) {
1057 if (gcry_md_setkey(hmac_handle
, tunnel
->shared_key
, HASH_MD5_LENGTH
)) {
1058 gcry_md_close(hmac_handle
);
1062 if (msg_type
!= MESSAGE_TYPE_SCCRQ
) {
1063 if (tunnel
->lcce1_nonce
!= NULL
&& tunnel
->lcce2_nonce
!= NULL
) {
1064 if (addresses_equal(&tunnel
->lcce1
, &pinfo
->src
)) {
1065 gcry_md_write(hmac_handle
, tunnel
->lcce1_nonce
, tunnel
->lcce1_nonce_len
);
1066 gcry_md_write(hmac_handle
, tunnel
->lcce2_nonce
, tunnel
->lcce2_nonce_len
);
1068 gcry_md_write(hmac_handle
, tunnel
->lcce2_nonce
, tunnel
->lcce2_nonce_len
);
1069 gcry_md_write(hmac_handle
, tunnel
->lcce1_nonce
, tunnel
->lcce1_nonce_len
);
1074 gcry_md_write(hmac_handle
, tvb_get_ptr(tvb
, offset
, idx
+ 1 - offset
), idx
+ 1 - offset
);
1075 /* Message digest is calculated with an empty message digest field */
1076 gcry_md_write(hmac_handle
, zero
, avp_len
- 1);
1077 remainder
= length
- (idx
+ avp_len
);
1078 gcry_md_write(hmac_handle
, tvb_get_ptr(tvb
, idx
+ avp_len
, remainder
), remainder
);
1079 memcpy(digest
, gcry_md_read(hmac_handle
, 0), HASH_MD5_LENGTH
);
1080 gcry_md_close(hmac_handle
);
1083 static void sha1_hmac_digest(l2tpv3_tunnel_t
*tunnel
,
1092 uint8_t zero
[HASH_SHA1_LENGTH
] = { 0 };
1093 gcry_md_hd_t hmac_handle
;
1097 if (tunnel
->conv
->pt
== PT_NONE
) /* IP encapsulated L2TPv3 */
1100 if (gcry_md_open(&hmac_handle
, GCRY_MD_SHA1
, GCRY_MD_FLAG_HMAC
)) {
1103 if (gcry_md_setkey(hmac_handle
, tunnel
->shared_key
, HASH_MD5_LENGTH
)) {
1104 gcry_md_close(hmac_handle
);
1108 if (msg_type
!= MESSAGE_TYPE_SCCRQ
) {
1109 if (tunnel
->lcce1_nonce
!= NULL
&& tunnel
->lcce2_nonce
!= NULL
) {
1110 if (addresses_equal(&tunnel
->lcce1
, &pinfo
->src
)) {
1111 gcry_md_write(hmac_handle
, tunnel
->lcce1_nonce
, tunnel
->lcce1_nonce_len
);
1112 gcry_md_write(hmac_handle
, tunnel
->lcce2_nonce
, tunnel
->lcce2_nonce_len
);
1114 gcry_md_write(hmac_handle
, tunnel
->lcce2_nonce
, tunnel
->lcce2_nonce_len
);
1115 gcry_md_write(hmac_handle
, tunnel
->lcce1_nonce
, tunnel
->lcce1_nonce_len
);
1120 gcry_md_write(hmac_handle
, tvb_get_ptr(tvb
, offset
, idx
+ 1 - offset
), idx
+ 1 - offset
);
1121 /* Message digest is calculated with an empty message digest field */
1122 gcry_md_write(hmac_handle
, zero
, avp_len
- 1);
1123 remainder
= length
- (idx
+ avp_len
);
1124 gcry_md_write(hmac_handle
, tvb_get_ptr(tvb
, idx
+ avp_len
, remainder
), remainder
);
1125 memcpy(digest
, gcry_md_read(hmac_handle
, 0), HASH_SHA1_LENGTH
);
1126 gcry_md_close(hmac_handle
);
1129 static int check_control_digest(l2tpv3_tunnel_t
*tunnel
,
1137 uint8_t digest
[HASH_SHA1_LENGTH
];
1142 update_shared_key(tunnel
);
1144 switch (tvb_get_uint8(tvb
, idx
)) {
1146 if ((avp_len
- 1) != HASH_MD5_LENGTH
)
1148 md5_hmac_digest(tunnel
, tvb
, length
, idx
, avp_len
, msg_type
, pinfo
, digest
);
1150 case L2TP_HMAC_SHA1
:
1151 if ((avp_len
- 1) != HASH_SHA1_LENGTH
)
1153 sha1_hmac_digest(tunnel
, tvb
, length
, idx
, avp_len
, msg_type
, pinfo
, digest
);
1159 return tvb_memeql(tvb
, idx
+ 1, digest
, avp_len
- 1);
1162 static void store_cma_nonce(l2tpv3_tunnel_t
*tunnel
,
1168 uint8_t *nonce
= NULL
;
1174 case MESSAGE_TYPE_SCCRQ
:
1175 if (!tunnel
->lcce1_nonce
) {
1176 tunnel
->lcce1_nonce
= (uint8_t *)wmem_alloc(wmem_file_scope(), length
);
1177 tunnel
->lcce1_nonce_len
= length
;
1178 nonce
= tunnel
->lcce1_nonce
;
1181 case MESSAGE_TYPE_SCCRP
:
1182 if (!tunnel
->lcce2_nonce
) {
1183 tunnel
->lcce2_nonce
= (uint8_t *)wmem_alloc(wmem_file_scope(), length
);
1184 tunnel
->lcce2_nonce_len
= length
;
1185 nonce
= tunnel
->lcce2_nonce
;
1193 tvb_memcpy(tvb
, (void *)nonce
, offset
, length
);
1198 static void store_ccid(l2tpv3_tunnel_t
*tunnel
,
1207 case MESSAGE_TYPE_SCCRQ
:
1208 tunnel
->lcce1_id
= tvb_get_ntohl(tvb
, offset
);
1210 case MESSAGE_TYPE_SCCRP
:
1211 tunnel
->lcce2_id
= tvb_get_ntohl(tvb
, offset
);
1220 static l2tpv3_session_t
*find_session(l2tpv3_tunnel_t
*tunnel
,
1224 l2tpv3_session_t
*session
= NULL
;
1227 iterator
= tunnel
->sessions
;
1229 session
= (l2tpv3_session_t
*)iterator
->data
;
1231 if ((session
->lcce1
.id
== lcce1_id
) ||
1232 (session
->lcce2
.id
== lcce2_id
)) {
1236 iterator
= g_slist_next(iterator
);
1242 static void init_session(l2tpv3_session_t
*session
)
1244 session
->lcce1
.cookie_len
= session
->lcce2
.cookie_len
= -1;
1245 session
->lcce1
.l2_specific
= session
->lcce2
.l2_specific
= -1;
1246 session
->pw_type
= L2TPv3_PW_DEFAULT
;
1249 static l2tpv3_session_t
*alloc_session(void)
1251 l2tpv3_session_t
*session
= wmem_new0(wmem_packet_scope(), l2tpv3_session_t
);
1252 init_session(session
);
1257 static l2tpv3_session_t
*store_lsession_id(l2tpv3_session_t
*_session
,
1262 l2tpv3_session_t
*session
= _session
;
1265 case MESSAGE_TYPE_ICRQ
:
1266 case MESSAGE_TYPE_OCRQ
:
1267 case MESSAGE_TYPE_ICRP
:
1268 case MESSAGE_TYPE_OCRP
:
1274 if (session
== NULL
)
1275 session
= alloc_session();
1278 case MESSAGE_TYPE_ICRQ
:
1279 case MESSAGE_TYPE_OCRQ
:
1280 session
->lcce1
.id
= tvb_get_ntohl(tvb
, offset
);
1282 case MESSAGE_TYPE_ICRP
:
1283 case MESSAGE_TYPE_OCRP
:
1284 session
->lcce2
.id
= tvb_get_ntohl(tvb
, offset
);
1291 static l2tpv3_session_t
*store_rsession_id(l2tpv3_session_t
*_session
,
1296 l2tpv3_session_t
*session
= _session
;
1299 case MESSAGE_TYPE_ICRP
:
1300 case MESSAGE_TYPE_OCRP
:
1306 if (session
== NULL
)
1307 session
= alloc_session();
1309 session
->lcce1
.id
= tvb_get_ntohl(tvb
, offset
);
1314 static l2tpv3_session_t
*store_cookie_len(l2tpv3_session_t
*_session
,
1318 l2tpv3_session_t
*session
= _session
;
1321 case MESSAGE_TYPE_ICRQ
:
1322 case MESSAGE_TYPE_OCRQ
:
1323 case MESSAGE_TYPE_ICRP
:
1324 case MESSAGE_TYPE_OCRP
:
1330 if (session
== NULL
)
1331 session
= alloc_session();
1334 case MESSAGE_TYPE_ICRQ
:
1335 case MESSAGE_TYPE_OCRQ
:
1336 session
->lcce1
.cookie_len
= len
;
1338 case MESSAGE_TYPE_ICRP
:
1339 case MESSAGE_TYPE_OCRP
:
1340 session
->lcce2
.cookie_len
= len
;
1347 static l2tpv3_session_t
*store_pw_type(l2tpv3_session_t
*_session
,
1352 l2tpv3_session_t
*session
= _session
;
1355 case MESSAGE_TYPE_ICRQ
:
1356 case MESSAGE_TYPE_OCRQ
:
1362 if (session
== NULL
)
1363 session
= alloc_session();
1365 session
->pw_type
= tvb_get_ntohs(tvb
, offset
);
1370 static l2tpv3_session_t
*store_l2_sublayer(l2tpv3_session_t
*_session
,
1375 l2tpv3_session_t
*session
= _session
;
1376 int result
= l2tpv3_l2_specific
;
1377 uint16_t l2_sublayer
;
1380 case MESSAGE_TYPE_ICRQ
:
1381 case MESSAGE_TYPE_OCRQ
:
1382 case MESSAGE_TYPE_ICCN
:
1383 case MESSAGE_TYPE_OCCN
:
1384 case MESSAGE_TYPE_ICRP
:
1385 case MESSAGE_TYPE_OCRP
:
1391 if (session
== NULL
)
1392 session
= alloc_session();
1394 l2_sublayer
= tvb_get_ntohs(tvb
, offset
);
1395 switch (l2_sublayer
) {
1397 result
= L2TPv3_L2_SPECIFIC_NONE
; break;
1399 result
= L2TPv3_L2_SPECIFIC_DEFAULT
; break;
1401 result
= L2TPv3_L2_SPECIFIC_ATM
; break;
1403 result
= L2TPv3_L2_SPECIFIC_DOCSIS_DMPT
; break;
1409 case MESSAGE_TYPE_ICRQ
:
1410 case MESSAGE_TYPE_OCRQ
:
1411 case MESSAGE_TYPE_ICCN
:
1412 case MESSAGE_TYPE_OCCN
:
1413 session
->lcce1
.l2_specific
= result
;
1415 case MESSAGE_TYPE_ICRP
:
1416 case MESSAGE_TYPE_OCRP
:
1417 session
->lcce2
.l2_specific
= result
;
1424 static void update_session(l2tpv3_tunnel_t
*tunnel
, l2tpv3_session_t
*session
)
1426 l2tpv3_session_t
*existing
= NULL
;
1428 if (tunnel
== NULL
|| session
== NULL
)
1431 if (session
->lcce1
.id
== 0 && session
->lcce2
.id
== 0)
1434 existing
= find_session(tunnel
, session
->lcce1
.id
, session
->lcce2
.id
);
1436 existing
= wmem_new0(wmem_file_scope(), l2tpv3_session_t
);
1437 init_session(existing
);
1440 if (session
->lcce1
.id
!= 0)
1441 existing
->lcce1
.id
= session
->lcce1
.id
;
1443 if (session
->lcce2
.id
!= 0)
1444 existing
->lcce2
.id
= session
->lcce2
.id
;
1446 if (session
->lcce1
.cookie_len
!= -1)
1447 existing
->lcce1
.cookie_len
= session
->lcce1
.cookie_len
;
1449 if (session
->lcce2
.cookie_len
!= -1)
1450 existing
->lcce2
.cookie_len
= session
->lcce2
.cookie_len
;
1452 if (session
->lcce1
.l2_specific
!= -1)
1453 existing
->lcce1
.l2_specific
= session
->lcce1
.l2_specific
;
1455 if (session
->lcce2
.l2_specific
!= -1)
1456 existing
->lcce2
.l2_specific
= session
->lcce2
.l2_specific
;
1458 if (session
->pw_type
!= L2TPv3_PW_DEFAULT
)
1459 existing
->pw_type
= session
->pw_type
;
1461 if (tunnel
->sessions
== NULL
) {
1462 tunnel
->sessions
= g_slist_append(tunnel
->sessions
, existing
);
1463 list_heads
= g_slist_append(list_heads
, tunnel
->sessions
);
1465 tunnel
->sessions
= g_slist_append(tunnel
->sessions
, existing
);
1469 static void l2tp_prompt(packet_info
*pinfo _U_
, char* result
)
1471 snprintf(result
, MAX_DECODE_AS_PROMPT_LEN
, "Decode L2TPv3 pseudowire type 0x%04x as",
1472 GPOINTER_TO_UINT(p_get_proto_data(pinfo
->pool
, pinfo
, proto_l2tp
, 0)));
1475 static void *l2tp_value(packet_info
*pinfo _U_
)
1477 return p_get_proto_data(pinfo
->pool
, pinfo
, proto_l2tp
, 0);
1481 * Dissect CISCO AVP:s
1483 static int dissect_l2tp_cisco_avps(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, l2tp_cntrl_data_t
*l2tp_cntrl_data
, l2tpv3_session_t
**session
) {
1487 uint32_t avp_vendor_id
;
1489 uint16_t ver_len_hidden
;
1490 proto_tree
*l2tp_avp_tree
, *l2tp_avp_tree_sub
;
1492 ver_len_hidden
= tvb_get_ntohs(tvb
, offset
);
1493 avp_len
= AVP_LENGTH(ver_len_hidden
);
1494 avp_vendor_id
= tvb_get_ntohs(tvb
, offset
+ 2);
1495 avp_type
= tvb_get_ntohs(tvb
, offset
+ 4);
1497 l2tp_avp_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
1498 avp_len
, ett_l2tp_avp
, NULL
, "Vendor %s (%u): %s AVP",
1499 enterprises_lookup(avp_vendor_id
, "Unknown"), avp_vendor_id
,
1500 val_to_str(avp_type
, cisco_avp_type_vals
, "Unknown (%u)"));
1502 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1503 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1504 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1506 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
1514 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1518 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_cisco_avp_type
, tvb
, offset
, 2, avp_type
);
1524 /* process_l2tpv3_control does not set COL_INFO for vendor messages */
1525 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s - Cisco ACK (ccid=%u)", control_msg
, l2tp_cntrl_data
->ccid
);
1528 case CISCO_ASSIGNED_CONNECTION_ID
:
1529 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_assigned_control_connection_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1532 case CISCO_PW_CAPABILITY_LIST
:
1533 l2tp_avp_tree_sub
= proto_tree_add_subtree(l2tp_avp_tree
, tvb
, offset
, avp_len
,
1534 ett_l2tp_avp_sub
, NULL
, "Pseudowire Capabilities List");
1535 while (avp_len
>= 2) {
1536 proto_tree_add_item(l2tp_avp_tree_sub
, hf_l2tp_cisco_pw_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1542 case CISCO_LOCAL_SESSION_ID
:
1543 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_local_session_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1544 *session
= store_lsession_id(*session
, tvb
, offset
, l2tp_cntrl_data
->msg_type
);
1546 case CISCO_REMOTE_SESSION_ID
:
1547 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_remote_session_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1548 *session
= store_rsession_id(*session
, tvb
, offset
, l2tp_cntrl_data
->msg_type
);
1550 case CISCO_ASSIGNED_COOKIE
:
1551 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_assigned_cookie
, tvb
, offset
, avp_len
, ENC_NA
);
1552 *session
= store_cookie_len(*session
, avp_len
, l2tp_cntrl_data
->msg_type
);
1554 case CISCO_REMOTE_END_ID
:
1555 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_remote_end_id
, tvb
, offset
, avp_len
, ENC_NA
|ENC_ASCII
);
1558 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_pseudowire_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1559 *session
= store_pw_type(*session
, tvb
, offset
, l2tp_cntrl_data
->msg_type
);
1561 case CISCO_CIRCUIT_STATUS
:
1562 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_circuit_status
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1563 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_circuit_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1565 case CISCO_SESSION_TIE_BREAKER
:
1566 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_tie_breaker
,
1567 tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1569 case CISCO_DRAFT_AVP_VERSION
:
1570 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_draft_avp_version
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1572 case CISCO_MESSAGE_DIGEST
:
1573 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_message_digest
, tvb
, offset
, avp_len
, ENC_NA
);
1575 case CISCO_AUTH_NONCE
:
1576 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_nonce
, tvb
, offset
, avp_len
, ENC_NA
);
1578 case CISCO_INTERFACE_MTU
:
1579 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cisco_interface_mtu
, tvb
, offset
, avp_len
, ENC_BIG_ENDIAN
);
1583 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, offset
, avp_len
);
1592 * Dissect Broadband Forums AVP:s
1594 static int dissect_l2tp_broadband_avps(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
) {
1598 uint32_t avp_vendor_id
;
1600 uint16_t ver_len_hidden
;
1601 proto_tree
*l2tp_avp_tree
, *l2tp_avp_ale_tree
;
1604 ver_len_hidden
= tvb_get_ntohs(tvb
, offset
);
1605 avp_len
= AVP_LENGTH(ver_len_hidden
);
1606 avp_vendor_id
= tvb_get_ntohs(tvb
, offset
+ 2);
1607 avp_type
= tvb_get_ntohs(tvb
, offset
+ 4);
1609 l2tp_avp_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
1610 avp_len
, ett_l2tp_avp
, NULL
, "Vendor %s (%u): %s AVP",
1611 enterprises_lookup(avp_vendor_id
, "Unknown"), avp_vendor_id
,
1612 val_to_str(avp_type
, broadband_avp_type_vals
, "Unknown (%u)"));
1614 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1615 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1616 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1618 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
1626 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1630 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_broadband_avp_type
, tvb
, offset
, 2, avp_type
);
1636 case BROADBAND_AGENT_CIRCUIT_ID
:
1637 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_agent_circuit_id
, tvb
, offset
, avp_len
, ENC_UTF_8
);
1640 case BROADBAND_AGENT_REMOTE_ID
:
1641 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_agent_remote_id
, tvb
, offset
, avp_len
, ENC_UTF_8
);
1644 case BROADBAND_ACTUAL_DR_UP
:
1645 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_actual_dr_up
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1648 case BROADBAND_ACTUAL_DR_DOWN
:
1649 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_actual_dr_down
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1652 case BROADBAND_MINIMUM_DR_UP
:
1653 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_minimum_dr_up
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1656 case BROADBAND_MINIMUM_DR_DOWN
:
1657 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_minimum_dr_down
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1660 case BROADBAND_ATTAINABLE_DR_UP
:
1661 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_attainable_dr_up
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1664 case BROADBAND_ATTAINABLE_DR_DOWN
:
1665 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_attainable_dr_down
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1668 case BROADBAND_MAXIMUM_DR_UP
:
1669 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_maximum_dr_up
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1672 case BROADBAND_MAXIMUM_DR_DOWN
:
1673 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_maximum_dr_down
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1676 case BROADBAND_MINIMUM_DR_UP_LOW_POWER
:
1677 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_minimum_dr_up_low_power
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1680 case BROADBAND_MINIMUM_DR_DOWN_LOW_POWER
:
1681 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_minimum_dr_down_low_power
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1684 case BROADBAND_MAXIMUM_INTERLEAVING_DELAY_UP
:
1685 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_maximum_interleaving_delay_up
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1688 case BROADBAND_ACTUAL_INTERLEAVING_DELAY_UP
:
1689 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_actual_interleaving_delay_up
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1692 case BROADBAND_MAXIMUM_INTERLEAVING_DELAY_DOWN
:
1693 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_maximum_interleaving_delay_down
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1696 case BROADBAND_ACTUAL_INTERLEAVING_DELAY_DOWN
:
1697 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_actual_interleaving_delay_down
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1700 case BROADBAND_ACCESS_LOOP_ENCAPSULATION
:
1702 ta
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_access_loop_encapsulation
, tvb
, offset
, avp_len
, ENC_NA
);
1703 l2tp_avp_ale_tree
= proto_item_add_subtree(ta
, ett_l2tp_ale_sub
);
1704 proto_tree_add_item(l2tp_avp_ale_tree
, hf_l2tp_broadband_access_loop_encapsulation_data_link
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1705 proto_tree_add_item(l2tp_avp_ale_tree
, hf_l2tp_broadband_access_loop_encapsulation_enc1
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1706 proto_tree_add_item(l2tp_avp_ale_tree
, hf_l2tp_broadband_access_loop_encapsulation_enc2
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1710 case BROADBAND_ANCP_ACCESS_LINE_TYPE
:
1711 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_ancp_access_line_type
, tvb
, offset
, avp_len
, ENC_BIG_ENDIAN
);
1714 case BROADBAND_IWF_SESSION
:
1715 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_broadband_iwf_session
, tvb
, offset
, avp_len
, ENC_BIG_ENDIAN
);
1719 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, offset
, avp_len
);
1728 * Dissect Ericsson AVP:s
1731 /* Dissect a single variable-length Ericsson Transport Configuration Group */
1732 static int dissect_l2tp_ericsson_transp_cfg(tvbuff_t
*tvb
, proto_tree
*parent_tree
)
1735 uint32_t i
, num_sapis
;
1738 while (tvb_reported_length_remaining(tvb
, offset
) >= 8) {
1739 tree
= proto_tree_add_subtree_format(parent_tree
, tvb
, 0, -1, ett_l2tp_ericsson_tcg
,
1740 NULL
, "Transport Config Bundling Group");
1741 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_group_id
, tvb
, offset
++, 1, ENC_NA
);
1742 proto_tree_add_item_ret_uint(tree
, hf_l2tp_ericsson_tcg_num_sapis
, tvb
, offset
++, 1, ENC_NA
, &num_sapis
);
1743 for (i
= 0; i
< num_sapis
; i
++) {
1744 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_sapi
, tvb
, offset
++, 1, ENC_NA
);
1746 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_ip
, tvb
, offset
, 4, ENC_NA
);
1748 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_dscp
, tvb
, offset
++, 1, ENC_NA
);
1749 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_crc32_enable
, tvb
, offset
++, 1, ENC_NA
);
1750 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_bundling_tout
, tvb
, offset
++, 1, ENC_NA
);
1751 proto_tree_add_item(tree
, hf_l2tp_ericsson_tcg_bundling_max_pkt
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1758 /* Dissect a single 3-byte Ericsson TEI-to-SC Map */
1759 static int dissect_l2tp_ericsson_tei_sc_map(tvbuff_t
*tvb
, proto_tree
*parent_tree
)
1761 int i
= 0, offset
= 0;
1764 while (tvb_reported_length_remaining(tvb
, offset
) >= 3) {
1765 tree
= proto_tree_add_subtree_format(parent_tree
, tvb
, offset
, 3, ett_l2tp_ericsson_map
,
1766 NULL
, "Transport Config Bundling Group %u", i
);
1767 proto_tree_add_item(tree
, hf_l2tp_ericsson_map_tei_low
, tvb
, offset
++, 1, ENC_NA
);
1768 proto_tree_add_item(tree
, hf_l2tp_ericsson_map_tei_high
, tvb
, offset
++, 1, ENC_NA
);
1769 proto_tree_add_item(tree
, hf_l2tp_ericsson_map_sc
, tvb
, offset
++, 1, ENC_NA
);
1775 static int dissect_l2tp_ericsson_avps(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, uint32_t ccid _U_
)
1779 uint32_t avp_vendor_id
;
1781 uint16_t ver_len_hidden
;
1783 proto_tree
*l2tp_avp_tree
;
1786 ver_len_hidden
= tvb_get_ntohs(tvb
, offset
);
1787 avp_len
= AVP_LENGTH(ver_len_hidden
);
1788 avp_vendor_id
= tvb_get_ntohs(tvb
, offset
+ 2);
1789 avp_type
= tvb_get_ntohs(tvb
, offset
+ 4);
1791 l2tp_avp_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
1792 avp_len
, ett_l2tp_avp
, NULL
, "Vendor %s (%u): %s AVP",
1793 enterprises_lookup(avp_vendor_id
, "Unknown"), avp_vendor_id
,
1794 val_to_str(avp_type
, ericsson_avp_type_vals
, "Unknown (%u)"));
1796 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1797 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1798 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1800 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
1808 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1812 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_ericsson_avp_type
, tvb
, offset
, 2, avp_type
);
1817 case ERICSSON_MSG_TYPE
:
1818 proto_tree_add_item_ret_uint(l2tp_avp_tree
, hf_l2tp_ericsson_msg_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &msg_type
);
1819 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s - %s", control_msg
, val_to_str(msg_type
, ericsson_short_msg_type_vals
, "Unknown (0x%x)"));
1821 case ERICSSON_PROTO_VERSION
:
1822 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_ver_pref
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1823 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_ver_2
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1824 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_ver_3
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
1826 case ERICSSON_CONN_TYPE
:
1827 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_conn_type
, tvb
, offset
, 1, ENC_NA
);
1829 case ERICSSON_STN_NAME
:
1830 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_stn_name
, tvb
, offset
, avp_len
, ENC_ASCII
);
1832 case ERICSSON_CRC_ENABLED
:
1833 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_crc32_enable
, tvb
, offset
, avp_len
, ENC_NA
);
1835 case ERICSSON_ABIS_LOWER_MODE
:
1836 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_abis_lower_mode
, tvb
, offset
, 1, ENC_NA
);
1838 case ERICSSON_TRANSPORT_CONFIG
:
1839 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_tc_overl_thresh
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1840 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_tc_num_groups
, tvb
, offset
+2, 1, ENC_NA
);
1841 /* FIXME: iterate over multiple groups */
1842 tcg_tvb
= tvb_new_subset_length(tvb
, offset
+3, avp_len
-3);
1843 dissect_l2tp_ericsson_transp_cfg(tcg_tvb
, l2tp_avp_tree
);
1845 case ERICSSON_TEI_TO_SC_MAP
:
1846 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_ericsson_tc_num_maps
, tvb
, offset
++, 1, ENC_NA
);
1847 tcg_tvb
= tvb_new_subset_length(tvb
, offset
, avp_len
);
1848 offset
+= dissect_l2tp_ericsson_tei_sc_map(tcg_tvb
, l2tp_avp_tree
);
1852 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, offset
, avp_len
);
1861 * Ref: http://www.cablelabs.com/specifications/CM-SP-DEPI-I08-100611.pdf
1864 dissect_l2tp_vnd_cablelabs_avps(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
1868 uint32_t avp_vendor_id
;
1870 uint16_t ver_len_hidden
;
1871 proto_tree
*l2tp_avp_tree
;
1873 ver_len_hidden
= tvb_get_ntohs(tvb
, offset
);
1874 avp_len
= AVP_LENGTH(ver_len_hidden
);
1875 avp_vendor_id
= tvb_get_ntohs(tvb
, offset
+ 2);
1876 avp_type
= tvb_get_ntohs(tvb
, offset
+ 4);
1878 l2tp_avp_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
1879 avp_len
, ett_l2tp_avp
, NULL
, "Vendor %s (%u): %s AVP",
1880 enterprises_lookup(avp_vendor_id
, "Unknown"), avp_vendor_id
,
1881 val_to_str(avp_type
, cablelabs_avp_type_vals
, "Unknown (%u)"));
1883 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1884 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1885 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1887 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
1895 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1899 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_cablelabs_avp_type
, tvb
, offset
, 2, avp_type
);
1905 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_l_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1906 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_tsid_group_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1909 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_frequency
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1914 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_l_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1915 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_tsid_group_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1916 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_modulation
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1921 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_l_bit
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1922 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_tsid_group_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1926 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_m
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1929 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_cablel_avp_n
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1935 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, offset
, avp_len
);
1945 * Processes AVPs for Control Messages all versions and transports
1947 static void process_control_avps(tvbuff_t
*tvb
,
1949 proto_tree
*l2tp_tree
,
1953 l2tpv3_tunnel_t
*tunnel
)
1955 proto_tree
*l2tp_lcp_avp_tree
, *l2tp_avp_tree
= NULL
, *l2tp_avp_tree_sub
, *l2tp_avp_csu_tree
;
1956 proto_item
*te
, *tc
;
1959 bool isStopCcn
= false;
1961 uint32_t avp_vendor_id
;
1963 uint16_t ver_len_hidden
;
1964 tvbuff_t
*next_tvb
, *avp_tvb
;
1966 uint16_t digest_avp_len
= 0;
1967 proto_item
*digest_item
= NULL
;
1968 l2tp_cntrl_data_t
*l2tp_cntrl_data
= wmem_new0(pinfo
->pool
, l2tp_cntrl_data_t
);
1970 l2tpv3_session_t
*session
= NULL
;
1972 l2tp_cntrl_data
->ccid
= ccid
;
1974 while (idx
< length
) { /* Process AVP's */
1975 ver_len_hidden
= tvb_get_ntohs(tvb
, idx
);
1976 avp_len
= AVP_LENGTH(ver_len_hidden
);
1977 avp_vendor_id
= tvb_get_ntohs(tvb
, idx
+ 2);
1978 avp_type
= tvb_get_ntohs(tvb
, idx
+ 4);
1981 proto_tree_add_expert_format(l2tp_avp_tree
? l2tp_avp_tree
: l2tp_tree
, pinfo
, &ei_l2tp_avp_length
, tvb
, idx
, 2, "AVP length must be >= 6, got %u", avp_len
);
1985 if (avp_vendor_id
!= VENDOR_IETF
) {
1987 avp_tvb
= tvb_new_subset_length(tvb
, idx
, avp_len
);
1989 if (avp_vendor_id
== VENDOR_CISCO
) { /* Vendor-Specific AVP */
1991 dissect_l2tp_cisco_avps(avp_tvb
, pinfo
, l2tp_tree
, l2tp_cntrl_data
, &session
);
1995 } else if (avp_vendor_id
== VENDOR_BROADBAND_FORUM
) { /* Vendor-Specific AVP */
1997 dissect_l2tp_broadband_avps(avp_tvb
, pinfo
, l2tp_tree
);
2001 } else if (avp_vendor_id
== VENDOR_ERICSSON
) { /* Vendor-Specific AVP */
2003 dissect_l2tp_ericsson_avps(avp_tvb
, pinfo
, l2tp_tree
, ccid
);
2008 /* Vendor-Specific AVP */
2009 if (!dissector_try_uint_new(l2tp_vendor_avp_dissector_table
, avp_vendor_id
, avp_tvb
, pinfo
, l2tp_tree
, false, l2tp_cntrl_data
)){
2010 l2tp_avp_tree
= proto_tree_add_subtree_format(l2tp_tree
, tvb
, idx
,
2011 avp_len
, ett_l2tp_avp
, NULL
, "Vendor %s (%u) AVP Type %u",
2012 enterprises_lookup(avp_vendor_id
, "Unknown"), avp_vendor_id
,
2015 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2016 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2017 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2019 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
2024 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2027 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_avp_type
, tvb
, idx
, 2, avp_type
);
2029 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, idx
, avp_len
-6);
2038 l2tp_avp_tree
= proto_tree_add_subtree_format(l2tp_tree
, tvb
, idx
,
2039 avp_len
, ett_l2tp_avp
, NULL
, "%s AVP",
2040 val_to_str_ext(avp_type
, &avp_type_vals_ext
, "Unknown (%u)"));
2042 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_mandatory
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2043 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hidden
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2044 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_length
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2046 if (HIDDEN_BIT(ver_len_hidden
)) { /* don't try do display hidden */
2054 /* Special Case for handling Extended Vendor Id */
2055 if (avp_type
== EXTENDED_VENDOR_ID
) {
2057 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
,
2058 tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2065 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_id
,
2066 tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2071 proto_tree_add_uint(l2tp_avp_tree
, hf_l2tp_avp_type
,
2072 tvb
, idx
, 2, avp_type
);
2078 case CONTROL_MESSAGE
:
2079 msg_type
= tvb_get_ntohs(tvb
, idx
);
2080 l2tp_cntrl_data
->msg_type
= msg_type
;
2081 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_message_type
,
2082 tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2084 if (msg_type
== MESSAGE_TYPE_StopCCN
) {
2089 case RESULT_ERROR_CODE
:
2093 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_stop_ccn_result_code
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2096 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_result_code
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2103 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_error_code
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2109 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_error_message
, tvb
, idx
, avp_len
, ENC_ASCII
);
2112 case PROTOCOL_VERSION
:
2115 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_protocol_version
, tvb
, idx
, 1, ENC_BIG_ENDIAN
);
2119 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_protocol_revision
, tvb
, idx
, 1, ENC_BIG_ENDIAN
);
2122 case FRAMING_CAPABILITIES
:
2123 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_async_framing_supported
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2124 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_sync_framing_supported
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2127 case BEARER_CAPABILITIES
:
2128 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_analog_access_supported
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2129 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_digital_access_supported
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2133 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_tie_breaker
, tvb
, idx
, 8, ENC_BIG_ENDIAN
);
2136 case FIRMWARE_REVISION
:
2137 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_firmware_revision
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2141 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_host_name
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2145 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_vendor_name
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2148 case ASSIGNED_TUNNEL_ID
:
2149 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_assigned_tunnel_id
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2152 case RECEIVE_WINDOW_SIZE
:
2153 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_receive_window_size
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2157 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_chap_challenge
, tvb
, idx
, avp_len
, ENC_NA
);
2162 * XXX - export stuff from the Q.931 dissector
2163 * to dissect the cause code and cause message,
2168 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_cause_code
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2174 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_cause_msg
, tvb
, idx
, 1, ENC_BIG_ENDIAN
);
2180 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_advisory_msg
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2183 case CHALLENGE_RESPONSE
:
2184 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_chap_challenge_response
, tvb
, idx
, 16, ENC_NA
);
2187 case ASSIGNED_SESSION
:
2188 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_assigned_session_id
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2191 case CALL_SERIAL_NUMBER
:
2192 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_call_serial_number
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2196 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_minimum_bps
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2200 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_maximum_bps
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2204 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_analog_bearer_type
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2205 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_digital_bearer_type
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2209 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_async_framing_type
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2210 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_sync_framing_type
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2216 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_called_number
,
2217 tvb
, idx
, avp_len
, ENC_ASCII
);
2220 case CALLING_NUMBER
:
2223 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_calling_number
,
2224 tvb
, idx
, avp_len
, ENC_ASCII
);
2230 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_sub_address
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2233 case TX_CONNECT_SPEED
:
2234 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_connect_speed
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2237 case PHYSICAL_CHANNEL
:
2238 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_physical_channel
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2241 case INITIAL_RECEIVED_LCP_CONFREQ
:
2242 te
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_initial_received_lcp_confreq
, tvb
, idx
, avp_len
, ENC_NA
);
2243 l2tp_lcp_avp_tree
= proto_item_add_subtree(te
, ett_l2tp_lcp
);
2244 next_tvb
= tvb_new_subset_length(tvb
, idx
, avp_len
);
2245 call_dissector(ppp_lcp_options_handle
, next_tvb
, pinfo
, l2tp_lcp_avp_tree
);
2248 case LAST_SENT_LCP_CONFREQ
:
2249 te
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_last_sent_lcp_confreq
, tvb
, idx
, avp_len
, ENC_NA
);
2250 l2tp_lcp_avp_tree
= proto_item_add_subtree(te
, ett_l2tp_lcp
);
2251 next_tvb
= tvb_new_subset_length(tvb
, idx
, avp_len
);
2252 call_dissector(ppp_lcp_options_handle
, next_tvb
, pinfo
, l2tp_lcp_avp_tree
);
2255 case LAST_RECEIVED_LCP_CONFREQ
:
2256 te
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_last_received_lcp_confreq
, tvb
, idx
, avp_len
, ENC_NA
);
2257 l2tp_lcp_avp_tree
= proto_item_add_subtree(te
, ett_l2tp_lcp
);
2258 next_tvb
= tvb_new_subset_length(tvb
, idx
, avp_len
);
2259 call_dissector(ppp_lcp_options_handle
, next_tvb
, pinfo
, l2tp_lcp_avp_tree
);
2262 case PROXY_AUTHEN_TYPE
:
2263 msg_type
= tvb_get_ntohs(tvb
, idx
);
2264 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_proxy_authen_type
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2267 case PROXY_AUTHEN_NAME
:
2270 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_proxy_authen_name
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2273 case PROXY_AUTHEN_CHALLENGE
:
2274 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_proxy_authen_challenge
, tvb
, idx
, avp_len
, ENC_NA
);
2277 case PROXY_AUTHEN_ID
:
2278 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_proxy_authen_id
, tvb
, idx
+ 1, 1, ENC_BIG_ENDIAN
);
2281 case PROXY_AUTHEN_RESPONSE
:
2282 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_proxy_authen_response
, tvb
, idx
, avp_len
, ENC_NA
);
2285 case CALL_STATUS_AVPS
:
2293 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_crc_errors
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2299 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_framing_errors
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2305 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_hardware_overruns
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2311 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_buffer_overruns
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2317 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_time_out_errors
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2323 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_alignment_errors
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2336 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_send_accm
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2342 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_receive_accm
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2348 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_random_vector
, tvb
, idx
, avp_len
, ENC_NA
);
2351 case PRIVATE_GROUP_ID
:
2352 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_private_group_id
, tvb
, idx
, avp_len
, ENC_NA
);
2355 case RX_CONNECT_SPEED
:
2356 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_rx_connect_speed
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2359 case PPP_DISCONNECT_CAUSE_CODE
:
2362 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_disconnect_code
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2368 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_control_protocol_number
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2374 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_cause_code_direction
, tvb
, idx
, 1, ENC_BIG_ENDIAN
);
2380 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_cause_code_message
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2383 case MESSAGE_DIGEST
:
2386 digest_avp_len
= avp_len
;
2387 digest_item
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_message_digest
, tvb
, idx
, avp_len
, ENC_NA
);
2391 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_router_id
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2393 case ASSIGNED_CONTROL_CONN_ID
:
2394 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_assigned_control_conn_id
,
2395 tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2396 store_ccid(tunnel
, tvb
, idx
, msg_type
);
2398 case PW_CAPABILITY_LIST
:
2399 l2tp_avp_tree_sub
= proto_tree_add_subtree(l2tp_avp_tree
, tvb
, idx
, avp_len
,
2400 ett_l2tp_avp_sub
, NULL
, "Pseudowire Capabilities List");
2402 while (avp_len
>= 2) {
2403 proto_tree_add_item(l2tp_avp_tree_sub
, hf_l2tp_avp_pw_type
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2408 case LOCAL_SESSION_ID
:
2409 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_local_session_id
,
2410 tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2411 col_append_fstr(pinfo
->cinfo
,COL_INFO
, ", LSID: %2u",
2412 tvb_get_ntohl(tvb
, idx
));
2413 session
= store_lsession_id(session
, tvb
, idx
, msg_type
);
2415 case REMOTE_SESSION_ID
:
2416 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_remote_session_id
,
2417 tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2418 col_append_fstr(pinfo
->cinfo
,COL_INFO
, ", RSID: %2u",
2419 tvb_get_ntohl(tvb
, idx
));
2420 session
= store_rsession_id(session
, tvb
, idx
, msg_type
);
2422 case ASSIGNED_COOKIE
:
2423 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_assigned_cookie
, tvb
, idx
, avp_len
, ENC_NA
);
2424 session
= store_cookie_len(session
, avp_len
, msg_type
);
2427 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_remote_end_id
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2430 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_pseudowire_type
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2431 session
= store_pw_type(session
, tvb
, idx
, msg_type
);
2433 case L2_SPECIFIC_SUBLAYER
:
2434 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_layer2_specific_sublayer
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2435 session
= store_l2_sublayer(session
, tvb
, idx
, msg_type
);
2437 case DATA_SEQUENCING
:
2438 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_data_sequencing
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2440 case CIRCUIT_STATUS
:
2441 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_circuit_status
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2442 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_circuit_type
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2444 case PREFERRED_LANGUAGE
:
2445 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_preferred_language
, tvb
, idx
, avp_len
, ENC_NA
|ENC_ASCII
);
2447 case CTL_MSG_AUTH_NONCE
:
2448 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_nonce
, tvb
, idx
, avp_len
, ENC_NA
);
2449 store_cma_nonce(tunnel
, tvb
, idx
, avp_len
, msg_type
);
2451 case TX_CONNECT_SPEED_V3
:
2455 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_tx_connect_speed_v3
, tvb
, idx
, 8, ENC_BIG_ENDIAN
);
2457 case RX_CONNECT_SPEED_V3
:
2461 proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_rx_connect_speed_v3
, tvb
, idx
, 8, ENC_BIG_ENDIAN
);
2463 case CONNECT_SPEED_UPDATE
:
2465 tc
= proto_tree_add_item(l2tp_avp_tree
, hf_l2tp_avp_csu
, tvb
, idx
, avp_len
, ENC_NA
);
2466 l2tp_avp_csu_tree
= proto_item_add_subtree(tc
, ett_l2tp_csu
);
2467 if (avp_len
== 12) {
2469 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_res
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2470 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_remote_session_id_v2
, tvb
, idx
+2, 2, ENC_BIG_ENDIAN
);
2471 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_current_tx_speed_v2
, tvb
, idx
+4, 4, ENC_BIG_ENDIAN
);
2472 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_current_rx_speed_v2
, tvb
, idx
+8, 4, ENC_BIG_ENDIAN
);
2474 else if (avp_len
== 20) {
2476 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_remote_session_id_v3
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2477 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_current_tx_speed_v3
, tvb
, idx
+4, 8, ENC_BIG_ENDIAN
);
2478 proto_tree_add_item(l2tp_avp_csu_tree
, hf_l2tp_avp_csu_current_rx_speed_v3
, tvb
, idx
+12, 8, ENC_BIG_ENDIAN
);
2485 proto_tree_add_expert(l2tp_avp_tree
, pinfo
, &ei_l2tp_vendor_specific_avp_data
, tvb
, idx
, avp_len
);
2492 /* SCCRQ digest can only be calculated once we know whether nonces are being used */
2493 if (digest_avp_len
) {
2494 if (check_control_digest(tunnel
, tvb
, length
, digest_idx
, digest_avp_len
, msg_type
, pinfo
) < 0)
2495 expert_add_info(pinfo
, digest_item
, &ei_l2tp_incorrect_digest
);
2498 update_session(tunnel
, session
);
2502 * Processes Data Messages for v3 IP and UDP, starting from the Session ID
2503 * (common to IP and UDP). Dissects the L2TPv3 Session header, the (optional)
2504 * L2-Specific sublayer and calls the appropriate dissector for the payload.
2507 process_l2tpv3_data(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2508 proto_tree
*l2tp_tree
, proto_item
*l2tp_item
, int *pIdx
,
2509 l2tpv3_tunnel_t
*tunnel
)
2513 uint32_t oam_cell
= 0;
2514 proto_tree
*l2_specific
= NULL
;
2515 proto_item
*ti
= NULL
;
2517 int cookie_len
= l2tpv3_cookie
;
2518 int l2_spec
= l2tpv3_l2_specific
;
2519 unsigned pw_type
= L2TPv3_PW_DEFAULT
;
2521 lcce_settings_t
*lcce
= NULL
;
2522 l2tpv3_session_t
*session
= NULL
;
2524 /* Get Session ID */
2525 sid
= tvb_get_ntohl(tvb
, idx
);
2529 if (addresses_equal(&tunnel
->lcce1
, &pinfo
->dst
)) {
2530 session
= find_session(tunnel
, sid
, 0);
2532 lcce
= &session
->lcce1
;
2534 session
= find_session(tunnel
, 0, sid
);
2536 lcce
= &session
->lcce2
;
2542 l2_spec
= lcce
->l2_specific
;
2543 if (cookie_len
== -1)
2544 cookie_len
= lcce
->cookie_len
;
2545 if (pw_type
== L2TPv3_PW_DEFAULT
)
2546 pw_type
= session
->pw_type
;
2550 l2_spec
= L2TPv3_L2_SPECIFIC_NONE
;
2552 if (cookie_len
== -1)
2553 cookie_len
= L2TPv3_COOKIE_DEFAULT
;
2555 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "D[S:0x%08X]", sid
);
2556 col_set_fence(pinfo
->cinfo
, COL_INFO
);
2558 proto_tree_add_item(l2tp_tree
, hf_l2tp_sid
, tvb
, idx
-4, 4, ENC_BIG_ENDIAN
);
2559 ti
= proto_tree_add_uint(l2tp_tree
, hf_l2tp_avp_pseudowire_type
, tvb
, 0, 0, pw_type
);
2560 proto_item_set_generated(ti
);
2561 if (!(tvb_offset_exists(tvb
, idx
))) {
2564 if (cookie_len
!= 0) {
2565 proto_tree_add_item(l2tp_tree
, hf_l2tp_cookie
, tvb
, idx
, cookie_len
, ENC_NA
);
2567 proto_item_set_len(l2tp_item
, idx
);
2571 case L2TPv3_L2_SPECIFIC_DEFAULT
:
2573 ti
= proto_tree_add_item(l2tp_tree
, hf_l2tp_l2_spec_def
,
2574 tvb
, idx
, 4, ENC_NA
);
2575 l2_specific
= proto_item_add_subtree(ti
, ett_l2tp_l2_spec
);
2577 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_s
, tvb
, idx
,
2579 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_sequence
, tvb
,
2580 idx
+ 1, 3, ENC_BIG_ENDIAN
);
2584 case L2TPv3_L2_SPECIFIC_DOCSIS_DMPT
:
2586 ti
= proto_tree_add_item(l2tp_tree
, hf_l2tp_l2_spec_docsis_dmpt
,
2587 tvb
, idx
, 4, ENC_NA
);
2588 l2_specific
= proto_item_add_subtree(ti
, ett_l2tp_l2_spec
);
2590 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_v
, tvb
,
2591 idx
, 1, ENC_BIG_ENDIAN
);
2593 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_s
, tvb
,
2594 idx
, 1, ENC_BIG_ENDIAN
);
2596 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_h
, tvb
,
2597 idx
, 1, ENC_BIG_ENDIAN
);
2599 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_flow_id
, tvb
,
2600 idx
, 1, ENC_BIG_ENDIAN
);
2602 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_sequence
, tvb
,
2603 idx
+ 2, 2, ENC_BIG_ENDIAN
);
2607 case L2TPv3_L2_SPECIFIC_ATM
:
2609 ti
= proto_tree_add_item(l2tp_tree
, hf_l2tp_l2_spec_atm
,
2610 tvb
, idx
, 4, ENC_NA
);
2611 l2_specific
= proto_item_add_subtree(ti
, ett_l2tp_l2_spec
);
2613 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_s
, tvb
, idx
,
2615 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_t
, tvb
, idx
,
2618 * As per RFC 4454, the T bit specifies whether
2619 * we're transporting an OAM cell or an AAL5 frame.
2621 oam_cell
= tvb_get_uint8(tvb
, idx
) & 0x08;
2622 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_g
, tvb
, idx
,
2624 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_c
, tvb
, idx
,
2626 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_u
, tvb
, idx
,
2628 proto_tree_add_item(l2_specific
, hf_l2tp_l2_spec_sequence
, tvb
,
2629 idx
+ 1, 3, ENC_BIG_ENDIAN
);
2633 case L2TPv3_L2_SPECIFIC_LAPD
:
2635 proto_tree_add_item(l2tp_tree
, hf_l2tp_lapd_info
, tvb
, idx
+ 4, 3, ENC_NA
);
2638 case L2TPv3_L2_SPECIFIC_NONE
:
2643 next_tvb
= tvb_new_subset_remaining(tvb
, idx
);
2644 proto_item_set_len(l2tp_item
, idx
);
2645 p_add_proto_data(pinfo
->pool
, pinfo
, proto_l2tp
, 0, GUINT_TO_POINTER(pw_type
));
2647 if (!dissector_try_uint_new(pw_type_table
, pw_type
, next_tvb
, pinfo
, tree
, false, GUINT_TO_POINTER(oam_cell
)))
2649 call_data_dissector(next_tvb
, pinfo
, tree
);
2653 static int * const l2tp_control_fields
[] = {
2655 &hf_l2tp_length_bit
,
2662 * Processes v3 data message over UDP, to then call process_l2tpv3_data
2663 * from the common part (Session ID)
2666 process_l2tpv3_data_udp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2667 l2tpv3_conversation_t
*l2tp_conv
)
2669 proto_tree
*l2tp_tree
;
2670 proto_item
*l2tp_item
;
2671 int idx
= 4; /* skip to sid */
2673 l2tp_item
= proto_tree_add_item(tree
, proto_l2tp
, tvb
, 0, 8, ENC_NA
);
2674 l2tp_tree
= proto_item_add_subtree(l2tp_item
, ett_l2tp
);
2677 proto_item_append_text(l2tp_item
, " version 3");
2679 proto_tree_add_bitmask(l2tp_tree
, tvb
, 0, hf_l2tp_flags
, ett_l2tp_flags
, l2tp_control_fields
, ENC_BIG_ENDIAN
);
2681 /* Data in v3 over UDP has this reserved */
2682 proto_tree_add_item(l2tp_tree
, hf_l2tp_res
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
2685 /* Call process_l2tpv3_data from Session ID (offset in idx of 4) */
2686 process_l2tpv3_data(tvb
, pinfo
, tree
, l2tp_tree
, l2tp_item
, &idx
, l2tp_conv
->tunnel
);
2690 * Processes v3 data message over IP, to then call process_l2tpv3_data
2691 * from the common part (Session ID)
2694 process_l2tpv3_data_ip(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2695 l2tpv3_conversation_t
*l2tp_conv
)
2697 proto_tree
*l2tp_tree
;
2698 proto_item
*l2tp_item
;
2702 l2tp_item
= proto_tree_add_item(tree
, proto_l2tp
, tvb
, 0, 4, ENC_NA
);
2703 l2tp_tree
= proto_item_add_subtree(l2tp_item
, ett_l2tp
);
2704 proto_item_append_text(l2tp_item
, " version 3");
2706 /* Call process_l2tpv3_data from Session ID (offset in idx of 0) */
2707 process_l2tpv3_data(tvb
, pinfo
, tree
, l2tp_tree
, l2tp_item
, &idx
, l2tp_conv
->tunnel
);
2711 * Processes v3 Control Message over IP, that carries NULL Session ID
2712 * to then call process_control_avps after dissecting the control.
2715 process_l2tpv3_control(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int baseIdx
,
2716 l2tpv3_conversation_t
*l2tp_conv
)
2718 proto_tree
*l2tp_tree
= NULL
;
2719 proto_item
*l2tp_item
= NULL
;
2723 uint16_t length
= 0; /* Length field */
2724 uint32_t ccid
= 0; /* Control Connection ID */
2725 uint16_t vendor_id
= 0;
2728 uint16_t control
= 0;
2730 l2tpv3_tunnel_t
*tunnel
= NULL
;
2731 l2tpv3_tunnel_t tmp_tunnel
;
2733 control
= tvb_get_ntohs(tvb
, idx
);
2734 idx
+= 2; /* skip ahead */
2735 if (LENGTH_BIT(control
)) { /* length field included ? */
2736 length
= tvb_get_ntohs(tvb
, idx
);
2740 /* Get Control Channel ID */
2741 ccid
= tvb_get_ntohl(tvb
, idx
);
2746 if ((LENGTH_BIT(control
))&&(length
==12)) /* ZLB Message */
2747 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2748 "%s - ZLB (ccid=0x%08X)",
2749 control_msg
, ccid
);
2752 if (SEQUENCE_BIT(control
)) {
2758 vendor_id
= tvb_get_ntohs(tvb
, tmp_idx
);
2761 avp_type
= tvb_get_ntohs(tvb
, tmp_idx
);
2764 /* If it's a vendor AVP let the vendor AVP dissector fill in the info column */
2765 if ( vendor_id
== VENDOR_IETF
) {
2766 if (avp_type
== CONTROL_MESSAGE
) {
2767 /* We print message type */
2768 msg_type
= tvb_get_ntohs(tvb
, tmp_idx
);
2769 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2770 "%s - %s (ccid=0x%08X)",
2772 val_to_str_ext(msg_type
, &l2tp_message_type_short_str_vals_ext
, "Unknown (%u)"),
2777 * This is not a control message.
2778 * We never pass here except in case of bad l2tp packet!
2780 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2787 if (LENGTH_BIT(control
)) {
2789 * Set the length of this tvbuff to be no longer than the length
2792 * XXX - complain if that length is longer than the length of
2793 * the tvbuff? Have "set_actual_length()" return a Boolean
2794 * and have its callers check the result?
2796 set_actual_length(tvb
, length
+baseIdx
);
2800 l2tp_item
= proto_tree_add_item(tree
, proto_l2tp
, tvb
, 0, -1, ENC_NA
);
2801 l2tp_tree
= proto_item_add_subtree(l2tp_item
, ett_l2tp
);
2802 proto_item_append_text(l2tp_item
, " version 3");
2805 proto_tree_add_item(l2tp_tree
, hf_l2tp_sid
, tvb
, 0, 4, ENC_BIG_ENDIAN
);
2807 proto_tree_add_bitmask(l2tp_tree
, tvb
, baseIdx
, hf_l2tp_flags
, ett_l2tp_flags
, l2tp_control_fields
, ENC_BIG_ENDIAN
);
2810 if (LENGTH_BIT(control
)) {
2811 proto_tree_add_item(l2tp_tree
, hf_l2tp_length
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2815 proto_tree_add_item(l2tp_tree
, hf_l2tp_ccid
, tvb
, idx
, 4, ENC_BIG_ENDIAN
);
2818 if (SEQUENCE_BIT(control
)) {
2819 proto_tree_add_item(l2tp_tree
, hf_l2tp_Ns
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2821 proto_tree_add_item(l2tp_tree
, hf_l2tp_Nr
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
2826 if ((LENGTH_BIT(control
))&&(length
==12)) {
2827 proto_tree_add_item(l2tp_tree
, hf_l2tp_zero_length_body_message
, tvb
, 0, 0, ENC_NA
);
2829 avp_type
= tvb_get_ntohs(tvb
, idx
+ 4);
2830 if (avp_type
== CONTROL_MESSAGE
) {
2832 msg_type
= tvb_get_ntohs(tvb
, idx
+ 6);
2833 if (msg_type
== MESSAGE_TYPE_SCCRQ
) {
2834 tunnel
= &tmp_tunnel
;
2835 memset(tunnel
, 0, sizeof(l2tpv3_tunnel_t
));
2836 tunnel
->conv
= l2tp_conv
;
2837 copy_address_wmem(wmem_file_scope(), &tunnel
->lcce1
, &pinfo
->src
);
2838 copy_address_wmem(wmem_file_scope(), &tunnel
->lcce2
, &pinfo
->dst
);
2843 if (!LENGTH_BIT(control
)) {
2847 if (tunnel
== NULL
) {
2848 tunnel
= l2tp_conv
->tunnel
;
2851 process_control_avps(tvb
, pinfo
, l2tp_tree
, idx
, length
+baseIdx
, ccid
, tunnel
);
2853 if (tunnel
== &tmp_tunnel
&& l2tp_conv
->tunnel
== NULL
) {
2854 l2tp_conv
->tunnel
= wmem_new0(wmem_file_scope(), l2tpv3_tunnel_t
);
2855 memcpy(l2tp_conv
->tunnel
, &tmp_tunnel
, sizeof(l2tpv3_tunnel_t
));
2860 * Dissector for L2TP over UDP. For v2, calls process_control_avps for
2861 * control messages, or the ppp dissector based on the control bit.
2862 * For v3, calls either process_l2tpv3_control or process_l2tpv3_data_udp
2863 * based on the control bit.
2866 dissect_l2tp_udp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
2868 proto_tree
*l2tp_tree
;
2869 proto_item
*l2tp_item
;
2872 uint16_t length
= 0; /* Length field */
2873 uint16_t tid
; /* Tunnel ID */
2874 uint16_t cid
; /* Call ID */
2875 uint16_t offset_size
; /* Offset size */
2880 conversation_t
*conv
= NULL
;
2881 l2tpv3_conversation_t
*l2tp_conv
= NULL
;
2884 * Don't accept packets that aren't for an L2TP version we know,
2885 * as they might not be L2TP packets even though they happen
2886 * to be coming from or going to the L2TP port.
2888 if (tvb_captured_length(tvb
) < 2)
2889 return 0; /* not enough information to check */
2890 control
= tvb_get_ntohs(tvb
, 0);
2891 switch (L2TP_VERSION(control
)) {
2901 /* RFCs 2661 and 3931 say that L2TPv2 and v3 use a TFTP-like method
2902 * of each side choosing their own port and only using the L2TP port
2903 * to establish the connection. In common practice, both parties use
2904 * the assigned L2TP port the entire time, due to NAT, firewalls, etc.
2905 * We support both methods by using conversations with no second port.
2907 conv
= find_conversation(pinfo
->num
, &pinfo
->src
, &pinfo
->dst
, CONVERSATION_UDP
,
2908 pinfo
->srcport
, pinfo
->destport
, NO_PORT_B
);
2910 if (conv
== NULL
|| (conversation_get_dissector(conv
, pinfo
->num
) != l2tp_udp_handle
)) {
2911 conv
= find_conversation(pinfo
->num
, &pinfo
->dst
, &pinfo
->src
, CONVERSATION_UDP
,
2912 pinfo
->destport
, pinfo
->srcport
, NO_PORT_B
);
2915 if ((conv
== NULL
) || (conversation_get_dissector(conv
, pinfo
->num
) != l2tp_udp_handle
)) {
2916 conv
= conversation_new(pinfo
->num
, &pinfo
->src
, &pinfo
->dst
, CONVERSATION_UDP
,
2917 pinfo
->srcport
, 0, NO_PORT2
);
2918 conversation_set_dissector(conv
, l2tp_udp_handle
);
2921 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "L2TP");
2922 col_clear(pinfo
->cinfo
, COL_INFO
);
2924 switch (L2TP_VERSION(control
)) {
2930 l2tp_conv
= (l2tpv3_conversation_t
*)conversation_get_proto_data(conv
, proto_l2tp
);
2932 l2tp_conv
= wmem_new0(wmem_file_scope(), l2tpv3_conversation_t
);
2933 l2tp_conv
->pt
= PT_UDP
;
2934 conversation_add_proto_data(conv
, proto_l2tp
, (void *)l2tp_conv
);
2937 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "L2TPv3");
2938 if (CONTROL_BIT(control
)) {
2939 /* Call to process l2tp v3 control message */
2940 process_l2tpv3_control(tvb
, pinfo
, tree
, 0, l2tp_conv
);
2943 /* Call to process l2tp v3 data message */
2944 process_l2tpv3_data_udp(tvb
, pinfo
, tree
, l2tp_conv
);
2946 return tvb_reported_length(tvb
);
2949 if (LENGTH_BIT(control
)) { /* length field included ? */
2950 idx
+= 2; /* skip ahead */
2951 length
= tvb_get_ntohs(tvb
, idx
);
2954 /* collect the tunnel id & call id */
2956 tid
= tvb_get_ntohs(tvb
, idx
);
2958 cid
= tvb_get_ntohs(tvb
, idx
);
2960 if (CONTROL_BIT(control
)) {
2961 /* CONTROL MESSAGE */
2964 if ((LENGTH_BIT(control
))&&(length
==12)) /* ZLB Message */
2965 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2966 "%s - ZLB (tunnel id=%d, session id=%u)",
2967 control_msg
, tid
, cid
);
2970 if (SEQUENCE_BIT(control
)) {
2976 avp_type
= tvb_get_ntohs(tvb
, (tmp_idx
+=2));
2978 if (avp_type
== CONTROL_MESSAGE
) {
2979 /* We print message type */
2980 msg_type
= tvb_get_ntohs(tvb
, tmp_idx
+2);
2981 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2982 "%s - %s (tunnel id=%u, session id=%u)",
2984 val_to_str_ext(msg_type
, &l2tp_message_type_short_str_vals_ext
, "Unknown (%u)"),
2990 * This is not a control message.
2991 * We never pass here except in case of bad l2tp packet!
2993 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
2994 "%s (tunnel id=%u, session id=%u)",
2995 control_msg
, tid
, cid
);
3002 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
3003 "%s (tunnel id=%u, session id=%u)",
3004 data_msg
, tid
, cid
);
3007 if (LENGTH_BIT(control
)) {
3009 * Set the length of this tvbuff to be no longer than the length
3012 * XXX - complain if that length is longer than the length of
3013 * the tvbuff? Have "set_actual_length()" return a Boolean
3014 * and have its callers check the result?
3016 set_actual_length(tvb
, length
);
3019 l2tp_item
= proto_tree_add_item(tree
,proto_l2tp
, tvb
, 0, -1, ENC_NA
);
3020 l2tp_tree
= proto_item_add_subtree(l2tp_item
, ett_l2tp
);
3023 static int * const control_fields
[] = {
3025 &hf_l2tp_length_bit
,
3027 &hf_l2tp_offset_bit
,
3033 proto_tree_add_bitmask(l2tp_tree
, tvb
, 0, hf_l2tp_flags
, ett_l2tp_flags
, control_fields
, ENC_BIG_ENDIAN
);
3036 if (LENGTH_BIT(control
)) {
3038 proto_tree_add_item(l2tp_tree
, hf_l2tp_length
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
3044 proto_tree_add_item(l2tp_tree
, hf_l2tp_tunnel
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
3048 proto_tree_add_item(l2tp_tree
, hf_l2tp_session
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
3052 if (SEQUENCE_BIT(control
)) {
3054 proto_tree_add_item(l2tp_tree
, hf_l2tp_Ns
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
3058 proto_tree_add_item(l2tp_tree
, hf_l2tp_Nr
, tvb
, idx
, 2, ENC_BIG_ENDIAN
);
3062 if (OFFSET_BIT(control
)) {
3063 offset_size
= tvb_get_ntohs(tvb
, idx
);
3065 proto_tree_add_uint(l2tp_tree
, hf_l2tp_offset
, tvb
, idx
, 2,
3069 if (offset_size
!= 0) {
3071 proto_tree_add_item(l2tp_tree
, hf_l2tp_offset_padding
, tvb
, idx
, offset_size
, ENC_NA
);
3077 if (tree
&& (LENGTH_BIT(control
))&&(length
==12)) {
3078 proto_tree_add_item(l2tp_tree
, hf_l2tp_zero_length_body_message
, tvb
, 0, 0, ENC_NA
);
3081 if (!CONTROL_BIT(control
)) { /* Data Messages so we are done */
3083 proto_item_set_len(l2tp_item
, idx
);
3084 /* If we have data, signified by having a length bit, dissect it */
3085 if (tvb_offset_exists(tvb
, idx
)) {
3086 next_tvb
= tvb_new_subset_remaining(tvb
, idx
);
3087 call_dissector(ppp_hdlc_handle
, next_tvb
, pinfo
, tree
);
3089 return tvb_reported_length(tvb
);
3092 if (LENGTH_BIT(control
))
3093 process_control_avps(tvb
, pinfo
, l2tp_tree
, idx
, length
, -1, NULL
);
3095 return tvb_reported_length(tvb
);
3100 * Only L2TPv3 runs directly over IP, and dissect_l2tp_ip starts dissecting
3101 * those packets to call either process_l2tpv3_control for Control Messages
3102 * or process_l2tpv3_data_ip for Data Messages over IP, based on the
3106 dissect_l2tp_ip(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
3109 uint32_t sid
; /* Session ID */
3111 conversation_t
*conv
= NULL
;
3112 l2tpv3_conversation_t
*l2tp_conv
= NULL
;
3114 conv
= find_or_create_conversation(pinfo
);
3116 l2tp_conv
= (l2tpv3_conversation_t
*)conversation_get_proto_data(conv
, proto_l2tp
);
3118 l2tp_conv
= wmem_new0(wmem_file_scope(), l2tpv3_conversation_t
);
3119 l2tp_conv
->pt
= PT_NONE
;
3120 conversation_add_proto_data(conv
, proto_l2tp
, (void *)l2tp_conv
);
3123 /* Only L2TPv3 runs directly over IP */
3124 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "L2TPv3");
3126 col_clear(pinfo
->cinfo
, COL_INFO
);
3128 sid
= tvb_get_ntohl(tvb
, idx
);
3130 /* This is control message */
3131 /* Call to process l2tp v3 control message */
3132 process_l2tpv3_control(tvb
, pinfo
, tree
, 4, l2tp_conv
);
3135 /* Call to process l2tp v3 data message */
3136 process_l2tpv3_data_ip(tvb
, pinfo
, tree
, l2tp_conv
);
3139 return tvb_captured_length(tvb
);
3142 static int dissect_atm_oam_llc(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
3144 uint32_t oam_cell
= GPOINTER_TO_UINT(data
);
3147 call_dissector(atm_oam_handle
, tvb
, pinfo
, tree
);
3149 call_dissector(llc_handle
, tvb
, pinfo
, tree
);
3152 return tvb_captured_length(tvb
);
3155 static void l2tp_cleanup(void)
3157 GSList
*iterator
= list_heads
;
3160 g_slist_free((GSList
*)iterator
->data
);
3161 iterator
= g_slist_next(iterator
);
3164 if (list_heads
!= NULL
) {
3165 g_slist_free(list_heads
);
3170 /* registration with the filtering engine */
3172 proto_register_l2tp(void)
3174 static hf_register_info hf
[] = {
3176 { "Flags", "l2tp.flags", FT_UINT16
, BASE_HEX
, NULL
, 0,
3180 { "Type", "l2tp.type", FT_UINT16
, BASE_DEC
, VALS(l2tp_type_vals
), 0x8000,
3181 "Type bit", HFILL
}},
3183 { &hf_l2tp_length_bit
,
3184 { "Length Bit", "l2tp.length_bit", FT_BOOLEAN
, 16, TFS(&l2tp_length_bit_truth
), 0x4000,
3188 { "Sequence Bit", "l2tp.seq_bit", FT_BOOLEAN
, 16, TFS(&l2tp_seq_bit_truth
), 0x0800,
3191 { &hf_l2tp_offset_bit
,
3192 { "Offset bit", "l2tp.offset_bit", FT_BOOLEAN
, 16, TFS(&l2tp_offset_bit_truth
), 0x0200,
3195 { &hf_l2tp_priority
,
3196 { "Priority", "l2tp.priority", FT_BOOLEAN
, 16, TFS(&l2tp_priority_truth
), 0x0100,
3197 "Priority bit", HFILL
}},
3200 { "Version", "l2tp.version", FT_UINT16
, BASE_DEC
, NULL
, 0x000f,
3204 { "Length","l2tp.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3208 { "Tunnel ID","l2tp.tunnel", FT_UINT16
, BASE_DEC
, NULL
, 0x0, /* Probably should be FT_BYTES */
3212 { "Session ID","l2tp.session", FT_UINT16
, BASE_DEC
, NULL
, 0x0, /* Probably should be FT_BYTES */
3216 { "Ns","l2tp.Ns", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3220 { "Nr","l2tp.Nr", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3224 { "Offset","l2tp.offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3225 "Number of octets past the L2TP header at which the payload data starts.", HFILL
}},
3227 { &hf_l2tp_avp_mandatory
,
3228 { "Mandatory", "l2tp.avp.mandatory", FT_BOOLEAN
, 16, NULL
, 0x8000,
3231 { &hf_l2tp_avp_hidden
,
3232 { "Hidden", "l2tp.avp.hidden", FT_BOOLEAN
, 16, NULL
, 0x4000,
3235 { &hf_l2tp_avp_length
,
3236 { "Length", "l2tp.avp.length", FT_UINT16
, BASE_DEC
, NULL
, 0x03ff,
3239 { &hf_l2tp_avp_vendor_id
,
3240 { "Vendor ID", "l2tp.avp.vendor_id", FT_UINT32
, BASE_ENTERPRISES
, STRINGS_ENTERPRISES
, 0,
3241 "AVP Vendor ID", HFILL
}},
3243 { &hf_l2tp_avp_type
,
3244 { "AVP Type", "l2tp.avp.type", FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &avp_type_vals_ext
, 0,
3247 { &hf_l2tp_tie_breaker
,
3248 { "Tie Breaker", "l2tp.tie_breaker", FT_UINT64
, BASE_HEX
, NULL
, 0,
3252 { "Session ID","l2tp.sid", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
3256 { "Control Connection ID","l2tp.ccid", FT_UINT32
, BASE_HEX
, NULL
, 0x0,
3260 { "Reserved","l2tp.res", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
3264 { "Cookie","l2tp.cookie", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3267 { &hf_l2tp_l2_spec_def
,
3268 { "Default L2-Specific Sublayer","l2tp.l2_spec_def", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3271 { &hf_l2tp_l2_spec_atm
,
3272 { "ATM-Specific Sublayer","l2tp.l2_spec_atm", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3275 { &hf_l2tp_l2_spec_docsis_dmpt
,
3276 { "DOCSIS DMPT - Specific Sublayer","l2tp.l2_spec_docsis_dmpt", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3279 { &hf_l2tp_l2_spec_v
,
3280 { "V-bit","l2tp.l2_spec_v", FT_BOOLEAN
, 8, NULL
, 0x80,
3281 "VCCV Bit", HFILL
}},
3283 { &hf_l2tp_l2_spec_s
,
3284 { "S-bit","l2tp.l2_spec_s", FT_BOOLEAN
, 8, NULL
, 0x40,
3285 "Sequence Bit", HFILL
}},
3287 { &hf_l2tp_l2_spec_h
,
3288 { "H-bits","l2tp.l2_spec_h", FT_UINT8
, BASE_HEX
, NULL
, 0x30,
3289 "Extended Header Bits", HFILL
}},
3291 { &hf_l2tp_l2_spec_t
,
3292 { "T-bit","l2tp.l2_spec_t", FT_BOOLEAN
, 8, NULL
, 0x08,
3293 "Transport Type Bit", HFILL
}},
3295 { &hf_l2tp_l2_spec_g
,
3296 { "G-bit","l2tp.l2_spec_g", FT_BOOLEAN
, 8, NULL
, 0x04,
3297 "EFCI Bit", HFILL
}},
3299 { &hf_l2tp_l2_spec_c
,
3300 { "C-bit","l2tp.l2_spec_c", FT_BOOLEAN
, 8, NULL
, 0x02,
3301 "CLP Bit", HFILL
}},
3303 { &hf_l2tp_l2_spec_u
,
3304 { "U-bit","l2tp.l2_spec_u", FT_BOOLEAN
, 8, NULL
, 0x01,
3305 "C/R Bit", HFILL
}},
3307 { &hf_l2tp_l2_spec_flow_id
,
3308 { "Flow ID","l2tp.l2_spec_flow_id", FT_UINT8
, BASE_HEX
, NULL
, FLOW_ID_MASK
,
3311 { &hf_l2tp_l2_spec_sequence
,
3312 { "Sequence Number","l2tp.l2_spec_sequence", FT_UINT24
, BASE_DEC
, NULL
, 0x0,
3315 { &hf_l2tp_cisco_avp_type
,
3316 { "Type", "l2tp.avp.ciscotype", FT_UINT16
, BASE_DEC
, VALS(cisco_avp_type_vals
), 0,
3317 "AVP Type", HFILL
}},
3319 { &hf_l2tp_ericsson_avp_type
,
3320 { "Type", "l2tp.avp.ericssontype", FT_UINT16
, BASE_DEC
, VALS(ericsson_avp_type_vals
), 0,
3321 "AVP Type", HFILL
}},
3323 { &hf_l2tp_broadband_avp_type
,
3324 { "Type", "l2tp.avp.broadbandtype", FT_UINT16
, BASE_DEC
, VALS(broadband_avp_type_vals
), 0,
3325 "AVP Type", HFILL
}},
3327 { &hf_l2tp_cablelabs_avp_type
,
3328 { "Type", "l2tp.avp.cablelabstype", FT_UINT16
, BASE_DEC
, VALS(cablelabs_avp_type_vals
), 0,
3329 "AVP Type", HFILL
}},
3331 { &hf_l2tp_avp_message_type
,
3332 { "Message Type", "l2tp.avp.message_type", FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &message_type_vals_ext
, 0,
3335 { &hf_l2tp_avp_assigned_tunnel_id
,
3336 { "Assigned Tunnel ID", "l2tp.avp.assigned_tunnel_id", FT_UINT16
, BASE_DEC
, NULL
, 0,
3339 { &hf_l2tp_avp_assigned_control_conn_id
,
3340 { "Assigned Control Connection ID", "l2tp.avp.assigned_control_conn_id", FT_UINT32
, BASE_DEC
, NULL
, 0,
3343 { &hf_l2tp_avp_assigned_session_id
,
3344 { "Assigned Session ID", "l2tp.avp.assigned_session_id", FT_UINT16
, BASE_DEC
, NULL
, 0,
3347 { &hf_l2tp_avp_remote_session_id
,
3348 { "Remote Session ID", "l2tp.avp.remote_session_id", FT_UINT32
, BASE_DEC
, NULL
, 0,
3351 { &hf_l2tp_avp_local_session_id
,
3352 { "Local Session ID", "l2tp.avp.local_session_id", FT_UINT32
, BASE_DEC
, NULL
, 0,
3355 { &hf_l2tp_avp_called_number
,
3356 { "Called Number", "l2tp.avp.called_number", FT_STRING
, BASE_NONE
, NULL
, 0,
3359 { &hf_l2tp_avp_calling_number
,
3360 { "Calling Number", "l2tp.avp.calling_number", FT_STRING
, BASE_NONE
, NULL
, 0,
3363 { &hf_l2tp_cisco_tie_breaker
,
3364 { "Tie Breaker", "l2tp.cisco.tie_breaker", FT_UINT64
, BASE_HEX
, NULL
, 0,
3367 { &hf_l2tp_cablel_avp_l_bit
,
3368 { "L(lock bit)", "l2tp.cablel.l_bit", FT_BOOLEAN
, 16, NULL
, 0x8000,
3371 { &hf_l2tp_cablel_avp_tsid_group_id
,
3372 { "TSID Group ID", "l2tp.cablel.tsid_group_id", FT_UINT16
, BASE_DEC
, NULL
, 0x7f00,
3375 { &hf_l2tp_cablel_avp_frequency
,
3376 { "Frequency", "l2tp.cablel.frequency", FT_UINT32
, BASE_DEC
, NULL
, 0,
3379 { &hf_l2tp_cablel_avp_modulation
,
3380 { "Modulation", "l2tp.cablel.modulation", FT_UINT16
, BASE_DEC
, VALS(l2tp_cablel_modulation_vals
), 0x000f,
3383 { &hf_l2tp_cablel_avp_m
,
3384 { "M", "l2tp.cablel.m", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3387 { &hf_l2tp_cablel_avp_n
,
3388 { "N", "l2tp.cablel.n", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3391 { &hf_l2tp_broadband_agent_circuit_id
,
3392 { "Agent Circuit ID", "l2tp.broadband.agent_circuit_id", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3395 { &hf_l2tp_broadband_agent_remote_id
,
3396 { "Agent Remote ID", "l2tp.broadband.agent_remote_id", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3399 { &hf_l2tp_broadband_actual_dr_up
,
3400 { "Actual Data Rate Upstream", "l2tp.broadband.actual_dr_up", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3401 "Actual Data Rate Upstream in bits per seconds", HFILL
}},
3403 { &hf_l2tp_broadband_actual_dr_down
,
3404 { "Actual Data Rate Downstream", "l2tp.broadband.actual_dr_down", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3405 "Actual Data Rate Downstream in bits per seconds", HFILL
}},
3407 { &hf_l2tp_broadband_minimum_dr_up
,
3408 { "Minimum Data Rate Upstream", "l2tp.broadband.minimum_dr_up", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3409 "Minimum Data Rate Upstream in bits per seconds", HFILL
}},
3411 { &hf_l2tp_broadband_minimum_dr_down
,
3412 { "Minimum Data Rate Downstream", "l2tp.broadband.minimum_dr_down", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3413 "Minimum Data Rate Downstream in bits per seconds", HFILL
}},
3415 { &hf_l2tp_broadband_attainable_dr_up
,
3416 { "Attainable Data Rate Upstream", "l2tp.broadband.attainable_dr_up", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3417 "Attainable Data Rate Upstream in bits per seconds", HFILL
}},
3419 { &hf_l2tp_broadband_attainable_dr_down
,
3420 { "Attainable Data Rate Downstream", "l2tp.broadband.attainable_dr_down", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3421 "Attainable Data Rate Downstream in bits per seconds", HFILL
}},
3423 { &hf_l2tp_broadband_maximum_dr_up
,
3424 { "Maximum Data Rate Upstream", "l2tp.broadband.maximum_dr_up", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3425 "Maximum Data Rate Upstream in bits per seconds", HFILL
}},
3427 { &hf_l2tp_broadband_maximum_dr_down
,
3428 { "Maximum Data Rate Downstream", "l2tp.broadband.maximum_dr_down", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3429 "Maximum Data Rate Downstream in bits per seconds", HFILL
}},
3431 { &hf_l2tp_broadband_minimum_dr_up_low_power
,
3432 { "Minimum Data Rate Upstream Low-Power", "l2tp.broadband.minimum_dr_up_low_power", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3433 "Minimum Data Rate Upstream Low-Power in bits per seconds", HFILL
}},
3435 { &hf_l2tp_broadband_minimum_dr_down_low_power
,
3436 { "Minimum Data Rate Downstream Low-Power", "l2tp.broadband.minimum_dr_down_low_power", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3437 "Minimum Data Rate Downstream Low-Power in bits per seconds", HFILL
}},
3439 { &hf_l2tp_broadband_maximum_interleaving_delay_up
,
3440 { "Maximum Interleaving Delay Upstream", "l2tp.broadband.maximum_interleaving_delay_up", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3441 "Maximum Interleaving Delay Upstream in ms", HFILL
}},
3443 { &hf_l2tp_broadband_actual_interleaving_delay_up
,
3444 { "Actual Interleaving Delay Upstream", "l2tp.broadband.actual_interleaving_delay_up", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3445 "Actual Interleaving Delay Upstream in ms", HFILL
}},
3447 { &hf_l2tp_broadband_maximum_interleaving_delay_down
,
3448 { "Maximum Interleaving Delay Downstream", "l2tp.broadband.maximum_interleaving_delay_down", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3449 "Maximum Interleaving Delay Downstream in ms", HFILL
}},
3451 { &hf_l2tp_broadband_actual_interleaving_delay_down
,
3452 { "Actual Interleaving Delay Downstream", "l2tp.broadband.actual_interleaving_delay_down", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3453 "Actual Interleaving Delay Downstream in ms", HFILL
}},
3455 { &hf_l2tp_broadband_access_loop_encapsulation
,
3456 { "Access Loop Encapsulation", "l2tp.broadband.access_loop_encapsulation", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3459 { &hf_l2tp_broadband_access_loop_encapsulation_data_link
,
3460 { "Data Link", "l2tp.broadband.access_loop_encapsulation.data_link", FT_UINT8
, BASE_HEX
, VALS(ale_datalink_types_vals
), 0x0,
3463 { &hf_l2tp_broadband_access_loop_encapsulation_enc1
,
3464 { "Encaps 1", "l2tp.broadband.access_loop_encapsulation.enc1", FT_UINT8
, BASE_HEX
, VALS(ale_enc1_types_vals
), 0x0,
3467 { &hf_l2tp_broadband_access_loop_encapsulation_enc2
,
3468 { "Encaps 2", "l2tp.broadband.access_loop_encapsulation.enc2", FT_UINT8
, BASE_HEX
, VALS(ale_enc2_types_vals
), 0x0,
3471 { &hf_l2tp_broadband_ancp_access_line_type
,
3472 { "ANCP Access Line Type", "l2tp.broadband.ancp_access_line_type", FT_UINT32
, BASE_HEX
, VALS(ancp_types_vals
), 0x0,
3475 { &hf_l2tp_broadband_iwf_session
,
3476 { "IWF Session", "l2tp.broadband.iwf_session", FT_UINT32
, BASE_HEX
, VALS(iwf_types_vals
), 0x0,
3480 { "Connect Speed Update","l2tp.avp.csu", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3483 { &hf_l2tp_avp_csu_res
,
3484 { "Reserved", "l2tp.avp.csu.res", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
3487 { &hf_l2tp_avp_csu_remote_session_id_v2
,
3488 { "Remote Session ID", "l2tp.avp.csu.remote_session_id", FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x0,
3491 { &hf_l2tp_avp_csu_current_tx_speed_v2
,
3492 { "Current TX Connect Speed", "l2tp.avp.csu.current_tx_speed", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3493 "Current TX Connect Speed in bps", HFILL
}},
3495 { &hf_l2tp_avp_csu_current_rx_speed_v2
,
3496 { "Current RX Connect Speed", "l2tp.avp.csu.current_rx_speed", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3497 "Current RX Connect Speed in bps", HFILL
}},
3499 { &hf_l2tp_avp_csu_remote_session_id_v3
,
3500 { "Remote Session ID", "l2tp.avp.csu.remote_session_id", FT_UINT32
, BASE_DEC_HEX
, NULL
, 0x0,
3503 { &hf_l2tp_avp_csu_current_tx_speed_v3
,
3504 { "Current TX Connect Speed", "l2tp.avp.csu.current_tx_speed64", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3505 "Current TX Connect Speed in bps", HFILL
}},
3507 { &hf_l2tp_avp_csu_current_rx_speed_v3
,
3508 { "Current RX Connect Speed", "l2tp.avp.csu.current_rx_speed64", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3509 "Current RX Connect Speed in bps", HFILL
}},
3511 { &hf_l2tp_ericsson_msg_type
,
3512 { "Ericsson Message Type", "l2tp.ericsson.msg_type", FT_UINT16
, BASE_DEC
, VALS(ericsson_msg_type_vals
), 0x0,
3515 { &hf_l2tp_ericsson_conn_type
,
3516 { "Connection Type", "l2tp.ericsson.conn_type", FT_UINT8
, BASE_DEC
, VALS(ericsson_conn_type_vals
), 0x0,
3519 { &hf_l2tp_ericsson_stn_name
,
3520 { "STN Name", "l2tp.ericsson.stn_name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3523 { &hf_l2tp_ericsson_crc32_enable
,
3524 { "CRC32 Enabled", "l2tp.ericsson.crc32_enable", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3527 { &hf_l2tp_ericsson_abis_lower_mode
,
3528 { "Abis Lower Type", "l2tp.ericsson.abis_lower_mode", FT_UINT8
, BASE_DEC
, VALS(ericsson_abis_lower_mode_vals
), 0x0,
3531 { &hf_l2tp_ericsson_tc_overl_thresh
,
3532 { "Overload Threshold in 0.1%", "l2tp.ericsson.overload_thresh", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3535 { &hf_l2tp_ericsson_tc_num_groups
,
3536 { "Number of Transport Config Groups", "l2tp.ericsson.tc_num_groups", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3539 { &hf_l2tp_ericsson_tcg_group_id
,
3540 { "Transport Config Group ID", "l2tp.ericsson.tc_group_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3543 { &hf_l2tp_ericsson_tcg_num_sapis
,
3544 { "Number of SAPIs in Transport Group", "l2tp.ericsson.tc_num_sapi", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3547 { &hf_l2tp_ericsson_tcg_sapi
,
3548 { "TCG SAPI", "l2tp.ericsson.tcg_sapi", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3551 { &hf_l2tp_ericsson_tcg_ip
,
3552 { "TCG IP Address", "l2tp.ericsson.tcg_ip", FT_IPv4
, BASE_NONE
, NULL
, 0x0,
3555 { &hf_l2tp_ericsson_tcg_dscp
,
3556 { "TCG DSCP", "l2tp.ericsson.tcg_dscp", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
3559 { &hf_l2tp_ericsson_tcg_crc32_enable
,
3560 { "CRC32 Enabled", "l2tp.ericsson.crc32_en", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3563 { &hf_l2tp_ericsson_tcg_bundling_tout
,
3564 { "TCG Bundling Timeout (ms)", "l2tp.ericsson.gcg.bundle_tout", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3567 { &hf_l2tp_ericsson_tcg_bundling_max_pkt
,
3568 { "TCG Bundling Max Packet Size", "l2tp.ericsson.tcg.bundle_max_pkt", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3571 { &hf_l2tp_ericsson_tc_num_maps
,
3572 { "Number of TEI-SC Maps", "l2tp.ericsson.num_maps", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3575 { &hf_l2tp_ericsson_map_tei_low
,
3576 { "TEI Range Lowest Value", "l2tp.ericsson.map_tei_low", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3579 { &hf_l2tp_ericsson_map_tei_high
,
3580 { "TEI Range Highest Value", "l2tp.ericsson.map_tei_high", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3583 { &hf_l2tp_ericsson_map_sc
,
3584 { "Super Channel", "l2tp.ericsson.map_ssc", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3587 { &hf_l2tp_ericsson_ver_pref
,
3588 { "Preferred/Chosen Version", "l2tp.ericsson.ver_pref", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3591 { &hf_l2tp_ericsson_ver_2
,
3592 { "Version (2)", "l2tp.ericsson.ver_2", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3595 { &hf_l2tp_ericsson_ver_3
,
3596 { "Version (3)", "l2tp.ericsson.ver_3", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3599 /* Generated from convert_proto_tree_add_text.pl */
3600 { &hf_l2tp_cisco_assigned_control_connection_id
, { "Assigned Control Connection ID", "l2tp.cisco.assigned_control_connection_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3601 { &hf_l2tp_cisco_pw_type
, { "PW Type", "l2tp.cisco.pw_type", FT_UINT16
, BASE_DEC
, VALS(pw_types_vals
), 0x0, NULL
, HFILL
}},
3602 { &hf_l2tp_cisco_local_session_id
, { "Local Session ID", "l2tp.cisco.local_session_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3603 { &hf_l2tp_cisco_remote_session_id
, { "Remote Session ID", "l2tp.cisco.remote_session_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3604 { &hf_l2tp_cisco_assigned_cookie
, { "Assigned Cookie", "l2tp.cisco.assigned_cookie", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3605 { &hf_l2tp_cisco_remote_end_id
, { "Remote End ID", "l2tp.cisco.remote_end_id", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3606 { &hf_l2tp_cisco_pseudowire_type
, { "Pseudowire Type", "l2tp.cisco.pseudowire_type", FT_UINT16
, BASE_DEC
, VALS(pw_types_vals
), 0x0, NULL
, HFILL
}},
3607 { &hf_l2tp_cisco_circuit_status
, { "Circuit Status", "l2tp.cisco.circuit_status", FT_BOOLEAN
, 16, TFS(&tfs_up_down
), 0x0001, NULL
, HFILL
}},
3608 { &hf_l2tp_cisco_circuit_type
, { "Circuit Type", "l2tp.cisco.circuit_type", FT_BOOLEAN
, 16, TFS(&tfs_new_existing
), 0x0001, NULL
, HFILL
}},
3609 { &hf_l2tp_cisco_draft_avp_version
, { "Draft AVP Version", "l2tp.cisco.draft_avp_version", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3610 { &hf_l2tp_cisco_message_digest
, { "Message Digest", "l2tp.cisco.message_digest", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3611 { &hf_l2tp_cisco_nonce
, { "Nonce", "l2tp.cisco.nonce", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3612 { &hf_l2tp_cisco_interface_mtu
, { "Interface MTU", "l2tp.cisco.interface_mtu", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3613 { &hf_l2tp_stop_ccn_result_code
, { "Result code", "l2tp.result_code", FT_UINT16
, BASE_DEC
, VALS(result_code_stopccn_vals
), 0x0, NULL
, HFILL
}},
3614 { &hf_l2tp_result_code
, { "Result code", "l2tp.result_code", FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &result_code_cdn_vals_ext
, 0x0, NULL
, HFILL
}},
3615 { &hf_l2tp_avp_error_code
, { "Error code", "l2tp.avp.error_code", FT_UINT16
, BASE_DEC
, VALS(error_code_vals
), 0x0, NULL
, HFILL
}},
3616 { &hf_l2tp_avp_error_message
, { "Error Message", "l2tp.avp.error_message", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3617 { &hf_l2tp_avp_protocol_version
, { "Version", "l2tp.avp.protocol_version", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3618 { &hf_l2tp_avp_protocol_revision
, { "Revision", "l2tp.avp.protocol_revision", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3619 { &hf_l2tp_avp_async_framing_supported
, { "Async Framing Supported", "l2tp.avp.async_framing_supported", FT_BOOLEAN
, 32, NULL
, 0x00000002, NULL
, HFILL
}},
3620 { &hf_l2tp_avp_sync_framing_supported
, { "Sync Framing Supported", "l2tp.avp.sync_framing_supported", FT_BOOLEAN
, 32, NULL
, 0x00000001, NULL
, HFILL
}},
3621 { &hf_l2tp_avp_analog_access_supported
, { "Analog Access Supported", "l2tp.avp.analog_access_supported", FT_BOOLEAN
, 32, NULL
, 0x00000002, NULL
, HFILL
}},
3622 { &hf_l2tp_avp_digital_access_supported
, { "Digital Access Supported", "l2tp.avp.digital_access_supported", FT_BOOLEAN
, 32, NULL
, 0x00000001, NULL
, HFILL
}},
3623 { &hf_l2tp_avp_firmware_revision
, { "Firmware Revision", "l2tp.avp.firmware_revision", FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x0, NULL
, HFILL
}},
3624 { &hf_l2tp_avp_host_name
, { "Host Name", "l2tp.avp.host_name", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3625 { &hf_l2tp_avp_vendor_name
, { "Vendor Name", "l2tp.avp.vendor_name", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3626 { &hf_l2tp_avp_receive_window_size
, { "Receive Window Size", "l2tp.avp.receive_window_size", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3627 { &hf_l2tp_avp_chap_challenge
, { "CHAP Challenge", "l2tp.avp.chap_challenge", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3628 { &hf_l2tp_avp_cause_code
, { "Cause Code", "l2tp.avp.cause_code", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3629 { &hf_l2tp_avp_cause_msg
, { "Cause Msg", "l2tp.avp.cause_msg", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3630 { &hf_l2tp_avp_advisory_msg
, { "Advisory Msg", "l2tp.avp.advisory_msg", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3631 { &hf_l2tp_avp_chap_challenge_response
, { "CHAP Challenge Response", "l2tp.avp.chap_challenge_response", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3632 { &hf_l2tp_avp_call_serial_number
, { "Call Serial Number", "l2tp.avp.call_serial_number", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3633 { &hf_l2tp_avp_minimum_bps
, { "Minimum BPS", "l2tp.avp.minimum_bps", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3634 { &hf_l2tp_avp_maximum_bps
, { "Maximum BPS", "l2tp.avp.maximum_bps", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3635 { &hf_l2tp_avp_analog_bearer_type
, { "Analog Bearer Type", "l2tp.avp.analog_bearer_type", FT_BOOLEAN
, 32, NULL
, 0x00000002, NULL
, HFILL
}},
3636 { &hf_l2tp_avp_digital_bearer_type
, { "Digital Bearer Type", "l2tp.avp.digital_bearer_type", FT_BOOLEAN
, 32, NULL
, 0x00000001, NULL
, HFILL
}},
3637 { &hf_l2tp_avp_async_framing_type
, { "Async Framing Type", "l2tp.avp.async_framing_type", FT_BOOLEAN
, 32, NULL
, 0x00000002, NULL
, HFILL
}},
3638 { &hf_l2tp_avp_sync_framing_type
, { "Sync Framing Type", "l2tp.avp.sync_framing_type", FT_BOOLEAN
, 32, NULL
, 0x00000001, NULL
, HFILL
}},
3639 { &hf_l2tp_avp_sub_address
, { "Sub-Address", "l2tp.avp.sub_address", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3640 { &hf_l2tp_avp_connect_speed
, { "Connect Speed", "l2tp.avp.connect_speed", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3641 { &hf_l2tp_avp_physical_channel
, { "Physical Channel", "l2tp.avp.physical_channel", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3642 { &hf_l2tp_avp_initial_received_lcp_confreq
, { "Initial Received LCP CONFREQ", "l2tp.avp.initial_received_lcp_confreq", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3643 { &hf_l2tp_avp_last_sent_lcp_confreq
, { "Last Sent LCP CONFREQ", "l2tp.avp.last_sent_lcp_confreq", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3644 { &hf_l2tp_avp_last_received_lcp_confreq
, { "Last Received LCP CONFREQ", "l2tp.avp.last_received_lcp_confreq", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3645 { &hf_l2tp_avp_proxy_authen_type
, { "Proxy Authen Type", "l2tp.avp.proxy_authen_type", FT_UINT16
, BASE_DEC
, VALS(authen_type_vals
), 0x0, NULL
, HFILL
}},
3646 { &hf_l2tp_avp_proxy_authen_name
, { "Proxy Authen Name", "l2tp.avp.proxy_authen_name", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3647 { &hf_l2tp_avp_proxy_authen_challenge
, { "Proxy Authen Challenge", "l2tp.avp.proxy_authen_challenge", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3648 { &hf_l2tp_avp_proxy_authen_id
, { "Proxy Authen ID", "l2tp.avp.proxy_authen_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3649 { &hf_l2tp_avp_proxy_authen_response
, { "Proxy Authen Response", "l2tp.avp.proxy_authen_response", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3650 { &hf_l2tp_avp_crc_errors
, { "CRC Errors", "l2tp.avp.crc_errors", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3651 { &hf_l2tp_avp_framing_errors
, { "Framing Errors", "l2tp.avp.framing_errors", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3652 { &hf_l2tp_avp_hardware_overruns
, { "Hardware Overruns", "l2tp.avp.hardware_overruns", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3653 { &hf_l2tp_avp_buffer_overruns
, { "Buffer Overruns", "l2tp.avp.buffer_overruns", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3654 { &hf_l2tp_avp_time_out_errors
, { "Time-out Errors", "l2tp.avp.time_out_errors", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3655 { &hf_l2tp_avp_alignment_errors
, { "Alignment Errors", "l2tp.avp.alignment_errors", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3656 { &hf_l2tp_avp_send_accm
, { "Send ACCM", "l2tp.avp.send_accm", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3657 { &hf_l2tp_avp_receive_accm
, { "Receive ACCM", "l2tp.avp.receive_accm", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3658 { &hf_l2tp_avp_random_vector
, { "Random Vector", "l2tp.avp.random_vector", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3659 { &hf_l2tp_avp_private_group_id
, { "Private Group ID", "l2tp.avp.private_group_id", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3660 { &hf_l2tp_avp_rx_connect_speed
, { "Rx Connect Speed", "l2tp.avp.rx_connect_speed", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3661 { &hf_l2tp_avp_disconnect_code
, { "Disconnect Code", "l2tp.avp.disconnect_code", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3662 { &hf_l2tp_avp_control_protocol_number
, { "Control Protocol Number", "l2tp.avp.control_protocol_number", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3663 { &hf_l2tp_avp_cause_code_direction
, { "Direction", "l2tp.avp.cause_code_direction", FT_UINT8
, BASE_DEC
, VALS(cause_code_direction_vals
), 0x0, NULL
, HFILL
}},
3664 { &hf_l2tp_avp_cause_code_message
, { "Message", "l2tp.avp.cause_code_message", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3665 { &hf_l2tp_avp_message_digest
, { "Message Digest", "l2tp.avp.message_digest", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3666 { &hf_l2tp_avp_router_id
, { "Router ID", "l2tp.avp.router_id", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
3667 { &hf_l2tp_avp_pw_type
, { "PW Type", "l2tp.avp.pw_type", FT_UINT16
, BASE_DEC
, VALS(pw_types_vals
), 0x0, NULL
, HFILL
}},
3668 { &hf_l2tp_avp_assigned_cookie
, { "Assigned Cookie", "l2tp.avp.assigned_cookie", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3669 { &hf_l2tp_avp_remote_end_id
, { "Remote End ID", "l2tp.avp.remote_end_id", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3670 { &hf_l2tp_avp_pseudowire_type
, { "Pseudowire Type", "l2tp.avp.pseudowire_type", FT_UINT16
, BASE_DEC
, VALS(pw_types_vals
), 0x0, NULL
, HFILL
}},
3671 { &hf_l2tp_avp_layer2_specific_sublayer
, { "Layer2 Specific Sublayer", "l2tp.avp.layer2_specific_sublayer", FT_UINT16
, BASE_DEC
, VALS(l2_sublayer_vals
), 0x0, NULL
, HFILL
}},
3672 { &hf_l2tp_avp_data_sequencing
, { "Data Sequencing", "l2tp.avp.data_sequencing", FT_UINT16
, BASE_DEC
, VALS(data_sequencing_vals
), 0x0, NULL
, HFILL
}},
3673 { &hf_l2tp_avp_circuit_status
, { "Circuit Status", "l2tp.avp.circuit_status", FT_BOOLEAN
, 16, TFS(&tfs_up_down
), 0x0001, NULL
, HFILL
}},
3674 { &hf_l2tp_avp_circuit_type
, { "Circuit Type", "l2tp.avp.circuit_type", FT_BOOLEAN
, 16, TFS(&tfs_new_existing
), 0x0002, NULL
, HFILL
}},
3675 { &hf_l2tp_avp_preferred_language
, { "Preferred Language", "l2tp.avp.preferred_language", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3676 { &hf_l2tp_avp_nonce
, { "Nonce", "l2tp.avp.nonce", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3677 { &hf_l2tp_avp_tx_connect_speed_v3
, { "Tx Connect Speed v3", "l2tp.avp.tx_connect_speed_v3", FT_UINT64
, BASE_HEX
|BASE_VAL64_STRING
|BASE_SPECIAL_VALS
, VALS64(unique_indeterminable_or_no_link
), 0x0, NULL
, HFILL
}},
3678 { &hf_l2tp_avp_rx_connect_speed_v3
, { "Rx Connect Speed v3", "l2tp.avp.rx_connect_speed_v3", FT_UINT64
, BASE_HEX
|BASE_VAL64_STRING
|BASE_SPECIAL_VALS
, VALS64(unique_indeterminable_or_no_link
), 0x0, NULL
, HFILL
}},
3679 { &hf_l2tp_lapd_info
, { "LAPD info", "l2tp.lapd_info", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3680 { &hf_l2tp_zero_length_body_message
, { "Zero Length Body message", "l2tp.zero_length_body_message", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3681 { &hf_l2tp_offset_padding
, { "Offset Padding", "l2tp.offset_padding", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
3684 static int *ett
[] = {
3693 &ett_l2tp_ericsson_tcg
,
3694 &ett_l2tp_ericsson_map
,
3697 static ei_register_info ei
[] = {
3698 { &ei_l2tp_incorrect_digest
, { "l2tp.incorrect_digest", PI_CHECKSUM
, PI_WARN
, "Incorrect Digest", EXPFILL
}},
3699 /* Generated from convert_proto_tree_add_text.pl */
3700 { &ei_l2tp_vendor_specific_avp_data
, { "l2tp.vendor_specific_avp_data", PI_UNDECODED
, PI_WARN
, "Vendor-Specific AVP data", EXPFILL
}},
3701 { &ei_l2tp_avp_length
, { "l2tp.avp_length.bad", PI_MALFORMED
, PI_ERROR
, "Bad AVP length", EXPFILL
}},
3704 module_t
*l2tp_module
;
3705 expert_module_t
* expert_l2tp
;
3707 /* Decode As handling */
3708 static build_valid_func l2tp_da_build_value
[1] = {l2tp_value
};
3709 static decode_as_value_t l2tp_da_values
= {l2tp_prompt
, 1, l2tp_da_build_value
};
3710 static decode_as_t l2tp_da
= {"l2tp", "l2tp.pw_type", 1, 0, &l2tp_da_values
, NULL
, NULL
,
3711 decode_as_default_populate_list
, decode_as_default_reset
, decode_as_default_change
, NULL
};
3713 proto_l2tp
= proto_register_protocol("Layer 2 Tunneling Protocol", "L2TP", "l2tp");
3714 l2tp_udp_handle
= register_dissector("lt2p_udp", dissect_l2tp_udp
, proto_l2tp
);
3715 l2tp_ip_handle
= register_dissector("l2tp_ip", dissect_l2tp_ip
, proto_l2tp
);
3716 atm_oam_llc_handle
= register_dissector("atm_oam_llc", dissect_atm_oam_llc
, proto_l2tp
);
3717 proto_register_field_array(proto_l2tp
, hf
, array_length(hf
));
3718 proto_register_subtree_array(ett
, array_length(ett
));
3719 expert_l2tp
= expert_register_protocol(proto_l2tp
);
3720 expert_register_field_array(expert_l2tp
, ei
, array_length(ei
));
3722 l2tp_vendor_avp_dissector_table
= register_dissector_table("l2tp.vendor_avp", "L2TP vendor AVP dissector table", proto_l2tp
, FT_UINT32
, BASE_DEC
);
3723 pw_type_table
= register_dissector_table("l2tp.pw_type", "L2TPv3 pseudowire type", proto_l2tp
, FT_UINT32
, BASE_DEC
);
3725 l2tp_module
= prefs_register_protocol(proto_l2tp
, NULL
);
3727 prefs_register_enum_preference(l2tp_module
,
3729 "L2TPv3 Cookie Size",
3730 "L2TPv3 Cookie Size",
3735 prefs_register_enum_preference(l2tp_module
,
3737 "L2TPv3 L2-Specific Sublayer",
3738 "L2TPv3 L2-Specific Sublayer",
3739 &l2tpv3_l2_specific
,
3740 l2tpv3_l2_specifics
,
3743 prefs_register_static_text_preference(l2tp_module
, "protocol",
3744 "Dissection of pseudowire types is configured through \"Decode As\". "
3745 "Type 0 is used for sessions with unknown pseudowire type.",
3746 "Pseudowire Type \"Decode As\" instructions");
3748 prefs_register_string_preference(l2tp_module
,"shared_secret","Shared Secret",
3749 "Shared secret used for control message digest authentication",
3752 register_cleanup_routine(l2tp_cleanup
);
3753 register_decode_as(&l2tp_da
);
3757 proto_reg_handoff_l2tp(void)
3759 dissector_add_uint_with_preference("udp.port", UDP_PORT_L2TP
, l2tp_udp_handle
);
3760 dissector_add_uint("ip.proto", IP_PROTO_L2TP
, l2tp_ip_handle
);
3763 * Get a handle for the PPP-in-HDLC-like-framing dissector.
3765 ppp_hdlc_handle
= find_dissector_add_dependency("ppp_hdlc", proto_l2tp
);
3766 ppp_lcp_options_handle
= find_dissector_add_dependency("ppp_lcp_options", proto_l2tp
);
3768 /* Register vendor AVP dissector(s)*/
3769 dissector_add_uint("l2tp.vendor_avp", VENDOR_CABLELABS
, create_dissector_handle(dissect_l2tp_vnd_cablelabs_avps
, proto_l2tp
));
3773 * Get a handle for the dissectors used in v3.
3775 atm_oam_handle
= find_dissector_add_dependency("atm_oam_cell", proto_l2tp
);
3776 llc_handle
= find_dissector_add_dependency("llc", proto_l2tp
);
3778 dissector_add_uint("l2tp.pw_type", L2TPv3_PW_AAL5
, atm_oam_llc_handle
);
3781 * XXX: Should we register something (Ethernet?) to L2TPv3_PW_DEFAULT?
3782 * The user could always change it with Decode As.
3787 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3792 * indent-tabs-mode: nil
3795 * vi: set shiftwidth=4 tabstop=8 expandtab:
3796 * :indentSize=4:tabSize=8:noTabs=true: