Deleted Added
full compact
snmpmod.3 (211404) snmpmod.3 (216294)
1.\"
2.\" Copyright (c) 2004-2005
3.\" Hartmut Brandt.
4.\" All rights reserved.
5.\" Copyright (c) 2001-2003
6.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
7.\" All rights reserved.
8.\"

--- 17 unchanged lines hidden (view full) ---

26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $Begemot: bsnmp/snmpd/snmpmod.3,v 1.14 2005/10/04 13:30:35 brandt_h Exp $
33.\"
1.\"
2.\" Copyright (c) 2004-2005
3.\" Hartmut Brandt.
4.\" All rights reserved.
5.\" Copyright (c) 2001-2003
6.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
7.\" All rights reserved.
8.\"

--- 17 unchanged lines hidden (view full) ---

26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $Begemot: bsnmp/snmpd/snmpmod.3,v 1.14 2005/10/04 13:30:35 brandt_h Exp $
33.\"
34.Dd February 27, 2006
34.Dd September 9, 2010
35.Dt SNMPMOD 3
36.Os
37.Sh NAME
38.Nm INSERT_OBJECT_OID_LINK_INDEX ,
39.Nm INSERT_OBJECT_INT_LINK_INDEX ,
40.Nm FIND_OBJECT_OID_LINK_INDEX ,
41.Nm NEXT_OBJECT_OID_LINK_INDEX ,
42.Nm FIND_OBJECT_INT_LINK_INDEX ,

--- 12 unchanged lines hidden (view full) ---

55.Nm NEXT_OBJECT_INT ,
56.Nm this_tick ,
57.Nm start_tick ,
58.Nm get_ticks ,
59.Nm systemg ,
60.Nm comm_define ,
61.Nm community ,
62.Nm oid_zeroDotZero ,
35.Dt SNMPMOD 3
36.Os
37.Sh NAME
38.Nm INSERT_OBJECT_OID_LINK_INDEX ,
39.Nm INSERT_OBJECT_INT_LINK_INDEX ,
40.Nm FIND_OBJECT_OID_LINK_INDEX ,
41.Nm NEXT_OBJECT_OID_LINK_INDEX ,
42.Nm FIND_OBJECT_INT_LINK_INDEX ,

--- 12 unchanged lines hidden (view full) ---

55.Nm NEXT_OBJECT_INT ,
56.Nm this_tick ,
57.Nm start_tick ,
58.Nm get_ticks ,
59.Nm systemg ,
60.Nm comm_define ,
61.Nm community ,
62.Nm oid_zeroDotZero ,
63.Nm oid_usmUnknownEngineIDs ,
64.Nm oid_usmNotInTimeWindows ,
63.Nm reqid_allocate ,
64.Nm reqid_next ,
65.Nm reqid_base ,
66.Nm reqid_istype ,
67.Nm reqid_type ,
68.Nm timer_start ,
69.Nm timer_start_repeat ,
70.Nm timer_stop ,

--- 23 unchanged lines hidden (view full) ---

94.Nm oid_save ,
95.Nm oid_rollback ,
96.Nm oid_commit ,
97.Nm oid_get ,
98.Nm index_decode ,
99.Nm index_compare ,
100.Nm index_compare_off ,
101.Nm index_append ,
65.Nm reqid_allocate ,
66.Nm reqid_next ,
67.Nm reqid_base ,
68.Nm reqid_istype ,
69.Nm reqid_type ,
70.Nm timer_start ,
71.Nm timer_start_repeat ,
72.Nm timer_stop ,

--- 23 unchanged lines hidden (view full) ---

96.Nm oid_save ,
97.Nm oid_rollback ,
98.Nm oid_commit ,
99.Nm oid_get ,
100.Nm index_decode ,
101.Nm index_compare ,
102.Nm index_compare_off ,
103.Nm index_append ,
102.Nm index_append_off
104.Nm index_append_off,
105.Nm bsnmpd_get_usm_stats,
106.Nm bsnmpd_reset_usm_stats,
107.Nm usm_first_user,
108.Nm usm_next_user,
109.Nm usm_find_user,
110.Nm usm_new_user,
111.Nm usm_delete_user,
112.Nm usm_flush_users,
113.Nm usm_user
103.Nd "SNMP daemon loadable module interface"
104.Sh LIBRARY
105Begemot SNMP library
106.Pq libbsnmp, -lbsnmp
107.Sh SYNOPSIS
108.In bsnmp/snmpmod.h
109.Fn INSERT_OBJECT_OID_LINK_INDEX "PTR" "LIST" "LINK" "INDEX"
110.Fn INSERT_OBJECT_INT_LINK_INDEX "PTR" "LIST" "LINK" "INDEX"

--- 112 unchanged lines hidden (view full) ---

223.Ft int
224.Fn index_compare "const struct asn_oid *oid1" "u_int sub" "const struct asn_oid *oid2"
225.Ft int
226.Fn index_compare_off "const struct asn_oid *oid1" "u_int sub" "const struct asn_oid *oid2" "u_int off"
227.Ft void
228.Fn index_append "struct asn_oid *dst" "u_int sub" "const struct asn_oid *src"
229.Ft void
230.Fn index_append_off "struct asn_oid *dst" "u_int sub" "const struct asn_oid *src" "u_int off"
114.Nd "SNMP daemon loadable module interface"
115.Sh LIBRARY
116Begemot SNMP library
117.Pq libbsnmp, -lbsnmp
118.Sh SYNOPSIS
119.In bsnmp/snmpmod.h
120.Fn INSERT_OBJECT_OID_LINK_INDEX "PTR" "LIST" "LINK" "INDEX"
121.Fn INSERT_OBJECT_INT_LINK_INDEX "PTR" "LIST" "LINK" "INDEX"

--- 112 unchanged lines hidden (view full) ---

234.Ft int
235.Fn index_compare "const struct asn_oid *oid1" "u_int sub" "const struct asn_oid *oid2"
236.Ft int
237.Fn index_compare_off "const struct asn_oid *oid1" "u_int sub" "const struct asn_oid *oid2" "u_int off"
238.Ft void
239.Fn index_append "struct asn_oid *dst" "u_int sub" "const struct asn_oid *src"
240.Ft void
241.Fn index_append_off "struct asn_oid *dst" "u_int sub" "const struct asn_oid *src" "u_int off"
242.Ft struct snmpd_usmstat *
243.Fn bsnmpd_get_usm_stats "void"
244.Ft void
245.Fn bsnmpd_reset_usm_stats "void"
246.Ft struct usm_user *
247.Fn usm_first_user "void"
248.Ft struct usm_user *
249.Fn usm_next_user "struct usm_user *uuser"
250.Ft struct usm_user *
251.Fn usm_find_user "uint8_t *engine" "uint32_t elen" "char *uname"
252.Ft struct usm_user *
253.Fn usm_new_user "uint8_t *engine" "uint32_t elen" "char *uname"
254.Ft void
255.Fn usm_delete_user "struct usm_user *"
256.Ft void
257.Fn usm_flush_users "void"
258.Vt extern struct usm_user *usm_user;
259.Vt extern const struct asn_oid oid_usmUnknownEngineIDs;
260.Vt extern const struct asn_oid oid_usmNotInTimeWindows;
231.Sh DESCRIPTION
232The
233.Xr bsnmpd 1
234SNMP daemon implements a minimal MIB which consists of the system group, part
235of the SNMP MIB, a private configuration MIB, a trap destination table, a
236UDP port table, a community table, a module table, a statistics group and
237a debugging group.
238All other MIBs are support through loadable modules.

--- 295 unchanged lines hidden (view full) ---

534It is visible in the community table.
535.It Fa mod
536This is the module defining the community.
537.It Fa str
538This is the initial community string.
539.El
540.Pp
541The function returns a globally unique community identifier.
261.Sh DESCRIPTION
262The
263.Xr bsnmpd 1
264SNMP daemon implements a minimal MIB which consists of the system group, part
265of the SNMP MIB, a private configuration MIB, a trap destination table, a
266UDP port table, a community table, a module table, a statistics group and
267a debugging group.
268All other MIBs are support through loadable modules.

--- 295 unchanged lines hidden (view full) ---

564It is visible in the community table.
565.It Fa mod
566This is the module defining the community.
567.It Fa str
568This is the initial community string.
569.El
570.Pp
571The function returns a globally unique community identifier.
542If a PDU is
572If a SNMPv1 or SNMPv2 PDU is
543received who's community string matches, this identifier is set into the global
544.Va community .
545.Pp
546The function
547.Fn comm_string
548returns the current community string for the given community.
549.Pp
550All communities defined by a module are automatically released when the module
551is unloaded.
573received who's community string matches, this identifier is set into the global
574.Va community .
575.Pp
576The function
577.Fn comm_string
578returns the current community string for the given community.
579.Pp
580All communities defined by a module are automatically released when the module
581is unloaded.
582.Ss THE USER-BASED SECURITY GROUP
583The scalar statistics of the USM group are held in the global variable
584.Va snmpd_usmstats :
585.Bd -literal -offset indent
586struct snmpd_usmstat {
587 uint32_t unsupported_seclevels;
588 uint32_t not_in_time_windows;
589 uint32_t unknown_users;
590 uint32_t unknown_engine_ids;
591 uint32_t wrong_digests;
592 uint32_t decrypt_errors;
593};
594.Ed
595.Fn bsnmpd_get_usm_stats
596returns a pointer to the global structure containing the statistics.
597.Fn bsnmpd_reset_usm_stats
598clears the statistics of the USM group.
599.Pp
600A global list of configured USM users is maintained by the daemon.
601.Bd -literal -offset indent
602struct usm_user {
603 struct snmp_user suser;
604 uint8_t user_engine_id[SNMP_ENGINE_ID_SIZ];
605 uint32_t user_engine_len;
606 char user_public[SNMP_USM_NAME_SIZ];
607 uint32_t user_public_len;
608 int32_t status;
609 int32_t type;
610 SLIST_ENTRY(usm_user) up;
611};
612.Ed
613This structure represents an USM user. The daemon only responds to SNMPv3 PDUs
614with user credentials matching an USM user entry in its global list.
615If a SNMPv3 PDU is received, whose security model is USM, the global
616.Va usm_user
617is set to point at the user entry that matches the credentials contained in
618the PDU.
619However, the daemon does not create or remove USM users, it gives an interface
620to external loadable module(s) to manage the list.
621.Fn usm_new_user
622adds an user entry in the list, and
623.Fn usm_delete_user
624deletes an existing entry from the list.
625.Fn usm_flush_users
626is used to remove all configured USM users.
627.Fn usm_first_user
628will return the first user in the list, or
629.Li NULL
630if the list is empty.
631.Fn usm_next_user
632will return the next user of a given entry if one exists, or
633.Li NULL .
634The list is sorted according to the USM user name and Engine ID.
635.Fn usm_find_user
636returns the USM user entry matching the given
637.Fa engine
638and
639.Fa uname
640or
641.Li NULL
642if an user with the specified name and engine id is not present in the list.
552.Ss WELL KNOWN OIDS
553The global variable
554.Va oid_zeroDotZero
555contains the OID 0.0.
643.Ss WELL KNOWN OIDS
644The global variable
645.Va oid_zeroDotZero
646contains the OID 0.0.
647The global variables
648.Va oid_usmUnknownEngineIDs
649.Va oid_usmNotInTimeWindows
650contains the OIDs 1.3.6.1.6.3.15.1.1.4.0 and 1.3.6.1.6.3.15.1.1.2.0 used
651in the SNMPv3 USM Engine Discovery.
556.Ss REQUEST ID RANGES
557For modules that implement SNMP client functions besides SNMP agent functions
558it may be necessary to identify SNMP requests by their identifier to allow
559easier routing of responses to the correct sub-system.
560Request id ranges
561provide a way to acquire globally non-overlapping sub-ranges of the entire
56231-bit id range.
563.Pp

--- 366 unchanged lines hidden ---
652.Ss REQUEST ID RANGES
653For modules that implement SNMP client functions besides SNMP agent functions
654it may be necessary to identify SNMP requests by their identifier to allow
655easier routing of responses to the correct sub-system.
656Request id ranges
657provide a way to acquire globally non-overlapping sub-ranges of the entire
65831-bit id range.
659.Pp

--- 366 unchanged lines hidden ---