Feature request: convert decimal to hexadecimal format

http://wiki.mikrotik.com/wiki/Manual:IPv6_Overview#6to4_.286in4.29_tunnels

Link above describe howto set up an 6to4 relay on ROS but one thing is missing:

Now you need to add a IPv6 address to the tunnel interface. The address should be in form “2002 + + ” . A bash script can be used to generate such IPv6 address for you:

atis@atis-desktop:~$ ipv4=“1.2.3.4”; id=“1”; printf “2002:%02x%02x:%02x%02x::$id\n” echo $ipv4 | tr "." " "
2002:0102:0304::1

>

It would be nice if I can do this in ROS scripting as converting decimal number to hexadecimal format is missing from ROS scripting at the moment.

You can find some inspiration in http://forum.mikrotik.com/t/ipv6/37758/17

Ehh, nice work but while this script part is 25 lines long then this should be 1 line “:tohex” for example…
I hope your work will provide inspiration to ROS developer too :slight_smile:

Nahh, ok then 5 lines with kindness :slight_smile:

I’d also like to have :tohex, it was just if you really needed some solution (even if not elegant) right now without waiting. :slight_smile:

Btw, to developers, if :tohex is implemented, then please not just :tohex but :tohex

I had already integrated into my script, works fine :slight_smile: