]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ntp.c
Fix a bunch of de-constifications.
[tcpdump] / print-ntp.c
index 93268ac017b50b024d98cb93a156df099cbdc81f..eed98f7e68b821384b1e3aaa37dcb69ec5c890f0 100644 (file)
@@ -23,7 +23,6 @@
  *     loosely based on print-bootp.c
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 */
 struct l_fixedpt {
-       u_int32_t int_part;
-       u_int32_t fraction;
+       uint32_t int_part;
+       uint32_t fraction;
 };
 
 struct s_fixedpt {
-       u_int16_t int_part;
-       u_int16_t fraction;
+       uint16_t int_part;
+       uint16_t fraction;
 };
 
 /* rfc2030
@@ -120,13 +119,13 @@ struct ntpdata {
        int precision:8;
        struct s_fixedpt root_delay;
        struct s_fixedpt root_dispersion;
-       u_int32_t refid;
+       uint32_t refid;
        struct l_fixedpt ref_timestamp;
        struct l_fixedpt org_timestamp;
        struct l_fixedpt rec_timestamp;
        struct l_fixedpt xmt_timestamp;
-        u_int32_t key_id;
-        u_int8_t  message_digest[16];
+        uint32_t key_id;
+        uint8_t  message_digest[16];
 };
 /*
  *     Leap Second Codes (high order two bits)
@@ -207,7 +206,7 @@ ntp_print(netdissect_options *ndo,
        register const struct ntpdata *bp;
        int mode, version, leapind;
 
-       bp = (struct ntpdata *)cp;
+       bp = (const struct ntpdata *)cp;
 
        ND_TCHECK(bp->status);
 
@@ -261,7 +260,7 @@ ntp_print(netdissect_options *ndo,
                break;
 
        case PRIM_REF:
-               if (fn_printn((u_char *)&(bp->refid), 4, ndo->ndo_snapend))
+               if (fn_printn(ndo, (const u_char *)&(bp->refid), 4, ndo->ndo_snapend))
                        goto trunc;
                break;
 
@@ -343,8 +342,8 @@ p_ntp_time(netdissect_options *ndo,
            register const struct l_fixedpt *lfp)
 {
        register int32_t i;
-       register u_int32_t uf;
-       register u_int32_t f;
+       register uint32_t uf;
+       register uint32_t f;
        register float ff;
 
        i = EXTRACT_32BITS(&lfp->int_part);
@@ -379,9 +378,9 @@ p_ntp_delta(netdissect_options *ndo,
             register const struct l_fixedpt *lfp)
 {
        register int32_t i;
-       register u_int32_t u, uf;
-       register u_int32_t ou, ouf;
-       register u_int32_t f;
+       register uint32_t u, uf;
+       register uint32_t ou, ouf;
+       register uint32_t f;
        register float ff;
        int signbit;