2001-03-09 13:38:19 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that: (1) source code distributions
|
|
|
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
|
|
|
* distributions including binary code include the above copyright notice and
|
|
|
|
* this paragraph in its entirety in the documentation or other materials
|
|
|
|
* provided with the distribution, and (3) all advertising materials mentioning
|
|
|
|
* features or use of this software display the following acknowledgement:
|
|
|
|
* ``This product includes software developed by the University of California,
|
|
|
|
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
|
|
|
* the University nor the names of its contributors may be used to endorse
|
|
|
|
* or promote products derived from this software without specific prior
|
|
|
|
* written permission.
|
|
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
|
|
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
* PPTP support contributed by Motonori Shindo (mshindo@mshindo.net)
|
|
|
|
*/
|
|
|
|
|
2016-08-14 21:42:19 +08:00
|
|
|
/* \summary: Point-to-Point Tunnelling Protocol (PPTP) printer */
|
|
|
|
|
2017-12-31 10:18:37 +08:00
|
|
|
/* specification: RFC 2637 */
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2018-01-22 04:27:08 +08:00
|
|
|
#include <config.h>
|
2001-03-09 13:38:19 +08:00
|
|
|
#endif
|
|
|
|
|
2018-01-20 22:59:49 +08:00
|
|
|
#include "netdissect-stdinc.h"
|
2002-08-01 16:52:55 +08:00
|
|
|
|
2015-09-06 05:35:58 +08:00
|
|
|
#include "netdissect.h"
|
2002-12-11 15:13:49 +08:00
|
|
|
#include "extract.h"
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2013-12-26 22:08:06 +08:00
|
|
|
static const char tstr[] = " [|pptp]";
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
#define PPTP_MSG_TYPE_CTRL 1 /* Control Message */
|
|
|
|
#define PPTP_MSG_TYPE_MGMT 2 /* Management Message (currently not used */
|
|
|
|
#define PPTP_MAGIC_COOKIE 0x1a2b3c4d /* for sanity check */
|
|
|
|
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_SCCRQ 1
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_SCCRP 2
|
2002-06-12 01:08:37 +08:00
|
|
|
#define PPTP_CTRL_MSG_TYPE_StopCCRQ 3
|
2001-03-09 13:38:19 +08:00
|
|
|
#define PPTP_CTRL_MSG_TYPE_StopCCRP 4
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_ECHORQ 5
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_ECHORP 6
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_OCRQ 7
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_OCRP 8
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_ICRQ 9
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_ICRP 10
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_ICCN 11
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_CCRQ 12
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_CDN 13
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_WEN 14
|
|
|
|
#define PPTP_CTRL_MSG_TYPE_SLI 15
|
|
|
|
|
|
|
|
#define PPTP_FRAMING_CAP_ASYNC_MASK 0x00000001 /* Aynchronous */
|
|
|
|
#define PPTP_FRAMING_CAP_SYNC_MASK 0x00000002 /* Synchronous */
|
|
|
|
|
|
|
|
#define PPTP_BEARER_CAP_ANALOG_MASK 0x00000001 /* Analog */
|
|
|
|
#define PPTP_BEARER_CAP_DIGITAL_MASK 0x00000002 /* Digital */
|
|
|
|
|
Add a few more GCC warnings on GCC >= 2 for ".devel" builds.
From Neil T. Spring: fixes for many of those warnings:
addrtoname.c, configure.in: Linux needs netinet/ether.h for
ether_ntohost
print-*.c: change char *foo = "bar" to const char *foo = "bar"
to appease -Wwrite-strings; should affect no run-time behavior.
print-*.c: make some variables unsigned.
print-bgp.c: plen ('prefix len') is unsigned, no reason to
validate by comparing to zero.
print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
instead of inet_ntoa.
print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
be false, so check for (u_int)-1, which represents failure,
explicitly.
print-isakmp.c: complete initialization of attrmap objects.
print-lwres.c: "if(x); print foo;" seemed much more likely to be
intended to be "if(x) { print foo; }".
print-smb.c: complete initialization of some structures.
In addition, add some fixes for the signed vs. unsigned comparison
warnings:
extract.h: cast the result of the byte-extraction-and-combining,
as, at least for the 16-bit version, C's integral promotions
will turn "u_int16_t" into "int" if there are other "int"s
nearby.
print-*.c: make some more variables unsigned, or add casts to an
unsigned type of signed values known not to be negative, or add
casts to "int" of unsigned values known to fit in an "int", and
make other changes needed to handle the aforementioned variables
now being unsigned.
print-isakmp.c: clean up the handling of error/status indicators
in notify messages.
print-ppp.c: get rid of a check that an unsigned quantity is >=
0.
print-radius.c: clean up some of the bounds checking.
print-smb.c: extract the word count into a "u_int" to avoid the
aforementioned problems with C's integral promotions.
print-snmp.c: change a check that an unsigned variable is >= 0
to a check that it's != 0.
Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
2002-09-05 08:00:07 +08:00
|
|
|
static const char *pptp_message_type_string[] = {
|
2001-03-09 13:38:19 +08:00
|
|
|
"NOT_DEFINED", /* 0 Not defined in the RFC2637 */
|
|
|
|
"SCCRQ", /* 1 Start-Control-Connection-Request */
|
|
|
|
"SCCRP", /* 2 Start-Control-Connection-Reply */
|
|
|
|
"StopCCRQ", /* 3 Stop-Control-Connection-Request */
|
|
|
|
"StopCCRP", /* 4 Stop-Control-Connection-Reply */
|
|
|
|
"ECHORQ", /* 5 Echo Request */
|
|
|
|
"ECHORP", /* 6 Echo Reply */
|
|
|
|
|
|
|
|
"OCRQ", /* 7 Outgoing-Call-Request */
|
|
|
|
"OCRP", /* 8 Outgoing-Call-Reply */
|
|
|
|
"ICRQ", /* 9 Incoming-Call-Request */
|
|
|
|
"ICRP", /* 10 Incoming-Call-Reply */
|
|
|
|
"ICCN", /* 11 Incoming-Call-Connected */
|
|
|
|
"CCRQ", /* 12 Call-Clear-Request */
|
|
|
|
"CDN", /* 13 Call-Disconnect-Notify */
|
|
|
|
|
|
|
|
"WEN", /* 14 WAN-Error-Notify */
|
|
|
|
|
|
|
|
"SLI" /* 15 Set-Link-Info */
|
|
|
|
#define PPTP_MAX_MSGTYPE_INDEX 16
|
|
|
|
};
|
|
|
|
|
|
|
|
/* common for all PPTP control messages */
|
|
|
|
struct pptp_hdr {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t length;
|
|
|
|
nd_uint16_t msg_type;
|
|
|
|
nd_uint32_t magic_cookie;
|
|
|
|
nd_uint16_t ctrl_msg_type;
|
2018-01-12 23:06:25 +08:00
|
|
|
nd_uint16_t reserved0;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_sccrq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t proto_ver;
|
|
|
|
nd_uint16_t reserved1;
|
|
|
|
nd_uint32_t framing_cap;
|
|
|
|
nd_uint32_t bearer_cap;
|
|
|
|
nd_uint16_t max_channel;
|
|
|
|
nd_uint16_t firm_rev;
|
|
|
|
nd_byte hostname[64];
|
|
|
|
nd_byte vendor[64];
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_sccrp {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t proto_ver;
|
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
|
|
|
nd_uint32_t framing_cap;
|
|
|
|
nd_uint32_t bearer_cap;
|
|
|
|
nd_uint16_t max_channel;
|
|
|
|
nd_uint16_t firm_rev;
|
|
|
|
nd_byte hostname[64];
|
|
|
|
nd_byte vendor[64];
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_stopccrq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint8_t reason;
|
2018-01-12 23:06:25 +08:00
|
|
|
nd_uint8_t reserved1;
|
2018-01-13 00:59:03 +08:00
|
|
|
nd_uint16_t reserved2;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_stopccrp {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
2018-01-13 00:59:03 +08:00
|
|
|
nd_uint16_t reserved1;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_echorq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint32_t id;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_echorp {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint32_t id;
|
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
2018-01-13 00:59:03 +08:00
|
|
|
nd_uint16_t reserved1;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_ocrq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint16_t call_ser;
|
|
|
|
nd_uint32_t min_bps;
|
|
|
|
nd_uint32_t max_bps;
|
|
|
|
nd_uint32_t bearer_type;
|
|
|
|
nd_uint32_t framing_type;
|
|
|
|
nd_uint16_t recv_winsiz;
|
|
|
|
nd_uint16_t pkt_proc_delay;
|
|
|
|
nd_uint16_t phone_no_len;
|
|
|
|
nd_uint16_t reserved1;
|
|
|
|
nd_byte phone_no[64];
|
|
|
|
nd_byte subaddr[64];
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_ocrp {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint16_t peer_call_id;
|
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
|
|
|
nd_uint16_t cause_code;
|
|
|
|
nd_uint32_t conn_speed;
|
|
|
|
nd_uint16_t recv_winsiz;
|
|
|
|
nd_uint16_t pkt_proc_delay;
|
|
|
|
nd_uint32_t phy_chan_id;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_icrq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint16_t call_ser;
|
|
|
|
nd_uint32_t bearer_type;
|
|
|
|
nd_uint32_t phy_chan_id;
|
|
|
|
nd_uint16_t dialed_no_len;
|
|
|
|
nd_uint16_t dialing_no_len;
|
|
|
|
nd_byte dialed_no[64]; /* DNIS */
|
|
|
|
nd_byte dialing_no[64]; /* CLID */
|
|
|
|
nd_byte subaddr[64];
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_icrp {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint16_t peer_call_id;
|
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
|
|
|
nd_uint16_t recv_winsiz;
|
|
|
|
nd_uint16_t pkt_proc_delay;
|
2018-01-13 00:59:03 +08:00
|
|
|
nd_uint16_t reserved1;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_iccn {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t peer_call_id;
|
|
|
|
nd_uint16_t reserved1;
|
|
|
|
nd_uint32_t conn_speed;
|
|
|
|
nd_uint16_t recv_winsiz;
|
|
|
|
nd_uint16_t pkt_proc_delay;
|
|
|
|
nd_uint32_t framing_type;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_ccrq {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint16_t reserved1;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_cdn {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t call_id;
|
|
|
|
nd_uint8_t result_code;
|
|
|
|
nd_uint8_t err_code;
|
|
|
|
nd_uint16_t cause_code;
|
|
|
|
nd_uint16_t reserved1;
|
|
|
|
nd_byte call_stats[128];
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_wen {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t peer_call_id;
|
2018-01-13 00:59:03 +08:00
|
|
|
nd_uint16_t reserved1;
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint32_t crc_err;
|
|
|
|
nd_uint32_t framing_err;
|
|
|
|
nd_uint32_t hardware_overrun;
|
|
|
|
nd_uint32_t buffer_overrun;
|
|
|
|
nd_uint32_t timeout_err;
|
|
|
|
nd_uint32_t align_err;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
struct pptp_msg_sli {
|
2017-12-31 10:18:37 +08:00
|
|
|
nd_uint16_t peer_call_id;
|
|
|
|
nd_uint16_t reserved1;
|
|
|
|
nd_uint32_t send_accm;
|
|
|
|
nd_uint32_t recv_accm;
|
2002-12-11 15:13:49 +08:00
|
|
|
};
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
/* attributes that appear more than once in above messages:
|
|
|
|
|
2002-06-12 01:08:37 +08:00
|
|
|
Number of
|
2001-03-09 13:38:19 +08:00
|
|
|
occurence attributes
|
|
|
|
--------------------------------------
|
2014-04-23 15:20:40 +08:00
|
|
|
2 uint32_t bearer_cap;
|
|
|
|
2 uint32_t bearer_type;
|
|
|
|
6 uint16_t call_id;
|
|
|
|
2 uint16_t call_ser;
|
|
|
|
2 uint16_t cause_code;
|
|
|
|
2 uint32_t conn_speed;
|
|
|
|
6 uint8_t err_code;
|
|
|
|
2 uint16_t firm_rev;
|
|
|
|
2 uint32_t framing_cap;
|
|
|
|
2 uint32_t framing_type;
|
2001-03-09 13:38:19 +08:00
|
|
|
2 u_char hostname[64];
|
2014-04-23 15:20:40 +08:00
|
|
|
2 uint32_t id;
|
|
|
|
2 uint16_t max_channel;
|
|
|
|
5 uint16_t peer_call_id;
|
|
|
|
2 uint32_t phy_chan_id;
|
|
|
|
4 uint16_t pkt_proc_delay;
|
|
|
|
2 uint16_t proto_ver;
|
|
|
|
4 uint16_t recv_winsiz;
|
|
|
|
2 uint8_t reserved1;
|
|
|
|
9 uint16_t reserved1;
|
|
|
|
6 uint8_t result_code;
|
2001-03-09 13:38:19 +08:00
|
|
|
2 u_char subaddr[64];
|
|
|
|
2 u_char vendor[64];
|
|
|
|
|
2002-06-12 01:08:37 +08:00
|
|
|
so I will prepare print out functions for these attributes (except for
|
2001-03-09 13:38:19 +08:00
|
|
|
reserved*).
|
|
|
|
*/
|
|
|
|
|
2018-01-13 00:59:03 +08:00
|
|
|
#define PRINT_RESERVED_IF_NOT_ZERO_1(reserved) \
|
|
|
|
if (EXTRACT_U_1(reserved)) \
|
|
|
|
ND_PRINT(" [ERROR: reserved=%u must be zero]", \
|
|
|
|
EXTRACT_U_1(reserved));
|
|
|
|
|
|
|
|
#define PRINT_RESERVED_IF_NOT_ZERO_2(reserved) \
|
|
|
|
if (EXTRACT_BE_U_2(reserved)) \
|
|
|
|
ND_PRINT(" [ERROR: reserved=%u must be zero]", \
|
|
|
|
EXTRACT_BE_U_2(reserved));
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
/******************************************/
|
|
|
|
/* Attribute-specific print out functions */
|
|
|
|
/******************************************/
|
|
|
|
|
|
|
|
/* In these attribute-specific print-out functions, it't not necessary
|
2014-03-19 17:57:56 +08:00
|
|
|
to do ND_TCHECK because they are already checked in the caller of
|
2001-03-09 13:38:19 +08:00
|
|
|
these functions. */
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_cap_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *bearer_cap)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" BEARER_CAP(%s%s)",
|
2017-12-31 10:18:37 +08:00
|
|
|
EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_DIGITAL_MASK ? "D" : "",
|
2018-01-07 18:47:30 +08:00
|
|
|
EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_ANALOG_MASK ? "A" : "");
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
2014-04-09 20:08:00 +08:00
|
|
|
static const struct tok pptp_btype_str[] = {
|
|
|
|
{ 1, "A" }, /* Analog */
|
|
|
|
{ 2, "D" }, /* Digital */
|
|
|
|
{ 3, "Any" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_type_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *bearer_type)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" BEARER_TYPE(%s)",
|
|
|
|
tok2str(pptp_btype_str, "?", EXTRACT_BE_U_4(*bearer_type)));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *call_id)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CALL_ID(%u)", EXTRACT_BE_U_2(*call_id));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_ser_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *call_ser)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CALL_SER_NUM(%u)", EXTRACT_BE_U_2(*call_ser));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_cause_code_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *cause_code)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CAUSE_CODE(%u)", EXTRACT_BE_U_2(*cause_code));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_conn_speed_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *conn_speed)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CONN_SPEED(%u)", EXTRACT_BE_U_4(*conn_speed));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
2014-04-09 20:08:00 +08:00
|
|
|
static const struct tok pptp_errcode_str[] = {
|
|
|
|
{ 0, "None" },
|
|
|
|
{ 1, "Not-Connected" },
|
|
|
|
{ 2, "Bad-Format" },
|
|
|
|
{ 3, "Bad-Value" },
|
|
|
|
{ 4, "No-Resource" },
|
|
|
|
{ 5, "Bad-Call-ID" },
|
|
|
|
{ 6, "PAC-Error" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint8_t *err_code)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" ERR_CODE(%u", EXTRACT_U_1(*err_code));
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":%s", tok2str(pptp_errcode_str, "?", EXTRACT_U_1(*err_code)));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(")");
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_firm_rev_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *firm_rev)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" FIRM_REV(%u)", EXTRACT_BE_U_2(*firm_rev));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_cap_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *framing_cap)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" FRAME_CAP(");
|
2017-12-31 10:18:37 +08:00
|
|
|
if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_ASYNC_MASK) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("A"); /* Async */
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2017-12-31 10:18:37 +08:00
|
|
|
if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_SYNC_MASK) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("S"); /* Sync */
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(")");
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
2014-04-09 20:08:00 +08:00
|
|
|
static const struct tok pptp_ftype_str[] = {
|
|
|
|
{ 1, "A" }, /* Async */
|
|
|
|
{ 2, "S" }, /* Sync */
|
|
|
|
{ 3, "E" }, /* Either */
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_type_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *framing_type)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" FRAME_TYPE(%s)",
|
|
|
|
tok2str(pptp_ftype_str, "?", EXTRACT_BE_U_4(*framing_type)));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_hostname_print(netdissect_options *ndo,
|
|
|
|
const u_char *hostname)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" HOSTNAME(%.64s)", hostname);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_id_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *id)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" ID(%u)", EXTRACT_BE_U_4(*id));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_max_channel_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *max_channel)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" MAX_CHAN(%u)", EXTRACT_BE_U_2(*max_channel));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *peer_call_id)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PEER_CALL_ID(%u)", EXTRACT_BE_U_2(*peer_call_id));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_phy_chan_id_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint32_t *phy_chan_id)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PHY_CHAN_ID(%u)", EXTRACT_BE_U_4(*phy_chan_id));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_pkt_proc_delay_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *pkt_proc_delay)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PROC_DELAY(%u)", EXTRACT_BE_U_2(*pkt_proc_delay));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_proto_ver_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *proto_ver)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PROTO_VER(%u.%u)", /* Version.Revision */
|
2017-12-31 10:18:37 +08:00
|
|
|
EXTRACT_BE_U_2(*proto_ver) >> 8,
|
2018-01-07 18:47:30 +08:00
|
|
|
EXTRACT_BE_U_2(*proto_ver) & 0xff);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_recv_winsiz_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint16_t *recv_winsiz)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" RECV_WIN(%u)", EXTRACT_BE_U_2(*recv_winsiz));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
2014-04-09 20:08:00 +08:00
|
|
|
static const struct tok pptp_scrrp_str[] = {
|
|
|
|
{ 1, "Successful channel establishment" },
|
|
|
|
{ 2, "General error" },
|
|
|
|
{ 3, "Command channel already exists" },
|
|
|
|
{ 4, "Requester is not authorized to establish a command channel" },
|
|
|
|
{ 5, "The protocol version of the requester is not supported" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct tok pptp_echorp_str[] = {
|
|
|
|
{ 1, "OK" },
|
|
|
|
{ 2, "General Error" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct tok pptp_ocrp_str[] = {
|
|
|
|
{ 1, "Connected" },
|
|
|
|
{ 2, "General Error" },
|
|
|
|
{ 3, "No Carrier" },
|
|
|
|
{ 4, "Busy" },
|
|
|
|
{ 5, "No Dial Tone" },
|
|
|
|
{ 6, "Time-out" },
|
|
|
|
{ 7, "Do Not Accept" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct tok pptp_icrp_str[] = {
|
|
|
|
{ 1, "Connect" },
|
|
|
|
{ 2, "General Error" },
|
|
|
|
{ 3, "Do Not Accept" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct tok pptp_cdn_str[] = {
|
|
|
|
{ 1, "Lost Carrier" },
|
|
|
|
{ 2, "General Error" },
|
|
|
|
{ 3, "Admin Shutdown" },
|
|
|
|
{ 4, "Request" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(netdissect_options *ndo,
|
2017-12-31 10:18:37 +08:00
|
|
|
const nd_uint8_t *result_code, int ctrl_msg_type)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" RESULT_CODE(%u", EXTRACT_U_1(*result_code));
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag) {
|
2014-04-09 20:08:00 +08:00
|
|
|
const struct tok *dict =
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_SCCRP ? pptp_scrrp_str :
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_StopCCRP ? pptp_echorp_str :
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_ECHORP ? pptp_echorp_str :
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_OCRP ? pptp_ocrp_str :
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_ICRP ? pptp_icrp_str :
|
|
|
|
ctrl_msg_type == PPTP_CTRL_MSG_TYPE_CDN ? pptp_cdn_str :
|
|
|
|
NULL; /* assertion error */
|
|
|
|
if (dict != NULL)
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":%s", tok2str(dict, "?", EXTRACT_U_1(*result_code)));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(")");
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_subaddr_print(netdissect_options *ndo,
|
|
|
|
const u_char *subaddr)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" SUB_ADDR(%.64s)", subaddr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_vendor_print(netdissect_options *ndo,
|
|
|
|
const u_char *vendor)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" VENDOR(%.64s)", vendor);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************/
|
|
|
|
/* PPTP message print out functions */
|
|
|
|
/************************************/
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sccrq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_sccrq *ptr = (const struct pptp_msg_sccrq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->proto_ver);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_proto_ver_print(ndo, &ptr->proto_ver);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->framing_cap);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_cap_print(ndo, &ptr->framing_cap);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->bearer_cap);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_cap_print(ndo, &ptr->bearer_cap);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->max_channel);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_max_channel_print(ndo, &ptr->max_channel);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->firm_rev);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_firm_rev_print(ndo, &ptr->firm_rev);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->hostname);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_hostname_print(ndo, &ptr->hostname[0]);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->vendor);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_vendor_print(ndo, &ptr->vendor[0]);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sccrp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_sccrp *ptr = (const struct pptp_msg_sccrp *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->proto_ver);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_proto_ver_print(ndo, &ptr->proto_ver);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_SCCRP);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->framing_cap);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_cap_print(ndo, &ptr->framing_cap);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->bearer_cap);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_cap_print(ndo, &ptr->bearer_cap);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->max_channel);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_max_channel_print(ndo, &ptr->max_channel);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->firm_rev);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_firm_rev_print(ndo, &ptr->firm_rev);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->hostname);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_hostname_print(ndo, &ptr->hostname[0]);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->vendor);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_vendor_print(ndo, &ptr->vendor[0]);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_stopccrq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_stopccrq *ptr = (const struct pptp_msg_stopccrq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->reason);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" REASON(%u", EXTRACT_U_1(ptr->reason));
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag) {
|
2017-12-31 10:18:37 +08:00
|
|
|
switch (EXTRACT_U_1(ptr->reason)) {
|
2001-03-09 13:38:19 +08:00
|
|
|
case 1:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":None");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case 2:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":Stop-Protocol");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case 3:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":Stop-Local-Shutdown");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
default:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(":?");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(")");
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_1(ptr->reserved1);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved2);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved2);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_stopccrp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_stopccrp *ptr = (const struct pptp_msg_stopccrp *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_StopCCRP);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_echorq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_echorq *ptr = (const struct pptp_msg_echorq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_id_print(ndo, &ptr->id);
|
2002-06-12 01:08:37 +08:00
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_echorp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_echorp *ptr = (const struct pptp_msg_echorp *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_id_print(ndo, &ptr->id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_ECHORP);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2002-06-12 01:08:37 +08:00
|
|
|
|
2001-03-09 13:38:19 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ocrq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_ocrq *ptr = (const struct pptp_msg_ocrq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_ser);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_ser_print(ndo, &ptr->call_ser);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->min_bps);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" MIN_BPS(%u)", EXTRACT_BE_U_4(ptr->min_bps));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->max_bps);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" MAX_BPS(%u)", EXTRACT_BE_U_4(ptr->max_bps));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->bearer_type);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_type_print(ndo, &ptr->bearer_type);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->framing_type);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_type_print(ndo, &ptr->framing_type);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->recv_winsiz);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->pkt_proc_delay);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->phone_no_len);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PHONE_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->phone_no_len));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->phone_no);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" PHONE_NO(%.64s)", ptr->phone_no);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->subaddr);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_subaddr_print(ndo, &ptr->subaddr[0]);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ocrp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_ocrp *ptr = (const struct pptp_msg_ocrp *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->peer_call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_OCRP);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->cause_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_cause_code_print(ndo, &ptr->cause_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->conn_speed);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_conn_speed_print(ndo, &ptr->conn_speed);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->recv_winsiz);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->pkt_proc_delay);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->phy_chan_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_icrq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_icrq *ptr = (const struct pptp_msg_icrq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_ser);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_ser_print(ndo, &ptr->call_ser);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->bearer_type);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_bearer_type_print(ndo, &ptr->bearer_type);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->phy_chan_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->dialed_no_len);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" DIALED_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialed_no_len));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->dialing_no_len);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" DIALING_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialing_no_len));
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->dialed_no);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" DIALED_NO(%.64s)", ptr->dialed_no);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->dialing_no);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" DIALING_NO(%.64s)", ptr->dialing_no);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->subaddr);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_subaddr_print(ndo, &ptr->subaddr[0]);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_icrp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_icrp *ptr = (const struct pptp_msg_icrp *)dat;
|
2002-06-12 01:08:37 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->peer_call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_ICRP);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->recv_winsiz);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->pkt_proc_delay);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_iccn_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_iccn *ptr = (const struct pptp_msg_iccn *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->peer_call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->conn_speed);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_conn_speed_print(ndo, &ptr->conn_speed);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->recv_winsiz);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->pkt_proc_delay);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->framing_type);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_framing_type_print(ndo, &ptr->framing_type);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ccrq_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_ccrq *ptr = (const struct pptp_msg_ccrq *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_cdn_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_cdn *ptr = (const struct pptp_msg_cdn *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_call_id_print(ndo, &ptr->call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->result_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_CDN);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_1(ptr->err_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_err_code_print(ndo, &ptr->err_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->cause_code);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_cause_code_print(ndo, &ptr->cause_code);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-13 03:24:38 +08:00
|
|
|
ND_TCHECK_SIZE(&ptr->call_stats);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CALL_STATS(%.128s)", ptr->call_stats);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_wen_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_wen *ptr = (const struct pptp_msg_wen *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->peer_call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->crc_err);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CRC_ERR(%u)", EXTRACT_BE_U_4(ptr->crc_err));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->framing_err);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" FRAMING_ERR(%u)", EXTRACT_BE_U_4(ptr->framing_err));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->hardware_overrun);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" HARDWARE_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->hardware_overrun));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->buffer_overrun);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" BUFFER_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->buffer_overrun));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->timeout_err);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" TIMEOUT_ERR(%u)", EXTRACT_BE_U_4(ptr->timeout_err));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->align_err);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" ALIGN_ERR(%u)", EXTRACT_BE_U_4(ptr->align_err));
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sli_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
2015-04-27 08:24:42 +08:00
|
|
|
const struct pptp_msg_sli *ptr = (const struct pptp_msg_sli *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->peer_call_id);
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(ptr->reserved1);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->send_accm);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" SEND_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->send_accm));
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(ptr->recv_accm);
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" RECV_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->recv_accm));
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_print(netdissect_options *ndo,
|
|
|
|
const u_char *dat)
|
2001-03-09 13:38:19 +08:00
|
|
|
{
|
|
|
|
const struct pptp_hdr *hdr;
|
2014-04-23 15:20:40 +08:00
|
|
|
uint32_t mc;
|
|
|
|
uint16_t ctrl_msg_type;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(": pptp");
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2015-04-27 08:24:42 +08:00
|
|
|
hdr = (const struct pptp_hdr *)dat;
|
2001-03-09 13:38:19 +08:00
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(hdr->length);
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" Length=%u", EXTRACT_BE_U_2(hdr->length));
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(hdr->msg_type);
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag) {
|
2017-12-31 10:18:37 +08:00
|
|
|
switch(EXTRACT_BE_U_2(hdr->msg_type)) {
|
2001-03-09 13:38:19 +08:00
|
|
|
case PPTP_MSG_TYPE_CTRL:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CTRL-MSG");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_MSG_TYPE_MGMT:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" MGMT-MSG");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
default:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" UNKNOWN-MSG-TYPE");
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_4(hdr->magic_cookie);
|
2017-12-31 10:18:37 +08:00
|
|
|
mc = EXTRACT_BE_U_4(hdr->magic_cookie);
|
2001-03-09 13:38:19 +08:00
|
|
|
if (mc != PPTP_MAGIC_COOKIE) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" UNEXPECTED Magic-Cookie!!(%08x)", mc);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2014-03-19 17:57:56 +08:00
|
|
|
if (ndo->ndo_vflag || mc != PPTP_MAGIC_COOKIE) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" Magic-Cookie=%08x", mc);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(hdr->ctrl_msg_type);
|
2017-12-31 10:18:37 +08:00
|
|
|
ctrl_msg_type = EXTRACT_BE_U_2(hdr->ctrl_msg_type);
|
2001-03-09 13:38:19 +08:00
|
|
|
if (ctrl_msg_type < PPTP_MAX_MSGTYPE_INDEX) {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" CTRL_MSGTYPE=%s",
|
|
|
|
pptp_message_type_string[ctrl_msg_type]);
|
2001-03-09 13:38:19 +08:00
|
|
|
} else {
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT(" UNKNOWN_CTRL_MSGTYPE(%u)", ctrl_msg_type);
|
2001-03-09 13:38:19 +08:00
|
|
|
}
|
2018-01-12 23:06:25 +08:00
|
|
|
ND_TCHECK_2(hdr->reserved0);
|
2018-01-13 00:59:03 +08:00
|
|
|
PRINT_RESERVED_IF_NOT_ZERO_2(hdr->reserved0);
|
2001-03-09 13:38:19 +08:00
|
|
|
|
|
|
|
dat += 12;
|
|
|
|
|
|
|
|
switch(ctrl_msg_type) {
|
|
|
|
case PPTP_CTRL_MSG_TYPE_SCCRQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sccrq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_SCCRP:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sccrp_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_StopCCRQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_stopccrq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_StopCCRP:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_stopccrp_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_ECHORQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_echorq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_ECHORP:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_echorp_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_OCRQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ocrq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_OCRP:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ocrp_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_ICRQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_icrq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_ICRP:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_icrp_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_ICCN:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_iccn_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_CCRQ:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_ccrq_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_CDN:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_cdn_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_WEN:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_wen_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
case PPTP_CTRL_MSG_TYPE_SLI:
|
2014-03-19 17:57:56 +08:00
|
|
|
pptp_sli_print(ndo, dat);
|
2001-03-09 13:38:19 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* do nothing */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
trunc:
|
2018-01-07 18:47:30 +08:00
|
|
|
ND_PRINT("%s", tstr);
|
2002-06-12 01:08:37 +08:00
|
|
|
}
|