[AGENT++] Net-SNMP master agent <-> AgentX++ sub agent compatibility

Frank Fock fock at agentpp.com
Wed Mar 12 23:31:49 CET 2008


Hello John,

The byte order is part of the AgentX header. See RFC 2741:

6. Protocol Definitions

6.1. AgentX PDU Header

    The AgentX PDU header is a fixed-format, 20-octet structure:

    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   h.version   |    h.type     |    h.flags    |  <reserved>   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          h.sessionID                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        h.transactionID                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          h.packetID                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        h.payload_length                       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    An AgentX PDU header contains the following fields:

       h.version

          The version of the AgentX protocol (1 for this memo).

       h.type

          The PDU type; one of the following values:

             agentx-Open-PDU             (1),
             agentx-Close-PDU            (2),
             agentx-Register-PDU         (3),
             agentx-Unregister-PDU       (4),
             agentx-Get-PDU              (5),
             agentx-GetNext-PDU          (6),
             agentx-GetBulk-PDU          (7),
             agentx-TestSet-PDU          (8),
             agentx-CommitSet-PDU        (9),
             agentx-UndoSet-PDU         (10),



Daniele, et al.             Standards Track                    [Page 17]

RFC 2741                         AgentX                     January 2000


             agentx-CleanupSet-PDU      (11),
             agentx-Notify-PDU          (12),
             agentx-Ping-PDU            (13),
             agentx-IndexAllocate-PDU   (14),
             agentx-IndexDeallocate-PDU (15),
             agentx-AddAgentCaps-PDU    (16),
             agentx-RemoveAgentCaps-PDU (17),
             agentx-Response-PDU        (18)

             The set of PDU types for "administrative processing" are 1-4
             and 12-17.  The set of PDU types for "SNMP request
             processing" are 5-11.

       h.flags

             A bitmask, with bit 0 the least significant bit.  The bit
             definitions are as follows:

                  Bit             Definition
                  ---             ----------
                  0               INSTANCE_REGISTRATION
                  1               NEW_INDEX
                  2               ANY_INDEX
                  3               NON_DEFAULT_CONTEXT
                  4               NETWORK_BYTE_ORDER
                  5-7             (reserved)

             The NETWORK_BYTE_ORDER bit applies to all multi-byte integer
             values in the entire AgentX packet, including the remaining
             header fields.  If set, then network byte order (most
             significant byte first; "big endian") is used.  If not set,
             then least significant byte first ("little endian") is used.

             The NETWORK_BYTE_ORDER bit applies to all AgentX PDUs.

             The NON_DEFAULT_CONTEXT bit is used only in the AgentX PDUs
             described in section 6.1.1, "Context".

             The NEW_INDEX and ANY_INDEX bits are used only within the
             agentx-IndexAllocate-, and -IndexDeallocate-PDUs.

             The INSTANCE_REGISTRATION bit is used only within the
             agentx-Register-PDU.


Best regards,
Frank

john.edmonds at bt.com wrote:
> Hello Frank,
>  
> As far as I can tell the Net-SNMP workarounds are enabled, although I can't see that they are related to this particular issue.  Where in the agentX protocol code is the byte ordering determined, perhaps I can try some debugging?
>  
> Thanks,
> John 
> 
> ________________________________
> 
> From: Frank Fock [mailto:fock at agentpp.com]
> Sent: Thu 28/02/2008 18:45
> To: Edmonds,J,John,JGFTX C
> Cc: AGENTPP at agentpp.org
> Subject: Re: [AGENT++] Net-SNMP master agent <-> AgentX++ sub agent compatibility
> 
> 
> 
> Hello John,
> 
> The AgentX protocol requires that master as well as sub-agent can
> operate on both byte orders (host and network). Thus, if it only
> works when forcing the sub-agent to change its default order
> then the master agent seems to have a bug.
> 
> BTW, have you enabled the NET-SNMP compatibility work-arounds
> in agent++_def.h already?
> 
> Best regards,
> Frank
> 
> john.edmonds at bt.com schrieb:
>> Hello,
>>
>> I've had a little trouble getting a Net-SNMP master agent (5.4.1) talking to an AgentX++ sub agent using the AgentX protocol.  To get things working I added the line to the open_session() method below to force a change to the default byte order.  With this change everything appears to work fine, without it nothing works.... 
>>
>> int SubAgentXMib::open_session()
>> {
>>    if (session) {
>>    // disconnect
>>    delete session;
>>    }
>> session = create_session();
>> // JAE - fix byte ordering for Net-SNMP master agent compatibility
>> session->set_byte_order(true);
>> // JAE - fix byte ordering for Net-SNMP master agent compatibility
>> status = AGENTX_STATUS_CONNECT;
>> return agentx->open_session(*session);
>> }
>>
>>
>> In your experience should this change be necessary?  If not, why might it be necessary in my case? I am running on a 8248 PPC platform.
>>
>> Best regards,
>> John Edmonds
>> _______________________________________________
>> AGENTPP mailing list
>> AGENTPP at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/agentpp
>>  
> 
> 
> 
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com



More information about the AGENTPP mailing list