Re: about modifying files generated by mib2c

"蔷<Qiang Hu>" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Thank you for your reply,and I paste the code of "init_m3uaMIB" you need
here:

void
init_m3uaMIB(void)
{

    DEBUGMSGTL(("m3uaMIB", "Initializing\n"));

    /*
     * register ourselves with the agent to handle our mib tree
     */
    REGISTER_MIB("m3uaMIB", m3uaMIB_variables, variable4,
                 m3uaMIB_variables_oid);

    /*
     * place any other initialization junk you need here
     */

}

and the structures of some variables,

oid             m3uaMIB_variables_oid[] = { 1, 3, 6, 1, 4, 1, **** };
struct variable4 m3uaMIB_variables[] = {
    /*
     * magic number        , variable type , ro/rw , callback fn  , L,
oidsuffix
     */
#define M3UAVERSION  1
    {M3UAVERSION, ASN_UNSIGNED, RONLY, var_m3uaMIB, 1, {1}},
#define M3UAPROCTYPE  2
    {M3UAPROCTYPE, ASN_INTEGER, RONLY, var_m3uaMIB, 1, {2}},
#define M3UALOCALPORT  3
    {M3UALOCALPORT, ASN_UNSIGNED, RONLY, var_m3uaMIB, 1, {3}},
#define M3UATRVALUE  4
    {M3UATRVALUE, ASN_UNSIGNED, RWRITE, var_m3uaMIB, 1, {4}},
#define M3UATPAUDVALUE  5
    {M3UATPAUDVALUE, ASN_UNSIGNED, RWRITE, var_m3uaMIB, 1, {5}},
#define M3UAHEARTBEAT  6
    {M3UAHEARTBEAT, ASN_INTEGER, RWRITE, var_m3uaMIB, 1, {6}},
#define M3UATBEATVALUE  7
{M3UATBEATVALUE, ASN_UNSIGNED, RWRITE, var_m3uaMIB, 1, {7}},
.
.
.

and is there something wrong? In hurry .thank you!

On 7/27/06, Dave Shield <[email protected]> wrote:
>
> On 27/07/06, <Qiang Hu> <[email protected]> wrote:
> >                                      it's odd that
> > when i snmpwalk it i got such result(why m3uaManagement became the leaf
> > nod?):
> > [root@localhost root]# snmpwalk -v 1 -c public localhost m3uaMIB
> > M3UA-MIB::m3uaManagement.0 = Gauge32: 200
> > M3UA-MIB::m3uaConformance.0 = INTEGER: 2
> > M3UA-MIB::m3uaMIB.3.0 = Gauge32: 2905
>
> How did you register the MIB?
> What is the code from the 'init_m3uaMIB()' routine?
> (or whatever it's actually called)
>
> Dave
>



-- 
Qiang

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.