aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-10-14 01:10:51 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-10-14 01:10:51 +0000
commitaa749665c55261f653126c0ebbfee903f0e22952 (patch)
tree38715ec6acfc49a880346c4945e98f91d5e914ca
parentfc260f79672120c87d80fb6a0b5b8453c356d121 (diff)
From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5295 :
Hi a patch to enchance the PPTP Dissector It is a rework of PPTP dissector - Replace proto_tree_add_text by proto_tree_add_item - Replace not standard table and function by standard value_string - .... The code is checked and fuzzed (more 200 pass) ! with personnal PPTP Sample and PPTP Sample from pcapr.net svn path=/trunk/; revision=34504
-rw-r--r--AUTHORS1
-rw-r--r--epan/dissectors/packet-pptp.c1016
2 files changed, 525 insertions, 492 deletions
diff --git a/AUTHORS b/AUTHORS
index 3e2119f069..4b5a5e227a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2938,6 +2938,7 @@ Alexis La Goutte <alexis.lagoutte [AT] gmail.com> {
CAPWAP dissector
Miscellaneous ISAKMP enhancements
Packet TCP Mood Option (RFC5841) support
+ PPTP dissector enhancements (Rework)
}
Varun Notibala <nbvarun [AT] gmail.com> {
diff --git a/epan/dissectors/packet-pptp.c b/epan/dissectors/packet-pptp.c
index d94eddcf8f..45fed332d4 100644
--- a/epan/dissectors/packet-pptp.c
+++ b/epan/dissectors/packet-pptp.c
@@ -2,6 +2,9 @@
* Routines for the Point-to-Point Tunnelling Protocol (PPTP) (RFC 2637)
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
+ * 10/2010 - Rework PPTP Dissector
+ * Alexis La Goutte <alexis.lagoutte at gmail dot com>
+ *
* $Id$
*
* Wireshark - Network traffic analyzer
@@ -31,7 +34,55 @@
#include <epan/packet.h>
static int proto_pptp = -1;
+static int hf_pptp_length = -1;
static int hf_pptp_message_type = -1;
+static int hf_pptp_magic_cookie = -1;
+static int hf_pptp_control_message_type = -1;
+static int hf_pptp_reserved = -1;
+static int hf_pptp_protocol_version = -1;
+static int hf_pptp_framing_capabilities = -1;
+static int hf_pptp_bearer_capabilities = -1;
+static int hf_pptp_maximum_channels = -1;
+static int hf_pptp_firmware_revision = -1;
+static int hf_pptp_host_name = -1;
+static int hf_pptp_vendor_name = -1;
+static int hf_pptp_control_result = -1;
+static int hf_pptp_error = -1;
+static int hf_pptp_reason = -1;
+static int hf_pptp_stop_result = -1;
+static int hf_pptp_identifier = -1;
+static int hf_pptp_echo_result = -1;
+static int hf_pptp_call_id = -1;
+static int hf_pptp_call_serial_number = -1;
+static int hf_pptp_minimum_bps = -1;
+static int hf_pptp_maximum_bps = -1;
+static int hf_pptp_bearer_type = -1;
+static int hf_pptp_framing_type = -1;
+static int hf_pptp_packet_receive_window_size = -1;
+static int hf_pptp_packet_processing_delay = -1;
+static int hf_pptp_phone_number_length = -1;
+static int hf_pptp_phone_number = -1;
+static int hf_pptp_subaddress = -1;
+static int hf_pptp_peer_call_id = -1;
+static int hf_pptp_out_result = -1;
+static int hf_pptp_cause = -1;
+static int hf_pptp_connect_speed = -1;
+static int hf_pptp_physical_channel_id = -1;
+static int hf_pptp_dialed_number_length = -1;
+static int hf_pptp_dialed_number = -1;
+static int hf_pptp_dialing_number_length = -1;
+static int hf_pptp_dialing_number = -1;
+static int hf_pptp_in_result = -1;
+static int hf_pptp_disc_result = -1;
+static int hf_pptp_call_statistics = -1;
+static int hf_pptp_crc_errors = -1;
+static int hf_pptp_framing_errors = -1;
+static int hf_pptp_hardware_overruns = -1;
+static int hf_pptp_buffer_overruns = -1;
+static int hf_pptp_timeout_errors = -1;
+static int hf_pptp_alignment_errors = -1;
+static int hf_pptp_send_accm = -1;
+static int hf_pptp_receive_accm = -1;
static gint ett_pptp = -1;
@@ -41,247 +92,109 @@ static dissector_handle_t data_handle;
#define MAGIC_COOKIE 0x1A2B3C4D
+static const value_string control_message_type_vals[] = {
+ { 1, "Start-Control-Connection-Request" },
+ { 2, "Start-Control-Connection-Reply" },
+ { 3, "Stop-Control-Connection-Request" },
+ { 4, "Stop-Control-Connection-Reply" },
+ { 5, "Echo-Request" },
+ { 6, "Echo-Reply" },
+ { 7, "Outgoing-Call-Request" },
+ { 8, "Outgoing-Call-Reply" },
+ { 9, "Incoming-Call-Request" },
+ { 10, "Incoming-Call-Reply" },
+ { 11, "Incoming-Call-Connected" },
+ { 12, "Call-Clear-Request" },
+ { 13, "Call-Disconnect-Notify" },
+ { 14, "WAN-Error-Notify" },
+ { 15, "Set-Link-Info" },
+ { 0, NULL },
+};
static const value_string msgtype_vals[] = {
{ 1, "Control Message" },
{ 2, "Management Message" },
{ 0, NULL }
};
-#define NUM_FRAME_TYPES 4
-#define frametype2str(t) \
- ((t < NUM_FRAME_TYPES) ? frametypestr[t] : "Unknown framing type")
-
-static const char *frametypestr[NUM_FRAME_TYPES] = {
- "Unknown framing type",
- "Asynchronous Framing supported",
- "Synchronous Framing supported",
- "Either Framing supported"
-};
-
-#define NUM_BEARER_TYPES 4
-#define bearertype2str(t) \
- ((t < NUM_BEARER_TYPES) ? bearertypestr[t] : "Unknown bearer type")
-
-static const char *bearertypestr[NUM_BEARER_TYPES] = {
- "Unknown bearer type",
- "Analog access supported",
- "Digital access supported",
- "Either access supported"
+static const value_string frametype_vals[] = {
+ { 1, "Asynchronous Framing supported" },
+ { 2, "Synchronous Framing supported"},
+ { 3, "Either Framing supported" },
+ { 0, NULL }
};
-#define NUM_CNTRLRESULT_TYPES 6
-#define cntrlresulttype2str(t) \
- ((t < NUM_CNTRLRESULT_TYPES) ? cntrlresulttypestr[t] : "Unknown Start-Control-connection-Reply result code")
-
-static const char *cntrlresulttypestr[NUM_CNTRLRESULT_TYPES] = {
- "Unknown Start-Control-connection-Reply result code",
- "Successful channel establishment",
- "General error",
- "Command channel already exists",
- "Requester not authorized",
- "Protocol version not supported"
+static const value_string bearertype_vals[] = {
+ { 1, "Analog access supported" },
+ { 2, "Digital access supported" },
+ { 3, "Either access supported" },
+ { 0, NULL }
};
-#define NUM_ERROR_TYPES 7
-#define errortype2str(t) \
- ((t < NUM_ERROR_TYPES) ? errortypestr[t] : "Unknown general error code")
-
-static const char *errortypestr[NUM_ERROR_TYPES] = {
- "None",
- "Not-Connected",
- "Bad-Format",
- "Bad-Value",
- "No-Resource",
- "Bad-Call ID",
- "PAC-Error"
+static const value_string control_resulttype_vals[] = {
+ { 1, "Successful channel establishment" },
+ { 2, "General error" },
+ { 3, "Command channel already exists" },
+ { 4, "Requester not authorized" },
+ { 5, "Protocol version not supported" },
+ { 0, NULL }
};
-#define NUM_REASON_TYPES 4
-#define reasontype2str(t) \
- ((t < NUM_REASON_TYPES) ? reasontypestr[t] : "Unknown Stop-Control-Connection-Request reason code")
-
-static const char *reasontypestr[NUM_REASON_TYPES] = {
- "Unknown Stop-Control-Connection-Request reason code",
- "None",
- "Stop-Protocol",
- "Stop-Local-Shutdown"
+static const value_string errortype_vals[] = {
+ { 0, "None" },
+ { 1, "Not-Connected" },
+ { 2, "Bad-Format" },
+ { 3, "Bad-Value" },
+ { 4, "No-Resource" },
+ { 5, "Bad-Call ID" },
+ { 6, "PAC-Error" },
+ { 0, NULL }
};
-#define NUM_STOPRESULT_TYPES 3
-#define stopresulttype2str(t) \
- ((t < NUM_STOPRESULT_TYPES) ? stopresulttypestr[t] : "Unknown Stop-Control-Connection-Reply result code")
-
-static const char *stopresulttypestr[NUM_STOPRESULT_TYPES] = {
- "Unknown Stop-Control-Connection-Reply result code",
- "OK",
- "General error"
+static const value_string reasontype_vals[] = {
+ { 1, "None" },
+ { 2, "Stop-Protocol" },
+ { 3, "Stop-Local-Shutdown" },
+ { 0, NULL }
};
-#define NUM_ECHORESULT_TYPES 3
-#define echoresulttype2str(t) \
- ((t < NUM_ECHORESULT_TYPES) ? echoresulttypestr[t] : "Unknown Echo-Reply result code")
-
-static const char *echoresulttypestr[NUM_ECHORESULT_TYPES] = {
- "Unknown Echo-Reply result code",
- "OK",
- "General error"
+static const value_string stop_resulttype_vals[] = {
+ { 1, "OK" },
+ { 2, "General error" },
+ { 0, NULL }
};
-#define NUM_OUTRESULT_TYPES 8
-#define outresulttype2str(t) \
- ((t < NUM_OUTRESULT_TYPES) ? outresulttypestr[t] : "Unknown Outgoing-Call-Reply result code")
-
-static const char *outresulttypestr[NUM_OUTRESULT_TYPES] = {
- "Unknown Outgoing-Call-Reply result code",
- "Connected",
- "General Error",
- "No Carrier",
- "Busy",
- "No Dial Tone",
- "Time-out",
- "Do Not Accept"
+static const value_string echo_resulttype_vals[] = {
+ { 1, "OK" },
+ { 2, "General error" },
+ { 0, NULL }
};
-#define NUM_INRESULT_TYPES 4
-#define inresulttype2str(t) \
- ((t < NUM_INRESULT_TYPES) ? inresulttypestr[t] : "Unknown Incoming-Call-Reply result code")
-
-static const char *inresulttypestr[NUM_INRESULT_TYPES] = {
- "Unknown Incoming-Call-Reply result code",
- "Connect",
- "General Error",
- "Do Not Accept"
+static const value_string out_resulttype_vals[] = {
+ { 1, "Connected" },
+ { 2, "General Error" },
+ { 3, "No Carrier" },
+ { 4, "Busy" },
+ { 5, "No Dial Tone" },
+ { 6, "Time-out" },
+ { 7, "Do Not Accept" },
+ { 0, NULL }
};
-#define NUM_DISCRESULT_TYPES 5
-#define discresulttype2str(t) \
- ((t < NUM_DISCRESULT_TYPES) ? discresulttypestr[t] : "Unknown Call-Disconnect-Notify result code")
-
-static const char *discresulttypestr[NUM_DISCRESULT_TYPES] = {
- "Unknown Call-Disconnect-Notify result code",
- "Lost Carrier",
- "General Error",
- "Admin Shutdown",
- "Request"
+static const value_string in_resulttype_vals[] = {
+ { 1, "Connect" },
+ { 2, "General error" },
+ { 3, "Do Not Accept" },
+ { 0, NULL }
};
-static void dissect_unknown(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_cntrl_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_cntrl_reply(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_stop_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_stop_reply(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_echo_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_echo_reply(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_out_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_out_reply(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_in_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_in_reply(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_in_connected(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_clear_req(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_disc_notify(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_error_notify(tvbuff_t *, int, packet_info *, proto_tree *);
-static void dissect_set_link(tvbuff_t *, int, packet_info *, proto_tree *);
-
-#define NUM_CNTRL_TYPES 16
-#define cntrltype2str(t) \
- ((t < NUM_CNTRL_TYPES) ? strfuncs[t].str : "UNKNOWN-CONTROL-TYPE")
-
-static struct strfunc {
- const char * str;
- void (*func)(tvbuff_t *, int, packet_info *, proto_tree *);
-} strfuncs[NUM_CNTRL_TYPES] = {
- {"Unknown control type", dissect_unknown },
- {"Start-Control-Connection-Request", dissect_cntrl_req },
- {"Start-Control-Connection-Reply", dissect_cntrl_reply },
- {"Stop-Control-Connection-Request", dissect_stop_req },
- {"Stop-Control-Connection-Reply", dissect_stop_reply },
- {"Echo-Request", dissect_echo_req },
- {"Echo-Reply", dissect_echo_reply },
- {"Outgoing-Call-Request", dissect_out_req },
- {"Outgoing-Call-Reply", dissect_out_reply },
- {"Incoming-Call-Request", dissect_in_req },
- {"Incoming-Call-Reply", dissect_in_reply },
- {"Incoming-Call-Connected", dissect_in_connected },
- {"Call-Clear-Request", dissect_clear_req },
- {"Call-Disconnect-Notify", dissect_disc_notify },
- {"WAN-Error-Notify", dissect_error_notify },
- {"Set-Link-Info", dissect_set_link }
+static const value_string disc_resulttype_vals[] = {
+ { 1, "Lost Carrier" },
+ { 2, "General Error" },
+ { 3, "Admin Shutdown" },
+ { 4, "Request" },
+ { 0, NULL }
};
-/*
- * Length of host name and vendor name strings in control requests and
- * replies.
- */
-#define HOSTLEN 64
-#define VENDORLEN 64
-
-/*
- * Length of phone number(s) and subaddress in call requests.
- */
-#define PHONELEN 64
-#define SUBADDRLEN 64
-
-/*
- * Length of statistics in a Call-Disconnect-Notify message.
- */
-#define STATSLEN 128
-
-static void
-dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- int offset = 0;
- guint16 len;
- guint16 cntrl_type;
-
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPTP");
- col_clear(pinfo->cinfo, COL_INFO);
-
- len = tvb_get_ntohs(tvb, offset);
- cntrl_type = tvb_get_ntohs(tvb, offset + 8);
-
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, cntrltype2str(cntrl_type));
-
- if (tree) {
- guint32 cookie;
- proto_item * ti;
- proto_tree * pptp_tree;
-
- ti = proto_tree_add_item(tree, proto_pptp, tvb, offset, len, FALSE);
- pptp_tree = proto_item_add_subtree(ti, ett_pptp);
-
- proto_tree_add_text(pptp_tree, tvb, offset, 2, "Length: %u", len);
- offset += 2;
-
- proto_tree_add_item(pptp_tree, hf_pptp_message_type, tvb,
- offset, 2, FALSE);
- offset += 2;
-
- cookie = tvb_get_ntohl(tvb, offset);
-
- if (cookie == MAGIC_COOKIE)
- proto_tree_add_text(pptp_tree, tvb, offset, 4,
- "Cookie: %#08x (correct)", cookie);
- else
- proto_tree_add_text(pptp_tree, tvb, offset, 4,
- "Cookie: %#08x (incorrect)", cookie);
- offset += 4;
-
- proto_tree_add_text(pptp_tree, tvb, offset, 2,
- "Control type: %s (%u)", cntrltype2str(cntrl_type), cntrl_type);
- offset += 2;
-
- proto_tree_add_text(pptp_tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
- offset += 2;
-
- if (cntrl_type < NUM_CNTRL_TYPES)
- ( *(strfuncs[cntrl_type].func))(tvb, offset, pinfo, pptp_tree);
- else
- call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, pptp_tree);
- }
-}
-
static void
dissect_unknown(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
@@ -293,515 +206,441 @@ static void
dissect_cntrl_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 major_ver;
- guint8 minor_ver;
- guint32 frame;
- guint32 bearer;
- guint8 host[HOSTLEN+1];
- guint8 vendor[VENDORLEN+1];
-
- major_ver = tvb_get_guint8(tvb, offset);
- minor_ver = tvb_get_guint8(tvb, offset + 1);
- proto_tree_add_text(tree, tvb, offset, 2,
- "Protocol version: %u.%u", major_ver, minor_ver);
+ proto_tree_add_uint_format(tree, hf_pptp_protocol_version, tvb, offset,
+ 2, tvb_get_ntohs(tvb, offset), "Protocol version: %u.%u",
+ tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- frame = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Framing capabilities: %s (%u)", frametype2str(frame), frame);
+ proto_tree_add_item(tree, hf_pptp_framing_capabilities, tvb, offset, 4, FALSE);
offset += 4;
- bearer = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
+ proto_tree_add_item(tree, hf_pptp_bearer_capabilities, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Maximum channels: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_maximum_channels, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Firmware revision: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_firmware_revision, tvb, offset, 2, FALSE);
offset += 2;
- tvb_memcpy(tvb, host, offset, HOSTLEN);
- host[HOSTLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, HOSTLEN,
- "Hostname: %s", host);
- offset += HOSTLEN;
+ proto_tree_add_item(tree, hf_pptp_host_name, tvb, offset, 64, FALSE);
+ offset += 64;
- tvb_memcpy(tvb, vendor, offset, VENDORLEN);
- vendor[VENDORLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, VENDORLEN,
- "Vendor: %s", vendor);
+ proto_tree_add_item(tree, hf_pptp_vendor_name, tvb, offset, 64, FALSE);
}
static void
dissect_cntrl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 major_ver;
- guint8 minor_ver;
- guint8 result;
- guint8 error;
- guint32 frame;
- guint32 bearer;
- guint8 host[HOSTLEN+1];
- guint8 vendor[VENDORLEN+1];
-
- major_ver = tvb_get_guint8(tvb, offset);
- minor_ver = tvb_get_guint8(tvb, offset + 1);
- proto_tree_add_text(tree, tvb, offset, 2,
- "Protocol version: %u.%u", major_ver, minor_ver);
- offset += 2;
-
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", cntrlresulttype2str(result), result);
+
+ proto_tree_add_uint_format(tree, hf_pptp_protocol_version, tvb, offset,
+ 2, tvb_get_ntohs(tvb, offset), "Protocol version: %u.%u",
+ tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1));
+ offset += 2;
+
+ proto_tree_add_item(tree, hf_pptp_control_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- frame = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Framing capabilities: %s (%u)", frametype2str(frame), frame);
+ proto_tree_add_item(tree, hf_pptp_framing_capabilities, tvb, offset, 4, FALSE);
offset += 4;
- bearer = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
+ proto_tree_add_item(tree, hf_pptp_bearer_capabilities, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Maximum channels: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_maximum_channels, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Firmware revision: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_firmware_revision, tvb, offset, 2, FALSE);
offset += 2;
- tvb_memcpy(tvb, host, offset, HOSTLEN);
- host[HOSTLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, HOSTLEN,
- "Hostname: %s", host);
- offset += HOSTLEN;
+ proto_tree_add_item(tree, hf_pptp_host_name, tvb, offset, 64, FALSE);
+ offset += 64;
+
+ proto_tree_add_item(tree, hf_pptp_vendor_name, tvb, offset, 64, FALSE);
- tvb_memcpy(tvb, vendor, offset, VENDORLEN);
- vendor[VENDORLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, VENDORLEN,
- "Vendor: %s", vendor);
}
static void
dissect_stop_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 reason;
-
- reason = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Reason: %s (%u)", reasontype2str(reason), reason);
+ proto_tree_add_item(tree, hf_pptp_reason, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 1,
- "Reserved: %u", tvb_get_guint8(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);;
}
static void
dissect_stop_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 result;
- guint8 error;
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", stopresulttype2str(result), result);
+ proto_tree_add_item(tree, hf_pptp_stop_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);;
+
}
static void
dissect_echo_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- proto_tree_add_text(tree, tvb, offset, 4,
- "Identifier: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_identifier, tvb, offset, 4, FALSE);;
}
static void
dissect_echo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 result;
- guint8 error;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Identifier: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_identifier, tvb, offset, 4, FALSE);
offset += 4;
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", echoresulttype2str(result), result);
+ proto_tree_add_item(tree, hf_pptp_echo_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, sizeof(error),
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
}
static void
dissect_out_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint32 bearer;
- guint32 frame;
- guint8 phone[PHONELEN+1];
- guint8 subaddr[SUBADDRLEN+1];
-
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call Serial Number: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_serial_number, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Minimum BPS: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_minimum_bps, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Maximum BPS: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_maximum_bps, tvb, offset, 4, FALSE);
offset += 4;
- bearer = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
+ proto_tree_add_item(tree, hf_pptp_bearer_type, tvb, offset, 4, FALSE);
offset += 4;
- frame = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Framing capabilities: %s (%u)", frametype2str(frame), frame);
+ proto_tree_add_item(tree, hf_pptp_framing_type, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Receive window size: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Processing delay: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Phone number length: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_phone_number_length, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- tvb_memcpy(tvb, phone, offset, PHONELEN);
- phone[PHONELEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, PHONELEN,
- "Phone number: %s", phone);
- offset += PHONELEN;
+ proto_tree_add_item(tree, hf_pptp_phone_number, tvb, offset, 64, FALSE);
+ offset += 64;
- tvb_memcpy(tvb, subaddr, offset, SUBADDRLEN);
- subaddr[SUBADDRLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, SUBADDRLEN,
- "Subaddress: %s", subaddr);
+ proto_tree_add_item(tree, hf_pptp_subaddress, tvb, offset, 64, FALSE);
}
static void
dissect_out_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 result;
- guint8 error;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Peer's call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, FALSE);
offset += 2;
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", outresulttype2str(result), result);
+ proto_tree_add_item(tree, hf_pptp_out_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Cause code: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_cause, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Connect speed: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_connect_speed, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Receive window size: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Processing delay: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Physical channel ID: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_physical_channel_id, tvb, offset, 4, FALSE);
}
static void
dissect_in_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint32 bearer;
- guint8 dialed[PHONELEN+1];
- guint8 dialing[PHONELEN+1];
- guint8 subaddr[SUBADDRLEN+1];
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call serial number: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_serial_number, tvb, offset, 2, FALSE);
offset += 2;
- bearer = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Bearer capabilities: %s (%u)", bearertype2str(bearer), bearer);
+ proto_tree_add_item(tree, hf_pptp_bearer_type, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Physical channel ID: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_physical_channel_id, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Dialed number length: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_dialed_number_length, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Dialing number length: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_dialing_number_length, tvb, offset, 2, FALSE);
offset += 2;
- tvb_memcpy(tvb, dialing, offset, PHONELEN);
- dialed[PHONELEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, PHONELEN,
- "Dialed number: %s", dialed);
- offset += PHONELEN;
+ proto_tree_add_item(tree, hf_pptp_dialed_number, tvb, offset, 64, FALSE);
+ offset += 64;
- tvb_memcpy(tvb, dialing, offset, PHONELEN);
- dialing[PHONELEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, PHONELEN,
- "Dialing number: %s", dialing);
- offset += PHONELEN;
+ proto_tree_add_item(tree, hf_pptp_dialing_number, tvb, offset, 64, FALSE);
+ offset += 64;
- tvb_memcpy(tvb, subaddr, offset, SUBADDRLEN);
- subaddr[SUBADDRLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, SUBADDRLEN,
- "Subaddress: %s", subaddr);
+ proto_tree_add_item(tree, hf_pptp_subaddress, tvb, offset, 64, FALSE);
}
static void
dissect_in_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 result;
- guint8 error;
-
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Peer's call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, FALSE);
offset += 2;
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", inresulttype2str(result), result);
+ proto_tree_add_item(tree, hf_pptp_in_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Receive window size: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Processing delay: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
}
static void
dissect_in_connected(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint32 frame;
-
- proto_tree_add_text(tree, tvb, offset, 2,
- "Peer's call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Connect speed: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_connect_speed, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Receive window size: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_receive_window_size, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Processing delay: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_packet_processing_delay, tvb, offset, 2, FALSE);
offset += 2;
- frame = tvb_get_ntohl(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 4,
- "Framing capabilities: %s (%u)", frametype2str(frame), frame);
+ proto_tree_add_item(tree, hf_pptp_framing_type, tvb, offset, 4, FALSE);
}
static void
dissect_clear_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
}
static void
dissect_disc_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- guint8 result;
- guint8 error;
- guint8 stats[STATSLEN+1];
-
- proto_tree_add_text(tree, tvb, offset, 2,
- "Call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_call_id, tvb, offset, 2, FALSE);
offset += 2;
- result = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Result: %s (%u)", discresulttype2str(result), result);
+ proto_tree_add_item(tree, hf_pptp_disc_result, tvb, offset, 1, FALSE);
offset += 1;
- error = tvb_get_guint8(tvb, offset);
- proto_tree_add_text(tree, tvb, offset, 1,
- "Error: %s (%u)", errortype2str(error), error);
+ proto_tree_add_item(tree, hf_pptp_error, tvb, offset, 1, FALSE);
offset += 1;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Cause code: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_cause, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- tvb_memcpy(tvb, stats, offset, STATSLEN);
- stats[STATSLEN] = '\0';
- proto_tree_add_text(tree, tvb, offset, STATSLEN,
- "Call statistics: %s", stats);
+ proto_tree_add_item(tree, hf_pptp_call_statistics, tvb, offset, 64, FALSE);
}
static void
dissect_error_notify(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- proto_tree_add_text(tree, tvb, offset, 2,
- "Peer's call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "CRC errors: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_crc_errors, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Framing errors: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_framing_errors, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Hardware overruns: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_hardware_overruns, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Buffer overruns: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_buffer_overruns, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Time-out errors: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_timeout_errors, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Alignment errors: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_alignment_errors, tvb, offset, 4, FALSE);
}
static void
dissect_set_link(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree)
{
- proto_tree_add_text(tree, tvb, offset, 2,
- "Peer's call ID: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_peer_call_id, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 2,
- "Reserved: %u", tvb_get_ntohs(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
offset += 2;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Send ACCM: %#08x", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_send_accm, tvb, offset, 4, FALSE);
offset += 4;
- proto_tree_add_text(tree, tvb, offset, 4,
- "Recv ACCM: %#08x", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_item(tree, hf_pptp_receive_accm, tvb, offset, 4, FALSE);
+}
+
+static void
+dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ int offset = 0;
+ guint16 len;
+ guint16 control_message_type;
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPTP");
+
+ len = tvb_get_ntohs(tvb, offset);
+ control_message_type = tvb_get_ntohs(tvb, offset + 8);
+
+ col_add_str(pinfo->cinfo, COL_INFO,
+ val_to_str(control_message_type, control_message_type_vals,
+ "Unknown control type (%d)"));
+
+ if (tree) {
+ proto_item *ti, *item;
+ proto_tree *pptp_tree;
+
+ ti = proto_tree_add_item(tree, proto_pptp, tvb, offset, len, FALSE);
+ pptp_tree = proto_item_add_subtree(ti, ett_pptp);
+
+ proto_tree_add_item(pptp_tree, hf_pptp_length, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ proto_tree_add_item(pptp_tree, hf_pptp_message_type, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ item = proto_tree_add_item(pptp_tree, hf_pptp_magic_cookie, tvb, offset, 4, FALSE);
+
+ if (tvb_get_ntohl(tvb, offset) == MAGIC_COOKIE)
+ proto_item_append_text(item," (correct)");
+ else
+ proto_item_append_text(item," (incorrect)");
+
+ offset += 4;
+
+ proto_tree_add_item(pptp_tree, hf_pptp_control_message_type, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ proto_tree_add_item(pptp_tree, hf_pptp_reserved, tvb, offset, 2, FALSE);
+ offset += 2;
+
+ switch(control_message_type){
+ case 0x01: /* Start-Control-Connection-Request */
+ dissect_cntrl_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x02: /* Start-Control-Connection-Reply */
+ dissect_cntrl_reply(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x03: /* Stop-Control-Connection-Request */
+ dissect_stop_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x04: /* Stop-Control-Connection-Reply */
+ dissect_stop_reply(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x05: /* Echo-Request */
+ dissect_echo_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x06: /* Echo-Reply */
+ dissect_echo_reply(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x07: /* Outgoing-Call-Request */
+ dissect_out_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x08: /* Outgoing-Call-Reply */
+ dissect_out_reply(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x09: /* Incoming-Call-Request */
+ dissect_in_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0A: /* Incoming-Call-Reply */
+ dissect_in_reply(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0B: /* Incoming-Call-Connected */
+ dissect_in_connected(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0C: /* Call-Clear-Request */
+ dissect_clear_req(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0D: /* Call-Disconnect-Notify */
+ dissect_disc_notify(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0E: /* WAN-Error-Notify */
+ dissect_error_notify(tvb, offset, pinfo, pptp_tree);
+ break;
+ case 0x0F: /* Set-Link-Info */
+ dissect_set_link(tvb, offset, pinfo, pptp_tree);
+ break;
+ default: /* Unknown Type... */
+ dissect_unknown(tvb, offset, pinfo, pptp_tree);
+ break;
+ }
+ }
}
void
@@ -812,10 +651,203 @@ proto_register_pptp(void)
};
static hf_register_info hf[] = {
+ { &hf_pptp_length,
+ { "Length", "pptp.length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Total length in octets of this PPTP message", HFILL }},
{ &hf_pptp_message_type,
{ "Message type", "pptp.type",
FT_UINT16, BASE_DEC, VALS(msgtype_vals), 0x0,
- "PPTP message type", HFILL }}
+ "PPTP message type", HFILL }},
+ { &hf_pptp_magic_cookie,
+ { "Magic Cookie", "pptp.magic_cookie",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "This constant value is used as a sanity check on received messages", HFILL }},
+ { &hf_pptp_control_message_type,
+ { "Control Message Type", "pptp.control_message_type",
+ FT_UINT16, BASE_DEC, VALS(control_message_type_vals), 0x0,
+ NULL, HFILL }},
+ { &hf_pptp_reserved,
+ { "Reserved", "pptp.reserved",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "This field MUST be 0", HFILL }},
+ { &hf_pptp_protocol_version,
+ { "Protocol version", "pptp.protocol_version",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The version of the PPTP protocol", HFILL }},
+ { &hf_pptp_framing_capabilities,
+ { "Framing Capabilities", "pptp.framing_capabilities",
+ FT_UINT32, BASE_DEC, VALS(frametype_vals), 0x0,
+ "A set of bits indicating the type of framing", HFILL }},
+ { &hf_pptp_bearer_capabilities,
+ { "Bearer Capabilities", "pptp.bearer_capabilities",
+ FT_UINT32, BASE_DEC, VALS(bearertype_vals), 0x0,
+ "A set of bits indicating the type of bearer", HFILL }},
+ { &hf_pptp_maximum_channels,
+ { "Maximum Channels", "pptp.maximum_channels",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The total number of individual PPP sessions this PAC can support", HFILL }},
+ { &hf_pptp_firmware_revision,
+ { "Firmware Revision", "pptp.firmware_revision",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "This field contains the firmware revision", HFILL }},
+ { &hf_pptp_host_name,
+ { "Host Name", "pptp.host_name",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "A 64 octet field containing the DNS name", HFILL }},
+ { &hf_pptp_vendor_name,
+ { "Vendor Name", "pptp.vendor_name",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "A 64 octet field containing a vendor", HFILL }},
+ { &hf_pptp_control_result,
+ { "Result Code", "pptp.control_result",
+ FT_UINT8, BASE_DEC, VALS(control_resulttype_vals), 0x0,
+ "Indicates the result of the command channel establishment attempt", HFILL }},
+ { &hf_pptp_error,
+ { "Error Code", "pptp.error",
+ FT_UINT8, BASE_DEC, VALS(errortype_vals), 0x0,
+ NULL, HFILL }},
+ { &hf_pptp_reason,
+ { "Reason", "pptp.reason",
+ FT_UINT8, BASE_DEC, VALS(reasontype_vals), 0x0,
+ "Indicates the reason for the control connection being close", HFILL }},
+ { &hf_pptp_stop_result,
+ { "Result Code", "pptp.stop_result",
+ FT_UINT8, BASE_DEC, VALS(stop_resulttype_vals), 0x0,
+ "Indicates the result of the attempt to close the control connection", HFILL }},
+ { &hf_pptp_identifier,
+ { "Identifier", "pptp.identifier",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_pptp_echo_result,
+ { "Result Code", "pptp.echo_result",
+ FT_UINT8, BASE_DEC, VALS(echo_resulttype_vals), 0x0,
+ "Indicates the result of the receipt of the Echo-Request", HFILL }},
+ { &hf_pptp_call_id,
+ { "Call ID", "pptp.call_id",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL }},
+ { &hf_pptp_call_serial_number,
+ { "Call Serial Number", "pptp.call_serial_number",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "An identifier assigned by the PNS to this session for the purpose of identifying this particular session in logged session information", HFILL }},
+ { &hf_pptp_minimum_bps,
+ { "Minimum BPS", "pptp.minimum_bps",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "The lowest acceptable line speed (in bits/second) for this session", HFILL }},
+ { &hf_pptp_maximum_bps,
+ { "Maximum BPS", "pptp.maximum_bps",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "The highest acceptable line speed (in bits/second) for this session", HFILL }},
+ { &hf_pptp_framing_type,
+ { "Framing Type", "pptp.framing_type",
+ FT_UINT32, BASE_DEC, VALS(frametype_vals), 0x0,
+ "A value indicating the type of PPP framing to be used for this outgoing call", HFILL }},
+ { &hf_pptp_bearer_type,
+ { "Bearer Type", "pptp.bearer_type",
+ FT_UINT32, BASE_DEC, VALS(bearertype_vals), 0x0,
+ "A value indicating the bearer capability required for this outgoing call", HFILL }},
+ { &hf_pptp_packet_receive_window_size,
+ { "Packet Receive Window Size", "pptp.packet_receive_window_size",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "A unique identifier, unique to a particular PAC-PNS pair assigned by the PNS", HFILL }},
+ { &hf_pptp_packet_processing_delay,
+ { "Packet Processing Delay", "pptp.packet_processing_delay",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "A measure of the packet processing delay that might be imposed on data sent to the PNS from the PAC", HFILL }},
+ { &hf_pptp_phone_number_length,
+ { "Phone Number Length", "pptp.phone_number_length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The actual number of valid digits in the Phone Number field", HFILL }},
+ { &hf_pptp_phone_number,
+ { "Phone Number", "pptp.phone_number",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "The number to be dialed to establish the outgoing session", HFILL }},
+ { &hf_pptp_subaddress,
+ { "Subaddress", "pptp.subaddress",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "A 64 octet field used to specify additional dialing information.", HFILL }},
+ { &hf_pptp_peer_call_id,
+ { "Peer Call ID", "pptp.peer_call_id",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "This field is set to the value received in the Call ID field of the corresponding Outgoing-Call-Request message", HFILL }},
+ { &hf_pptp_out_result,
+ { "Result Code", "pptp.out_result",
+ FT_UINT8, BASE_DEC, VALS(out_resulttype_vals), 0x0,
+ "Indicates the result of the receipt of the Outgoing-Call-Request attempt", HFILL }},
+ { &hf_pptp_cause,
+ { "Cause Code", "pptp.cause",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "This field gives additional information", HFILL }},
+ { &hf_pptp_connect_speed,
+ { "Connect Speed", "pptp.connect_speed",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "The actual connection speed used, in bits/second.", HFILL }},
+ { &hf_pptp_physical_channel_id,
+ { "Physical Channel ID", "pptp.physical_channel_id",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "This field is set by the PAC in a vendor-specific manner to the physical channel number used to place this call", HFILL }},
+ { &hf_pptp_dialed_number_length,
+ { "Dialed Number Length", "pptp.dialed_number_length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The actual number of valid digits in the Dialed Number field", HFILL }},
+ { &hf_pptp_dialed_number,
+ { "Dialed Number", "pptp.dialed_number",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "The number that was dialed by the caller", HFILL }},
+
+ { &hf_pptp_dialing_number_length,
+ { "Dialing Number Length", "pptp.dialing_number_length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The actual number of valid digits in the Dialing Number field", HFILL }},
+ { &hf_pptp_dialing_number,
+ { "Dialing Number", "pptp.dialing_number",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "The number from which the call was placed", HFILL }},
+ { &hf_pptp_in_result,
+ { "Result Code", "pptp.in_result",
+ FT_UINT8, BASE_DEC, VALS(in_resulttype_vals), 0x0,
+ "This value indicates the result of the Incoming-Call-Request attemp", HFILL }},
+ { &hf_pptp_disc_result,
+ { "Result Code", "pptp.disc_result",
+ FT_UINT8, BASE_DEC, VALS(disc_resulttype_vals), 0x0,
+ "This value indicates the reason for the disconnect", HFILL }},
+ { &hf_pptp_call_statistics,
+ { "Call Statistics", "pptp.call_Statistics",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "This field is an ASCII string containing vendor-specific call statistics that can be logged for diagnostic purpose", HFILL }},
+ { &hf_pptp_crc_errors,
+ { "CRC Errors", "pptp.crc_errors",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of PPP frames received with CRC errors since session was established", HFILL }},
+ { &hf_pptp_framing_errors,
+ { "Framing Errors", "pptp.framing_errors",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of improperly framed PPP packets received", HFILL }},
+ { &hf_pptp_hardware_overruns,
+ { "Hardware overruns", "pptp.hardware_overruns",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of receive buffer over-runs since session was established", HFILL }},
+ { &hf_pptp_buffer_overruns,
+ { "Buffer overruns", "pptp.buffer_overruns",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of buffer over-runs detected since session was established", HFILL }},
+ { &hf_pptp_timeout_errors,
+ { "Time-out Errors", "pptp.timeout_errors",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of time-outs since call was established", HFILL }},
+ { &hf_pptp_alignment_errors,
+ { "Alignment Errors", "pptp.alignment_errors",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Number of Alignment errors since call was established", HFILL }},
+ { &hf_pptp_send_accm,
+ { "Send ACCM", "pptp.send_accm",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "The send ACCM value the client should use to process outgoing PPP packets", HFILL }},
+ { &hf_pptp_receive_accm,
+ { "Receive ACCM", "pptp.receive_accm",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "The Receive ACCM value the client should use to process incoming PPP packets", HFILL }},
};
proto_pptp = proto_register_protocol("Point-to-Point Tunnelling Protocol",