PK )6FZ��) Requests.phpnu �[��� <?php
/**
* Loads the old Requests class file when the autoloader
* references the original PSR-0 Requests class.
*
* @deprecated 6.2.0
* @package WordPress
* @subpackage Requests
* @since 6.2.0
*/
include_once ABSPATH . WPINC . '/class-requests.php';
PK ��FZ���� � winpipe.hnu �[��� /*
Copyright (c) Fabasoft R&D Software GmbH & Co KG, 2003
oss@fabasoft.com
Author: Bernhard Penz <bernhard.penz@fabasoft.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of Fabasoft R&D Software GmbH & Co KG or any of its subsidiaries,
brand or product names may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef WIN32
#ifndef WINPIPE_H
#define WINPIPE_H
NETSNMP_IMPORT
int create_winpipe_transport(int *pipefds);
#endif
#endif
PK ��FZ��0r� � snmpv3-security-includes.hnu �[��� /* This file is automatically generated by configure. Do not modify by hand. */
#include <net-snmp/library/snmptsm.h>
#include <net-snmp/library/snmpusm.h>
PK ��FZyk#�F �F container.hnu �[��� /* Portions of this file are subject to the following copyright(s). See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*/
/*
* Portions of this file are copyrighted by:
* Copyright (C) 2007 Apple, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef NETSNMP_CONTAINER_H
#define NETSNMP_CONTAINER_H
/*
* $Id$
*
* WARNING: This is a recently created file, and all of it's contents are
* subject to change at any time.
*
* A basic container template. A generic way for code to store and
* retrieve data. Allows for interchangable storage algorithms.
*/
#ifndef NET_SNMP_CONFIG_H
#error "Please include <net-snmp/net-snmp-config.h> before this file"
#endif
#include <stdlib.h> /* free() */
#include <net-snmp/types.h>
#include <net-snmp/library/factory.h>
#include <net-snmp/library/snmp_logging.h>
#include <net-snmp/library/tools.h>
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
*
* function pointer definitions
*
*************************************************************************/
struct netsnmp_iterator_s; /** forward declare */
struct netsnmp_container_s; /** forward declare */
/*
* function for performing an operation on a container which
* returns (maybe the same) container.
*/
typedef struct netsnmp_container_s* (netsnmp_container_mod_op)
(struct netsnmp_container_s *, void *context, u_int flags);
/*
* function for setting an option on a container
*/
typedef int (netsnmp_container_option)(struct netsnmp_container_s *,
int set, u_int flags);
/*
* function returning an int for an operation on a container
*/
typedef int (netsnmp_container_rc)(struct netsnmp_container_s *);
/*
* function returning an iterator for a container
*/
typedef struct netsnmp_iterator_s * (netsnmp_container_it)
(struct netsnmp_container_s *);
/*
* function returning a size_t for an operation on a container
*/
typedef size_t (netsnmp_container_size)(struct netsnmp_container_s *);
/*
* function returning an int for an operation on an object and
* a container
*/
typedef int (netsnmp_container_op)(struct netsnmp_container_s *,
const void *data);
/*
* function returning an int for an operation on an object at a given
* position in a container (for containers supporting direct access)
*/
typedef int (netsnmp_container_da_op)(struct netsnmp_container_s *,
size_t pos, void *data);
/*
* function returning an int and an object at a given position in a
* container (for containers supporting direct access)
*/
typedef int (netsnmp_container_da_op_rtn)(struct netsnmp_container_s *,
size_t pos,
void **data);
/*
* function returning an oject for an operation on an object and a
* container
*/
typedef void * (netsnmp_container_rtn)(struct netsnmp_container_s *,
const void *data);
/*
* function with no return which acts on an object
*/
typedef void (netsnmp_container_obj_func)(void *data, void *context);
/*
* function with no return which calls a function on an object
*/
typedef void (netsnmp_container_func)(struct netsnmp_container_s *,
netsnmp_container_obj_func *,
void *context);
/*
* function returning an array of objects for an operation on an
* ojbect and a container
*/
typedef netsnmp_void_array * (netsnmp_container_set)
(struct netsnmp_container_s *, void *data);
/*
* function returning an int for a comparison between two objects
*/
typedef int (netsnmp_container_compare)(const void *lhs,
const void *rhs);
/*************************************************************************
*
* Basic container
*
*************************************************************************/
typedef struct netsnmp_container_s {
/*
* pointer for container implementation
*/
void * container_data;
/*
* returns the number of items in a container
*/
netsnmp_container_size *get_size;
/*
* initialize a container
*/
netsnmp_container_rc *init;
/*
* release memory used by a container.
*
* Note: if your data structures contained allocated
* memory, you are responsible for releasing that
* memory before calling this function!
*/
netsnmp_container_rc *cfree;
/*
* add an entry to the container
*/
netsnmp_container_op *insert;
/*
* add an entry to the container at a given position
*/
netsnmp_container_da_op *insert_before;
netsnmp_container_da_op *insert_after;
/*
* remove an entry from the container
*/
netsnmp_container_op *remove;
/*
* remove an entry from the container at a given position
*/
netsnmp_container_da_op_rtn *remove_at;
/*
* release memory for an entry from the container
*/
netsnmp_container_op *release; /* NOTE: deprecated. Use free_item */
netsnmp_container_obj_func *free_item;
/*
* find the entry in the container with the same key
*
* Note: do not change the key! If you need to
* change a key, remove the entry, change the key,
* and the re-add the entry.
*/
netsnmp_container_rtn *find;
/*
* find the entry in the container with the next highest key
*
* If the key is NULL, return the first item in the container.
*/
netsnmp_container_rtn *find_next;
/*
* get entry at the given index (for containers supporting direct access
*/
netsnmp_container_da_op_rtn *get_at;
/*
* find all entries in the container which match the partial key
* returns allocated memory (netsnmp_void_array). User is responsible
* for releasing this memory (free(array->array), free(array)).
* DO NOT FREE ELEMENTS OF THE ARRAY, because they are the same pointers
* stored in the container.
*/
netsnmp_container_set *get_subset;
/*
* function to return an iterator for the container
*/
netsnmp_container_it *get_iterator;
/*
* function to call another function for each object in the container
*/
netsnmp_container_func *for_each;
/*
* specialized version of for_each used to optimize cleanup.
* clear the container, optionally calling a function for each item.
*/
netsnmp_container_func *clear;
/*
* OPTIONAL function to filter inserts to the container
* (intended for a secondary container, which only wants
* a sub-set of the objects in the primary/parent container)
* Returns:
* 1 : filter matched (don't insert)
* 0 : no match (insert)
*/
netsnmp_container_op *insert_filter;
/*
* OPTIONAL function to duplicate a container. Defaults to a shallow
* copy. Only the specified container is copied (i.e. sub-containers
* not included).
*/
netsnmp_container_mod_op *duplicate;
/*
* function to compare two object stored in the container.
*
* Returns:
*
* -1 LHS < RHS
* 0 LHS = RHS
* 1 LHS > RHS
*/
netsnmp_container_compare *compare;
/*
* same as compare, but RHS will be a partial key
*/
netsnmp_container_compare *ncompare;
/*
* function to set container options
*/
netsnmp_container_option *options;
/*
* unique name for finding a particular container in a list
*/
char *container_name;
/*
* sort count, for iterators to track (insert/delete
* bumps counter, invalidates iterator)
*/
u_long sync;
/*
* flags
*/
u_int flags;
/*
* containers can contain other containers (additional indexes)
*/
struct netsnmp_container_s *next, *prev;
} netsnmp_container;
/*
* initialize/free a container of container factories. used by
* netsnmp_container_find* functions.
*/
NETSNMP_IMPORT
void netsnmp_container_init_list(void);
NETSNMP_IMPORT
void netsnmp_container_free_list(void);
/*
* register a new container factory
*/
int netsnmp_container_register_with_compare(const char* name,
netsnmp_factory *f,
netsnmp_container_compare *c);
int netsnmp_container_register(const char* name, netsnmp_factory *f);
/*
* search for and create a container from a list of types or a
* specific type.
*/
NETSNMP_IMPORT
netsnmp_container * netsnmp_container_find(const char *type_list);
netsnmp_container * netsnmp_container_get(const char *type);
/*
* utility routines
*/
NETSNMP_IMPORT
void netsnmp_container_add_index(netsnmp_container *primary,
netsnmp_container *new_index);
netsnmp_factory *netsnmp_container_get_factory(const char *type);
/*
* common comparison routines
*/
/** first data element is a 'netsnmp_index' */
NETSNMP_IMPORT
int netsnmp_compare_netsnmp_index(const void *lhs, const void *rhs);
NETSNMP_IMPORT
int netsnmp_ncompare_netsnmp_index(const void *lhs, const void *rhs);
/** first data element is a 'char *' */
int netsnmp_compare_cstring(const void * lhs, const void * rhs);
int netsnmp_ncompare_cstring(const void * lhs, const void * rhs);
/** useful for octet strings */
NETSNMP_IMPORT
int netsnmp_compare_mem(const char * lhs, size_t lhs_len,
const char * rhs, size_t rhs_len);
/** no structure, just 'char *' pointers */
int netsnmp_compare_direct_cstring(const void * lhs, const void * rhs);
int netsnmp_compare_long(const void * lhs, const void * rhs);
int netsnmp_compare_ulong(const void * lhs, const void * rhs);
int netsnmp_compare_int32(const void * lhs, const void * rhs);
int netsnmp_compare_uint32(const void * lhs, const void * rhs);
/** for_each callback to call free on data item */
NETSNMP_IMPORT
void netsnmp_container_simple_free(void *data, void *context);
/*
* container optionflags
*/
#define CONTAINER_KEY_ALLOW_DUPLICATES 0x00000001
#define CONTAINER_KEY_UNSORTED 0x00000002
/* ... */
#define CONTAINER_FLAG_INTERNAL_1 0x80000000
#define CONTAINER_SET_OPTIONS(x,o,rc) do { \
if (NULL==(x)->options) \
rc = -1; \
else { \
rc = (x)->options(x, 1, o); \
if (rc != -1 ) \
(x)->flags |= o; \
} \
} while(0)
#define CONTAINER_CHECK_OPTION(x,o,rc) do { \
rc = x->flags & 0; \
} while(0)
/*
* useful macros (x = container; k = key; c = user context)
*/
#define CONTAINER_FIRST(x) (x)->find_next(x,NULL)
#define CONTAINER_FIND(x,k) (x)->find(x,k)
#define CONTAINER_NEXT(x,k) (x)->find_next(x,k)
/*
* GET_SUBSET returns allocated memory (netsnmp_void_array). User is responsible
* for releasing this memory (free(array->array), free(array)).
* DO NOT FREE ELEMENTS OF THE ARRAY, because they are the same pointers
* stored in the container.
*/
#define CONTAINER_GET_SUBSET(x,k) (x)->get_subset(x,k)
#define CONTAINER_SIZE(x) (x)->get_size(x)
#define CONTAINER_ITERATOR(x) (x)->get_iterator(x)
#define CONTAINER_COMPARE(x,l,r) (x)->compare(l,r)
#define CONTAINER_FOR_EACH(x,f,c) (x)->for_each(x,f,c)
/*
* if you are getting multiple definitions of these three
* inline functions, you most likely have optimizations turned off.
* Either turn them back on, or define NETSNMP_NO_INLINE
*/
/*
* insert k into all containers
*/
NETSNMP_IMPORT
int CONTAINER_INSERT(netsnmp_container *x, const void *k);
/*
* insert item before given position
*/
NETSNMP_IMPORT
int CONTAINER_INSERT_BEFORE(netsnmp_container *x, size_t pos, void *k);
/*
* remove k from all containers
*/
NETSNMP_IMPORT
int CONTAINER_REMOVE(netsnmp_container *x, const void *k);
/*
* remove item at given position
*/
NETSNMP_IMPORT
int CONTAINER_REMOVE_AT(netsnmp_container *x, size_t pos, void **k);
/*
* get item at given position
*/
NETSNMP_IMPORT
int CONTAINER_GET_AT(netsnmp_container *x, size_t pos, void **k);
/*
* duplicate container
*/
NETSNMP_IMPORT
netsnmp_container *CONTAINER_DUP(netsnmp_container *x, void *ctx,
u_int flags);
/*
* clear all containers. When clearing the *first* container, and
* *only* the first container, call the function f for each item.
* After calling this function, all containers should be empty.
*/
NETSNMP_IMPORT
void CONTAINER_CLEAR(netsnmp_container *x, netsnmp_container_obj_func *f,
void *c);
/*
* clear all containers. When clearing the *first* container, and
* *only* the first container, call the free_item function for each item.
* After calling this function, all containers should be empty.
*/
NETSNMP_IMPORT
void CONTAINER_FREE_ALL(netsnmp_container *x, void *c);
/*
* free all containers
*/
NETSNMP_IMPORT
int CONTAINER_FREE(netsnmp_container *x);
NETSNMP_IMPORT
netsnmp_container *SUBCONTAINER_FIND(netsnmp_container *x,
const char* name);
/*
* INTERNAL utility routines for container implementations
*/
void netsnmp_init_container(netsnmp_container *c,
netsnmp_container_rc *init,
netsnmp_container_rc *cfree,
netsnmp_container_size *size,
netsnmp_container_compare *cmp,
netsnmp_container_op *ins,
netsnmp_container_op *rem,
netsnmp_container_rtn *fnd);
/** Duplicate container meta-data. */
int netsnmp_container_data_dup(netsnmp_container *dup,
netsnmp_container *c);
/*************************************************************************
*
* container iterator
*
*************************************************************************/
/*
* function returning an int for an operation on an iterator
*/
typedef int (netsnmp_iterator_rc)(struct netsnmp_iterator_s *);
/*
* function returning an oject for an operation on an iterator
*/
typedef void * (netsnmp_iterator_rtn)(struct netsnmp_iterator_s *);
/*
* iterator structure
*/
typedef struct netsnmp_iterator_s {
netsnmp_container *container;
/*
* sync from container when iterator created. used to invalidate
* the iterator when the container changes.
*/
u_long sync;
/*
* reset iterator position to beginning of container.
*/
netsnmp_iterator_rc *reset;
/*
* release iterator and memory it uses
*/
netsnmp_iterator_rc *release;
/*
* first, last and current DO NOT advance the iterator
*/
netsnmp_iterator_rtn *first;
netsnmp_iterator_rtn *curr;
netsnmp_iterator_rtn *last;
netsnmp_iterator_rtn *next;
/*
* remove will remove the item at the current position, then back up
* the iterator to the previous item. That way next will move to the
* item (the one that replaced the removed item.
*/
netsnmp_iterator_rc *remove;
} netsnmp_iterator;
#define ITERATOR_FIRST(x) x->first(x)
#define ITERATOR_NEXT(x) x->next(x)
#define ITERATOR_LAST(x) x->last(x)
#define ITERATOR_REMOVE(x) x->remove(x)
#define ITERATOR_RELEASE(x) do { x->release(x); x = NULL; } while(0)
#ifdef __cplusplus
}
#endif
#endif /** NETSNMP_CONTAINER_H */
PK ��FZ*�p� snmpTCPBaseDomain.hnu �[��� #ifndef SNMPTCPBASEDOMAIN_H
#define SNMPTCPBASEDOMAIN_H
#include <net-snmp/library/snmp_transport.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Prototypes
*/
int netsnmp_tcpbase_recv(netsnmp_transport *t, void *buf, int size,
void **opaque, int *olength);
int netsnmp_tcpbase_send(netsnmp_transport *t, const void *buf, int size,
void **opaque, int *olength);
#ifdef __cplusplus
}
#endif
#endif /* SNMPTCPBASEDOMAIN_H */
PK ��FZl�m
lcd_time.hnu �[��� /*
* lcd_time.h
*/
#ifndef _LCD_TIME_H
#define _LCD_TIME_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* undefine to enable time synchronization only on authenticated packets
*/
#define LCD_TIME_SYNC_OPT 1
/*
* Macros and definitions.
*/
#define ETIMELIST_SIZE 23
typedef struct enginetime_struct {
u_char *engineID;
u_int engineID_len;
u_int engineTime;
u_int engineBoot;
/*
* Time & boots values received from last authenticated
* * message within the previous time window.
*/
time_t lastReceivedEngineTime;
/*
* Timestamp made when engineTime/engineBoots was last
* * updated. Measured in seconds.
*/
#ifdef LCD_TIME_SYNC_OPT
u_int authenticatedFlag;
#endif
struct enginetime_struct *next;
} enginetime , *Enginetime;
/*
* Macros for streamlined engineID existence checks --
*
* e is char *engineID,
* e_l is u_int engineID_len.
*
*
* ISENGINEKNOWN(e, e_l)
* Returns:
* TRUE If engineID is recoreded in the EngineID List;
* FALSE Otherwise.
*
* ENSURE_ENGINE_RECORD(e, e_l)
* Adds the given engineID to the EngineID List if it does not exist
* already. engineID is added with a <enginetime, engineboots>
* tuple of <0,0>. ALWAYS succeeds -- except in case of a
* fatal internal error.
* Returns:
* SNMPERR_SUCCESS On success;
* SNMPERR_GENERR Otherwise.
*
* MAKENEW_ENGINE_RECORD(e, e_l)
* Returns:
* SNMPERR_SUCCESS If engineID already exists in the EngineID List;
* SNMPERR_GENERR Otherwise -and- invokes ENSURE_ENGINE_RECORD()
* to add an entry to the EngineID List.
*
* XXX Requres the following declaration in modules calling ISENGINEKNOWN():
* static u_int dummy_etime, dummy_eboot;
*/
#define ISENGINEKNOWN(e, e_l) \
( (get_enginetime(e, e_l, \
&dummy_eboot, &dummy_etime, TRUE) == SNMPERR_SUCCESS) \
? TRUE \
: FALSE )
#define ENSURE_ENGINE_RECORD(e, e_l) \
( (set_enginetime(e, e_l, 0, 0, FALSE) == SNMPERR_SUCCESS) \
? SNMPERR_SUCCESS \
: SNMPERR_GENERR )
#define MAKENEW_ENGINE_RECORD(e, e_l) \
( (ISENGINEKNOWN(e, e_l) == TRUE) \
? SNMPERR_SUCCESS \
: (ENSURE_ENGINE_RECORD(e, e_l), SNMPERR_GENERR) )
/*
* Prototypes.
*/
int get_enginetime(const u_char * engineID, u_int engineID_len,
u_int * engine_boot,
u_int * engine_time,
u_int authenticated);
int get_enginetime_ex(u_char * engineID,
u_int engineID_len,
u_int * engine_boot,
u_int * engine_time,
u_int * last_engine_time,
u_int authenticated);
NETSNMP_IMPORT
int set_enginetime(const u_char * engineID, u_int engineID_len,
u_int engine_boot, u_int engine_time,
u_int authenticated);
Enginetime
search_enginetime_list(const u_char * engineID, u_int engineID_len);
int hash_engineID(const u_char * engineID, u_int engineID_len);
void dump_etimelist_entry(Enginetime e, int count);
void dump_etimelist(void);
void free_etimelist(void);
void free_enginetime(unsigned char *engineID, size_t engineID_len);
#ifdef __cplusplus
}
#endif
#endif /* _LCD_TIME_H */
PK ��FZ��a�� � data_list.hnu �[��� /* Portions of this file are subject to the following copyright(s). See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*/
/*
* Portions of this file are copyrighted by:
* Copyright � 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
/*
* @file netsnmp_data_list.h
*
* @addtogroup agent
* @addtogroup library *
*
* $Id$
*
* External definitions for functions and variables in netsnmp_data_list.c.
*
* @{
*/
#ifndef DATA_LIST_H
#define DATA_LIST_H
#ifdef __cplusplus
extern "C" {
#endif
#include <net-snmp/library/snmp_impl.h>
#include <net-snmp/library/tools.h>
typedef void (Netsnmp_Free_List_Data) (void *);
typedef int (Netsnmp_Save_List_Data) (char *buf, size_t buf_len, void *);
typedef void * (Netsnmp_Read_List_Data) (char *buf, size_t buf_len);
/** @struct netsnmp_data_list_s
* used to iterate through lists of data
*/
typedef struct netsnmp_data_list_s {
struct netsnmp_data_list_s *next;
char *name;
/** The pointer to the data passed on. */
void *data;
/** must know how to free netsnmp_data_list->data */
Netsnmp_Free_List_Data *free_func;
} netsnmp_data_list;
typedef struct netsnmp_data_list_saveinfo_s {
netsnmp_data_list **datalist;
const char *type;
const char *token;
Netsnmp_Save_List_Data *data_list_save_ptr;
Netsnmp_Read_List_Data *data_list_read_ptr;
Netsnmp_Free_List_Data *data_list_free_ptr;
} netsnmp_data_list_saveinfo;
NETSNMP_IMPORT
netsnmp_data_list *
netsnmp_create_data_list(const char *, void *, Netsnmp_Free_List_Data* );
void netsnmp_data_list_add_node(netsnmp_data_list **head,
netsnmp_data_list *node);
netsnmp_data_list *
netsnmp_data_list_add_data(netsnmp_data_list **head,
const char *name, void *data,
Netsnmp_Free_List_Data * beer);
NETSNMP_IMPORT
void *netsnmp_get_list_data(netsnmp_data_list *head,
const char *node);
NETSNMP_IMPORT
void netsnmp_free_list_data(netsnmp_data_list *head); /* single */
NETSNMP_IMPORT
void netsnmp_free_all_list_data(netsnmp_data_list *head); /* multiple */
NETSNMP_IMPORT
int netsnmp_remove_list_node(netsnmp_data_list **realhead,
const char *name);
NETSNMP_IMPORT
netsnmp_data_list *
netsnmp_get_list_node(netsnmp_data_list *head,
const char *name);
/** depreciated: use netsnmp_data_list_add_node() */
NETSNMP_IMPORT
void netsnmp_add_list_data(netsnmp_data_list **head,
netsnmp_data_list *node);
void
netsnmp_register_save_list(netsnmp_data_list **datalist,
const char *type, const char *token,
Netsnmp_Save_List_Data *data_list_save_ptr,
Netsnmp_Read_List_Data *data_list_read_ptr,
Netsnmp_Free_List_Data *data_list_free_ptr);
int
netsnmp_save_all_data(netsnmp_data_list *head,
const char *type, const char *token,
Netsnmp_Save_List_Data * data_list_save_ptr);
SNMPCallback netsnmp_save_all_data_callback;
void netsnmp_read_data_callback(const char *token, char *line);
void shutdown_data_list(void);
#ifdef __cplusplus
}
#endif
#endif
/** @} */
PK ��FZ̙�Ky y snmpIPv4BaseDomain.hnu �[��� /* IPV4 base transport support functions
*/
#ifndef SNMPIPV4BASE_H
#define SNMPIPV4BASE_H
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <net-snmp/library/snmp_transport.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Prototypes
*/
char *netsnmp_ipv4_fmtaddr(const char *prefix, netsnmp_transport *t,
const void *data, int len);
void netsnmp_ipv4_get_taddr(struct netsnmp_transport_s *t, void **addr,
size_t *addr_len);
int netsnmp_ipv4_ostring_to_sockaddr(struct sockaddr_in *sin,
const void *o, size_t o_len);
/*
* Convert a "traditional" peername into a sockaddr_in structure which is
* written to *addr_ Returns 1 if the conversion was successful, or 0 if it
* failed
*/
int netsnmp_sockaddr_in(struct sockaddr_in *addr, const char *peername,
int remote_port);
int netsnmp_sockaddr_in2(struct sockaddr_in *addr, const char *inpeername,
const char *default_target);
#ifdef __cplusplus
}
#endif
#endif /* SNMPIPV4BASE_H */
PK ��FZ�Ϥp� � scapi.hnu �[��� /*
* scapi.h
*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef _SCAPI_H
#define _SCAPI_H
#ifdef NETSNMP_USE_OPENSSL
#include <openssl/ossl_typ.h> /* EVP_MD */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Authentication/privacy transform bitlengths.
*/
#define SNMP_TRANS_AUTHLEN_HMACMD5 128
#define SNMP_TRANS_AUTHLEN_HMACSHA1 160
#define SNMP_TRANS_AUTHLEN_HMAC128SHA224 224 /* OPTIONAL */
#define SNMP_TRANS_AUTHLEN_HMAC192SHA256 256 /* MUST */
#define SNMP_TRANS_AUTHLEN_HMAC256SHA384 384 /* OPTIONAL */
#define SNMP_TRANS_AUTHLEN_HMAC384SHA512 512 /* SHOULD */
#define SNMP_TRANS_AUTHLEN_HMAC96 96
#define SNMP_TRANS_PRIVLEN_1DES 64
#define SNMP_TRANS_PRIVLEN_1DES_IV 64
#ifdef NETSNMP_DRAFT_REEDER_3DES
#define SNMP_TRANS_PRIVLEN_3DESEDE 256
#define SNMP_TRANS_PRIVLEN_3DESEDE_IV 64
#endif /* NETSNMP_DRAFT_REEDER_3DES */
#define SNMP_TRANS_PRIVLEN_AES 128
#define SNMP_TRANS_PRIVLEN_AES_IV 128
#define SNMP_TRANS_PRIVLEN_AES128 SNMP_TRANS_PRIVLEN_AES
#define SNMP_TRANS_PRIVLEN_AES128_IV SNMP_TRANS_PRIVLEN_AES_IV
#define SNMP_TRANS_PRIVLEN_AES192 192
#define SNMP_TRANS_PRIVLEN_AES192_IV 128 /* 192 */
#define SNMP_TRANS_PRIVLEN_AES256 256
#define SNMP_TRANS_PRIVLEN_AES256_IV 128 /* 256 */
typedef struct netsnmp_auth_alg_info_s {
int type;
const char * name;
oid * alg_oid;
int oid_len;
int proper_length;
int mac_length;
} netsnmp_auth_alg_info;
typedef struct netsnmp_priv_alg_info_s {
int type;
const char * name;
oid * alg_oid;
int oid_len;
int proper_length;
int iv_length;
int pad_size;
#ifdef NETSNMP_USE_OPENSSL
const EVP_CIPHER * cipher;
#endif
} netsnmp_priv_alg_info;
/*
* Prototypes.
*/
NETSNMP_IMPORT
int sc_get_authtype(const oid * hashoid, u_int hashoid_len);
NETSNMP_IMPORT
int sc_get_proper_auth_length_bytype(int auth_type);
NETSNMP_IMPORT
int sc_get_auth_maclen(int auth_type);
NETSNMP_IMPORT
const char* sc_get_auth_name(int auth_type);
NETSNMP_IMPORT
oid * sc_get_auth_oid(int auth_type, size_t *oid_len);
NETSNMP_IMPORT
netsnmp_auth_alg_info * sc_get_auth_alg_byoid(const oid *oid, u_int len);
NETSNMP_IMPORT
netsnmp_auth_alg_info * sc_get_auth_alg_bytype(u_int type);
NETSNMP_IMPORT
netsnmp_auth_alg_info * sc_get_auth_alg_byindex(u_int index);
/** deprectated, use
* sc_get_authtype() + sc_get_proper_auth_length_bytype() */
NETSNMP_IMPORT
int sc_get_properlength(const oid * hashtype,
u_int hashtype_len);
#ifdef NETSNMP_USE_OPENSSL
NETSNMP_IMPORT
const EVP_MD *sc_get_openssl_hashfn(int auth_type);
NETSNMP_IMPORT
const EVP_CIPHER *sc_get_openssl_privfn(int priv_type);
#endif
NETSNMP_IMPORT
int sc_get_privtype(const oid * privtype, u_int privtype_len);
NETSNMP_IMPORT
oid * sc_get_priv_oid(int type, size_t *oid_len);
NETSNMP_IMPORT
int sc_get_proper_priv_length(const oid * privtype,
u_int privtype_len);
NETSNMP_IMPORT
int sc_get_proper_priv_length_bytype(int privtype);
NETSNMP_IMPORT
netsnmp_priv_alg_info * sc_get_priv_alg_byoid(const oid *oid, u_int len);
NETSNMP_IMPORT
netsnmp_priv_alg_info * sc_get_priv_alg_bytype(u_int type);
NETSNMP_IMPORT
netsnmp_priv_alg_info * sc_get_priv_alg_byindex(u_int index);
NETSNMP_IMPORT
int sc_init(void);
NETSNMP_IMPORT
int sc_shutdown(int majorID, int minorID, void *serverarg,
void *clientarg);
NETSNMP_IMPORT
int sc_random(u_char * buf, size_t * buflen);
NETSNMP_IMPORT
int sc_generate_keyed_hash(const oid * authtype,
size_t authtypelen,
const u_char * key, u_int keylen,
const u_char * message, u_int msglen,
u_char * MAC, size_t * maclen);
NETSNMP_IMPORT
int sc_check_keyed_hash(const oid * authtype,
size_t authtypelen, const u_char * key,
u_int keylen, const u_char * message,
u_int msglen, const u_char * MAC,
u_int maclen);
NETSNMP_IMPORT
int sc_encrypt(const oid * privtype, size_t privtypelen,
u_char * key, u_int keylen,
u_char * iv, u_int ivlen,
const u_char * plaintext, u_int ptlen,
u_char * ciphertext, size_t * ctlen);
NETSNMP_IMPORT
int sc_decrypt(const oid * privtype, size_t privtypelen,
u_char * key, u_int keylen,
u_char * iv, u_int ivlen,
u_char * ciphertext, u_int ctlen,
u_char * plaintext, size_t * ptlen);
NETSNMP_IMPORT
int sc_hash_type(int auth_type, const u_char * buf,
size_t buf_len, u_char * MAC,
size_t * MAC_len);
NETSNMP_IMPORT
int sc_hash(const oid * hashtype, size_t hashtypelen,
const u_char * buf, size_t buf_len,
u_char * MAC, size_t * MAC_len);
NETSNMP_IMPORT
int sc_get_transform_type(oid * hashtype,
u_int hashtype_len,
int (**hash_fn) (const int mode,
void **context,
const u_char *
data,
const int
data_len,
u_char **
digest,
size_t *
digest_len));
/*
* All functions devolve to the following block if we can't do cryptography
*/
#define _SCAPI_NOT_CONFIGURED \
{ \
snmp_log(LOG_ERR, "Encryption support not enabled.\n"); \
DEBUGMSGTL(("scapi", "SCAPI not configured")); \
return SNMPERR_SC_NOT_CONFIGURED; \
}
/*
* define a transform type if we're using the internal md5 support
*/
#ifdef NETSNMP_USE_INTERNAL_MD5
#define INTERNAL_MD5 1
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SCAPI_H */
PK ��FZx��ߠ � snmp_enum.hnu �[��� #ifndef SNMP_ENUM_H
#define SNMP_ENUM_H
/*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct snmp_enum_list {
struct snmp_enum_list *next;
int value;
char *label;
};
#define SE_MAX_IDS 5
#define SE_MAX_SUBIDS 32 /* needs to be a multiple of 8 */
/*
* begin storage definitions
*/
/*
* These definitions correspond with the "storid" argument to the API
*/
#define SE_LIBRARY_ID 0
#define SE_MIB_ID 1
#define SE_APPLICATION_ID 2
#define SE_ASSIGNED_ID 3
/*
* library specific enum locations
*/
/*
* error codes
*/
#define SE_OK 0
#define SE_NOMEM 1
#define SE_ALREADY_THERE 2
#define SE_DNE -2
int init_snmp_enum(const char *type);
struct snmp_enum_list *se_find_list(unsigned int major,
unsigned int minor);
struct snmp_enum_list *se_find_slist(const char *listname);
int se_store_in_list(struct snmp_enum_list *,
unsigned int major, unsigned int minor);
int se_find_value(unsigned int major, unsigned int minor,
const char *label);
int se_find_free_value(unsigned int major, unsigned int minor);
char *se_find_label(unsigned int major, unsigned int minor,
int value);
/**
* Add the pair (label, value) to the list (major, minor). Transfers
* ownership of the memory pointed to by label to the list:
* clear_snmp_enum() deallocates that memory.
*/
int se_add_pair(unsigned int major, unsigned int minor,
char *label, int value);
/*
* finds a list of enums in a list of enum structs associated by a name.
*/
/*
* find a list, and then operate on that list
* ( direct methods further below if you already have the list pointer)
*/
NETSNMP_IMPORT
char *se_find_label_in_slist(const char *listname,
int value);
NETSNMP_IMPORT
int se_find_value_in_slist(const char *listname,
const char *label);
NETSNMP_IMPORT
int se_find_casevalue_in_slist(const char *listname,
const char *label);
int se_find_free_value_in_slist(const char *listname);
/**
* Add the pair (label, value) to the slist with name listname. Transfers
* ownership of the memory pointed to by label to the list:
* clear_snmp_enum() deallocates that memory.
*/
NETSNMP_IMPORT
int se_add_pair_to_slist(const char *listname, char *label,
int value);
/*
* operates directly on a possibly external list
*/
char *se_find_label_in_list(struct snmp_enum_list *list,
int value);
int se_find_value_in_list(struct snmp_enum_list *list,
const char *label);
int se_find_casevalue_in_list(struct snmp_enum_list *list,
const char *label);
int se_find_free_value_in_list(struct snmp_enum_list *list);
int se_add_pair_to_list(struct snmp_enum_list **list,
char *label, int value);
/*
* Persistent enumeration lists
*/
void se_store_enum_list(struct snmp_enum_list *new_list,
const char *token, const char *type);
void se_store_list(unsigned int major, unsigned int minor,
const char *type);
void se_clear_slist(const char *listname);
void se_store_slist(const char *listname, const char *type);
int se_store_slist_callback(int majorID, int minorID,
void *serverargs, void *clientargs);
void se_read_conf(const char *word, const char *cptr);
/**
* Deallocate the memory allocated by init_snmp_enum(): remove all key/value
* pairs stored by se_add_*() calls.
*/
NETSNMP_IMPORT
void clear_snmp_enum(void);
#ifdef __cplusplus
}
#endif
#endif /* SNMP_ENUM_H */
PK ��FZPkܠ snmpTCPIPv6Domain.hnu �[��� #ifndef _SNMPTCPIPV6DOMAIN_H
#define _SNMPTCPIPV6DOMAIN_H
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
config_require(IPv6Base)
config_require(SocketBase)
config_require(TCPBase)
#include <net-snmp/library/snmpIPv6BaseDomain.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The SNMP over TCP over IPv6 transport domain is identified by
* transportDomainTcpIpv4 as defined in RFC 3419.
*/
#define TRANSPORT_DOMAIN_TCP_IPV6 1,3,6,1,2,1,100,1,6
NETSNMP_IMPORT oid netsnmp_TCPIPv6Domain[];
netsnmp_transport *netsnmp_tcp6_transport(const struct sockaddr_in6 *addr,
int local);
/*
* "Constructor" for transport domain object.
*/
NETSNMP_IMPORT void netsnmp_tcpipv6_ctor(void);
#ifdef __cplusplus
}
#endif
#endif/*_SNMPTCPIPV6DOMAIN_H*/
PK ��FZ���nR R container_null.hnu �[��� #ifndef NETSNMP_CONTAINER_NULL_H
#define NETSNMP_CONTAINER_NULL_H
#include <net-snmp/library/container.h>
#ifdef __cplusplus
extern "C" {
#endif
netsnmp_container *netsnmp_container_get_null(void);
NETSNMP_IMPORT
void netsnmp_container_null_init(void);
#ifdef __cplusplus
}
#endif
#endif /** NETSNMP_CONTAINER_NULL_H */
PK ��FZ�+�&� � mt_support.hnu �[��� /*
* mt_support.h - multi-thread resource locking support declarations
*/
/*
* Author: Markku Laukkanen
* Created: 6-Sep-1999
* History:
* 8-Sep-1999 M. Slifcak method names changed;
* use array of resource locking structures.
*/
#ifndef MT_SUPPORT_H
#define MT_SUPPORT_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Lock group identifiers
*/
#define MT_LIBRARY_ID 0
#define MT_APPLICATION_ID 1
#define MT_TOKEN_ID 2
#define MT_MAX_IDS 3 /* one greater than last from above */
#define MT_MAX_SUBIDS 10
/*
* Lock resource identifiers for library resources
*/
#define MT_LIB_NONE 0
#define MT_LIB_SESSION 1
#define MT_LIB_REQUESTID 2
#define MT_LIB_MESSAGEID 3
#define MT_LIB_SESSIONID 4
#define MT_LIB_TRANSID 5
#define MT_LIB_MAXIMUM 6 /* must be one greater than the last one */
#if defined(NETSNMP_REENTRANT) || defined(WIN32)
#if HAVE_PTHREAD_H
#include <pthread.h>
typedef pthread_mutex_t mutex_type;
#ifdef pthread_mutexattr_default
#define MT_MUTEX_INIT_DEFAULT pthread_mutexattr_default
#else
#define MT_MUTEX_INIT_DEFAULT 0
#endif
#elif defined(WIN32) || defined(cygwin)
#include <windows.h>
typedef CRITICAL_SECTION mutex_type;
#else /* HAVE_PTHREAD_H */
error "There is no re-entrant support as defined."
#endif /* HAVE_PTHREAD_H */
NETSNMP_IMPORT
int snmp_res_init(void);
NETSNMP_IMPORT
int snmp_res_lock(int groupID, int resourceID);
NETSNMP_IMPORT
int snmp_res_unlock(int groupID, int resourceID);
NETSNMP_IMPORT
int snmp_res_destroy_mutex(int groupID, int resourceID);
#else /* NETSNMP_REENTRANT */
#ifndef WIN32
#define snmp_res_init() do {} while (0)
#define snmp_res_lock(x,y) do {} while (0)
#define snmp_res_unlock(x,y) do {} while (0)
#define snmp_res_destroy_mutex(x,y) do {} while (0)
#endif /* WIN32 */
#endif /* NETSNMP_REENTRANT */
#ifdef __cplusplus
}
#endif
#endif /* MT_SUPPORT_H */
PK ��FZ-Y,�S S snmpUnixDomain.hnu �[��� #ifndef _SNMPUNIXDOMAIN_H
#define _SNMPUNIXDOMAIN_H
#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
#if defined(cygwin) || defined(mingw32) || defined(mingw32msvc)
config_error(Unix domain protocol support unavailable for this platform)
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#include <net-snmp/library/snmp_transport.h>
config_require(SocketBase)
#ifdef __cplusplus
extern "C" {
#endif
/*
* The SNMP over local socket transport domain is identified by
* transportDomainLocal as defined in RFC 3419.
*/
#define TRANSPORT_DOMAIN_LOCAL 1,3,6,1,2,1,100,1,13
NETSNMP_IMPORT oid netsnmp_UnixDomain[];
netsnmp_transport *netsnmp_unix_transport(const struct sockaddr_un *addr,
int local);
void netsnmp_unix_agent_config_tokens_register(void);
void netsnmp_unix_parse_security(const char *token, char *param);
int netsnmp_unix_getSecName(void *opaque, int olength,
const char *community,
size_t community_len, const char **secName,
const char **contextName);
/*
* "Constructor" for transport domain object.
*/
void netsnmp_unix_ctor(void);
/*
* Support functions
*/
void netsnmp_unix_create_path_with_mode(int mode);
void netsnmp_unix_dont_create_path(void);
#ifdef __cplusplus
}
#endif
#else
#define netsnmp_unix_create_path_with_mode(x)
#define netsnmp_unix_dont_create_path()
#endif /*NETSNMP_TRANSPORT_UNIX_DOMAIN */
#endif/*_SNMPUNIXDOMAIN_H*/
PK ��FZ��% % snmpv3.hnu �[��� /*
* snmpv3.h
*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef SNMPV3_H
#define SNMPV3_H
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_ENGINEID_LENGTH 32 /* per SNMP-FRAMEWORK-MIB SnmpEngineID TC */
#define ENGINEID_TYPE_IPV4 1
#define ENGINEID_TYPE_IPV6 2
#define ENGINEID_TYPE_MACADDR 3
#define ENGINEID_TYPE_TEXT 4
#define ENGINEID_TYPE_EXACT 5
#define ENGINEID_TYPE_NETSNMP_RND 128
#define DEFAULT_NIC "eth0"
NETSNMP_IMPORT int
snmpv3_parse_args(char *optarg, netsnmp_session * session, char **Apsz,
char **Xpsz, int argc, char *const *argv, int flags);
NETSNMP_IMPORT
int setup_engineID(u_char ** eidp, const char *text);
NETSNMP_IMPORT
int set_exact_engineID(const u_char *id, size_t len);
void engineID_conf(const char *word, char *cptr);
void engineBoots_conf(const char *, char *);
void engineIDType_conf(const char *, char *);
void engineIDNic_conf(const char *, char *);
NETSNMP_IMPORT
void init_snmpv3(const char *);
int init_snmpv3_post_config(int majorid, int minorid,
void *serverarg,
void *clientarg);
int init_snmpv3_post_premib_config(int majorid,
int minorid,
void *serverarg,
void *clientarg);
void shutdown_snmpv3(const char *type);
int snmpv3_store(int majorID, int minorID, void *serverarg,
void *clientarg);
NETSNMP_IMPORT
u_long snmpv3_local_snmpEngineBoots(void);
int snmpv3_clone_engineID(u_char **, size_t *, u_char *,
size_t);
NETSNMP_IMPORT
size_t snmpv3_get_engineID(u_char * buf, size_t buflen);
NETSNMP_IMPORT
u_char *snmpv3_generate_engineID(size_t *);
NETSNMP_IMPORT
u_long snmpv3_local_snmpEngineTime(void);
int get_default_secLevel(void);
void snmpv3_set_engineBootsAndTime(int boots, int ttime);
int free_engineID(int majorid, int minorid, void *serverarg,
void *clientarg);
NETSNMP_IMPORT
int parse_secLevel_conf(const char* word, char *cptr);
NETSNMP_IMPORT int
snmpv3_parse_arg(int arg, char *optarg, netsnmp_session *session,
char **Apsz, char **Xpsz, int argc, char *const *argv,
int flags);
NETSNMP_IMPORT int
snmpv3_options(char *optarg, netsnmp_session * session, char **Apsz,
char **Xpsz, int argc, char *const *argv);
#ifdef __cplusplus
}
#endif
#endif /* SNMPV3_H */
PK ��FZr���� � container_iterator.hnu �[��� /**
* @file container_iterator.h
* @addtogroup container_iterator
* @{
*/
#ifndef _CONTAINER_ITERATOR_HANDLER_H_
#define _CONTAINER_ITERATOR_HANDLER_H_
#include "container.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (Netsnmp_Iterator_Loop_Key) (void *iterator_ctx,
netsnmp_ref_void* loop_ctx,
netsnmp_ref_void* key);
typedef int (Netsnmp_Iterator_Loop_Data)(void *iterator_ctx,
netsnmp_ref_void* loop_ctx,
netsnmp_ref_void* data);
typedef int (Netsnmp_Iterator_Ctx) (void *iterator_ctx,
netsnmp_ref_void* loop_ctx);
typedef int (Netsnmp_Iterator_Ctx_Dup) (void *iterator_ctx,
netsnmp_ref_void* loop_ctx,
netsnmp_ref_void* dup_ctx,
int reuse);
typedef int (Netsnmp_Iterator_Op) (void *iterator_ctx);
typedef int (Netsnmp_Iterator_Data) (void *iterator_ctx,
const void *data);
void netsnmp_container_iterator_init(void);
netsnmp_container* netsnmp_container_iterator_get(
void *iterator_user_ctx,
netsnmp_container_compare * compare,
Netsnmp_Iterator_Loop_Key * get_first,
Netsnmp_Iterator_Loop_Key * get_next,
Netsnmp_Iterator_Loop_Data * get_data,
Netsnmp_Iterator_Ctx_Dup * save_pos, /* iff returning static data */
Netsnmp_Iterator_Ctx * init_loop_ctx,
Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
Netsnmp_Iterator_Data * free_user_ctx,
int sorted);
/*
* set up optional callbacks/
* NOTE: even though the first parameter is a generic netsnmp_container,
* this function should only be called for a container created
* by netsnmp_container_iterator_get.
*/
void
netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
Netsnmp_Iterator_Data * insert_data,
Netsnmp_Iterator_Data * remove_data,
Netsnmp_Iterator_Op * get_size);
#ifdef __cplusplus
}
#endif
#endif /* _CONTAINER_ITERATOR_HANDLER_H_ */
/** @} */
PK ��FZ�يs, ,
snmp_secmod.hnu �[��� #ifndef SNMPSECMOD_H
#define SNMPSECMOD_H
#ifdef __cplusplus
extern "C" {
#endif
#include <net-snmp/library/snmp_transport.h>
/* Locally defined security models.
* (Net-SNMP enterprise number = 8072)*256 + local_num
*/
#define NETSNMP_SEC_MODEL_KSM 2066432
#define NETSNMP_KSM_SECURITY_MODEL NETSNMP_SEC_MODEL_KSM
#define NETSNMP_TSM_SECURITY_MODEL SNMP_SEC_MODEL_TSM
struct snmp_secmod_def;
/*
* parameter information passed to security model routines
*/
struct snmp_secmod_outgoing_params {
int msgProcModel;
u_char *globalData;
size_t globalDataLen;
int maxMsgSize;
int secModel;
u_char *secEngineID;
size_t secEngineIDLen;
char *secName;
size_t secNameLen;
int secLevel;
u_char *scopedPdu;
size_t scopedPduLen;
void *secStateRef;
u_char *secParams;
size_t *secParamsLen;
u_char **wholeMsg;
size_t *wholeMsgLen;
size_t *wholeMsgOffset;
netsnmp_pdu *pdu; /* IN - the pdu getting encoded */
netsnmp_session *session; /* IN - session sending the message */
};
struct snmp_secmod_incoming_params {
int msgProcModel; /* IN */
size_t maxMsgSize; /* IN - Used to calc maxSizeResponse. */
u_char *secParams; /* IN - BER encoded securityParameters. */
int secModel; /* IN */
int secLevel; /* IN - AuthNoPriv; authPriv etc. */
u_char *wholeMsg; /* IN - Original v3 message. */
size_t wholeMsgLen; /* IN - Msg length. */
u_char *secEngineID; /* OUT - Pointer snmpEngineID. */
size_t *secEngineIDLen; /* IN/OUT - Len available; len returned. */
/*
* NOTE: Memory provided by caller.
*/
char *secName; /* OUT - Pointer to securityName. */
size_t *secNameLen; /* IN/OUT - Len available; len returned. */
u_char **scopedPdu; /* OUT - Pointer to plaintext scopedPdu. */
size_t *scopedPduLen; /* IN/OUT - Len available; len returned. */
size_t *maxSizeResponse; /* OUT - Max size of Response PDU. */
void **secStateRef; /* OUT - Ref to security state. */
netsnmp_session *sess; /* IN - session which got the message */
netsnmp_pdu *pdu; /* IN - the pdu getting parsed */
u_char msg_flags; /* IN - v3 Message flags. */
};
/*
* function pointers:
*/
/*
* free's a given security module's data; called at unregistration time
*/
typedef int (SecmodSessionCallback) (netsnmp_session *);
typedef int (SecmodPduCallback) (netsnmp_pdu *);
typedef int (Secmod2PduCallback) (netsnmp_pdu *, netsnmp_pdu *);
typedef int (SecmodOutMsg) (struct snmp_secmod_outgoing_params *);
typedef int (SecmodInMsg) (struct snmp_secmod_incoming_params *);
typedef void (SecmodFreeState) (void *);
typedef void (SecmodHandleReport) (void *sessp,
netsnmp_transport *transport,
netsnmp_session *,
int result,
netsnmp_pdu *origpdu);
typedef int (SecmodDiscoveryMethod) (void *slp, netsnmp_session *session);
typedef int (SecmodPostDiscovery) (void *slp, netsnmp_session *session);
typedef int (SecmodSessionSetup) (netsnmp_session *in_session,
netsnmp_session *out_session);
/*
* definition of a security module
*/
/*
* all of these callback functions except the encoding and decoding
* routines are optional. The rest of them are available if need.
*/
struct snmp_secmod_def {
/*
* session maniplation functions
*/
SecmodSessionCallback *session_open; /* called in snmp_sess_open() */
SecmodSessionCallback *session_close; /* called in snmp_sess_close() */
SecmodSessionSetup *session_setup;
/*
* pdu manipulation routines
*/
SecmodPduCallback *pdu_free; /* called in free_pdu() */
Secmod2PduCallback *pdu_clone; /* called in snmp_clone_pdu() */
SecmodPduCallback *pdu_timeout; /* called when request timesout */
SecmodFreeState *pdu_free_state_ref; /* frees pdu->securityStateRef */
/*
* de/encoding routines: mandatory
*/
SecmodOutMsg *encode_reverse; /* encode packet back to front */
SecmodOutMsg *encode_forward; /* encode packet forward */
SecmodInMsg *decode; /* decode & validate incoming */
/*
* error and report handling
*/
SecmodHandleReport *handle_report;
/*
* default engineID discovery mechanism
*/
SecmodDiscoveryMethod *probe_engineid;
SecmodPostDiscovery *post_probe_engineid;
};
/*
* internal list
*/
struct snmp_secmod_list {
int securityModel;
struct snmp_secmod_def *secDef;
struct snmp_secmod_list *next;
};
/*
* register a security service
*/
int register_sec_mod(int, const char *,
struct snmp_secmod_def *);
/*
* find a security service definition
*/
NETSNMP_IMPORT
struct snmp_secmod_def *find_sec_mod(int);
/*
* register a security service
*/
int unregister_sec_mod(int); /* register a security service */
void init_secmod(void);
NETSNMP_IMPORT
void shutdown_secmod(void);
/*
* clears the sec_mod list
*/
NETSNMP_IMPORT
void clear_sec_mod(void);
#ifdef __cplusplus
}
#endif
#endif /* SNMPSECMOD_H */
PK ��FZ�`~G G snmpIPv6BaseDomain.hnu �[��� /* IPV6 base transport support functions
*/
#ifndef SNMPIPV6BASE_H
#define SNMPIPV6BASE_H
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <net-snmp/library/snmp_transport.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Prototypes
*/
NETSNMP_IMPORT
char *netsnmp_ipv6_fmtaddr(const char *prefix, netsnmp_transport *t,
const void *data, int len);
NETSNMP_IMPORT
void netsnmp_ipv6_get_taddr(struct netsnmp_transport_s *t, void **addr,
size_t *addr_len);
NETSNMP_IMPORT
int netsnmp_ipv6_ostring_to_sockaddr(struct sockaddr_in6 *sin6,
const void *o, size_t o_len);
NETSNMP_IMPORT
int netsnmp_sockaddr_in6_2(struct sockaddr_in6 *addr,
const char *inpeername,
const char *default_target);
int netsnmp_sockaddr_in6(struct sockaddr_in6 *addr,
const char *inpeername, int remote_port);
#ifdef __cplusplus
}
#endif
#endif /* SNMPIPV6BASE_H */
PK ��FZ|7�% �% vacm.hnu �[��� /*
* vacm.h
*
* SNMPv3 View-based Access Control Model
*
* Portions of this file are subject to the following copyright(s). See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*
* Portions of this file are copyrighted by:
* Copyright (c) 2016 VMware, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef VACM_H
#define VACM_H
#ifdef __cplusplus
extern "C" {
#endif
#define VACM_SUCCESS 0
#define VACM_NOSECNAME 1
#define VACM_NOGROUP 2
#define VACM_NOACCESS 3
#define VACM_NOVIEW 4
#define VACM_NOTINVIEW 5
#define VACM_NOSUCHCONTEXT 6
#define VACM_SUBTREE_UNKNOWN 7
#define SECURITYMODEL 1
#define SECURITYNAME 2
#define SECURITYGROUP 3
#define SECURITYSTORAGE 4
#define SECURITYSTATUS 5
#define ACCESSPREFIX 1
#define ACCESSMODEL 2
#define ACCESSLEVEL 3
#define ACCESSMATCH 4
#define ACCESSREAD 5
#define ACCESSWRITE 6
#define ACCESSNOTIFY 7
#define ACCESSSTORAGE 8
#define ACCESSSTATUS 9
#define VACMVIEWSPINLOCK 1
#define VIEWNAME 2
#define VIEWSUBTREE 3
#define VIEWMASK 4
#define VIEWTYPE 5
#define VIEWSTORAGE 6
#define VACMVIEWSTATUS 7
#define VACM_MAX_STRING 32
#define VACMSTRINGLEN 34 /* VACM_MAX_STRING + 2 */
struct vacm_groupEntry {
int securityModel;
char securityName[VACMSTRINGLEN];
char groupName[VACMSTRINGLEN];
int storageType;
int status;
u_long bitMask;
struct vacm_groupEntry *reserved;
struct vacm_groupEntry *next;
};
#define CONTEXT_MATCH_EXACT 1
#define CONTEXT_MATCH_PREFIX 2
/* VIEW ENUMS ---------------------------------------- */
/* SNMPD usage: get/set/send-notification views */
#define VACM_VIEW_READ 0
#define VACM_VIEW_WRITE 1
#define VACM_VIEW_NOTIFY 2
/* SNMPTRAPD usage: log execute and net-access (forward) usage */
#define VACM_VIEW_LOG 3
#define VACM_VIEW_EXECUTE 4
#define VACM_VIEW_NET 5
/* VIEW BIT MASK VALUES-------------------------------- */
/* SNMPD usage: get/set/send-notification views */
#define VACM_VIEW_READ_BIT (1 << VACM_VIEW_READ)
#define VACM_VIEW_WRITE_BIT (1 << VACM_VIEW_WRITE)
#define VACM_VIEW_NOTIFY_BIT (1 << VACM_VIEW_NOTIFY)
/* SNMPTRAPD usage: log execute and net-access (forward) usage */
#define VACM_VIEW_LOG_BIT (1 << VACM_VIEW_LOG)
#define VACM_VIEW_EXECUTE_BIT (1 << VACM_VIEW_EXECUTE)
#define VACM_VIEW_NET_BIT (1 << VACM_VIEW_NET)
#define VACM_VIEW_NO_BITS 0
/* Maximum number of views in the view array */
#define VACM_MAX_VIEWS 8
#define VACM_VIEW_ENUM_NAME "vacmviews"
void init_vacm(void);
struct vacm_accessEntry {
char groupName[VACMSTRINGLEN];
char contextPrefix[VACMSTRINGLEN];
int securityModel;
int securityLevel;
int contextMatch;
char views[VACM_MAX_VIEWS][VACMSTRINGLEN];
int storageType;
int status;
u_long bitMask;
struct vacm_accessEntry *reserved;
struct vacm_accessEntry *next;
};
struct vacm_viewEntry {
char viewName[VACMSTRINGLEN];
oid viewSubtree[MAX_OID_LEN+1]; /* keep len in [0] */
size_t viewSubtreeLen;
u_char viewMask[VACMSTRINGLEN];
size_t viewMaskLen;
int viewType;
int viewStorageType;
int viewStatus;
u_long bitMask;
struct vacm_viewEntry *reserved;
struct vacm_viewEntry *next;
};
NETSNMP_IMPORT
void vacm_destroyViewEntry(const char *, oid *, size_t);
NETSNMP_IMPORT
void vacm_destroyAllViewEntries(void);
#define VACM_MODE_FIND 0
#define VACM_MODE_IGNORE_MASK 1
#define VACM_MODE_CHECK_SUBTREE 2
NETSNMP_IMPORT
struct vacm_viewEntry *vacm_getViewEntry(const char *, oid *, size_t,
int);
/*
* Returns a pointer to the viewEntry with the
* same viewName and viewSubtree
* Returns NULL if that entry does not exist.
*/
NETSNMP_IMPORT
int vacm_checkSubtree(const char *, oid *, size_t);
/*
* Check to see if everything within a subtree is in view, not in view,
* or possibly both.
*
* Returns:
* VACM_SUCCESS The OID is included in the view.
* VACM_NOTINVIEW If no entry in the view list includes the
* provided OID, or the OID is explicitly excluded
* from the view.
* VACM_SUBTREE_UNKNOWN The entire subtree has both allowed and
* disallowed portions.
*/
NETSNMP_IMPORT
void
vacm_scanViewInit(void);
/*
* Initialized the scan routines so that they will begin at the
* beginning of the list of viewEntries.
*
*/
NETSNMP_IMPORT
struct vacm_viewEntry *vacm_scanViewNext(void);
/*
* Returns a pointer to the next viewEntry.
* These entries are returned in no particular order,
* but if N entries exist, N calls to view_scanNext() will
* return all N entries once.
* Returns NULL if all entries have been returned.
* view_scanInit() starts the scan over.
*/
NETSNMP_IMPORT
struct vacm_viewEntry *vacm_createViewEntry(const char *, oid *,
size_t);
/*
* Creates a viewEntry with the given index
* and returns a pointer to it.
* The status of this entry is created as invalid.
*/
NETSNMP_IMPORT
void vacm_destroyGroupEntry(int, const char *);
NETSNMP_IMPORT
void vacm_destroyAllGroupEntries(void);
NETSNMP_IMPORT
struct vacm_groupEntry *vacm_createGroupEntry(int, const char *);
NETSNMP_IMPORT
struct vacm_groupEntry *vacm_getGroupEntry(int, const char *);
NETSNMP_IMPORT
void vacm_scanGroupInit(void);
NETSNMP_IMPORT
struct vacm_groupEntry *vacm_scanGroupNext(void);
NETSNMP_IMPORT
void vacm_destroyAccessEntry(const char *, const char *,
int, int);
NETSNMP_IMPORT
void vacm_destroyAllAccessEntries(void);
NETSNMP_IMPORT
struct vacm_accessEntry *vacm_createAccessEntry(const char *,
const char *, int,
int);
NETSNMP_IMPORT
struct vacm_accessEntry *vacm_getAccessEntry(const char *,
const char *, int, int);
NETSNMP_IMPORT
void vacm_scanAccessInit(void);
NETSNMP_IMPORT
struct vacm_accessEntry *vacm_scanAccessNext(void);
void vacm_destroySecurityEntry(const char *);
struct vacm_securityEntry *vacm_createSecurityEntry(const char *);
struct vacm_securityEntry *vacm_getSecurityEntry(const char *);
void vacm_scanSecurityInit(void);
struct vacm_securityEntry *vacm_scanSecurityEntry(void);
NETSNMP_IMPORT
int vacm_is_configured(void);
void vacm_save(const char *token, const char *type);
void vacm_save_view(struct vacm_viewEntry *view,
const char *token, const char *type);
void vacm_save_access(struct vacm_accessEntry *access_entry,
const char *token, const char *type);
void vacm_save_auth_access(struct vacm_accessEntry *access_entry,
const char *token, const char *type, int authtype);
void vacm_save_group(struct vacm_groupEntry *group_entry,
const char *token, const char *type);
NETSNMP_IMPORT
void vacm_parse_config_view(const char *token, const char *line);
NETSNMP_IMPORT
void vacm_parse_config_group(const char *token,
const char *line);
NETSNMP_IMPORT
void vacm_parse_config_access(const char *token,
const char *line);
NETSNMP_IMPORT
void vacm_parse_config_auth_access(const char *token,
const char *line);
NETSNMP_IMPORT
int store_vacm(int majorID, int minorID, void *serverarg,
void *clientarg);
NETSNMP_IMPORT
struct vacm_viewEntry *netsnmp_view_get(struct vacm_viewEntry *head,
const char *viewName,
oid * viewSubtree,
size_t viewSubtreeLen, int mode);
NETSNMP_IMPORT
int netsnmp_vacm_simple_usm_add(const char *user, int rw, int authLevel,
const char *view, oid *oidView,
size_t oidViewLen, const char *context);
NETSNMP_IMPORT
int netsnmp_vacm_simple_usm_del(const char *user, int authLevel,
const char *view, oid *oidView,
size_t oidViewLen, const char *context);
#ifdef __cplusplus
}
#endif
#endif /* VACM_H */
PK ��FZ��*�� � system.hnu �[��� #ifndef SNMP_SYSTEM_H
#define SNMP_SYSTEM_H
#ifndef NET_SNMP_CONFIG_H
#error "Please include <net-snmp/net-snmp-config.h> before this file"
#endif
#include <stdarg.h> /* va_list */
#ifdef __cplusplus
extern "C" {
#endif
/* Portions of this file are subject to the following copyrights. See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*/
/***********************************************************
Copyright 1993 by Carnegie Mellon University
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of CMU not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/*
* portions Copyright � 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
/*
* function to create a daemon. Will fork and call setsid().
*
* Returns: -1 : fork failed
* 0 : No errors
*/
NETSNMP_IMPORT
int netsnmp_daemonize(int quit_immediately, int stderr_log);
/*
* Definitions for the system dependent library file
*
* Do not define 'struct direct' when MSVC_PERL is defined because a
* structure with that name is also defined in the Perl header
* lib\CORE\dirent.h. Do not declare gettimeofday() either.
*/
#ifndef MSVC_PERL
#ifndef HAVE_READDIR
/*
* structure of a directory entry
*/
typedef struct direct {
long d_ino; /* inode number (not used by MS-DOS) */
int d_namlen; /* Name length */
char d_name[257]; /* file name */
} _DIRECT;
/*
* structure for dir operations
*/
typedef struct _dir_struc {
char *start; /* Starting position */
char *curr; /* Current position */
long size; /* Size of string table */
long nfiles; /* number if filenames in table */
struct direct dirstr; /* Directory structure to return */
} DIR;
NETSNMP_IMPORT
DIR *opendir(const char *filename);
NETSNMP_IMPORT
struct direct *readdir(DIR * dirp);
NETSNMP_IMPORT
int closedir(DIR * dirp);
#endif /* HAVE_READDIR */
#ifndef HAVE_GETTIMEOFDAY
NETSNMP_IMPORT
int gettimeofday(struct timeval *, struct timezone *tz);
#endif
#endif /* MSVC_PERL */
/*
* Note: when compiling Net-SNMP with dmalloc enabled on a system without
* strcasecmp() or strncasecmp(), the macro HAVE_STRNCASECMP is
* not defined but strcasecmp() and strncasecmp() are defined as macros in
* <dmalloc.h>. In order to prevent a compilation error, do not declare
* strcasecmp() or strncasecmp() when the <dmalloc.h> header has been included.
*/
#if !defined(HAVE_STRNCASECMP) && !defined(strcasecmp)
NETSNMP_IMPORT
int strcasecmp(const char *s1, const char *s2);
#endif
#if !defined(HAVE_STRNCASECMP) && !defined(strncasecmp)
NETSNMP_IMPORT
int strncasecmp(const char *s1, const char *s2, size_t n);
#endif
#ifdef WIN32
NETSNMP_IMPORT
char *winsock_startup(void);
NETSNMP_IMPORT
void winsock_cleanup(void);
#define SOCK_STARTUP winsock_startup()
#define SOCK_CLEANUP winsock_cleanup()
#else /* !WIN32 */
#define SOCK_STARTUP
#define SOCK_CLEANUP
#endif /* WIN32 */
#include <net-snmp/types.h> /* For definition of in_addr_t */
/* Simply resolve a hostname and return first IPv4 address.
* Returns -1 on error */
NETSNMP_IMPORT
int netsnmp_gethostbyname_v4(const char* name,
in_addr_t *addr_out);
/** netsnmp versions of dns resoloution.. may include DNSSEC validation. */
struct addrinfo; /* forward declare */
NETSNMP_IMPORT
struct hostent *netsnmp_gethostbyname(const char *name);
NETSNMP_IMPORT
struct hostent *netsnmp_gethostbyaddr(const void *addr, socklen_t len,
int type);
NETSNMP_IMPORT
int netsnmp_getaddrinfo(const char *name, const char *service,
const struct addrinfo *hints,
struct addrinfo **res);
NETSNMP_IMPORT
in_addr_t get_myaddr(void);
NETSNMP_IMPORT
long get_uptime(void);
#ifndef HAVE_STRDUP
char *strdup(const char *);
#endif
#ifndef HAVE_SETENV
NETSNMP_IMPORT
int setenv(const char *, const char *, int);
#endif
NETSNMP_IMPORT
int calculate_time_diff(const struct timeval *,
const struct timeval *);
NETSNMP_IMPORT
u_int calculate_sectime_diff(const struct timeval *now,
const struct timeval *then);
#ifndef HAVE_STRCASESTR
char *strcasestr(const char *, const char *);
#endif
#ifndef HAVE_STRTOL
long strtol(const char *, char **, int);
#endif
#ifndef HAVE_STRTOUL
unsigned long strtoul(const char *, char **, int);
#endif
#ifndef HAVE_STRTOULL
NETSNMP_IMPORT uint64_t strtoull(const char *, char **, int);
#endif
#ifndef HAVE_STRTOK_R
NETSNMP_IMPORT
char *strtok_r(char *, const char *, char **);
#endif
#ifndef HAVE_SNPRINTF
int snprintf(char *, size_t, const char *, ...);
#endif
#ifndef HAVE_ASPRINTF
NETSNMP_IMPORT
int vasprintf(char **strp, const char *fmt, va_list ap);
NETSNMP_IMPORT
int asprintf(char **strp, const char *fmt, ...);
#endif
NETSNMP_IMPORT
int mkdirhier(const char *pathname, mode_t mode,
int skiplast);
NETSNMP_IMPORT
const char *netsnmp_mktemp(void);
#ifndef HAVE_STRLCPY
NETSNMP_IMPORT
size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCAT
NETSNMP_IMPORT
size_t strlcat(char *, const char *, size_t);
#endif
int netsnmp_os_prematch(const char *ospmname,
const char *ospmrelprefix);
int netsnmp_os_kernel_width(void);
NETSNMP_IMPORT
int netsnmp_str_to_uid(const char *useroruid);
NETSNMP_IMPORT
int netsnmp_str_to_gid(const char *grouporgid);
#ifdef __cplusplus
}
#endif
#endif /* SNMP_SYSTEM_H */
PK ��FZ�v� � oid_stash.hnu �[��� #ifndef OID_STASH_H
#define OID_STASH_H
/*
* designed to store/retrieve information associated with a given oid.
* Storage is done in an efficient tree manner for fast lookups.
*/
#define OID_STASH_CHILDREN_SIZE 31
#ifdef __cplusplus
extern "C" {
#endif
struct netsnmp_oid_stash_node_s;
/* args: buffer, sizeof(buffer), yourdata, stashnode */
typedef int (NetSNMPStashDump) (char *, size_t,
void *,
struct netsnmp_oid_stash_node_s *);
typedef void (NetSNMPStashFreeNode) (void *);
typedef struct netsnmp_oid_stash_node_s {
oid value;
struct netsnmp_oid_stash_node_s **children; /* array of children */
size_t children_size;
struct netsnmp_oid_stash_node_s *next_sibling; /* cache too small links */
struct netsnmp_oid_stash_node_s *prev_sibling;
struct netsnmp_oid_stash_node_s *parent;
void *thedata;
} netsnmp_oid_stash_node;
typedef struct netsnmp_oid_stash_save_info_s {
const char *token;
netsnmp_oid_stash_node **root;
NetSNMPStashDump *dumpfn;
} netsnmp_oid_stash_save_info;
NETSNMP_IMPORT
int netsnmp_oid_stash_add_data(netsnmp_oid_stash_node **root,
const oid * lookup,
size_t lookup_len,
void *mydata);
SNMPCallback netsnmp_oid_stash_store_all;
netsnmp_oid_stash_node
*netsnmp_oid_stash_get_node(netsnmp_oid_stash_node *root,
const oid * lookup, size_t lookup_len);
NETSNMP_IMPORT
void *netsnmp_oid_stash_get_data(netsnmp_oid_stash_node *root,
const oid * lookup,
size_t lookup_len);
NETSNMP_IMPORT
netsnmp_oid_stash_node *
netsnmp_oid_stash_getnext_node(netsnmp_oid_stash_node *root,
oid * lookup, size_t lookup_len);
netsnmp_oid_stash_node *netsnmp_oid_stash_create_sized_node(size_t
mysize);
netsnmp_oid_stash_node *netsnmp_oid_stash_create_node(void); /* returns a malloced node */
void netsnmp_oid_stash_store(netsnmp_oid_stash_node *root,
const char *tokenname,
NetSNMPStashDump *dumpfn,
oid *curoid, size_t curoid_len);
/* frees all data in the stash and cleans it out. Sets root = NULL */
NETSNMP_IMPORT
void netsnmp_oid_stash_free(netsnmp_oid_stash_node **root,
NetSNMPStashFreeNode *freefn);
/* a noop function that can be passed to netsnmp_oid_stash_node to
NOT free the data */
NetSNMPStashFreeNode netsnmp_oid_stash_no_free;
#ifdef __cplusplus
}
#endif
#endif /* OID_STASH_H */
PK ��FZ-�� dir_utils.hnu �[��� /* Portions of this file are subject to the following copyright(s). See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*/
/*
* Portions of this file are copyrighted by:
* Copyright (C) 2007 Apple, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef NETSNMP_DIR_UTILS_H
#define NETSNMP_DIR_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* filter function; return 1 to include file, 0 to exclude
*/
#define NETSNMP_DIR_EXCLUDE 0
#define NETSNMP_DIR_INCLUDE 1
typedef int (netsnmp_directory_filter)(const void *text, void *ctx);
/*------------------------------------------------------------------
*
* Prototypes
*/
netsnmp_container *
netsnmp_directory_container_read_some(netsnmp_container *user_container,
const char *dirname,
netsnmp_directory_filter *filter,
void *filter_ctx, u_int flags);
#define netsnmp_directory_container_read(c,d,f) \
netsnmp_directory_container_read_some(c,d,NULL,NULL,f);
void netsnmp_directory_container_free(netsnmp_container *c);
/*------------------------------------------------------------------
*
* flags
*/
#define NETSNMP_DIR_RECURSE 0x0001
#define NETSNMP_DIR_RELATIVE_PATH 0x0002
#define NETSNMP_DIR_SORTED 0x0004
/** don't return null if dir empty */
#define NETSNMP_DIR_EMPTY_OK 0x0008
/** store netsnmp_file instead of filenames */
#define NETSNMP_DIR_NSFILE 0x0010
/** load stats in netsnmp_file */
#define NETSNMP_DIR_NSFILE_STATS 0x0020
/** allow files to be indexed more than once */
#define NETSNMP_DIR_ALLOW_DUPLICATES 0x0040
#ifdef __cplusplus
}
#endif
#endif /* NETSNMP_DIR_UTILS_H */
PK ��FZ����"