Re: REVERSE_ASNENCODING

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/6/15 sanjaykumar <[email protected]>:
> #define NETSNMP_USE_REVERSE_ASNENCODING       1
> #define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1
> Please somebody let me know what is ACTUAL use of this macro.

It's concerned with the process of encoding the SNMP request
into the packet that's actually sent out over the network.
And in particular, with the handling of the multiple levels of
wrapping that SNMP uses.

Many of the encodings have the form   "length  data"
where the first byte (or two bytes (or three bytes...)) indicates
how large the following data will be.
   But this data may itself be the encoding of various other
values - so we don't know how big it will be until *after* it's
been encoded.   And hence, we don't know whether the length
field will need one, two or three... bytes.

The simplistic approach is to assume that all lengths will need the
larger size.   But this is somewhat wasteful (and can run into problems
with extra-large data that might need *more* than three bytes).

So the trick that we use (take a bow, Mr Hardaker), is to encode the
request starting at the very end, and work backwards.   So we begin
with the lowest-level data, and encode that.   So now we know how
big the encoded data is, and can use the correct representation for
this length when encoding the next layer outwards.


> Dees it explicitly required  ?
> If i will disable I have to disable both ??

It's not fundamental, no - you *could* turn it off if you really wanted.
But why would you do that?   It works much better this way.

If you were to change anything, it would make more sense to remove
support for "forward encoding", and *always* use the reverse mechanism.


>  how can I disable ?

No idea - it's a daft thing to want to do!

What are you trying to achieve here?

Dave

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.