Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

ASCII to decimal conversions

ichalis_37981
Historic F5 Account

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!

 

2 REPLIES 2

ichalis_37981
Historic F5 Account

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} ]"

Alxender
Altostratus
Altostratus

It looks difficult to convert.