]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-pptp.c
Use nd_ types, add EXTRACT_ calls.
[tcpdump] / print-pptp.c
index 5083015dc72b400354d5f48009775364f5677e15..c89eb33a4c5fec4fd82ed38439283976892ec441 100644 (file)
  * PPTP support contributed by Motonori Shindo ([email protected])
  */
 
+/* \summary: Point-to-Point Tunnelling Protocol (PPTP) printer */
+
+/* specification: RFC 2637 */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -83,147 +87,147 @@ static const char *pptp_message_type_string[] = {
 
 /* common for all PPTP control messages */
 struct pptp_hdr {
-       uint16_t length;
-       uint16_t msg_type;
-       uint32_t magic_cookie;
-       uint16_t ctrl_msg_type;
-       uint16_t reserved0;
+       nd_uint16_t length;
+       nd_uint16_t msg_type;
+       nd_uint32_t magic_cookie;
+       nd_uint16_t ctrl_msg_type;
+       nd_uint8_t reserved0[2];
 };
 
 struct pptp_msg_sccrq {
-       uint16_t proto_ver;
-       uint16_t reserved1;
-       uint32_t framing_cap;
-       uint32_t bearer_cap;
-       uint16_t max_channel;
-       uint16_t firm_rev;
-       u_char hostname[64];
-       u_char vendor[64];
+       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];
 };
 
 struct pptp_msg_sccrp {
-       uint16_t proto_ver;
-       uint8_t result_code;
-       uint8_t err_code;
-       uint32_t framing_cap;
-       uint32_t bearer_cap;
-       uint16_t max_channel;
-       uint16_t firm_rev;
-       u_char hostname[64];
-       u_char vendor[64];
+       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];
 };
 
 struct pptp_msg_stopccrq {
-       uint8_t reason;
-       uint8_t reserved1;
-       uint16_t reserved2;
+       nd_uint8_t  reason;
+       nd_byte     reserved1[1];
+       nd_byte     reserved2[2];
 };
 
 struct pptp_msg_stopccrp {
-       uint8_t result_code;
-       uint8_t err_code;
-       uint16_t reserved1;
+       nd_uint8_t  result_code;
+       nd_uint8_t  err_code;
+       nd_byte     reserved1[2];
 };
 
 struct pptp_msg_echorq {
-       uint32_t id;
+       nd_uint32_t id;
 };
 
 struct pptp_msg_echorp {
-       uint32_t id;
-       uint8_t result_code;
-       uint8_t err_code;
-       uint16_t reserved1;
+       nd_uint32_t id;
+       nd_uint8_t  result_code;
+       nd_uint8_t  err_code;
+       nd_byte     reserved1[2];
 };
 
 struct pptp_msg_ocrq {
-       uint16_t call_id;
-       uint16_t call_ser;
-       uint32_t min_bps;
-       uint32_t max_bps;
-       uint32_t bearer_type;
-       uint32_t framing_type;
-       uint16_t recv_winsiz;
-       uint16_t pkt_proc_delay;
-       uint16_t phone_no_len;
-       uint16_t reserved1;
-       u_char phone_no[64];
-       u_char subaddr[64];
+       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];
 };
 
 struct pptp_msg_ocrp {
-       uint16_t call_id;
-       uint16_t peer_call_id;
-       uint8_t result_code;
-       uint8_t err_code;
-       uint16_t cause_code;
-       uint32_t conn_speed;
-       uint16_t recv_winsiz;
-       uint16_t pkt_proc_delay;
-       uint32_t phy_chan_id;
+       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;
 };
 
 struct pptp_msg_icrq {
-       uint16_t call_id;
-       uint16_t call_ser;
-       uint32_t bearer_type;
-       uint32_t phy_chan_id;
-       uint16_t dialed_no_len;
-       uint16_t dialing_no_len;
-       u_char dialed_no[64];           /* DNIS */
-       u_char dialing_no[64];          /* CLID */
-       u_char subaddr[64];
+       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];
 };
 
 struct pptp_msg_icrp {
-       uint16_t call_id;
-       uint16_t peer_call_id;
-       uint8_t result_code;
-       uint8_t err_code;
-       uint16_t recv_winsiz;
-       uint16_t pkt_proc_delay;
-       uint16_t reserved1;
+       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;
+       nd_byte     reserved1[2];
 };
 
 struct pptp_msg_iccn {
-       uint16_t peer_call_id;
-       uint16_t reserved1;
-       uint32_t conn_speed;
-       uint16_t recv_winsiz;
-       uint16_t pkt_proc_delay;
-       uint32_t framing_type;
+       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;
 };
 
 struct pptp_msg_ccrq {
-       uint16_t call_id;
-       uint16_t reserved1;
+       nd_uint16_t call_id;
+       nd_uint16_t reserved1;
 };
 
 struct pptp_msg_cdn {
-       uint16_t call_id;
-       uint8_t result_code;
-       uint8_t err_code;
-       uint16_t cause_code;
-       uint16_t reserved1;
-       u_char call_stats[128];
+       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];
 };
 
 struct pptp_msg_wen {
-       uint16_t peer_call_id;
-       uint16_t reserved1;
-       uint32_t crc_err;
-       uint32_t framing_err;
-       uint32_t hardware_overrun;
-       uint32_t buffer_overrun;
-       uint32_t timeout_err;
-       uint32_t align_err;
+       nd_uint16_t peer_call_id;
+       nd_byte     reserved1[2];
+       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;
 };
 
 struct pptp_msg_sli {
-       uint16_t peer_call_id;
-       uint16_t reserved1;
-       uint32_t send_accm;
-       uint32_t recv_accm;
+       nd_uint16_t peer_call_id;
+       nd_uint16_t reserved1;
+       nd_uint32_t send_accm;
+       nd_uint32_t recv_accm;
 };
 
 /* attributes that appear more than once in above messages:
@@ -269,11 +273,11 @@ struct pptp_msg_sli {
 
 static void
 pptp_bearer_cap_print(netdissect_options *ndo,
-                      const uint32_t *bearer_cap)
+                      const nd_uint32_t *bearer_cap)
 {
        ND_PRINT((ndo, " BEARER_CAP(%s%s)",
-                 EXTRACT_32BITS(bearer_cap) & PPTP_BEARER_CAP_DIGITAL_MASK ? "D" : "",
-                 EXTRACT_32BITS(bearer_cap) & PPTP_BEARER_CAP_ANALOG_MASK ? "A" : ""));
+                 EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_DIGITAL_MASK ? "D" : "",
+                 EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_ANALOG_MASK ? "A" : ""));
 }
 
 static const struct tok pptp_btype_str[] = {
@@ -285,38 +289,38 @@ static const struct tok pptp_btype_str[] = {
 
 static void
 pptp_bearer_type_print(netdissect_options *ndo,
-                       const uint32_t *bearer_type)
+                       const nd_uint32_t *bearer_type)
 {
        ND_PRINT((ndo, " BEARER_TYPE(%s)",
-                 tok2str(pptp_btype_str, "?", EXTRACT_32BITS(bearer_type))));
+                 tok2str(pptp_btype_str, "?", EXTRACT_BE_U_4(*bearer_type))));
 }
 
 static void
 pptp_call_id_print(netdissect_options *ndo,
-                   const uint16_t *call_id)
+                   const nd_uint16_t *call_id)
 {
-       ND_PRINT((ndo, " CALL_ID(%u)", EXTRACT_16BITS(call_id)));
+       ND_PRINT((ndo, " CALL_ID(%u)", EXTRACT_BE_U_2(*call_id)));
 }
 
 static void
 pptp_call_ser_print(netdissect_options *ndo,
-                    const uint16_t *call_ser)
+                    const nd_uint16_t *call_ser)
 {
-       ND_PRINT((ndo, " CALL_SER_NUM(%u)", EXTRACT_16BITS(call_ser)));
+       ND_PRINT((ndo, " CALL_SER_NUM(%u)", EXTRACT_BE_U_2(*call_ser)));
 }
 
 static void
 pptp_cause_code_print(netdissect_options *ndo,
-                      const uint16_t *cause_code)
+                      const nd_uint16_t *cause_code)
 {
-       ND_PRINT((ndo, " CAUSE_CODE(%u)", EXTRACT_16BITS(cause_code)));
+       ND_PRINT((ndo, " CAUSE_CODE(%u)", EXTRACT_BE_U_2(*cause_code)));
 }
 
 static void
 pptp_conn_speed_print(netdissect_options *ndo,
-                      const uint32_t *conn_speed)
+                      const nd_uint32_t *conn_speed)
 {
-       ND_PRINT((ndo, " CONN_SPEED(%u)", EXTRACT_32BITS(conn_speed)));
+       ND_PRINT((ndo, " CONN_SPEED(%u)", EXTRACT_BE_U_4(*conn_speed)));
 }
 
 static const struct tok pptp_errcode_str[] = {
@@ -332,31 +336,31 @@ static const struct tok pptp_errcode_str[] = {
 
 static void
 pptp_err_code_print(netdissect_options *ndo,
-                    const uint8_t *err_code)
+                    const nd_uint8_t *err_code)
 {
-       ND_PRINT((ndo, " ERR_CODE(%u", *err_code));
+       ND_PRINT((ndo, " ERR_CODE(%u", EXTRACT_U_1(*err_code)));
        if (ndo->ndo_vflag) {
-               ND_PRINT((ndo, ":%s", tok2str(pptp_errcode_str, "?", *err_code)));
+               ND_PRINT((ndo, ":%s", tok2str(pptp_errcode_str, "?", EXTRACT_U_1(*err_code))));
        }
        ND_PRINT((ndo, ")"));
 }
 
 static void
 pptp_firm_rev_print(netdissect_options *ndo,
-                    const uint16_t *firm_rev)
+                    const nd_uint16_t *firm_rev)
 {
-       ND_PRINT((ndo, " FIRM_REV(%u)", EXTRACT_16BITS(firm_rev)));
+       ND_PRINT((ndo, " FIRM_REV(%u)", EXTRACT_BE_U_2(*firm_rev)));
 }
 
 static void
 pptp_framing_cap_print(netdissect_options *ndo,
-                       const uint32_t *framing_cap)
+                       const nd_uint32_t *framing_cap)
 {
        ND_PRINT((ndo, " FRAME_CAP("));
-       if (EXTRACT_32BITS(framing_cap) & PPTP_FRAMING_CAP_ASYNC_MASK) {
+       if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_ASYNC_MASK) {
                 ND_PRINT((ndo, "A"));          /* Async */
         }
-        if (EXTRACT_32BITS(framing_cap) & PPTP_FRAMING_CAP_SYNC_MASK) {
+        if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_SYNC_MASK) {
                 ND_PRINT((ndo, "S"));          /* Sync */
         }
        ND_PRINT((ndo, ")"));
@@ -371,10 +375,10 @@ static const struct tok pptp_ftype_str[] = {
 
 static void
 pptp_framing_type_print(netdissect_options *ndo,
-                        const uint32_t *framing_type)
+                        const nd_uint32_t *framing_type)
 {
        ND_PRINT((ndo, " FRAME_TYPE(%s)",
-                 tok2str(pptp_ftype_str, "?", EXTRACT_32BITS(framing_type))));
+                 tok2str(pptp_ftype_str, "?", EXTRACT_BE_U_4(*framing_type))));
 }
 
 static void
@@ -386,53 +390,53 @@ pptp_hostname_print(netdissect_options *ndo,
 
 static void
 pptp_id_print(netdissect_options *ndo,
-              const uint32_t *id)
+              const nd_uint32_t *id)
 {
-       ND_PRINT((ndo, " ID(%u)", EXTRACT_32BITS(id)));
+       ND_PRINT((ndo, " ID(%u)", EXTRACT_BE_U_4(*id)));
 }
 
 static void
 pptp_max_channel_print(netdissect_options *ndo,
-                       const uint16_t *max_channel)
+                       const nd_uint16_t *max_channel)
 {
-       ND_PRINT((ndo, " MAX_CHAN(%u)", EXTRACT_16BITS(max_channel)));
+       ND_PRINT((ndo, " MAX_CHAN(%u)", EXTRACT_BE_U_2(*max_channel)));
 }
 
 static void
 pptp_peer_call_id_print(netdissect_options *ndo,
-                        const uint16_t *peer_call_id)
+                        const nd_uint16_t *peer_call_id)
 {
-       ND_PRINT((ndo, " PEER_CALL_ID(%u)", EXTRACT_16BITS(peer_call_id)));
+       ND_PRINT((ndo, " PEER_CALL_ID(%u)", EXTRACT_BE_U_2(*peer_call_id)));
 }
 
 static void
 pptp_phy_chan_id_print(netdissect_options *ndo,
-                       const uint32_t *phy_chan_id)
+                       const nd_uint32_t *phy_chan_id)
 {
-       ND_PRINT((ndo, " PHY_CHAN_ID(%u)", EXTRACT_32BITS(phy_chan_id)));
+       ND_PRINT((ndo, " PHY_CHAN_ID(%u)", EXTRACT_BE_U_4(*phy_chan_id)));
 }
 
 static void
 pptp_pkt_proc_delay_print(netdissect_options *ndo,
-                          const uint16_t *pkt_proc_delay)
+                          const nd_uint16_t *pkt_proc_delay)
 {
-       ND_PRINT((ndo, " PROC_DELAY(%u)", EXTRACT_16BITS(pkt_proc_delay)));
+       ND_PRINT((ndo, " PROC_DELAY(%u)", EXTRACT_BE_U_2(*pkt_proc_delay)));
 }
 
 static void
 pptp_proto_ver_print(netdissect_options *ndo,
-                     const uint16_t *proto_ver)
+                     const nd_uint16_t *proto_ver)
 {
        ND_PRINT((ndo, " PROTO_VER(%u.%u)",     /* Version.Revision */
-              EXTRACT_16BITS(proto_ver) >> 8,
-              EXTRACT_16BITS(proto_ver) & 0xff));
+              EXTRACT_BE_U_2(*proto_ver) >> 8,
+              EXTRACT_BE_U_2(*proto_ver) & 0xff));
 }
 
 static void
 pptp_recv_winsiz_print(netdissect_options *ndo,
-                       const uint16_t *recv_winsiz)
+                       const nd_uint16_t *recv_winsiz)
 {
-       ND_PRINT((ndo, " RECV_WIN(%u)", EXTRACT_16BITS(recv_winsiz)));
+       ND_PRINT((ndo, " RECV_WIN(%u)", EXTRACT_BE_U_2(*recv_winsiz)));
 }
 
 static const struct tok pptp_scrrp_str[] = {
@@ -478,9 +482,9 @@ static const struct tok pptp_cdn_str[] = {
 
 static void
 pptp_result_code_print(netdissect_options *ndo,
-                       const uint8_t *result_code, int ctrl_msg_type)
+                       const nd_uint8_t *result_code, int ctrl_msg_type)
 {
-       ND_PRINT((ndo, " RESULT_CODE(%u", *result_code));
+       ND_PRINT((ndo, " RESULT_CODE(%u", EXTRACT_U_1(*result_code)));
        if (ndo->ndo_vflag) {
                const struct tok *dict =
                        ctrl_msg_type == PPTP_CTRL_MSG_TYPE_SCCRP    ? pptp_scrrp_str :
@@ -491,7 +495,7 @@ pptp_result_code_print(netdissect_options *ndo,
                        ctrl_msg_type == PPTP_CTRL_MSG_TYPE_CDN      ? pptp_cdn_str :
                        NULL; /* assertion error */
                if (dict != NULL)
-                       ND_PRINT((ndo, ":%s", tok2str(dict, "?", *result_code)));
+                       ND_PRINT((ndo, ":%s", tok2str(dict, "?", EXTRACT_U_1(*result_code))));
        }
        ND_PRINT((ndo, ")"));
 }
@@ -579,9 +583,9 @@ pptp_stopccrq_print(netdissect_options *ndo,
        const struct pptp_msg_stopccrq *ptr = (const struct pptp_msg_stopccrq *)dat;
 
        ND_TCHECK(ptr->reason);
-       ND_PRINT((ndo, " REASON(%u", ptr->reason));
+       ND_PRINT((ndo, " REASON(%u", EXTRACT_U_1(ptr->reason)));
        if (ndo->ndo_vflag) {
-               switch (ptr->reason) {
+               switch (EXTRACT_U_1(ptr->reason)) {
                case 1:
                        ND_PRINT((ndo, ":None"));
                        break;
@@ -670,9 +674,9 @@ pptp_ocrq_print(netdissect_options *ndo,
        ND_TCHECK(ptr->call_ser);
        pptp_call_ser_print(ndo, &ptr->call_ser);
        ND_TCHECK(ptr->min_bps);
-       ND_PRINT((ndo, " MIN_BPS(%u)", EXTRACT_32BITS(&ptr->min_bps)));
+       ND_PRINT((ndo, " MIN_BPS(%u)", EXTRACT_BE_U_4(ptr->min_bps)));
        ND_TCHECK(ptr->max_bps);
-       ND_PRINT((ndo, " MAX_BPS(%u)", EXTRACT_32BITS(&ptr->max_bps)));
+       ND_PRINT((ndo, " MAX_BPS(%u)", EXTRACT_BE_U_4(ptr->max_bps)));
        ND_TCHECK(ptr->bearer_type);
        pptp_bearer_type_print(ndo, &ptr->bearer_type);
        ND_TCHECK(ptr->framing_type);
@@ -682,7 +686,7 @@ pptp_ocrq_print(netdissect_options *ndo,
        ND_TCHECK(ptr->pkt_proc_delay);
        pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay);
        ND_TCHECK(ptr->phone_no_len);
-       ND_PRINT((ndo, " PHONE_NO_LEN(%u)", EXTRACT_16BITS(&ptr->phone_no_len)));
+       ND_PRINT((ndo, " PHONE_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->phone_no_len)));
        ND_TCHECK(ptr->reserved1);
        ND_TCHECK(ptr->phone_no);
        ND_PRINT((ndo, " PHONE_NO(%.64s)", ptr->phone_no));
@@ -741,9 +745,9 @@ pptp_icrq_print(netdissect_options *ndo,
        ND_TCHECK(ptr->phy_chan_id);
        pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id);
        ND_TCHECK(ptr->dialed_no_len);
-       ND_PRINT((ndo, " DIALED_NO_LEN(%u)", EXTRACT_16BITS(&ptr->dialed_no_len)));
+       ND_PRINT((ndo, " DIALED_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialed_no_len)));
        ND_TCHECK(ptr->dialing_no_len);
-       ND_PRINT((ndo, " DIALING_NO_LEN(%u)", EXTRACT_16BITS(&ptr->dialing_no_len)));
+       ND_PRINT((ndo, " DIALING_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialing_no_len)));
        ND_TCHECK(ptr->dialed_no);
        ND_PRINT((ndo, " DIALED_NO(%.64s)", ptr->dialed_no));
        ND_TCHECK(ptr->dialing_no);
@@ -857,17 +861,17 @@ pptp_wen_print(netdissect_options *ndo,
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
        ND_TCHECK(ptr->reserved1);
        ND_TCHECK(ptr->crc_err);
-       ND_PRINT((ndo, " CRC_ERR(%u)", EXTRACT_32BITS(&ptr->crc_err)));
+       ND_PRINT((ndo, " CRC_ERR(%u)", EXTRACT_BE_U_4(ptr->crc_err)));
        ND_TCHECK(ptr->framing_err);
-       ND_PRINT((ndo, " FRAMING_ERR(%u)", EXTRACT_32BITS(&ptr->framing_err)));
+       ND_PRINT((ndo, " FRAMING_ERR(%u)", EXTRACT_BE_U_4(ptr->framing_err)));
        ND_TCHECK(ptr->hardware_overrun);
-       ND_PRINT((ndo, " HARDWARE_OVERRUN(%u)", EXTRACT_32BITS(&ptr->hardware_overrun)));
+       ND_PRINT((ndo, " HARDWARE_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->hardware_overrun)));
        ND_TCHECK(ptr->buffer_overrun);
-       ND_PRINT((ndo, " BUFFER_OVERRUN(%u)", EXTRACT_32BITS(&ptr->buffer_overrun)));
+       ND_PRINT((ndo, " BUFFER_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->buffer_overrun)));
        ND_TCHECK(ptr->timeout_err);
-       ND_PRINT((ndo, " TIMEOUT_ERR(%u)", EXTRACT_32BITS(&ptr->timeout_err)));
+       ND_PRINT((ndo, " TIMEOUT_ERR(%u)", EXTRACT_BE_U_4(ptr->timeout_err)));
        ND_TCHECK(ptr->align_err);
-       ND_PRINT((ndo, " ALIGN_ERR(%u)", EXTRACT_32BITS(&ptr->align_err)));
+       ND_PRINT((ndo, " ALIGN_ERR(%u)", EXTRACT_BE_U_4(ptr->align_err)));
 
        return;
 
@@ -885,9 +889,9 @@ pptp_sli_print(netdissect_options *ndo,
        pptp_peer_call_id_print(ndo, &ptr->peer_call_id);
        ND_TCHECK(ptr->reserved1);
        ND_TCHECK(ptr->send_accm);
-       ND_PRINT((ndo, " SEND_ACCM(0x%08x)", EXTRACT_32BITS(&ptr->send_accm)));
+       ND_PRINT((ndo, " SEND_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->send_accm)));
        ND_TCHECK(ptr->recv_accm);
-       ND_PRINT((ndo, " RECV_ACCM(0x%08x)", EXTRACT_32BITS(&ptr->recv_accm)));
+       ND_PRINT((ndo, " RECV_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->recv_accm)));
 
        return;
 
@@ -909,11 +913,11 @@ pptp_print(netdissect_options *ndo,
 
        ND_TCHECK(hdr->length);
        if (ndo->ndo_vflag) {
-               ND_PRINT((ndo, " Length=%u", EXTRACT_16BITS(&hdr->length)));
+               ND_PRINT((ndo, " Length=%u", EXTRACT_BE_U_2(hdr->length)));
        }
        ND_TCHECK(hdr->msg_type);
        if (ndo->ndo_vflag) {
-               switch(EXTRACT_16BITS(&hdr->msg_type)) {
+               switch(EXTRACT_BE_U_2(hdr->msg_type)) {
                case PPTP_MSG_TYPE_CTRL:
                        ND_PRINT((ndo, " CTRL-MSG"));
                        break;
@@ -927,7 +931,7 @@ pptp_print(netdissect_options *ndo,
        }
 
        ND_TCHECK(hdr->magic_cookie);
-       mc = EXTRACT_32BITS(&hdr->magic_cookie);
+       mc = EXTRACT_BE_U_4(hdr->magic_cookie);
        if (mc != PPTP_MAGIC_COOKIE) {
                ND_PRINT((ndo, " UNEXPECTED Magic-Cookie!!(%08x)", mc));
        }
@@ -935,7 +939,7 @@ pptp_print(netdissect_options *ndo,
                ND_PRINT((ndo, " Magic-Cookie=%08x", mc));
        }
        ND_TCHECK(hdr->ctrl_msg_type);
-       ctrl_msg_type = EXTRACT_16BITS(&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((ndo, " CTRL_MSGTYPE=%s",
                       pptp_message_type_string[ctrl_msg_type]));