📄 v3_ini.c
字号:
/* * Copyright 2000-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_ini.c,v $ * Revision 1.2 2001/11/06 21:20:31 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:44 tneale * Tornado shuffle * * Revision 9.12.4.3 2001/08/30 21:15:38 josh * don't make references to code in other modules if we can avoid it * * Revision 9.12.4.2 2001/07/16 18:02:15 josh * a first-round commit adding infrastructure support * for the SNMPv3 Coexistence RFC (2576) * * Revision 9.12.4.1 2001/06/28 18:22:59 josh * Seeding the Cormorant branch with the code from the old * cormorant branch * * Revision 9.12 2001/04/11 21:01:50 josh * we are overwriting the trunk's copy of this file with * the file from the kingfisher branch * * Revision 9.11 2001/01/19 22:22:29 paul * Update copyright. * * Revision 9.10 2000/07/12 20:11:57 josh * initialization for proxy code * * Revision 9.9 2000/06/09 13:56:00 josh * modified installation options and added new code to deal with * SNMPv3 proxies * * Revision 9.8.4.1 2001/04/11 20:48:34 josh * moving cormorant-specific changes off to the cormorant * branch * * Revision 9.8.2.2 2001/03/12 22:08:30 tneale * Updated copyright * * Revision 9.8.2.1 2000/09/20 21:46:58 josh * bringing branch up to currency with the root tree * * Revision 9.8 2000/03/17 00:19:30 meister * Update copyright message * * Revision 9.7 1999/11/09 17:56:41 josh * fixing memory leaks and initialization issues * * Revision 9.6 1999/11/01 15:03:51 josh * manually reinitialize globals on startup -- makes Envoy restartable * * Revision 9.5 1999/10/03 00:18:13 josh * fixing retramit timer code -- setting handler correctly, * cleaning up some double-free situations, and putting locking in * where needed * * Revision 9.4 1999/09/27 21:11:48 josh * fixing nits, rewriting engine id <--> address code, adding installation * option * * Revision 9.3 1999/09/15 16:17:36 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 9.2 1999/09/14 19:33:14 josh * initializing new structures and list pointers * * Revision 9.1 1999/06/16 17:04:23 josh * First step of adding RFC2573 Notify support. * * Revision 9.0 1998/10/16 22:12:36 sar * Update version stamp to match release * * Revision 8.2 1998/09/16 03:13:48 sar * Correct the name for the boots tag * * Revision 8.1 1998/08/12 04:44:01 sar * Move the initialization routines around some in order to minimize * the amount of code that gets pulled in for init purposes. * *//* [clearcase]modification history-------------------01c,15apr05,AJS Diffie-Hellman work01b,13apr05,AJS Diffie-Hellman work01a,24nov03,job update copyright information*/#include <wrn/wm/snmp/engine/asn1conf.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/v3_ini.h>#include <wrn/wm/snmp/engine/v3_eng.h>#include <wrn/wm/snmp/engine/v3_con.h>#include <wrn/wm/snmp/engine/v3_acc.h>#include <wrn/wm/snmp/engine/v3_user.h>#include <wrn/wm/snmp/engine/v3_auth.h>#include <wrn/wm/snmp/engine/v3_priv.h>#if INSTALL_ENVOY_SNMP_V3_TARGET#include <wrn/wm/snmp/engine/v3_trgt.h>#if INSTALL_ENVOY_SNMP_V3_NOTIFY#include <wrn/wm/snmp/engine/v3_ntfy.h>#include <wrn/wm/snmp/engine/sendntfy.h>#endif /* INSTALL_ENVOY_SNMP_V3_NOTIFY */#if INSTALL_ENVOY_SNMP_V3_PROXY#include <wrn/wm/snmp/engine/v3_proxy.h>#endif /* INSTALL_ENVOY_SNMP_V3_PROXY */#endif /* INSTALL_ENVOY_SNMP_V3_TARGET */#if INSTALL_ENVOY_SNMP_COEXISTENCE#include <wrn/wm/snmp/engine/v3_comm.h>#endif /* INSTALL_ENVOY_SNMP_COEXISTENCE */#if INSTALL_SNMP_V3_DIFFIE_HELLMAN#include <wrn/wm/snmp/engine/v3_dh.h>#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */sbits32_t v3_snmpEngineMaxMessageSize = 0;ENGINE_LEAF_T *v3_my_engine = 0;ENGINE_LEAF_T *root_engine = 0;SNMP_CONTEXT_T *v3_context_root = 0;SNMP_GROUP_T *root_group = 0;SNMP_ACC_GRP_T *root_access = 0;SNMP_USER_ENG_T *root_user = 0;SNMP_AUTH_T *v3_auth_root = 0;SNMP_PRIV_T *v3_priv_root = 0;#if INSTALL_ENVOY_SNMP_V3_TARGETSNMP_TARGET_ADDR_T *root_target_addr = 0;SNMP_TARGET_PARAMS_T *root_target_params = 0;#if INSTALL_ENVOY_SNMP_V3_NOTIFYSNMP_NOTIFY_T *root_notify = 0;SNMP_NOTIFY_FILTER_PROFILE_T *root_notify_filter_profile = 0;SNMP_NOTIFY_FILTER_T *root_notify_filter = 0;SNMP_RETRANS_ROOT_T root_retrans_block;RETRANS_COOKIE_T *root_retrans_cookie = 0;#endif /* INSTALL_ENVOY_SNMP_V3_NOTIFY */#if INSTALL_ENVOY_SNMP_V3_PROXYSNMP_PROXY_T *root_proxy = 0;SNMP_PROXY_CB_ROOT_T root_proxy_block;#if !(INSTALL_ENVOY_SNMP_V3_NOTIFY)bits32_t proxy_msgid = 0;#endif#endif /* INSTALL_ENVOY_SNMP_V3_PROXY */#endif /* INSTALL_ENVOY_SNMP_V3_TARGET */#if INSTALL_ENVOY_SNMP_COEXISTENCESNMP_COMMUNITY_T *root_community = 0;#endif /* INSTALL_ENVOY_SNMP_COEXISTENCE */#if INSTALL_ENVOY_SNMP_LOCK#if (INSTALL_ENVOY_SNMP_V3_NOTIFY) || (INSTALL_ENVOY_SNMP_V3_PROXY)ENVOY_SNMP_LOCK(SNMP_V3_Retrans_Lock);#endifENVOY_SNMP_LOCK(SNMP_V3_Boots_Lock);#endifvoid envoy_v3_init (void){v3_snmpEngineMaxMessageSize = SNMP_MAX_PACKET_SIZE;/* set up root lists */v3_my_engine = 0;root_engine = 0;v3_context_root = 0;root_group = 0;root_access = 0;root_user = 0;v3_auth_root = 0;v3_priv_root = 0;#if INSTALL_ENVOY_SNMP_V3_TARGETroot_target_addr = 0;root_target_params = 0;#if INSTALL_ENVOY_SNMP_V3_NOTIFYroot_notify = 0;root_notify_filter_profile = 0;root_notify_filter = 0;root_retrans_block.retrans = 0;root_retrans_block.next_retrans_id = 0;envoy_tm_init(&root_retrans_block.timer);root_retrans_block.timer.handler = 0;root_retrans_cookie = 0;#endif /* INSTALL_ENVOY_SNMP_V3_NOTIFY */#if INSTALL_ENVOY_SNMP_V3_PROXYroot_proxy = 0;root_proxy_block.pcb = 0;envoy_tm_init(&root_proxy_block.timer);#if INSTALL_ENVOY_SNMP_V3_NOTIFY/* This is all a setup to make sure that, by default, we don't * create notifies and proxy requests with the same msgid. */root_proxy_block.nextMsgID = &(root_retrans_block.next_retrans_id);#elseproxy_msgid = 0;root_proxy_block.nextMsgID = &proxy_msgid;root_proxy_block.timer.handler = 0;#endif#endif /* INSTALL_ENVOY_SNMP_V3_PROXY */#endif /* INSTALL_ENVOY_SNMP_V3_TARGET */#if INSTALL_ENVOY_SNMP_COEXISTENCEroot_community = 0;#endif /* INSTALL_ENVOY_SNMP_COEXISTENCE */#if INSTALL_ENVOY_SNMP_LOCK#if INSTALL_ENVOY_SNMP_V3_NOTIFYENVOY_SNMP_INIT_LOCK_TAG(SNMP_V3_Retrans_Lock, ENVOY_V3RETRANSLOCK_TAG);#endif /* INSTALL_ENVOY_SNMP_V3_NOTIFY */ENVOY_SNMP_INIT_LOCK_TAG(SNMP_V3_Boots_Lock, ENVOY_V3BOOTSLOCK_TAG);#endif /* INSTALL_ENVOY_SNMP_LOCK */#if INSTALL_SNMP_V3_DIFFIE_HELLMAN/* Initialize the context required by BIGNUM libraries */SNMP_DH_bnCtx = BN_CTX_new();#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -