original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,599 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/agentx.h,v 1.9 2002/05/30 17:24:54 andre Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1994-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: agentx.h,v $
* Revision 1.9 2002/05/30 17:24:54 andre
* Add placeholder definition for AX_RESPONSE_PREPROCESS
*
* Revision 1.8 2002/04/09 14:18:35 tneale
* REGLIST changes to handle list-based registration
*
* Revision 1.7 2002/03/28 14:37:07 tneale
* Removed externs of old mib variables
*
* Revision 1.6 2002/03/20 20:20:41 tneale
* Fixed multiple definition of ENVOY_AX_PARSE_ERROR
*
* Revision 1.5 2002/03/19 21:47:01 tneale
* Changed Agentx protocol error codes per RFC2741
*
* Revision 1.4 2002/03/18 16:05:43 tneale
* Added cmonnect_id member to Session structure
*
* Revision 1.3 2002/03/12 15:54:39 tneale
* Added structure definition for the registration list
*
* Revision 1.2 2001/11/06 21:35:00 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.6.4.1 2001/08/17 20:38:43 meister
* Added prototypes for some agentx helper functions which were previously
* declared statically. Added prototypes for agentx and v3 dynamic config init
* functions.
*
* Revision 9.6 2001/01/19 22:22:02 paul
* Update copyright.
*
* Revision 9.5 2000/03/17 19:48:27 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:32 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 16:53:16 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 1999/12/23 14:47:26 josh
* cleaning up code per Shawn's comments -- removing extraneous
* comments and doing proxy check before notify check
*
* Revision 9.1 1999/03/30 15:20:13 josh
* feature to allow customer-driven context conversion into AgentX
*
* Revision 9.0 1998/10/16 22:10:03 sar
* Update version stamp to match release
*
* Revision 8.2 1998/08/12 04:52:15 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 8.1 1998/02/25 04:50:19 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:19 sar
* Updated revision to 8.0
*
* Revision 7.4 1997/10/30 04:23:16 sar
* Update type information mostly convert bits16_ts to ALENGTH_Ts
* also add MAX_ALENGTH
*
* Revision 7.3 1997/10/29 04:11:40 sar
* Cleaned up some type mismatches to keep compilers happy
*
* Revision 7.2 1997/10/21 02:53:37 sar
* Added defines for transport types and index allocate and deallocate macros
* and removed leaf decrement function
*
* Revision 7.1 1997/10/16 00:25:16 sar
* Primarily this set of modifications is for the agentx protocol.
* Most of the work was in the agentx.h and ax_mth.h files. Most
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
* to their structures and snmp got some new lock macros.
*
* One other change of note was the modification of continue
* processing. Previously we called a specific continue routine
* directly, now we store a pointer to the corret continue
* function in the snmp packet structure and call that. We include
* macros for backwards compatibility.
*
*/
/* [clearcase]
modification history
-------------------
01b,19apr05,job update copyright notices
01a,04aug04,job dropped connection handling
*/
#if (!defined(envoy_agentx_inc))
#define envoy_agentx_inc
#ifdef __cplusplus
extern"C" {
#endif
#include <wrn/wm/snmp/engine/asn1conf.h>
#include <wrn/wm/snmp/engine/asn1.h>
#include <wrn/wm/snmp/engine/buffer.h>
#include <wrn/wm/snmp/engine/vbdefs.h>
#include <wrn/wm/snmp/engine/etimer.h>
#include <wrn/wm/snmp/engine/tree.h>
/*extern struct ENVOY_AX_PKT_S;
extern struct SNMP_PKT_S;*/
typedef void ENVOY_AX_ADMIN_T (ptr_t, ptr_t);
typedef int ENVOY_AX_SEND_T (ptr_t, ptr_t, ptr_t, ALENGTH_T);
typedef void ENVOY_AX_ERROR_T (ptr_t, int);
typedef void ENVOY_AX_ADD_T (ptr_t);
#define ENVOY_AX_MASTER_PORT 705
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* Define a chunk block for agentx, this is used by the byte_handler
code to save and build a packet when it arrives in chunks rather
than all at once */
typedef struct ENVOY_AX_CHUNK_S
{
EBUFFER_T chunk;
} ENVOY_AX_CHUNK_T;
/* Define a state block for the sub agent, primarily this will
be useful if you want to have multiple sub agents in the same
process space */
typedef struct ENVOY_AX_SA_SB_S
{
struct ENVOY_AX_PKT_S *set_list; /* list of outstanding set requests */
struct ENVOY_AX_PKT_S *gnb_list; /* list of deferred gnb requests */
bits32_t readers; /* number of outstanding gnb reqs */
ENVOY_TIMER_T ager; /* timer block for aging pkts */
ENVOY_TIMER_T defer; /* timer block for deferring pkts */
bits32_t flags; /* currently only if the timer has
been set */
#if INSTALL_ENVOY_SNMP_LOCK
ENVOY_LOCK_T list_lock; /* lock for manipulating this struct
and the structs on the two lists */
ENVOY_LOCK_T coarse_lock; /* lock for manipulating the mib db */
#endif
} ENVOY_AX_SA_SB_T;
/* Define the agentx structure */
typedef struct ENVOY_AX_PKT_S
{
bits8_t version; /* The agentx protocol version */
bits8_t type; /* The agentx pdu type, see below */
bits8_t flags; /* Agentx flags, also see below */
bits32_t session_id; /* session id between mast & sub */
bits32_t transaction_id; /* groups agentx pkts to snmp pkts */
bits32_t packet_id; /* associates response pkts to reqs */
EBUFFER_T context; /* context, optional, see flags */
ENVOY_AX_SEND_T *send; /* io completion routine */
ENVOY_AX_ERROR_T *error; /* error completion routine */
ptr_t cookie; /* cookie for comp routines */
struct SNMP_PKT_S *pktp; /* snmp packet we've turned this agentx
request into for processing */
ENVOY_AX_SA_SB_T *sasb; /* pointer to the state block for
this sub agent */
struct ENVOY_AX_PKT_S *next; /* next pointer for lists */
bits32_t ts; /* timestamp for aging pkts */
bits32_t sysuptime; /* these 3 are only used in */
bits16_t error_stat; /* responses */
bits16_t error_index;
union { /* pdu data, one of the following */
bits8_t reason; /* enum for reason for closing */
struct { /* used for opens, add caps and */
bits8_t timeout; /* remove caps */
bits8_t prefix;
OBJ_ID_T sub_id;
EBUFFER_T descr;
} open_data;
struct { /* used for (un)registers */
bits8_t timeout;
bits8_t priority;
bits8_t range;
OBJ_ID_T region;
OIDC_T bound;
} reg_data;
struct { /* gets, nexts, bulks, test sets, */
bits16_t non_reps; /* responses, notifies and index */
bits16_t max_reps; /* (de)allocates */
VBL_T vbl_str;
bits8_t cur_phase; /* current phase of set processing */
/* same as vb flags */
bits32_t next_pid; /* info for the next phase */
bits8_t next_phase; /* of set processing, what */
ENVOY_AX_SEND_T *next_send; /* to do, and any comp info */
ENVOY_AX_ERROR_T *next_error;
ptr_t *next_cookie;
} proc_data;
} data;
} ENVOY_AX_PKT_T;
/* AgentX pdu types */
#define ENVOY_AX_OPEN 1
#define ENVOY_AX_CLOSE 2
#define ENVOY_AX_REGISTER 3
#define ENVOY_AX_UNREGISTER 4
#define ENVOY_AX_GET 5
#define ENVOY_AX_NEXT 6
#define ENVOY_AX_BULK 7
#define ENVOY_AX_TEST 8
#define ENVOY_AX_COMMIT 9
#define ENVOY_AX_UNDO 10
#define ENVOY_AX_CLEANUP 11
#define ENVOY_AX_NOTIFY 12
#define ENVOY_AX_PING 13
#define ENVOY_AX_INDEX_ALLOCATE 14
#define ENVOY_AX_INDEX_DEALLOCATE 15
#define ENVOY_AX_ADD_AC 16
#define ENVOY_AX_REMOVE_AC 17
#define ENVOY_AX_RESPONSE 18
/* AgentX flag bits */
#define ENVOY_AX_BIT_INSTANCE 1
#define ENVOY_AX_BIT_NEW_INDEX 2
#define ENVOY_AX_BIT_ANY_INDEX 4
#define ENVOY_AX_BIT_NDC 8 /* non-default context bit, when set
optional context field is used */
#define ENVOY_AX_BIT_BYTE_ORDER 16 /* when set, network byte order used */
/* reasons for closing a connection */
#define ENVOY_AX_CLOSE_OTHER 1
#define ENVOY_AX_CLOSE_PARSE 2
#define ENVOY_AX_CLOSE_PROTO 3
#define ENVOY_AX_CLOSE_TIMEOUTS 4
#define ENVOY_AX_CLOSE_SHUTDOWN 5
#define ENVOY_AX_CLOSE_MANAGER 6
/* AgentX codes for the next phase of sets */
#define ENVOY_AX_NEXT_CLEANUP_START 1
#define ENVOY_AX_NEXT_UNDO_START 2
/* AgentX Protocol error codes */
#define ENVOY_AX_OPEN_FAILED 256
#define ENVOY_AX_NOT_OPEN 257
#define ENVOY_AX_INDEX_WRONG_TYPE 258
#define ENVOY_AX_INDEX_ALREADY_ALLOCATED 259
#define ENVOY_AX_INDEX_NONE_AVAILABLE 260
#define ENVOY_AX_INDEX_NOT_ALLOCATED 261
#define ENVOY_AX_UNSUPPORTED_CONTEXT 262
#define ENVOY_AX_DUPLICATE_REGISTRATION 263
#define ENVOY_AX_UNKNOWN_REGISTRATION 264
#define ENVOY_AX_UNKNOWN_AGENT_CAPS 265
#define ENVOY_AX_PROTOCOL_PARSE_ERROR 266
#define ENVOY_AX_REQUEST_DENIED 267
#define ENVOY_AX_PROCESSING_ERROR 268
#define ENVOY_AX_OTHER 0xffff
/* AgentX error codes */
#define ENVOY_AX_ALLOCATION_FAILURE 1
#define ENVOY_AX_BAD_VALUE 2
#define ENVOY_AX_TOO_SMALL 3
#define ENVOY_AX_BAD_SIZE 4
#define ENVOY_AX_WRONG_VERSION 5
#define ENVOY_AX_PARSE_ERROR 6
#define ENVOY_AX_BAD_OPERATION 7
#define ENVOY_AX_SESS_LOSS 8
#define ENVOY_AX_TOO_BIG 9
/* AgentX packet access macros */
#define ax_pkt_get_context(PKTP) (&(PKTP)->context)
/* AgentX version stamps */
#define ENVOY_AX_VERSION_1 1
#define ENVOY_AX_VERSION_MAXIMUM 1
/* AgentX session admin status codes */
#define ENVOY_AX_SESSION_UP 1
#define ENVOY_AX_SESSION_DOWN 2
/* globals variables for subagents */
#ifndef ENVOY_AX_SA_TIMEOUT
#define ENVOY_AX_SA_TIMEOUT 1000
#endif
extern bits32_t envoy_ax_sa_timeout;
extern void envoy_ax_sa_init (void);
extern void envoy_ax_pkt_init (ENVOY_AX_PKT_T *);
extern ENVOY_AX_PKT_T *envoy_ax_pkt_allocate (void);
extern ALENGTH_T envoy_ax_pkt_size (ENVOY_AX_PKT_T *, VB_T *);
extern void envoy_ax_pkt_clean (ENVOY_AX_PKT_T *);
extern void envoy_ax_pkt_free (ENVOY_AX_PKT_T *);
extern int envoy_ax_pkt_encode (ENVOY_AX_PKT_T *, VB_T *,
EBUFFER_T *, ALENGTH_T);
extern ENVOY_AX_PKT_T *envoy_ax_pkt_decode (bits8_t *, ALENGTH_T, int *);
extern ENVOY_AX_PKT_T *envoy_ax_pkt_create_all(int *, bits8_t, bits8_t,
bits8_t, bits32_t, bits32_t,
bits8_t, bits32_t, bits8_t *,
int, OBJ_ID_T *, bits8_t,
bits8_t, bits8_t, OIDC_T,
bits32_t, bits8_t *, int,
bits8_t);
extern int envoy_ax_pkt_create_open (EBUFFER_T *, bits8_t, bits8_t,
bits32_t, bits8_t, bits32_t,
bits8_t *, OBJ_ID_T *);
extern int envoy_ax_pkt_create_close (EBUFFER_T *, bits8_t, bits8_t,
bits32_t, bits32_t, bits8_t);
extern int envoy_ax_pkt_create_registrations(EBUFFER_T *, bits8_t, bits8_t,
bits8_t, bits32_t, bits32_t,
bits8_t, bits8_t, bits8_t,
OBJ_ID_T *, OIDC_T, bits32_t,
bits8_t *);
extern int envoy_ax_pkt_create_ping (EBUFFER_T *, bits8_t, bits8_t,
bits32_t, bits32_t, bits32_t,
bits8_t *);
extern int envoy_ax_pkt_create_agent_caps(EBUFFER_T *, bits8_t, bits8_t,
bits8_t, bits32_t, bits32_t,
bits32_t, bits8_t *, bits32_t,
bits8_t *, OBJ_ID_T *);
extern ENVOY_AX_PKT_T *envoy_ax_pkt_create_variables(int *, bits8_t,
bits8_t, bits8_t,
bits32_t, bits32_t,
bits32_t, bits8_t *,
int, int);
extern int envoy_ax_bind_integer (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
sbits32_t);
extern int envoy_ax_bind_ip_address(ENVOY_AX_PKT_T *, int, int, OIDC_T *,
bits8_t *);
extern int envoy_ax_bind_null (ENVOY_AX_PKT_T *, int, int, OIDC_T *);
extern int envoy_ax_bind_object_id (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
int, OIDC_T *);
extern int envoy_ax_bind_string (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
bits8_t, int, bits8_t *, int);
extern int envoy_ax_bind_uint_64 (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
bits8_t, bits32_t, bits32_t);
extern int envoy_ax_bind_uint (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
bits8_t, bits32_t);
extern void envoy_ax_sa_handler(bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
ENVOY_AX_ERROR_T *, ptr_t);
extern int _snmp_find_next_helper_ax(MIBNODE_T *, int,
OIDC_T*, OBJ_ID_T *, int, VB_T *,
SNMP_PKT_T *, int);
extern int _snmp_find_next_bound(MIBNODE_T *, VB_T *);
#if INSTALL_COMMON_DYNAMIC_COMP_CONFIG
extern void ax_dyncfg_init(void);
#endif
extern ENVOY_AX_SA_SB_T *envoy_ax_sa_state_create(void);
extern void envoy_ax_sa_state_init (ENVOY_AX_SA_SB_T *);
extern int envoy_ax_sa_session_loss(ENVOY_AX_SA_SB_T *, ptr_t,
int, bits32_t);
typedef struct ENVOY_AX_SESSION_S
{
struct ENVOY_AX_SESSION_S *next;/* next session in the list */
bits32_t session_id; /* id for this session */
bits32_t connection_id; /* id for this connection */
bits8_t version; /* protocol version for this session */
bits8_t timeout; /* default timeout period */
bits8_t flags; /* flags, currently byte order */
ENVOY_AX_SEND_T *send; /* routine to send to sub agent */
ENVOY_AX_ERROR_T *error; /* routine to free the cookie */
ptr_t cookie; /* cookie for use with send rtn */
OBJ_ID_T sub_id; /* tag for sub agent */
EBUFFER_T descr; /* string for sub agent */
bits32_t timestamp; /* when this session started */
bits32_t timeout_count; /* number of consecutive timeouts */
} ENVOY_AX_SESSION_T;
typedef struct ENVOY_AX_MA_REG_S
{
bits32_t reg_index; /* index for use in agentx mib */
bits32_t context_id; /* index of context for this object */
bits8_t priority; /* priority for this object */
MIBLEAF_T *leaf; /* leaf for use in the mib tree
also contains session, priority
and timeout information */
struct ENVOY_AX_MA_REG_S *next;
struct ENVOY_AX_MA_REG_S *mib_next;
} ENVOY_AX_MA_REG_T;
typedef struct ENVOY_AX_MA_REGLIST_S
{
struct ENVOY_AX_MA_REGLIST_S *next; /* next registration in the list */
bits32_t reg_index; /* index for use in agentx mib */
bits32_t session_id; /* id for this session */
bits32_t connection_id; /* id for this connection */
bits8_t range_id; /* subid which has range, if any */
OIDC_T bound; /* upper bound of range, if any */
bits8_t flags; /* non-zero if this is an instance */
MIBLEAF_T *mibleaf; /* MIB leaf that has more info on this reg. */
struct ENVOY_AX_MA_REGLIST_S *match; /* For list of registrations w/same OID */
bits32_t context_id; /* id for this context */
bits8_t priority; /* priority of this registration */
OBJ_ID_T start_oid; /* registered subtree, or start if range */
} ENVOY_AX_MA_REGLIST_T;
typedef struct ENVOY_AX_CONTEXT_S
{
bits32_t id; /* this context's index in the list */
struct ENVOY_AX_CONTEXT_S *next; /* ptr to next element in list */
EBUFFER_T context; /* string for the context */
MIBNODE_T *mibroot; /* mib root node the user gave us */
TREENODE_T *indexroot; /* root for possible indexes */
} ENVOY_AX_CONTEXT_T;
/* control structure for outstanding agentx requests */
typedef struct AX_CB_S
{
struct AX_CB_S *next;
bits32_t reqid;
SNMP_PKT_T *pktp;
VB_T *vbp;
int count;
} AX_CB_T;
/* global variables used by an agentx master to keep state */
#ifndef ENVOY_AX_DEFAULT_TIMEOUT
#define ENVOY_AX_DEFAULT_TIMEOUT 1
#endif
#ifndef SNMP_AX_TIMEOUT_COUNT
#define SNMP_AX_TIMEOUT_COUNT 3
#endif
/* General sub-agent response packet pre-processing. */
#ifndef AX_RESPONSE_PREPROCESS
#define AX_RESPONSE_PREPROCESS(PKT)
#endif
extern bits32_t agentxDefaultTimeout;
extern AX_CB_T *first_axcb;
extern bits32_t ax_reqid;
extern bits32_t ax_registration_id;
extern TREENODE_T *registration_root;
extern bits32_t agentxRegisterDuplicate;
extern bits32_t envoy_ax_session_id;
extern ENVOY_AX_SESSION_T *envoy_ax_session_list;
extern ENVOY_AX_MA_REGLIST_T *envoy_ax_registration_list;
extern bits32_t context_list_id;
extern ENVOY_AX_CONTEXT_T *context_list;
extern sbits32_t agentxMasterAgentXVer;
extern void envoy_ax_ma_init (void);
extern void envoy_ax_ma_handler(bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
ENVOY_AX_ERROR_T *, ptr_t);
extern int envoy_ax_ma_cleanup_sessions(ptr_t, bits8_t);
typedef void ENVOY_AX_HANDLER_T (bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
ENVOY_AX_ERROR_T *, ptr_t);
extern void envoy_ax_chunk_init (ENVOY_AX_CHUNK_T *);
extern int envoy_ax_chunk_clean (ENVOY_AX_CHUNK_T *);
extern int envoy_ax_chunk_handler(bits8_t *, ALENGTH_T, ENVOY_AX_HANDLER_T *,
ENVOY_AX_CHUNK_T *, ENVOY_AX_SA_SB_T *,
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
ENVOY_AX_ERROR_T *, ENVOY_AX_ADD_T *,
ptr_t);
#if (!defined(ENVOY_AX_COOKIE_CMP))
#define ENVOY_AX_COOKIE_CMP(HAND, COOKIE) (HAND == COOKIE)
#endif
typedef struct ENVOY_AX_INDEX_STR_S
{
ALENGTH_T length;
bits8_t *buffer;
} ENVOY_AX_INDEX_STR_T;
typedef struct ENVOY_AX_INDEX_DATA_S
{
struct ENVOY_AX_INDEX_DATA_S *next;
bits32_t session_id; /* 0 for no session */
union {
OBJ_ID_T objid;
bits32_t bits32;
ENVOY_AX_INDEX_STR_T string;
bits8_t ipaddr[4];
} data;
} ENVOY_AX_INDEX_DATA_T;
typedef struct ENVOY_AX_INDEX_HDR_S
{
bits8_t type;
ENVOY_AX_INDEX_DATA_T *data;
} ENVOY_AX_INDEX_HDR_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern ENVOY_AX_SESSION_T *ax_session_find_index(bits32_t, int *);
extern void ax_session_release (ENVOY_AX_SESSION_T *);
extern ENVOY_AX_SESSION_T *ax_session_next (bits32_t, int *);
extern int envoy_ax_ma_cleanup_session_mth(bits32_t, bits8_t);
extern ENVOY_AX_CONTEXT_T *ax_context_index(bits32_t);
extern ENVOY_AX_CONTEXT_T *ax_context_next (ENVOY_AX_CONTEXT_T *);
extern ENVOY_AX_MA_REG_T *find_reg_leaf(OBJ_ID_T *, bits8_t, bits32_t);
extern sbits32_t Find_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *, MIBLEAF_T **);
extern int AX_Add_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *, MIBLEAF_T *,
MIBLEAF_T **);
extern MIBLEAF_T * AX_Remove_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *);
#define ENVOY_AX_TRANSPORT_TYPE_UNIX 1
#define ENVOY_AX_TRANSPORT_TYPE_TCP 2
#define ENVOY_AX_TRANSPORT_TYPE_UDP 3
#define ENVOY_AX_TRANSPORT_TYPE_MEM 4
#define ENVOY_AX_TRANSPORT_TYPE_OTHER 5
extern void ax_ma_index_allocate (ENVOY_AX_PKT_T *, ENVOY_AX_PKT_T *,
ENVOY_AX_CONTEXT_T *);
extern void ax_ma_index_deallocate(ENVOY_AX_PKT_T *, ENVOY_AX_PKT_T *,
ENVOY_AX_CONTEXT_T *);
extern void ax_ma_cleanup_indexes (bits32_t);
#if INSTALL_ENVOY_AGENTX_INDEX
#define AX_MA_RTN_IND_ALLOC(AX, RP, CON) ax_ma_index_allocate(AX, RP, CON)
#define AX_MA_RTN_IND_DEALLOC(AX, RP, CON) ax_ma_index_deallocate(AX, RP, CON)
#else
#define AX_MA_RTN_IND_ALLOC(AX, RP, CON) ((RP)->error_stat = GEN_ERR)
#define AX_MA_RTN_IND_DEALLOC(AX, RP, CON) ((RP)->error_stat = GEN_ERR)
#endif
#ifdef __cplusplus
}
#endif
#endif /* envoy_agentx_inc */
@@ -0,0 +1,257 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/asn1.h,v 1.2 2001/11/06 21:35:00 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1986-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: asn1.h,v $
* Revision 1.2 2001/11/06 21:35:00 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:02 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:27 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:32 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:53:49 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:03 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:21 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:20 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:47:58 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:28 sra
* Release 6.0.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.4 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.3 1993/04/28 22:00:38 sar
* Moved the definition of UINT_64_T to ui64.h and update others
*
* Revision 3.2 1993/04/26 20:33:14 sar
* Added bitstrings, and have deletion of parties or contexts delete acls.
*
* Revision 3.1 1993/03/25 21:15:21 sar
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
*
* Revision 3.0 1992/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.104 91/10/30 20:53:14 dab
* Include asn1conf.h only if it's not already been included.
*
* Revision 2.103 91/08/15 15:41:45 dab
* Pulled configuration from asn1.h and snmp.h and put in
* snmpconf.h and asn1conf.h.
*
* Revision 2.102 91/08/14 10:55:24 dab
* Removed type declarations to snmpconf.h and includes that file.
*
* Revision 2.101 91/08/12 12:48:00 dab
* Added typedef of PTR_T.
*
* Revision 2.100 91/08/09 14:09:44 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:19 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:26
* Release 2.00
*
* Rev 1.1 14 Dec 1989 16:01:16
* Added support for Borland Turbo C compiler
*
* Rev 1.0 12 Sep 1988 10:46:12
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(asn1_inc))
#define asn1_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
/* ASN.1 FLAGS (form and class), adjusted for position within an octet */
#define A_IDCF_MASK 0xE0 /* Mask for ID CLASS and FORM bits */
#define A_IDC_MASK 0xC0 /* Mask for ID CLASS bits */
#define A_IDF_MASK 0x20 /* Mask for ID FORM bit */
#define A_FLAG_MASK 0xE0
#define A_UNIVERSAL 0x00
#define A_APPLICATION 0x40
#define A_CONTEXT 0x80
#define A_PRIVATE 0xC0
#define A_PRIMITIVE 0x00
#define A_CONSTRUCTOR 0x20
#define A_DEFAULT_SCOPE A_CONTEXT
/* ASN.1 basic types, all in UNIVERSAL scope */
#define A_NO_ID 0x00
#define A_BOOLEAN 0x01
#define A_INTEGER 0x02
#define A_BITSTRING 0x03
#define A_OCTETSTRING 0x04
#define A_NULL 0x05
#define A_OBJECTID 0x06
#define A_SEQUENCE 0x10
#define A_SET 0x11
/* ASN.1 defined types, all based on OCTETSTRING */
#define A_NUMERICSTRING 0x12
#define A_PRINTABLESTRING 0x13
#define A_T61STRING 0x14
#define A_TELETEXSTRING A_T61STRING
#define A_VIDEOTEXSTRING 0x15
#define A_IA5STRING 0x16
#define A_GRAPHICSTRING 0x19
#define A_VISIBLESTRING 0x1A
#define A_GENERALSTRING 0x1B
/* Other ASN.1 defined universal types */
#define A_GENERALIZEDTIME 0x18
#define A_UTCTIME 0x17
#define A_OBJECTDESCRIPTOR 0x07
/****************************************************************************
NAME: A_SizeOfLength
PURPOSE: Compute the number of octets needed to hold an ASN.1 length field.
PARAMETERS:
ALENGTH_T The proposed length
RETURNS: ALENGTH_T The number of octets needed
RESTRICTIONS:
BUGS:
****************************************************************************/
#define A_SizeOfLength(S) ((ALENGTH_T)((S) <= 127 ? 1 : ((S) <= 255 ? 2 : 3)))
/****************************************************************************
NAME: A_SizeOfType
PURPOSE: Compute the number of octets needed to hold an ASN.1 type field
PARAMETERS:
ATVALUE_T The proposed type (without CLASS & FORM bits)
RETURNS: unsigned int The number of octets needed
RESTRICTIONS:
BUGS:
****************************************************************************/
#define A_SizeOfType(V) ((unsigned int) ((V) <= 30 ? 1 : \
((V) <= 127 ? 2 : ((V) <= 16383 ? 3 : 4))))
/****************************************************************************
A_SizeOfOctetString -- Return total size that an octet string would
occupy when ASN.1 encoded (tag and length fields
are NOT included)
Parameters:
ALENGTH_T The size of the string
Returns: ALENGTH_T Number of octets the octet string would occupy if
in ASN.1 encoding, NOT including the type/length fields
of the outermost wrapper. Since these routines only
generate non-constructor encodings, the length is
exactly that given.
****************************************************************************/
#define A_SizeOfOctetString(L) ((ALENGTH_T)(L))
/****************************************************************************
OBJECT IDENTIFIER
****************************************************************************/
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* The following structure is used to internally hold an object identifier */
/* Each component is limited in range from 0 to 64K-1. */
typedef struct OBJ_ID_S
{
int num_components; /* # of object id components */
/* Note: this is the number of */
/* components in the object id, */
/* which is one more than the # */
/* of subidentifiers in an */
/* encoded object id. */
OIDC_T *component_list;
} OBJ_ID_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#ifdef __cplusplus
}
#endif
#endif /* asn1_inc */
@@ -0,0 +1,408 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/asn1conf.h,v 1.3 2003/01/15 13:58:56 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1993-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: asn1conf.h,v $
* Revision 1.3 2003/01/15 13:58:56 josh
* directory structure shifting
*
* Revision 1.2 2001/11/06 21:50:40 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.9.4.3 2001/09/21 19:14:28 josh
* an extra check: can't install coexistence if neither SNMPv1
* nor SNMPv2 are installed
*
* Revision 9.9.4.2 2001/08/24 14:32:10 josh
* a variety of option checks to make sure we don't have conflicting
* options installed
*
* Revision 9.9.4.1 2001/06/28 18:22:56 josh
* Seeding the Cormorant branch with the code from the old
* cormorant branch
*
* Revision 9.9 2001/04/11 20:58:32 josh
* we are overwriting the trunk's copy of this file with
* the file from the kingfisher branch
*
* Revision 9.8 2001/01/19 22:22:02 paul
* Update copyright.
*
* Revision 9.7 2000/07/10 15:55:13 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 9.6 2000/06/09 14:54:12 josh
* modifications due to new installation options, new proxy code
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
* be built with the target code
*
* Revision 9.5.4.1 2001/04/11 20:48:29 josh
* moving cormorant-specific changes off to the cormorant
* branch
*
* Revision 9.5.2.2 2001/03/12 22:07:50 tneale
* Updated copyright
*
* Revision 9.5.2.1 2000/09/21 21:14:52 josh
* bringing branch include files in line with root
*
* Revision 9.5 2000/03/17 19:48:28 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:32 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 16:54:09 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 1999/06/01 15:46:14 josh
* Moving some installation option checking.
*
* Revision 9.1 1999/04/09 20:36:59 josh
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
*
* Revision 9.0 1998/10/16 22:10:04 sar
* Update version stamp to match release
*
* Revision 8.8 1998/08/04 02:02:17 sar
* Added some macros for use with longer term storage, if the user
* hasn't defined them they default to the standard ones.
*
* Revision 8.7 1998/06/23 20:28:23 sar
* Added requirement for view2275 if v3 is installed
*
* Revision 8.6 1998/06/09 21:34:56 sar
* Added MEMCMP_NULLOK
*
* Revision 8.5 1998/06/08 19:42:10 sar
* Create a define to tell us if we need the stats group in general
*
* Revision 8.4 1998/05/29 03:53:54 sar
* Add and use defines for v2 types and v2 protocol pieces. This allows
* us to include the types and pieces for other versions, such as v3,
* without having to touch all of the seperate files that use the
* types or pieces.
*
* Revision 8.3 1998/05/23 19:55:38 sar
* As part of adding rfc2275 made a switch to mesh 2275 and 1445.
*
* Revision 8.2 1998/02/25 15:21:23 sra
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
*
* Revision 8.1 1998/02/25 04:50:22 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:20 sar
* Updated revision to 8.0
*
* Revision 7.5 1997/10/30 04:23:16 sar
* Update type information mostly convert bits16_ts to ALENGTH_Ts
* also add MAX_ALENGTH
*
* Revision 7.4 1997/10/22 03:07:28 sar
* Mofied the agentx and older subagent schemes install options
*
* Revision 7.3 1997/08/21 17:23:44 sra
* Begin moving configuration stuff that's common to all products to common.h
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
*
* Revision 7.2 1997/03/20 06:47:59 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
01b,26jul08,y_t fix the incompatible for STL
01a,19apr05,job update copyright notices
*/
#if !defined(asn1conf_inc)
#define asn1conf_inc
#ifdef __cplusplus
extern"C" {
#endif
#if !defined(EPILOGUE_INSTALL_H)
#include <wrn/wm/common/install.h>
#endif
/* Get the standard types and the install defines */
#if !defined(EPILOGUE_TYPES_H)
#include <wrn/wm/common/types.h>
#endif
/* !!! These are here for backwards compatibility only while we're switching
* over to the new configuration system. */
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2)
#define SGRP 1
#endif
/* This is to provide compatibility for windnet users because the
* windnet version of envoy had all struct declarations bracketted
* with an alignment pragma based on this test. We will follow
* suit but put the test in a single place (here). */
#if INSTALL_ENVOY_ALIGN_STRUCTURES
#define WINDNET_STRUCT_ALIGN
#endif
/*****************************************************************
* Portable types definitions for backwards compatibility. These
* are now defined in terms of things defined by <common/h/types.h> and
* therefore <oemtypes.h> so any changes should be made in
* <oemtypes.h>.
*****************************************************************/
/* various sizes of integers */
typedef sbits32_t INT_32_T;
typedef bits32_t UINT_32_T;
typedef sbits16_t INT_16_T;
typedef bits16_t UINT_16_T;
typedef bits8_t UINT_8_T;
typedef bits8_t OCTET_T ;
/* A generic pointer type. Use void * if your compiler can hack
* it, otherwise char * is probably the right thing. */
typedef ptr_t PTR_T;
/* SNMP ASN.1 tags and lengths can always fit into 16 bits... */
typedef bits16_t ATVALUE_T; /* ASN.1 type values */
typedef bits16_t ALENGTH_T; /* ASN.1 contents field lengths */
/* this is used as both a maximum and a mask */
#define MAX_ALENGTH 0xFFFF
#define OCTETS_PER_INT32 (sizeof(INT_32_T)/sizeof(OCTET_T))
#define OCTETS_PER_INT16 (sizeof(INT_16_T)/sizeof(OCTET_T))
/*
* get the common system configuration
*/
#include <wrn/wm/common/config.h>
/*
* get the system configuration for envoy
*/
#define CONFIG_PREAMBLE 1
#include <envoy.h>
#undef CONFIG_PREAMBLE
/* Long lived dynamic storage. If the user doesn't define
them explicitly we use the shorter term ones */
#ifndef SNMP_memory_alloc_lt
#define SNMP_memory_alloc_lt(need) SNMP_memory_alloc(need)
#endif
#ifndef SNMP_memory_free_lt
#define SNMP_memory_free_lt(buf) SNMP_memory_free(buf)
#endif
/*****************************************************************
* Set the size of object identifier components. 32 bits is recommended
* but 16 bits may work and may save a little space.
* This may be overridden in <oemtypes.h> by defining __TYPES_HAVE_OIDC_T_
*****************************************************************/
#ifndef __TYPES_HAVE_OIDC_T_
typedef bits32_t OIDC_T;
#endif
/* min and max macros if not provided by the system */
#ifndef NOMINMAX
#if (!defined(max))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if (!defined(min))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif
/* These are the standard C functions that we use in Envoy. If the
* customer's compiler supplies these correctly then nothing more need be
* done. If not, then <envoy.h> can override. The most common case is
* that the system provides them but with the wrong type arguments (char *
* instead of void *). The macros can then fix this with casts. */
#ifndef MEMCPY
#define MEMCPY(dst, src, n) memcpy(dst, src, n)
#endif
#ifndef MEMSET
#define MEMSET(dst, val, n) memset(dst, val, n)
#endif
#ifndef MEMCMP
#define MEMCMP(s1, s2, n) memcmp(s1, s2, n)
#endif
#ifndef STRLEN
#define STRLEN(s) strlen(s)
#endif
#ifndef MEMCMP_NULLOK
#define MEMCMP_NULLOK(s1, s2, n) (n ? MEMCMP(s1, s2, n) : 0)
#endif
/* Error checking, Look for inconsistencies or necessary configuration
that hasn't been done */
/* Do we need any of the stats. For v1 & v2 there is a seperate
installation option for the stats groups, for v3 the stats
are required for reports so installing v3 installs the groups */
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2 || \
INSTALL_ENVOY_SNMP_VERSION_3)
#define ENVOY_NEED_STATS 1
#else
#define ENVOY_NEED_STATS 0
#endif
/* See if we need either v2 types or protocols, we do this
to avoid needing to add new install option whenever a new
version is defined */
#if (INSTALL_ENVOY_SNMP_USE_V2_TYPES || INSTALL_ENVOY_SNMP_VERSION_2 || \
INSTALL_ENVOY_SNMP_VERSION_3)
#define ENVOY_USE_V2_TYPES 1
#else
#define ENVOY_USE_V2_TYPES 0
#endif
#if (INSTALL_ENVOY_SNMP_VERSION_2 || INSTALL_ENVOY_SNMP_VERSION_3)
#define ENVOY_USE_V2_PROTOS 1
#else
#define ENVOY_USE_V2_PROTOS 0
#endif
/* If version 3 is installed we must have 2275 views */
#if ((INSTALL_ENVOY_SNMP_VERSION_3) && !(INSTALL_ENVOY_SNMP_RFC2275_VIEWS))
#error If you are installing version 3 you must also install rfc2275
#error views using _ENVOY_SNMP_RFC2275_VIEWS.
#endif
/* check that only one of the view schemes is turned on,
if one is turned on turn on the flex view option for use
elsewhere */
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS && INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
#error Must not have both the rfc1445 and rfc2275 view schemes installed.
#error You should modify the configuration file and remove either the
#error ENVOY_SNMP_RFC1445_VIEWS or ENVOY_SNMP_RFC2275_VIEWS option
#endif
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS || INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
#define INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS 1
#else
#define INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS 0
#endif
/* Check that that the lock & serialization options are consistent */
#if (INSTALL_ENVOY_SNMP_LOCK && INSTALL_ENVOY_SNMP_SERIALIZE)
#error Must not have both the lock code and the serialization code installed.
#error You should modify the configuration file and remove either
#error the ENVOY_SNMP_LOCK or the ENVOY_SNMP_SERIALIZE option
#endif
#if (INSTALL_ENVOY_CONTINUE_REENTRANT && !INSTALL_ENVOY_SNMP_LOCK)
#error Must have locks installed to use reentrant continues.
#error You should modify the configuration file and install
#error the ENVOY_SNMP_LOCK option.
#endif
/* check that the options for the agentx scheme are consistent */
#if ((INSTALL_ENVOY_AGENTX_MASTER || INSTALL_ENVOY_AGENTX_SUB) && \
!(INSTALL_ENVOY_AGENTX))
#error You must install ENVOY_AGENTX with ENVOY_AGENTX_MASTER
#error and ENVOY_AGENTX_SUB
#endif
#if (INSTALL_ENVOY_AGENTX_MASTER)
#if (INSTALL_ENVOY_MAIN_AGENT && !(INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS))
#error You must install ENVOY_SNMP_RFC1445_VIEWS or
#error ENVOY_SNMP_RFC2275_VIEWS for use with a master agent
#endif
#if (!INSTALL_ENVOY_SNMP_LOCK && !INSTALL_ENVOY_SNMP_SERIALIZE)
#error Must have either the locking scheme or the serialization scheme
#error installed. You should modify the configuration file and install
#error either the ENVOY_SNMP_LOCK or ENVOY_SNMP_SERIALIZE option
#endif
#endif
/* Check that the various SNMPv3 components are consistent */
#if ((INSTALL_ENVOY_SNMP_V3_TARGET) && !(INSTALL_ENVOY_SNMP_VERSION_3))
#error The target code (ENVOY_SNMP_V3_TARGET) requires SNMPv3 support.
#error Either uninstall ENVOY_SNMP_V3_TARGET or install ENVOY_SNMP_VERSION_3.
#endif
#if !(INSTALL_ENVOY_SNMP_VERSION_1 || INSTALL_ENVOY_SNMP_VERSION_2) && \
INSTALL_ENVOY_SNMP_COEXISTENCE
#error If coexistence is installed, either SNMPv1 or SNMPv2 must also
#error be installed.
#endif
#if ((INSTALL_ENVOY_SNMP_V3_NOTIFY || INSTALL_ENVOY_SNMP_V3_PROXY || \
INSTALL_ENVOY_SNMP_COEXISTENCE) && !(INSTALL_ENVOY_SNMP_V3_TARGET))
#error The use of notifies, proxies, or coexistence requires that
#error ENVOY_SNMP_V3_TARGET be installed.
#endif
#if ((INSTALL_ENVOY_SNMP_V3_PROXY) && (INSTALL_ENVOY_SNMP_PROXY))
#error ENVOY_SNMP_V3_PROXY and ENVOY_SNMP_PROXY cannot both be installed.
#endif
#if ((INSTALL_ENVOY_SNMP_V3_PROXY) || (INSTALL_ENVOY_SNMP_PROXY))
#define INSTALL_ENVOY_USE_SNMP_PROXY 1
#else
#define INSTALL_ENVOY_USE_SNMP_PROXY 0
#endif
/* If we don't have a main agent we shouldn't be counting stats */
#if ((INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2) && \
!(INSTALL_ENVOY_MAIN_AGENT))
#error Must not have the stats groups installed if building only a
#error sub agent. You should modify the configuration file
#error for the makmak program and either uninstall the SNMP_GROUP
#error options, add the MASTER agent option or remove the SUB agent option
#endif
#if INSTALL_ENVOY_SNMP_VERSION_USEC
#error Envoy no longer supports USEC. Please uninstall
#error ENVOY_SNMP_VERSION_USEC and recompile.
#endif
#if INSTALL_ENVOY_40_VB_FREE_COMPAT
#error ENVOY_40_VB_FREE_COMPAT is no longer a valid option.
#error Please uninstall it and recompile.
#endif
#if (INSTALL_SNMP_VXWORKS_VIRTUAL_STACK && \
INSTALL_SNMP_VXWORKS_VS_ENTITY && \
!(INSTALL_ENVOY_ENTITY_MIB))
#error You must install ENVOY_ENTITY_MIB for use with SNMP_VXWORKS_VS_ENTITY
#endif
#ifdef __cplusplus
}
#endif
#endif /* asn1conf_inc */
@@ -0,0 +1,297 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/auxfuncs.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1991-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: auxfuncs.h,v $
* Revision 1.2 2001/11/06 21:35:01 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:03 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:29 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:32 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:54:24 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 1999/05/24 20:12:10 josh
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
* to avoid C++ compiler errors.
*
* Revision 9.0 1998/10/16 22:10:05 sar
* Update version stamp to match release
*
* Revision 8.2 1998/05/23 19:58:52 sar
* Added string to oid (and back) translation routines
*
* Revision 8.1 1998/02/25 04:50:24 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:21 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:00 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.2 1996/01/05 19:09:34 sar
* added group_by_getproc_and_instance
*
* Revision 6.1 1995/10/20 22:53:35 sar
* removed bitstring & uinteger32 options
*
* Revision 6.0 1995/05/31 21:46:31 sra
* Release 6.0.
*
* Revision 5.4 1995/05/06 01:39:54 sar
* moved the defs for method routines in auxi into auxmth.h
*
* Revision 5.3 1995/03/20 23:11:33 sar
* Added declarations of the get_<type>_async functions
* Updated scan_vb_forLeaf & scan_for_leaf_and_match to use vb pointers
* instead of indexes.
*
* Revision 5.2 1994/10/03 21:20:27 sar
* Added the defs for SNMP_Create_And_Send_Traps and
* SNMP_Create_Encode_And_Send_Traps.
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Rearrange some items to deal with removing v2 types from v1 settings if
* they aren't installed.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.3 1994/05/04 22:43:48 sar
* added def for null_set_proc
*
* Revision 4.2 1994/04/15 21:38:04 sar
* added the dynmaic flag to get_ui64.
*
* Revision 4.1 1994/03/08 18:00:01 dab
* Added oidcmp2
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.9 1993/06/07 18:31:09 sar
* Added the get and set functions for ui64s and the get function for
* bit strings.
*
* Revision 3.8 1993/05/14 15:13:29 sar
* removed scan_vb_and_reset as it was no longer being used.
*
* Revision 3.7 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.6 1993/04/27 21:06:48 sar
* Removed index_to_vbp it is now in buildpkt.h
*
* Revision 3.5 1993/04/17 00:58:20 sar
* added the def for vb_extract_row_loose
*
* Revision 3.4 1993/03/05 03:56:25 dab
* fixed up types
*
* Revision 3.3 1993/03/03 16:12:39 dab
* Protect against multiple inclusion and remove __() definition.
*
* Revision 3.2 1993/03/02 19:04:38 sar
* added definition of vb_scan_and_reset.
*
* Revision 3.1 1993/02/26 17:28:25 sar
* added scan_for_leaf_and_match and scan_vb_for_leaf so they can be use
* by outside routines.
*
* Revision 3.0 1992/04/03 19:52:27 dab
* Release 3.0
*
* Revision 1.13 92/03/31 12:23:54 dab
* Changed flags in the create_row structure again.
*
* Revision 1.12 92/03/31 11:16:56 dab
* Changed flags in create_row structure.
*
* Revision 1.11 92/03/30 18:43:17 dab
* Changed arguments to oid_to_ip().
*
* Revision 1.10 92/03/26 10:47:08 dab
* removed get_cookie().
*
* Revision 1.9 92/02/27 16:47:39 dab
* Changed the create_row structure to hold a MIBLEAF_T pointer instead
* of a locator.
*
* Revision 1.7 92/02/04 10:49:00 dab
* Added oidcmp().
*
* Revision 1.6 91/11/06 14:39:44 dab
* Added vb_extract_row and the create_row structure.
*
* Revision 1.5 91/11/04 15:25:56 dab
* Renamed index parameter in function declarations so it doesn't
* conflict with system routine index().
*
* Revision 1.4 91/11/04 15:10:31 dab
* Added oidorder().
*
* Revision 1.3 91/10/31 13:08:41 dab
* Changed args to ip_to_llist so llist is a signed long *.
* Also added llist_cmp.
*
* Revision 1.2 91/10/30 09:43:32 dab
* New functions ip_to_rlist(), ip_to_llist(), and oid_to_ip().
*
* Revision 1.1 91/10/24 10:59:34 dab
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#ifndef auxfuncs_inc
#define auxfuncs_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(buildpkt_inc))
#include <wrn/wm/snmp/engine/buildpkt.h>
#endif
#if (!defined(auxmth_inc))
#include <wrn/wm/snmp/engine/auxmth.h>
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* A structure used for looking up all the pieces of a row create of an
* SNMP packet. */
struct create_row {
MIBLEAF_T *leaf;
OCTET_T flags;
};
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define ROW_FLAG_NEEDED 0x01
#define ROW_FLAG_CALL_SET 0x02
/* various other housekeeping functions */
extern int ip_to_llist __((UINT_32_T ip,
INT_32_T *llist));
extern int ip_to_rlist __((UINT_32_T ip,
OIDC_T *rlist));
extern int llist_cmp __((INT_32_T *list1,
INT_32_T *list2,
int len));
extern int oid_to_ip __((int tcount,
OIDC_T *tlist,
UINT_32_T *addr));
extern int oidcmp __((int tcount_1,
OIDC_T *tlist_1,
int tcount_2,
OIDC_T *tlist_2));
extern int oidcmp2 __((int tcount_1,
OIDC_T *tlist_1,
int tcount_2,
OIDC_T *tlist_2));
extern int oidorder __((OIDC_T *idp1,
OIDC_T *idp2,
int n));
extern int scan_vb_for_locator __((SNMP_PKT_T * pktp,
int vb_index,
UINT_16_T loc));
extern VB_T *vb_extract_row __((SNMP_PKT_T *pkt,
int start_indx,
int tcount,
OIDC_T *tlist,
int row_len,
struct create_row *row));
extern VB_T *scan_for_leaf_and_match __((SNMP_PKT_T *pkt,
VB_T *vbp,
MIBLEAF_T *leaf,
int tcount,
OIDC_T *tlist));
extern VB_T *scan_vb_for_leaf __((SNMP_PKT_T *pktp,
VB_T *vbp,
MIBLEAF_T *leaf));
extern VB_T *vb_extract_row_loose __((SNMP_PKT_T *pktp,
int indx,
MIBLEAF_T **leaves,
int tcount,
OIDC_T *tlist));
extern void group_by_getproc_and_instance __((SNMP_PKT_T *pktp,
VB_T *first_vbp,
int tcount,
OIDC_T *tlist));
extern int oid_to_string __((int tcount,
OIDC_T *tlist,
ALENGTH_T *blen,
bits8_t *buffp,
int iflag));
extern int string_to_oid __((ALENGTH_T blen,
bits8_t *buffp,
int tcount,
OIDC_T *tlist,
int iflag));
#ifdef __cplusplus
}
#endif
#endif /* auxfuncs_inc */
@@ -0,0 +1,409 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/auxmth.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: auxmth.h,v $
* Revision 1.2 2001/11/06 21:35:01 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.6 2001/04/11 20:12:00 josh
* merging changes from the kingfisher branch back onto
* the trunk
*
* Revision 9.5 2001/01/19 22:22:03 paul
* Update copyright.
*
* Revision 9.4.2.2 2001/03/12 22:07:51 tneale
* Updated copyright
*
* Revision 9.4.2.1 2000/09/21 21:14:53 josh
* bringing branch include files in line with root
*
* Revision 9.4 2000/03/17 19:48:29 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 16:54:40 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 2000/02/04 21:54:14 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.1 1999/05/24 20:12:11 josh
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
* to avoid C++ compiler errors.
*
* Revision 9.0 1998/10/16 22:10:05 sar
* Update version stamp to match release
*
* Revision 8.2 1998/05/29 03:53:54 sar
* Add and use defines for v2 types and v2 protocol pieces. This allows
* us to include the types and pieces for other versions, such as v3,
* without having to touch all of the seperate files that use the
* types or pieces.
*
* Revision 8.1 1998/02/25 04:50:25 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:21 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:01 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.3 1996/01/05 19:09:34 sar
* Added null_next and null_test functions for use with the mibcompiler
*
* Revision 6.2 1995/11/11 00:05:52 sar
* added *_TestAndIncr_async functions.
*
* Revision 6.1 1995/10/20 22:53:35 sar
* removed bitstring & uinteger32 options
*
* Revision 6.0 1995/05/31 21:46:32 sra
* Release 6.0.
*
* Revision 1.1 1995/05/06 01:39:54 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
/* Defs for all of the method routines written in auxi */
#ifndef auxmth_inc
#define auxmth_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(buildpkt_inc))
#include <wrn/wm/snmp/engine/buildpkt.h>
#endif
/* null test functions */
extern int null_test_proc __((int form,
OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp,
int indx));
extern void null_test_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
/* generic test function (for non-settable scalars) */
extern int it_exists __((int form,
OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp,
int vb_index));
extern void it_exists_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
/* Test function for test and increment type variables */
extern void test_TestAndIncr_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
#if (ENVOY_USE_V2_TYPES)
/* Test and cleanup functions for UInteger64 */
extern void ui64_async_test __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void ui64_async_cleanup __((PTR_T value));
#endif
/* various get functions */
extern INT_32_T null_get_proc __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp));
extern void null_get_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern INT_32_T get_int __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp));
extern unsigned char *get_ip_address __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp,
UINT_32_T *addr));
extern OBJ_ID_T *get_object_identifier __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp,
int *dynamic));
extern unsigned char *get_string __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
int *lengthp,
SNMP_PKT_T *pktp,
int *dynamic));
extern UINT_32_T get_uint __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp));
extern UINT_32_T get_ulong __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp));
/* We only include these two functions if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern UINT_64_T *get_ui64 __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
SNMP_PKT_T *pktp,
int *dynamic));
#endif
extern void get_int_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_ip_address_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_object_identifier_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_string_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_uint_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_ulong_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void get_TestAndIncr_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
/* We only include these two functions if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void get_ui64_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
#endif
/* null next functions */
extern int null_next_proc __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
OIDC_T *rlist,
char *cookie,
SNMP_PKT_T *pktp));
extern void null_next_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
/* various undo procedures */
extern void undo_int_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void undo_uint_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void undo_TestAndIncr_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
#if (ENVOY_USE_V2_TYPES)
extern void ui64_async_undo __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
#endif
/* various set procedures */
extern void null_set_proc __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
INT_32_T value,
SNMP_PKT_T *pktp,
int vb_index));
extern void null_set_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void set_int __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
INT_32_T value,
SNMP_PKT_T *pktp,
int vb_index));
extern void set_uint __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
UINT_32_T value,
SNMP_PKT_T *pktp,
int vb_index));
/* We only include this function if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void set_ui64 __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
char *cookie,
UINT_32_T high,
UINT_32_T low,
SNMP_PKT_T *pktp,
int vb_index));
#endif
extern void set_int_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void set_uint_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
extern void set_TestAndIncr_async __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
/* We only include this function if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void ui64_async_set __((OIDC_T lastmatch,
int tcount,
OIDC_T *tlist,
SNMP_PKT_T *pktp,
VB_T *vbp));
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,215 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/axapi.h,v 1.5 2002/04/04 15:20:35 andre Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1994-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: axapi.h,v $
* Revision 1.5 2002/04/04 15:20:35 andre
* Change enums to #defines; add default user-exit
*
* Revision 1.3 2002/03/18 20:20:04 tneale
* Changed type of argument tcount to conform to correct type
*
* Revision 1.2 2002/02/26 18:41:49 josh
* update and nits
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if !defined(_RFC2742API_H_)
#define _RFC2742API_H_
/* Macros / symbolic constant definitions */
#if !defined(TRUE)
#define TRUE 1
#endif
#if !defined(FALSE)
#define FALSE 0
#endif
#if !defined(ENVOY_AX_CONN_ENTRY)
/* Define ENVOY_AX_CONN_ENTRY for non-VxWorks builds */
#define ENVOY_AX_CONN_ENTRY(INDEX, MATCH_TYPE, P_CONNENT) 0
#endif
#if !defined(ENVOY_AX_GET_CONNID)
/* Define ENVOY_AX_GET_CONNID for non-VxWorks builds */
#define ENVOY_AX_GET_CONNID(PCE) 1
#endif
#define agentxConnectionEntry_INSTANCE_LEN 1
#define agentxSessionEntry_INSTANCE_LEN 2
#define agentxRegistrationEntry_INSTANCE_LEN 3
/* Internal data retrieval definitions, typedefs and structures */
#define AX_MATCH_GET 1
#define AX_MATCH_NEXT 2
#define AX_GEN_DEFTO 1
#define AX_GEN_VER 2
#define AX_CONN_LASTCHG 3
#define AX_SESS_LASTCHG 4
#define AX_REG_LASTCHG 5
/* GENERAL, CONNECTION, SESSION and REGISTRATION group structures */
typedef struct AX_GEN_S
{
bits32_t agentxDefaultTimeout;
bits32_t agentxMasterAgentXVer;
} AX_GEN_T;
typedef struct AX_CONNENT_S
{
bits32_t agentxConnIndex;
bits32_t agentxConnTransportTime;
OBJ_ID_T agentxConnTransportDomain;
EBUFFER_T agentxConnTransportAddress;
} AX_CONNENT_T;
typedef struct AX_SESSENT_S
{
bits32_t agentxConnIndex;
bits32_t agentxSessIndex;
OBJ_ID_T agentxSessObjectID;
EBUFFER_T agentxSessDescr;
bits32_t agentxSessAdminStatus;
bits32_t agentxSessOpenTime;
bits32_t agentxSessAgentXVer;
bits32_t agentxSessTimeout;
} AX_SESSENT_T;
typedef struct AX_REGENT_S
{
bits32_t agentxConnIndex;
bits32_t agentxSessIndex;
bits32_t agentxRegIndex;
EBUFFER_T agentxRegContext;
OBJ_ID_T agentxRegStart;
bits32_t agentxRegRangeSubId;
bits32_t agentxRegUpperBound;
bits32_t agentxRegPriority;
bits32_t agentxRegTimeout;
bits32_t agentxRegInstance;
} AX_REGENT_T;
/* API prototypes */
boolean_t AxGetScalar (int scalarCode, bits32_t *value);
AX_CONNENT_T *AxConnGetEntry (int tcount, OIDC_T *tlist);
AX_CONNENT_T *AxConnGetNext (int tcount, OIDC_T *tlist);
AX_SESSENT_T *AxSessGetEntry (int tcount, OIDC_T *tlist);
AX_SESSENT_T *AxSessGetNext (int tcount, OIDC_T *tlist);
AX_REGENT_T *AxRegGetEntry (int tcount, OIDC_T *tlist);
AX_REGENT_T *AxRegGetNext (int tcount, OIDC_T *tlist);
/* axmth.c prototypes: GENERAL group */
void agentxGeneral_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxGeneral_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
/* axmth.c prototypes: CONNECTION group */
void agentxConnectionEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
AX_CONNENT_T *agentxConnectionEntry_first (void);
void agentxConnectionEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
bits32_t agentxConnectionEntry_build_instance (AX_CONNENT_T *axConnEntry, OIDC_T *tempInst);
void agentxConnection_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxConnection_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void setAxConnTblLastChg (bits32_t timeStamp);
void agentxFreeConnEntry (ptr_t pConnEntry);
/* axmth.c prototypes: SESSION group */
void agentxSessionEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxSessionEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxSessionEntry_test (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxSessionEntry_set (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxSession_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxSession_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
/* axmth.c prototypes: REGISTRATION group */
void agentxRegistrationEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxRegistrationEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxRegistration_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
void agentxRegistration_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
/* mibLeaf.h definitions moved here for convenience */
#define LEAF_agentxDefaultTimeout 1
#define MIN_agentxDefaultTimeout 0L
#define MAX__agentxDefaultTimeout 255L
#define LEAF_agentxMasterAgentXVer 2
#define MIN_agentxMasterAgentXVer 1L
#define MAX__agentxMasterAgentXVer 255L
#define LEAF_agentxConnTableLastChange 1
#define LEAF_agentxConnIndex 1
#define MIN_agentxConnIndex 1L
#define MAX__agentxConnIndex 4294967295L
#define LEAF_agentxConnTransportTime 2
#define LEAF_agentxConnTransportDomain 3
#define LEAF_agentxConnTransportAddress 4
#define MINSIZE_agentxConnTransportAddress 0L
#define MAX_SIZE_agentxConnTransportAddress 255L
#define LEAF_agentxSessionTableLastChange 1
#define LEAF_agentxSessionIndex 1
#define MIN_agentxSessionIndex 0L
#define MAX__agentxSessionIndex 4294967295L
#define LEAF_agentxSessionObjectID 2
#define LEAF_agentxSessionDescr 3
#define MINSIZE_agentxSessionDescr 0L
#define MAX_SIZE_agentxSessionDescr 255L
#define LEAF_agentxSessionAdminStatus 4
#define VAL_agentxSessionAdminStatus_up 1L
#define VAL_agentxSessionAdminStatus_down 2L
#define LEAF_agentxSessionOpenTime 5
#define LEAF_agentxSessionAgentXVer 6
#define MIN_agentxSessionAgentXVer 1L
#define MAX__agentxSessionAgentXVer 255L
#define LEAF_agentxSessionTimeout 7
#define MIN_agentxSessionTimeout 0L
#define MAX__agentxSessionTimeout 255L
#define LEAF_agentxRegistrationTableLastChange 1
#define LEAF_agentxRegIndex 1
#define MIN_agentxRegIndex 1L
#define MAX__agentxRegIndex 4294967295L
#define LEAF_agentxRegContext 2
#define LEAF_agentxRegStart 3
#define LEAF_agentxRegRangeSubId 4
#define LEAF_agentxRegUpperBound 5
#define LEAF_agentxRegPriority 6
#define LEAF_agentxRegTimeout 7
#define MIN_agentxRegTimeout 0L
#define MAX__agentxRegTimeout 255L
#define LEAF_agentxRegInstance 8
#define VAL_agentxRegInstance_true 1L
#define VAL_agentxRegInstance_false 2L
#endif /* _RFC2742API_H_ */
@@ -0,0 +1,62 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/bstring.h,v 1.1.1.1 2001/11/05 17:47:22 tneale Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1996-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: bstring.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.2 2001/01/19 22:22:03 paul
* Update copyright.
*
* Revision 9.1 2000/03/17 19:48:31 meister
* Update copyright notice
*
* Revision 9.0 1998/10/16 22:10:07 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:27 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:22 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:02 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 1.1 1996/01/22 20:58:52 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
/* This is a placeholder file for use with older makefiles that require
it for dependency reasons. */
@@ -0,0 +1,338 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/buffer.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1988-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: buffer.h,v $
* Revision 1.2 2001/11/06 21:35:01 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:04 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:31 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:33 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:55:08 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:07 sar
* Update version stamp to match release
*
* Revision 8.3 1998/06/18 04:42:00 sar
* Modified bflags in ebuffer to be unsigned ints and updated
* calling routines accordingly
*
* Revision 8.2 1998/05/23 20:01:13 sar
* Added EBufferAllocateLoad and updated some types
*
* Revision 8.1 1998/02/25 04:50:28 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:23 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:05 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:34 sra
* Release 6.0.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.6 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.5 1993/04/22 20:14:13 sar
* Updating of macros and defines to use new naming scheme and get the
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
* for example).
*
* Revision 3.4 1993/03/20 00:21:50 sar
* Replaced EBufferAdd with EBufferAdjust which takes a length and if
* necessary extends the buffer.
* Added EBufferReplace which puts the given string into the buffer
* extending the buffer if necessary.
*
* Revision 3.3 1993/03/05 03:56:25 dab
* fixed up types
*
* Revision 3.2 1993/03/02 19:04:38 sar
* added definition of EBuffer_add which extends the string in a buffer.
*
* Revision 3.1 1993/02/17 20:46:41 sar
* Added EBufferStart - macro: obtain address of first byte in a buffer.
* Added EBufferSeek - definition: move the pointer in a buffer.
*
* Revision 3.0 92/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.102 1992/03/31 14:04:08 dab
* Fixed EBufferReset to fixup the remaining field too.
*
* Revision 2.101 92/02/04 11:04:37 dab
* Changed the EBufferReset macro to return void.
*
* Revision 2.100 91/08/09 14:09:44 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:21 romkey
* Initial revision
*
*
* Revision 2.0 31-Mar-1990 15:11:22 dab
* Release 2.00
*
* Rev 1.1 19 Sep 1988 17:27:04
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:12
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(buffer_inc))
#define buffer_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* The EBUFFER_T structure is used to control encoding into a buffer */
typedef struct EBUFFER_S
{
unsigned int bflags;
bits8_t *start_bp; /* Start of the buffer. */
bits8_t *next_bp; /* Next location in buffer to be filled */
ALENGTH_T remaining; /* Number of empty spots remaining in buffer*/
} EBUFFER_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* Values for bflags */
#define BFL_IS_ALLOC 0x0002 /* Buffer must be obtained */
#define BFL_IS_DYNAMIC 0x0001 /* Buffer was obtained by malloc */
#define BFL_IS_STATIC 0x0000 /* Buffer is statically allocated */
/****************************************************************************
NAME: EBufferInitialize
PURPOSE: Initialize a buffer to a know, but not usable state
EBufferSetup must be used to make the buffer ready for use.
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: Nothing
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferInitialize(E) (((EBUFFER_T *)(E))->bflags=0, \
((EBUFFER_T *)(E))->next_bp=(bits8_t *)0, \
((EBUFFER_T *)(E))->start_bp=(bits8_t *)0, \
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)0)
/****************************************************************************
NAME: EBufferSetup
PURPOSE: Setup a buffer to receive ASN.1 encoded data
PARAMETERS:
unsigned int BFL_xxx flags from buffer.h
EBUFFER_T * Buffer descriptor
bits8_t * Address of the buffer
ALENGTH_T Length of the buffer
RETURNS: Nothing
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferSetup(F,E,B,L) (((EBUFFER_T *)(E))->bflags=(F), \
((EBUFFER_T *)(E))->start_bp=(bits8_t *)(B), \
((EBUFFER_T *)(E))->next_bp=(bits8_t *)(B), \
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)(L))
/****************************************************************************
NAME: EBufferPreLoad
PURPOSE: Pre-load data into a buffer
PARAMETERS:
unsigned int BFL_xxx flags from buffer.h
EBUFFER_T * Buffer descriptor
bits8_t * Address of the buffer containing the data
ALENGTH_T Length of the data
RETURNS: Nothing
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferPreLoad(F,E,B,L) ( \
((EBUFFER_T *)(E))->bflags=(F), \
((EBUFFER_T *)(E))->start_bp=(bits8_t *)(B), \
((EBUFFER_T *)(E))->next_bp=((bits8_t *)(B)+(ALENGTH_T)(L)), \
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)0)
/****************************************************************************
NAME: EBufferNext
PURPOSE: Obtain address of next free byte in a buffer
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: bits8_t * Buffer descriptor
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferNext(E) (((EBUFFER_T *)(E))->next_bp)
/****************************************************************************
NAME: EBufferStart
PURPOSE: Obtain address of first byte in a buffer
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: bits8_t * Buffer descriptor
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferStart(E) (((EBUFFER_T *)(E))->start_bp)
/****************************************************************************
NAME: EBufferUsed
PURPOSE: Indicate how many octets are currently in the buffer.
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: ALENGTH_T Number of octets used.
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferUsed(E) ((ALENGTH_T)((((EBUFFER_T *)(E))->next_bp) - \
(((EBUFFER_T *)(E))->start_bp)))
/****************************************************************************
NAME: EBufferRemaining
PURPOSE: Indicate how many octets are currently unused in the buffer.
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: ALENGTH_T Number of octets unused.
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferRemaining(E) (((EBUFFER_T *)(E))->remaining)
/****************************************************************************
NAME: EBufferReset
PURPOSE: Reset the buffer to an empty state, just like after EBufferSetup
PARAMETERS:
EBUFFER_T * Buffer descriptor
RETURNS: Nothing
RESTRICTIONS:
BUGS:
****************************************************************************/
#define EBufferReset(E) ( \
(((EBUFFER_T *)(E))->remaining += \
((EBUFFER_T *)(E))->next_bp - \
((EBUFFER_T *)(E))->start_bp), \
((void)(((EBUFFER_T *)(E))->next_bp = \
((EBUFFER_T *)(E))->start_bp)))
extern int EBufferClone __((EBUFFER_T *, EBUFFER_T *));
extern void EBufferClean __((EBUFFER_T *));
extern void EBufferAppend __((EBUFFER_T *, EBUFFER_T *));
extern int EBufferSeek __((EBUFFER_T *, ALENGTH_T, int));
extern int EBufferAdjust __((EBUFFER_T *, ALENGTH_T));
extern int EBufferReplace __((EBUFFER_T *, bits8_t *, ALENGTH_T));
extern int EBufferAllocateLoad __((unsigned int, EBUFFER_T *,
bits8_t *, ALENGTH_T));
#ifdef __cplusplus
}
#endif
#endif /* buffer_inc */
@@ -0,0 +1,310 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/buildpkt.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1988-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: buildpkt.h,v $
* Revision 1.2 2001/11/06 21:35:02 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.7 2001/01/19 22:22:04 paul
* Update copyright.
*
* Revision 9.6 2000/03/17 19:48:32 meister
* Update copyright notice
*
* Revision 9.5 2000/03/09 16:55:22 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.4 2000/03/09 13:51:30 josh
* a shell function has been created to allow SNMPv3 requests
* to be created while we're holding the coarse lock.
*
* Revision 9.3 1999/09/21 21:30:20 josh
* correcting VBL_Bind_* macros
*
* Revision 9.2 1999/09/14 19:44:11 josh
* prototypes and macros for VBL_Bind_*() functions/macros
*
* Revision 9.1 1999/04/09 20:37:00 josh
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
*
* Revision 9.0 1998/10/16 22:10:08 sar
* Update version stamp to match release
*
* Revision 8.5 1998/07/20 02:01:23 sar
* Removed dynamic/static tags from v3 packet creation routine
*
* Revision 8.4 1998/06/18 04:42:02 sar
* Modified bflags in ebuffer to be unsigned ints and updated
* calling routines accordingly
*
* Revision 8.3 1998/05/29 03:53:54 sar
* Add and use defines for v2 types and v2 protocol pieces. This allows
* us to include the types and pieces for other versions, such as v3,
* without having to touch all of the seperate files that use the
* types or pieces.
*
* Revision 8.2 1998/05/23 20:04:07 sar
* Added creation function for v3 requests
*
* Revision 8.1 1998/02/25 04:50:30 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:23 sar
* Updated revision to 8.0
*
* Revision 7.4 1997/03/20 06:48:06 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.3 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.2 1996/12/04 18:42:08 sar
* Added a definition for SNMP_Bind_OBJECT_ID to make older versions
* of Emissary happy.
*
* Revision 7.1 1996/10/15 14:28:01 sar
* Added create_internal_request
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.2 1996/01/10 16:23:25 sar
* USEC updates
*
* Revision 6.1 1995/10/20 22:53:35 sar
* remvoed nsapaddress function
* removed create functions for party system
* remvoed bitstring function
*
* Revision 6.0 1995/05/31 21:46:38 sra
* Release 6.0.
*
* Revision 5.3 1995/03/20 23:11:33 sar
* Moved index_to_vbp to snmpdefs.h and included snmpdefs.h for backward
* compatibility.
*
* Revision 5.2 1994/10/03 21:20:27 sar
* Added the def for SNMP_Create_V2_Half_Trap
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Rearrange some items to deal with removing v2 types from v1 settings if
* they aren't installed.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.6 1993/05/17 14:04:13 sar
* changed SNMP_Create_Party_Request to be SNMP_Create_V2_Request
*
* Revision 3.5 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.4 1993/04/27 21:06:48 sar
* Removed index_to_vbp it is now in buildpkt.h
*
* Revision 3.3 1993/04/26 20:33:14 sar
* Added bitstrings, and have deletion of parties or contexts delete acls.
*
* Revision 3.2 1993/03/25 21:15:21 sar
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
*
* Revision 3.1 1993/02/17 20:47:28 sar
* Added SNMP_Create_Party_Request - definition: create a v2 packet.
*
* Revision 3.0 92/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.100 91/08/09 14:09:45 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:22 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:20
* Release 2.00
*
* Rev 1.4 25 Jan 1989 11:55:50
* Corrected definitions of macros SNMP_Bind_Counter, SNMP_Bind_Gauge, and
* SNMP_Bind_Timeticks -- each of these had the type mis-defined.
* Also added a new macro -- SNMP_Bind_Opaque.
*
* Rev 1.3 11 Jan 1989 12:10:10
* Buildpkt.c split into multiple files to prevent linker from picking up
* unused routines.
*
* Rev 1.2 22 Sep 1988 18:38:14
* Added definitions for SNMP_Bind_Null().
*
* Rev 1.1 19 Sep 1988 17:27:04
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:14
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(buildpkt_inc))
#define buildpkt_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(snmp_inc))
#include <wrn/wm/snmp/engine/snmp.h>
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#define SNMP_Bind_Counter(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
L, VT_COUNTER, V)
#define SNMP_Bind_Gauge(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
L, VT_GAUGE, V)
#define SNMP_Bind_Timeticks(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
L, VT_TIMETICKS, V)
#define SNMP_Bind_Opaque(P,I,C,L,W,S,D) SNMP_Bind_String(P, I, C, L, \
VT_OPAQUE, W, S, D)
#define VBL_Bind_Counter(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
L, VT_COUNTER, V)
#define VBL_Bind_Gauge(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
L, VT_GAUGE, V)
#define VBL_Bind_Timeticks(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
L, VT_TIMETICKS, V)
#define VBL_Bind_Opaque(P,I,C,L,W,S,D) VBL_Bind_String(P, I, C, L, \
VT_OPAQUE, W, S, D)
/* Defined to clean up an error in some versions of Emissary */
#define SNMP_Bind_OBJECT_ID SNMP_Bind_Object_ID
/* We only install some functions if their types are installed */
#if (ENVOY_USE_V2_TYPES)
#define SNMP_Bind_Counter64(P,I,C,L,H,LO) SNMP_Bind_64_Unsigned_Integer(P, I,\
C, L, VT_COUNTER64, H, LO)
#define VBL_Bind_Counter64(P,I,C,L,H,LO) VBL_Bind_64_Unsigned_Integer(P, I,\
C, L, VT_COUNTER64, H, LO)
#endif
#if (INSTALL_ENVOY_SNMP_VERSION_3)
extern SNMP_PKT_T * SNMP_Create_Request_V3_Lockable __((int, int, bits32_t,
bits32_t, bits8_t,
bits32_t, bits8_t *,
ALENGTH_T, bits8_t *,
ALENGTH_T, bits8_t *,
ALENGTH_T, bits8_t *,
ALENGTH_T, sbits32_t,
int, int, int, int));
extern SNMP_PKT_T * SNMP_Create_Request_V3 __((int, int, bits32_t,
bits32_t, bits8_t, bits32_t,
bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
sbits32_t, int, int, int));
#endif
extern SNMP_PKT_T * SNMP_Create_Request2 __((int, int, int, char *,
INT_32_T, int, int, int));
#define SNMP_Create_Request(PDU, VER, CLEN, CSTR, RID, VBS) \
SNMP_Create_Request2(PDU, VER, CLEN, CSTR, RID, VBS, 0, 0)
extern SNMP_PKT_T *SNMP_Create_Internal_Request __((int, int, int, sbits8_t *,
unsigned short int,
INT_32_T, int, int, int,
ALENGTH_T, IO_COMPLETE_T *,
ERR_COMPLETE_T *, PTR_T));
extern SNMP_PKT_T * SNMP_Create_Trap __((int, int, char *, int,
OIDC_T *, OCTET_T *, int,
INT_32_T, UINT_32_T, int));
extern int SNMP_Bind_Integer __((SNMP_PKT_T *, int, int,
OIDC_T *, INT_32_T));
extern int SNMP_Bind_Unsigned_Integer __((SNMP_PKT_T *, int, int,
OIDC_T *, OCTET_T, UINT_32_T));
extern int SNMP_Bind_IP_Address __((SNMP_PKT_T *, int, int,
OIDC_T *, OCTET_T *));
extern int SNMP_Bind_Object_ID __((SNMP_PKT_T *, int, int,
OIDC_T *, int, OIDC_T *));
extern int SNMP_Bind_String __((SNMP_PKT_T *, int, int,
OIDC_T *, OCTET_T,
int, OCTET_T *, int));
extern int SNMP_Bind_Null __((SNMP_PKT_T *, int, int, OIDC_T *));
extern int VBL_Bind_Integer __((VBL_T *, int, int,
OIDC_T *, INT_32_T));
extern int VBL_Bind_Unsigned_Integer __((VBL_T *, int, int,
OIDC_T *, OCTET_T, UINT_32_T));
extern int VBL_Bind_IP_Address __((VBL_T *, int, int,
OIDC_T *, OCTET_T *));
extern int VBL_Bind_Object_ID __((VBL_T *, int, int,
OIDC_T *, int, OIDC_T *));
extern int VBL_Bind_String __((VBL_T *, int, int,
OIDC_T *, OCTET_T,
int, OCTET_T *, int));
extern int VBL_Bind_Null __((VBL_T *, int, int, OIDC_T *));
/* We only install some functions if their types are installed */
#if (ENVOY_USE_V2_TYPES)
extern int SNMP_Bind_64_Unsigned_Integer __((SNMP_PKT_T *, int, int,
OIDC_T *, OCTET_T,
UINT_32_T, UINT_32_T));
extern int VBL_Bind_64_Unsigned_Integer __((VBL_T *, int, int,
OIDC_T *, OCTET_T,
UINT_32_T, UINT_32_T));
#endif
#ifdef __cplusplus
}
#endif
#endif /* buildpkt_inc */
@@ -0,0 +1,230 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/decode.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1986-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: decode.h,v $
* Revision 1.2 2001/11/06 21:35:02 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.3 2001/01/19 22:22:04 paul
* Update copyright.
*
* Revision 9.2 2000/03/17 19:48:33 meister
* Update copyright notice
*
* Revision 9.1 2000/03/09 16:55:35 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:09 sar
* Update version stamp to match release
*
* Revision 8.3 1998/05/29 03:53:55 sar
* Add and use defines for v2 types and v2 protocol pieces. This allows
* us to include the types and pieces for other versions, such as v3,
* without having to touch all of the seperate files that use the
* types or pieces.
*
* Revision 8.2 1998/05/23 20:02:36 sar
* Added A_DecodeOctetWTC
*
* Revision 8.1 1998/02/25 04:50:32 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:24 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:08 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.1 1995/10/20 22:53:35 sar
* removed bitstring & uinteger32 options
*
* Revision 6.0 1995/05/31 21:46:40 sra
* Release 6.0.
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Rearrange some items to deal with removing v2 types from v1 settings if
* they aren't installed.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.1 1994/05/02 17:03:55 sar
* Added a new decode error (AE_WRONG_TYPE) for use with some new routines
* that do type checking while pulling a value out.
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.5 1993/06/17 23:30:45 sar
* Modifed decode of bit strings as it was wrong.
*
* Revision 3.4 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.3 1993/04/28 22:00:38 sar
* Moved the definition of UINT_64_T to ui64.h and update others
*
* Revision 3.2 1993/04/26 20:33:14 sar
* Added bitstrings, and have deletion of parties or contexts delete acls.
*
* Revision 3.1 1993/03/25 21:15:21 sar
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
*
* Revision 3.0 1992/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.101 92/02/05 18:49:08 dab
* Fixed up casting in A_DecodeTypeClass for MSC.
*
* Revision 2.100 91/08/09 14:09:45 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:23 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:26
* Release 2.00
*
* Rev 1.3 23 Mar 1989 11:55:58
* Merged the decode helper into the one routine that used it.
*
* Rev 1.2 18 Mar 1989 11:57:26
* Revised prototypes for A_DecodeOctetStringData and A_DecodeOctetString
*
* Rev 1.1 19 Sep 1988 17:27:04
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:14
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(decode_inc))
#define decode_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(localio_inc))
#include <wrn/wm/snmp/engine/localio.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(ui64_inc))
#include <wrn/wm/snmp/engine/ui64.h>
#endif
/****************************************************************************
NAME: A_DecodeTypeClass
PURPOSE: Decode the Class and Form bits from an ASN.1 type field.
The data stream is read using the local I/O package.
The stream pointer is NOT advanced, leaving it pointing to the
start of the type field, ready for a subsequent call to
A_DecodeTypeValue.
CAVEAT: The user should call this return *BEFORE* calling
A_DecodeTypeValue.
PARAMETERS: LCL_FILE * A stream descriptor (already open)
RETURNS: OCTET_T The Class and Form bits
RESTRICTIONS: It is assumed that the stream is not at EOF.
****************************************************************************/
#define A_DecodeTypeClass(L) ((OCTET_T) (Lcl_Peekc((LCL_FILE *)(L)) & \
A_IDCF_MASK))
/****************************************************************************
Decoding errors
****************************************************************************/
#define AE_PREMATURE_END 1
#define AE_INDEFINITE_LENGTH 2
#define AE_WRONG_VALUE 3
#define AE_WRONG_TYPE 4
#define AE_WRONG_LENGTH 5
#define AE_ALLOC_FAILURE 6
extern ATVALUE_T A_DecodeTypeValue __((LCL_FILE *, int *));
extern ALENGTH_T A_DecodeLength __((LCL_FILE *, int *));
extern void A_DecodeOctetStringData __((LCL_FILE *, ALENGTH_T,
EBUFFER_T *, int *));
extern void A_DecodeOctetString __((LCL_FILE *, EBUFFER_T *,
int *));
extern void A_DecodeOctetStringWTC __((LCL_FILE *, EBUFFER_T *,
int *, ATVALUE_T,
OCTET_T));
extern bits8_t A_DecodeOctetWTC __((LCL_FILE *, int *,
ATVALUE_T, bits8_t));
extern INT_32_T A_DecodeIntegerData __((LCL_FILE *, ALENGTH_T,
int *));
extern INT_32_T A_DecodeInteger __((LCL_FILE *, int *));
extern INT_32_T A_DecodeIntegerWTC __((LCL_FILE *, int *,
ATVALUE_T, OCTET_T));
extern void A_DecodeObjectIdData __((LCL_FILE *, ALENGTH_T,
OBJ_ID_T *, int *));
extern void A_DecodeObjectId __((LCL_FILE *, OBJ_ID_T *,
int *));
extern void A_DecodeObjectIdWTC __((LCL_FILE *, OBJ_ID_T *,
int *, ATVALUE_T,
OCTET_T));
/* We only install some functions if their types are installed */
#if (ENVOY_USE_V2_TYPES)
extern void A_DecodeInteger64Data __((LCL_FILE *, ALENGTH_T,
UINT_64_T *, int *));
extern void A_DecodeInteger64 __((LCL_FILE *, UINT_64_T *,
int *));
#endif
#ifdef __cplusplus
}
#endif
#endif /* decode_inc */
@@ -0,0 +1,184 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/encode.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1986-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: encode.h,v $
* Revision 1.2 2001/11/06 21:35:02 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.3 2001/01/19 22:22:04 paul
* Update copyright.
*
* Revision 9.2 2000/03/17 19:48:33 meister
* Update copyright notice
*
* Revision 9.1 2000/03/09 16:55:43 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:10 sar
* Update version stamp to match release
*
* Revision 8.2 1998/05/29 03:53:55 sar
* Add and use defines for v2 types and v2 protocol pieces. This allows
* us to include the types and pieces for other versions, such as v3,
* without having to touch all of the seperate files that use the
* types or pieces.
*
* Revision 8.1 1998/02/25 04:50:33 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:24 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:09 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.1 1995/10/20 22:53:35 sar
* removed bitstring & uinteger32 options
*
* Revision 6.0 1995/05/31 21:46:41 sra
* Release 6.0.
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Rearrange some items to deal with removing v2 types from v1 settings if
* they aren't installed.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.4 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.3 1993/04/28 22:00:38 sar
* Moved the definition of UINT_64_T to ui64.h and update others
*
* Revision 3.2 1993/04/26 20:33:14 sar
* Added bitstrings, and have deletion of parties or contexts delete acls.
*
* Revision 3.1 1993/03/25 21:15:21 sar
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
*
* Revision 3.0 1992/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.101 91/08/12 12:53:01 dab
* Added EHELPER_T so as to declare the arguments to the helper function.
*
* Revision 2.100 91/08/09 14:09:46 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:24 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:24
* Release 2.00
*
* Rev 1.1 19 Sep 1988 17:27:06
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:16
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01b,03jun09,y_t update for requirement WIND00161876
01a,19apr05,job update copyright notices
*/
#if (!defined(encode_inc))
#define encode_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(ui64_inc))
#include <wrn/wm/snmp/engine/ui64.h>
#endif
typedef ALENGTH_T (EHELPER_T) __((PTR_T, OCTET_T *, ALENGTH_T));
extern ALENGTH_T A_SizeOfInt __((INT_32_T));
extern ALENGTH_T A_SizeOfUnsignedInt __((UINT_32_T));
extern ALENGTH_T A_SizeOfObjectId __((OBJ_ID_T *));
/* We only install some functions if their types are installed */
#if (ENVOY_USE_V2_TYPES)
extern ALENGTH_T A_SizeOfUnsignedInt64 __((UINT_64_T *));
#endif
extern void A_EncodeType __((ATVALUE_T, OCTET_T,
EHELPER_T *, OCTET_T *));
extern void A_EncodeLength __((ALENGTH_T, EHELPER_T *,
OCTET_T *));
extern void A_EncodeInt __((ATVALUE_T, OCTET_T,
INT_32_T, EHELPER_T *,
OCTET_T *));
extern void A_EncodeUnsignedInt __((ATVALUE_T, OCTET_T,
UINT_32_T, EHELPER_T *,
OCTET_T *));
extern void A_EncodeOctetString __((ATVALUE_T, OCTET_T,
OCTET_T *, ALENGTH_T,
EHELPER_T *, OCTET_T *));
extern void A_EncodeObjectId __((ATVALUE_T, OCTET_T,
OBJ_ID_T *, EHELPER_T *,
OCTET_T *));
/* We only install some functions if their types are installed */
#if (ENVOY_USE_V2_TYPES)
extern void A_EncodeUnsignedInt64 __((ATVALUE_T, OCTET_T,
UINT_64_T , EHELPER_T *,
OCTET_T *));
#endif
extern EHELPER_T A_EncodeHelper;
#ifdef __cplusplus
}
#endif
#endif /* encode_inc */
@@ -0,0 +1,202 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/entlogic.h,v 1.1 2002/05/23 18:47:30 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* All rights reserved.
****************************************************************************/
/*
* $Log: entlogic.h,v $
* Revision 1.1 2002/05/23 18:47:30 josh
* support for the entLogicalTable from RFC 2737
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(ent_logical_inc))
#define ent_logical_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define ETC_ENT_LOGICAL_MAX_INDEX 0x7fffffff
#define ETC_ENT_LOGICAL_MAX 255
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct ENT_LOGICAL_S
{
struct ENT_LOGICAL_S *next;
bits32_t entLogicalIndex;
EBUFFER_T entLogicalDescr;
OBJ_ID_T entLogicalType;
EBUFFER_T entLogicalCommunity;
EBUFFER_T entLogicalTAddress;
OBJ_ID_T entLogicalTDomain;
EBUFFER_T entLogicalContextEngineID;
EBUFFER_T entLogicalContextName;
bits16_t flags;
} ENT_LOGICAL_T;
/* global root pointer for target params list */
extern ENT_LOGICAL_T *root_ent_logical;
#define Ent_Logical_Set_Defaults(L) \
(MEMSET((L), 0, sizeof(ENT_LOGICAL_T)), \
EBufferInitialize(&((L)->entLogicalDescr)), \
EBufferInitialize(&((L)->entLogicalCommunity)), \
EBufferInitialize(&((L)->entLogicalTAddress)), \
EBufferInitialize(&((L)->entLogicalContextEngineID)), \
EBufferInitialize(&((L)->entLogicalContextName)), \
(L)->flags = 0)
extern ENT_LOGICAL_T * Ent_Logical_Create __((void));
extern void Ent_Logical_Destroy __((ENT_LOGICAL_T *));
extern int Ent_Logical_Install __((ENT_LOGICAL_T *, bits32_t));
extern void Ent_Logical_Deinstall __((ENT_LOGICAL_T *));
extern ENT_LOGICAL_T * Ent_Logical_Lookup __((bits32_t));
extern ENT_LOGICAL_T * Ent_Logical_Next __((int, OIDC_T *));
extern ENT_LOGICAL_T * Ent_Logical_Next_Ent __((ENT_LOGICAL_T *));
#define Ent_Logical_Get_Index(L) ((L)->entLogicalIndex)
#define Ent_Logical_Set_Index(L, V) ((L)->entLogicalIndex = (V))
#define Ent_Logical_Get_Descr(L) (EBufferStart(&((L)->entLogicalDescr)))
#define Ent_Logical_Get_Descr_Len(L) (EBufferUsed(&((L)->entLogicalDescr)))
#define Ent_Logical_Set_Descr(L, S, N, F) \
(EBufferAllocateLoad((F), &((L)->entLogicalDescr), (S), (N)))
#define Ent_Logical_Get_Type(L) (&((L)->entLogicalType))
#define Ent_Logical_Set_Type(L, D, N) \
(build_object_id((N), (D), (&((L)->entLogicalType))))
#define Ent_Logical_Get_Community(L) \
(EBufferStart(&((L)->entLogicalCommunity)))
#define Ent_Logical_Get_Community_Len(L) \
(EBufferUsed(&((L)->entLogicalCommunity)))
#define Ent_Logical_Set_Community(L, S, N, F) \
(EBufferAllocateLoad((F), &((L)->entLogicalCommunity), (S), (N)))
#define Ent_Logical_Get_TAddress(L) \
(EBufferStart(&((L)->entLogicalTAddress)))
#define Ent_Logical_Get_TAddress_Len(L) \
(EBufferUsed(&((L)->entLogicalTAddress)))
#define Ent_Logical_Set_TAddress(L, S, N, F) \
(EBufferAllocateLoad((F), &((L)->entLogicalTAddress), (S), (N)))
#define Ent_Logical_Get_TDomain(L) (&((L)->entLogicalTDomain))
#define Ent_Logical_Set_TDomain(L, D, N) \
(build_object_id((N), (D), (&((L)->entLogicalTDomain))))
#define Ent_Logical_Get_Context_Engine_ID(L) \
(EBufferStart(&((L)->entLogicalContextEngineID)))
#define Ent_Logical_Get_Context_Engine_ID_Len(L) \
(EBufferUsed(&((L)->entLogicalContextEngineID)))
#define Ent_Logical_Set_Context_Engine_ID(L, S, N, F) \
(EBufferAllocateLoad((F), &((L)->entLogicalContextEngineID), (S), (N)))
#define Ent_Logical_Get_Context_Name(L) \
(EBufferStart(&((L)->entLogicalContextName)))
#define Ent_Logical_Get_Context_Name_Len(L) \
(EBufferUsed(&((L)->entLogicalContextName)))
#define Ent_Logical_Set_Context_Name(L, S, N, F) \
(EBufferAllocateLoad((F), &((L)->entLogicalContextName), (S), (N)))
#define Ent_Logical_Get_Flags(L) ((L)->flags)
#define Ent_Logical_Set_Flags(L, V) ((L)->flags = (bits16_t)(V))
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct ENT_GENERAL_S
{
bits32_t entLastChangeTime;
} ENT_GENERAL_T;
/* Global pointer for the entityGeneral group */
extern ENT_GENERAL_T root_ent_general;
#define Ent_General_Set_Defaults(G) \
(MEMSET((G), 0, sizeof(ENT_GENERAL_T)))
#define Ent_General_Group_Lookup() (&root_ent_general)
#define Ent_General_Get_Last_Change_Time(G) ((G)->entLastChangeTime)
#define Ent_General_Set_Last_Change_Time(G, V) \
((G)->entLastChangeTime = (bits32_t) V)
/* Constants for entLogicalTable */
#define LEAF_entLogicalIndex 1
#define MIN_entLogicalIndex 1L
#define MAX_entLogicalIndex 2147483647L
#define LEAF_entLogicalDescr 2
#define MINSIZE_entLogicalDescr 0L
#define MAXSIZE_entLogicalDescr 255L
#define LEAF_entLogicalType 3
#define LEAF_entLogicalCommunity 4
#define MINSIZE_entLogicalCommunity 0L
#define MAXSIZE_entLogicalCommunity 255L
#define LEAF_entLogicalTAddress 5
#define MINSIZE_entLogicalTAddress 1L
#define MAXSIZE_entLogicalTAddress 255L
#define LEAF_entLogicalTDomain 6
#define LEAF_entLogicalContextEngineID 7
#define MINSIZE_entLogicalContextEngineID 0L
#define MAXSIZE_entLogicalContextEngineID 32L
#define LEAF_entLogicalContextName 8
#define MINSIZE_entLogicalContextName 0L
#define MAXSIZE_entLogicalContextName 255L
/* Constants for entGeneral group */
#define LEAF_entLastChangeTime 1
extern void entLogicalEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void entLogicalEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void entityGeneral_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void entityGeneral_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(ent_logical_inc))*/
@@ -0,0 +1,147 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/etimer.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: etimer.h,v $
* Revision 1.2 2001/11/06 21:35:02 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:04 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:34 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:33 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:55:57 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 2000/02/29 20:40:48 josh
* #ifdefs so we don't have semicolons sitting on lines alone in include
* files (the ARM compiler hates that).
*
* Revision 9.0 1998/10/16 22:10:10 sar
* Update version stamp to match release
*
* Revision 8.3 1998/08/12 04:52:15 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 8.2 1998/06/28 21:48:54 sar
* Added ENVOY_TIMER_32_T for functions that want 32 bit cookies
* and need to allocate space on the fly.
*
* Revision 8.1 1998/02/25 04:50:34 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:25 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:10 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:42 sra
* Release 6.0.
*
* Revision 1.1 1995/03/20 23:07:47 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(etimer_inc))
#define etimer_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined snmp_inc)
#include <wrn/wm/snmp/engine/snmp.h>
#endif
/* timer structure. Timer memory allocation is expected to be managed by
* code which calls into the timer system.
*
* Software using timers must call tm_init() on any timer before calling
* any other tm_ functions on it.
*/
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct ENVOY_TIMER_S {
struct ENVOY_TIMER_S *link; /* list link */
bits32_t expire; /* relative expiration time in ms */
void (*handler) __((struct ENVOY_TIMER_S *, void *));
/* expiration handler */
void *cookie; /* handler cookie */
} ENVOY_TIMER_T;
/* structure that contains a 32 bit id so the memory can be allocated
as a block, done here so that multiple routines can use it */
typedef struct ENVOY_TIMER_32_S {
struct ENVOY_TIMER_S timer;
bits32_t id;
} ENVOY_TIMER_32_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* timer calls
*/
void envoy_tm_init __((ENVOY_TIMER_T *)); /* init timer */
int envoy_tm_set __((ENVOY_TIMER_T *, bits32_t));/* set timer */
int envoy_tm_cancel __((ENVOY_TIMER_T *)); /* cancel timer */
/* global root pointer and init routine */
#if INSTALL_ENVOY_SNMP_LOCK
ENVOY_SNMP_LOCK_EXTERN(SNMP_TimerLock);
#endif
extern ENVOY_TIMER_T *envoy_timer_list;
void envoy_timer_init __((void));
#ifdef __cplusplus
}
#endif
#endif /* etimer_inc */
@@ -0,0 +1,196 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/localio.h,v 1.3 2003/01/15 13:58:56 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/*****************************************************************************
* Copyright 1986-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: localio.h,v $
* Revision 1.3 2003/01/15 13:58:56 josh
* directory structure shifting
*
* Revision 1.2 2001/11/06 21:50:40 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:05 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:34 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:33 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:56:08 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:14 sar
* Update version stamp to match release
*
* Revision 8.3 1998/06/22 03:11:10 sar
* Changed the type used for lengths in localio. We now use ALENGTH_Ts
* to make it match the rest of the code and keep compilers happy
*
* Revision 8.2 1998/02/25 15:21:23 sra
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
*
* Revision 8.1 1998/02/25 04:50:36 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:25 sar
* Updated revision to 8.0
*
* Revision 7.3 1997/03/20 06:48:11 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.2 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.1 1997/01/16 20:46:35 sar
* changed uchar to bits8_t
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.1 1996/01/10 16:23:25 sar
* Removed some no_pp stuff
* Added the start of buffer macro
*
* Revision 6.0 1995/05/31 21:46:43 sra
* Release 6.0.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.3 1993/05/19 20:07:52 sar
* tiding up types to make compilers happy, (timestamps to UINT_32_T,
* sizes to ALENGTH_T).
*
* Revision 3.2 1993/02/17 20:48:03 sar
* Added Lcl_Next - macro: get current position in buffer.
* Added Lcl_Dup - defin: duplicate a lcl_file.
* Changed Lcl_Size - macro: corrected lbuf->next to lbuf_next.
*
* Revision 3.1 92/07/31 11:54:43 dab
* Added Lcl_Size().
*
* Revision 3.0 92/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.101 92/02/05 18:49:59 dab
* In lcl_* macros don't cast L as (LCL_FILE *) because it already
* should be.
* Made sure all returns of Lcl_Getc() were the same type.
*
* Revision 2.100 91/08/09 14:09:46 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:26 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:26
* Release 2.00
*
* Rev 1.2 19 Sep 1988 17:48:36
* Added header and version identification lines. No code changes.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(localio_inc))
#define localio_inc
#ifdef __cplusplus
extern"C" {
#endif
/* Get the standard types */
#if !defined(EPILOGUE_TYPES_H)
#include <wrn/wm/common/types.h>
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct LCL_FILE_S
{
bits8_t lcl_flags;
bits8_t *lbuf_start;
bits8_t *lbuf_next;
bits8_t *lbuf_end; /* Address AFTER last byte */
} LCL_FILE;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define LCL_MALLOC 0x01 /* LCL_FILE was malloc-ed at open */
#define LCL_EOF 0x80 /* EOF encountered */
/* Start of buffer */
#define Lcl_Start(L) (L)->lbuf_start
#define Lcl_Eof(L) (((L)->lcl_flags&LCL_EOF)?-1:0)
/* Current position in stream. */
#define Lcl_Tell(L) (ALENGTH_T)((L)->lbuf_next - (L)->lbuf_start)
/* Address of current positon in buffer */
#define Lcl_Next(L) (L)->lbuf_next
/* Amount of data left in stream. */
#define Lcl_Size(L) (ALENGTH_T)((L)->lbuf_end - (L)->lbuf_next)
#define GETC_MACRO
#if defined(GETC_MACRO)
/* The following is an macro version of this routine Lcl_Getc */
#define Lcl_Getc(L) ( (((L)->lcl_flags & LCL_EOF) ? -1 : \
(((L)->lbuf_next < (L)->lbuf_end) ? \
(int)(*((L)->lbuf_next++)) : \
(((L)->lcl_flags |= LCL_EOF), -1))))
#endif /* GETC_MACRO */
extern LCL_FILE *Lcl_Open (LCL_FILE *, bits8_t *, ALENGTH_T);
extern void Lcl_Close (LCL_FILE *);
#if !defined(GETC_MACRO)
extern int Lcl_Getc (LCL_FILE *);
#endif /* GETC_MACRO */
extern int Lcl_Peekc (LCL_FILE *);
extern ALENGTH_T Lcl_Read (LCL_FILE *, bits8_t *, ALENGTH_T);
extern int Lcl_Seek (LCL_FILE *, ALENGTH_T, int);
extern ALENGTH_T Lcl_Resize (LCL_FILE *, ALENGTH_T, int);
extern LCL_FILE *Lcl_Dup (LCL_FILE *, LCL_FILE *);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,567 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/mib.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1988-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: mib.h,v $
* Revision 1.2 2001/11/06 21:35:02 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.9.4.1 2001/08/24 14:11:25 josh
* make sure that standard declaration of NODE_NT zeroes all fields
*
* Revision 9.9 2001/04/11 20:12:00 josh
* merging changes from the kingfisher branch back onto
* the trunk
*
* Revision 9.8 2001/01/19 22:22:05 paul
* Update copyright.
*
* Revision 9.7.2.2 2001/03/12 22:07:54 tneale
* Updated copyright
*
* Revision 9.7.2.1 2000/10/13 21:17:33 josh
* function prototypes and static declarations to eliminate warnings
* from the Tornado compiler
*
* Revision 9.7 2000/03/17 19:48:35 meister
* Update copyright notice
*
* Revision 9.6 2000/03/09 20:58:33 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.5 2000/03/09 16:56:42 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.4 1999/12/23 14:47:26 josh
* cleaning up code per Shawn's comments -- removing extraneous
* comments and doing proxy check before notify check
*
* Revision 9.3 1999/11/12 23:20:28 josh
* fixing synchronous function prototypes
*
* Revision 9.2 1999/10/26 20:07:33 josh
* fix indeterminate function prototyping with forward declarations
*
* Revision 9.1 1999/05/24 20:12:11 josh
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
* to avoid C++ compiler errors.
*
* Revision 9.0 1998/10/16 22:10:15 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:40 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:26 sar
* Updated revision to 8.0
*
* Revision 7.6 1997/10/29 01:33:28 sar
* Only define the two character macros ("NO", "RW" etc) if the user
* asks for them via an installation option.
*
* Revision 7.5 1997/10/22 03:07:29 sar
* Mofied the agentx and older subagent schemes install options
*
* Revision 7.4 1997/10/16 00:25:17 sar
* Primarily this set of modifications is for the agentx protocol.
* Most of the work was in the agentx.h and ax_mth.h files. Most
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
* to their structures and snmp got some new lock macros.
*
* One other change of note was the modification of continue
* processing. Previously we called a specific continue routine
* directly, now we store a pointer to the corret continue
* function in the snmp packet structure and call that. We include
* macros for backwards compatibility.
*
* Revision 7.3 1997/09/16 19:19:23 sar
* Added the NT macros for leaves and nodes, these add a flag
* word to allow the mib compiler to set some flags in the mib
* tree structure. Emissary 7.0 can make use of these macros.
*
* Revision 7.2 1997/03/20 06:48:13 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:58 sra
* Release 6.0.
*
* Revision 5.4 1995/05/03 21:01:22 sar
* Added CREATE_ACCESS & NOTIFY_ACCESS
*
* Revision 5.3 1995/03/24 17:35:34 sar
* Added scalar/tabular arg to the leaf_asy and leaf_com macros, currently
* we just throw it away.
*
* Revision 5.2 1995/03/20 23:11:33 sar
* Added the ASY_*PROC_T method routines
* Updated the MIBLEAF_T structure to use the async method routine typedefs
* Added a compatibility structure for backwards compatibility
* Added a new series of macros to populate the mibleaf and compat structure.
*
* Revision 5.1 1994/08/04 22:05:29 sar
* Added multiple mib tree capability, including macros to translate the
* old apis into the new api's
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.3 1994/04/29 20:06:04 sar
* Added LEAF_INACTIVE flag and modified calling sequence for Find_Node.
*
* Revision 4.2 1994/02/01 23:37:07 sar
* Added flags for use with the Find, Add and Remove_Node routines.
*
* Revision 4.1 1993/09/30 19:32:16 sar
* Added a definition for TEST_CREATE in the list of defines for
* the form parameter to the testproc routine. TEST_CREATE specified
* that this call is to check if the given object can be created.
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.2 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.1 1993/03/02 18:16:06 dab
* Removed __() macro since this is defined in <types.h>
*
* Revision 3.0 1992/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.103 92/01/30 14:00:17 dab
* Added function parameter prototypes for the test, get, set, and next
* functions. Also added casts inthe LEAF and LEAFM macros to cast the
* routines to those prototypes.
*
* Revision 2.102 91/12/05 15:02:59 dab
* LEAF macro initializes mib view masks to 0xFFFFFFFF instead of just 0xFF.
*
* Revision 2.101 91/11/07 09:37:23 dab
* Made the view and write masks be 32 bits.
*
* Revision 2.100 91/08/09 14:09:47 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:28 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:24
* Release 2.00
*
* Rev 1.8 24 Sep 1989 22:06:34
* Renamed mib_root to mib_root_node to support the MIB compiler.
*
* Rev 1.7 11 Jan 1989 11:59:48
* Updated copyright dates.
*
* Rev 1.6 11 Jan 1989 11:09:20
* Added definitions of find_object_node() and find_next_object() for non-
* ANSI compilers.
*
* Rev 1.5 10 Oct 1988 21:47:00
* Reorganized source modules
*
* Rev 1.4 21 Sep 1988 16:34:00
* Revised spelling to conform to the usage "MGMT" in the MIB.
*
* Rev 1.3 20 Sep 1988 15:50:10
* Revised END_OF_ARC macro to avoid an improper type cast.
*
* Rev 1.2 19 Sep 1988 19:56:06
* Revised MIBARC structure and ARC macro to avoid casting structure
* pointers to a (char *) which, on machines like the Cray, could
* destroy the meaning of the pointer.
*
* Rev 1.1 19 Sep 1988 17:27:06
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:18
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(mib_inc))
#define mib_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
/* Definitions for "form" parameter to the "testproc" found in leaf nodes */
#define TEST_GET 0
#define TEST_SET 1
#define TEST_CREATE 2
/* Definitions for node_type in MIBNODE_T and MIBLEAF_T */
#define NODE_TYPE 0x01
#define INNER_NODE 0x00
#define LEAF_NODE 0x01
#define REMOVABLE 0x02
#define REPLACEABLE 0x04
#define SYSTEM_OWNED 0x08
#define NODE_DYNAMIC 0x10
#define LEAF_DYNAMIC 0x10
#define ARC_DYNAMIC 0x20
#define COOKIE_DYNAMIC 0x20
#define LEAF_INACTIVE 0x40
#define AGENTX_LEAF 0x80
struct SNMP_PKT_S;
struct VB_S;
typedef void ASY_TESTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
typedef void ASY_GETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
typedef void ASY_SETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
typedef void ASY_NEXTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
typedef int TESTPROC_T __((int form, OIDC_T lastmatch, int tcount,
OIDC_T *tlist, char *cookie,
struct SNMP_PKT_S *pktp, int indx));
typedef INT_32_T GETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
char *cookie,
struct SNMP_PKT_S *pktp));
typedef void SETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
char *cookie, INT_32_T value,
struct SNMP_PKT_S *pktp, int vb_index));
typedef int NEXTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
OIDC_T *rlist, char *cookie,
struct SNMP_PKT_S *pktp));
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* Define a MIB leaf node */
typedef struct MIBLEAF_S
{
unsigned short node_type; /* See above */
OCTET_T expected_tag; /* VT_xxx from snmp.h */
OCTET_T access_type; /* See below */
ASY_TESTPROC_T *testproc; /* Routine to check whether the */
/* indicated data object exists */
ASY_GETPROC_T *getproc; /* Routine to get the data */
ASY_SETPROC_T *setproc; /* Routine to set the data */
ASY_NEXTPROC_T *nextproc; /* Routine to locate "next" obj id */
char * user_cookie; /* Value to pass to unchanged */
UINT_16_T locator; /* The user can define any value for*/
/* this field. It is useful to */
/* give easy to handle names to */
/* leaves. */
UINT_32_T view_mask; /* A mask of the views of which this*/
/* leaf is a part. */
UINT_32_T write_mask; /* That subset of view_mask in which*/
/* is potentially writable. */
#if INSTALL_ENVOY_AGENTX_MASTER
bits32_t session_id; /* session for this object */
bits16_t ref_count; /* reference count */
bits8_t timeout; /* timeout period */
#endif
#if defined(DEBUG)
char * object_name; /* FOR DEBUGGING */
#endif
} MIBLEAF_T;
/* Bit values for access_type */
#define READ_ACCESS 0x01
#define WRITE_ACCESS 0x02
#define CREATE_ACCESS 0x04
#define NOTIFY_ACCESS 0x08
#define READ_WRITE_ACCESS (READ_ACCESS | WRITE_ACCESS)
#define READ_CREATE_ACCESS (READ_ACCESS | WRITE_ACCESS | CREATE_ACCESS)
#if INSTALL_ENVOY_TWO_CHAR_MACROS
#define RO READ_ACCESS /* READ ONLY ACCESS */
#define WO WRITE_ACCESS /* WRITE ONLY ACCESS */
#define RW (READ_ACCESS | WRITE_ACCESS) /* READ/WRITE ACCESS */
#define RC (READ_ACCESS | WRITE_ACCESS | CREATE_ACCESS) /* READ/CREATE */
#define NO NOTIFY_ACCESS /* NOTIFY ONLY ACCESS */
#endif
/* Bit values for scalar vs tabular type */
#define SCALAR 0x80
#define TABULAR 0x00
/* maximum size for a reference count */
#define AX_MAX_REF_COUNT 0xFFFF
/* Define an MIB internal (or root) node */
typedef struct MIBNODE_S
{
unsigned short node_type; /* See above */
struct MIBARC_S *arcs; /* Descendents from this node */
#if INSTALL_ENVOY_AGENTX_MASTER
MIBLEAF_T *leaf; /* leaf for this node */
#endif
} MIBNODE_T;
/* Define a pointer from a node to subsidiary node or a leaf */
/* These structures are aggregated into an array. */
/* THE LAST ELEMENT IN SUCH AN ARRAY MUST HAVE A NULL POINTER. */
typedef struct MIBARC_S
{
OIDC_T id; /* Object identifier component */
struct MIBARC_S *nodep; /* The descendent node/leaf */
} MIBARC_T;
/* Define a cookie structure to hold old style method routines for use with
the backwards compatibility method routines */
typedef struct COMPAT_ROUTINES_S
{
TESTPROC_T * testproc;
NEXTPROC_T * nextproc;
GETPROC_T * getproc;
SETPROC_T * setproc;
char * cookie;
} COMPAT_ROUTINES_T;
#define MIB_ISO 1 /* Level 0 - ISO *IS* #1 by fiat (!!) */
#define MIB_CCITT 2 /* Level 0 */
#define MIB_JOINT_ISO_CCITT 3 /* Level 0 */
#define MIB_ORG 3 /* Level 1 - {ISO 3} */
#define MIB_DOD 6 /* Level 2 - {ORG 6} */
#define MIB_INTERNET 1 /* Level 3 - {DOD 1} */
#define MIB_DIRECTORY 1 /* Level 4 - {INTERNET 1} */
#define MIB_MGMT 2 /* Level 4 - {INTERNET 2} */
#define MIB_MIB2 1 /* Level 5 - {MGMT 1} */
#define MIB_MIB1 1 /* Level 5 - {MGMT 1} */
#define MIB_SYSTEM 1 /* Level 6 - {MIB 1} */
#define MIB_INTERFACES 2 /* Level 6 - {MIB 2} */
#define MIB_AT 3 /* Level 6 - {MIB 3} */
#define MIB_IP 4 /* Level 6 - {MIB 4} */
#define MIB_ICMP 5 /* Level 6 - {MIB 5} */
#define MIB_TCP 6 /* Level 6 - {MIB 6} */
#define MIB_UDP 7 /* Level 6 - {MIB 7} */
#define MIB_EGP 8 /* Level 6 - {MIB 8} */
#define MIB_EXPERIMENTAL 3 /* Level 4 - {INTERNET 3} */
#define MIB_IETF 1 /* Level 5 - {EXPERIMENTAL 1} */
#define MIB_PRIVATE 4 /* Level 4 - {INTERNET 4} */
#define MIB_ENTERPRISE 1 /* Level 5 - {PRIVATE 1} */
#define ARC(ID,NODE) {ID, (struct MIBARC_S *)&NODE}
#define END_OF_ARC_LIST {0, (struct MIBARC_S *)0}
#define NODE(NAME, ARCLIST) {INNER_NODE, ARCLIST}
#if INSTALL_ENVOY_AGENTX_MASTER
#define NODE_NT(NAME, NT, ARCLIST) {(INNER_NODE | NT), ARCLIST, 0}
#else
#define NODE_NT(NAME, NT, ARCLIST) {(INNER_NODE | NT), ARCLIST}
#endif
#define SNMP_NULLPROC (int (*)())0
/* The LEAF macro is for release 1 mib.c and MIB Compiler */
#define LEAF(NAME, VT, ACCESS, TESTP, GETP, SETP, NXTP, COOKIE) \
{LEAF_NODE, VT, ACCESS, \
(TESTPROC_T *)TESTP, (GETPROC_T *)GETP, \
(SETPROC_T *)SETP, (NEXTPROC_T *)NXTP, \
(char *)COOKIE, 0, 0xFFFFFFFFL, 0xFFFFFFFFL}
/* The LEAFM macro is for release 2 mib.c and MIB Compiler */
#define LEAFM(NM, VT, ACC, TSTP, GETP, SETP, NXTP, CKE, LOC, VMSK, WMSK) \
{LEAF_NODE, VT, ACC, \
(TESTPROC_T *)TSTP, (GETPROC_T *)GETP, \
(SETPROC_T *)SETP, (NEXTPROC_T *)NXTP, \
(char *)CKE, LOC, VMSK, WMSK }
/* The LEAF_ASYS macro is for release envoy release 6 and is for use with
the async routines, it tags the leaf as static */
#define LEAF_ASYS(LN, NM, VT, AC, TB, TST, GET, SET, NEX, CKE, LOC, VMK, WMK) \
STATIC MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
(ASY_TESTPROC_T *)TST, (ASY_GETPROC_T *)GET, \
(ASY_SETPROC_T *)SET, (ASY_NEXTPROC_T *)NEX, \
(char *)CKE, LOC, VMK, WMK }
/* The LEAF_ASY macro is for release envoy release 6 and is for use with
the async routines */
#define LEAF_ASY(LN, NM, VT, AC, TB, TST, GET, SET, NEX, CKE, LOC, VMK, WMK) \
MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
(ASY_TESTPROC_T *)TST, (ASY_GETPROC_T *)GET, \
(ASY_SETPROC_T *)SET, (ASY_NEXTPROC_T *)NEX, \
(char *)CKE, LOC, VMK, WMK }
/* The LEAFCOMS macro is for envoy release 6 and is for use with the async
compatibility routines. The compat routines allow older non-async method
routines to be run from a newer async engine */
#define LEAF_COMS(LN, CN, NM, VT, AC, TB, TS, GT, ST, NX, CKE, LOC, VMK, WMK) \
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
(GETPROC_T *)GT, (SETPROC_T *)ST, \
(char *)CKE }; \
STATIC MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
(ASY_TESTPROC_T *)async_compat_test, \
(ASY_GETPROC_T *)async_compat_get, \
(ASY_SETPROC_T *)async_compat_set, \
(ASY_NEXTPROC_T *)async_compat_next, \
(char *)&CN, LOC, VMK, WMK }
#define LEAF_COM(LN, CN, NM, VT, AC, TB, TS, GT, ST, NX, CKE, LOC, VMK, WMK) \
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
(GETPROC_T *)GT, (SETPROC_T *)ST, \
(char *)CKE }; \
MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
(ASY_TESTPROC_T *)async_compat_test, \
(ASY_GETPROC_T *)async_compat_get, \
(ASY_SETPROC_T *)async_compat_set, \
(ASY_NEXTPROC_T *)async_compat_next, \
(char *)&CN, LOC, VMK, WMK }
/* The LEAF NT macros are for emissary release 7 and include a flag
argument to allow setting of the removable class flags */
#define LEAF_NT_ASYS(LN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
STATIC MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
(ASY_TESTPROC_T *)TS, (ASY_GETPROC_T *)GT, \
(ASY_SETPROC_T *)ST, (ASY_NEXTPROC_T *)NX, \
(char *)CK, LC, VM, WM }
#define LEAF_NT_ASY(LN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
(ASY_TESTPROC_T *)TS, (ASY_GETPROC_T *)GT, \
(ASY_SETPROC_T *)ST, (ASY_NEXTPROC_T *)NX, \
(char *)CK, LC, VM, WM }
/* The COM macros are for use with the async compatibility routines.
The compat routines allow older non-async method routines to
be run from a newer async engine */
#define LEAF_NT_COMS(LN, CN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
(GETPROC_T *)GT, (SETPROC_T *)ST, \
(char *)CK }; \
STATIC MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
(ASY_TESTPROC_T *)async_compat_test, \
(ASY_GETPROC_T *)async_compat_get, \
(ASY_SETPROC_T *)async_compat_set, \
(ASY_NEXTPROC_T *)async_compat_next, \
(char *)&CN, LC, VM, WM }
#define LEAF_NT_COM(LN, CN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
(GETPROC_T *)GT, (SETPROC_T *)ST, \
(char *)CK }; \
MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
(ASY_TESTPROC_T *)async_compat_test, \
(ASY_GETPROC_T *)async_compat_get, \
(ASY_SETPROC_T *)async_compat_set, \
(ASY_NEXTPROC_T *)async_compat_next, \
(char *)&CN, LC, VM, WM }
typedef struct MIBLOC_S
{
UINT_16_T ml_flags;
OIDC_T ml_last_match;
/* The following item splits out the "instance" part of the */
/* full object identifier. The number of components in the */
/* "base" part (i.e. the path to the leaf may be derived by */
/* vb_obj_id.num_components - ml_base_objid.num_components and */
/* the list of components being taken directly from */
/* vb_obj_id.component_list. */
OBJ_ID_T ml_remaining_objid;
union {
MIBLEAF_T *mlleaf_u;
MIBNODE_T *mlnode_u;
} mbl_u;
} MIBLOC_T;
#define ml_leaf mbl_u.mlleaf_u
#define ml_node mbl_u.mlnode_u
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* Values for ml_flags */
#define ML_IS_LEAF 0x01
/* Determine what the default root node will be */
#ifdef ENVOY_DEFAULT_MIB_ROOT_NODE
#define ENVOY_MIB_ROOT_NODE ENVOY_DEFAULT_MIB_ROOT_NODE
extern MIBNODE_T ENVOY_DEFAULT_MIB_ROOT_NODE;
#else
#define ENVOY_MIB_ROOT_NODE mib_root_node
extern MIBNODE_T mib_root_node;
#endif
extern INT_32_T Find_Node_From_Root __((MIBNODE_T *root,
OBJ_ID_T *objp,
MIBNODE_T **npp));
extern int Add_Node_From_Root __((MIBNODE_T *root,
OBJ_ID_T *objp,
MIBNODE_T *anode,
MIBNODE_T **rnode));
extern MIBNODE_T * Remove_Node_From_Root __((MIBNODE_T *root,
OBJ_ID_T *objp));
#if (INSTALL_ENVOY_AGENTX_MASTER)
extern sbits32_t Find_Leaf_From_Root __((MIBNODE_T *mibroot,
OBJ_ID_T *objid,
MIBLEAF_T **mibleaf));
extern int AX_Add_Leaf_From_Root __((MIBNODE_T *mibroot,
OBJ_ID_T *objp,
MIBLEAF_T *add_leaf,
MIBLEAF_T **rem_leaf));
extern MIBLEAF_T * AX_Remove_Leaf_From_Root __((MIBNODE_T *mibroot,
OBJ_ID_T *objid));
#endif /* #if (INSTALL_ENVOY_AGENTX_MASTER) */
#define Find_Node(O, N) Find_Node_From_Root (0, O, N)
#define Add_Node(O, A, R) Add_Node_From_Root (0, O, A, R)
#define Remove_Node(O) Remove_Node_From_Root (0, O)
#ifdef __cplusplus
}
#endif
#endif /* mib_inc */
@@ -0,0 +1,179 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/ntfy_chk.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: ntfy_chk.h,v $
* Revision 1.2 2001/11/06 21:35:03 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
* Tornado shuffle
*
* Revision 9.6.4.2 2001/08/07 18:33:56 josh
* adding support for SNMPv1/v2c/v3 coexistence to SNMP Notify code
*
* Revision 9.6.4.1 2001/06/28 18:22:56 josh
* Seeding the Cormorant branch with the code from the old
* cormorant branch
*
* Revision 9.6 2001/04/11 21:01:49 josh
* we are overwriting the trunk's copy of this file with
* the file from the kingfisher branch
*
* Revision 9.5 2001/01/19 22:22:05 paul
* Update copyright.
*
* Revision 9.4 2000/07/12 18:36:41 josh
* additional flags and prototypes
*
* Revision 9.3.4.1 2001/04/11 20:48:30 josh
* moving cormorant-specific changes off to the cormorant
* branch
*
* Revision 9.3.2.3 2001/03/12 22:07:55 tneale
* Updated copyright
*
* Revision 9.3.2.2 2000/12/13 20:51:07 josh
* SNMP_Send_Notify_Name() now obsoletes SNMP_Send_Notify()
* logic of SNMP_Send_Notify_Name() is improved to help prevent nesting of
* locks and generally smooth out flow of data
*
* Revision 9.3.2.1 2000/09/21 21:14:53 josh
* bringing branch include files in line with root
*
* Revision 9.3 2000/03/17 19:48:35 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:34 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:57:00 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1999/10/21 20:43:34 josh
* updating version stamps
*
* Revision 1.5 1999/10/18 22:49:52 josh
* patches to method routines and related code
*
* Revision 1.4 1999/09/30 22:07:57 josh
* cleaning up and changing prototypes to match new cookie scheme
*
* Revision 1.3 1999/09/27 21:11:44 josh
* fixing nits, rewriting engine id <--> address code, adding installation
* option
*
* Revision 1.2 1999/09/14 19:41:02 josh
* completed code for sending v3 notifies
*
* Revision 1.1 1999/09/08 18:10:51 josh
* functions to build a target list for a given notify
*
*
*/
/* [clearcase]
modification history
-------------------
01b,15sep09,y_t fix for WIND00181371
01a,19apr05,job update copyright notices
*/
#if (!defined(ntfy_chk_inc))
#define ntfy_chk_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#if (!defined(v3_trgt_inc))
#include <wrn/wm/snmp/engine/v3_trgt.h>
#endif
#if (!defined(v3_ntfy_inc))
#include <wrn/wm/snmp/engine/v3_ntfy.h>
#endif
#define tag_whitespace(TL) \
((((TL) == ' ') || ((TL) == '\x9') || \
((TL) == '\xd') || ((TL) == '\xa')) ? 1 : 0)
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct TARGET_LIST_S
{
struct TARGET_LIST_S *next;
SNMP_TARGET_ADDR_T *target;
/* information passed in by the caller */
SNMP_PKT_T *pktp;
VBL_T *vblp;
EBUFFER_T context;
/* destination address */
SNMPADDR_T for_addr;
/* information pulled out of the target_addr object */
OBJ_ID_T tdomain;
EBUFFER_T taddress;
bits32_t timeout;
bits16_t retry_count;
bits32_t mms;
/* information pulled out of the target_params object */
int ptype;
int mp_model;
int sec_model;
EBUFFER_T sec_name;
int sec_level;
bits16_t flags;
#define SNMP_TARGET_LIST_SEND_NOTIFY 0x0001
#define SNMP_TARGET_LIST_SEND_PROBE 0x0002
#define SNMP_TARGET_LIST_SEND_INFORM 0x0004
#define SNMP_TARGET_LIST_SEND_PROXY_PROBE 0x0008
#define SNMP_TARGET_LIST_INFOK 0x0010
} TARGET_LIST_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern void init_target_list __((TARGET_LIST_T *));
extern void clean_target_list __((TARGET_LIST_T *));
extern TARGET_LIST_T *build_target_list __((SNMP_NOTIFY_T *, VBL_T *));
extern int taglist_check __((EBUFFER_T *, EBUFFER_T *));
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(ntfy_chk_inc))*/
@@ -0,0 +1,142 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/objectid.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1988-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: objectid.h,v $
* Revision 1.2 2001/11/06 21:35:03 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.3 2001/01/19 22:22:05 paul
* Update copyright.
*
* Revision 9.2 2000/03/17 19:48:36 meister
* Update copyright notice
*
* Revision 9.1 2000/03/09 16:57:20 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:16 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:42 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:27 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:14 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:48 sra
* Release 6.0.
*
* Revision 5.1 1995/03/20 23:11:33 sar
* Minor cleanup.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.4 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.3 1993/04/27 21:06:48 sar
* added copy_object_id which does a straight copy, beware free one copy
* while using the other.
*
* Revision 3.2 1993/04/22 20:14:13 sar
* Updating of macros and defines to use new naming scheme and get the
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
* for example).
*
* Revision 3.1 1993/02/17 20:49:21 sar
* Added no_pp definition (#define __(x) x stuff)
* Added init_object_id - macro: init an OBJ_ID_T to 0 components and 0 list.
*
* Revision 3.0 92/04/03 19:52:27 dab
* Release 3.0
*
* Revision 2.100 91/08/09 14:09:47 dab
* Update version.
*
* Revision 1.1 91/07/30 02:24:29 romkey
* Initial revision
*
*
* Rev 2.0 31 Mar 1990 15:11:20
* Release 2.00
*
* Rev 1.2 11 Jan 1989 12:46:46
* Moved Clean_Obj_ID() to objectid.c
*
* Rev 1.1 19 Sep 1988 17:27:08
* Made changes to make the Sun C compiler happy.
*
* Rev 1.0 12 Sep 1988 10:46:20
* Initial revision.
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(objectid_inc))
#define objectid_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#define clone_object_id(O, N) build_object_id( \
((OBJ_ID_T *)(O))->num_components, \
((OBJ_ID_T *)(O))->component_list, N)
#define init_object_id(O) ((OBJ_ID_T *)(O))->num_components = 0; \
((OBJ_ID_T *)(O))->component_list = 0;
#define copy_object_id(O, N) \
(((OBJ_ID_T *)(N))->num_components = ((OBJ_ID_T *)(O))->num_components, \
((OBJ_ID_T *)(N))->component_list = ((OBJ_ID_T *)(O))->component_list)
extern int build_object_id __((int, OIDC_T *, OBJ_ID_T *));
extern void Clean_Obj_ID __((OBJ_ID_T *));
#ifdef __cplusplus
}
#endif
#endif /* objectid_inc */
@@ -0,0 +1,118 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/proxy.h,v 1.3 2001/11/06 21:50:40 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: proxy.h,v $
* Revision 1.3 2001/11/06 21:50:40 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.2 2001/11/06 21:35:03 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.6 2001/01/19 22:22:05 paul
* Update copyright.
*
* Revision 9.5 2000/03/17 19:48:37 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:34 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 16:57:34 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 2000/02/29 20:40:49 josh
* #ifdefs so we don't have semicolons sitting on lines alone in include
* files (the ARM compiler hates that).
*
* Revision 9.1 1999/11/01 19:56:52 josh
* cleaning up initializations to keep extra files out of code when not
* in use
*
* Revision 9.0 1998/10/16 22:10:16 sar
* Update version stamp to match release
*
* Revision 8.1 1998/08/12 04:52:14 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(proxy_ini_inc))
#define proxy_ini_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(snmp_inc))
#include <wrn/wm/snmp/engine/snmp.h>
#endif
#if INSTALL_ENVOY_SNMP_LOCK
ENVOY_SNMP_LOCK_EXTERN(SNMP_ProxyLock);
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct PROXY_CB_S
{
struct PROXY_CB_S *next;
UINT_32_T indx;
UINT_32_T reqid;
EBUFFER_T community;
SNMPADDR_T loc_addr;
SNMPADDR_T for_addr;
IO_COMPLETE_T *io_comp;
ERR_COMPLETE_T *err_comp;
PTR_T async_cookie;
ALENGTH_T maxpkt;
ATVALUE_T pdu_type;
INT_32_T original_version;
} PROXY_CB_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern void envoy_proxy_init __((void));
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(proxy_ini_inc)) */
@@ -0,0 +1,121 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/proxy_tr.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: proxy_tr.h,v $
* Revision 1.2 2001/11/06 21:35:03 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:06 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:37 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:34 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:57:46 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:17 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:43 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:27 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:15 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 1.1 1995/11/14 22:41:44 sar
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(proxy_tr_inc))
#define proxy_tr_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (INSTALL_ENVOY_SNMP_PROXY)
typedef INT_32_T TRANSPORT_ROUTINE_T __((EBUFFER_T *, PTR_T));
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct PROXY_BLOCK_S
{
EBUFFER_T community;
TRANSPORT_ROUTINE_T *transport_routine;
PTR_T transport_block;
} PROXY_BLOCK_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern INT_32_T SNMP_Proxy_V1_Translation __((SNMP_PKT_T *));
extern INT_32_T SNMP_Proxy_Trap_V1_To_V2 __((SNMP_PKT_T *));
extern INT_32_T SNMP_Proxy_V2_Translation __((SNMP_PKT_T *));
#endif /* #if (INSTALL_ENVOY_SNMP_PROXY) */
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(proxy_tr_inc)) */
@@ -0,0 +1,244 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/sendntfy.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
/*
* Copyright (C) 1999-2005, 2008 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: sendntfy.h,v $
* Revision 1.2 2001/11/06 21:35:03 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.9 2001/04/11 20:42:56 josh
* merge from the kingfisher branch
*
* Revision 9.8 2001/01/19 22:22:06 paul
* Update copyright.
*
* Revision 9.7 2000/07/12 18:39:31 josh
* moving SNMP_Find_Matching_Engine_ID() to v3_eng.c -- appropriately
* updating headers to correspond
*
* Revision 9.6 2000/06/09 14:54:12 josh
* modifications due to new installation options, new proxy code
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
* be built with the target code
*
* Revision 9.5.2.3 2001/03/12 22:07:56 tneale
* Updated copyright
*
* Revision 9.5.2.2 2001/01/19 21:32:24 josh
* prototype for SNMP_Send_Notify_Name(). retrans_timer_exp() redefined
* to static
*
* Revision 9.5.2.1 2000/09/21 21:14:53 josh
* bringing branch include files in line with root
*
* Revision 9.5 2000/03/17 19:48:38 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:34 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 16:58:01 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 2000/02/04 21:54:16 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.1 2000/01/05 21:15:28 josh
* moving code around to make sure probe checks occur as long as an
* engine ID is found
*
* Revision 9.0 1999/10/21 20:43:35 josh
* updating version stamps
*
* Revision 1.8 1999/10/07 23:38:24 josh
* added definition for snmpaddr to taddress conversion routine
*
* Revision 1.7 1999/10/03 00:18:08 josh
* fixing retramit timer code -- setting handler correctly,
* cleaning up some double-free situations, and putting locking in
* where needed
*
* Revision 1.6 1999/09/30 22:07:58 josh
* cleaning up and changing prototypes to match new cookie scheme
*
* Revision 1.5 1999/09/27 21:11:44 josh
* fixing nits, rewriting engine id <--> address code, adding installation
* option
*
* Revision 1.4 1999/09/15 16:17:39 josh
* Linking the Retransmit Lock to the Retransmit list turns out to
* be a lot more trouble than it's worth. We'll just refer to
* it directly, a la SNMP_CoarseLock.
*
* Revision 1.3 1999/09/14 19:41:02 josh
* completed code for sending v3 notifies
*
* Revision 1.2 1999/09/11 02:14:06 josh
* updating header file -- created retrans block structures
*
* Revision 1.1 1999/09/01 21:56:04 josh
* Code to do actual sending of Notifies
*
*
*/
/* [clearcase]
modification history
-------------------
01b,15jul08,y_z add ack,timeout callback in the RETRANS_COOKIE_T
01a,19apr05,job update copyright notices
*/
#if (!defined(sendntfy_inc))
#define sendntfy_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#if (!defined(etimer_inc))
#include <wrn/wm/snmp/engine/etimer.h>
#endif
#if (!defined(v3_trgt_inc))
#include <wrn/wm/snmp/engine/v3_trgt.h>
#endif
#if (!defined(v3_ntfy_inc))
#include <wrn/wm/snmp/engine/v3_ntfy.h>
#endif
#if (!defined(ntfy_chk_inc))
#include <wrn/wm/snmp/engine/ntfy_chk.h>
#endif
#ifndef ENVOY_RETRANS_CLEANUP_INTERVAL
#define ENVOY_RETRANS_CLEANUP_INTERVAL 500
#endif
#ifndef ENVOY_SET_RETRANS_ID
#define ENVOY_SET_RETRANS_ID(RET) \
(RET)->retrans_id = root_retrans_block.next_retrans_id++
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct RETRANS_COOKIE_S
{
struct RETRANS_COOKIE_S *next;
int ref_cnt;
RETRANS_CLEANUP_T *cleanup_rtn;
ACK_CALLBACK_T *ack_rtn;
TIMEOUT_CALLBACK_T *timeout_rtn;
PTR_T cookie;
} RETRANS_COOKIE_T;
typedef struct SNMP_RETRANS_S
{
struct SNMP_RETRANS_S *next;
SNMP_PKT_T *pktp;
SNMPADDR_T for_addr;
SNMPADDR_T loc_addr;
bits16_t retry_count;
bits32_t timeout;
IO_COMPLETE_T *io_complete;
ERR_COMPLETE_T *error_complete;
RETRANS_COOKIE_T *cookie;
bits32_t retrans_id;
bits32_t time_sent;
bits16_t flags;
#define SNMP_RETRANS_FLAGS_EXPIRED 0x01
#define SNMP_RETRANS_FLAGS_ACKNOWLEDGED 0x02
#define SNMP_RETRANS_FLAGS_SENDING_PROBE 0x04
bits16_t ref_cnt;
TARGET_LIST_T *tlp;
} SNMP_RETRANS_T;
typedef struct SNMP_RETRANS_ROOT_S
{
SNMP_RETRANS_T *retrans;
bits32_t next_retrans_id;
ENVOY_TIMER_T timer;
} SNMP_RETRANS_ROOT_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern RETRANS_COOKIE_T *root_retrans_cookie;
extern SNMP_RETRANS_ROOT_T root_retrans_block;
extern int SNMP_Probe_Check __((SNMP_RETRANS_T *));
extern void SNMP_Check_Retrans_List __((SNMP_PKT_T *));
extern void SNMP_Send_Packet_Retransmit __((SNMP_PKT_T *, SNMPADDR_T *,
SNMPADDR_T *, bits16_t,
bits32_t, IO_COMPLETE_T *,
ERR_COMPLETE_T *,
RETRANS_COOKIE_T *));
extern void SNMP_Send_Packet_Probe __((TARGET_LIST_T *,
SNMPADDR_T *,
IO_COMPLETE_T *,
ERR_COMPLETE_T *,
RETRANS_COOKIE_T *));
extern void SNMP_Send_Notify __((SNMP_NOTIFY_T *, VBL_T *, SNMPADDR_T *,
bits8_t *, ALENGTH_T, IO_COMPLETE_T *,
ERR_COMPLETE_T *, RETRANS_CLEANUP_T *,
PTR_T));
extern void SNMP_Send_Notify_Name_Ack __((bits8_t *, ALENGTH_T, VBL_T *,
SNMPADDR_T *, bits8_t *, ALENGTH_T,
IO_COMPLETE_T *, ERR_COMPLETE_T *,
RETRANS_CLEANUP_T *, PTR_T,ACK_CALLBACK_T *,TIMEOUT_CALLBACK_T *));
extern void SNMP_Send_Notify_Name __((bits8_t *, ALENGTH_T, VBL_T *,
SNMPADDR_T *, bits8_t *, ALENGTH_T,
IO_COMPLETE_T *, ERR_COMPLETE_T *,
RETRANS_CLEANUP_T *, PTR_T));
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(sendntfy_inc))*/
@@ -0,0 +1,63 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/smi.h,v 1.1.1.1 2001/11/05 17:47:23 tneale Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: smi.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.2 2001/01/19 22:22:06 paul
* Update copyright.
*
* Revision 9.1 2000/03/17 19:48:38 meister
* Update copyright notice
*
* Revision 9.0 1998/10/16 22:10:18 sar
* Update version stamp to match release
*
* Revision 1.1 1998/05/23 19:51:56 sar
* Defines for various items that are in the standard smi
* and might be used by our code. For example row status
* and storage tags.
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(smi_inc))
#define smi_inc
#define ETC_STO_OTHER 1
#define ETC_STO_VOL 2
#define ETC_STO_NONVOL 3
#define ETC_STO_PERM 4
#define ETC_STO_RONLY 5
#define ETC_RS_RSNE 0
#define ETC_RS_ACTIVE 1
#define ETC_RS_NIS 2
#define ETC_RS_NREADY 3
#define ETC_RS_CAGO 4
#define ETC_RS_CAWAIT 5
#define ETC_RS_DESTROY 6
#endif
@@ -0,0 +1,270 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/snmp.h,v 1.4 2003/01/15 13:58:56 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1993-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: snmp.h,v $
* Revision 1.4 2003/01/15 13:58:56 josh
* directory structure shifting
*
* Revision 1.3 2001/11/06 21:50:40 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.2 2001/11/06 21:35:04 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:06 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:39 meister
* Update copyright notice
*
* Revision 9.3 1999/10/29 21:05:42 josh
* The infrastructure lock tag is needed by Epilogue subagents as well
*
* Revision 9.2 1999/10/18 22:35:52 sar
* Add free_lock
* add init_lock to the block used if locks aren't defined
*
* Revision 9.1 1999/09/14 19:45:12 josh
* added a new lock -- SNMP_V3_Retrans_Lock
*
* Revision 9.0 1998/10/16 22:10:18 sar
* Update version stamp to match release
*
* Revision 8.5 1998/05/29 17:12:34 josh
* a few ifdefs for cleanliness
*
* Revision 8.4 1998/05/29 17:10:02 josh
* new locking macros added.
*
* Revision 8.3 1998/05/28 03:41:35 sar
* Added extern for boots lock
*
* Revision 8.2 1998/04/16 15:45:07 josh
* Declaring a separate lock if necessary
*
* Revision 8.1 1998/02/25 04:50:44 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:27 sar
* Updated revision to 8.0
*
* Revision 7.5 1997/10/22 03:07:30 sar
* Mofied the agentx and older subagent schemes install options
*
* Revision 7.4 1997/10/16 00:25:18 sar
* Primarily this set of modifications is for the agentx protocol.
* Most of the work was in the agentx.h and ax_mth.h files. Most
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
* to their structures and snmp got some new lock macros.
*
* One other change of note was the modification of continue
* processing. Previously we called a specific continue routine
* directly, now we store a pointer to the corret continue
* function in the snmp packet structure and call that. We include
* macros for backwards compatibility.
*
* Revision 7.3 1997/08/21 17:23:44 sra
* Begin moving configuration stuff that's common to all products to common.h
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
*
* Revision 7.2 1997/03/20 06:48:16 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:59:45 sra
* Release 6.0.
*
* Revision 5.4 1995/05/02 23:29:47 sar
* added some semi-colons in the lock macros.
*
* Revision 5.3 1995/04/18 20:41:28 sar
* Added some new macros and modified the old macros so we don't require
* ifdefs in all of the mainline code. Instead we use the new macros
* which will be defined to nothgin if locks aren't installed.
*
* Revision 5.2 1995/03/20 23:11:33 sar
* Redo the defaults for the lock scheme. They macros are now
* defined to look like "good" returns so the main line code does not
* have to deal with if defs. Some places that have large blocks of
* lock code may still choose to use if defs.
*
* Revision 5.1 1994/10/12 20:11:47 sar
* Added an ifdef around the def for the coarse lock
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 1.6 1993/05/28 18:01:05 sar
* added the define as nothing macros for snmp_trace_input and output.
*
* Revision 1.5 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 1.4 1993/04/30 22:58:26 sar
* Added mechanism for minimal proxies and coarse grained locks.
*
* Revision 1.3 1993/04/26 20:33:14 sar
* Added bitstrings, and have deletion of parties or contexts delete acls.
*
* Revision 1.2 1993/03/03 20:06:55 dab
* If the config file doesn't set SNMP_SILLY_MARKETING_MACRO
* then set it to something that wan't make a mess here.
*
* Revision 1.1 1993/02/26 17:08:46 dab
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(snmp_inc))
#define snmp_inc
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#include <wrn/wm/common/glue.h>
#include <envoy.h>
/* Define some macros as nothing if the user hasn't defined them */
#if !defined(SNMP_TRACE_INPUT)
#define SNMP_TRACE_INPUT(pkt)
#endif
#if !defined(SNMP_TRACE_OUTPUT)
#define SNMP_TRACE_OUTPUT(pkt)
#endif
/* If we are using the lock code specify coarse lock for everybody to use.
We also specify a larger macro that gets a lock and if it can't
executes it's other arguments */
#if INSTALL_ENVOY_SNMP_LOCK
#ifndef ENVOY_SNMP_INIT_LOCK_TAG
#define ENVOY_SNMP_INIT_LOCK_TAG(name, tag) ENVOY_SNMP_INIT_LOCK((name))
#endif
#ifndef ENVOY_SNMP_FREE_LOCK_TAG
#define ENVOY_SNMP_FREE_LOCK_TAG(lock, tag)
#endif
#ifndef SNMP_COARSELOCK_TAG
#define SNMP_COARSELOCK_TAG "COAR"
#endif
#ifndef SNMP_TIMERLOCK_TAG
#define SNMP_TIMERLOCK_TAG "TIMR"
#endif
#ifndef SNMP_INFRASTRUCTURELOCK_TAG
#define SNMP_INFRASTRUCTURELOCK_TAG "INFR"
#endif
#if INSTALL_ENVOY_SNMP_PROXY
#ifndef SNMP_PROXYLOCK_TAG
#define SNMP_PROXYLOCK_TAG "PROX"
#endif
#endif
#if INSTALL_ENVOY_CONTINUE_REENTRANT
#ifndef ENVOY_CONTINUELOCK_TAG
#define ENVOY_CONTINUELOCK_TAG "CONT"
#endif
#endif
#if INSTALL_ENVOY_AGENTX
#ifndef ENVOY_AXLISTLOCK_TAG
#define ENVOY_AXLISTLOCK_TAG "AXLS"
#endif
#ifndef ENVOY_AXCOARSELOCK_TAG
#define ENVOY_AXCOARSELOCK_TAG "AXCO"
#endif
#endif
#if INSTALL_ENVOY_SNMP_VERSION_3
#ifndef ENVOY_V3RETRANSLOCK_TAG
#define ENVOY_V3RETRANSLOCK_TAG "RETR"
#endif
#ifndef ENVOY_V3BOOTSLOCK_TAG
#define ENVOY_V3BOOTSLOCK_TAG "V3BT"
#endif
#endif
ENVOY_SNMP_LOCK_EXTERN(SNMP_CoarseLock);
ENVOY_SNMP_LOCK_EXTERN(SNMP_infrastructure_lock);
#if INSTALL_ENVOY_SNMP_VERSION_3
ENVOY_SNMP_LOCK_EXTERN(SNMP_V3_Retrans_Lock);
ENVOY_SNMP_LOCK_EXTERN(SNMP_V3_Boots_Lock);
#endif
#define ENVOY_SNMP_LOCK_AND_1ARGS(get, lock, com1) \
if (get(lock)) { com1; }
#define ENVOY_SNMP_LOCK_AND_2ARGS(get, lock, com1, com2) \
if (get(lock)) { com1; com2; }
#define ENVOY_SNMP_LOCK_AND_3ARGS(get, lock, com1, com2, com3) \
if (get(lock)) { com1; com2; com3; }
#define ENVOY_SNMP_LOCK_AND_4ARGS(get, lock, com1, com2, com3, com4) \
if (get(lock)) { com1; com2; com3; com4; }
#else /* INSTALL_ENVOY_SNMP_LOCK */
/* Don't use the lock stuff if the user doesn't define it */
#define ENVOY_SNMP_LOCK(name)
#define ENVOY_SNMP_LOCK_EXTERN(name);
#define ENVOY_SNMP_INIT_LOCK(name)
#define ENVOY_SNMP_INIT_LOCK_TAG(name, tag)
#define ENVOY_SNMP_FREE_LOCK_TAG(lock, tag)
#define ENVOY_SNMP_GET_READ_LOCK(name) 0
#define ENVOY_SNMP_RELEASE_READ_LOCK(name)
#define ENVOY_SNMP_GET_WRITE_LOCK(name) 0
#define ENVOY_SNMP_RELEASE_WRITE_LOCK(name)
#define ENVOY_SNMP_LOCK_AND_1ARGS(get, lock, com1)
#define ENVOY_SNMP_LOCK_AND_2ARGS(get, lock, com1, com2)
#define ENVOY_SNMP_LOCK_AND_3ARGS(get, lock, com1, com2, com3)
#define ENVOY_SNMP_LOCK_AND_4ARGS(get, lock, com1, com2, com3, com4)
#endif /* INSTALL_ENVOY_SNMP_LOCK */
#if (INSTALL_ENVOY_AGENTX_MASTER && INSTALL_ENVOY_SNMP_LOCK)
#define ENVOY_AX_MA_RELEASE_READ_LOCK(name) ENVOY_SNMP_RELEASE_READ_LOCK(name)
#define ENVOY_AX_MA_RELEASE_WRITE_LOCK(name) ENVOY_SNMP_RELEASE_WRITE_LOCK(name)
#else
#define ENVOY_AX_MA_RELEASE_READ_LOCK(name)
#define ENVOY_AX_MA_RELEASE_WRITE_LOCK(name)
#endif
#endif /* snmp_inc */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,246 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/snmpstat.h,v 1.2 2001/11/06 21:35:04 josh Exp $ */
/*
* Copyright (C) 1999-2010 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1991-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: snmpstat.h,v $
* Revision 1.2 2001/11/06 21:35:04 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:10 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:41 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:34 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:58:33 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 1999/04/09 20:37:02 josh
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
*
* Revision 9.0 1998/10/16 22:10:20 sar
* Update version stamp to match release
*
* Revision 8.3 1998/06/08 19:42:11 sar
* Create a define to tell us if we need the stats group in general
*
* Revision 8.2 1998/05/23 20:06:17 sar
* Added some stats variables for SNMPv3
*
* Revision 8.1 1998/02/25 04:50:48 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:28 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:19 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.3 1996/01/10 16:23:25 sar
* USEC updates
*
* Revision 6.2 1995/11/14 22:42:26 sar
* renamed proxydrops & silentdrops to match the mib definitions.
*
* Revision 6.1 1995/10/20 22:53:35 sar
* moved some stats into and out of the ifdef blocks
* removed the v2 classic stats
* added some v2 community stats
*
* Revision 6.0 1995/05/31 21:46:53 sra
* Release 6.0.
*
* Revision 5.1 1995/03/20 23:11:33 sar
* Moved the deinition of the statistics macros here so there is one
* central point for them.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 3.5 1993/06/02 23:05:55 dab
* Changed #ifdef's to #if's for things from install.h
*
* Revision 3.4 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 3.3 1993/04/22 20:14:13 sar
* Updating of macros and defines to use new naming scheme and get the
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
* for example).
*
* Revision 3.2 1993/02/18 20:43:26 sar
* Added DestPartyMismatches and UnknownContexts to the v2 snmpstat group.
*
* Revision 3.1 1993/02/17 20:55:10 sar
* Updated stats to deal with v1 and v2 options.
*
* Revision 3.0 92/04/03 19:52:27 dab
* Release 3.0
*
* Revision 1.1 91/10/30 20:45:25 dab
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
01b,15jun10,y_t update for LP64
01a,19apr05,job update copyright notices
*/
#if (!defined(snmpstat_inc))
#define snmpstat_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#if (!defined(snmp_inc))
#include <wrn/wm/snmp/engine/snmp.h>
#endif
#if (ENVOY_NEED_STATS)
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_STATS_S
{
unsigned int snmpInPkts;
unsigned int snmpInBadVersions;
unsigned int snmpInBadCommunityNames;
unsigned int snmpInBadCommunityUses;
unsigned int snmpInASNParseErrs;
unsigned short snmpEnableAuthTraps;
#if INSTALL_ENVOY_SNMP_GROUP_V1
unsigned int snmpOutPkts;
unsigned int snmpInBadTypes;
unsigned int snmpInTooBigs;
unsigned int snmpInNoSuchNames;
unsigned int snmpInBadValues;
unsigned int snmpInReadOnlys;
unsigned int snmpInGenErrs;
unsigned int snmpInTotalReqVars;
unsigned int snmpInTotalSetVars;
unsigned int snmpInGetRequests;
unsigned int snmpInGetNexts;
unsigned int snmpInSetRequests;
unsigned int snmpInGetResponses;
unsigned int snmpInTraps;
unsigned int snmpOutTooBigs;
unsigned int snmpOutNoSuchNames;
unsigned int snmpOutBadValues;
unsigned int snmpOutReadOnlys;
unsigned int snmpOutGenErrs;
unsigned int snmpOutGetRequests;
unsigned int snmpOutGetNexts;
unsigned int snmpOutSetRequests;
unsigned int snmpOutGetResponses;
unsigned int snmpOutTraps;
#endif /* INSTALL_ENVOY_SNMP_GROUP_V1 */
#if INSTALL_ENVOY_SNMP_GROUP_V2
unsigned int snmpSilentDrops;
unsigned int snmpProxyDrops;
#endif /* INSTALL_ENVOY_SNMP_GROUP_V2 */
#if INSTALL_ENVOY_SNMP_VERSION_3
unsigned int snmpUnknownSecurityModels;
unsigned int snmpInvalidMsgs;
unsigned int snmpUnknownPDUHandlers;
unsigned int snmpUnavailableContexts;
unsigned int snmpUnknownContexts;
unsigned int usmStatsUnsupportedSecLevels;
unsigned int usmStatsNotInTimeWindows;
unsigned int usmStatsUnknownUserNames;
unsigned int usmStatsUnknownEngineIDs;
unsigned int usmStatsWrongDigests;
unsigned int usmStatsDecryptionErrors;
#endif /* INSTALL_ENVOY_SNMP_VERSION_3 */
} SNMP_STATS_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern SNMP_STATS_T snmp_stats;
#endif /* ENVOY_NEED_STATS */
/* Some macros to make the mainline code a little cleaner to read */
#if (INSTALL_ENVOY_SNMP_GROUP_V1)
#define SGRPv1_INC_COUNTER(x) inc_counter(x)
#define SGRPv1_ADD_COUNTER(x, y) add_counter(x, y)
#else
#define SGRPv1_INC_COUNTER(x)
#define SGRPv1_ADD_COUNTER(x, y)
#endif
#if (INSTALL_ENVOY_SNMP_GROUP_V2)
#define SGRPv2_INC_COUNTER(x) inc_counter(x)
#else
#define SGRPv2_INC_COUNTER(x)
#endif
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2)
#define SGRPv1v2_INC_COUNTER(x) inc_counter(x)
#else
#define SGRPv1v2_INC_COUNTER(x)
#endif
#if (INSTALL_ENVOY_SNMP_VERSION_3)
#define SGRPv3_INC_COUNTER(x) inc_counter(x)
#else
#define SGRPv3_INC_COUNTER(x)
#endif
#ifdef __cplusplus
}
#endif
#endif /* snmpstat_inc */
@@ -0,0 +1,165 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/tree.h,v 1.2 2001/11/06 21:35:04 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1993-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: tree.h,v $
* Revision 1.2 2001/11/06 21:35:04 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:10 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:42 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:35 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:59:00 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:21 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:51 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:31 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:21 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:55 sra
* Release 6.0.
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Minor cleanup, adding other include files.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.1 1994/05/10 20:17:19 sar
* Removed the #if that restricted it for use with v2 only
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 1.8 1993/06/02 23:05:55 dab
* Changed #ifdef's to #if's for things from install.h
*
* Revision 1.7 1993/05/03 17:54:14 sar
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
*
* Revision 1.6 1993/04/30 22:58:26 sar
* Added mechanism for minimal proxies and coarse grained locks.
*
* Revision 1.5 1993/04/22 20:14:13 sar
* Updating of macros and defines to use new naming scheme and get the
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
* for example).
*
* Revision 1.4 1993/04/17 00:58:50 sar
* changed def of TREE_Add to allow the user to determine what node the leaf
* was attatched to.
*
* Revision 1.3 1993/03/05 03:56:25 dab
* fixed up types
*
* Revision 1.2 1993/02/24 00:59:50 sar
* Removed the name objid from the partyleaf and put a copy of it in the
* pkt. Also Updated many of the SNMP_(Party, Context, ACL)_* files
* to use a OIDC_T/length instead of a OBJ_ID_T so we don't have to
* allocate an OBJ_ID_T when we don't have one.
*
* Revision 1.1 1993/02/17 20:55:28 sar
* Initial revision
*
* Revision 3.0 92/09/09 sar
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#include <wrn/wm/snmp/engine/asn1.h>
#if (!defined(tree_inc))
#define tree_inc
#ifdef __cplusplus
extern"C" {
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* Define a generic tree structure */
typedef struct TREENODE_S
{
INT_32_T status; /* flag and status word */
OIDC_T name; /* subid for this level */
struct TREENODE_S * parent; /* ptr to one level up */
struct TREENODE_S * sibling; /* ptr to this level */
PTR_T child; /* ptr to one level down */
/* or to the data block */
} TREENODE_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define TREESTATIC 0x1 /* Node may not be deleted, ptrs may change */
#define TREETWIN 0x2 /* Next node contains a leaf pointer */
#define TREECHILD 0x4 /* Node contains a child pointer */
#define TREELEAF 0x8 /* Node contains a leaf pointer */
extern int TREE_Add __((TREENODE_T **root, OIDC_T *oidc,
int oidclen, PTR_T leaf,
TREENODE_T **retnode));
extern int TREE_Delete __((TREENODE_T **root, TREENODE_T *node));
extern TREENODE_T *TREE_Get __((TREENODE_T *root, OIDC_T *oidc,
int oidclen, int *length));
extern TREENODE_T *TREE_GetPrev __((TREENODE_T *root, OIDC_T *oidc,
int oidclen));
extern TREENODE_T *TREE_GetNext __((TREENODE_T *root, TREENODE_T *node));
extern int TREE_Extract __((TREENODE_T *node, PTR_T *leaf));
extern int TREE_Install __((TREENODE_T *node, PTR_T leaf));
extern int TREE_Name __((TREENODE_T *node, OIDC_T *oidc, int len));
#ifdef __cplusplus
}
#endif
#endif /* tree_inc */
@@ -0,0 +1,334 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/ui64.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1993-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: ui64.h,v $
* Revision 1.2 2001/11/06 21:35:05 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:10 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:42 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:35 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 16:59:11 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:21 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:52 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:32 sar
* Updated revision to 8.0
*
* Revision 7.3 1997/10/26 01:44:43 sar
* Always define the 64 bit counter and include it in the vb defintion
* instead of forgetting about it if we don't have v2 or v2 types installed.
*
* Revision 7.2 1997/03/20 06:48:23 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:56 sra
* Release 6.0.
*
* Revision 5.2 1994/11/29 21:58:53 sar
* Added a missing : to UI64_Compare.
*
* Revision 5.1 1994/09/29 18:31:12 sar
* Rearrange some items to deal with removing v2 types from v1 settings if
* they aren't installed.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 1.4 1993/06/17 23:30:45 sar
* remvoed the ENVOY_ from UI64 routines and macros.
*
* Revision 1.3 1993/06/07 18:31:09 sar
* Added a set macro to set a 64 bitter from two 32 bitters.
*
* Revision 1.2 1993/04/28 22:00:38 sar
* Moved the definition of UINT_64_T to ui64.h and update others
*
* Revision 1.1 1993/04/22 20:14:13 sar
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
01b,01apr09,y_t fix the big endian & little endian issue
01a,19apr05,job update copyright notices
*/
/* define some macros for manipulating unsinged 64 bit quantities */
#if !defined(ui64_inc)
#define ui64_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
/****************************************************************************
UINT_64_T
****************************************************************************/
/* The following structure is used to hold 64 bit unsigned int. It is
targeted for COUNTER64 but for generality it is called UINT_64_T. */
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
#if (_BYTE_ORDER == _BIG_ENDIAN)
typedef struct UINT_64_S
{
UINT_32_T high; /* the high (msb) 4 bytes of the uint */
UINT_32_T low; /* the low (lsb) 4 bytes of the uint */
} UINT_64_T;
#endif
#if (_BYTE_ORDER == _LITTLE_ENDIAN)
typedef struct UINT_64_S
{
UINT_32_T low; /* the low (lsb) 4 bytes of the uint */
UINT_32_T high; /* the high (msb) 4 bytes of the uint */
} UINT_64_T;
#endif
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/****************************************************************************
NAME: UI64_Set
PURPOSE: Set a UINT_64_T from two UINT_32_Ts
PARAMETERS: UINT_64_T * the structure to use
UINT_32_T the high bits
UINT_32_T the low bits
RETURNS: nothing
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_Set(N, H, L) ((N)->high = (H), (N)->low = (L))
/****************************************************************************
NAME: UI64_High
PURPOSE: Get the high order 32 bits
PARAMETERS: UINT_64_T * the structure to use
RETURNS: UINT_32_T
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_High(N) (N)->high
/****************************************************************************
NAME: UI64_Low
PURPOSE: Get the low order 32 bits
PARAMETERS: UINT_64_T * Pointer to the object
RETURNS: UINT_32_T
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_Low(N) (N)->low
/****************************************************************************
NAME: UI64_Zero
PURPOSE: Zero a UINT_64_T object
PARAMETERS: UINT_64_T * Pointer to the object to be zeroed.
RETURNS:
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_Zero(N) (N)->high = (N)->low = 0L
/****************************************************************************
NAME: UI64_Increment
PURPOSE: Increment (by one) a UINT_64_T object
PARAMETERS: UINT_64_T * Pointer to the object to be incremented.
RETURNS:
RESTRICTIONS: This routine will wrap the object if necessary and not give
any warning about having done so.
BUGS:
****************************************************************************/
#define UI64_Increment(N) if (++((N)->low) == 0) (N)->high++
/****************************************************************************
NAME: UI64_Add32
PURPOSE: Add a UINT_32_T to a UINT_64_T
PARAMETERS: UINT_64_T * pointer to the object to be updated
UINT_32_T the quantity to add in.
RETURNS:
RESTRICTIONS: This routine will wrap the object if necessary and not give
any warning about having done so.
BUGS:
****************************************************************************/
#define UI64_Add32(N, I) (N)->low += I; if ((N)->low < I) (N)->high++
/****************************************************************************
NAME: UI64_Add64
PURPOSE: Add two UINT_64_Ts
PARAMETERS: UINT_64_T * The object to update
UINT_64_T * The object to add in
RETURNS: Doesn't return anything but the first UINT_64_T is updated.
RESTRICTIONS: This routine will wrap the object if necessary and not give
any warning about having done so.
BUGS:
****************************************************************************/
#define UI64_Add64(N, M) (N)->low += (M)->low; (N)->high += (M)->high; \
if ((N)->low < (M)->low) (N)->high++
/****************************************************************************
NAME: UI64_Sub64
PURPOSE: Subtract two UINT_64_Ts
PARAMETERS: UINT_64_T * the result goes here
UINT_64_T * Subtract from this object
UINT_64_T * the object to subtract
RETURNS: Doesn't return anything but the first UINT_64_T is filled in.
RESTRICTIONS: This routine will wrap the object if necessary and not give
any warning about having done so.
BUGS:
****************************************************************************/
#define UI64_Sub64(X, Y, Z) (X)->low = (Y)->low - (Z)->low; \
(X)->high = (Y)->high - (Z)->high; \
if ((X)->low > (Y)->low) (X)->high--
/****************************************************************************
NAME: UI64_Copy
PURPOSE: Copy one UINT_64_T to another
PARAMETERS: UINT_64_T * the result goes here
UINT_64_T * copy from this object
RETURNS: Doesn't return anything but the first UINT_64_T is filled in.
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_Copy(X, Y) (X)->low = (Y)->low; (X)->high = (Y)->high
/****************************************************************************
NAME: UI64_Compare
PURPOSE: Compare two UINT_64_Ts
PARAMETERS: UINT_64_T * The two objects to compare
UINT_64_T *
RETURNS: < 0 if the first is smaller than the second
> 0 if the first is greater than the second
0 if they are equal.
RESTRICTIONS:
BUGS:
****************************************************************************/
#define UI64_Compare(X, Y) \
(((X)->high == (Y)->high) ? \
(((X)->low == (Y)->low) ? (0) : (((X)->low > (Y)->low) ? (1) : (-1))) : \
(((X)->high > (Y)->high) ? (1) : (-1)))
#ifdef __cplusplus
}
#endif
#endif /* ui64.h defined */
@@ -0,0 +1,285 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_acc.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_acc.h,v $
* Revision 1.2 2001/11/06 21:35:05 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.6 2001/04/25 16:52:23 josh
* the SNMP_ACCESS_T object is now initialized with a default
* status of ETC_RS_NIS instead of ETC_RS_NREADY
*
* Revision 9.5 2001/01/19 22:22:11 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:43 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:35 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:59:22 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 2000/02/04 21:54:19 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.0 1998/10/16 22:10:23 sar
* Update version stamp to match release
*
* Revision 1.7 1998/08/12 04:52:16 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 1.6 1998/07/06 01:01:21 sar
* Update type of security level field to make compilers happy
*
* Revision 1.5 1998/07/01 01:48:18 sar
* As part of the set_defaults macro do a memset to zero the memory
*
* Revision 1.4 1998/06/18 04:42:03 sar
* Modified bflags in ebuffer to be unsigned ints and updated
* calling routines accordingly
*
* Revision 1.3 1998/06/16 05:29:56 sar
* clean up some type info
* modify the api for the next routine
*
* Revision 1.2 1998/05/30 02:52:08 sar
* Modifed the names used for max string length
* Updated user lookup
*
* Revision 1.1 1998/05/23 19:49:39 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_acc_inc))
#define v3_acc_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define ETC_ACCESS_VIEW_MAX 32
#define ETC_ACCESS_GROUP_MAX 32
#define ETC_ACCESS_ACCESS_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_GROUP_S
{
struct SNMP_GROUP_S *next;
sbits32_t model; /* security model, an index */
bits8_t *uname; /* security name, other index */
ALENGTH_T uname_len; /* length of security name */
EBUFFER_T grp_name; /* group name */
bits16_t status;
bits16_t storage;
} SNMP_GROUP_T;
/* global root pointer for group list */
extern SNMP_GROUP_T *root_group;
#define SNMP_Group_Set_Defaults(G) (MEMSET((G), 0, sizeof(SNMP_GROUP_T)), \
EBufferInitialize(&((G)->grp_name)), \
(G)->storage = ETC_STO_NONVOL, \
(G)->status = ETC_RS_NREADY)
extern SNMP_GROUP_T * SNMP_Group_Create __((void));
extern void SNMP_Group_Destroy __((SNMP_GROUP_T *));
extern int SNMP_Group_Install __((SNMP_GROUP_T *, sbits32_t,
bits8_t *, ALENGTH_T));
extern void SNMP_Group_Deinstall __((SNMP_GROUP_T *));
extern SNMP_GROUP_T * SNMP_Group_Lookup __((sbits32_t, bits8_t *,
ALENGTH_T));
extern SNMP_GROUP_T * SNMP_Group_Next __((int, OIDC_T *));
extern SNMP_GROUP_T * SNMP_Group_Next_Group __((SNMP_GROUP_T *));
extern void SNMP_Group_Name __((SNMP_GROUP_T *, sbits32_t *,
bits8_t *, ALENGTH_T *));
#define SNMP_Group_Set_Group(G, S, L, F) \
(EBufferAllocateLoad((F), &((G)->grp_name), (S), (L)))
#define SNMP_Group_Compare_Names(G1, G2) ((G1 == G2) ? 0 : 1)
#define SNMP_Group_Get_Group(G) (EBufferStart(&((G)->grp_name)))
#define SNMP_Group_Get_Group_Len(G) (EBufferUsed(&((G)->grp_name)))
#define SNMP_Group_Get_Status(G) ((G)->status)
#define SNMP_Group_Set_Status(G, V) ((G)->status = (bits16_t)(V))
#define SNMP_Group_Get_Storage(G) ((G)->storage)
#define SNMP_Group_Set_Storage(G, V) ((G)->storage = (bits16_t)(V))
typedef struct SNMP_ACC_GRP_S
{
struct SNMP_ACC_GRP_S *next;
bits8_t *grp_name; /* group name, an index */
ALENGTH_T grp_len;
struct SNMP_ACCESS_S *access;
} SNMP_ACC_GRP_T;
typedef struct SNMP_ACCESS_S
{
struct SNMP_ACC_GRP_S *group;
struct SNMP_ACCESS_S *next;
bits8_t *prefix; /* context prefix, an index */
ALENGTH_T prefix_len;
int prefix_match; /* prefix match, exact - 1, prefix - 2 */
sbits32_t model; /* security model, an index */
sbits16_t level; /* security level, an index */
EBUFFER_T readview; /* name of view for reading */
EBUFFER_T writeview; /* name of view for writing */
EBUFFER_T notifyview; /* name of view for notifies */
int status;
int storage;
} SNMP_ACCESS_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define ETC_ACCESS_EXACT 1
#define ETC_ACCESS_PREFIX 2
/* global root pointer for access list */
extern SNMP_ACC_GRP_T *root_access;
#define SNMP_V3_Access_Set_Defaults(A) (MEMSET((A), 0, sizeof(SNMP_ACCESS_T)),\
(A)->prefix_match = ETC_ACCESS_EXACT, \
EBufferInitialize(&((A)->readview)), \
EBufferInitialize(&((A)->writeview)), \
EBufferInitialize(&((A)->notifyview)),\
(A)->storage = ETC_STO_NONVOL, \
(A)->status = ETC_RS_NIS)
extern SNMP_ACCESS_T * SNMP_V3_Access_Create __((void));
extern void SNMP_V3_Access_Destroy __((SNMP_ACCESS_T *));
extern int SNMP_V3_Access_Install __((SNMP_ACCESS_T *,
bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
sbits32_t, sbits32_t));
extern void SNMP_V3_Access_Deinstall __((SNMP_ACCESS_T *));
extern SNMP_ACCESS_T * SNMP_V3_Access_Lookup __((bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
sbits32_t, sbits32_t));
extern SNMP_ACCESS_T * SNMP_V3_Access_Next __((int, OIDC_T *));
extern SNMP_ACCESS_T * SNMP_V3_Access_Next_Access __((SNMP_ACCESS_T *));
extern void SNMP_V3_Access_Name __((SNMP_ACCESS_T *,
bits8_t *, ALENGTH_T *,
bits8_t *, ALENGTH_T *,
sbits32_t *, sbits32_t *));
extern SNMP_ACCESS_T * SNMP_V3_Access_Find __((bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T,
sbits32_t, sbits32_t));
extern int SNMP_V3_Access_Set_View __((SNMP_ACCESS_T *,
EBUFFER_T *, bits8_t *,
ALENGTH_T, unsigned int));
#define SNMP_V3_Access_Compare_Names(A1, A2) ((A1 == A2) ? 0 : 1)
#define SNMP_V3_Access_Get_Read(A) EBufferStart(&((A)->readview))
#define SNMP_V3_Access_Get_Read_Len(A) EBufferUsed(&((A)->readview))
#define SNMP_V3_Access_Set_Read(A,S,L,F) \
SNMP_V3_Access_Set_View(A, &((A)->readview), S, L, F)
#define SNMP_V3_Access_Get_Write(A) EBufferStart(&((A)->writeview))
#define SNMP_V3_Access_Get_Write_Len(A) EBufferUsed(&((A)->writeview))
#define SNMP_V3_Access_Set_Write(A,S,L,F) \
SNMP_V3_Access_Set_View(A, &((A)->writeview), S, L, F)
#define SNMP_V3_Access_Get_Notify(A) EBufferStart(&((A)->notifyview))
#define SNMP_V3_Access_Get_Notify_Len(A) EBufferUsed(&((A)->notifyview))
#define SNMP_V3_Access_Set_Notify(A,S,L,F) \
SNMP_V3_Access_Set_View(A, &((A)->notifyview), S, L, F)
#define SNMP_V3_Access_Get_Prefix_Match(A) ((A)->prefix_match)
#define SNMP_V3_Access_Set_Prefix_Match(A, B) (((A)->prefix_match) = (B))
#define SNMP_V3_Access_Get_Status(A) ((A)->status)
#define SNMP_V3_Access_Set_Status(A, V) ((A)->status = (bits16_t)(V))
#define SNMP_V3_Access_Get_Storage(A) ((A)->storage)
#define SNMP_V3_Access_Set_Storage(A, V) ((A)->storage = (bits16_t)(V))
extern void grouptable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_acc_inc))*/
@@ -0,0 +1,243 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_auth.h,v 1.4 2003/01/15 13:58:56 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_auth.h,v $
* Revision 1.4 2003/01/15 13:58:56 josh
* directory structure shifting
*
* Revision 1.3 2001/11/06 21:50:41 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.2 2001/11/06 21:35:05 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:11 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:43 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:35 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:59:34 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 2000/02/04 21:54:20 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.0 1998/10/16 22:10:23 sar
* Update version stamp to match release
*
* Revision 1.4 1998/08/12 04:52:17 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 1.3 1998/06/16 05:29:19 sar
* Add a long tag ("L") to a long constant
*
* Revision 1.2 1998/05/27 22:53:53 sar
* Add routines to manipulate the auth and priv lists (add and find),
* as well as some specifics adds (md5, sha)
*
* Revision 1.1 1998/05/23 19:49:39 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01e,09sep10,y_t fixed for WIND00230477
01d,03sep08,y_t update for openssl
01c,17may05,job fix up the DH code
01b,05may05,asl Diffie-Hellman work
01a,15apr05,AJS Diffie-Hellman work
01a,13apr05,AJS Diffie-Hellman work
*/
#if (!defined(v3_auth_inc))
#define v3_auth_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#include <stdio.h>
/*#if (!defined(HMAC_H))
#ifndef INSTALL_on_linux
#include <ipcom_type.h>
#endif
#include <openssl/evp.h>
#include <openssl/hmac.h>
#endif*/
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
#include <openssl/bn.h>
#include <openssl/dh.h>
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
/* For password to key purposes, this is the length to expand a password to */
#define V3_AUTH_MEGABYTE 1048576L
/* Needs is what is the length needed in the packet,
digest is the length of the acutal digest
keysize is the length of the keysize */
#define V3_HMAC_MD5_NEEDS 12
#define V3_HMAC_MD5_DIGEST 16
#define V3_HMAC_MD5_KEYSIZE 16
#define V3_HMAC_SHA_NEEDS 12
#define V3_HMAC_SHA_DIGEST 20
#define V3_HMAC_SHA_KEYSIZE 20
#define V3_HMAC_MAX_NEEDS 12
#define V3_HMAC_MAX_DIGEST 20
#define V3_HMAC_ENCRYPT_NONE 0
#define V3_HMAC_ENCRYPT_MD5 1
#define V3_HMAC_ENCRYPT_SHA 2
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_AUTH_S
{
struct SNMP_AUTH_S *next;
OBJ_ID_T name; /* name of the auth protocol */
char *digest_name;
ALENGTH_T need; /* digest carried in snmp message */
ALENGTH_T keysize; /* full digest */
int (*authenticate)(struct SNMP_AUTH_S *, bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T, bits8_t *, int);
} SNMP_AUTH_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* global root pointer for the auth list */
extern SNMP_AUTH_T *v3_auth_root;
extern SNMP_AUTH_T * SNMP_Auth_Find __((int, OIDC_T *));
extern int SNMP_Auth_Add __((SNMP_AUTH_T *));
extern int SNMP_Auth_Add_MD5 __((void));
extern int SNMP_Auth_Add_SHA __((void));
#define SNMP_Auth_Digest(A, K, KL, B, BL, O) \
((A)->authenticate(A, K, KL, B, BL, O, 0))
#define SNMP_Auth_Verify(A, K, KL, B, BL, O) \
((A)->authenticate(A, K, KL, B, BL, O, 1))
#define SNMP_Auth_Get_KeySize(A) ((A)->keysize)
#define SNMP_Auth_Get_Need(A) ((A)->need)
#define SNMP_Auth_Get_Name(A) (&((A)->name))
extern int SNMP_V3_Pass2Key __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T key_len,
bits8_t *, ALENGTH_T engineid_len, int));
extern int SNMP_V3_KeyChange __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T key_len));
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
int SNMP_V3_DHKeyChange (DH *DHvalues, BIGNUM *pubKey,\
bits8_t **sk, int *skLen);
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
/* Macros to get/set an Auth/Priv key */
#define SNMP_Get_DHauthKey(USER) \
(EBufferStart (&(USER->DH_keys.DHpubAuthKey)))
#define SNMP_Get_DHauthKey_len(USER) \
(EBufferUsed (&(USER->DH_keys.DHpubAuthKey)))
#define SNMP_Set_DHauthKey(USER,FLAGS,KEY,LENGTH) \
(EBufferPreload(FLAGS,((SNMP_DH_T *)(USER)->DH_keys).DHpubAuthKey,KEY,LENGTH)
/* Macros to get/set a Priv key */
#define SNMP_Get_DHprivKey(USER) \
(EBufferStart (&(USER->DH_keys.DHpubPrivKey)))
#define SNMP_Get_DHprivKey_len(USER) \
(EBufferUsed (&(USER->DH_keys.DHpubPrivKey)))
#define SNMP_Set_DHprivKey(USER,FLAGS,KEY,LENGTH) \
(EBufferPreload(FLAGS,((SNMP_DH_T *)(USER)->DH_keys).DHpubPrivKey,KEY,LENGTH)
/* Get the auth/priv random numbers; returns a pointer to BIGNUM */
#define SNMP_Get_DHauthRand(USER) (((SNMP_DH_T *)(USER)->DH_keys).DHauthRand)
#define SNMP_Get_DHprivhRand(USER) (((SNMP_DH_T *)(USER)->DH_keys).DHprivRand)
/* Set the BIGNUM pointer for auth/priv random numbers */
#define SNMP_Set_DHauthRand(USER,BN) \
(((SNMP_DH_T *)(USER)->DH_keys).DHauthRand = BN)
#define SNMP_Set_DHprivRand(USER,BN) \
(((SNMP_DH_T *)(USER)->DH_keys).DHprivRand = BN)
/* Other declarations */
extern OIDC_T v3_auth_noauth[];
extern int v3_auth_noauth_size;
extern int v3_auth_authenticate __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T, bits8_t *, int));
extern SNMP_AUTH_T v3_auth_md5;
extern SNMP_AUTH_T v3_auth_sha;
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_auth_inc)) */
@@ -0,0 +1,235 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_comm.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
/*
* Copyright (C) 1999-2005, 2013 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_comm.h,v $
* Revision 1.2 2001/11/06 21:35:05 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 1.1.2.3 2001/09/21 19:16:07 josh
* updating and expanding structures for use with coexistence
*
* Revision 1.1.2.2 2001/08/07 18:33:57 josh
* adding support for SNMPv1/v2c/v3 coexistence to SNMP Notify code
*
* Revision 1.1.2.1 2001/07/16 18:02:12 josh
* a first-round commit adding infrastructure support
* for the SNMPv3 Coexistence RFC (2576)
*
*
*/
/* [clearcase]
modification history
-------------------
01b,06aug13,bbz clear the med impact warning from prevent.pl(WIND00429583)
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_comm_inc))
#define v3_comm_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define ETC_COMMUNITY_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_COMMUNITY_S
{
struct SNMP_COMMUNITY_S *next;
EBUFFER_T comm_index; /* the name of this entry */
EBUFFER_T comm_name; /* the community name */
EBUFFER_T comm_sec_name; /* security name */
EBUFFER_T comm_con_id; /* context engine id */
EBUFFER_T comm_con_name; /* context name */
EBUFFER_T comm_tag; /* transport tag */
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_COMMUNITY_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define ETC_COMM_NAME 0x01
#define ETC_COMM_SEC_NAME 0x02
#define ETC_COMM_ALL_FLAGS 0x03
/* global root pointer for target params list */
extern SNMP_COMMUNITY_T *root_community;
#define SNMP_Community_Set_Defaults(C) \
(MEMSET((C), 0, sizeof(SNMP_COMMUNITY_T)), \
EBufferInitialize(&((C)->comm_index)), \
EBufferInitialize(&((C)->comm_name)), \
EBufferInitialize(&((C)->comm_sec_name)), \
EBufferInitialize(&((C)->comm_con_id)), \
EBufferAllocateLoad(BFL_IS_ALLOC, &((C)->comm_con_id), \
v3_my_engine->id, v3_my_engine->id_len), \
EBufferInitialize(&((C)->comm_con_name)), \
EBufferInitialize(&((C)->comm_tag)), \
(C)->storage = ETC_STO_NONVOL, \
(C)->status = ETC_RS_NREADY, \
(C)->flags = 0)
extern SNMP_COMMUNITY_T * SNMP_Community_Create __((void));
extern void SNMP_Community_Destroy __((SNMP_COMMUNITY_T *));
extern envoy_err_t SNMP_Community_Install __((SNMP_COMMUNITY_T *, bits8_t *,
ALENGTH_T));
extern void SNMP_Community_Deinstall __((SNMP_COMMUNITY_T *));
extern SNMP_COMMUNITY_T * SNMP_Community_Lookup __((bits8_t *, ALENGTH_T));
extern SNMP_COMMUNITY_T * SNMP_Community_Next __((int, OIDC_T *));
extern SNMP_COMMUNITY_T * SNMP_Community_Next_Community
__((SNMP_COMMUNITY_T *));
extern void SNMP_Community_Index __((SNMP_COMMUNITY_T *, bits8_t *,
ALENGTH_T *));
#define SNMP_Community_Get_Index(C) (EBufferStart(&((C)->comm_index)))
#define SNMP_Community_Get_Index_Len(C) (EBufferUsed(&((C)->comm_index)))
#define SNMP_Community_Get_Name(C) (EBufferStart(&((C)->comm_name)))
#define SNMP_Community_Get_Name_Len(C) (EBufferUsed(&((C)->comm_name)))
#define SNMP_Community_Set_Name(C, S, L, F) \
(EBufferAllocateLoad((F), &((C)->comm_name), (S), (L)))
#define SNMP_Community_Get_Sec_Name(C) (EBufferStart(&((C)->comm_sec_name)))
#define SNMP_Community_Get_Sec_Name_Len(C) (EBufferUsed(&((C)->comm_sec_name)))
#define SNMP_Community_Set_Sec_Name(C, S, L, F) \
(EBufferAllocateLoad((F), &((C)->comm_sec_name), (S), (L)))
#define SNMP_Community_Get_Con_ID(C) (EBufferStart(&((C)->comm_con_id)))
#define SNMP_Community_Get_Con_ID_Len(C) (EBufferUsed(&((C)->comm_con_id)))
#define SNMP_Community_Set_Con_ID(C, S, L, F) \
(EBufferAllocateLoad((F), &((C)->comm_con_id), (S), (L)))
#define SNMP_Community_Get_Con_Name(C) (EBufferStart(&((C)->comm_con_name)))
#define SNMP_Community_Get_Con_Name_Len(C) (EBufferUsed(&((C)->comm_con_name)))
#define SNMP_Community_Set_Con_Name(C, S, L, F) \
(EBufferAllocateLoad((F), &((C)->comm_con_name), (S), (L)))
#define SNMP_Community_Get_Tag(C) (EBufferStart(&((C)->comm_tag)))
#define SNMP_Community_Get_Tag_Len(C) (EBufferUsed(&((C)->comm_tag)))
#define SNMP_Community_Set_Tag(C, S, L, F) \
(EBufferAllocateLoad((F), &((C)->comm_tag), (S), (L)))
#define SNMP_Community_Get_Storage(C) ((C)->storage)
#define SNMP_Community_Set_Storage(C, V) ((C)->storage = (bits16_t)(V))
#define SNMP_Community_Get_Status(C) ((C)->status)
#define SNMP_Community_Set_Status(C, V) ((C)->status = (bits16_t)(V))
#define SNMP_Community_Get_Flags(C) ((C)->flags)
#define SNMP_Community_Set_Flags(C, V) ((C)->flags = (bits16_t)(V))
extern void snmpCommunityEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern struct SNMP_TARGET_ADDR_S *find_target_by_community __((EBUFFER_T *,
OBJ_ID_T *,
EBUFFER_T *));
#if (INSTALL_ENVOY_SNMP_V3_NOTIFY) || (INSTALL_ENVOY_SNMP_V3_PROXY)
/* Some well-known OIDs that will be necessary to deal with traps
* and proxies
*/
extern OIDC_T COEX_SNMPTRAPOID[];
extern OIDC_T COEX_TRAPENTERPRISE[];
extern OIDC_T COEX_SNMPTRAPS[];
extern OIDC_T COEX_COLDSTART[];
extern OIDC_T COEX_WARMSTART[];
extern OIDC_T COEX_LINKDOWN[];
extern OIDC_T COEX_LINKUP[];
extern OIDC_T COEX_AUTHFAILURE[];
extern OIDC_T COEX_NEIGHBORLOSS[];
#endif
/* The leaf definitions for the method routines */
#define LEAF_snmpCommunityIndex 1
#define MINSIZE_snmpCommunityIndex 1L
#define MAXSIZE_snmpCommunityIndex 32L
#define LEAF_snmpCommunityName 2
#define LEAF_snmpCommunitySecurityName 3
#define MINSIZE_snmpCommunitySecurityName 1L
#define MAXSIZE_snmpCommunitySecurityName 32L
#define LEAF_snmpCommunityContextEngineID 4
#define MINSIZE_snmpCommunityContextEngineID 5L
#define MAXSIZE_snmpCommunityContextEngineID 32L
#define LEAF_snmpCommunityContextName 5
#define MINSIZE_snmpCommunityContextName 0L
#define MAXSIZE_snmpCommunityContextName 32L
#define LEAF_snmpCommunityTransportTag 6
#define MINSIZE_snmpCommunityTransportTag 0L
#define MAXSIZE_snmpCommunityTransportTag 255L
#define LEAF_snmpCommunityStorageType 7
#define VAL_snmpCommunityStorageType_other 1L
#define VAL_snmpCommunityStorageType_volatile 2L
#define VAL_snmpCommunityStorageType_nonVolatile 3L
#define VAL_snmpCommunityStorageType_permanent 4L
#define VAL_snmpCommunityStorageType_readOnly 5L
#define LEAF_snmpCommunityStatus 8
#define VAL_snmpCommunityStatus_active 1L
#define VAL_snmpCommunityStatus_notInService 2L
#define VAL_snmpCommunityStatus_notReady 3L
#define VAL_snmpCommunityStatus_createAndGo 4L
#define VAL_snmpCommunityStatus_createAndWait 5L
#define VAL_snmpCommunityStatus_destroy 6L
#define LEAF_snmpTargetAddrTMask 1
#define MINSIZE_snmpTargetAddrTMask 0L
#define MAXSIZE_snmpTargetAddrTMask 255L
#define LEAF_snmpTargetAddrMMS 2
#define MIN_snmpTargetAddrMMS 484L
#define MAX_snmpTargetAddrMMS 2147483646L
#define LEAF_snmpTrapAddress 3
#define LEAF_snmpTrapCommunity 4
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_comm_inc))*/
@@ -0,0 +1,128 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_con.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_con.h,v $
* Revision 1.2 2001/11/06 21:35:05 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.5 2001/01/19 22:22:11 paul
* Update copyright.
*
* Revision 9.4 2000/03/17 19:48:44 meister
* Update copyright notice
*
* Revision 9.3 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.2 2000/03/09 16:59:47 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 2000/02/04 21:54:21 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.0 1998/10/16 22:10:24 sar
* Update version stamp to match release
*
* Revision 1.4 1998/08/01 17:29:05 sar
* Add argument to context length function
*
* Revision 1.3 1998/06/09 16:43:54 sar
* Moved some context routines to snmp so that they are in the core code
* and can be used by the rest of the core. Also renamed the routines
* to keep them separate from usec.
*
* Revision 1.2 1998/05/30 02:52:07 sar
* Modifed the names used for max string length
* Updated user lookup
*
* Revision 1.1 1998/05/23 19:49:40 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_context_inc))
#define v3_context_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#define ETC_CONTEXT_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_CONTEXT_S
{
struct SNMP_CONTEXT_S *next;
bits8_t *name;
ALENGTH_T length;
} SNMP_CONTEXT_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
extern SNMP_CONTEXT_T *v3_context_root;
extern int SNMP_V3_Context_Add __((bits8_t *, ALENGTH_T));
extern int SNMP_V3_Context_Remove __((bits8_t *, ALENGTH_T));
extern SNMP_CONTEXT_T *SNMP_V3_Context_Find __((bits8_t *, ALENGTH_T));
#define SNMP_V3_Context_Name(C) ((C)->name)
#define SNMP_V3_Context_Name_Length(C) ((C)->length)
extern void contexttable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void contexttable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif /* v3_context_inc */
@@ -0,0 +1,62 @@
/* v3_dh.h - v3_dh.h routines */
/*
* Copyright (C) 2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/* [clearcase]
modification history
-------------------
01c,04may05,asl Diffie-Hellman work
01b,02may05,job fix superfluous definitions
01a,28apr05,job remove extraneous prototype
*/
#if (!defined(v3_dh_inc))
#define v3_dh_inc
#ifdef __cplusplus
extern"C" {
#endif
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
#include <openssl/bn.h>
#define DH_MAX_FIELD_LEN 2
#define DH_LONG_FORM 2
#define DH_MIN_PARAMS_LEN 256
#define DH_SEQID 0x30
#define DH_MINKEYCHG 4
#define DH_SEED_PRIME 211
#define DH_MAX_SEED_BYTES 256
#ifndef SNMP_DH_RAND
#define SNMP_DH_RAND()
#endif
#define DH_PRIMELEN BN_num_bytes (SNMP_DH_params.prime)
extern BN_CTX *SNMP_DH_bnCtx;
extern SNMP_DH_PARAMS_T SNMP_DH_params;
int SNMP_DH_encodeParams (BIGNUM *prime, int base, int pvl, EBUFFER_T *result);
int SNMP_DH_decodeParams (EBUFFER_T *BUFFER, BIGNUM *prime, int *base, int *pvl);
int SNMP_set_DH_params (int primeLen, bits8_t *prime, int base, int pvl);
int SNMP_get_DH_params (int *primeLen, bits8_t **prime, int *base, int *pvl);
int SNMP_bn2bin (BIGNUM *bignum, bits8_t **binVal);
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
#ifdef __cplusplus
}
#endif
#endif /* v3_dh_inc */
@@ -0,0 +1,218 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_eng.h,v 1.3 2002/04/01 21:33:27 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_eng.h,v $
* Revision 1.3 2002/04/01 21:33:27 josh
* make sure that engine ids conform to restricted lengths
* (minimum of 5, maximum of 32)
*
* Revision 1.2 2001/11/06 21:35:06 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
* Tornado shuffle
*
* Revision 9.11 2001/04/11 20:42:56 josh
* merge from the kingfisher branch
*
* Revision 9.10 2001/01/19 22:22:11 paul
* Update copyright.
*
* Revision 9.9 2000/07/12 18:39:30 josh
* moving SNMP_Find_Matching_Engine_ID() to v3_eng.c -- appropriately
* updating headers to correspond
*
* Revision 9.8 2000/06/09 14:54:12 josh
* modifications due to new installation options, new proxy code
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
* be built with the target code
*
* Revision 9.7.2.2 2001/03/12 22:08:00 tneale
* Updated copyright
*
* Revision 9.7.2.1 2000/09/21 21:14:54 josh
* bringing branch include files in line with root
*
* Revision 9.7 2000/03/17 19:48:44 meister
* Update copyright notice
*
* Revision 9.6 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.5 2000/03/09 17:00:01 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.4 2000/02/04 21:54:22 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.3 1999/10/29 21:47:24 josh
* better control over how and when ENVOY_ADD_ENGINE_ADDRESS and
* ENVOY_ADD_ENGINE_ID are defined.
*
* Revision 9.2 1999/10/07 23:39:56 josh
* default definitions for ENVOY_ADD_ENGINE_ID and
* ENVOY_ADD_ENGINE_ADDRESS
*
* Revision 9.1 1999/09/27 21:11:44 josh
* fixing nits, rewriting engine id <--> address code, adding installation
* option
*
* Revision 9.0 1998/10/16 22:10:24 sar
* Update version stamp to match release
*
* Revision 1.6 1998/08/12 04:52:16 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 1.5 1998/07/20 01:59:57 sar
* Add () to SNMP_Engine_Get_My_* and ENVOY_TIME calls
* Modify the timestamp installs so they are all the same,
* installing ENVOY_TIME() - timestamp
*
* Revision 1.4 1998/07/03 16:54:53 sar
* Remove many engine install option, moved this engine's information
* into an engine structure
*
* Revision 1.3 1998/06/18 04:42:04 sar
* Modified bflags in ebuffer to be unsigned ints and updated
* calling routines accordingly
*
* Revision 1.2 1998/05/30 02:52:08 sar
* Modifed the names used for max string length
* Updated user lookup
*
* Revision 1.1 1998/05/23 19:49:40 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_eng_inc))
#define v3_eng_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#define ETC_ENGINE_ENGINE_MIN 5
#define ETC_ENGINE_ENGINE_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct ENGINE_LEAF_S
{
struct ENGINE_LEAF_S *next;
bits8_t *id;
ALENGTH_T id_len;
bits32_t boots;
sbits32_t offset;
sbits32_t lasttime;
#if INSTALL_ENVOY_SNMP_V3_TARGET
OBJ_ID_T tdomain; /* information to allow us to find */
EBUFFER_T taddress; /* a remote engineid for informs */
#endif
} ENGINE_LEAF_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#ifndef ENVOY_ADD_ENGINE_ADDRESS
#if (INSTALL_ENVOY_SNMP_V3_TARGET)
extern int envoy_add_engine_address __((SNMP_PKT_T *, SNMPADDR_T *, int));
#define ENVOY_ADD_ENGINE_ADDRESS(P, A, C) \
envoy_add_engine_address((P), (A), (C))
#elif defined(ENVOY_ADD_ENGINE_ID)
#define ENVOY_ADD_ENGINE_ADDRESS(P, A, C) (ENVOY_ADD_ENGINE_ID(P), 1)
#endif
#endif
/* global variables */
extern sbits32_t v3_snmpEngineMaxMessageSize;
extern ENGINE_LEAF_T *v3_my_engine;
extern ENGINE_LEAF_T *root_engine;
extern int SNMP_Engine_Set_My_Info __((bits8_t *, ALENGTH_T,
bits32_t, sbits32_t));
#define SNMP_Engine_Get_My_ID() (v3_my_engine ? v3_my_engine->id : 0)
#define SNMP_Engine_Get_My_ID_Length() (v3_my_engine ? v3_my_engine->id_len : 0)
#define SNMP_Engine_Get_My_Boots() (v3_my_engine ? v3_my_engine->boots : 0)
#define SNMP_Engine_Get_My_Time() (v3_my_engine ? \
(ENVOY_TIME()) - v3_my_engine->offset : 0)
#define SNMP_Engine_Get_Boots(E) ((E)->boots)
#define SNMP_Engine_Get_Time(E) ((ENVOY_TIME()) - (E)->offset)
#define SNMP_Engine_Get_LastTime(E) ((E)->lasttime)
#define SNMP_Engine_Set_Info(E, B, T) ((E)->boots = (B), \
(E)->offset = (ENVOY_TIME()) - (T),\
(E)->lasttime = (T))
extern void SNMP_Find_Matching_Engine_ID __((OBJ_ID_T *, EBUFFER_T *,
bits8_t **, ALENGTH_T *));
extern int SNMP_Engine_Set_Address __((bits8_t *, ALENGTH_T,
OIDC_T *, int,
bits8_t *, ALENGTH_T));
extern ENGINE_LEAF_T * SNMP_Engine_Lookup __((bits8_t *, ALENGTH_T));
extern int SNMP_Engine_Install __((bits8_t *, ALENGTH_T,
bits32_t, sbits32_t));
extern void get_snmpEngineID __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void get_snmpEngineBoots __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void get_snmpEngineTime __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif /* (!defined(v3_eng_inc)) */
@@ -0,0 +1,85 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_ini.h,v 1.3 2001/11/06 21:50:41 josh Exp $ */
/*
* Copyright (C) 1999-2011 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_ini.h,v $
* Revision 1.3 2001/11/06 21:50:41 josh
* second (and hopefully final) pass of new path hacking
*
* Revision 1.2 2001/11/06 21:35:06 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.3 2001/01/19 22:22:11 paul
* Update copyright.
*
* Revision 9.2 2000/03/17 19:48:45 meister
* Update copyright notice
*
* Revision 9.1 2000/03/09 17:00:12 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:25 sar
* Update version stamp to match release
*
* Revision 8.1 1998/08/12 04:52:16 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
*/
/* [clearcase]
modification history
-------------------
01b,16jun11,y_t update for requirement WIND00242199
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_ini_inc))
#define v3_ini_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
#if (!defined(snmp_inc))
#include <wrn/wm/snmp/engine/snmp.h>
#endif
extern void envoy_v3_init __((void));
#ifdef _WRS_CONFIG_COMPONENT_IPCRYPTO_USE_FIPS_140_2
#define OPENSSL_FIPS
#endif
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_ini_inc)) */
@@ -0,0 +1,216 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_mth.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_mth.h,v $
* Revision 1.2 2001/11/06 21:35:06 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.4.4.1 2001/07/16 18:02:13 josh
* a first-round commit adding infrastructure support
* for the SNMPv3 Coexistence RFC (2576)
*
* Revision 9.4 2001/01/19 22:22:12 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:45 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 17:00:24 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.1 1999/10/15 17:44:50 josh
* added prototypes for method routines for target and notify MIBs
*
* Revision 9.0 1998/10/16 22:10:25 sar
* Update version stamp to match release
*
* Revision 1.2 1998/07/03 16:54:53 sar
* Remove many engine install option, moved this engine's information
* into an engine structure
*
* Revision 1.1 1998/05/23 19:49:40 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01b,21apr05,AJS Diffie-Hellman work
01a,19apr05,job update copyright notices
01a,13apr05,AJS Diffie-Hellman work
*/
#if (!defined(v3_mth_inc))
#define v3_mth_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#if (!defined(vb_inc))
#include <wrn/wm/snmp/engine/vbdefs.h>
#endif
/* for our engine information */
extern void get_snmpEngineID __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void get_snmpEngineBoots __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void get_snmpEngineTime __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the targetaddr table */
extern void snmpTargetAddrEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the targetparams table */
extern void snmpTargetParamsEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the notify table */
extern void snmpNotifyEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the notifyfilterprofile table */
extern void snmpNotifyFilterProfileEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the notifyfilter table */
extern void snmpNotifyFilterEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the proxy table */
extern void snmpProxyEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the user table */
extern void usertable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* Diffie-Hellman usmDHParameters object */
extern void usmDHPublicObjects_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usmDHPublicObjects_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usmDHPublicObjects_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usmDHPublicObjects_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the context table, read only so don't have test or set */
extern void contexttable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void contexttable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the security to group and access tables */
extern void grouptable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void grouptable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void accesstable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* for the community table */
extern void snmpCommunityEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpCommunityEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,402 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_ntfy.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_ntfy.h,v $
* Revision 1.2 2001/11/06 21:35:06 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.6 2001/01/19 22:22:12 paul
* Update copyright.
*
* Revision 9.5 2000/03/17 19:48:46 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 17:06:27 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 2000/02/04 21:54:24 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.1 2000/01/02 22:55:56 josh
* patching up a memory leak here, a broken compare there...per
* sar's comments
*
* Revision 9.0 1999/10/21 20:43:36 josh
* updating version stamps
*
* Revision 1.7 1999/10/21 19:13:08 josh
* adding flags for flags fields in various objects to help with row
* creation
*
* Revision 1.6 1999/10/15 17:47:27 josh
* included MIB leaf definitions and cleaned up useless macros
*
* Revision 1.5 1999/09/21 21:31:26 josh
* Adding a limit constant for the NotifyFilterMask
*
* Revision 1.4 1999/09/14 19:35:26 josh
* updating default initialization per RFC 2573
*
* Revision 1.3 1999/09/11 02:15:19 josh
* added definitions for filter excluded and included
*
* Revision 1.2 1999/09/01 20:50:02 josh
* updates to reach consistency with v3_ntfy.c
*
* Revision 1.1 1999/06/16 17:04:22 josh
* First step of adding RFC2573 Notify support.
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_ntfy_inc))
#define v3_ntfy_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define ETC_NOTIFY_MAX 32
#define ETC_NOTIFY_FILTER_PROFILE_MAX 32
#define ETC_NOTIFY_FILTER_MAX 32
#define ETC_NOTIFY_FILTER_MASK_MAX 16
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_NOTIFY_S
{
struct SNMP_NOTIFY_S *next;
EBUFFER_T notify_name; /* Name of the notify */
EBUFFER_T notify_tag; /* Tag notify is associated with */
bits16_t notify_type; /* Trap or Inform? */
#define SNMP_NOTIFY_TRAP 1
#define SNMP_NOTIFY_INFORM 2
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_NOTIFY_T;
/* global root pointer for notify list */
extern SNMP_NOTIFY_T *root_notify;
#define SNMP_Notify_Set_Defaults(T) \
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_T)), \
EBufferInitialize(&((T)->notify_name)), \
EBufferInitialize(&((T)->notify_tag)), \
(T)->notify_type = SNMP_NOTIFY_TRAP, \
(T)->storage = ETC_STO_NONVOL, \
(T)->status = ETC_RS_NREADY, \
(T)->flags = 0)
extern SNMP_NOTIFY_T * SNMP_Notify_Create __((void));
extern void SNMP_Notify_Destroy __((SNMP_NOTIFY_T *));
extern int SNMP_Notify_Install __((SNMP_NOTIFY_T *, bits8_t *,
ALENGTH_T));
extern void SNMP_Notify_Deinstall __((SNMP_NOTIFY_T *));
extern SNMP_NOTIFY_T * SNMP_Notify_Lookup __((bits8_t *, ALENGTH_T));
extern SNMP_NOTIFY_T * SNMP_Notify_Next __((int, OIDC_T *));
extern SNMP_NOTIFY_T * SNMP_Notify_Next_Notify __((SNMP_NOTIFY_T *));
extern void SNMP_Notify_Name __((SNMP_NOTIFY_T *, bits8_t *,
ALENGTH_T *));
#define SNMP_Notify_Get_Name(N) (EBufferStart(&((N)->notify_name)))
#define SNMP_Notify_Get_Name_Len(N) (EBufferUsed(&((N)->notify_name)))
#define SNMP_Notify_Get_Tag(N) (EBufferStart(&((N)->notify_tag)))
#define SNMP_Notify_Get_Tag_Len(N) (EBufferUsed(&((N)->notify_tag)))
#define SNMP_Notify_Set_Tag(N, S, L, F) \
(EBufferAllocateLoad((F), &((N)->notify_tag), (S), (L)))
#define SNMP_Notify_Get_Type(N) ((N)->notify_type)
#define SNMP_Notify_Set_Type(N, V) ((N)->notify_type = (bits16_t)(V))
#define SNMP_Notify_Get_Storage(N) ((N)->storage)
#define SNMP_Notify_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
#define SNMP_Notify_Get_Status(N) ((N)->status)
#define SNMP_Notify_Set_Status(N, V) ((N)->status = (bits16_t)(V))
#define SNMP_Notify_Get_Flags(N) ((N)->flags)
#define SNMP_Notify_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
typedef struct SNMP_NOTIFY_FILTER_PROFILE_S
{
struct SNMP_NOTIFY_FILTER_PROFILE_S *next;
EBUFFER_T params_name; /* From snmpTargetParamsTable */
EBUFFER_T profile_name; /* Name of filter profile */
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_NOTIFY_FILTER_PROFILE_T;
#define ETC_NPROF_PROFILE 0x01
#define ETC_NPROF_ALL_FLAGS 0x01
/* global root pointer for notify filter profile list */
extern SNMP_NOTIFY_FILTER_PROFILE_T *root_notify_filter_profile;
#define SNMP_Notify_Profile_Set_Defaults(T) \
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_FILTER_PROFILE_T)), \
EBufferInitialize(&((T)->params_name)), \
EBufferInitialize(&((T)->profile_name)), \
(T)->storage = ETC_STO_NONVOL, \
(T)->status = ETC_RS_NREADY, \
(T)->flags = 0)
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Create
__((void));
extern void SNMP_Notify_Profile_Destroy
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
extern int SNMP_Notify_Profile_Install
__((SNMP_NOTIFY_FILTER_PROFILE_T *, bits8_t *, ALENGTH_T));
extern void SNMP_Notify_Profile_Deinstall
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Lookup
__((bits8_t *, ALENGTH_T));
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Next
__((int, OIDC_T *));
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Next_Profile
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
extern void SNMP_Notify_Profile_Name
__((SNMP_NOTIFY_FILTER_PROFILE_T *, bits8_t *, ALENGTH_T *));
#define SNMP_Notify_Profile_Get_Params(N) \
(EBufferStart(&((N)->params_name)))
#define SNMP_Notify_Profile_Get_Params_Len(N) \
(EBufferUsed(&((N)->params_name)))
#define SNMP_Notify_Profile_Get_Profile(N) \
(EBufferStart(&((N)->profile_name)))
#define SNMP_Notify_Profile_Get_Profile_Len(N) \
(EBufferUsed(&((N)->profile_name)))
#define SNMP_Notify_Profile_Set_Profile(N, S, L, F) \
(EBufferAllocateLoad((F), &((N)->profile_name), (S), (L)))
#define SNMP_Notify_Profile_Get_Storage(N) ((N)->storage)
#define SNMP_Notify_Profile_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
#define SNMP_Notify_Profile_Get_Status(N) ((N)->status)
#define SNMP_Notify_Profile_Set_Status(N, V) ((N)->status = (bits16_t)(V))
#define SNMP_Notify_Profile_Get_Flags(N) ((N)->flags)
#define SNMP_Notify_Profile_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
typedef struct SNMP_NOTIFY_FILTER_S
{
struct SNMP_NOTIFY_FILTER_S *next;
EBUFFER_T profile_name; /* From snmpNotifyFilterProfileTable */
OBJ_ID_T subtree; /* MIB subtree for this filter */
EBUFFER_T filter_mask; /* Mask for subtree */
bits16_t filter_type; /* include or exclude filter */
#define SNMP_NOTIFY_FILTER_INCLUDED 1
#define SNMP_NOTIFY_FILTER_EXCLUDED 2
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_NOTIFY_FILTER_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* global root pointer for notify filter list */
extern SNMP_NOTIFY_FILTER_T *root_notify_filter;
#define SNMP_Notify_Filter_Set_Defaults(T) \
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_FILTER_T)), \
EBufferInitialize(&((T)->profile_name)) , \
EBufferInitialize(&((T)->filter_mask)), \
(T)->filter_type = SNMP_NOTIFY_FILTER_INCLUDED, \
(T)->storage = ETC_STO_NONVOL, \
(T)->status = ETC_RS_NREADY, \
(T)->flags = 0)
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Create __((void));
extern void SNMP_Notify_Filter_Destroy __((SNMP_NOTIFY_FILTER_T *));
extern int SNMP_Notify_Filter_Install __((SNMP_NOTIFY_FILTER_T *, bits8_t *,
ALENGTH_T, OBJ_ID_T *));
extern void SNMP_Notify_Filter_Deinstall __((SNMP_NOTIFY_FILTER_T *));
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Lookup
__((bits8_t *, ALENGTH_T, OBJ_ID_T *));
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Next __((int, OIDC_T *));
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Next_Filter
__((SNMP_NOTIFY_FILTER_T *));
extern void SNMP_Notify_Filter_Name __((SNMP_NOTIFY_FILTER_T *,
bits8_t *, ALENGTH_T *,
OIDC_T **, int *));
#define SNMP_Notify_Filter_Get_Profile(N) \
(EBufferStart(&((N)->profile_name)))
#define SNMP_Notify_Filter_Get_Profile_Len(N) \
(EBufferUsed(&((N)->profile_name)))
#define SNMP_Notify_Filter_Get_Subtree(N) (&((N)->subtree))
#define SNMP_Notify_Filter_Get_Mask(N) \
(EBufferStart(&((N)->filter_mask)))
#define SNMP_Notify_Filter_Get_Mask_Len(N) \
(EBufferUsed(&((N)->filter_mask)))
#define SNMP_Notify_Filter_Set_Mask(N, S, L, F) \
(EBufferAllocateLoad((F), &((N)->filter_mask), (S), (L)))
#define SNMP_Notify_Filter_Get_Type(N) ((N)->filter_type)
#define SNMP_Notify_Filter_Set_Type(N, V) ((N)->filter_type = (bits16_t)(V))
#define SNMP_Notify_Filter_Get_Storage(N) ((N)->storage)
#define SNMP_Notify_Filter_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
#define SNMP_Notify_Filter_Get_Status(N) ((N)->status)
#define SNMP_Notify_Filter_Set_Status(N, V) ((N)->status = (bits16_t)(V))
#define SNMP_Notify_Filter_Get_Flags(N) ((N)->flags)
#define SNMP_Notify_Filter_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
extern void snmpNotifyEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterProfileEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpNotifyFilterEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* The leaf definitions for the method routines */
#define LEAF_snmpNotifyName 1
#define MINSIZE_snmpNotifyName 1L
#define MAXSIZE_snmpNotifyName 32L
#define LEAF_snmpNotifyTag 2
#define MINSIZE_snmpNotifyTag 0L
#define MAXSIZE_snmpNotifyTag 255L
#define LEAF_snmpNotifyType 3
#define VAL_snmpNotifyType_trap 1L
#define VAL_snmpNotifyType_inform 2L
#define LEAF_snmpNotifyStorageType 4
#define VAL_snmpNotifyStorageType_other 1L
#define VAL_snmpNotifyStorageType_volatile 2L
#define VAL_snmpNotifyStorageType_nonVolatile 3L
#define VAL_snmpNotifyStorageType_permanent 4L
#define VAL_snmpNotifyStorageType_readOnly 5L
#define LEAF_snmpNotifyRowStatus 5
#define VAL_snmpNotifyRowStatus_active 1L
#define VAL_snmpNotifyRowStatus_notInService 2L
#define VAL_snmpNotifyRowStatus_notReady 3L
#define VAL_snmpNotifyRowStatus_createAndGo 4L
#define VAL_snmpNotifyRowStatus_createAndWait 5L
#define VAL_snmpNotifyRowStatus_destroy 6L
#define LEAF_snmpNotifyFilterProfileName 1
#define MINSIZE_snmpNotifyFilterProfileName 1L
#define MAXSIZE_snmpNotifyFilterProfileName 32L
#define LEAF_snmpNotifyFilterProfileStorType 2
#define VAL_snmpNotifyFilterProfileStorType_other 1L
#define VAL_snmpNotifyFilterProfileStorType_volatile 2L
#define VAL_snmpNotifyFilterProfileStorType_nonVolatile 3L
#define VAL_snmpNotifyFilterProfileStorType_permanent 4L
#define VAL_snmpNotifyFilterProfileStorType_readOnly 5L
#define LEAF_snmpNotifyFilterProfileRowStatus 3
#define VAL_snmpNotifyFilterProfileRowStatus_active 1L
#define VAL_snmpNotifyFilterProfileRowStatus_notInService 2L
#define VAL_snmpNotifyFilterProfileRowStatus_notReady 3L
#define VAL_snmpNotifyFilterProfileRowStatus_createAndGo 4L
#define VAL_snmpNotifyFilterProfileRowStatus_createAndWait 5L
#define VAL_snmpNotifyFilterProfileRowStatus_destroy 6L
#define LEAF_snmpNotifyFilterSubtree 1
#define LEAF_snmpNotifyFilterMask 2
#define MINSIZE_snmpNotifyFilterMask 0L
#define MAXSIZE_snmpNotifyFilterMask 16L
#define LEAF_snmpNotifyFilterType 3
#define VAL_snmpNotifyFilterType_included 1L
#define VAL_snmpNotifyFilterType_excluded 2L
#define LEAF_snmpNotifyFilterStorageType 4
#define VAL_snmpNotifyFilterStorageType_other 1L
#define VAL_snmpNotifyFilterStorageType_volatile 2L
#define VAL_snmpNotifyFilterStorageType_nonVolatile 3L
#define VAL_snmpNotifyFilterStorageType_permanent 4L
#define VAL_snmpNotifyFilterStorageType_readOnly 5L
#define LEAF_snmpNotifyFilterRowStatus 5
#define VAL_snmpNotifyFilterRowStatus_active 1L
#define VAL_snmpNotifyFilterRowStatus_notInService 2L
#define VAL_snmpNotifyFilterRowStatus_notReady 3L
#define VAL_snmpNotifyFilterRowStatus_createAndGo 4L
#define VAL_snmpNotifyFilterRowStatus_createAndWait 5L
#define VAL_snmpNotifyFilterRowStatus_destroy 6L
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_ntfy_inc))*/
@@ -0,0 +1,141 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_priv.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_priv.h,v $
* Revision 1.2 2001/11/06 21:35:06 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.4 2001/01/19 22:22:12 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:46 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 17:06:57 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.0 1998/10/16 22:10:26 sar
* Update version stamp to match release
*
* Revision 1.3 1998/08/12 04:52:17 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 1.2 1998/05/27 22:53:53 sar
* Add routines to manipulate the auth and priv lists (add and find),
* as well as some specifics adds (md5, sha)
*
* Revision 1.1 1998/05/23 19:49:40 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01b,20apr09,y_t update for requirement WIND00000579
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_priv_inc))
#define v3_priv_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
typedef ALENGTH_T (V3_PRIV_SIZE_T) __((ptr_t, ALENGTH_T));
typedef int (V3_PRIV_ENCODE_T) __((bits8_t *, ALENGTH_T, sbits32_t, sbits32_t,
bits8_t *, ALENGTH_T,
bits8_t *, bits8_t *));
typedef int (V3_PRIV_DECODE_T) __((bits8_t *, ALENGTH_T,sbits32_t, sbits32_t,
bits8_t *, ALENGTH_T,
bits8_t *, bits8_t *));
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_PRIV_S
{
struct SNMP_PRIV_S *next;
OBJ_ID_T name; /* name of the priv protocol */
V3_PRIV_SIZE_T *size; /* routine to calculate the size */
V3_PRIV_ENCODE_T *encode; /* routine to encode */
V3_PRIV_DECODE_T *decode; /* routine to decode */
ALENGTH_T need; /* space required for priv stuff */
ALENGTH_T keysize; /* space required for the key */
} SNMP_PRIV_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* global root pointer for the auth list */
extern SNMP_PRIV_T *v3_priv_root;
extern SNMP_PRIV_T * SNMP_Priv_Find __((int, OIDC_T *));
extern int SNMP_Priv_Add __((SNMP_PRIV_T *));
extern int SNMP_Priv_Add_DES __((void));
extern int SNMP_Priv_Add_AESCFB128 __((void));
#define SNMP_Priv_Size(P, PKT, SL) (((P)->size)((PKT), (SL)))
#define SNMP_Priv_Encode(P, K, KL, BT, ET, B, BL, SP, OP) \
(((P)->encode)((K), (KL), (BT),(ET), (B), (BL), (SP), (OP)))
#define SNMP_Priv_Decode(P, K, KL, BT, ET, B, BL, SP, OP) \
(((P)->decode)((K), (KL), (BT), (ET), (B), (BL), (SP), (OP)))
#define SNMP_Priv_Get_KeySize(P) ((P)->keysize)
#define SNMP_Priv_Get_Need(P) ((P)->need)
#define SNMP_Priv_Get_Name(P) (&((P)->name))
extern OIDC_T v3_priv_nopriv[];
extern int v3_priv_nopriv_size;
extern SNMP_PRIV_T v3_priv_des;
extern SNMP_PRIV_T v3_priv_aescfb128;
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_priv_inc)) */
@@ -0,0 +1,282 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_proxy.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
/* v3_proxy.h - definitions for RFC 2573 Proxy code */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* All rights reserved.
****************************************************************************/
/*
modification history
--------------------
01d,15sep09,y_t fix for WIND00181371
01c,19apr05,job update copyright notices
01b,25nov03,ps copyright update
01a,25aug03,job fixing a prototype mismatch
$Log: v3_proxy.h,v $
Revision 1.2 2001/11/06 21:35:07 josh
new revised path structure, first pass. Also removing useless
shell include files.
Revision 1.1.1.1 2001/11/05 17:47:24 tneale
Tornado shuffle
Revision 9.4.2.4 2001/09/21 19:16:07 josh
updating and expanding structures for use with coexistence
Revision 9.4.2.3 2001/08/31 17:02:20 josh
clean up a few nits
Revision 9.4.2.2 2001/08/24 14:31:24 josh
adding function prototypes for the proxy processing routines
Revision 9.4.2.1 2001/06/28 18:22:57 josh
Seeding the Cormorant branch with the code from the old
cormorant branch
Revision 9.3.2.1 2001/04/11 19:35:41 josh
moving cormorant-specific files onto the special
cormorant branch so they don't get in kingfisher's way
Revision 9.3 2001/01/19 22:22:12 paul
Update copyright.
Revision 9.2 2000/07/12 18:42:27 josh
definitions for proxy control block and associated flags and
structures
Revision 9.1 2000/06/09 14:54:13 josh
modifications due to new installation options, new proxy code
moved some definitions from sendntfy.h into v3_trgt.h so they'd
be built with the target code
*/
#if (!defined(__INCv3Proxyh))
#define __INCv3Proxyh
#ifdef __cplusplus
extern"C" {
#endif /* __cplusplus */
#include <wrn/wm/snmp/engine/asn1.h>
#include <wrn/wm/snmp/engine/buffer.h>
#include <wrn/wm/snmp/engine/smi.h>
#include <wrn/wm/snmp/engine/etimer.h>
#define ETC_PROXY_NAME_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_PROXY_S
{
struct SNMP_PROXY_S *next; /* next proxy object in list */
struct EBUFFER_S proxy_name; /* the name of the proxy object */
struct EBUFFER_S context_engine_id; /* engine id of this proxy */
struct EBUFFER_S context_name; /* context name of proxy */
struct EBUFFER_S target_params_in; /* for endpoint matching */
struct EBUFFER_S single_target_out; /* for forwarding of requests */
struct EBUFFER_S multiple_target_out; /* for forwarding of notifies */
ETC_STORAGE_T storage; /* storage type of this object */
ETC_STATUS_T status; /* row status of this object */
bits8_t proxy_type; /* read, write, trap or inform */
} SNMP_PROXY_T;
/* global root pointer for target params list */
extern SNMP_PROXY_T *root_proxy;
#define SNMP_Proxy_Set_Defaults(P) \
(MEMSET((P), 0, sizeof(SNMP_PROXY_T)), \
EBufferInitialize(&((P)->proxy_name)), \
EBufferInitialize(&((P)->context_engine_id)), \
EBufferInitialize(&((P)->context_name)), \
EBufferInitialize(&((P)->target_params_in)), \
EBufferInitialize(&((P)->single_target_out)), \
EBufferInitialize(&((P)->multiple_target_out)), \
(P)->storage = ETC_STO_NONVOL, \
(P)->status = ETC_RS_NREADY, \
(P)->proxy_type = PROXY_TYPE_READ)
/* values for the proxy_type field */
#define PROXY_TYPE_READ 1
#define PROXY_TYPE_WRITE 2
#define PROXY_TYPE_TRAP 3
#define PROXY_TYPE_INFORM 4
extern SNMP_PROXY_T * SNMP_Proxy_Create __((void));
extern void SNMP_Proxy_Destroy __((SNMP_PROXY_T * proxy));
extern envoy_err_t SNMP_Proxy_Install __((SNMP_PROXY_T * proxy,
bits8_t * proxy_name,
ALENGTH_T proxy_name_len));
extern void SNMP_Proxy_Deinstall __((SNMP_PROXY_T * proxy));
extern SNMP_PROXY_T * SNMP_Proxy_Lookup __((bits8_t * proxy_name,
ALENGTH_T proxy_name_len));
extern SNMP_PROXY_T * SNMP_Proxy_Next __((int tcount,
OIDC_T * tlist));
extern SNMP_PROXY_T * SNMP_Proxy_Next_Proxy __((SNMP_PROXY_T * proxy));
extern void SNMP_Proxy_Name __((SNMP_PROXY_T * proxy,
bits8_t * proxy_name,
ALENGTH_T * proxy_name_len));
#define SNMP_Proxy_Get_Proxy_Name(P) (EBufferStart(&((P)->proxy_name)))
#define SNMP_Proxy_Get_Proxy_Name_Len(P) (EBufferUsed(&((P)->proxy_name)))
#define SNMP_Proxy_Get_Proxy_Type(P) ((P)->proxy_type)
#define SNMP_Proxy_Set_Proxy_Type(P, V) ((P)->proxy_type = (bits16_t)(V))
#define SNMP_Proxy_Get_Context_Engine_ID(P) \
(EBufferStart(&((P)->context_engine_id)))
#define SNMP_Proxy_Get_Context_Engine_ID_Len(P) \
(EBufferUsed(&((P)->context_engine_id)))
#define SNMP_Proxy_Set_Context_Engine_ID(P, S, L, F) \
(EBufferAllocateLoad((F), &((P)->context_engine_id), (S), (L)))
#define SNMP_Proxy_Get_Context_Name(P) (EBufferStart(&((P)->context_name)))
#define SNMP_Proxy_Get_Context_Name_Len(P) (EBufferUsed(&((P)->context_name)))
#define SNMP_Proxy_Set_Context_Name(P, S, L, F) \
(EBufferAllocateLoad((F), &((P)->context_name), (S), (L)))
#define SNMP_Proxy_Get_Target_Params_In(P) \
(EBufferStart(&((P)->target_params_in)))
#define SNMP_Proxy_Get_Target_Params_In_Len(P) \
(EBufferUsed(&((P)->target_params_in)))
#define SNMP_Proxy_Set_Target_Params_In(P, S, L, F) \
(EBufferAllocateLoad((F), &((P)->target_params_in), (S), (L)))
#define SNMP_Proxy_Get_Single_Target_Out(P) \
(EBufferStart(&((P)->single_target_out)))
#define SNMP_Proxy_Get_Single_Target_Out_Len(P) \
(EBufferUsed(&((P)->single_target_out)))
#define SNMP_Proxy_Set_Single_Target_Out(P, S, L, F) \
(EBufferAllocateLoad((F), &((P)->single_target_out), (S), (L)))
#define SNMP_Proxy_Get_Multiple_Target_Out(P) \
(EBufferStart(&((P)->multiple_target_out)))
#define SNMP_Proxy_Get_Multiple_Target_Out_Len(P) \
(EBufferUsed(&((P)->multiple_target_out)))
#define SNMP_Proxy_Set_Multiple_Target_Out(P, S, L, F) \
(EBufferAllocateLoad((F), &((P)->multiple_target_out), (S), (L)))
#define SNMP_Proxy_Get_Storage(P) ((P)->storage)
#define SNMP_Proxy_Set_Storage(P, V) ((P)->storage = (bits16_t)(V))
#define SNMP_Proxy_Get_Status(P) ((P)->status)
#define SNMP_Proxy_Set_Status(P, V) ((P)->status = (bits16_t)(V))
#define SNMP_Proxy_Get_Flags(P) ((P)->flags)
#define SNMP_Proxy_Set_Flags(P, V) ((P)->flags = (bits16_t)(V))
/* User-definable stuff */
#ifndef PROXY_SWEEP_TIME
#define PROXY_SWEEP_TIME 3000
#endif
#ifndef ENVOY_SNMP_SEND_PROXY
#define ENVOY_SNMP_SEND_PROXY(FOR, LOC, PKT, SIZ)
#endif
/* structure definition for proxy control block */
struct TARGET_LIST_S;
typedef struct SNMP_PROXY_CB_S
{
struct SNMP_PROXY_CB_S * next;
struct TARGET_LIST_S * targetList;
SNMP_PKT_T * originalPkt;
EBUFFER_T contextEngineID;
EBUFFER_T contextName;
EBUFFER_T secName;
EBUFFER_T communityString;
bits32_t msgID;
bits32_t expires;
bits8_t flags;
} SNMP_PROXY_CB_T;
#define SNMP_PROXY_FLAGS_EXPIRED 0x01
#define SNMP_PROXY_FLAGS_RESPONDED 0x02
#define SNMP_PROXY_FLAGS_VBLIST_COPIED 0x04
typedef struct SNMP_PROXY_CB_ROOT_S
{
SNMP_PROXY_CB_T * pcb;
bits32_t * nextMsgID;
ENVOY_TIMER_T timer;
} SNMP_PROXY_CB_ROOT_T;
extern SNMP_PROXY_CB_ROOT_T root_proxy_block;
extern envoy_err_t snmpProxyV3Request __((SNMP_PKT_T *));
extern envoy_err_t snmpProxyV3Notify __((SNMP_PKT_T *));
extern envoy_err_t snmpProxyV3Response __((SNMP_PKT_T *));
extern void snmpProxyEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpProxyEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
/* Definitions of leaf nodes for MIB support */
#define LEAF_snmpProxyName 1
#define MINSIZE_snmpProxyName 1L
#define MAXSIZE_snmpProxyName 32L
#define LEAF_snmpProxyType 2
#define VAL_snmpProxyType_read 1L
#define VAL_snmpProxyType_write 2L
#define VAL_snmpProxyType_trap 3L
#define VAL_snmpProxyType_inform 4L
#define LEAF_snmpProxyContextEngineID 3
#define MINSIZE_snmpProxyContextEngineID 5L
#define MAXSIZE_snmpProxyContextEngineID 32L
#define LEAF_snmpProxyContextName 4
#define MINSIZE_snmpProxyContextName 0L
#define MAXSIZE_snmpProxyContextName 255L
#define LEAF_snmpProxyTargetParamsIn 5
#define MINSIZE_snmpProxyTargetParamsIn 0L
#define MAXSIZE_snmpProxyTargetParamsIn 255L
#define LEAF_snmpProxySingleTargetOut 6
#define MINSIZE_snmpProxySingleTargetOut 0L
#define MAXSIZE_snmpProxySingleTargetOut 255L
#define LEAF_snmpProxyMultipleTargetOut 7
#define MINSIZE_snmpProxyMultipleTargetOut 0L
#define MAXSIZE_snmpProxyMultipleTargetOut 255L
#define LEAF_snmpProxyStorageType 8
#define VAL_snmpProxyStorageType_other 1L
#define VAL_snmpProxyStorageType_volatile 2L
#define VAL_snmpProxyStorageType_nonVolatile 3L
#define VAL_snmpProxyStorageType_permanent 4L
#define VAL_snmpProxyStorageType_readOnly 5L
#define LEAF_snmpProxyRowStatus 9
#define VAL_snmpProxyRowStatus_active 1L
#define VAL_snmpProxyRowStatus_notInService 2L
#define VAL_snmpProxyRowStatus_notReady 3L
#define VAL_snmpProxyRowStatus_createAndGo 4L
#define VAL_snmpProxyRowStatus_createAndWait 5L
#define VAL_snmpProxyRowStatus_destroy 6L
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __INCv3Proxyh */
@@ -0,0 +1,418 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_trgt.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
/*
* Copyright (C) 1999-2005, 2013 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_trgt.h,v $
* Revision 1.2 2001/11/06 21:35:07 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.8.4.2 2001/09/21 19:16:08 josh
* updating and expanding structures for use with coexistence
*
* Revision 9.8.4.1 2001/07/16 18:02:13 josh
* a first-round commit adding infrastructure support
* for the SNMPv3 Coexistence RFC (2576)
*
* Revision 9.8 2001/04/11 20:42:56 josh
* merge from the kingfisher branch
*
* Revision 9.7 2001/01/19 22:22:12 paul
* Update copyright.
*
* Revision 9.6 2000/06/09 14:54:13 josh
* modifications due to new installation options, new proxy code
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
* be built with the target code
*
* Revision 9.5.2.2 2001/03/12 22:08:02 tneale
* Updated copyright
*
* Revision 9.5.2.1 2000/09/21 21:14:55 josh
* bringing branch include files in line with root
*
* Revision 9.5 2000/03/17 19:48:47 meister
* Update copyright notice
*
* Revision 9.4 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.3 2000/03/09 17:07:15 tneale
* Added #ifdef for C++ to declare extern C if needed
*
* Revision 9.2 2000/02/04 21:54:25 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.1 2000/01/02 22:55:56 josh
* patching up a memory leak here, a broken compare there...per
* sar's comments
*
* Revision 9.0 1999/10/21 20:43:35 josh
* updating version stamps
*
* Revision 1.5 1999/10/21 19:13:09 josh
* adding flags for flags fields in various objects to help with row
* creation
*
* Revision 1.4 1999/10/15 17:47:26 josh
* included MIB leaf definitions and cleaned up useless macros
*
* Revision 1.3 1999/09/21 21:31:45 josh
* fixed a few structure access macros
*
* Revision 1.2 1999/09/14 19:35:26 josh
* updating default initialization per RFC 2573
*
* Revision 1.1 1999/06/16 17:04:23 josh
* First step of adding RFC2573 Notify support.
*
*
*/
/* [clearcase]
modification history
-------------------
01b,06aug13,bbz clear the med impact warning from prevent.pl(WIND00429583)
01a,19apr05,job update copyright notices
*/
#if (!defined(v3_trgt_inc))
#define v3_trgt_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define ETC_TARGET_ADDR_MAX 32
#define ETC_TARGET_PARAMS_MAX 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct SNMP_TARGET_ADDR_S
{
struct SNMP_TARGET_ADDR_S *next;
EBUFFER_T target_name; /* the name of the target */
OBJ_ID_T tdomain; /* the transport domain */
EBUFFER_T taddress; /* target address */
EBUFFER_T tmask; /* target mask */
sbits32_t timeout; /* interval between retr. */
bits16_t retry_count; /* number of retrans. */
bits32_t target_mms; /* max message size */
EBUFFER_T tag_list; /* list of magic labels */
EBUFFER_T params; /* name of SNMP_TARGET_PARAM_T */
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_TARGET_ADDR_T;
#define ETC_TADDR_TDOMAIN 0x01
#define ETC_TADDR_TADDRESS 0x02
#define ETC_TADDR_PARAMS 0x04
#define ETC_TADDR_ALL_FLAGS 0x07
#define ETC_TADDR_TIMEOUT 1500
#define ETC_TADDR_RETRY_COUNT 3
#define ETC_TADDR_MMS 484
/* global root pointer for target params list */
extern SNMP_TARGET_ADDR_T *root_target_addr;
#define SNMP_Target_Addr_Set_Defaults(T) \
(MEMSET((T), 0, sizeof(SNMP_TARGET_ADDR_T)), \
EBufferInitialize(&((T)->target_name)), \
EBufferInitialize(&((T)->taddress)), \
EBufferInitialize(&((T)->tmask)), \
EBufferInitialize(&((T)->tag_list)), \
EBufferInitialize(&((T)->params)), \
(T)->timeout = ETC_TADDR_TIMEOUT, \
(T)->retry_count = ETC_TADDR_RETRY_COUNT, \
(T)->target_mms = ETC_TADDR_MMS, \
(T)->storage = ETC_STO_NONVOL, \
(T)->status = ETC_RS_NREADY, \
(T)->flags = 0)
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Create __((void));
extern void SNMP_Target_Addr_Destroy __((SNMP_TARGET_ADDR_T *));
extern int SNMP_Target_Addr_Install __((SNMP_TARGET_ADDR_T *, bits8_t *,
ALENGTH_T));
extern void SNMP_Target_Addr_Deinstall __((SNMP_TARGET_ADDR_T *));
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Lookup __((bits8_t *, ALENGTH_T));
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Next __((int, OIDC_T *));
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Next_Addr __((SNMP_TARGET_ADDR_T *));
extern void SNMP_Target_Addr_Name __((SNMP_TARGET_ADDR_T *, bits8_t *,
ALENGTH_T *));
#define SNMP_Target_Addr_Get_Name(T) (EBufferStart(&((T)->target_name)))
#define SNMP_Target_Addr_Get_Name_Len(T) (EBufferUsed(&((T)->target_name)))
#define SNMP_Target_Addr_Get_TDomain(T) (&((T)->tdomain))
#define SNMP_Target_Addr_Set_TDomain(T, D, L) \
(build_object_id((L), (D), (&((T)->tdomain))))
#define SNMP_Target_Addr_Get_TAddress(T) (EBufferStart(&((T)->taddress)))
#define SNMP_Target_Addr_Get_TAddress_Len(T) (EBufferUsed(&((T)->taddress)))
#define SNMP_Target_Addr_Set_TAddress(T, S, L, F) \
(EBufferAllocateLoad((F), &((T)->taddress), (S), (L)))
#define SNMP_Target_Addr_Get_TMask(T) (EBufferStart(&((T)->tmask)))
#define SNMP_Target_Addr_Get_TMask_Len(T) (EBufferUsed(&((T)->tmask)))
#define SNMP_Target_Addr_Set_TMask(T, S, L, F) \
(EBufferAllocateLoad((F), &((T)->tmask), (S), (L)))
#define SNMP_Target_Addr_Get_Timeout(T) ((T)->timeout)
#define SNMP_Target_Addr_Set_Timeout(T, V) ((T)->timeout = (sbits32_t)(V))
#define SNMP_Target_Addr_Get_Retry_Count(T) ((T)->retry_count)
#define SNMP_Target_Addr_Set_Retry_Count(T, V) ((T)->retry_count = (bits16_t)(V))
#define SNMP_Target_Addr_Get_MMS(T) ((T)->target_mms)
#define SNMP_Target_Addr_Set_MMS(T, V) ((T)->target_mms = (bits16_t)(V))
#define SNMP_Target_Addr_Get_Tag_List(T) (EBufferStart(&((T)->tag_list)))
#define SNMP_Target_Addr_Get_Tag_List_Len(T) (EBufferUsed(&((T)->tag_list)))
#define SNMP_Target_Addr_Set_Tag_List(T, S, L, F) \
(EBufferAllocateLoad((F), &((T)->tag_list), (S), (L)))
#define SNMP_Target_Addr_Get_Params(T) (EBufferStart(&((T)->params)))
#define SNMP_Target_Addr_Get_Params_Len(T) (EBufferUsed(&((T)->params)))
#define SNMP_Target_Addr_Set_Params(T, S, L, F) \
(EBufferAllocateLoad((F), &((T)->params), (S), (L)))
#define SNMP_Target_Addr_Get_Storage(T) ((T)->storage)
#define SNMP_Target_Addr_Set_Storage(T, V) ((T)->storage = (bits16_t)(V))
#define SNMP_Target_Addr_Get_Status(T) ((T)->status)
#define SNMP_Target_Addr_Set_Status(T, V) ((T)->status = (bits16_t)(V))
#define SNMP_Target_Addr_Get_Flags(T) ((T)->flags)
#define SNMP_Target_Addr_Set_Flags(T, V) ((T)->flags = (bits16_t)(V))
typedef struct SNMP_TARGET_PARAMS_S
{
struct SNMP_TARGET_PARAMS_S *next;
EBUFFER_T params_name; /* name of the params object */
sbits32_t mp_model; /* SNMP version, roughly */
sbits32_t sec_model; /* security model */
EBUFFER_T sec_name; /* security name, aka user */
bits16_t sec_level; /* security level (auth/priv) */
bits16_t storage;
bits16_t status;
bits16_t flags;
} SNMP_TARGET_PARAMS_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define ETC_TPARAM_MPMODEL 0x01
#define ETC_TPARAM_SECMODEL 0x02
#define ETC_TPARAM_SECNAME 0x04
#define ETC_TPARAM_SECLEVEL 0x08
#define ETC_TPARAM_ALL_FLAGS 0x0F
/* global root pointer for target params list */
extern SNMP_TARGET_PARAMS_T *root_target_params;
#define SNMP_Target_Params_Set_Defaults(G) \
(MEMSET((G), 0, sizeof(SNMP_TARGET_PARAMS_T)), \
EBufferInitialize(&((G)->params_name)), \
EBufferInitialize(&((G)->sec_name)), \
(G)->storage = ETC_STO_NONVOL, \
(G)->status = ETC_RS_NREADY, \
(G)->flags = 0)
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Create __((void));
extern void SNMP_Target_Params_Destroy __((SNMP_TARGET_PARAMS_T *));
extern int SNMP_Target_Params_Install __((SNMP_TARGET_PARAMS_T *, bits8_t *,
ALENGTH_T));
extern void SNMP_Target_Params_Deinstall __((SNMP_TARGET_PARAMS_T *));
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Lookup __((bits8_t *,
ALENGTH_T));
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Next __((int, OIDC_T *));
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Next_Params
__((SNMP_TARGET_PARAMS_T *));
extern void SNMP_Target_Params_Name __((SNMP_TARGET_PARAMS_T *,
bits8_t *, ALENGTH_T *));
#define SNMP_Target_Params_Get_Name(T) (EBufferStart(&((T)->params_name)))
#define SNMP_Target_Params_Get_Name_Len(T) (EBufferUsed(&((T)->params_name)))
#define SNMP_Target_Params_Get_MP_Model(T) ((T)->mp_model)
#define SNMP_Target_Params_Set_MP_Model(T, V) ((T)->mp_model = (sbits32_t)(V))
#define SNMP_Target_Params_Get_Sec_Model(T) ((T)->sec_model)
#define SNMP_Target_Params_Set_Sec_Model(T, V) ((T)->sec_model = (sbits32_t)(V))
#define SNMP_Target_Params_Get_Sec_Name(T) (EBufferStart(&((T)->sec_name)))
#define SNMP_Target_Params_Get_Sec_Name_Len(T) (EBufferUsed(&((T)->sec_name)))
#define SNMP_Target_Params_Set_Sec_Name(T, S, L, F) \
(EBufferAllocateLoad((F), &((T)->sec_name), (S), (L)))
#define SNMP_Target_Params_Get_Sec_Level(T) ((T)->sec_level)
#define SNMP_Target_Params_Set_Sec_Level(T, V) ((T)->sec_level = (bits16_t)(V))
#define SNMP_Target_Params_Get_Storage(T) ((T)->storage)
#define SNMP_Target_Params_Set_Storage(T, V) ((T)->storage = (bits16_t)(V))
#define SNMP_Target_Params_Get_Status(T) ((T)->status)
#define SNMP_Target_Params_Set_Status(T, V) ((T)->status = (bits16_t)(V))
#define SNMP_Target_Params_Get_Flags(T) ((T)->flags)
#define SNMP_Target_Params_Set_Flags(T, V) ((T)->flags = (bits16_t)(V))
extern sbits32_t v3_snmpTargetSpinLock;
extern void snmpTargetAddrEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetAddrEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void snmpTargetParamsEntry_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifndef ENVOY_SNMPADDR_TO_TADDRESS
#define ENVOY_USE_DEFAULT_SNMPADDR 1
#define ENVOY_SNMPADDR_TO_TADDRESS(A, D, T) \
envoy_snmpaddr_to_taddress(A, D, T)
extern int envoy_snmpaddr_to_taddress __((SNMPADDR_T *, OBJ_ID_T *,
EBUFFER_T *));
#endif
#ifndef ENVOY_TADDRESS_TO_SNMPADDR
#define ENVOY_USE_DEFAULT_TADDRESS 1
#define ENVOY_TADDRESS_TO_SNMPADDR(A, D, T) \
envoy_taddress_to_snmpaddr(A, D, T)
extern int envoy_taddress_to_snmpaddr __((SNMPADDR_T *, OBJ_ID_T *,
EBUFFER_T *));
#endif
extern envoy_err_t copyVarBind __((VB_T *, int, SNMP_PKT_T *));
extern int copyVarBindList __((VBL_T *, VBL_T *, sbits32_t));
extern int SNMP_Convert_VB __((VBL_T *, OBJ_ID_T *, int *,
sbits32_t *, bits32_t *));
extern envoy_err_t copyNotifyVarBindList __((SNMP_PKT_T *, SNMP_PKT_T *));
/* The leaf definitions for the method routines */
#define LEAF_snmpTargetAddrName 1
#define MINSIZE_snmpTargetAddrName 1L
#define MAXSIZE_snmpTargetAddrName 32L
#define LEAF_snmpTargetAddrTDomain 2
#define LEAF_snmpTargetAddrTAddress 3
#define MINSIZE_snmpTargetAddrTAddress 1L
#define MAXSIZE_snmpTargetAddrTAddress 255L
#define LEAF_snmpTargetAddrTimeout 4
#define MIN_snmpTargetAddrTimeout 0L
#define MAX_snmpTargetAddrTimeout 2147483647L
#define LEAF_snmpTargetAddrRetryCount 5
#define MIN_snmpTargetAddrRetryCount 0L
#define MAX_snmpTargetAddrRetryCount 255L
#define LEAF_snmpTargetAddrTagList 6
#define MINSIZE_snmpTargetAddrTagList 0L
#define MAXSIZE_snmpTargetAddrTagList 255L
#define LEAF_snmpTargetAddrParams 7
#define MINSIZE_snmpTargetAddrParams 1L
#define MAXSIZE_snmpTargetAddrParams 32L
#define LEAF_snmpTargetAddrStorageType 8
#define VAL_snmpTargetAddrStorageType_other 1L
#define VAL_snmpTargetAddrStorageType_volatile 2L
#define VAL_snmpTargetAddrStorageType_nonVolatile 3L
#define VAL_snmpTargetAddrStorageType_permanent 4L
#define VAL_snmpTargetAddrStorageType_readOnly 5L
#define LEAF_snmpTargetAddrRowStatus 9
#define VAL_snmpTargetAddrRowStatus_active 1L
#define VAL_snmpTargetAddrRowStatus_notInService 2L
#define VAL_snmpTargetAddrRowStatus_notReady 3L
#define VAL_snmpTargetAddrRowStatus_createAndGo 4L
#define VAL_snmpTargetAddrRowStatus_createAndWait 5L
#define VAL_snmpTargetAddrRowStatus_destroy 6L
#define LEAF_snmpTargetParamsName 1
#define MINSIZE_snmpTargetParamsName 1L
#define MAXSIZE_snmpTargetParamsName 32L
#define LEAF_snmpTargetParamsMPModel 2
#define MIN_snmpTargetParamsMPModel 0L
#define MAX_snmpTargetParamsMPModel 2147483647L
#define LEAF_snmpTargetParamsSecurityModel 3
#define MIN_snmpTargetParamsSecurityModel 1L
#define MAX_snmpTargetParamsSecurityModel 2147483646L
#define LEAF_snmpTargetParamsSecurityName 4
#define MINSIZE_snmpTargetParamsSecurityName 0L
#define MAXSIZE_snmpTargetParamsSecurityName 255L
#define LEAF_snmpTargetParamsSecurityLevel 5
#define VAL_snmpTargetParamsSecurityLevel_noAuthNoPriv 1L
#define VAL_snmpTargetParamsSecurityLevel_authNoPriv 2L
#define VAL_snmpTargetParamsSecurityLevel_authPriv 3L
#define LEAF_snmpTargetParamsStorageType 6
#define VAL_snmpTargetParamsStorageType_other 1L
#define VAL_snmpTargetParamsStorageType_volatile 2L
#define VAL_snmpTargetParamsStorageType_nonVolatile 3L
#define VAL_snmpTargetParamsStorageType_permanent 4L
#define VAL_snmpTargetParamsStorageType_readOnly 5L
#define LEAF_snmpTargetParamsRowStatus 7
#define VAL_snmpTargetParamsRowStatus_active 1L
#define VAL_snmpTargetParamsRowStatus_notInService 2L
#define VAL_snmpTargetParamsRowStatus_notReady 3L
#define VAL_snmpTargetParamsRowStatus_createAndGo 4L
#define VAL_snmpTargetParamsRowStatus_createAndWait 5L
#define VAL_snmpTargetParamsRowStatus_destroy 6L
#ifdef __cplusplus
}
#endif
#endif /* #if (!defined(v3_trgt_inc))*/
@@ -0,0 +1,299 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_user.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: v3_user.h,v $
* Revision 1.2 2001/11/06 21:35:07 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.7 2001/01/19 22:22:13 paul
* Update copyright.
*
* Revision 9.6 2000/03/17 19:48:47 meister
* Update copyright notice
*
* Revision 9.5 2000/03/09 20:58:36 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.4 2000/03/09 17:14:06 tneale
* Added #ifdef for C++ to extern C if needed
*
* Revision 9.3 2000/02/04 21:54:26 josh
* prototyping functions that may need to be called by other modules
* this is done primarily to make the vxWorks compiler happy.
* Warning: the prototypes added may be duplicated by a mib_hand.h
* file generated by Emissary.
*
* Revision 9.2 1999/11/02 20:55:18 josh
* bringing usmUserTable into line with new spec: RFC 2574
* allows changing of auth and priv protocols after clone,
* allows row creation without initial clone, and allows enabling of rows
* without keychange for unused protocols (no authkeychange required if
* not using auth, etc.)
*
* Revision 9.1 1999/09/30 21:56:14 josh
* change public field to public_data so as not to conflict with
* C++ compilers
*
* Revision 9.0 1998/10/16 22:10:27 sar
* Update version stamp to match release
*
* Revision 1.7 1998/08/12 04:52:17 sar
* revamp the initialization routines to limit the amount of
* code that might get pulled in.
*
* Revision 1.6 1998/08/01 17:28:37 sar
* Removed the id check flag
*
* Revision 1.5 1998/07/01 01:48:20 sar
* As part of the set_defaults macro do a memset to zero the memory
*
* Revision 1.4 1998/06/30 00:30:58 sar
* Added macros to get and set user flags (cloned, authed and prived)
*
* Revision 1.3 1998/06/16 05:30:38 sar
* modify the api for the next routine
* split the engine id into its own struct
*
* Revision 1.2 1998/05/30 02:52:07 sar
* Modifed the names used for max string length
* Updated user lookup
*
* Revision 1.1 1998/05/23 19:49:41 sar
* Include files for use with v3 code. They define the structures
* and entry points for the various pieces.
* acc: access and group information
* auth & priv: authentication and privacy
* con: context
* eng: engine ids, both this agents and any others it knows
* mth: method routines, for use with mib control files
* user: user info
*
*/
/* [clearcase]
modification history
-------------------
01a,15apr05,AJS Diffie-Hellman work
01a,13apr05,AJS Diffie-Hellman work
*/
#if (!defined(v3_user_inc))
#define v3_user_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(v3_auth_inc))
#include <wrn/wm/snmp/engine/v3_auth.h>
#endif
#if (!defined(v3_priv_inc))
#include <wrn/wm/snmp/engine/v3_priv.h>
#endif
#if (!defined(v3_eng_inc))
#include <wrn/wm/snmp/engine/v3_eng.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
#include <openssl/bn.h>
#include <openssl/dh.h>
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
#define ETC_USER_USER_MAX 32
#define ETC_USER_ENGINE_MAX 32
#define ENGINE_MAXNAMELEN 32
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
#define LEAF_usmDHParameters 1
#define LEAF_usmDHUserAuthKeyChange 1
#define LEAF_usmDHUserOwnAuthKeyChange 2
#define LEAF_usmDHUserPrivKeyChange 3
#define LEAF_usmDHUserOwnPrivKeyChange 4
typedef struct SNMP_DH_S
{
EBUFFER_T DHpubAuthKey; /* DH public authentication key */
EBUFFER_T DHpubPrivKey; /* DH public privacy key */
DH *DHauthValues; /* DH values for the auth key */
DH *DHprivValues; /* DH values for the priv key */
} SNMP_DH_T;
typedef struct SNMP_DH_PARAMS_S
{
BIGNUM *prime; /* Large prime */
BIGNUM *base; /* Generator; typically 2 or 5 */
int pvl; /* Private value length, in bits */
EBUFFER_T encodedString; /* Encoded string with values above */
} SNMP_DH_PARAMS_T;
extern int SNMP_init_DH (void);
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
typedef struct SNMP_USER_ENG_S
{
struct SNMP_USER_ENG_S *next;
bits8_t *id;
ALENGTH_T id_len;
struct SNMP_USER_S *user;
} SNMP_USER_ENG_T;
typedef struct SNMP_USER_S
{
SNMP_USER_ENG_T *parent;
struct SNMP_USER_S *next;
bits8_t *uname;
ALENGTH_T uname_len;
SNMP_AUTH_T *auth;
bits8_t *authkey;
SNMP_PRIV_T *priv;
bits8_t *privkey;
EBUFFER_T public_data;
bits8_t maxsec;
sbits16_t storage;
sbits16_t status;
sbits16_t flags;
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
SNMP_DH_T DH_keys;
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
} SNMP_USER_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#define ETC_USER_CLONED 0x01
#define ETC_USER_AUTHED 0x02
#define ETC_USER_PRIVED 0x04
#define ETC_USER_VALID_AUTHKEY 0x08
#define ETC_USER_VALID_PRIVKEY 0x10
#define ETC_USER_ALL_FLAGS 0x1F
/* global root pointer for the user list */
extern SNMP_USER_ENG_T *root_user;
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
#define SNMP_User_Set_Defaults(U) (MEMSET((U), 0, sizeof(SNMP_USER_T)), \
EBufferInitialize(&((U)->public_data)), \
EBufferInitialize(&((U)->DH_keys.DHpubAuthKey)), \
EBufferInitialize(&((U)->DH_keys.DHpubPrivKey)), \
(U)->storage = ETC_STO_NONVOL, \
(U)->status = ETC_RS_NREADY)
#else
#define SNMP_User_Set_Defaults(U) (MEMSET((U), 0, sizeof(SNMP_USER_T)), \
EBufferInitialize(&((U)->public_data)), \
(U)->storage = ETC_STO_NONVOL, \
(U)->status = ETC_RS_NREADY)
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
extern SNMP_USER_T * SNMP_User_Lookup __((bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T));
extern SNMP_USER_T * SNMP_User_Next __((int, OIDC_T *));
extern SNMP_USER_T * SNMP_User_Next_User __((SNMP_USER_T *));
extern void SNMP_User_Destroy __((SNMP_USER_T *));
extern SNMP_USER_T * SNMP_User_Create __((SNMP_AUTH_T *, SNMP_PRIV_T *));
extern int SNMP_User_Install __((SNMP_USER_T *,
bits8_t *, ALENGTH_T,
bits8_t *, ALENGTH_T));
extern void SNMP_User_Deinstall __((SNMP_USER_T *));
extern void SNMP_User_Name __((SNMP_USER_T *,
bits8_t *, ALENGTH_T *,
bits8_t *, ALENGTH_T *));
extern void SNMP_User_Get_Sec_Name __((SNMP_USER_T *, bits8_t *,
ALENGTH_T *));
extern int SNMP_User_Set_AuthKey __((SNMP_USER_T *, bits8_t *,
ALENGTH_T));
extern int SNMP_User_Set_PrivKey __((SNMP_USER_T *, bits8_t *,
ALENGTH_T));
extern int SNMP_User_Swap_Users __((SNMP_USER_T *, SNMP_USER_T *));
#define SNMP_User_Compare_Names(U1, U2) (((U1) == (U2)) ? 0 : 1)
#define SNMP_User_Get_Auth(U) ((U)->auth)
#define SNMP_User_Get_AuthKey(U) ((U)->authkey)
#define SNMP_User_Get_Priv(U) ((U)->priv)
#define SNMP_User_Get_PrivKey(U) ((U)->privkey)
#define SNMP_User_Get_Public(U) (EBufferStart(&((U)->public_data)))
#define SNMP_User_Get_Public_Len(U) (EBufferUsed(&((U)->public_data)))
#define SNMP_User_Get_MaxSec(U) ((U)->maxsec)
#define SNMP_User_Get_Storage(U) ((U)->storage)
#define SNMP_User_Set_Storage(U, V) ((U)->storage = (sbits16_t)(V))
#define SNMP_User_Get_Status(U) ((U)->status)
#define SNMP_User_Set_Status(U, V) ((U)->status = (sbits16_t)(V))
#define SNMP_User_Get_Flags(U) ((U)->flags)
#define SNMP_User_Set_Flags(U, F) ((U)->flags = (sbits16_t)(F))
/* These macros are for internal use only and should not be used
by customers. It makes use of internal knowledge of the user
structure which may change in the future, causing the macros
to become unsupportable. In this case any code calling these
macros will need to be updated.
currently the only mapping between name and security name
is the identity mapping */
#define SNMP_User_Get_SName(U) ((U)->uname)
#define SNMP_User_Get_SName_Len(U) ((U)->uname_len)
extern sbits32_t v3_usmUserSpinLock;
extern void usertable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void usertable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#ifdef __cplusplus
}
#endif
#endif /* (!defined(user_inc)) */
@@ -0,0 +1,295 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/vbdefs.h,v 1.3 2002/05/13 20:46:19 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: vbdefs.h,v $
* Revision 1.3 2002/05/13 20:46:19 josh
* encoding process now checks for 16-bit overflows in
* calculating packet sizes
*
* Revision 1.2 2001/11/06 21:35:07 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.7 2001/01/19 22:22:13 paul
* Update copyright.
*
* Revision 9.6 2000/03/17 19:48:48 meister
* Update copyright notice
*
* Revision 9.5 2000/03/09 20:58:37 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.4 2000/03/09 17:14:20 tneale
* Added #ifdef for C++ to extern C if needed
*
* Revision 9.3 2000/02/02 17:35:28 josh
* adding VBList_Free() API call
*
* Revision 9.2 1999/12/23 14:47:28 josh
* cleaning up code per Shawn's comments -- removing extraneous
* comments and doing proxy check before notify check
*
* Revision 9.1 1999/05/24 20:12:12 josh
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
* to avoid C++ compiler errors.
*
* Revision 9.0 1998/10/16 22:10:28 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:54 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:33 sar
* Updated revision to 8.0
*
* Revision 7.6 1997/10/26 01:44:43 sar
* Always define the 64 bit counter and include it in the vb defintion
* instead of forgetting about it if we don't have v2 or v2 types installed.
*
* Revision 7.5 1997/10/22 03:07:28 sar
* Mofied the agentx and older subagent schemes install options
*
* Revision 7.4 1997/10/16 23:52:27 sar
* We changed the macro VB_GET_IP_ADDRESS to provide a more consistent
* type signature from compilers. Previously it could have been either
* a pointer to an array of bytes or a pointer to a byte. It should
* now resolve to a pointer to an array of bytes.
*
* Revision 7.3 1997/10/16 00:25:19 sar
* Primarily this set of modifications is for the agentx protocol.
* Most of the work was in the agentx.h and ax_mth.h files. Most
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
* to their structures and snmp got some new lock macros.
*
* One other change of note was the modification of continue
* processing. Previously we called a specific continue routine
* directly, now we store a pointer to the corret continue
* function in the snmp packet structure and call that. We include
* macros for backwards compatibility.
*
* Revision 7.2 1997/03/20 06:48:25 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.2 1995/10/20 22:53:35 sar
* removed bitstring include file & macro
* removed nsapaddress
* added VT_BITS & VT_UNSIGNED32
*
* Revision 6.1 1995/06/05 20:57:49 sar
* Added clean_vb_data.
*
* Revision 6.0 1995/05/31 21:46:57 sra
* Release 6.0.
*
* Revision 1.1 1995/03/20 23:07:47 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(vb_inc))
#define vb_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(asn1_inc))
#include <wrn/wm/snmp/engine/asn1.h>
#endif
#if (!defined(buffer_inc))
#include <wrn/wm/snmp/engine/buffer.h>
#endif
#if (!defined(mib_inc))
#include <wrn/wm/snmp/engine/mib.h>
#endif
#if (!defined(ui64_inc))
#include <wrn/wm/snmp/engine/ui64.h>
#endif
/* Definition for routine to free private vb space */
typedef void VBPRIVPROC_T __((PTR_T));
/* Definition for routine to undo sets */
struct VB_S;
typedef void UNDOPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
/* Define the internal shape of a VarBind */
typedef struct VB_S
{
struct VB_S * vb_link; /* For the user to use, usually */
/* to build a list of related */
/* VB_Ts. */
ALENGTH_T vb_seq_size; /* Overall length of the VarBind */
/* sequence when encoded. */
OBJ_ID_T vb_obj_id; /* Object id for this VarBind */
OCTET_T vb_data_flags_n_type; /* Class form & type of data */
OCTET_T vb_flags; /* See below */
ALENGTH_T vb_data_length; /* Length of the data when encode */
MIBLOC_T vb_ml; /* The mib-leaf associated with */
/* this VarBind. */
union {
INT_32_T v_number; /* Integer kinds of things */
UINT_32_T v_counter; /* Unsigned int things */
EBUFFER_T v_string; /* Octetstring things */
OBJ_ID_T v_object; /* Object id things */
unsigned char v_network_address[4];
UINT_64_T v_counter64; /* 64 bit unsigned things */
} value_u;
union {
ptr_t p_ptr; /* storage space for moving info */
bits32_t p_int; /* between test and set routines */
} priv;
VBPRIVPROC_T * vb_free_priv; /* pointer to routine to free the */
/* private storage space */
UNDOPROC_T * undoproc; /* pointer to routine to undo sets*/
#if (INSTALL_ENVOY_AGENTX)
OBJ_ID_T ax_search_end;
OCTET_T ax_flags;
#endif
} VB_T;
#define v_gauge v_counter
#define v_timeticks v_counter
#define v_uinteger32 v_counter
#define v_opaque v_string
#define vb_priv priv.p_ptr
#define vb_int priv.p_int
/* Values for vb_data_flags_n_type */
#define VT_NUMBER A_INTEGER
#define VT_STRING A_OCTETSTRING
#define VT_BITS A_OCTETSTRING /* same as a string */
#define VT_OBJECT A_OBJECTID
#define VT_EMPTY A_NULL
#define VT_IPADDRESS (A_APPLICATION | 0)
#define VT_COUNTER (A_APPLICATION | 1)
#define VT_GAUGE (A_APPLICATION | 2)
#define VT_UNSIGNED32 (A_APPLICATION | 2) /* same as a guage */
#define VT_TIMETICKS (A_APPLICATION | 3)
#define VT_OPAQUE (A_APPLICATION | 4)
#define VT_COUNTER64 (A_APPLICATION | 6)
#define VT_UINTEGER32 (A_APPLICATION | 7)
/* values for exception data types */
#define VT_NOSUCHOBJ (A_CONTEXT | 0)
#define VT_NOSUCHINS (A_CONTEXT | 1)
#define VT_ENDOFMIB (A_CONTEXT | 2)
/* Values for vb_flags */
#define VFLAG_ALREADY_TEST 0x01
#define VFLAG_ALREADY_SET 0x02
#define VFLAG_ALREADY_GET 0x02
#define VFLAG_SA_SENDIT 0x04
#define VFLAG_SA_DOIT 0x08
/* more values for vb_flags some of them need to be alligned with the
already_* flags, the rest are put in as we have space */
#define VFLAG_TEST_STARTED 0x10
#define VFLAG_TEST_DONE 0x01
#define VFLAG_SET_STARTED 0x20
#define VFLAG_SET_DONE 0x02
#define VFLAG_UNDO_STARTED 0x40
#define VFLAG_UNDO_DONE 0x80
#define VFLAG_UNDO_BOTH (VFLAG_UNDO_STARTED | VFLAG_UNDO_DONE)
#define VFLAG_GET_STARTED 0x20
#define VFLAG_GET_DONE 0x02
#define VFLAG_NEXT_STARTED 0x20
#define VFLAG_NEXT_DONE 0x02
#define VFLAG_NEXT_REDO 0x10
#define VFLAG_NEXT_VCREQ 0x40
#define VFLAG_NEXT_VCDONE 0x80
#define VFLAG_NEXT_INSTANCE 0x01
#define VFLAG_NEXT_VCBITS (VFLAG_NEXT_VCREQ | VFLAG_NEXT_VCDONE)
#define VFLAG_NEXT_FLAGS 0xF3
#define ENVOY_AX_FLAGS_INCLUDE 0x01
#define ENVOY_AX_FLAGS_CLEAN_LEAF 0x02
#define ENVOY_AX_FLAGS_CLEAN_INDEX 0x04
/* Define the shape of the VarBindList */
typedef struct VBL_S
{
ALENGTH_T vbl_length; /* Length of the VarBindList seq */
int vbl_count; /* Number of Var Bind items */
VB_T *vblist;
struct VBL_S *vblp; /* for get bulk chaining purposes */
} VBL_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
/* macros to get the data from a vbp */
#define VB_GET_INT32(V) ((V)->value_u.v_number)
#define VB_GET_UINT32(V) ((V)->value_u.v_counter)
#define VB_GET_IP_ADDRESS(V) ((V)->value_u.v_network_address)
#define VB_GET_STRING(V) &((V)->value_u.v_string)
#define VB_GET_OBJECT_ID(V) &((V)->value_u.v_object)
#define VB_GET_UINT64(V) &((V)->value_u.v_counter64)
/* macro to get a pointer to a cookie, so that the user
doesn't have to understand what a vb looks like */
#define VB_TO_COOKIE(vbp) (vbp)->vb_ml.ml_leaf->user_cookie
/* various vb utility routines */
extern VB_T * VarBindList_Allocate __((int));
extern VBL_T * VBList_Allocate __((int));
extern bits32_t vbsize __((VB_T *));
extern void Clean_vb_data __((VB_T *));
extern void Clean_vb __((VB_T *));
extern void Clean_vb_list __((VBL_T *));
extern void VBList_Free __((VBL_T *));
#ifdef __cplusplus
}
#endif
#endif /* (!defined(vb_inc)) */
@@ -0,0 +1,85 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/version.h,v 1.1.1.1 2001/11/05 17:47:24 tneale Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1988-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: version.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
* Tornado shuffle
*
* Revision 9.3 2001/01/19 22:22:13 paul
* Update copyright.
*
* Revision 9.2 2000/03/17 19:48:48 meister
* Update copyright notice
*
* Revision 9.1 2000/03/07 15:17:42 josh
* updating version stamp to match release
*
* Revision 9.0 1998/10/16 22:10:30 sar
* Update version stamp to match release
*
* Revision 8.2 1998/05/23 20:25:07 sar
* Update major version to 9 in preperation for next release.
*
* Revision 8.1 1998/02/25 04:50:55 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:33 sar
* Updated revision to 8.0
*
* Revision 7.4 1997/11/17 23:58:36 sar
* Update the version
*
* Revision 7.3 1997/03/20 06:48:26 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.2 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.1 1997/02/17 20:04:52 sar
* udpated version 7.2
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:59:46 sra
* Release 6.0.
*
* Revision 1.3 1995/05/29 03:59:37 sar
* Set the beta version define to 0
*
* Revision 1.2 1995/03/24 19:47:02 sar
* Updated to version 6.0 beta
*
* Revision 1.1 1995/03/20 23:07:47 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#define ENVOY_VERSION_STRING "$Revision: 1.1.1.1 $"
#define ENVOY_MAJOR_VERSION 9
#define ENVOY_MINOR_VERSION 1
#define ENVOY_BETA_VERSION 0
@@ -0,0 +1,260 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/view.h,v 1.2 2001/11/06 21:35:08 josh Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: view.h,v $
* Revision 1.2 2001/11/06 21:35:08 josh
* new revised path structure, first pass. Also removing useless
* shell include files.
*
* Revision 1.1.1.1 2001/11/05 17:47:25 tneale
* Tornado shuffle
*
* Revision 9.5 2001/04/25 16:40:05 josh
* make sure the instance is thoroughly checked in the
* vacmViewTreeFamilyTable before trying to create a
* new row
*
* Revision 9.4 2001/01/19 22:22:13 paul
* Update copyright.
*
* Revision 9.3 2000/03/17 19:48:49 meister
* Update copyright notice
*
* Revision 9.2 2000/03/09 20:58:37 tneale
* All structure definitions are now bracketted with a test that
* potentially sets an alignment pragma. This is to maintain compatibility
* with the code base that had been distributed by Wind River.
*
* Revision 9.1 2000/03/09 17:14:33 tneale
* Added #ifdef for C++ to extern C if needed
*
* Revision 9.0 1998/10/16 22:10:31 sar
* Update version stamp to match release
*
* Revision 8.4 1998/06/20 17:49:44 sar
* Modified the names and calling sequences for snmp_rfc2275 functions
*
* Revision 8.3 1998/06/18 04:44:20 sar
* Update view index to directly point to the name instead of using
* an ebuffer
*
* Revision 8.2 1998/05/23 20:20:08 sar
* added code for rfc2275, updated types
*
* Revision 8.1 1998/02/25 04:50:57 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:33 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:27 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 1.4 1995/11/14 22:42:26 sar
* Added the prototype defs for the view method routines.
*
* Revision 1.3 1995/11/11 00:05:52 sar
* removed use of rfc1445_view_routines
*
* Revision 1.2 1995/11/01 00:54:33 sar
* removed casts of 0
* changed the default row status to be nis instead of rsne
*
* Revision 1.1 1995/10/20 22:53:35 sar
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(view_inc))
#define view_inc
#ifdef __cplusplus
extern"C" {
#endif
#if (!defined(snmpdefs_inc))
#include <wrn/wm/snmp/engine/snmpdefs.h>
#endif
#if (!defined(smi_inc))
#include <wrn/wm/snmp/engine/smi.h>
#endif
#define STO_OTHER 1
#define STO_VOL 2
#define STO_NONVOL 3
#define STO_PERM 4
#define STO_RONLY 5
#define RS_RSNE 0
#define RS_ACTIVE 1
#define RS_NIS 2
#define RS_NREADY 3
#define RS_CAGO 4
#define RS_CAWAIT 5
#define RS_DESTROY 6
/* define the view structures */
#define VIEW_INCLUDED 1
#define VIEW_EXCLUDED 2
#define VIEW_INDETERMINATE 3
#define VIEW_MAXMASKLEN 16
#define VIEW_MAXINDEX 65535
#define VIEW_MAXINDEXL 65535L
#define ETC_VIEW_NAME_MIN 1
#define ETC_VIEW_NAME_MAX 32
/* options for SNMP_View_Check */
#define VIEW_CHECK_DET 0
#define VIEW_CHECK_IND 1
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 1
#endif
typedef struct VIEWLEAF_S
{
struct VIEWINDEX_S *parent; /* backpointer to parent, 0 if
this view isn't installed */
bits16_t index; /* index of the view table,
this is the same as it's parents
view index used for admin */
OBJ_ID_T subtree; /* the oid for this subtree */
EBUFFER_T mask; /* wildcard string */
int type; /* is this entry included or exc */
int status; /* status of this entry */
int storage; /* type of storage of this entry */
struct VIEWLEAF_S * lexinext; /* list of leaves in lexi order */
struct VIEWLEAF_S * masknext; /* list of leaves in mask order */
} VIEWLEAF_T;
typedef struct VIEWINDEX_S
{
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
bits16_t index; /* index of the view table */
#endif
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
bits8_t * name; /* name of the view table */
ALENGTH_T name_len; /* length of name */
#endif
struct VIEWINDEX_S * next; /* next index in the chain */
VIEWLEAF_T * lexilist; /* list of leaves in lexi order */
VIEWLEAF_T * masklist; /* list of leaves in mask order */
} VIEWINDEX_T;
#ifdef WINDNET_STRUCT_ALIGN
#pragma align 0
#endif
#if (INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS)
extern int SNMP_View_Find_Family __((SNMP_PKT_T *));
extern int SNMP_View_Family_Check __((SNMP_PKT_T *, OIDC_T *, int, int));
extern int SNMP_View_Check __((SNMP_PKT_T *, OIDC_T *, int, int));
#define SNMP_View_Get_Type(V) ((V)->type)
#define SNMP_View_Set_Type(V, W) ((V)->type = (bits16_t)W)
#define SNMP_View_Get_Mask(V) (EBufferStart(&(V)->mask))
#define SNMP_View_Get_MaskLen(V) (EBufferUsed(&(V)->mask))
#define SNMP_View_Set_StorageType(V, W) ((V)->storage = (bits16_t)W)
#define SNMP_View_Get_StorageType(V) ((V)->storage)
#define SNMP_View_Set_Status(V, W) ((V)->status = (bits16_t)W)
#define SNMP_View_Get_Status(V) ((V)->status)
#define SNMP_View_Get_Subtree(V) ((V)->subtree.component_list)
#define SNMP_View_Get_Subtree_Len(V) ((V)->subtree.num_components)
#define SNMP_View_Set_Defaults(V) ((V)->parent = 0, \
EBufferInitialize(&(V)->mask), \
(V)->masknext = 0, \
(V)->lexinext = 0, \
(V)->type = VIEW_INCLUDED, \
(V)->storage = STO_NONVOL, \
(V)->status = RS_NIS)
extern VIEWLEAF_T *SNMP_View_Create __((OIDC_T *, int));
extern void SNMP_View_Delete __((VIEWLEAF_T *));
extern VIEWLEAF_T *SNMP_View_Next __((VIEWLEAF_T *));
extern int SNMP_View_Set_Mask __((VIEWLEAF_T *, bits8_t *, int));
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
#define SNMP_View_Get_Index(V) ((V)->index)
extern int SNMP_View_Install __((bits16_t, VIEWLEAF_T *));
extern int SNMP_View_Name __((VIEWLEAF_T *, bits16_t *,
OIDC_T *, int));
extern int SNMP_View_Deinstall __((bits16_t, OIDC_T *, int));
extern VIEWLEAF_T *SNMP_View_Lookup __((bits16_t, OIDC_T *, int));
#endif /* #if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS) */
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
/*#define SNMP_View_2275_Name(V) ((V)->parent ? (V)->parent->name : 0)
#define SNMP_View_2275_Name_Len(V) ((V)->parent ? (V)->parent->name_len : 0)*/
extern void SNMP_View_2275_Name __((VIEWLEAF_T *, bits8_t *,
ALENGTH_T *));
extern int SNMP_View_2275_Install __((VIEWLEAF_T *, bits8_t *,
ALENGTH_T));
extern int SNMP_View_2275_Full_Name __((VIEWLEAF_T *, OIDC_T *, int));
extern void SNMP_View_2275_Deinstall __((VIEWLEAF_T *));
extern VIEWLEAF_T *SNMP_View_2275_Lookup __((bits8_t *, ALENGTH_T,
OIDC_T *, int));
extern sbits32_t v3_vacmViewSpinLock;
#endif /* #if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS) */
extern void viewtable_test __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void viewtable_get __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void viewtable_next __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
extern void viewtable_set __((OIDC_T, int, OIDC_T *,
SNMP_PKT_T *, VB_T *));
#endif /* (INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS) */
extern VIEWINDEX_T *viewroot;
#ifdef __cplusplus
}
#endif
#endif /* view_inc */
@@ -0,0 +1,84 @@
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1994-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: vxcmpnts.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:25 tneale
* Tornado shuffle
*
* Revision 1.1.2.3 2001/11/02 23:37:02 meister
* prototype for usrSnmpInit
*
* Revision 1.1.2.2 2001/10/01 18:52:56 meister
* Add some prototypes.
*
* Revision 1.1.2.1 2001/08/29 15:47:08 meister
* declarations for vxworks snmpd component initialation functions
* and task priorities
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#ifndef _ENVOY_VXCMPNTS_H
# define _ENVOY_VXCMPNTS_H 1
/*
* vxcmpnts.h - this file contains labels for each configurable component
* for the SNMPD running under VxWorks. Each one is a bit in
* in a bit-mask
*/
#define SNMPD_CORE_COMPONENT 0x1
#define SNMPD_VERSION_3_COMPONENT (0x1 << 1)
#define SNMPD_AGENTX_MASTER_COMPONENT (0x1 << 2)
#define SNMPD_AGENTX_SUBAGENT_COMPONENT (0x1 << 3)
/*
* delcarations for component init routines
*/
void initAxMasterComponent (void);
void initAxSubagentComponent (void);
void initSnmpV3Component (void);
void snmpdInitConfigMsgQ (void);
void initSnmpd(void);
void determineSnmpdComponents (void);
void envoy_dyncfg_init (void);
/*
* priorities for the component startup tasks, if not specified by the user
*/
#ifndef ENVOY_VXWORKS_SNMPD_INIT_PRIORITY
# define ENVOY_VXWORKS_SNMPD_INIT_PRIORITY 94
#endif
#ifndef ENVOY_VXWORKS_SNMPD_COMP_INIT_PRIORITY
# define ENVOY_VXWORKS_SNMPD_COMP_INIT_PRIORITY 95
#endif
#ifndef ENVOY_VXWORKS_SNMPD_PRIORITY
# define ENVOY_VXWORKS_SNMPD_PRIORITY 96
#endif
#endif /* _ENVOY_VXCMPNTS_H */
@@ -0,0 +1,138 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/wkobj.h,v 1.1.1.1 2001/11/05 17:47:25 tneale Exp $ */
/*
* Copyright (C) 1999-2005 Wind River Systems, Inc.
* All rights reserved. Provided under license only.
* Distribution or other use of this software is only
* permitted pursuant to the terms of a license agreement
* from Wind River Systems (and is otherwise prohibited).
* Refer to that license agreement for terms of use.
*/
/****************************************************************************
* Copyright 1993-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: wkobj.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:25 tneale
* Tornado shuffle
*
* Revision 9.2 2001/01/19 22:22:14 paul
* Update copyright.
*
* Revision 9.1 2000/03/17 19:48:49 meister
* Update copyright notice
*
* Revision 9.0 1998/10/16 22:10:32 sar
* Update version stamp to match release
*
* Revision 8.1 1998/02/25 04:50:58 sra
* Update copyrights.
*
* Revision 8.0 1997/11/18 00:56:34 sar
* Updated revision to 8.0
*
* Revision 7.2 1997/03/20 06:48:28 sra
* DFARS-safe copyright text. Zap!
*
* Revision 7.1 1997/02/25 10:49:26 sra
* Update copyright notice, dust under the bed.
*
* Revision 7.0 1996/03/18 20:17:33 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:46:47 sra
* Release 6.0.
*
* Revision 5.0 1994/05/16 15:49:04 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 16:05:41 sar
* Updated rev to 4.0 and coypright to 93
*
* Revision 1.2 1993/05/26 21:30:55 sar
* updated to work with the objid defined in the rfcs.
*
* Revision 1.1 1993/04/23 23:36:14 sar
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
01a,19apr05,job update copyright notices
*/
#if (!defined(wkobj_inc))
#define wkobj_inc
#define SNMP_INTERNET 1, 3, 6, 1
#define SNMP_DIRECTORY SNMP_INTERNET, 1
#define SNMP_MGMT SNMP_INTERNET, 2
#define SNMP_MIB2 SNMP_MGMT, 1
#define SNMP_EXPERIMENTAL SNMP_INTERNET, 3
#define SNMP_PRIVATE SNMP_INTERNET, 4
#define SNMP_ENTERPRISES SNMP_PRIVATE, 1
#define SNMP_SECURITY SNMP_INTERNET, 5
#define SNMP_SNMPV2 SNMP_INTERNET, 6
/*#define SNMP_SNMPMAPPINGS SNMP_SNMPV2, 1*/
/*#define SNMP_SNMPMODULES SNMP_SNMPV2, 4*/
/*#define SNMP_SNMPDOMAINS SNMP_SNMPMAPPINGS, 1*/
#define SNMP_SNMPDOMAINS SNMP_SNMPV2, 1
#define SNMP_UDPDOMAIN SNMP_SNMPDOMAINS, 1
#define SNMP_CLNSDOMAIN SNMP_SNMPDOMAINS, 2
#define SNMP_CONSDOMAIN SNMP_SNMPDOMAINS, 3
#define SNMP_DDPDOMAIN SNMP_SNMPDOMAINS, 4
#define SNMP_IPXDOMAIN SNMP_SNMPDOMAINS, 5
/*#define SNMP_SNMPPROXYS SNMP_SNMPMAPPINGS, 2*/
#define SNMP_SNMPPROXYS SNMP_SNMPV2, 2
#define SNMP_RFC1157PROXY SNMP_SNMPPROXYS, 1
#define SNMP_RFC1157DOMAIN SNMP_RFC1157PROXY, 1
#define SNMP_RFC1157NOAUTH SNMP_RFC1157PROXY, 2
#define SNMP_SNMPMODULES SNMP_SNMPV2, 3
#define SNMP_SNMPMIB SNMP_SNMPMODULES, 1
#define SNMP_SNMPMIBOBJECTS SNMP_SNMPMIB, 1
#define SNMP_SNMPTRAP SNMP_SNMPMIBOBJECTS, 4
#define SNMP_SNMPTRAPOID SNMP_SNMPTRAP, 1
#define SNMP_SNMPTRAPENTERPRISE SNMP_SNMPTRAP, 3
#define SNMP_SNMPTRAPS SNMP_SNMPMIBOBJECTS, 5
#define SNMP_COLDSTART SNMP_SNMPTRAPS, 1
#define SNMP_WARMSTART SNMP_SNMPTRAPS, 2
#define SNMP_LINKDOWN SNMP_SNMPTRAPS, 3
#define SNMP_LINKUP SNMP_SNMPTRAPS, 4
#define SNMP_AUTHENTICATIONFAILURE SNMP_SNMPTRAPS, 5
#define SNMP_EGPNEIGHBORLOSS SNMP_SNMPTRAPS, 6
#define SNMP_PARTYMIB SNMP_SNMPMODULES, 3
#define SNMP_PARTYADMIN SNMP_PARTYMIB, 1
#define SNMP_PARTYPROTOCOLS SNMP_PARTYADMIN, 1
#define SNMP_NOAUTH SNMP_PARTYPROTOCOLS, 1
#define SNMP_NOPRIV SNMP_PARTYPROTOCOLS, 2
#define SNMP_DESPRIV SNMP_PARTYPROTOCOLS, 3
#define SNMP_MD5AUTH SNMP_PARTYPROTOCOLS, 4
#define SNMP_TEMPORALDOMAINS SNMP_PARTYADMIN, 2
#define SNMP_CURRENTTIME SNMP_TEMPORALDOMAINS, 1
#define SNMP_RESTARTTIME SNMP_TEMPORALDOMAINS, 2
#define SNMP_CACHETIME SNMP_TEMPORALDOMAINS, 3
#define SNMP_INITIALPARTYID SNMP_PARTYADMIN, 3
#define SNMP_INITIALCONTEXTID SNMP_PARTYADMIN, 4
#endif /* wkobj_inc */