]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ppp.c
Add EXTRACT_ calls.
[tcpdump] / print-ppp.c
index bb8d660cb49aea7564354967f6acd512d8d3c388..31b87a24ebc079d8e90e9bd589e3fcf065930a62 100644 (file)
@@ -549,7 +549,7 @@ handle_ctrl_proto(netdissect_options *ndo,
                /* XXX: need to decode Data? - hexdump for now */
                if (len > 8) {
                        ND_PRINT((ndo, "\n\t  -----trailing data-----"));
-                       ND_TCHECK2(tptr[4], len - 8);
+                       ND_TCHECK_LEN(tptr + 4, len - 8);
                        print_unknown_data(ndo, tptr + 4, "\n\t  ", len - 8);
                }
                break;
@@ -1100,7 +1100,7 @@ print_ipcp_config_options(netdissect_options *ndo,
                                return 0;
                         }
 
-                        ND_TCHECK2(*(p + 2), IPCPOPT_IPCOMP_MINLEN);
+                        ND_TCHECK_LEN(p + 2, IPCPOPT_IPCOMP_MINLEN);
                         ND_PRINT((ndo, "\n\t    TCP Space %u, non-TCP Space %u" \
                                ", maxPeriod %u, maxTime %u, maxHdr %u",
                                EXTRACT_BE_U_2(p + 4),
@@ -1410,7 +1410,7 @@ ppp_hdlc(netdissect_options *ndo,
         * Do this so that we dont overwrite the original packet
         * contents.
         */
-       for (s = p, t = b, i = length; i != 0 && ND_TTEST(*s); i--) {
+       for (s = p, t = b, i = length; i != 0 && ND_TTEST_1(s); i--) {
                c = EXTRACT_U_1(s);
                s++;
                if (c == 0x7d) {
@@ -1539,7 +1539,7 @@ handle_ppp(netdissect_options *ndo,
 /* Standard PPP printer */
 u_int
 ppp_print(netdissect_options *ndo,
-          register const u_char *p, u_int length)
+          const u_char *p, u_int length)
 {
        u_int proto,ppp_header;
         u_int olen = length; /* _o_riginal length */
@@ -1610,10 +1610,10 @@ trunc:
 /* PPP I/F printer */
 u_int
 ppp_if_print(netdissect_options *ndo,
-             const struct pcap_pkthdr *h, register const u_char *p)
+             const struct pcap_pkthdr *h, const u_char *p)
 {
-       register u_int length = h->len;
-       register u_int caplen = h->caplen;
+       u_int length = h->len;
+       u_int caplen = h->caplen;
 
        if (caplen < PPP_HDRLEN) {
                ND_PRINT((ndo, "[|ppp]"));
@@ -1678,10 +1678,10 @@ ppp_if_print(netdissect_options *ndo,
  */
 u_int
 ppp_hdlc_if_print(netdissect_options *ndo,
-                  const struct pcap_pkthdr *h, register const u_char *p)
+                  const struct pcap_pkthdr *h, const u_char *p)
 {
-       register u_int length = h->len;
-       register u_int caplen = h->caplen;
+       u_int length = h->len;
+       u_int caplen = h->caplen;
        u_int proto;
        u_int hdrlen = 0;
 
@@ -1748,12 +1748,12 @@ ppp_hdlc_if_print(netdissect_options *ndo,
 /* BSD/OS specific PPP printer */
 u_int
 ppp_bsdos_if_print(netdissect_options *ndo _U_,
-                   const struct pcap_pkthdr *h _U_, register const u_char *p _U_)
+                   const struct pcap_pkthdr *h _U_, const u_char *p _U_)
 {
-       register u_int hdrlength;
+       u_int hdrlength;
 #ifdef __bsdi__
-       register u_int length = h->len;
-       register u_int caplen = h->caplen;
+       u_int length = h->len;
+       u_int caplen = h->caplen;
        uint16_t ptype;
        uint8_t llhl;
        const u_char *q;