On 10 February 2010 09:19, majid namnabat <maj....@gmail.com> wrote:
> The section to set snmpTargetAddrTDomain was:
>     oid oidsnmpTargetAddrTDomain[] =
            {1, 3, 6, 1, 6, 3, 12, 1, 2, 1,
2,'i','n','t','e','r','n','a','l','0',0};

What is that final 0 doing there?
Remember that SNMP strings are not null-terminated.

You might find it easier, clearer and safer to let the library routines
construct the OIDs for you.  Something like:

    oid oidsnmpTargetAddrTDomain[MAX_OID_LEN];
    size_t name_len = MAX_OID_LEN;

    snmp_parse_oid( "snmpTargetAddrTDomain.'internal0'",
        oidsnmpTargetAddrTDomain, &name_len);

(Note that single quotes indicate an implied-length string index)



//not accept
>      u_char oidsnmpUDPDomain[] =  {'s', 'n', 'm', 'p', 'U', 'D',
> 'P','D','o','m','a','i','n',0};

I have absolutely no idea what you are trying to do here!
There is already a  OID variable 'netsnmpUDPDomain'
containing the standard OID for the UDP domain.
  Please use that, rather than making up your own (invalid!) OID.

Dave

PS: Please send to *one* mailing list - not both -users and -coders.
      That is unnecessary and rude.

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to