then you have one hope.

and it's a slim one.

but you might be able to wring the last bit of info out.

the absolute max session id is 999_999_999 which in binary is: $ perl -e 'printf"%032b$/",999999999' 00111011100110101100100111111111 you have the 2 most significant bits to work with. %NASs = ( '192.168.254.12' => 0, '192.168.255.13' => 1, '192.168.256.2' => 2, '192.168.243.1' => 3 ); so you can fit 4 IP's and a session id in 32 bits. if you want to assume that your session id won't go above 463129087 th +en you can steal another bit and have 8 IPs. $ perl -le 'print unpack "N", pack "B*", "0001101110011010110010011111 +1111"' 463129087 or along the same lines, use the NAS number and session id with a dot, only because it's easier for humans. 1.4596831 12.4596831 instead of the 16bit big numbers...

this assumes an OID part can be 32 bits.

$ snmpget -v 1 $CENSORED sysDescr.9999999999 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: system.sysDescr.4294967295 $ snmpget -v 1 $CENSORED sysDescr.4294967294 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: system.sysDescr.4294967294 $ snmpget -v 1 $CENSORED sysDescr.4294967295 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: system.sysDescr.4294967295 $ snmpget -v 1 $CENSORED sysDescr.4294967296 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: system.sysDescr.4294967295

which may or may not be true.


In reply to Re: Re: Re: Re: Re: integer encoder/decoder by zengargoyle
in thread integer encoder/decoder by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.