]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-decnet.c
NDOize safeputs() and safeputchar()
[tcpdump] / print-decnet.c
index 7fea582e8a00ec5794b040bbd02352bba203f9bf..6a21684e221b28e73b9a0410af303e9bb97be10c 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifndef lint
-static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.39 2005-05-06 02:16:26 guy Exp $ (LBL)";
-#endif
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -46,6 +41,8 @@ struct rtentry;
 #include "interface.h"
 #include "addrtoname.h"
 
+static const char tstr[] = "[|decnet]";
+
 /* Forwards */
 static int print_decnet_ctlmsg(const union routehdr *, u_int, u_int);
 static void print_t_info(int);
@@ -74,18 +71,18 @@ decnet_print(register const u_char *ap, register u_int length,
        const u_char *nspp;
 
        if (length < sizeof(struct shorthdr)) {
-               (void)printf("[|decnet]");
+               (void)printf("%s", tstr);
                return;
        }
 
        TCHECK2(*ap, sizeof(short));
        pktlen = EXTRACT_LE_16BITS(ap);
        if (pktlen < sizeof(struct shorthdr)) {
-               (void)printf("[|decnet]");
+               (void)printf("%s", tstr);
                return;
        }
        if (pktlen > length) {
-               (void)printf("[|decnet]");
+               (void)printf("%s", tstr);
                return;
        }
        length = pktlen;
@@ -100,7 +97,7 @@ decnet_print(register const u_char *ap, register u_int length,
            if (vflag)
                (void) printf("[pad:%d] ", padlen);
            if (length < padlen + 2) {
-               (void)printf("[|decnet]");
+               (void)printf("%s", tstr);
                return;
            }
            TCHECK2(ap[sizeof(short)], padlen);
@@ -127,7 +124,7 @@ decnet_print(register const u_char *ap, register u_int length,
        switch (mflags & RMF_MASK) {
        case RMF_LONG:
            if (length < sizeof(struct longhdr)) {
-               (void)printf("[|decnet]");
+               (void)printf("%s", tstr);
                return;
            }
            TCHECK(rhp->rh_long);
@@ -170,7 +167,7 @@ decnet_print(register const u_char *ap, register u_int length,
        return;
 
 trunc:
-       (void)printf("[|decnet]");
+       (void)printf("%s", tstr);
        return;
 }
 
@@ -819,7 +816,7 @@ trunc:
        return (0);
 }
 
-static struct tok reason2str[] = {
+static const struct tok reason2str[] = {
        { UC_OBJREJECT,         "object rejected connect" },
        { UC_RESOURCES,         "insufficient resources" },
        { UC_NOSUCHNODE,        "unrecognized node name" },
@@ -889,7 +886,7 @@ pdata(u_char *dp, u_int maxlen)
 
        while (x-- > 0) {
            c = *dp++;
-           safeputchar(c);
+           safeputchar(gndo, c);
        }
 }
 #endif