Community discussions

 
oreggin
Member Candidate
Member Candidate
Topic Author
Posts: 102
Joined: Fri Oct 16, 2009 9:21 pm

Feature request: convert decimal to hexadecimal format

Fri Jun 25, 2010 12:21 am

http://wiki.mikrotik.com/wiki/Manual:IP ... 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 + <IPv4 address in hex> + <custom id>" . 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.
 
Sob
Forum Guru
Forum Guru
Posts: 4809
Joined: Mon Apr 20, 2009 9:11 pm

Re: Feature request: convert decimal to hexadecimal format

Fri Jun 25, 2010 6:18 pm

People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
oreggin
Member Candidate
Member Candidate
Topic Author
Posts: 102
Joined: Fri Oct 16, 2009 9:21 pm

Re: Feature request: convert decimal to hexadecimal format

Fri Jun 25, 2010 7:47 pm

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 :)
 
oreggin
Member Candidate
Member Candidate
Topic Author
Posts: 102
Joined: Fri Oct 16, 2009 9:21 pm

Re: Feature request: convert decimal to hexadecimal format

Sat Jun 26, 2010 12:53 am

Ehh, nice work but while this script part is 25 lines long then this should be 1 line ":tohex" for example...
Nahh, ok then 5 lines with kindness :)
 
Sob
Forum Guru
Forum Guru
Posts: 4809
Joined: Mon Apr 20, 2009 9:11 pm

Re: Feature request: convert decimal to hexadecimal format

Sat Jun 26, 2010 3:01 am

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

Btw, to developers, if :tohex is implemented, then please not just :tohex <number> but :tohex <number> <width>
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
oreggin
Member Candidate
Member Candidate
Topic Author
Posts: 102
Joined: Fri Oct 16, 2009 9:21 pm

Re: Feature request: convert decimal to hexadecimal format

Tue Jun 29, 2010 12:12 am

I'd also like to have :tohex, it was just if you really needed some solution (even if not elegant) right now without waiting. :)
I had already integrated into my script, works fine :)

Who is online

Users browsing this forum: Majestic-12 [Bot] and 68 guests