This post is more than 5 years old
5 Posts
0
2637
August 2nd, 2016 04:00
ASL Change string with binary data to numbers
@
From an snmptrap we get an octetstring with the ip address as hex binary digits i.e. 127.0.0.1 would be 4 bytes the first having 127 as value then two zero bytes and the last byte being 1.
In the console this will show up as the ascii equivalent of those characters (i.e. usually garbage unless something printable like 65 which would show up as 'A'). What we actually would like is that it would just show as the ip address.
I looked through the ASL manual but could not find a function to (what in other languages is usually called ord() ) of a character. The only function I could find was hextToString but that just displays the string above with any non-ascii removed.
Anyone know if this is possible?