Re: [lisp-snmp] Broken snmpwalk termination check
Brought to you by:
binghe
|
From: Chun T. (binghe) <bin...@gm...> - 2009-01-21 08:35:35
|
On 2009-1-21, at 16:29, John Fremlin wrote:
> Hi Chun Tian,
>
> "Chun Tian (binghe)" <bin...@gm...> writes:
>> On 2009-1-21, at 15:00, John Fremlin wrote:
>>> I think that the check to see when to terminate the snmpwalk was
>>> wrong
>>> in the version of snmp we were using. The snmpwalk terminates quite
>>> arbitrarily.
>>>
>>> First, the way of comparing oids with oid-< was very, very, very
>>> wrong.
>>>
>>>> (oid->= (oid ".1") (oid ".1.0"))
>>> T
>>>> (oid->= (oid ".1.1") (oid ".1.0"))
>>> T
>>
>> Maybe I shouldn't use these confused function names, but that's what
>> the original Lisp-SNMP project called.
>>
>> I don't think your patch on oid compare would work, because what I
>> want to do in snmp-walk in definitely NOT to check which oid is
>> "big".
>>
>> [Theorem 1] The OID as a number list which appears in a "GetNext PDU"
>> chain will ALWAYS get bigger and bigger. That's just what the SNMP
>> protocol defined on GetNextPDU.
>
> Yes this is what is supposed to happen. However in practice it does
> not
> happen for the MS Windows 2k boxen. They keep returning the same oid
> from getnext for SNMPv2-SMI::enterprises.77.1.4.1.0.
>
> The snmpwalk checks for this and so should we.
>
> && snmp_oid_compare(name, name_length,
> vars->name,
> vars->name_length) >=
> 0) {
> fprintf(stderr, "Error: OID not
> increasing: ");
>
What's the correspond VALUE (beside the "same" OID) here? I think SNMP
agent will reply the same OID on GetNextPDU only if this OID doesn't
exist in the SNMP agent. I thought I've captured it well (explained in
your second note)
And I'm sorry still don't know the difference between NO-SUCH-INSTANCE
and NO-SUCH-OBJECT, I cannot find a SNMP agent which reply me NO-SUCH-
INSTANCE, can you?
>
> [...]
>
>> (defun oid-< (oid-1 oid-2)
>> "test if oid-1 is oid-2's child"
>> ...)
>>
>> Use my version, I can detect:
>>
>> 1) "sysDescr.0" is "system"'s child (oid number list longer, and
>> their
>> start parts is the same)
>> 2) "ifNumber.0" is NOT "system"'s child.
>>
>> So, What's your opinion?
>
> Sorry I was confused by the name, I assumed that < was a total order
> not
> a partial order.
>
> I guess we should use both functions and keep both termination
> checks. Which one will get renamed? ;-)
>
> [...]
--
Chun Tian (binghe)
NetEase.com, Inc.
P. R. China
|