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 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/expert.h>
33 void proto_register_pptp(void);
34 void proto_reg_handoff_pptp(void);
36 static int proto_pptp = -1;
37 static int hf_pptp_length = -1;
38 static int hf_pptp_message_type = -1;
39 static int hf_pptp_magic_cookie = -1;
40 static int hf_pptp_control_message_type = -1;
41 static int hf_pptp_reserved = -1;
42 static int hf_pptp_protocol_version = -1;
43 static int hf_pptp_framing_capabilities = -1;
44 static int hf_pptp_bearer_capabilities = -1;
45 static int hf_pptp_maximum_channels = -1;
46 static int hf_pptp_firmware_revision = -1;
47 static int hf_pptp_host_name = -1;
48 static int hf_pptp_vendor_name = -1;
49 static int hf_pptp_control_result = -1;
50 static int hf_pptp_error = -1;
51 static int hf_pptp_reason = -1;
52 static int hf_pptp_stop_result = -1;
53 static int hf_pptp_identifier = -1;
54 static int hf_pptp_echo_result = -1;
55 static int hf_pptp_call_id = -1;
56 static int hf_pptp_call_serial_number = -1;
57 static int hf_pptp_minimum_bps = -1;
58 static int hf_pptp_maximum_bps = -1;
59 static int hf_pptp_bearer_type = -1;
60 static int hf_pptp_framing_type = -1;
61 static int hf_pptp_packet_receive_window_size = -1;
62 static int hf_pptp_packet_processing_delay = -1;
63 static int hf_pptp_phone_number_length = -1;
64 static int hf_pptp_phone_number = -1;
65 static int hf_pptp_subaddress = -1;
66 static int hf_pptp_peer_call_id = -1;
67 static int hf_pptp_out_result = -1;
68 static int hf_pptp_cause = -1;
69 static int hf_pptp_connect_speed = -1;
70 static int hf_pptp_physical_channel_id = -1;
71 static int hf_pptp_dialed_number_length = -1;
72 static int hf_pptp_dialed_number = -1;
73 static int hf_pptp_dialing_number_length = -1;
74 static int hf_pptp_dialing_number = -1;
75 static int hf_pptp_in_result = -1;
76 static int hf_pptp_disc_result = -1;
77 static int hf_pptp_call_statistics = -1;
78 static int hf_pptp_crc_errors = -1;
79 static int hf_pptp_framing_errors = -1;
80 static int hf_pptp_hardware_overruns = -1;
81 static int hf_pptp_buffer_overruns = -1;
82 static int hf_pptp_timeout_errors = -1;
83 static int hf_pptp_alignment_errors = -1;
84 static int hf_pptp_send_accm = -1;
85 static int hf_pptp_receive_accm = -1;
87 static gint ett_pptp = -1;
89 static expert_field ei_pptp_incorrect_magic_cookie = EI_INIT;
91 static dissector_handle_t data_handle;
93 #define TCP_PORT_PPTP 1723
95 #define MAGIC_COOKIE 0x1A2B3C4D
97 #define CNTRL_REQ 0x01
98 #define CNTRL_REPLY 0x02
100 #define STOP_REPLY 0x04
101 #define ECHO_REQ 0x05
102 #define ECHO_REPLY 0x06
104 #define OUT_REPLY 0x08
106 #define IN_REPLY 0x0A
107 #define IN_CONNECTED 0x0B
108 #define CLEAR_REQ 0x0C
109 #define DISC_NOTIFY 0x0D
110 #define ERROR_NOTIFY 0x0E
111 #define SET_LINK 0x0F
113 static const value_string control_message_type_vals[] = {
114 { CNTRL_REQ, "Start-Control-Connection-Request" },
115 { CNTRL_REPLY, "Start-Control-Connection-Reply" },
116 { STOP_REQ, "Stop-Control-Connection-Request" },
117 { STOP_REPLY, "Stop-Control-Connection-Reply" },
118 { ECHO_REQ, "Echo-Request" },
119 { ECHO_REPLY, "Echo-Reply" },
120 { OUT_REQ, "Outgoing-Call-Request" },
121 { OUT_REPLY, "Outgoing-Call-Reply" },
122 { IN_REQ, "Incoming-Call-Request" },
123 { IN_REPLY, "Incoming-Call-Reply" },
124 { IN_CONNECTED, "Incoming-Call-Connected" },
125 { CLEAR_REQ, "Call-Clear-Request" },
126 { DISC_NOTIFY, "Call-Disconnect-Notify" },
127 { ERROR_NOTIFY, "WAN-Error-Notify" },
128 { SET_LINK, "Set-Link-Info" },
131 static const value_string msgtype_vals[] = {
132 { 1, "Control Message" },
133 { 2, "Management Message" },
137 static const value_string frametype_vals[] = {
138 { 1, "Asynchronous Framing supported" },
139 { 2, "Synchronous Framing supported"},
140 { 3, "Either Framing supported" },
144 static const value_string bearertype_vals[] = {
145 { 1, "Analog access supported" },
146 { 2, "Digital access supported" },
147 { 3, "Either access supported" },
151 static const value_string control_resulttype_vals[] = {
152 { 1, "Successful channel establishment" },
153 { 2, "General error" },
154 { 3, "Command channel already exists" },
155 { 4, "Requester not authorized" },
156 { 5, "Protocol version not supported" },
160 static const value_string errortype_vals[] = {
162 { 1, "Not-Connected" },
165 { 4, "No-Resource" },
166 { 5, "Bad-Call ID" },
171 static const value_string reasontype_vals[] = {
173 { 2, "Stop-Protocol" },
174 { 3, "Stop-Local-Shutdown" },
178 static const value_string stop_resulttype_vals[] = {
180 { 2, "General error" },
184 static const value_string echo_resulttype_vals[] = {
186 { 2, "General error" },
190 static const value_string out_resulttype_vals[] = {
192 { 2, "General Error" },
195 { 5, "No Dial Tone" },
197 { 7, "Do Not Accept" },
201 static const value_string in_resulttype_vals[] = {
203 { 2, "General error" },
204 { 3, "Do Not Accept" },
208 static const value_string disc_resulttype_vals[] = {
209 { 1, "Lost Carrier" },
210 { 2, "General Error" },
211 { 3, "Admin Shutdown" },
217 dissect_unknown(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
219 call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, tree);
223 dissect_cntrl_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
228 proto_tree_add_uint_format_value(tree, hf_pptp_protocol_version, tvb, offset,
229 2, tvb_get_ntohs(tvb, offset), "%u.%u",
230 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
233 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
236 proto_tree_add_item(tree, hf_pptp_framing_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
239 proto_tree_add_item(tree, hf_pptp_bearer_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
242 proto_tree_add_item(tree, hf_pptp_maximum_channels, tvb, offset, 2, ENC_BIG_ENDIAN);
245 proto_tree_add_item(tree, hf_pptp_firmware_revision, tvb, offset, 2, ENC_BIG_ENDIAN);
248 proto_tree_add_item(tree, hf_pptp_host_name, tvb, offset, 64, ENC_ASCII|ENC_NA);
251 proto_tree_add_item(tree, hf_pptp_vendor_name, tvb, offset, 64, ENC_ASCII|ENC_NA);
255 dissect_cntrl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
260 proto_tree_add_uint_format_value(tree, hf_pptp_protocol_version, tvb, offset,
261 2, tvb_get_ntohs(tvb, offset), "%u.%u",
262 tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
265 proto_tree_add_item(tree, hf_pptp_control_result, tvb, offset, 1, ENC_BIG_ENDIAN);
268 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
271 proto_tree_add_item(tree, hf_pptp_framing_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
274 proto_tree_add_item(tree, hf_pptp_bearer_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
277 proto_tree_add_item(tree, hf_pptp_maximum_channels, tvb, offset, 2, ENC_BIG_ENDIAN);
280 proto_tree_add_item(tree, hf_pptp_firmware_revision, tvb, offset, 2, ENC_BIG_ENDIAN);
283 proto_tree_add_item(tree, hf_pptp_host_name, tvb, offset, 64, ENC_ASCII|ENC_NA);
286 proto_tree_add_item(tree, hf_pptp_vendor_name, tvb, offset, 64, ENC_ASCII|ENC_NA);
291 dissect_stop_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
296 proto_tree_add_item(tree, hf_pptp_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
299 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 1, ENC_NA);
302 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
306 dissect_stop_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
311 proto_tree_add_item(tree, hf_pptp_stop_result, tvb, offset, 1, ENC_BIG_ENDIAN);
314 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
317 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
322 dissect_echo_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
327 proto_tree_add_item(tree, hf_pptp_identifier, tvb, offset, 4, ENC_BIG_ENDIAN);
331 dissect_echo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
336 proto_tree_add_item(tree, hf_pptp_identifier, tvb, offset, 4, ENC_BIG_ENDIAN);
339 proto_tree_add_item(tree, hf_pptp_echo_result, tvb, offset, 1, ENC_BIG_ENDIAN);
342 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
345 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
349 dissect_out_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
354 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
357 proto_tree_add_item(tree, hf_pptp_call_serial_number, tvb, offset, 2, ENC_BIG_ENDIAN);
360 proto_tree_add_item(tree, hf_pptp_minimum_bps, tvb, offset, 4, ENC_BIG_ENDIAN);
363 proto_tree_add_item(tree, hf_pptp_maximum_bps, tvb, offset, 4, ENC_BIG_ENDIAN);
366 proto_tree_add_item(tree, hf_pptp_bearer_type, tvb, offset, 4, ENC_BIG_ENDIAN);
369 proto_tree_add_item(tree, hf_pptp_framing_type, tvb, offset, 4, ENC_BIG_ENDIAN);
372 proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, ENC_BIG_ENDIAN);
375 proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
378 proto_tree_add_item(tree, hf_pptp_phone_number_length, tvb, offset, 2, ENC_BIG_ENDIAN);
381 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
384 proto_tree_add_item(tree, hf_pptp_phone_number, tvb, offset, 64, ENC_ASCII|ENC_NA);
387 proto_tree_add_item(tree, hf_pptp_subaddress, tvb, offset, 64, ENC_ASCII|ENC_NA);
391 dissect_out_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
396 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
399 proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
402 proto_tree_add_item(tree, hf_pptp_out_result, tvb, offset, 1, ENC_BIG_ENDIAN);
405 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
408 proto_tree_add_item(tree, hf_pptp_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
411 proto_tree_add_item(tree, hf_pptp_connect_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
414 proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, ENC_BIG_ENDIAN);
417 proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
420 proto_tree_add_item(tree, hf_pptp_physical_channel_id, tvb, offset, 4, ENC_BIG_ENDIAN);
424 dissect_in_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
429 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
432 proto_tree_add_item(tree, hf_pptp_call_serial_number, tvb, offset, 2, ENC_BIG_ENDIAN);
435 proto_tree_add_item(tree, hf_pptp_bearer_type, tvb, offset, 4, ENC_BIG_ENDIAN);
438 proto_tree_add_item(tree, hf_pptp_physical_channel_id, tvb, offset, 4, ENC_BIG_ENDIAN);
441 proto_tree_add_item(tree, hf_pptp_dialed_number_length, tvb, offset, 2, ENC_BIG_ENDIAN);
444 proto_tree_add_item(tree, hf_pptp_dialing_number_length, tvb, offset, 2, ENC_BIG_ENDIAN);
447 proto_tree_add_item(tree, hf_pptp_dialed_number, tvb, offset, 64, ENC_ASCII|ENC_NA);
450 proto_tree_add_item(tree, hf_pptp_dialing_number, tvb, offset, 64, ENC_ASCII|ENC_NA);
453 proto_tree_add_item(tree, hf_pptp_subaddress, tvb, offset, 64, ENC_ASCII|ENC_NA);
457 dissect_in_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
462 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
465 proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
468 proto_tree_add_item(tree, hf_pptp_in_result, tvb, offset, 1, ENC_BIG_ENDIAN);
471 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
474 proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, ENC_BIG_ENDIAN);
477 proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
480 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
484 dissect_in_connected(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
489 proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
492 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
495 proto_tree_add_item(tree, hf_pptp_connect_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
498 proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, ENC_BIG_ENDIAN);
501 proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
504 proto_tree_add_item(tree, hf_pptp_framing_type, tvb, offset, 4, ENC_BIG_ENDIAN);
508 dissect_clear_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
513 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
516 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
520 dissect_disc_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
525 proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
528 proto_tree_add_item(tree, hf_pptp_disc_result, tvb, offset, 1, ENC_BIG_ENDIAN);
531 proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, ENC_BIG_ENDIAN);
534 proto_tree_add_item(tree, hf_pptp_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
537 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
540 proto_tree_add_item(tree, hf_pptp_call_statistics, tvb, offset, 64, ENC_ASCII|ENC_NA);
544 dissect_error_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
549 proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
552 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
555 proto_tree_add_item(tree, hf_pptp_crc_errors, tvb, offset, 4, ENC_BIG_ENDIAN);
558 proto_tree_add_item(tree, hf_pptp_framing_errors, tvb, offset, 4, ENC_BIG_ENDIAN);
561 proto_tree_add_item(tree, hf_pptp_hardware_overruns, tvb, offset, 4, ENC_BIG_ENDIAN);
564 proto_tree_add_item(tree, hf_pptp_buffer_overruns, tvb, offset, 4, ENC_BIG_ENDIAN);
567 proto_tree_add_item(tree, hf_pptp_timeout_errors, tvb, offset, 4, ENC_BIG_ENDIAN);
570 proto_tree_add_item(tree, hf_pptp_alignment_errors, tvb, offset, 4, ENC_BIG_ENDIAN);
574 dissect_set_link(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
579 proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, ENC_BIG_ENDIAN);
582 proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, ENC_NA);
585 proto_tree_add_item(tree, hf_pptp_send_accm, tvb, offset, 4, ENC_BIG_ENDIAN);
588 proto_tree_add_item(tree, hf_pptp_receive_accm, tvb, offset, 4, ENC_BIG_ENDIAN);
592 dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
594 proto_tree *pptp_tree = NULL;
595 proto_item *item = NULL;
598 guint16 control_message_type;
600 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPTP");
601 col_clear(pinfo->cinfo, COL_INFO);
603 len = tvb_get_ntohs(tvb, offset);
604 control_message_type = tvb_get_ntohs(tvb, offset + 8);
606 col_add_str(pinfo->cinfo, COL_INFO,
607 val_to_str(control_message_type, control_message_type_vals,
608 "Unknown control type (%d)"));
613 ti = proto_tree_add_item(tree, proto_pptp, tvb, offset, len, ENC_NA);
614 pptp_tree = proto_item_add_subtree(ti, ett_pptp);
616 proto_tree_add_item(pptp_tree, hf_pptp_length, tvb, offset, 2, ENC_BIG_ENDIAN);
618 proto_tree_add_item(pptp_tree, hf_pptp_message_type, tvb, offset+2, 2, ENC_BIG_ENDIAN);
620 item = proto_tree_add_item(pptp_tree, hf_pptp_magic_cookie, tvb, offset+4, 4, ENC_BIG_ENDIAN);
623 if (tvb_get_ntohl(tvb, offset+4) == MAGIC_COOKIE)
624 proto_item_append_text(item," (correct)");
626 proto_item_append_text(item," (incorrect)");
627 expert_add_info(pinfo, item, &ei_pptp_incorrect_magic_cookie);
631 proto_tree_add_item(pptp_tree, hf_pptp_control_message_type, tvb, offset+8, 2, ENC_BIG_ENDIAN);
633 proto_tree_add_item(pptp_tree, hf_pptp_reserved, tvb, offset+10, 2, ENC_NA);
636 offset += offset + 12;
638 switch(control_message_type){
639 case CNTRL_REQ: /* Start-Control-Connection-Request */
640 dissect_cntrl_req(tvb, offset, pinfo, pptp_tree);
642 case CNTRL_REPLY: /* Start-Control-Connection-Reply */
643 dissect_cntrl_reply(tvb, offset, pinfo, pptp_tree);
645 case STOP_REQ: /* Stop-Control-Connection-Request */
646 dissect_stop_req(tvb, offset, pinfo, pptp_tree);
648 case STOP_REPLY: /* Stop-Control-Connection-Reply */
649 dissect_stop_reply(tvb, offset, pinfo, pptp_tree);
651 case ECHO_REQ: /* Echo-Request */
652 dissect_echo_req(tvb, offset, pinfo, pptp_tree);
654 case ECHO_REPLY: /* Echo-Reply */
655 dissect_echo_reply(tvb, offset, pinfo, pptp_tree);
657 case OUT_REQ: /* Outgoing-Call-Request */
658 dissect_out_req(tvb, offset, pinfo, pptp_tree);
660 case OUT_REPLY: /* Outgoing-Call-Reply */
661 dissect_out_reply(tvb, offset, pinfo, pptp_tree);
663 case IN_REQ: /* Incoming-Call-Request */
664 dissect_in_req(tvb, offset, pinfo, pptp_tree);
666 case IN_REPLY: /* Incoming-Call-Reply */
667 dissect_in_reply(tvb, offset, pinfo, pptp_tree);
669 case IN_CONNECTED: /* Incoming-Call-Connected */
670 dissect_in_connected(tvb, offset, pinfo, pptp_tree);
672 case CLEAR_REQ: /* Call-Clear-Request */
673 dissect_clear_req(tvb, offset, pinfo, pptp_tree);
675 case DISC_NOTIFY: /* Call-Disconnect-Notify */
676 dissect_disc_notify(tvb, offset, pinfo, pptp_tree);
678 case ERROR_NOTIFY: /* WAN-Error-Notify */
679 dissect_error_notify(tvb, offset, pinfo, pptp_tree);
681 case SET_LINK: /* Set-Link-Info */
682 dissect_set_link(tvb, offset, pinfo, pptp_tree);
684 default: /* Unknown Type... */
685 dissect_unknown(tvb, offset, pinfo, pptp_tree);
691 proto_register_pptp(void)
693 static gint *ett[] = {
697 static hf_register_info hf[] = {
699 { "Length", "pptp.length",
700 FT_UINT16, BASE_DEC, NULL, 0x0,
701 "Total length in octets of this PPTP message", HFILL }
703 { &hf_pptp_message_type,
704 { "Message type", "pptp.type",
705 FT_UINT16, BASE_DEC, VALS(msgtype_vals), 0x0,
706 "PPTP message type", HFILL }
708 { &hf_pptp_magic_cookie,
709 { "Magic Cookie", "pptp.magic_cookie",
710 FT_UINT32, BASE_HEX, NULL, 0x0,
711 "This constant value is used as a sanity check on received messages", HFILL }
713 { &hf_pptp_control_message_type,
714 { "Control Message Type", "pptp.control_message_type",
715 FT_UINT16, BASE_DEC, VALS(control_message_type_vals), 0x0,
719 { "Reserved", "pptp.reserved",
720 FT_BYTES, BASE_NONE, NULL, 0x0,
721 "This field MUST be 0", HFILL }
723 { &hf_pptp_protocol_version,
724 { "Protocol version", "pptp.protocol_version",
725 FT_UINT16, BASE_DEC, NULL, 0x0,
726 "The version of the PPTP protocol", HFILL }
728 { &hf_pptp_framing_capabilities,
729 { "Framing Capabilities", "pptp.framing_capabilities",
730 FT_UINT32, BASE_DEC, VALS(frametype_vals), 0x0,
731 "A set of bits indicating the type of framing", HFILL }
733 { &hf_pptp_bearer_capabilities,
734 { "Bearer Capabilities", "pptp.bearer_capabilities",
735 FT_UINT32, BASE_DEC, VALS(bearertype_vals), 0x0,
736 "A set of bits indicating the type of bearer", HFILL }
738 { &hf_pptp_maximum_channels,
739 { "Maximum Channels", "pptp.maximum_channels",
740 FT_UINT16, BASE_DEC, NULL, 0x0,
741 "The total number of individual PPP sessions this PAC can support", HFILL }
743 { &hf_pptp_firmware_revision,
744 { "Firmware Revision", "pptp.firmware_revision",
745 FT_UINT16, BASE_DEC, NULL, 0x0,
746 "This field contains the firmware revision", HFILL }
748 { &hf_pptp_host_name,
749 { "Host Name", "pptp.host_name",
750 FT_STRING, BASE_NONE, NULL, 0x0,
751 "A 64 octet field containing the DNS name", HFILL }
753 { &hf_pptp_vendor_name,
754 { "Vendor Name", "pptp.vendor_name",
755 FT_STRING, BASE_NONE, NULL, 0x0,
756 "A 64 octet field containing a vendor", HFILL }
758 { &hf_pptp_control_result,
759 { "Result Code", "pptp.control_result",
760 FT_UINT8, BASE_DEC, VALS(control_resulttype_vals), 0x0,
761 "Indicates the result of the command channel establishment attempt", HFILL }
764 { "Error Code", "pptp.error",
765 FT_UINT8, BASE_DEC, VALS(errortype_vals), 0x0,
769 { "Reason", "pptp.reason",
770 FT_UINT8, BASE_DEC, VALS(reasontype_vals), 0x0,
771 "Indicates the reason for the control connection being close", HFILL }
773 { &hf_pptp_stop_result,
774 { "Result Code", "pptp.stop_result",
775 FT_UINT8, BASE_DEC, VALS(stop_resulttype_vals), 0x0,
776 "Indicates the result of the attempt to close the control connection", HFILL }
778 { &hf_pptp_identifier,
779 { "Identifier", "pptp.identifier",
780 FT_UINT32, BASE_DEC, NULL, 0x0,
783 { &hf_pptp_echo_result,
784 { "Result Code", "pptp.echo_result",
785 FT_UINT8, BASE_DEC, VALS(echo_resulttype_vals), 0x0,
786 "Indicates the result of the receipt of the Echo-Request", HFILL }
789 { "Call ID", "pptp.call_id",
790 FT_UINT16, BASE_DEC, NULL, 0x0,
791 "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL }
793 { &hf_pptp_call_serial_number,
794 { "Call Serial Number", "pptp.call_serial_number",
795 FT_UINT16, BASE_DEC, NULL, 0x0,
796 "An identifier assigned by the PNS to this session for the purpose of identifying this particular session in logged session information", HFILL }
798 { &hf_pptp_minimum_bps,
799 { "Minimum BPS", "pptp.minimum_bps",
800 FT_UINT32, BASE_DEC, NULL, 0x0,
801 "The lowest acceptable line speed (in bits/second) for this session", HFILL }
803 { &hf_pptp_maximum_bps,
804 { "Maximum BPS", "pptp.maximum_bps",
805 FT_UINT32, BASE_DEC, NULL, 0x0,
806 "The highest acceptable line speed (in bits/second) for this session", HFILL }
808 { &hf_pptp_framing_type,
809 { "Framing Type", "pptp.framing_type",
810 FT_UINT32, BASE_DEC, VALS(frametype_vals), 0x0,
811 "A value indicating the type of PPP framing to be used for this outgoing call", HFILL }
813 { &hf_pptp_bearer_type,
814 { "Bearer Type", "pptp.bearer_type",
815 FT_UINT32, BASE_DEC, VALS(bearertype_vals), 0x0,
816 "A value indicating the bearer capability required for this outgoing call", HFILL }
818 { &hf_pptp_packet_receive_window_size,
819 { "Packet Receive Window Size", "pptp.packet_receive_window_size",
820 FT_UINT16, BASE_DEC, NULL, 0x0,
821 "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL }
823 { &hf_pptp_packet_processing_delay,
824 { "Packet Processing Delay", "pptp.packet_processing_delay",
825 FT_UINT16, BASE_DEC, NULL, 0x0,
826 "A measure of the packet processing delay that might be imposed on data sent to the PNS from the PAC", HFILL }
828 { &hf_pptp_phone_number_length,
829 { "Phone Number Length", "pptp.phone_number_length",
830 FT_UINT16, BASE_DEC, NULL, 0x0,
831 "The actual number of valid digits in the Phone Number field", HFILL }
833 { &hf_pptp_phone_number,
834 { "Phone Number", "pptp.phone_number",
835 FT_STRING, BASE_NONE, NULL, 0x0,
836 "The number to be dialed to establish the outgoing session", HFILL }
838 { &hf_pptp_subaddress,
839 { "Subaddress", "pptp.subaddress",
840 FT_STRING, BASE_NONE, NULL, 0x0,
841 "A 64 octet field used to specify additional dialing information.", HFILL }
843 { &hf_pptp_peer_call_id,
844 { "Peer Call ID", "pptp.peer_call_id",
845 FT_UINT16, BASE_DEC, NULL, 0x0,
846 "This field is set to the value received in the Call ID field of the corresponding Outgoing-Call-Request message", HFILL }
848 { &hf_pptp_out_result,
849 { "Result Code", "pptp.out_result",
850 FT_UINT8, BASE_DEC, VALS(out_resulttype_vals), 0x0,
851 "Indicates the result of the receipt of the Outgoing-Call-Request attempt", HFILL }
854 { "Cause Code", "pptp.cause",
855 FT_UINT16, BASE_DEC, NULL, 0x0,
856 "This field gives additional information", HFILL }
858 { &hf_pptp_connect_speed,
859 { "Connect Speed", "pptp.connect_speed",
860 FT_UINT32, BASE_DEC, NULL, 0x0,
861 "The actual connection speed used, in bits/second.", HFILL }
863 { &hf_pptp_physical_channel_id,
864 { "Physical Channel ID", "pptp.physical_channel_id",
865 FT_UINT32, BASE_DEC, NULL, 0x0,
866 "This field is set by the PAC in a vendor-specific manner to the physical channel number used to place this call", HFILL }
868 { &hf_pptp_dialed_number_length,
869 { "Dialed Number Length", "pptp.dialed_number_length",
870 FT_UINT16, BASE_DEC, NULL, 0x0,
871 "The actual number of valid digits in the Dialed Number field", HFILL }
873 { &hf_pptp_dialed_number,
874 { "Dialed Number", "pptp.dialed_number",
875 FT_STRING, BASE_NONE, NULL, 0x0,
876 "The number that was dialed by the caller", HFILL }
879 { &hf_pptp_dialing_number_length,
880 { "Dialing Number Length", "pptp.dialing_number_length",
881 FT_UINT16, BASE_DEC, NULL, 0x0,
882 "The actual number of valid digits in the Dialing Number field", HFILL }
884 { &hf_pptp_dialing_number,
885 { "Dialing Number", "pptp.dialing_number",
886 FT_STRING, BASE_NONE, NULL, 0x0,
887 "The number from which the call was placed", HFILL }
889 { &hf_pptp_in_result,
890 { "Result Code", "pptp.in_result",
891 FT_UINT8, BASE_DEC, VALS(in_resulttype_vals), 0x0,
892 "This value indicates the result of the Incoming-Call-Request attempt", HFILL }
894 { &hf_pptp_disc_result,
895 { "Result Code", "pptp.disc_result",
896 FT_UINT8, BASE_DEC, VALS(disc_resulttype_vals), 0x0,
897 "This value indicates the reason for the disconnect", HFILL }
899 { &hf_pptp_call_statistics,
900 { "Call Statistics", "pptp.call_Statistics",
901 FT_STRING, BASE_NONE, NULL, 0x0,
902 "This field is an ASCII string containing vendor-specific call statistics that can be logged for diagnostic purpose", HFILL }
904 { &hf_pptp_crc_errors,
905 { "CRC Errors", "pptp.crc_errors",
906 FT_UINT32, BASE_DEC, NULL, 0x0,
907 "Number of PPP frames received with CRC errors since session was established", HFILL }
909 { &hf_pptp_framing_errors,
910 { "Framing Errors", "pptp.framing_errors",
911 FT_UINT32, BASE_DEC, NULL, 0x0,
912 "Number of improperly framed PPP packets received", HFILL }
914 { &hf_pptp_hardware_overruns,
915 { "Hardware overruns", "pptp.hardware_overruns",
916 FT_UINT32, BASE_DEC, NULL, 0x0,
917 "Number of receive buffer over-runs since session was established", HFILL }
919 { &hf_pptp_buffer_overruns,
920 { "Buffer overruns", "pptp.buffer_overruns",
921 FT_UINT32, BASE_DEC, NULL, 0x0,
922 "Number of buffer over-runs detected since session was established", HFILL }
924 { &hf_pptp_timeout_errors,
925 { "Time-out Errors", "pptp.timeout_errors",
926 FT_UINT32, BASE_DEC, NULL, 0x0,
927 "Number of time-outs since call was established", HFILL }
929 { &hf_pptp_alignment_errors,
930 { "Alignment Errors", "pptp.alignment_errors",
931 FT_UINT32, BASE_DEC, NULL, 0x0,
932 "Number of Alignment errors since call was established", HFILL }
934 { &hf_pptp_send_accm,
935 { "Send ACCM", "pptp.send_accm",
936 FT_UINT32, BASE_HEX, NULL, 0x0,
937 "The send ACCM value the client should use to process outgoing PPP packets", HFILL }
939 { &hf_pptp_receive_accm,
940 { "Receive ACCM", "pptp.receive_accm",
941 FT_UINT32, BASE_HEX, NULL, 0x0,
942 "The Receive ACCM value the client should use to process incoming PPP packets", HFILL }
946 static ei_register_info ei[] = {
947 { &ei_pptp_incorrect_magic_cookie, { "pptp.magic_cookie.incorrect", PI_PROTOCOL, PI_WARN, "Incorrect Magic Cookie", EXPFILL }},
950 expert_module_t* expert_pptp;
952 proto_pptp = proto_register_protocol("Point-to-Point Tunnelling Protocol",
954 proto_register_field_array(proto_pptp, hf, array_length(hf));
955 proto_register_subtree_array(ett, array_length(ett));
956 expert_pptp = expert_register_protocol(proto_pptp);
957 expert_register_field_array(expert_pptp, ei, array_length(ei));
961 proto_reg_handoff_pptp(void)
963 dissector_handle_t pptp_handle;
965 pptp_handle = create_dissector_handle(dissect_pptp, proto_pptp);
966 dissector_add_uint("tcp.port", TCP_PORT_PPTP, pptp_handle);
967 data_handle = find_dissector("data");