summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-11-14 16:18:44 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-11-14 16:18:44 +0000
commit2b917a9c98ca823bee8ac280df735bb6424ed3e1 (patch)
tree6d0c37d98611a14dd6e0d40c110cafbed679ca89
parentc046bd9bfc7a9773c9490d1762c9f963a06910ac (diff)
Shorten the AgentX header debug messages (only compiled with -DDEBUG)
to a single line and print to stderr instead of stdout. This makes it easier to follow the debug output again. Also, as a rule of thumb, it is OK to exceed 80 chars for these kinds of developer debug messages. OK blambert@
-rw-r--r--usr.sbin/relayd/agentx.c23
-rw-r--r--usr.sbin/snmpd/agentx.c23
2 files changed, 22 insertions, 24 deletions
diff --git a/usr.sbin/relayd/agentx.c b/usr.sbin/relayd/agentx.c
index 2a5d7b4378f..3bb6fb8c738 100644
--- a/usr.sbin/relayd/agentx.c
+++ b/usr.sbin/relayd/agentx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agentx.c,v 1.6 2014/10/12 13:08:47 blambert Exp $ */
+/* $OpenBSD: agentx.c,v 1.7 2014/11/14 16:18:43 reyk Exp $ */
/*
* Copyright (c) 2013,2014 Bret Stephen Lambert <blambert@openbsd.org>
*
@@ -953,21 +953,20 @@ snmp_agentx_dump_hdr(struct agentx_hdr *hdr)
return;
}
- printf("Version: %i\n", hdr->version);
- printf("Type: %s\n", snmp_agentx_type2name(hdr->type));
- printf("Flags: %i\n", hdr->flags);
- printf("Reserved: %i\n", hdr->reserved);
- printf("Session ID: %i\n", hdr->sessionid);
- printf("Transaction ID: %i\n", hdr->transactid);
- printf("Packet ID: %i\n", hdr->packetid);
- printf("Data Length: %i\n", hdr->length);
+ fprintf(stderr,
+ "agentx: version %d type %s flags %d reserved %d"
+ " sessionid %d transactid %d packetid %d length %d",
+ hdr->version, snmp_agentx_type2name(hdr->type), hdr->flags,
+ hdr->reserved, hdr->sessionid, hdr->transactid,
+ hdr->packetid, hdr->length);
if (hdr->type == AGENTX_RESPONSE) {
struct agentx_response *r = (struct agentx_response *)hdr;
- printf("SysUptime: %i\n", r->data.sysuptime);
- printf("Error: %i\n", r->data.error);
- printf("Index: %i\n", r->data.index);
+ fprintf(stderr, " sysuptime %d error %d index %d",
+ r->data.sysuptime, r->data.error, r->data.index);
}
+
+ fprintf(stderr, "\n");
}
#endif
diff --git a/usr.sbin/snmpd/agentx.c b/usr.sbin/snmpd/agentx.c
index 2a5d7b4378f..3bb6fb8c738 100644
--- a/usr.sbin/snmpd/agentx.c
+++ b/usr.sbin/snmpd/agentx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agentx.c,v 1.6 2014/10/12 13:08:47 blambert Exp $ */
+/* $OpenBSD: agentx.c,v 1.7 2014/11/14 16:18:43 reyk Exp $ */
/*
* Copyright (c) 2013,2014 Bret Stephen Lambert <blambert@openbsd.org>
*
@@ -953,21 +953,20 @@ snmp_agentx_dump_hdr(struct agentx_hdr *hdr)
return;
}
- printf("Version: %i\n", hdr->version);
- printf("Type: %s\n", snmp_agentx_type2name(hdr->type));
- printf("Flags: %i\n", hdr->flags);
- printf("Reserved: %i\n", hdr->reserved);
- printf("Session ID: %i\n", hdr->sessionid);
- printf("Transaction ID: %i\n", hdr->transactid);
- printf("Packet ID: %i\n", hdr->packetid);
- printf("Data Length: %i\n", hdr->length);
+ fprintf(stderr,
+ "agentx: version %d type %s flags %d reserved %d"
+ " sessionid %d transactid %d packetid %d length %d",
+ hdr->version, snmp_agentx_type2name(hdr->type), hdr->flags,
+ hdr->reserved, hdr->sessionid, hdr->transactid,
+ hdr->packetid, hdr->length);
if (hdr->type == AGENTX_RESPONSE) {
struct agentx_response *r = (struct agentx_response *)hdr;
- printf("SysUptime: %i\n", r->data.sysuptime);
- printf("Error: %i\n", r->data.error);
- printf("Index: %i\n", r->data.index);
+ fprintf(stderr, " sysuptime %d error %d index %d",
+ r->data.sysuptime, r->data.error, r->data.index);
}
+
+ fprintf(stderr, "\n");
}
#endif