Display Subnet in "About"

Posted by: SE_Sport_Driver

Display Subnet in "About" - 04/08/2004 00:07

With differant DHCP settings in Hijack for @Work and @Home, sometimes I have trouble connecting directly to the empeg depending on how it booted up. Looking at the subnet on both the empeg and whatever PC I'm using would help to troubleshoot sometimes... Maybe this could be added in a future empeg release?
Posted by: mlord

Re: Display Subnet in "About" - 04/08/2004 01:37

You mean, something like this (try it):
Code:
[hijack]
;@MENUEXEC netmask y=`cat /proc/net/route` && echo popup 5 "netmask=${y:162:8}" >/proc/empeg_notify


Just stick that in the config.ini, reboot, and then select "Netmask" from the Hijack menu..
Posted by: SE_Sport_Driver

Re: Display Subnet in "About" - 04/08/2004 06:58

Oh wow! Very cool! I'll give that a shot!
Posted by: SonicSnoop

Re: Display Subnet in "About" - 06/08/2004 15:20

Just out of curiosity I tried this copying it straight from your post into the config.ini when I try it I get:
netmask=00FFFFFF
Posted by: wfaulk

Re: Display Subnet in "About" - 06/08/2004 15:39

That's definitely what should be expected from that, but I don't really understand it. It appears to be the netmask displayed in hexadecimal reversed.

Your netmask is probably 255.255.255.0. That can also be written FF FF FF 00. Why /proc/net/route shows it reversed I'm not sure.
Posted by: peter

Re: Display Subnet in "About" - 06/08/2004 16:23

Quote:
Why /proc/net/route shows it reversed I'm not sure.

Network byte order.

Peter
Posted by: wfaulk

Re: Display Subnet in "About" - 06/08/2004 16:55

I was thinking that would have been FF FF 00 FF, but I guess you're right.
Posted by: mlord

Re: Display Subnet in "About" - 06/08/2004 20:44

Here is a somewhat fancier version:
Code:

[hijack]
;@MENUEXEC Netmask y=`cat /proc/net/route` && y=${y:162:8} && echo popup 5 "Netmask=$((0x${y:6:2})).$((0x${y:4:2})).$((0x${y:2:2})).$((0x${y:0:2}))" >/proc/empeg_notify