I'm experimenting with OMAPI as a means of giving our support staff additional insight into the state of a subscriber's service. Anyone who's ever played with OMAPI knows two things:
- The documentation is awful
- Assuming you get past the documentation's awfulness, the resulting objects contain hexadecimal representations of each value.
Now, I can convert IP addresses from the ab:ab:ab:ab format that they're returned in into dotted decimal without issue but does anyone know how to convert the other values into something sane, specifically, the start/end values.
Also, are the subnet values representative of the subnet mask assigned to the subscriber or are they related to something else? For example, I have a subscriber whose subnet mask is 255.255.224.0 but the subnet value returned by OMAPI is 00:00:00:09.
Okay, I've sussed out the starts/ends thing - basically, you remove the colons from the hexadecimal value, convert to int and then run it through, say, date() (PHP) or localtime() (Perl). E.g.,
4e:4a:03:74 becomes 4e4a0374, expressed as an int 1313473396 and then passed to date('Ymd G:i:s') to give us 20110816 6:43:16
I'm still not sure what the subnet value is (I mean, I'm guessing it somehow relates to the subnet mask but I'm not sure how).