]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-snmp.c
NDOize OpenFlow, IEEE slow and telnet decoders
[tcpdump] / print-snmp.c
index 8500566900a382cda552caf8dcb25422ebf2bdf3..6f57c2f1e05ef2e807a7d9e0bc6c51e63c03aca2 100644 (file)
  #     @(#)snmp.awk.x  1.1 (LANL) 1/15/90
  */
 
-#ifndef lint
-static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.64 2005-05-06 07:56:53 guy Exp $ (LBL)";
-#endif
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -75,10 +70,11 @@ static const char rcsid[] _U_ =
 #endif
 
 #include "interface.h"
-#include "addrtoname.h"
 
 #undef OPAQUE  /* defined in <wingdi.h> */
 
+static const char tstr[] = "[|snmp]";
+
 /*
  * Universal ASN.1 types
  * (we only care about the tag values for those allowed in the Internet SMI)
@@ -653,7 +649,7 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem)
        return elem->asnlen + hdr;
 
 trunc:
-       fputs("[|snmp]", stdout);
+       printf("%s", tstr);
        return -1;
 }
 
@@ -782,7 +778,7 @@ asn1_print(struct be *elem)
                const u_char *p = elem->data.str;
                TCHECK2(*p, asnlen);
                for (i = asnlen; printable && i-- > 0; p++)
-                       printable = isprint(*p) || isspace(*p);
+                       printable = ND_ISPRINT(*p);
                p = elem->data.str;
                if (printable) {
                        putchar('"');
@@ -834,7 +830,7 @@ asn1_print(struct be *elem)
        return 0;
 
 trunc:
-       fputs("[|snmp]", stdout);
+       printf("%s", tstr);
        return -1;
 }
 
@@ -930,7 +926,7 @@ smi_decode_oid(struct be *elem, unsigned int *oid,
        return 0;
 
 trunc:
-       fputs("[|snmp]", stdout);
+       printf("%s", tstr);
        return -1;
 }