2 * Routines for the Point-to-Point Tunnelling Protocol (PPTP) (RFC 2637)
3 * Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
5 * 10/2010 - Rework PPTP Dissector
6 * Alexis La Goutte <alexis.lagoutte at gmail dot com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include <epan/packet.h>
18 #include <epan/expert.h>
20 void proto_register_pptp(void);
21 void proto_reg_handoff_pptp(void);
23 static dissector_handle_t pptp_handle
;
25 static int proto_pptp
;
26 static int hf_pptp_length
;
27 static int hf_pptp_message_type
;
28 static int hf_pptp_magic_cookie
;
29 static int hf_pptp_control_message_type
;
30 static int hf_pptp_reserved
;
31 static int hf_pptp_protocol_version
;
32 static int hf_pptp_framing_capabilities
;
33 static int hf_pptp_bearer_capabilities
;
34 static int hf_pptp_maximum_channels
;
35 static int hf_pptp_firmware_revision
;
36 static int hf_pptp_host_name
;
37 static int hf_pptp_vendor_name
;
38 static int hf_pptp_control_result
;
39 static int hf_pptp_error
;
40 static int hf_pptp_reason
;
41 static int hf_pptp_stop_result
;
42 static int hf_pptp_identifier
;
43 static int hf_pptp_echo_result
;
44 static int hf_pptp_call_id
;
45 static int hf_pptp_call_serial_number
;
46 static int hf_pptp_minimum_bps
;
47 static int hf_pptp_maximum_bps
;
48 static int hf_pptp_bearer_type
;
49 static int hf_pptp_framing_type
;
50 static int hf_pptp_packet_receive_window_size
;
51 static int hf_pptp_packet_processing_delay
;
52 static int hf_pptp_phone_number_length
;
53 static int hf_pptp_phone_number
;
54 static int hf_pptp_subaddress
;
55 static int hf_pptp_peer_call_id
;
56 static int hf_pptp_out_result
;
57 static int hf_pptp_cause
;
58 static int hf_pptp_connect_speed
;
59 static int hf_pptp_physical_channel_id
;
60 static int hf_pptp_dialed_number_length
;
61 static int hf_pptp_dialed_number
;
62 static int hf_pptp_dialing_number_length
;
63 static int hf_pptp_dialing_number
;
64 static int hf_pptp_in_result
;
65 static int hf_pptp_disc_result
;
66 static int hf_pptp_call_statistics
;
67 static int hf_pptp_crc_errors
;
68 static int hf_pptp_framing_errors
;
69 static int hf_pptp_hardware_overruns
;
70 static int hf_pptp_buffer_overruns
;
71 static int hf_pptp_timeout_errors
;
72 static int hf_pptp_alignment_errors
;
73 static int hf_pptp_send_accm
;
74 static int hf_pptp_receive_accm
;
78 static expert_field ei_pptp_incorrect_magic_cookie
;
80 #define TCP_PORT_PPTP 1723
82 #define MAGIC_COOKIE 0x1A2B3C4D
84 #define CNTRL_REQ 0x01
85 #define CNTRL_REPLY 0x02
87 #define STOP_REPLY 0x04
89 #define ECHO_REPLY 0x06
91 #define OUT_REPLY 0x08
94 #define IN_CONNECTED 0x0B
95 #define CLEAR_REQ 0x0C
96 #define DISC_NOTIFY 0x0D
97 #define ERROR_NOTIFY 0x0E
100 static const value_string control_message_type_vals
[] = {
101 { CNTRL_REQ
, "Start-Control-Connection-Request" },
102 { CNTRL_REPLY
, "Start-Control-Connection-Reply" },
103 { STOP_REQ
, "Stop-Control-Connection-Request" },
104 { STOP_REPLY
, "Stop-Control-Connection-Reply" },
105 { ECHO_REQ
, "Echo-Request" },
106 { ECHO_REPLY
, "Echo-Reply" },
107 { OUT_REQ
, "Outgoing-Call-Request" },
108 { OUT_REPLY
, "Outgoing-Call-Reply" },
109 { IN_REQ
, "Incoming-Call-Request" },
110 { IN_REPLY
, "Incoming-Call-Reply" },
111 { IN_CONNECTED
, "Incoming-Call-Connected" },
112 { CLEAR_REQ
, "Call-Clear-Request" },
113 { DISC_NOTIFY
, "Call-Disconnect-Notify" },
114 { ERROR_NOTIFY
, "WAN-Error-Notify" },
115 { SET_LINK
, "Set-Link-Info" },
118 static const value_string msgtype_vals
[] = {
119 { 1, "Control Message" },
120 { 2, "Management Message" },
124 static const value_string frametype_vals
[] = {
125 { 1, "Asynchronous Framing supported" },
126 { 2, "Synchronous Framing supported"},
127 { 3, "Either Framing supported" },
131 static const value_string bearertype_vals
[] = {
132 { 1, "Analog access supported" },
133 { 2, "Digital access supported" },
134 { 3, "Either access supported" },
138 static const value_string control_resulttype_vals
[] = {
139 { 1, "Successful channel establishment" },
140 { 2, "General error" },
141 { 3, "Command channel already exists" },
142 { 4, "Requester not authorized" },
143 { 5, "Protocol version not supported" },
147 static const value_string errortype_vals
[] = {
149 { 1, "Not-Connected" },
152 { 4, "No-Resource" },
153 { 5, "Bad-Call ID" },
158 static const value_string reasontype_vals
[] = {
160 { 2, "Stop-Protocol" },
161 { 3, "Stop-Local-Shutdown" },
165 static const value_string stop_resulttype_vals
[] = {
167 { 2, "General error" },
171 static const value_string echo_resulttype_vals
[] = {
173 { 2, "General error" },
177 static const value_string out_resulttype_vals
[] = {
179 { 2, "General Error" },
182 { 5, "No Dial Tone" },
184 { 7, "Do Not Accept" },
188 static const value_string in_resulttype_vals
[] = {
190 { 2, "General error" },
191 { 3, "Do Not Accept" },
195 static const value_string disc_resulttype_vals
[] = {
196 { 1, "Lost Carrier" },
197 { 2, "General Error" },
198 { 3, "Admin Shutdown" },
204 dissect_unknown(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
)
206 call_data_dissector(tvb_new_subset_remaining(tvb
, offset
), pinfo
, tree
);
210 dissect_cntrl_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
215 proto_tree_add_uint_format_value(tree
, hf_pptp_protocol_version
, tvb
, offset
,
216 2, tvb_get_ntohs(tvb
, offset
), "%u.%u",
217 tvb_get_uint8(tvb
, offset
), tvb_get_uint8(tvb
, offset
+ 1));
220 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
223 proto_tree_add_item(tree
, hf_pptp_framing_capabilities
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
226 proto_tree_add_item(tree
, hf_pptp_bearer_capabilities
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
229 proto_tree_add_item(tree
, hf_pptp_maximum_channels
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
232 proto_tree_add_item(tree
, hf_pptp_firmware_revision
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
235 proto_tree_add_item(tree
, hf_pptp_host_name
, tvb
, offset
, 64, ENC_ASCII
);
238 proto_tree_add_item(tree
, hf_pptp_vendor_name
, tvb
, offset
, 64, ENC_ASCII
);
242 dissect_cntrl_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
247 proto_tree_add_uint_format_value(tree
, hf_pptp_protocol_version
, tvb
, offset
,
248 2, tvb_get_ntohs(tvb
, offset
), "%u.%u",
249 tvb_get_uint8(tvb
, offset
), tvb_get_uint8(tvb
, offset
+ 1));
252 proto_tree_add_item(tree
, hf_pptp_control_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
255 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
258 proto_tree_add_item(tree
, hf_pptp_framing_capabilities
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
261 proto_tree_add_item(tree
, hf_pptp_bearer_capabilities
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
264 proto_tree_add_item(tree
, hf_pptp_maximum_channels
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
267 proto_tree_add_item(tree
, hf_pptp_firmware_revision
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
270 proto_tree_add_item(tree
, hf_pptp_host_name
, tvb
, offset
, 64, ENC_ASCII
);
273 proto_tree_add_item(tree
, hf_pptp_vendor_name
, tvb
, offset
, 64, ENC_ASCII
);
278 dissect_stop_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
283 proto_tree_add_item(tree
, hf_pptp_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
286 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 1, ENC_NA
);
289 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
293 dissect_stop_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
298 proto_tree_add_item(tree
, hf_pptp_stop_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
301 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
304 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
309 dissect_echo_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
314 proto_tree_add_item(tree
, hf_pptp_identifier
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
318 dissect_echo_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
323 proto_tree_add_item(tree
, hf_pptp_identifier
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
326 proto_tree_add_item(tree
, hf_pptp_echo_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
329 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
332 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
336 dissect_out_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
341 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
344 proto_tree_add_item(tree
, hf_pptp_call_serial_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
347 proto_tree_add_item(tree
, hf_pptp_minimum_bps
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
350 proto_tree_add_item(tree
, hf_pptp_maximum_bps
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
353 proto_tree_add_item(tree
, hf_pptp_bearer_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
356 proto_tree_add_item(tree
, hf_pptp_framing_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
359 proto_tree_add_item(tree
, hf_pptp_packet_receive_window_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
362 proto_tree_add_item(tree
, hf_pptp_packet_processing_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
365 proto_tree_add_item(tree
, hf_pptp_phone_number_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
368 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
371 proto_tree_add_item(tree
, hf_pptp_phone_number
, tvb
, offset
, 64, ENC_ASCII
);
374 proto_tree_add_item(tree
, hf_pptp_subaddress
, tvb
, offset
, 64, ENC_ASCII
);
378 dissect_out_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
383 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
386 proto_tree_add_item(tree
, hf_pptp_peer_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
389 proto_tree_add_item(tree
, hf_pptp_out_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
392 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
395 proto_tree_add_item(tree
, hf_pptp_cause
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
398 proto_tree_add_item(tree
, hf_pptp_connect_speed
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
401 proto_tree_add_item(tree
, hf_pptp_packet_receive_window_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
404 proto_tree_add_item(tree
, hf_pptp_packet_processing_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
407 proto_tree_add_item(tree
, hf_pptp_physical_channel_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
411 dissect_in_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
416 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
419 proto_tree_add_item(tree
, hf_pptp_call_serial_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
422 proto_tree_add_item(tree
, hf_pptp_bearer_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
425 proto_tree_add_item(tree
, hf_pptp_physical_channel_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
428 proto_tree_add_item(tree
, hf_pptp_dialed_number_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
431 proto_tree_add_item(tree
, hf_pptp_dialing_number_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
434 proto_tree_add_item(tree
, hf_pptp_dialed_number
, tvb
, offset
, 64, ENC_ASCII
);
437 proto_tree_add_item(tree
, hf_pptp_dialing_number
, tvb
, offset
, 64, ENC_ASCII
);
440 proto_tree_add_item(tree
, hf_pptp_subaddress
, tvb
, offset
, 64, ENC_ASCII
);
444 dissect_in_reply(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
449 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
452 proto_tree_add_item(tree
, hf_pptp_peer_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
455 proto_tree_add_item(tree
, hf_pptp_in_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
458 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
461 proto_tree_add_item(tree
, hf_pptp_packet_receive_window_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
464 proto_tree_add_item(tree
, hf_pptp_packet_processing_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
467 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
471 dissect_in_connected(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
476 proto_tree_add_item(tree
, hf_pptp_peer_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
479 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
482 proto_tree_add_item(tree
, hf_pptp_connect_speed
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
485 proto_tree_add_item(tree
, hf_pptp_packet_receive_window_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
488 proto_tree_add_item(tree
, hf_pptp_packet_processing_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
491 proto_tree_add_item(tree
, hf_pptp_framing_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
495 dissect_clear_req(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
500 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
503 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
507 dissect_disc_notify(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
512 proto_tree_add_item(tree
, hf_pptp_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
515 proto_tree_add_item(tree
, hf_pptp_disc_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
518 proto_tree_add_item(tree
, hf_pptp_error
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
521 proto_tree_add_item(tree
, hf_pptp_cause
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
524 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
527 proto_tree_add_item(tree
, hf_pptp_call_statistics
, tvb
, offset
, 64, ENC_ASCII
);
531 dissect_error_notify(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
536 proto_tree_add_item(tree
, hf_pptp_peer_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
539 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
542 proto_tree_add_item(tree
, hf_pptp_crc_errors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
545 proto_tree_add_item(tree
, hf_pptp_framing_errors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
548 proto_tree_add_item(tree
, hf_pptp_hardware_overruns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
551 proto_tree_add_item(tree
, hf_pptp_buffer_overruns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
554 proto_tree_add_item(tree
, hf_pptp_timeout_errors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
557 proto_tree_add_item(tree
, hf_pptp_alignment_errors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
561 dissect_set_link(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
566 proto_tree_add_item(tree
, hf_pptp_peer_call_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
569 proto_tree_add_item(tree
, hf_pptp_reserved
, tvb
, offset
, 2, ENC_NA
);
572 proto_tree_add_item(tree
, hf_pptp_send_accm
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
575 proto_tree_add_item(tree
, hf_pptp_receive_accm
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
579 dissect_pptp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
581 proto_tree
*pptp_tree
= NULL
;
582 proto_item
*item
= NULL
;
585 uint16_t control_message_type
;
587 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "PPTP");
588 col_clear(pinfo
->cinfo
, COL_INFO
);
590 len
= tvb_get_ntohs(tvb
, offset
);
591 control_message_type
= tvb_get_ntohs(tvb
, offset
+ 8);
593 col_add_str(pinfo
->cinfo
, COL_INFO
,
594 val_to_str(control_message_type
, control_message_type_vals
,
595 "Unknown control type (%d)"));
600 ti
= proto_tree_add_item(tree
, proto_pptp
, tvb
, offset
, len
, ENC_NA
);
601 pptp_tree
= proto_item_add_subtree(ti
, ett_pptp
);
603 proto_tree_add_item(pptp_tree
, hf_pptp_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
605 proto_tree_add_item(pptp_tree
, hf_pptp_message_type
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
607 item
= proto_tree_add_item(pptp_tree
, hf_pptp_magic_cookie
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
610 if (tvb_get_ntohl(tvb
, offset
+4) == MAGIC_COOKIE
)
611 proto_item_append_text(item
," (correct)");
613 proto_item_append_text(item
," (incorrect)");
614 expert_add_info(pinfo
, item
, &ei_pptp_incorrect_magic_cookie
);
618 proto_tree_add_item(pptp_tree
, hf_pptp_control_message_type
, tvb
, offset
+8, 2, ENC_BIG_ENDIAN
);
620 proto_tree_add_item(pptp_tree
, hf_pptp_reserved
, tvb
, offset
+10, 2, ENC_NA
);
623 offset
+= offset
+ 12;
625 switch(control_message_type
){
626 case CNTRL_REQ
: /* Start-Control-Connection-Request */
627 dissect_cntrl_req(tvb
, offset
, pinfo
, pptp_tree
);
629 case CNTRL_REPLY
: /* Start-Control-Connection-Reply */
630 dissect_cntrl_reply(tvb
, offset
, pinfo
, pptp_tree
);
632 case STOP_REQ
: /* Stop-Control-Connection-Request */
633 dissect_stop_req(tvb
, offset
, pinfo
, pptp_tree
);
635 case STOP_REPLY
: /* Stop-Control-Connection-Reply */
636 dissect_stop_reply(tvb
, offset
, pinfo
, pptp_tree
);
638 case ECHO_REQ
: /* Echo-Request */
639 dissect_echo_req(tvb
, offset
, pinfo
, pptp_tree
);
641 case ECHO_REPLY
: /* Echo-Reply */
642 dissect_echo_reply(tvb
, offset
, pinfo
, pptp_tree
);
644 case OUT_REQ
: /* Outgoing-Call-Request */
645 dissect_out_req(tvb
, offset
, pinfo
, pptp_tree
);
647 case OUT_REPLY
: /* Outgoing-Call-Reply */
648 dissect_out_reply(tvb
, offset
, pinfo
, pptp_tree
);
650 case IN_REQ
: /* Incoming-Call-Request */
651 dissect_in_req(tvb
, offset
, pinfo
, pptp_tree
);
653 case IN_REPLY
: /* Incoming-Call-Reply */
654 dissect_in_reply(tvb
, offset
, pinfo
, pptp_tree
);
656 case IN_CONNECTED
: /* Incoming-Call-Connected */
657 dissect_in_connected(tvb
, offset
, pinfo
, pptp_tree
);
659 case CLEAR_REQ
: /* Call-Clear-Request */
660 dissect_clear_req(tvb
, offset
, pinfo
, pptp_tree
);
662 case DISC_NOTIFY
: /* Call-Disconnect-Notify */
663 dissect_disc_notify(tvb
, offset
, pinfo
, pptp_tree
);
665 case ERROR_NOTIFY
: /* WAN-Error-Notify */
666 dissect_error_notify(tvb
, offset
, pinfo
, pptp_tree
);
668 case SET_LINK
: /* Set-Link-Info */
669 dissect_set_link(tvb
, offset
, pinfo
, pptp_tree
);
671 default: /* Unknown Type... */
672 dissect_unknown(tvb
, offset
, pinfo
, pptp_tree
);
675 return tvb_captured_length(tvb
);
679 proto_register_pptp(void)
681 static int *ett
[] = {
685 static hf_register_info hf
[] = {
687 { "Length", "pptp.length",
688 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
689 "Total length in octets of this PPTP message", HFILL
}
691 { &hf_pptp_message_type
,
692 { "Message type", "pptp.type",
693 FT_UINT16
, BASE_DEC
, VALS(msgtype_vals
), 0x0,
694 "PPTP message type", HFILL
}
696 { &hf_pptp_magic_cookie
,
697 { "Magic Cookie", "pptp.magic_cookie",
698 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
699 "This constant value is used as a sanity check on received messages", HFILL
}
701 { &hf_pptp_control_message_type
,
702 { "Control Message Type", "pptp.control_message_type",
703 FT_UINT16
, BASE_DEC
, VALS(control_message_type_vals
), 0x0,
707 { "Reserved", "pptp.reserved",
708 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
709 "This field MUST be 0", HFILL
}
711 { &hf_pptp_protocol_version
,
712 { "Protocol version", "pptp.protocol_version",
713 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
714 "The version of the PPTP protocol", HFILL
}
716 { &hf_pptp_framing_capabilities
,
717 { "Framing Capabilities", "pptp.framing_capabilities",
718 FT_UINT32
, BASE_DEC
, VALS(frametype_vals
), 0x0,
719 "A set of bits indicating the type of framing", HFILL
}
721 { &hf_pptp_bearer_capabilities
,
722 { "Bearer Capabilities", "pptp.bearer_capabilities",
723 FT_UINT32
, BASE_DEC
, VALS(bearertype_vals
), 0x0,
724 "A set of bits indicating the type of bearer", HFILL
}
726 { &hf_pptp_maximum_channels
,
727 { "Maximum Channels", "pptp.maximum_channels",
728 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
729 "The total number of individual PPP sessions this PAC can support", HFILL
}
731 { &hf_pptp_firmware_revision
,
732 { "Firmware Revision", "pptp.firmware_revision",
733 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
734 "This field contains the firmware revision", HFILL
}
736 { &hf_pptp_host_name
,
737 { "Host Name", "pptp.host_name",
738 FT_STRING
, BASE_NONE
, NULL
, 0x0,
739 "A 64 octet field containing the DNS name", HFILL
}
741 { &hf_pptp_vendor_name
,
742 { "Vendor Name", "pptp.vendor_name",
743 FT_STRING
, BASE_NONE
, NULL
, 0x0,
744 "A 64 octet field containing a vendor", HFILL
}
746 { &hf_pptp_control_result
,
747 { "Result Code", "pptp.control_result",
748 FT_UINT8
, BASE_DEC
, VALS(control_resulttype_vals
), 0x0,
749 "Indicates the result of the command channel establishment attempt", HFILL
}
752 { "Error Code", "pptp.error",
753 FT_UINT8
, BASE_DEC
, VALS(errortype_vals
), 0x0,
757 { "Reason", "pptp.reason",
758 FT_UINT8
, BASE_DEC
, VALS(reasontype_vals
), 0x0,
759 "Indicates the reason for the control connection being close", HFILL
}
761 { &hf_pptp_stop_result
,
762 { "Result Code", "pptp.stop_result",
763 FT_UINT8
, BASE_DEC
, VALS(stop_resulttype_vals
), 0x0,
764 "Indicates the result of the attempt to close the control connection", HFILL
}
766 { &hf_pptp_identifier
,
767 { "Identifier", "pptp.identifier",
768 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
771 { &hf_pptp_echo_result
,
772 { "Result Code", "pptp.echo_result",
773 FT_UINT8
, BASE_DEC
, VALS(echo_resulttype_vals
), 0x0,
774 "Indicates the result of the receipt of the Echo-Request", HFILL
}
777 { "Call ID", "pptp.call_id",
778 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
779 "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL
}
781 { &hf_pptp_call_serial_number
,
782 { "Call Serial Number", "pptp.call_serial_number",
783 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
784 "An identifier assigned by the PNS to this session for the purpose of identifying this particular session in logged session information", HFILL
}
786 { &hf_pptp_minimum_bps
,
787 { "Minimum BPS", "pptp.minimum_bps",
788 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
789 "The lowest acceptable line speed (in bits/second) for this session", HFILL
}
791 { &hf_pptp_maximum_bps
,
792 { "Maximum BPS", "pptp.maximum_bps",
793 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
794 "The highest acceptable line speed (in bits/second) for this session", HFILL
}
796 { &hf_pptp_framing_type
,
797 { "Framing Type", "pptp.framing_type",
798 FT_UINT32
, BASE_DEC
, VALS(frametype_vals
), 0x0,
799 "A value indicating the type of PPP framing to be used for this outgoing call", HFILL
}
801 { &hf_pptp_bearer_type
,
802 { "Bearer Type", "pptp.bearer_type",
803 FT_UINT32
, BASE_DEC
, VALS(bearertype_vals
), 0x0,
804 "A value indicating the bearer capability required for this outgoing call", HFILL
}
806 { &hf_pptp_packet_receive_window_size
,
807 { "Packet Receive Window Size", "pptp.packet_receive_window_size",
808 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
809 "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL
}
811 { &hf_pptp_packet_processing_delay
,
812 { "Packet Processing Delay", "pptp.packet_processing_delay",
813 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
814 "A measure of the packet processing delay that might be imposed on data sent to the PNS from the PAC", HFILL
}
816 { &hf_pptp_phone_number_length
,
817 { "Phone Number Length", "pptp.phone_number_length",
818 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
819 "The actual number of valid digits in the Phone Number field", HFILL
}
821 { &hf_pptp_phone_number
,
822 { "Phone Number", "pptp.phone_number",
823 FT_STRING
, BASE_NONE
, NULL
, 0x0,
824 "The number to be dialed to establish the outgoing session", HFILL
}
826 { &hf_pptp_subaddress
,
827 { "Subaddress", "pptp.subaddress",
828 FT_STRING
, BASE_NONE
, NULL
, 0x0,
829 "A 64 octet field used to specify additional dialing information.", HFILL
}
831 { &hf_pptp_peer_call_id
,
832 { "Peer Call ID", "pptp.peer_call_id",
833 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
834 "This field is set to the value received in the Call ID field of the corresponding Outgoing-Call-Request message", HFILL
}
836 { &hf_pptp_out_result
,
837 { "Result Code", "pptp.out_result",
838 FT_UINT8
, BASE_DEC
, VALS(out_resulttype_vals
), 0x0,
839 "Indicates the result of the receipt of the Outgoing-Call-Request attempt", HFILL
}
842 { "Cause Code", "pptp.cause",
843 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
844 "This field gives additional information", HFILL
}
846 { &hf_pptp_connect_speed
,
847 { "Connect Speed", "pptp.connect_speed",
848 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
849 "The actual connection speed used, in bits/second.", HFILL
}
851 { &hf_pptp_physical_channel_id
,
852 { "Physical Channel ID", "pptp.physical_channel_id",
853 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
854 "This field is set by the PAC in a vendor-specific manner to the physical channel number used to place this call", HFILL
}
856 { &hf_pptp_dialed_number_length
,
857 { "Dialed Number Length", "pptp.dialed_number_length",
858 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
859 "The actual number of valid digits in the Dialed Number field", HFILL
}
861 { &hf_pptp_dialed_number
,
862 { "Dialed Number", "pptp.dialed_number",
863 FT_STRING
, BASE_NONE
, NULL
, 0x0,
864 "The number that was dialed by the caller", HFILL
}
867 { &hf_pptp_dialing_number_length
,
868 { "Dialing Number Length", "pptp.dialing_number_length",
869 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
870 "The actual number of valid digits in the Dialing Number field", HFILL
}
872 { &hf_pptp_dialing_number
,
873 { "Dialing Number", "pptp.dialing_number",
874 FT_STRING
, BASE_NONE
, NULL
, 0x0,
875 "The number from which the call was placed", HFILL
}
877 { &hf_pptp_in_result
,
878 { "Result Code", "pptp.in_result",
879 FT_UINT8
, BASE_DEC
, VALS(in_resulttype_vals
), 0x0,
880 "This value indicates the result of the Incoming-Call-Request attempt", HFILL
}
882 { &hf_pptp_disc_result
,
883 { "Result Code", "pptp.disc_result",
884 FT_UINT8
, BASE_DEC
, VALS(disc_resulttype_vals
), 0x0,
885 "This value indicates the reason for the disconnect", HFILL
}
887 { &hf_pptp_call_statistics
,
888 { "Call Statistics", "pptp.call_Statistics",
889 FT_STRING
, BASE_NONE
, NULL
, 0x0,
890 "This field is an ASCII string containing vendor-specific call statistics that can be logged for diagnostic purpose", HFILL
}
892 { &hf_pptp_crc_errors
,
893 { "CRC Errors", "pptp.crc_errors",
894 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
895 "Number of PPP frames received with CRC errors since session was established", HFILL
}
897 { &hf_pptp_framing_errors
,
898 { "Framing Errors", "pptp.framing_errors",
899 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
900 "Number of improperly framed PPP packets received", HFILL
}
902 { &hf_pptp_hardware_overruns
,
903 { "Hardware overruns", "pptp.hardware_overruns",
904 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
905 "Number of receive buffer over-runs since session was established", HFILL
}
907 { &hf_pptp_buffer_overruns
,
908 { "Buffer overruns", "pptp.buffer_overruns",
909 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
910 "Number of buffer over-runs detected since session was established", HFILL
}
912 { &hf_pptp_timeout_errors
,
913 { "Time-out Errors", "pptp.timeout_errors",
914 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
915 "Number of time-outs since call was established", HFILL
}
917 { &hf_pptp_alignment_errors
,
918 { "Alignment Errors", "pptp.alignment_errors",
919 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
920 "Number of Alignment errors since call was established", HFILL
}
922 { &hf_pptp_send_accm
,
923 { "Send ACCM", "pptp.send_accm",
924 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
925 "The send ACCM value the client should use to process outgoing PPP packets", HFILL
}
927 { &hf_pptp_receive_accm
,
928 { "Receive ACCM", "pptp.receive_accm",
929 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
930 "The Receive ACCM value the client should use to process incoming PPP packets", HFILL
}
934 static ei_register_info ei
[] = {
935 { &ei_pptp_incorrect_magic_cookie
, { "pptp.magic_cookie.incorrect", PI_PROTOCOL
, PI_WARN
, "Incorrect Magic Cookie", EXPFILL
}},
938 expert_module_t
* expert_pptp
;
940 proto_pptp
= proto_register_protocol("Point-to-Point Tunnelling Protocol",
942 pptp_handle
= register_dissector("pptp", dissect_pptp
, proto_pptp
);
943 proto_register_field_array(proto_pptp
, hf
, array_length(hf
));
944 proto_register_subtree_array(ett
, array_length(ett
));
945 expert_pptp
= expert_register_protocol(proto_pptp
);
946 expert_register_field_array(expert_pptp
, ei
, array_length(ei
));
950 proto_reg_handoff_pptp(void)
952 dissector_add_uint_with_preference("tcp.port", TCP_PORT_PPTP
, pptp_handle
);
956 * Editor modelines - https://www.wireshark.org/tools/modelines.html
961 * indent-tabs-mode: nil
964 * ex: set shiftwidth=2 tabstop=8 expandtab:
965 * :indentSize=2:tabSize=8:noTabs=true: