logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: some information: msg#00432

Subject: Re: some information
>              if the session and the pdu structures
> contain different information (and the session
> structure is only used to pass not specified
> explicitly information) how could they be sent in the
> same packet data unit?

They're not.
If the session structure says one thing, and the PDU structure
says something different, the the packet that's sent out will
have the PDU values in it.

The session structure is only used to provide the values that
are missing from the PDU.

For example, given:

        session.rattle = tweedledee
        session.winner = all
        session.prizes = all

        pdu.rattle = tweedledum

        snmp_send( session, pdu )

then the outgoing packet will contain  {tweedledum, all, all}
The PDU value of 'rattle' will override the session value.
But the session values for 'winner' and 'prizes' get used,
since there isn't anything specified explicitly in the PDU structure.



> I mean: what kind of udp-packet is used to sent both
> structures together?

Eh?
It doesn't send *both* structures - just the PDU structure.
But before the PDU is sent out, any gaps are filled from the session
equivalents.

The snmp_send routines will do something like:

        if ( !pdu.rattle )
            pdu.rattle = session.rattle;
        if ( !pdu.winner )
            pdu.rattle = session.winner;
        if ( !pdu.prizes )
            pdu.rattle = session.prizes;

        sendto( fd, pdu );



> Is there any way to send all of them to the socket
> (which is waiting for both) and make it answer to me
> with the right response with a 'sendto-like function'?

Sorry - that just doesn't make any sense.



> Another question, if you have time to anwser:
> yesterday I tried to sniff the udp-traffic of my LAN
> and I checked that the size of the packet which is
> sent by YOUR 'snmpget' application is about 40 KB for
> the question and about 50 KB for the agent's answer.

The difference will basically be filling in the answers.
The outgoing request has NULL values for each of the varbinds.
The response is exactly the same, but will have strings, integers
and OIDs instead of the NULLs.

Try
        snmpget -Ddump .....

and compare what goes either way.
(And yes - one of them *is* displayed backwards!)


> This dimension is related ONLY to the pdu structure or
> both 2 structures (pdu + session)?

PDU only.   The session never gets sent (see above).

Dave




-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5


<Prev in Thread] Current Thread [Next in Thread>