]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-decnet.c
Clean up whitespaces
[tcpdump] / print-decnet.c
index d1220327e74d5bab8893c6790c700ca93662f9c2..06985d0d5147d0a98623da9472bb855e5ea0de66 100644 (file)
@@ -488,10 +488,10 @@ struct dcmsg                              /* disconnect confirm message */
 /* Forwards */
 static int print_decnet_ctlmsg(netdissect_options *, const union routehdr *, u_int, u_int);
 static void print_t_info(netdissect_options *, u_int);
-static int print_l1_routes(netdissect_options *, const char *, u_int);
-static int print_l2_routes(netdissect_options *, const char *, u_int);
+static int print_l1_routes(netdissect_options *, const u_char *, u_int);
+static int print_l2_routes(netdissect_options *, const u_char *, u_int);
 static void print_i_info(netdissect_options *, u_int);
-static int print_elist(const char *, u_int);
+static int print_elist(const u_char *, u_int);
 static int print_nsp(netdissect_options *, const u_char *, u_int);
 static void print_reason(netdissect_options *, u_int);
 
@@ -618,9 +618,8 @@ print_decnet_ctlmsg(netdissect_options *ndo,
        u_int mflags = EXTRACT_U_1(rhp->rh_short.sh_flags);
        const union controlmsg *cmp = (const union controlmsg *)rhp;
        u_int src, dst, info, blksize, eco, ueco, hello, other, vers;
-       etheraddr srcea, rtea;
        u_int priority;
-       const char *rhpx = (const char *)rhp;
+       const u_char *rhpx = (const u_char *)rhp;
        int ret;
 
        switch (mflags & RMF_CTLMASK) {
@@ -690,9 +689,8 @@ print_decnet_ctlmsg(netdissect_options *ndo,
            vers = EXTRACT_U_1(cmp->cm_rhello.rh_vers);
            eco = EXTRACT_U_1(cmp->cm_rhello.rh_eco);
            ueco = EXTRACT_U_1(cmp->cm_rhello.rh_ueco);
-           memcpy((char *)&srcea, (const char *)&(cmp->cm_rhello.rh_src),
-               sizeof(srcea));
-           src = EXTRACT_LE_U_2(srcea.dne_remote.dne_nodeaddr);
+           src =
+               EXTRACT_LE_U_2(cmp->cm_rhello.rh_src.dne_remote.dne_nodeaddr);
            info = EXTRACT_U_1(cmp->cm_rhello.rh_info);
            blksize = EXTRACT_LE_U_2(cmp->cm_rhello.rh_blksize);
            priority = EXTRACT_U_1(cmp->cm_rhello.rh_priority);
@@ -712,15 +710,13 @@ print_decnet_ctlmsg(netdissect_options *ndo,
            vers = EXTRACT_U_1(cmp->cm_ehello.eh_vers);
            eco = EXTRACT_U_1(cmp->cm_ehello.eh_eco);
            ueco = EXTRACT_U_1(cmp->cm_ehello.eh_ueco);
-           memcpy((char *)&srcea, (const char *)&(cmp->cm_ehello.eh_src),
-               sizeof(srcea));
-           src = EXTRACT_LE_U_2(srcea.dne_remote.dne_nodeaddr);
+           src =
+               EXTRACT_LE_U_2(cmp->cm_ehello.eh_src.dne_remote.dne_nodeaddr);
            info = EXTRACT_U_1(cmp->cm_ehello.eh_info);
            blksize = EXTRACT_LE_U_2(cmp->cm_ehello.eh_blksize);
            /*seed*/
-           memcpy((char *)&rtea, (const char *)&(cmp->cm_ehello.eh_router),
-               sizeof(rtea));
-           dst = EXTRACT_LE_U_2(rtea.dne_remote.dne_nodeaddr);
+           dst =
+               EXTRACT_LE_U_2(cmp->cm_ehello.eh_router.dne_remote.dne_nodeaddr);
            hello = EXTRACT_LE_U_2(cmp->cm_ehello.eh_hello);
            other = EXTRACT_U_1(cmp->cm_ehello.eh_data);
            print_i_info(ndo, info);
@@ -761,7 +757,7 @@ print_t_info(netdissect_options *ndo,
 
 static int
 print_l1_routes(netdissect_options *ndo,
-                const char *rp, u_int len)
+                const u_char *rp, u_int len)
 {
        u_int count;
        u_int id;
@@ -792,7 +788,7 @@ trunc:
 
 static int
 print_l2_routes(netdissect_options *ndo,
-                const char *rp, u_int len)
+                const u_char *rp, u_int len)
 {
        u_int count;
        u_int area;
@@ -841,7 +837,7 @@ print_i_info(netdissect_options *ndo,
 }
 
 static int
-print_elist(const char *elp _U_, u_int len _U_)
+print_elist(const u_char *elp _U_, u_int len _U_)
 {
        /* Not enough examples available for me to debug this */
        return (1);