📄 axmcmpnt.c
字号:
/* * Copyright 2001-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. *//* * $Log: axmcmpnt.c,v $ * Revision 1.8 2003/01/15 14:05:11 josh * directory structure shifting * * Revision 1.7 2002/03/19 19:36:12 josh * break down the main MIB tree so it doesn't include AgentX objects * anymore. instead, the AgentX MIB objects are built into a separate * MIB tree file which will only be used when the AgentX code is included * in the project facility. * * Revision 1.6 2001/12/07 20:36:38 meister * ax_dyncfg_init should be ax_master_dyncfg_init * * Revision 1.5 2001/11/12 22:54:52 meister * Changed some DYNCFG_FUNCPTR's to DYNCFG_EXTERN_FUNCPTR's * * Revision 1.4 2001/11/08 22:18:33 meister * rework pathnames * * Revision 1.3 2001/11/06 21:50:52 josh * second (and hopefully final) pass of new path hacking * * Revision 1.2 2001/11/06 21:20:39 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:49 tneale * Tornado shuffle * * Revision 1.1.2.11 2001/11/02 21:15:10 meister * envoy/h/vxprotos.h -> snmp/vxagent/h/vxprotos.h * * Revision 1.1.2.10 2001/11/02 17:14:02 meister * split out user and core dynamic config * * Revision 1.1.2.9 2001/10/19 21:50:48 meister * snmpdInstalledComponentsValue should be unsigned in all references. * * Revision 1.1.2.8 2001/10/19 21:34:17 meister * fix minor typos * * Revision 1.1.2.7 2001/10/19 21:09:33 meister * get rid of the message-queue method of communicating which components * are installed, in favor of a directly accessible bit-mask variable. We never * never used the message queue for anything the simple bit mask couldnt do. * * Revision 1.1.2.6 2001/10/16 20:18:05 meister * Add prototypes for axMasterIoInit, and snmpAxMonitorSpawn. They dont * belong here. axCfg.h needs to be fixed and then they can be removed from * here. * * Revision 1.1.2.5 2001/10/16 19:53:01 meister * Tornado 2 doesnt have a VX_USER_MODE #define. * * Revision 1.1.2.4 2001/10/16 18:31:18 meister * dynamic pointers for snmpdAxMonitorSpawn, initAxMonitor * * Revision 1.1.2.3 2001/09/27 01:10:15 meister * Split out coexistence support into V3 component * * Revision 1.1.2.2 2001/09/18 16:36:15 meister * snmpd config msgQ and mutex should have consistent names. * * Revision 1.1.2.1 2001/08/29 15:43:22 meister * component initialization for the vxworks snmpd components * *//* [clearcase]modification history-------------------01b,19apr05,job update copyright notices01a,24nov03,job update copyright information*//* Copyright 1984-2001 Wind River Systems, Inc */#include "copyright_wrs.h"#include <vxWorks.h>#include <stdio.h>#include <msgQLib.h>#include <semLib.h>#include <taskLib.h>#include <wrn/wm/snmp/vxagent/axCfg.h>#include <wrn/wm/snmp/vxagent/snmpdLib.h>#include <wrn/wm/snmp/engine/snmpdefs.h>#include <wrn/wm/snmp/engine/vxcmpnts.h> #include <wrn/wm/snmp/vxagent/vxprotos.h>#include <wrn/wm/common/dyncfg.h>extern STATUS axMasterIoInit (void);extern void snmpAxMonitorSpawn (void);extern void axSockClose (void);/* from ax_mast.c */DYNCFG_EXTERN_FUNCPTR0(axMasterIoInit,STATUS)DYNCFG_EXTERN_FUNCPTR0(snmpAxMonitorSpawn,void)DYNCFG_EXTERN_FUNCPTR0(ax_add_ax_mibs,void)DYNCFG_EXTERN_FUNCPTR0(snmpCleanAgentXMaster,void)void registerAxMasterComponent (void);extern unsigned int snmpdInstalledComponentsValue;extern SEM_ID snmpdConfigMutex;/* set any dynamic configuration function pointers for the *user* part of the ax master component here. Core SNMP dynamic config wil be set in the core code. (this is not done in the core code now, but will be fixed to do so RSN.) */static void _ax_user_dyncfg_init(void) { DYNCFG_FUNCPTR_SET_DEFAULT(axMasterIoInit); DYNCFG_FUNCPTR_SET_DEFAULT(snmpAxMonitorSpawn); DYNCFG_FUNCPTR_SET_DEFAULT(ax_add_ax_mibs); DYNCFG_FUNCPTR_SET_DEFAULT(snmpCleanAgentXMaster);}void initAxMasterComponent (void){ int task_mode;#if INSTALL_ENVOY_VXWORKS_TAE task_mode = VX_USER_MODE;#else task_mode = 0x0000;#endif snmpdLog(SNMP_INFO,"initAxMasterComponent () called\n"); taskSpawn ("tRegAxMasterComponent", 95, task_mode, 8182, (FUNCPTR) registerAxMasterComponent, 0,0,0,0,0,0,0,0,0,0);}void registerAxMasterComponent (void){ semTake (snmpdConfigMutex, WAIT_FOREVER); snmpdInstalledComponentsValue |= SNMPD_AGENTX_MASTER_COMPONENT; /* set up any pointers needed for dynamic configuration */ /* this first call should really be moved into the core SNMP code */ ax_master_dyncfg_init (); /* this one will handle the user part */ _ax_user_dyncfg_init (); semGive (snmpdConfigMutex);}/** From RFC2742.MIB ** Subtree Object Identifier for Add_Node_From_Root ** agentXMIB OBJECT IDENTIFIER ::= { mib-2 74 }STATIC OIDC_T oid_axmib_node[] = { 1, 3, 6, 1, 2, 1, 74 };OBJ_ID_T objid_axmib_node = { sizeof(oid_axmib_node)/sizeof(OIDC_T), oid_axmib_node};**/extern OBJ_ID_T objid_axmib_node;extern MIBNODE_T axmib_node;void ax_add_ax_mibs (void){ MIBNODE_T *rnode; int status; /* AgentX MIB */ status = Add_Node_From_Root(&mib_root_node, &objid_axmib_node, &axmib_node, &rnode);}void snmpCleanAgentXMaster (void) { MIBNODE_T *rnode; axSockClose (); ENVOY_SNMP_GET_WRITE_LOCK(SNMP_CoarseLock); if ((rnode = Remove_Node_From_Root(&mib_root_node, &objid_axmib_node)) != &axmib_node) ; ENVOY_SNMP_RELEASE_WRITE_LOCK(SNMP_CoarseLock); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -