pppmibagent.c

来自「这是全套的PPP协议的源码」· C语言 代码 · 共 126 行

C
126
字号
/* pppMibAgent.c *//* Copyright 1984-2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01b,26aug02,ijm  use Add_Node_From_Root instead of snmpdTreeAdd01a,09aug02,rp   created*/#include <vxWorks.h>#include <logLib.h>#include <wrn/wm/snmp/vxagent/snmpdLib.h>IMPORT MIBNODE_T ppp_lcp_mib;IMPORT OBJ_ID_T objid_ppp_lcp_mib;IMPORT MIBNODE_T ppp_security_mib;IMPORT OBJ_ID_T objid_ppp_security_mib;IMPORT MIBNODE_T ppp_ipcp_mib;IMPORT OBJ_ID_T objid_ppp_ipcp_mib ;/******************************************************************************** ppp_mib_attach - add PPP MIBs dynamically to the main MIB tree** This routine adds the PPP MIBs to the main MIB tree. This allows* access to the PPP MIBs using the Envoy SNMP manager.  This function* is called from usrBasicPPPInit before the SNMP agent is initialized.* After the agent is initialized, SMNP_CoarseLock would need to be taken* prior to calling Add_Node_From_Root and released immediately after.** RETURNS: OK, or ERROR if Add_Node_From_Root fails.** NOMANUAL*/STATUS ppp_mib_attach (void)    {    MIBNODE_T *rnode;    if (Add_Node_From_Root (NULL, &objid_ppp_lcp_mib,                            &ppp_lcp_mib, &rnode) != OK)        {        logMsg ("Could not add PPP LCP MIB\n",1,2,3,4,5,6);        return (ERROR);        }    if (Add_Node_From_Root (NULL, &objid_ppp_security_mib,                            &ppp_security_mib, &rnode) != OK)        {        logMsg ("Could not add PPP SECURITY MIB\n",1,2,3,4,5,6);        return (ERROR);        }    if (Add_Node_From_Root (NULL, &objid_ppp_ipcp_mib,                            &ppp_ipcp_mib, &rnode) != OK)        {        logMsg ("Could not add PPP IPCP MIB\n",1,2,3,4,5,6);        return (ERROR);        }    return (OK);    }/******************************************************************************** ppp_mib_detach - remove PPP MIBs from the main MIB tree** This routine removes the PPP MIBs from the main MIB tree after the SNMP* agent is initialized. This routine will have no effect if nodes* are non-removable.  Please refer to PPP Release Notes for information on* how to make PPP nodes removable.** RETURNS: OK, or ERROR if Remove_Node_From_Root fails.** NOMANUAL*/STATUS ppp_mib_detach (void)    {    MIBNODE_T *rnode;    ENVOY_SNMP_GET_WRITE_LOCK (SNMP_CoarseLock);    rnode = Remove_Node_From_Root (NULL, &objid_ppp_lcp_mib);    ENVOY_SNMP_RELEASE_WRITE_LOCK (SNMP_CoarseLock);    if (rnode == NULL)        {        logMsg ("Could not remove PPP LCP MIB\n",1,2,3,4,5,6);        return (ERROR);        }    ENVOY_SNMP_GET_WRITE_LOCK (SNMP_CoarseLock);    rnode = Remove_Node_From_Root (NULL, &objid_ppp_security_mib);    ENVOY_SNMP_RELEASE_WRITE_LOCK (SNMP_CoarseLock);    if (rnode == NULL)        {        logMsg ("Could not remove PPP SECURITY MIB\n",1,2,3,4,5,6);        return (ERROR);        }    ENVOY_SNMP_GET_WRITE_LOCK (SNMP_CoarseLock);    rnode = Remove_Node_From_Root (NULL, &objid_ppp_ipcp_mib);    ENVOY_SNMP_RELEASE_WRITE_LOCK (SNMP_CoarseLock);    if (rnode == NULL)        {        logMsg ("Could not remove PPP IPCP MIB\n",1,2,3,4,5,6);        return (ERROR);        }    return (OK);    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?