Hehe,
Nice idea. Unfortunately it won't work in my situation.
Here are the specifics of my project. I have many NASes throughout my network. Each NAS has users online identified by a 9 digit session id. I access relevant user info via SNMP. Every specified interval a user dump is taken from each NAS and populated into a database. The application I am writing is a snmpd fronted to the database. So a client can walk my snmpd and get a list of their users. However, for simplicity and for certain functions to work, they need to be able to referrence a uniqe session id. Since the session id's on the NASes can be the same, I need to generate a new sessionid based on the NAS ip and sessionid.
I can't use an auto-incrementing id from a database table since the users are dumped every 5 min or so and I can't guarantee that the same id with be associated with the same user after each dump, and I'd also have to worry about users connecting and disconnecting. That is why I need to be able to generate a new sessionid. The 9 digit limitation is due to net-snmp. The maximum number of an oid level is 2147483647.
The idea is for the 9 digit sessionid to be part of the oid, so they can easily reference their users, instead of an auto-incrementing number.
enterprises.10000.10182.398820668
enterprises.10000.10182.548131831
enterprises.10000.10182.872131658
If it was an auto-incrementing number, that number would change when users connect/disconnect and unless they walk the tree again, they might access the wrong users info. It's more complicated than I am explaining it, but I think you get the basic idea of what I need.
I realize that encoding the IP and sessionid into a 9 digit number is not possible now, due to the reply's above. All I really want now is a way to take the IP and sessionid, do whatever to it, and get a 9 digit number that I is unique to that specific IP and sessionid. I don't care if I can't go backwards. Understand?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.