enum registration

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <000601c968e2$1bd521a0$02b2a8c0@tardis>
Hi,

I am a newbie in snmp coding, vetarn in C. I am struggling through my own code since mib2c doesn't work (Solaris 10.5, snmpd 5.4.1).

I am registering an enum scalar, but I don't know how to restrict snmpset just to the enum values:


static enum
{
    notConnected,
    run,
    suspend,
    isolate,
    restart,
    shut
} setMode;

netsnmp_register_int_instance("setMode",
                                            mode_oid,
                                            OID_LENGTH(mode_oid),
                                            &setMode, NULL);

Server2:~/work/kannel/snmp-> snmpset 127.0.0.1 setMode = 15
IANWAP-MIB::setMode = INTEGER: 15

It should accept SET only for 0 - 5. Any ideas?

Thanx,
Nikos

------------------------------------------------------------------------------

_______________________________________________
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.