+}
+
+# Print table header.
+print <<END;
+ <table width='100%'>
+ <tr valign="top"">
+ <th align='center'>
+ <a href="?sort_field=5&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=5&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ <th align='center' colspan="2">
+ <a href="?sort_field=1&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=1&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+
+ <a href="?sort_field=3&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=3&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ <th align='center' colspan="2">
+ <a href="?sort_field=2&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=2&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+
+ <a href="?sort_field=4&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=4&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ <th align='center'>
+ <a href="?sort_field=8&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=8&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+
+ <a href="?sort_field=9&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=9&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ <th align='center'>
+ <a href="?sort_field=6&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=6&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ <th align='center'>
+ <a href="?sort_field=7&sort_order=d"><img style="width:10px" src="/images/up.gif"></a>
+ <a href="?sort_field=7&sort_order=a"><img style="width:10px" src="/images/down.gif"></a>
+ </th>
+ </tr>
+ <tr valign="top"">
+ <th align='center'>
+ $Lang::tr{'protocol'}
+ </th>
+ <th align='center' colspan="2">
+ $Lang::tr{'source ip and port'}
+ </th>
+ <th align='center' colspan="2">
+ $Lang::tr{'dest ip and port'}
+ </th>
+ <th align='center'>
+ $Lang::tr{'download'} /
+ <br>$Lang::tr{'upload'}
+ </th>
+ <th align='center'>
+ $Lang::tr{'connection'}<br>$Lang::tr{'status'}
+ </th>
+ <th align='center'>
+ $Lang::tr{'expires'}<br>($Lang::tr{'seconds'})
+ </th>
+ </tr>
+END
+
+foreach my $line (@conntrack) {
+ my @conn = split(' ', $line);
+
+ # The first bit is the l3 protocol.
+ my $l3proto = $conn[0];
+
+ # Skip everything that is not IPv4.
+ if ($l3proto ne 'ipv4') {
+ next;
+ }
+
+ # L4 protocol (tcp, udp, ...).
+ my $l4proto = $conn[2];
+
+ # Translate unknown protocols.
+ if ($l4proto eq 'unknown') {
+ my $l4protonum = $conn[3];
+ if ($l4protonum eq '2') {
+ $l4proto = 'IGMP';
+ } elsif ($l4protonum eq '4') {
+ $l4proto = 'IPv4 Encap';
+ } elsif ($l4protonum eq '33') {
+ $l4proto = 'DCCP';
+ } elsif ($l4protonum eq '41') {
+ $l4proto = 'IPv6 Encap';
+ } elsif ($l4protonum eq '50') {
+ $l4proto = 'ESP';
+ } elsif ($l4protonum eq '51') {
+ $l4proto = 'AH';
+ } elsif ($l4protonum eq '132') {
+ $l4proto = 'SCTP';
+ } else {
+ $l4proto = $l4protonum;
+ }
+ } else {
+ $l4proto = uc($l4proto);
+ }
+
+ # Source and destination.
+ my $sip;
+ my $sip_ret;
+ my $dip;
+ my $dip_ret;
+ my $sport;
+ my $sport_ret;
+ my $dport;
+ my $dport_ret;
+ my @packets;
+ my @bytes;