Deleted Added
sdiff udiff text old ( 216294 ) new ( 216594 )
full compact
1.\"
2.\" Copyright (c) 2010 The FreeBSD Foundation
3.\" All rights reserved.
4.\"
5.\" Portions of this documentation were written by Shteryana Sotirova Shopova
6.\" under sponsorship from the FreeBSD Foundation.
7.\"
8.\" Copyright (c) 2004-2005

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

32.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36.\" SUCH DAMAGE.
37.\"
38.\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.9 2005/10/04 08:46:51 brandt_h Exp $
39.\"
40.Dd September 9, 2010
41.Dt BSNMPLIB 3
42.Os
43.Sh NAME
44.Nm snmp_value_free ,
45.Nm snmp_value_parse ,
46.Nm snmp_value_copy ,
47.Nm snmp_pdu_free ,
48.Nm snmp_pdu_decode ,
49.Nm snmp_pdu_encode ,
50.Nm snmp_pdu_decode_header ,
51.Nm snmp_pdu_decode_scoped ,
52.Nm snmp_pdu_decode_secmode ,
53.Nm snmp_pdu_dump ,
54.Nm snmp_passwd_to_keys ,
55.Nm snmp_get_local_keys ,
56.Nm snmp_calc_keychange ,
57.Nm TRUTH_MK ,
58.Nm TRUTH_GET ,
59.Nm TRUTH_OK
60.Nd "SNMP decoding and encoding library"

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

78.Fn snmp_pdu_encode "struct snmp_pdu *pdu" "struct asn_buf *buf"
79.Ft enum snmp_code
80.Fn snmp_pdu_decode_header "struct snmp_pdu *pdu" "struct asn_buf *buf"
81.Ft enum snmp_code
82.Fn snmp_pdu_decode_scoped "struct asn_buf *buf" "struct snmp_pdu *pdu" "int32_t *ip"
83.Ft enum snmp_code
84.Fn snmp_pdu_decode_secmode "struct asn_buf *buf" "struct snmp_pdu *pdu"
85.Ft void
86.Fn snmp_pdu_dump "const struct snmp_pdu *pdu"
87.Ft enum snmp_code
88.Fn snmp_passwd_to_keys "struct snmp_user *user" "char *passwd"
89.Ft enum snmp_code
90.Fn snmp_get_local_keys "struct snmp_user *user" "uint8_t *eid" "uint32_t elen"
91.Ft enum snmp_code
92.Fn snmp_calc_keychange "struct snmp_user *user" "uint8_t *keychange"
93.Ft int

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

170 int32_t max_msg_size;
171};
172.Ed
173.Pp
174This structure represents an SNMP engine as specified by the SNMP Management
175Architecture described in RFC 3411.
176.Pp
177.Bd -literal -offset indent
178#define SNMP_USM_NAME_SIZ (32 + 1)
179#define SNMP_AUTH_KEY_SIZ 40
180#define SNMP_PRIV_KEY_SIZ 32
181
182struct snmp_user {
183 char sec_name[SNMP_USM_NAME_SIZ];
184 enum snmp_authentication auth_proto;
185 enum snmp_privacy priv_proto;
186 uint8_t auth_key[SNMP_AUTH_KEY_SIZ];
187 uint8_t priv_key[SNMP_PRIV_KEY_SIZ];
188};
189.Ed
190.Pp
191This structure represents an SNMPv3 user as specified by the User-based

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

225
226#define SNMP_USM_AUTH_SIZE 12
227#define SNMP_USM_PRIV_SIZE 8
228
229#define SNMP_MSG_AUTH_FLAG 0x1
230#define SNMP_MSG_PRIV_FLAG 0x2
231#define SNMP_MSG_REPORT_FLAG 0x4
232
233#define SNMP_SECMODEL_USM 3
234
235struct snmp_pdu {
236 char community[SNMP_COMMUNITY_MAXLEN + 1];
237 enum snmp_version version;
238 u_int type;
239
240 /* SNMPv3 PDU header fields */
241 int32_t identifier;

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

291 SNMP_V3
292};
293.Ed
294and
295.Fa type
296is the type of the PDU.
297.Fa security_model
298is the security model used for SNMPv3 PDUs. The only supported
299value currently is 3 (User-based Security Model).
300.Pp
301The function
302.Fn snmp_value_free
303is used to free all the dynamic allocated contents of an SNMP value.
304It does not free the structure pointed to by
305.Fa value
306itself.
307.Pp

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

361The function
362.Fn snmp_pdu_decode_secmode
363verifies the authentication parameter contained in the PDU (if present) and
364if the PDU is encrypted, decrypts the PDU contents pointed to by
365.Fa buf .
366If successfull, a plain text scoped PDU is stored in the buffer.
367.Pp
368The function
369.Fn snmp_pdu_dump
370dumps the PDU in a human readable form by calling
371.Fn snmp_printf .
372.Pp
373The function
374.Fn snmp_passwd_to_keys
375calculates a binary private authentication key corresponding to a plain text human
376readable password string. The calculated key is placed in the

--- 113 unchanged lines hidden ---