shantanugoel / asus-rt-n66u-merlin

Discontinued. Please go to https://github.com/RMerl/asuswrt-merlin . Custom firmware for Asus RT-N66U based on asus sources. Started by Eric/RMerlin @ www.lostrealm.ca . There are 3 branches. master -> Asus stock, merlin -> RMerlin/Eric's builds, shantz -> Shantanu Goel's builds.
Other
18 stars 8 forks source link

WebUI page showing established connections #14

Closed RMerl closed 12 years ago

RMerl commented 12 years ago

Add a web page that displays currently established connections. Something similar to what is accomplished with this simple script:

RMerl commented 12 years ago

I already wrote a shell-based proof-of-concept script (interfaced through var_dump("","../path/this_script") ):

echo -e "proto \t Source \t Port \t Destination \t Port \t bytes"
echo     "===================================================="
cat /proc/net/nf_conntrack | grep "tcp" | awk '{print $3 "\t" substr($7,5) "\t" substr($9,7) "\t" substr($8,5) "\t" substr($10,7) "\t" substr($12,7)}' | sort
cat /proc/net/nf_conntrack | grep "udp" | awk '{print $3 "\t" substr($6,5) "\t" substr($8,7) "\t" substr($7,5) "\t" substr($9,7) "\t" substr($11,7)}' | sort

This works, but is a bit too hackish to be released like this. A new ej_dump_conntrack() function should be added to httpd/web.c, along with a new ej event. And rewrite those awk commands in C (or add this awk-based script to the firmware, and call it)

RMerl commented 12 years ago

Implemented, commit fb3c7716685453cb6e79c0929391e34bb4f046e1. A script-based method was used to reduce the amount of binary-level changes to Asus's code.