]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-pptp.c
Fix small misspellings
[tcpdump] / print-pptp.c
index ee1acc92f575f358b858c252bc0351d844e9698c..7bdc7d82fd3cb98b200f841d3e93f2342eba50ca 100644 (file)
 /* specification: RFC 2637 */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "extract.h"
 
-static const char tstr[] = " [|pptp]";
 
 #define PPTP_MSG_TYPE_CTRL     1       /* Control Message */
 #define PPTP_MSG_TYPE_MGMT     2       /* Management Message (currently not used */
@@ -91,7 +90,7 @@ struct pptp_hdr {
        nd_uint16_t msg_type;
        nd_uint32_t magic_cookie;
        nd_uint16_t ctrl_msg_type;
-       nd_uint8_t reserved0[2];
+       nd_uint16_t reserved0;
 };
 
 struct pptp_msg_sccrq {
@@ -119,14 +118,14 @@ struct pptp_msg_sccrp {
 
 struct pptp_msg_stopccrq {
        nd_uint8_t  reason;
-       nd_byte     reserved1[1];
-       nd_byte     reserved2[2];
+       nd_uint8_t  reserved1;
+       nd_uint16_t reserved2;
 };
 
 struct pptp_msg_stopccrp {
        nd_uint8_t  result_code;
        nd_uint8_t  err_code;
-       nd_byte     reserved1[2];
+       nd_uint16_t reserved1;
 };
 
 struct pptp_msg_echorq {
@@ -137,7 +136,7 @@ struct pptp_msg_echorp {
        nd_uint32_t id;
        nd_uint8_t  result_code;
        nd_uint8_t  err_code;
-       nd_byte     reserved1[2];
+       nd_uint16_t reserved1;
 };
 
 struct pptp_msg_ocrq {
@@ -186,7 +185,7 @@ struct pptp_msg_icrp {
        nd_uint8_t  err_code;
        nd_uint16_t recv_winsiz;
        nd_uint16_t pkt_proc_delay;
-       nd_byte     reserved1[2];
+       nd_uint16_t reserved1;
 };
 
 struct pptp_msg_iccn {
@@ -214,7 +213,7 @@ struct pptp_msg_cdn {
 
 struct pptp_msg_wen {
        nd_uint16_t peer_call_id;
-       nd_byte     reserved1[2];
+       nd_uint16_t reserved1;
        nd_uint32_t crc_err;
        nd_uint32_t framing_err;
        nd_uint32_t hardware_overrun;
@@ -233,7 +232,7 @@ struct pptp_msg_sli {
 /* attributes that appear more than once in above messages:
 
    Number of
-   occurence    attributes
+   occurrence    attributes
   --------------------------------------
       2         uint32_t bearer_cap;
       2         uint32_t bearer_type;
@@ -263,6 +262,16 @@ struct pptp_msg_sli {
   reserved*).
 */
 
+#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));
+
 /******************************************/
 /* Attribute-specific print out functions */
 /******************************************/
@@ -523,26 +532,27 @@ pptp_sccrq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_sccrq *ptr = (const struct pptp_msg_sccrq *)dat;
 
-       ND_TCHECK(ptr->proto_ver);
+       ND_TCHECK_2(ptr->proto_ver);
        pptp_proto_ver_print(ndo, &ptr->proto_ver);
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->framing_cap);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_4(ptr->framing_cap);
        pptp_framing_cap_print(ndo, &ptr->framing_cap);
-       ND_TCHECK(ptr->bearer_cap);
+       ND_TCHECK_4(ptr->bearer_cap);
        pptp_bearer_cap_print(ndo, &ptr->bearer_cap);
-       ND_TCHECK(ptr->max_channel);
+       ND_TCHECK_2(ptr->max_channel);
        pptp_max_channel_print(ndo, &ptr->max_channel);
-       ND_TCHECK(ptr->firm_rev);
+       ND_TCHECK_2(ptr->firm_rev);
        pptp_firm_rev_print(ndo, &ptr->firm_rev);
-       ND_TCHECK(ptr->hostname);
+       ND_TCHECK_SIZE(&ptr->hostname);
        pptp_hostname_print(ndo, &ptr->hostname[0]);
-       ND_TCHECK(ptr->vendor);
+       ND_TCHECK_SIZE(&ptr->vendor);
        pptp_vendor_print(ndo, &ptr->vendor[0]);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -551,29 +561,29 @@ pptp_sccrp_print(netdissect_options *ndo,
 {
        const struct pptp_msg_sccrp *ptr = (const struct pptp_msg_sccrp *)dat;
 
-       ND_TCHECK(ptr->proto_ver);
+       ND_TCHECK_2(ptr->proto_ver);
        pptp_proto_ver_print(ndo, &ptr->proto_ver);
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_SCCRP);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->framing_cap);
+       ND_TCHECK_4(ptr->framing_cap);
        pptp_framing_cap_print(ndo, &ptr->framing_cap);
-       ND_TCHECK(ptr->bearer_cap);
+       ND_TCHECK_4(ptr->bearer_cap);
        pptp_bearer_cap_print(ndo, &ptr->bearer_cap);
-       ND_TCHECK(ptr->max_channel);
+       ND_TCHECK_2(ptr->max_channel);
        pptp_max_channel_print(ndo, &ptr->max_channel);
-       ND_TCHECK(ptr->firm_rev);
+       ND_TCHECK_2(ptr->firm_rev);
        pptp_firm_rev_print(ndo, &ptr->firm_rev);
-       ND_TCHECK(ptr->hostname);
+       ND_TCHECK_SIZE(&ptr->hostname);
        pptp_hostname_print(ndo, &ptr->hostname[0]);
-       ND_TCHECK(ptr->vendor);
+       ND_TCHECK_SIZE(&ptr->vendor);
        pptp_vendor_print(ndo, &ptr->vendor[0]);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -582,7 +592,7 @@ pptp_stopccrq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_stopccrq *ptr = (const struct pptp_msg_stopccrq *)dat;
 
-       ND_TCHECK(ptr->reason);
+       ND_TCHECK_1(ptr->reason);
        ND_PRINT(" REASON(%u", EXTRACT_U_1(ptr->reason));
        if (ndo->ndo_vflag) {
                switch (EXTRACT_U_1(ptr->reason)) {
@@ -601,13 +611,15 @@ pptp_stopccrq_print(netdissect_options *ndo,
                }
        }
        ND_PRINT(")");
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->reserved2);
+       ND_TCHECK_1(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_1(ptr->reserved1);
+       ND_TCHECK_2(ptr->reserved2);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved2);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -616,16 +628,17 @@ pptp_stopccrp_print(netdissect_options *ndo,
 {
        const struct pptp_msg_stopccrp *ptr = (const struct pptp_msg_stopccrp *)dat;
 
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_StopCCRP);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->reserved1);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -634,13 +647,13 @@ pptp_echorq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_echorq *ptr = (const struct pptp_msg_echorq *)dat;
 
-       ND_TCHECK(ptr->id);
+       ND_TCHECK_4(ptr->id);
        pptp_id_print(ndo, &ptr->id);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -649,18 +662,19 @@ pptp_echorp_print(netdissect_options *ndo,
 {
        const struct pptp_msg_echorp *ptr = (const struct pptp_msg_echorp *)dat;
 
-       ND_TCHECK(ptr->id);
+       ND_TCHECK_4(ptr->id);
        pptp_id_print(ndo, &ptr->id);
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_ECHORP);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->reserved1);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -669,34 +683,35 @@ pptp_ocrq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_ocrq *ptr = (const struct pptp_msg_ocrq *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->call_ser);
+       ND_TCHECK_2(ptr->call_ser);
        pptp_call_ser_print(ndo, &ptr->call_ser);
-       ND_TCHECK(ptr->min_bps);
+       ND_TCHECK_4(ptr->min_bps);
        ND_PRINT(" MIN_BPS(%u)", EXTRACT_BE_U_4(ptr->min_bps));
-       ND_TCHECK(ptr->max_bps);
+       ND_TCHECK_4(ptr->max_bps);
        ND_PRINT(" MAX_BPS(%u)", EXTRACT_BE_U_4(ptr->max_bps));
-       ND_TCHECK(ptr->bearer_type);
+       ND_TCHECK_4(ptr->bearer_type);
        pptp_bearer_type_print(ndo, &ptr->bearer_type);
-       ND_TCHECK(ptr->framing_type);
+       ND_TCHECK_4(ptr->framing_type);
        pptp_framing_type_print(ndo, &ptr->framing_type);
-       ND_TCHECK(ptr->recv_winsiz);
+       ND_TCHECK_2(ptr->recv_winsiz);
        pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
-       ND_TCHECK(ptr->pkt_proc_delay);
+       ND_TCHECK_2(ptr->pkt_proc_delay);
        pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
-       ND_TCHECK(ptr->phone_no_len);
+       ND_TCHECK_2(ptr->phone_no_len);
        ND_PRINT(" PHONE_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->phone_no_len));
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->phone_no);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_SIZE(&ptr->phone_no);
        ND_PRINT(" PHONE_NO(%.64s)", ptr->phone_no);
-       ND_TCHECK(ptr->subaddr);
+       ND_TCHECK_SIZE(&ptr->subaddr);
        pptp_subaddr_print(ndo, &ptr->subaddr[0]);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -705,29 +720,29 @@ pptp_ocrp_print(netdissect_options *ndo,
 {
        const struct pptp_msg_ocrp *ptr = (const struct pptp_msg_ocrp *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->peer_call_id);
+       ND_TCHECK_2(ptr->peer_call_id);
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_OCRP);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->cause_code);
+       ND_TCHECK_2(ptr->cause_code);
        pptp_cause_code_print(ndo, &ptr->cause_code);
-       ND_TCHECK(ptr->conn_speed);
+       ND_TCHECK_4(ptr->conn_speed);
        pptp_conn_speed_print(ndo, &ptr->conn_speed);
-       ND_TCHECK(ptr->recv_winsiz);
+       ND_TCHECK_2(ptr->recv_winsiz);
        pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
-       ND_TCHECK(ptr->pkt_proc_delay);
+       ND_TCHECK_2(ptr->pkt_proc_delay);
        pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
-       ND_TCHECK(ptr->phy_chan_id);
+       ND_TCHECK_4(ptr->phy_chan_id);
        pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -736,29 +751,29 @@ pptp_icrq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_icrq *ptr = (const struct pptp_msg_icrq *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->call_ser);
+       ND_TCHECK_2(ptr->call_ser);
        pptp_call_ser_print(ndo, &ptr->call_ser);
-       ND_TCHECK(ptr->bearer_type);
+       ND_TCHECK_4(ptr->bearer_type);
        pptp_bearer_type_print(ndo, &ptr->bearer_type);
-       ND_TCHECK(ptr->phy_chan_id);
+       ND_TCHECK_4(ptr->phy_chan_id);
        pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id);
-       ND_TCHECK(ptr->dialed_no_len);
+       ND_TCHECK_2(ptr->dialed_no_len);
        ND_PRINT(" DIALED_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialed_no_len));
-       ND_TCHECK(ptr->dialing_no_len);
+       ND_TCHECK_2(ptr->dialing_no_len);
        ND_PRINT(" DIALING_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialing_no_len));
-       ND_TCHECK(ptr->dialed_no);
+       ND_TCHECK_SIZE(&ptr->dialed_no);
        ND_PRINT(" DIALED_NO(%.64s)", ptr->dialed_no);
-       ND_TCHECK(ptr->dialing_no);
+       ND_TCHECK_SIZE(&ptr->dialing_no);
        ND_PRINT(" DIALING_NO(%.64s)", ptr->dialing_no);
-       ND_TCHECK(ptr->subaddr);
+       ND_TCHECK_SIZE(&ptr->subaddr);
        pptp_subaddr_print(ndo, &ptr->subaddr[0]);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -767,24 +782,25 @@ pptp_icrp_print(netdissect_options *ndo,
 {
        const struct pptp_msg_icrp *ptr = (const struct pptp_msg_icrp *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->peer_call_id);
+       ND_TCHECK_2(ptr->peer_call_id);
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_ICRP);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->recv_winsiz);
+       ND_TCHECK_2(ptr->recv_winsiz);
        pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
-       ND_TCHECK(ptr->pkt_proc_delay);
+       ND_TCHECK_2(ptr->pkt_proc_delay);
        pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
-       ND_TCHECK(ptr->reserved1);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -793,22 +809,23 @@ pptp_iccn_print(netdissect_options *ndo,
 {
        const struct pptp_msg_iccn *ptr = (const struct pptp_msg_iccn *)dat;
 
-       ND_TCHECK(ptr->peer_call_id);
+       ND_TCHECK_2(ptr->peer_call_id);
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->conn_speed);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_4(ptr->conn_speed);
        pptp_conn_speed_print(ndo, &ptr->conn_speed);
-       ND_TCHECK(ptr->recv_winsiz);
+       ND_TCHECK_2(ptr->recv_winsiz);
        pptp_recv_winsiz_print(ndo, &ptr->recv_winsiz);
-       ND_TCHECK(ptr->pkt_proc_delay);
+       ND_TCHECK_2(ptr->pkt_proc_delay);
        pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
-       ND_TCHECK(ptr->framing_type);
+       ND_TCHECK_4(ptr->framing_type);
        pptp_framing_type_print(ndo, &ptr->framing_type);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -817,14 +834,15 @@ pptp_ccrq_print(netdissect_options *ndo,
 {
        const struct pptp_msg_ccrq *ptr = (const struct pptp_msg_ccrq *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->reserved1);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -833,22 +851,23 @@ pptp_cdn_print(netdissect_options *ndo,
 {
        const struct pptp_msg_cdn *ptr = (const struct pptp_msg_cdn *)dat;
 
-       ND_TCHECK(ptr->call_id);
+       ND_TCHECK_2(ptr->call_id);
        pptp_call_id_print(ndo, &ptr->call_id);
-       ND_TCHECK(ptr->result_code);
+       ND_TCHECK_1(ptr->result_code);
        pptp_result_code_print(ndo, &ptr->result_code, PPTP_CTRL_MSG_TYPE_CDN);
-       ND_TCHECK(ptr->err_code);
+       ND_TCHECK_1(ptr->err_code);
        pptp_err_code_print(ndo, &ptr->err_code);
-       ND_TCHECK(ptr->cause_code);
+       ND_TCHECK_2(ptr->cause_code);
        pptp_cause_code_print(ndo, &ptr->cause_code);
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->call_stats);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_SIZE(&ptr->call_stats);
        ND_PRINT(" CALL_STATS(%.128s)", ptr->call_stats);
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -857,26 +876,27 @@ pptp_wen_print(netdissect_options *ndo,
 {
        const struct pptp_msg_wen *ptr = (const struct pptp_msg_wen *)dat;
 
-       ND_TCHECK(ptr->peer_call_id);
+       ND_TCHECK_2(ptr->peer_call_id);
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->crc_err);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_4(ptr->crc_err);
        ND_PRINT(" CRC_ERR(%u)", EXTRACT_BE_U_4(ptr->crc_err));
-       ND_TCHECK(ptr->framing_err);
+       ND_TCHECK_4(ptr->framing_err);
        ND_PRINT(" FRAMING_ERR(%u)", EXTRACT_BE_U_4(ptr->framing_err));
-       ND_TCHECK(ptr->hardware_overrun);
+       ND_TCHECK_4(ptr->hardware_overrun);
        ND_PRINT(" HARDWARE_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->hardware_overrun));
-       ND_TCHECK(ptr->buffer_overrun);
+       ND_TCHECK_4(ptr->buffer_overrun);
        ND_PRINT(" BUFFER_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->buffer_overrun));
-       ND_TCHECK(ptr->timeout_err);
+       ND_TCHECK_4(ptr->timeout_err);
        ND_PRINT(" TIMEOUT_ERR(%u)", EXTRACT_BE_U_4(ptr->timeout_err));
-       ND_TCHECK(ptr->align_err);
+       ND_TCHECK_4(ptr->align_err);
        ND_PRINT(" ALIGN_ERR(%u)", EXTRACT_BE_U_4(ptr->align_err));
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -885,18 +905,19 @@ pptp_sli_print(netdissect_options *ndo,
 {
        const struct pptp_msg_sli *ptr = (const struct pptp_msg_sli *)dat;
 
-       ND_TCHECK(ptr->peer_call_id);
+       ND_TCHECK_2(ptr->peer_call_id);
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
-       ND_TCHECK(ptr->reserved1);
-       ND_TCHECK(ptr->send_accm);
+       ND_TCHECK_2(ptr->reserved1);
+       PRINT_RESERVED_IF_NOT_ZERO_2(ptr->reserved1);
+       ND_TCHECK_4(ptr->send_accm);
        ND_PRINT(" SEND_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->send_accm));
-       ND_TCHECK(ptr->recv_accm);
+       ND_TCHECK_4(ptr->recv_accm);
        ND_PRINT(" RECV_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->recv_accm));
 
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }
 
 void
@@ -907,15 +928,16 @@ pptp_print(netdissect_options *ndo,
        uint32_t mc;
        uint16_t ctrl_msg_type;
 
+       ndo->ndo_protocol = "pptp";
        ND_PRINT(": pptp");
 
        hdr = (const struct pptp_hdr *)dat;
 
-       ND_TCHECK(hdr->length);
+       ND_TCHECK_2(hdr->length);
        if (ndo->ndo_vflag) {
                ND_PRINT(" Length=%u", EXTRACT_BE_U_2(hdr->length));
        }
-       ND_TCHECK(hdr->msg_type);
+       ND_TCHECK_2(hdr->msg_type);
        if (ndo->ndo_vflag) {
                switch(EXTRACT_BE_U_2(hdr->msg_type)) {
                case PPTP_MSG_TYPE_CTRL:
@@ -930,7 +952,7 @@ pptp_print(netdissect_options *ndo,
                }
        }
 
-       ND_TCHECK(hdr->magic_cookie);
+       ND_TCHECK_4(hdr->magic_cookie);
        mc = EXTRACT_BE_U_4(hdr->magic_cookie);
        if (mc != PPTP_MAGIC_COOKIE) {
                ND_PRINT(" UNEXPECTED Magic-Cookie!!(%08x)", mc);
@@ -938,7 +960,7 @@ pptp_print(netdissect_options *ndo,
        if (ndo->ndo_vflag || mc != PPTP_MAGIC_COOKIE) {
                ND_PRINT(" Magic-Cookie=%08x", mc);
        }
-       ND_TCHECK(hdr->ctrl_msg_type);
+       ND_TCHECK_2(hdr->ctrl_msg_type);
        ctrl_msg_type = EXTRACT_BE_U_2(hdr->ctrl_msg_type);
        if (ctrl_msg_type < PPTP_MAX_MSGTYPE_INDEX) {
                ND_PRINT(" CTRL_MSGTYPE=%s",
@@ -946,7 +968,8 @@ pptp_print(netdissect_options *ndo,
        } else {
                ND_PRINT(" UNKNOWN_CTRL_MSGTYPE(%u)", ctrl_msg_type);
        }
-       ND_TCHECK(hdr->reserved0);
+       ND_TCHECK_2(hdr->reserved0);
+       PRINT_RESERVED_IF_NOT_ZERO_2(hdr->reserved0);
 
        dat += 12;
 
@@ -1004,5 +1027,5 @@ pptp_print(netdissect_options *ndo,
        return;
 
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }