22-Mar-2015 19:14
Hi,
I need to convert DNS ascii representations (in query) of an IP address to dotted quad decimal format.
For example, the number 10 is represented in the packet as Hex 3130. (31 ASCII = 1 decimal, 30 ASCII=0 decimal).
Anyone know an easy, efficient way to convert this to 10 decimal?? Thanks!
22-Mar-2015
21:25
- last edited on
03-Jun-2023
09:08
by
JimmyPackets
This works:
binary scan \x31\x30\x31\x30\x31\x30\x31\x30 a2a2a2a2 A B C D
set address "$A.$B.$C.$D"
log local0. "catch $address => [catch {IP::addr $address mask 255.255.255.255} ]"