1#!/usr/bin/awk -f
2BEGIN {
3	FIELDWIDTHS="16 16 16 6 6 6 7 5"
4	sid=ENVIRON["server_sid"]
5	route=ENVIRON["route"]
6}
7{
8 dest	= $1;
9 gw	= $2;
10 genmask= $3;
11 flags	= $4;
12 netif	= $8;
13 gsub(/\ /,"",dest)
14 gsub(/\ /,"",gw)
15 gsub(/\ /,"",genmask)
16 gsub(/\ /,"",flags)
17 gsub(/\ /,"",netif)
18 if ($1!~/^[A-Z]/ && $1!="") {
19	if (NR %2 == 0) print "<tr class=a1>"
20	else print "<tr class=a2>"
21	if (dest==route) {
22		print "<td class=editdelete><a href='JavaScript:apply(\""dest"\")'><img src='images/menu_addrule.png' width=20 height=20 align=top border=0></a></td>"
23		print "<td><input type=\"text\" name=\"dest\" id=\"dest\" size=15 maxlength=20 value=\""dest"\"></td>"
24		print "<td><input type=\"text\" name=\"gw\" id=\"gw\" size=15 maxlength=15 value=\""gw"\"></td>"
25		print "<td><input type=\"text\" name=\"genmask\" id=\"genmask\" size=15 maxlength=15 value=\""genmask"\"></td>"
26		print "<td>auto</td><td>auto</td>"
27		print "<td class=editdelete><img src='images/eraser_static.png$"sid"' width=20 height=20 align=top border=0></td></tr>"
28	} else {
29		if (gw!~/\./) {
30			print "<td class=editdelete><img src='images/editor_static.png"sid"' width=20 height=20 align=top border=0></td>"
31		} else {
32			print "<td class=editdelete><a href='rt_edit?form&route="dest"$"sid"'><img src='images/editor.png' width=20 height=20 align=top border=0></a></td>"
33		}
34		print "<td>"dest"</td><td>"gw"</td><td>"genmask"</td><td>"flags"</td><td>"netif"</td>"
35		print "<td class=editdelete><a href='JavaScript:rt_del(\""dest"\")'><img src='images/eraser.png' width=20 height=20 align=top border=0></a></td></tr>"
36	}
37 }
38}
39