Dear,
My program is now fine. It hasn't any error except  setting
snmpTargetAddrTDomain.
I tried four ways to set its value snmpUDPDomain. but it's value become
ccitt.1

This section is:

    oid      oidnetsnmpUDPDomain2[]    = { 1, 3, 6, 1, 6, 1, 1 };

       oid oidnetsnmpUDPDomain3[MAX_OID_LEN];
       size_t oidnetsnmpUDPDomain3_len = MAX_OID_LEN;

    if(flag_debug==1)
    {
    snmp_parse_oid( "SNMPv2-TM::snmpUDPDomain", oidnetsnmpUDPDomain3,
&oidnetsnmpUDPDomain3_len);
    }
    else if(flag_debug==2)
    {
    snmp_parse_oid( "snmpUDPDomain", oidnetsnmpUDPDomain3,
&oidnetsnmpUDPDomain3_len);
    }
    snmp_log(LOG_ERR, "set oidsnmpTargetAddrTDomain %d %d
%d!!!\n",oidnetsnmpUDPDomain3_len,OID_LENGTH(oidnetsnmpUDPDomain3),flag_debug);
    memset(&var, 0, sizeof(netsnmp_variable_list));
    snmp_set_var_objid( &var, oidsnmpTargetAddrTDomain,
OID_LENGTH(oidsnmpTargetAddrTDomain));
    if(flag_debug==1 || flag_debug==2)
        snmp_set_var_typed_value(&var,  ASN_OBJECT_ID, oidnetsnmpUDPDomain3,
oidnetsnmpUDPDomain3_len    );
    else if(flag_debug==4)
        snmp_set_var_typed_value(&var,  ASN_OBJECT_ID, netsnmpUDPDomain ,
netsnmpUDPDomain_len    );
    err = netsnmp_query_set( &var, sp );
    snmp_log(LOG_ERR, "err : %d\n",err);

it was return err=0.

but the value is ccitt.1 instead of snmpUDPDomain

snmpwalk -v2c -c public 192.168.20.5 snmpTargetAddrTable
SNMP-TARGET-MIB::snmpTargetAddrTDomain.'internal0' = *OID: ccitt.1*
SNMP-TARGET-MIB::snmpTargetAddrTAddress.'internal0' = Hex-STRING: C0 A8 14
63 00 A2
SNMP-TARGET-MIB::snmpTargetAddrTimeout.'internal0' = INTEGER: 1000
SNMP-TARGET-MIB::snmpTargetAddrRetryCount.'internal0' = INTEGER: 5
SNMP-TARGET-MIB::snmpTargetAddrTagList.'internal0' = STRING: internal0
SNMP-TARGET-MIB::snmpTargetAddrParams.'internal0' = STRING: internal0
SNMP-TARGET-MIB::snmpTargetAddrStorageType.'internal0' = INTEGER:
nonVolatile(3)
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'internal0' = INTEGER: active(1)

Why?
Thanks.
On Fri, Feb 12, 2010 at 4:25 AM, Mike Ayers <[email protected]> wrote:

> > From: majid namnabat [mailto:[email protected]]
> > Sent: Wednesday, February 10, 2010 9:02 PM
>
> >       but I can not set it. My code to set oidsnmpTargetAddrTDomain is
> > similar to this:
> >
> >           oid oidsnmpTargetAddrTDomain[] =        {1, 3, 6, 1, 6, 3, 12,
> > 1, 2, 1, 2,'i','n','t','e','r','n','a','l','0',0};//not accept
> >               u_char oidsnmpUDPDomain[] =  {'s', 'n', 'm', 'p', 'U', 'D',
> > 'P','D','o','m','a','i','n',0}
>
>         LOL!
>
>        I'm not giving the answer, 'cuz I'm laughing too hard, but I will
> give a hint: you want to set this to snmpUDPDomain, not "snmpUDPDomain".
>  Check out RFC1906.
>
>
>        HTH,
>
> Mike
>
>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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

Reply via email to