]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-wb.c
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / print-wb.c
index 14ce4450fd2ab73a18d280fb1563c83e98e4ac0e..49100fa48f4fbbee7efcd498fbfeaef6b347e71d 100644 (file)
@@ -56,9 +56,9 @@ static const char tstr[] = "[|wb]";
  * The transport level header.
  */
 struct pkt_hdr {
-       u_int32_t ph_src;               /* site id of source */
-       u_int32_t ph_ts;                /* time stamp (for skew computation) */
-       u_int16_t ph_version;   /* version number */
+       uint32_t ph_src;                /* site id of source */
+       uint32_t ph_ts;         /* time stamp (for skew computation) */
+       uint16_t ph_version;    /* version number */
        u_char ph_type;         /* message type */
        u_char ph_flags;        /* message flags */
 };
@@ -81,13 +81,13 @@ struct pkt_hdr {
 #define PF_VIS         0x02    /* only visible ops wanted */
 
 struct PageID {
-       u_int32_t p_sid;                /* session id of initiator */
-       u_int32_t p_uid;                /* page number */
+       uint32_t p_sid;         /* session id of initiator */
+       uint32_t p_uid;         /* page number */
 };
 
 struct dophdr {
-       u_int32_t  dh_ts;               /* sender's timestamp */
-       u_int16_t       dh_len;         /* body length */
+       uint32_t  dh_ts;                /* sender's timestamp */
+       uint16_t        dh_len;         /* body length */
        u_char  dh_flags;
        u_char  dh_type;        /* body type */
        /* body follows */
@@ -116,8 +116,8 @@ struct dophdr {
  */
 struct pkt_dop {
        struct PageID pd_page;  /* page that operations apply to */
-       u_int32_t       pd_sseq;        /* start sequence number */
-       u_int32_t       pd_eseq;        /* end sequence number */
+       uint32_t        pd_sseq;        /* start sequence number */
+       uint32_t        pd_eseq;        /* end sequence number */
        /* drawing ops follow */
 };
 
@@ -125,31 +125,31 @@ struct pkt_dop {
  * A repair request.
  */
 struct pkt_rreq {
-        u_int32_t pr_id;           /* source id of drawops to be repaired */
+        uint32_t pr_id;           /* source id of drawops to be repaired */
         struct PageID pr_page;           /* page of drawops */
-        u_int32_t pr_sseq;         /* start seqno */
-        u_int32_t pr_eseq;         /* end seqno */
+        uint32_t pr_sseq;         /* start seqno */
+        uint32_t pr_eseq;         /* end seqno */
 };
 
 /*
  * A repair reply.
  */
 struct pkt_rrep {
-       u_int32_t pr_id;        /* original site id of ops  */
+       uint32_t pr_id; /* original site id of ops  */
        struct pkt_dop pr_dop;
        /* drawing ops follow */
 };
 
 struct id_off {
-        u_int32_t id;
-        u_int32_t off;
+        uint32_t id;
+        uint32_t off;
 };
 
 struct pgstate {
-       u_int32_t slot;
+       uint32_t slot;
        struct PageID page;
-       u_int16_t nid;
-       u_int16_t rsvd;
+       uint16_t nid;
+       uint16_t rsvd;
         /* seqptr's */
 };
 
@@ -157,7 +157,7 @@ struct pgstate {
  * An announcement packet.
  */
 struct pkt_id {
-       u_int32_t pi_mslot;
+       uint32_t pi_mslot;
         struct PageID    pi_mpage;        /* current page */
        struct pgstate pi_ps;
         /* seqptr's */
@@ -166,12 +166,12 @@ struct pkt_id {
 
 struct pkt_preq {
         struct PageID  pp_page;
-        u_int32_t  pp_low;
-        u_int32_t  pp_high;
+        uint32_t  pp_low;
+        uint32_t  pp_high;
 };
 
 struct pkt_prep {
-        u_int32_t  pp_n;           /* size of pageid array */
+        uint32_t  pp_n;           /* size of pageid array */
         /* pgstate's follow */
 };
 
@@ -192,10 +192,10 @@ wb_id(netdissect_options *ndo,
 
        ND_PRINT((ndo, " %u/%s:%u (max %u/%s:%u) ",
               EXTRACT_32BITS(&id->pi_ps.slot),
-              ipaddr_string(&id->pi_ps.page.p_sid),
+              ipaddr_string(ndo, &id->pi_ps.page.p_sid),
               EXTRACT_32BITS(&id->pi_ps.page.p_uid),
               EXTRACT_32BITS(&id->pi_mslot),
-              ipaddr_string(&id->pi_mpage.p_sid),
+              ipaddr_string(ndo, &id->pi_mpage.p_sid),
               EXTRACT_32BITS(&id->pi_mpage.p_uid)));
 
        nid = EXTRACT_16BITS(&id->pi_ps.nid);
@@ -204,14 +204,14 @@ wb_id(netdissect_options *ndo,
        cp = (char *)(io + nid);
        if ((u_char *)cp + len <= ndo->ndo_snapend) {
                ND_PRINT((ndo, "\""));
-               (void)fn_print((u_char *)cp, (u_char *)cp + len);
+               fn_print(ndo, (u_char *)cp, (u_char *)cp + len);
                ND_PRINT((ndo, "\""));
        }
 
        c = '<';
        for (i = 0; i < nid && (u_char *)(io + 1) <= ndo->ndo_snapend; ++io, ++i) {
                ND_PRINT((ndo, "%c%s:%u",
-                   c, ipaddr_string(&io->id), EXTRACT_32BITS(&io->off)));
+                   c, ipaddr_string(ndo, &io->id), EXTRACT_32BITS(&io->off)));
                c = ',';
        }
        if (i >= nid) {
@@ -230,8 +230,8 @@ wb_rreq(netdissect_options *ndo,
                return (-1);
 
        ND_PRINT((ndo, " please repair %s %s:%u<%u:%u>",
-              ipaddr_string(&rreq->pr_id),
-              ipaddr_string(&rreq->pr_page.p_sid),
+              ipaddr_string(ndo, &rreq->pr_id),
+              ipaddr_string(ndo, &rreq->pr_page.p_sid),
               EXTRACT_32BITS(&rreq->pr_page.p_uid),
               EXTRACT_32BITS(&rreq->pr_sseq),
               EXTRACT_32BITS(&rreq->pr_eseq)));
@@ -248,7 +248,7 @@ wb_preq(netdissect_options *ndo,
 
        ND_PRINT((ndo, " need %u/%s:%u",
               EXTRACT_32BITS(&preq->pp_low),
-              ipaddr_string(&preq->pp_page.p_sid),
+              ipaddr_string(ndo, &preq->pp_page.p_sid),
               EXTRACT_32BITS(&preq->pp_page.p_uid)));
        return (0);
 }
@@ -273,11 +273,11 @@ wb_prep(netdissect_options *ndo,
 
                ND_PRINT((ndo, " %u/%s:%u",
                    EXTRACT_32BITS(&ps->slot),
-                   ipaddr_string(&ps->page.p_sid),
+                   ipaddr_string(ndo, &ps->page.p_sid),
                    EXTRACT_32BITS(&ps->page.p_uid)));
                io = (struct id_off *)(ps + 1);
                for (ie = io + ps->nid; io < ie && (u_char *)(io + 1) <= ep; ++io) {
-                       ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(&io->id),
+                       ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id),
                            EXTRACT_32BITS(&io->off)));
                        c = ',';
                }
@@ -309,7 +309,7 @@ static const char *dopstr[] = {
 
 static int
 wb_dops(netdissect_options *ndo,
-        const struct dophdr *dh, u_int32_t ss, u_int32_t es)
+        const struct dophdr *dh, uint32_t ss, uint32_t es)
 {
        ND_PRINT((ndo, " <"));
        for ( ; ss <= es; ++ss) {
@@ -320,7 +320,7 @@ wb_dops(netdissect_options *ndo,
                else {
                        ND_PRINT((ndo, " %s", dopstr[t]));
                        if (t == DT_SKIP || t == DT_HOLE) {
-                               u_int32_t ts = EXTRACT_32BITS(&dh->dh_ts);
+                               uint32_t ts = EXTRACT_32BITS(&dh->dh_ts);
                                ND_PRINT((ndo, "%d", ts - ss + 1));
                                if (ss > ts || ts > es) {
                                        ND_PRINT((ndo, "[|]"));
@@ -352,8 +352,8 @@ wb_rrep(netdissect_options *ndo,
        len -= sizeof(*rrep);
 
        ND_PRINT((ndo, " for %s %s:%u<%u:%u>",
-           ipaddr_string(&rrep->pr_id),
-           ipaddr_string(&dop->pd_page.p_sid),
+           ipaddr_string(ndo, &rrep->pr_id),
+           ipaddr_string(ndo, &dop->pd_page.p_sid),
            EXTRACT_32BITS(&dop->pd_page.p_uid),
            EXTRACT_32BITS(&dop->pd_sseq),
            EXTRACT_32BITS(&dop->pd_eseq)));
@@ -375,7 +375,7 @@ wb_drawop(netdissect_options *ndo,
        len -= sizeof(*dop);
 
        ND_PRINT((ndo, " %s:%u<%u:%u>",
-           ipaddr_string(&dop->pd_page.p_sid),
+           ipaddr_string(ndo, &dop->pd_page.p_sid),
            EXTRACT_32BITS(&dop->pd_page.p_uid),
            EXTRACT_32BITS(&dop->pd_sseq),
            EXTRACT_32BITS(&dop->pd_eseq)));