diff options
author | Martijn van Duren <martijn@cvs.openbsd.org> | 2020-10-27 18:24:02 +0000 |
---|---|---|
committer | Martijn van Duren <martijn@cvs.openbsd.org> | 2020-10-27 18:24:02 +0000 |
commit | 551267202837f288b0f3b11f51947d85b80d9bf4 (patch) | |
tree | 285e9f4d9a09f9f10c208cb086f1881db9a2ecc2 /lib/libagentx | |
parent | 46c87e63d09ddedd26e808d2a172beec5c434db4 (diff) |
Add agentx_varbind_unsigned32 as a wrapper around agentx_varbind_gauge32 to
be more clear what to use when a normal unsigned is desired.
This is in conformance with RFC 2578/SMIv2.
Ride yesterday's bump
OK tb@
Diffstat (limited to 'lib/libagentx')
-rw-r--r-- | lib/libagentx/Symbols.list | 1 | ||||
-rw-r--r-- | lib/libagentx/agentx.3 | 7 | ||||
-rw-r--r-- | lib/libagentx/agentx.c | 8 | ||||
-rw-r--r-- | lib/libagentx/agentx.h | 3 |
4 files changed, 16 insertions, 3 deletions
diff --git a/lib/libagentx/Symbols.list b/lib/libagentx/Symbols.list index 95804e1616d..6eda2be8ae0 100644 --- a/lib/libagentx/Symbols.list +++ b/lib/libagentx/Symbols.list @@ -42,6 +42,7 @@ agentx_varbind_index agentx_varbind_ipaddress agentx_varbind_counter32 agentx_varbind_gauge32 +agentx_varbind_unsigned32 agentx_varbind_timeticks agentx_varbind_opaque agentx_varbind_counter64 diff --git a/lib/libagentx/agentx.3 b/lib/libagentx/agentx.3 index 02e8e237753..f674c86f7cc 100644 --- a/lib/libagentx/agentx.3 +++ b/lib/libagentx/agentx.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: agentx.3,v 1.3 2020/10/27 17:33:05 martijn Exp $ +.\" $OpenBSD: agentx.3,v 1.4 2020/10/27 18:24:01 martijn Exp $ .\" .\" Copyright (c) 2020 Martijn van Duren <martijn@openbsd.org> .\" @@ -62,6 +62,7 @@ .Nm agentx_varbind_ipaddress , .Nm agentx_varbind_counter32 , .Nm agentx_varbind_gauge32 , +.Nm agentx_varbind_unsigned32 , .Nm agentx_varbind_timeticks , .Nm agentx_varbind_opaque , .Nm agentx_varbind_counter64 , @@ -222,6 +223,8 @@ .Ft void .Fn agentx_varbind_gauge32 "struct agentx_varbind *sav" "uint32_t value" .Ft void +.Fn agentx_varbind_unsigned32 "struct agentx_varbind *sav" "uint32_t value" +.Ft void .Fo agentx_varbind_timeticks .Fa "struct agentx_varbind *sav" "uint32_t value" .Fc @@ -517,6 +520,8 @@ Set the return value to ipaddress. Set the return value to an uint32_t of type counter32. .It Fn agentx_varbind_gauge32 Set the return value to an uint32_t of type gauge32. +.It Fn agentx_varbind_unsigned32 +A wrapper around agentx_varbind_gauge32. .It Fn agentx_varbind_timeticks Set the return value to an uint32_t of type timeticks. .It Fn agentx_varbind_opaque diff --git a/lib/libagentx/agentx.c b/lib/libagentx/agentx.c index d902e0b9f88..9a1984e0b75 100644 --- a/lib/libagentx/agentx.c +++ b/lib/libagentx/agentx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agentx.c,v 1.7 2020/10/27 17:19:44 martijn Exp $ */ +/* $OpenBSD: agentx.c,v 1.8 2020/10/27 18:24:01 martijn Exp $ */ /* * Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org> * @@ -3152,6 +3152,12 @@ agentx_varbind_gauge32(struct agentx_varbind *axv, uint32_t value) } void +agentx_varbind_unsigned32(struct agentx_varbind *axv, uint32_t value) +{ + agentx_varbind_gauge32(axv, value); +} + +void agentx_varbind_timeticks(struct agentx_varbind *axv, uint32_t value) { axv->axv_vb.avb_type = AX_DATA_TYPE_TIMETICKS; diff --git a/lib/libagentx/agentx.h b/lib/libagentx/agentx.h index 7c57a1557c9..250fd192c9b 100644 --- a/lib/libagentx/agentx.h +++ b/lib/libagentx/agentx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: agentx.h,v 1.4 2020/10/27 17:19:44 martijn Exp $ */ +/* $OpenBSD: agentx.h,v 1.5 2020/10/27 18:24:01 martijn Exp $ */ /* * Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org> * @@ -116,6 +116,7 @@ void agentx_varbind_ipaddress(struct agentx_varbind *, const struct in_addr *); void agentx_varbind_counter32(struct agentx_varbind *, uint32_t); void agentx_varbind_gauge32(struct agentx_varbind *, uint32_t); +void agentx_varbind_unsigned32(struct agentx_varbind *, uint32_t); void agentx_varbind_timeticks(struct agentx_varbind *, uint32_t); void agentx_varbind_opaque(struct agentx_varbind *, const char *, size_t); void agentx_varbind_counter64(struct agentx_varbind *, uint64_t); |