snmpmod.h (6d4b97158fa99be390dba1c61c1d1f547852aef6) snmpmod.h (72cd7a520d65ad6c36e208486118fbc92039423e)
1/*
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Author: Harti Brandt <harti@freebsd.org>
7 *
1/*
2 * Copyright (c) 2001-2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Author: Harti Brandt <harti@freebsd.org>
7 *
8 * Copyright (c) 2010 The FreeBSD Foundation
9 * All rights reserved.
10 *
11 * Portions of this software were developed by Shteryana Sotirova Shopova
12 * under sponsorship from the FreeBSD Foundation.
13 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.

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

450struct vacm_view *vacm_new_view(char *, struct asn_oid *);
451int vacm_delete_view(struct vacm_view *);
452struct vacm_context *vacm_first_context(void);
453struct vacm_context *vacm_next_context(struct vacm_context *);
454struct vacm_context *vacm_add_context(char *, int32_t);
455void vacm_flush_contexts(int32_t);
456
457/*
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.

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

456struct vacm_view *vacm_new_view(char *, struct asn_oid *);
457int vacm_delete_view(struct vacm_view *);
458struct vacm_context *vacm_first_context(void);
459struct vacm_context *vacm_next_context(struct vacm_context *);
460struct vacm_context *vacm_add_context(char *, int32_t);
461void vacm_flush_contexts(int32_t);
462
463/*
464 * RFC 3413 SNMP Management Target & Notification MIB
465 */
466
467struct snmpd_target_stats {
468 uint32_t unavail_contexts;
469 uint32_t unknown_contexts;
470};
471
472#define SNMP_UDP_ADDR_SIZ 6
473#define SNMP_TAG_SIZ (255 + 1)
474
475struct target_address {
476 char name[SNMP_ADM_STR32_SIZ];
477 uint8_t address[SNMP_UDP_ADDR_SIZ];
478 int32_t timeout;
479 int32_t retry;
480 char taglist[SNMP_TAG_SIZ];
481 char paramname[SNMP_ADM_STR32_SIZ];
482 int32_t type;
483 int32_t socket;
484 int32_t status;
485 SLIST_ENTRY(target_address) ta;
486};
487
488SLIST_HEAD(target_addresslist, target_address);
489
490struct target_param {
491 char name[SNMP_ADM_STR32_SIZ];
492 int32_t mpmodel;
493 int32_t sec_model;
494 char secname[SNMP_ADM_STR32_SIZ];
495 enum snmp_usm_level sec_level;
496 int32_t type;
497 int32_t status;
498 SLIST_ENTRY(target_param) tp;
499};
500
501SLIST_HEAD(target_paramlist, target_param);
502
503struct target_notify {
504 char name[SNMP_ADM_STR32_SIZ];
505 char taglist[SNMP_TAG_SIZ];
506 int32_t notify_type;
507 int32_t type;
508 int32_t status;
509 SLIST_ENTRY(target_notify) tn;
510};
511
512SLIST_HEAD(target_notifylist, target_notify);
513
514extern struct snmpd_target_stats snmpd_target_stats;
515struct snmpd_target_stats *bsnmpd_get_target_stats(void);
516struct target_address *target_first_address(void);
517struct target_address *target_next_address(struct target_address *);
518struct target_address *target_new_address(char *);
519int target_activate_address(struct target_address *);
520int target_delete_address(struct target_address *);
521struct target_param *target_first_param(void);
522struct target_param *target_next_param(struct target_param *);
523struct target_param *target_new_param(char *);
524int target_delete_param(struct target_param *);
525struct target_notify *target_first_notify(void);
526struct target_notify *target_next_notify(struct target_notify *);
527struct target_notify *target_new_notify(char *);
528int target_delete_notify (struct target_notify *);
529void target_flush_all(void);
530
531/*
458 * Well known OIDs
459 */
460extern const struct asn_oid oid_zeroDotZero;
461
462/* SNMPv3 Engine Discovery */
463extern const struct asn_oid oid_usmUnknownEngineIDs;
464extern const struct asn_oid oid_usmNotInTimeWindows;
465

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

510/* process the pdu. returns either _OK or _FAILED */
511enum snmpd_input_err snmp_input_finish(struct snmp_pdu *, const u_char *,
512 size_t, u_char *, size_t *, const char *, enum snmpd_input_err, int32_t,
513 void *);
514
515void snmp_output(struct snmp_pdu *, u_char *, size_t *, const char *);
516void snmp_send_port(void *, const struct asn_oid *, struct snmp_pdu *,
517 const struct sockaddr *, socklen_t);
532 * Well known OIDs
533 */
534extern const struct asn_oid oid_zeroDotZero;
535
536/* SNMPv3 Engine Discovery */
537extern const struct asn_oid oid_usmUnknownEngineIDs;
538extern const struct asn_oid oid_usmNotInTimeWindows;
539

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

584/* process the pdu. returns either _OK or _FAILED */
585enum snmpd_input_err snmp_input_finish(struct snmp_pdu *, const u_char *,
586 size_t, u_char *, size_t *, const char *, enum snmpd_input_err, int32_t,
587 void *);
588
589void snmp_output(struct snmp_pdu *, u_char *, size_t *, const char *);
590void snmp_send_port(void *, const struct asn_oid *, struct snmp_pdu *,
591 const struct sockaddr *, socklen_t);
592enum snmp_code snmp_pdu_auth_access(struct snmp_pdu *, int32_t *);
518
519/* sending traps */
520void snmp_send_trap(const struct asn_oid *, ...);
521
522/*
523 * Action support
524 */
525int string_save(struct snmp_value *, struct snmp_context *, ssize_t, u_char **);

--- 24 unchanged lines hidden ---
593
594/* sending traps */
595void snmp_send_trap(const struct asn_oid *, ...);
596
597/*
598 * Action support
599 */
600int string_save(struct snmp_value *, struct snmp_context *, ssize_t, u_char **);

--- 24 unchanged lines hidden ---