patch-2.2.11 linux/net/ipv4/ip_masq_user.c
Next file: linux/net/ipv4/ipconfig.c
Previous file: linux/net/ipv4/ip_masq_portfw.c
Back to the patch index
Back to the overall index
- Lines: 63
- Date:
Mon Aug 9 12:05:10 1999
- Orig file:
v2.2.10/linux/net/ipv4/ip_masq_user.c
- Orig date:
Sun Oct 4 10:21:45 1998
diff -u --recursive --new-file v2.2.10/linux/net/ipv4/ip_masq_user.c linux/net/ipv4/ip_masq_user.c
@@ -2,7 +2,7 @@
* IP_MASQ_USER user space control module
*
*
- * $Id: ip_masq_user.c,v 1.1 1998/08/29 23:51:08 davem Exp $
+ * $Id: ip_masq_user.c,v 1.1.2.1 1999/08/07 10:56:33 davem Exp $
*/
#include <linux/config.h>
@@ -347,8 +347,10 @@
struct ip_masq *ms;
char temp[129];
int idx = 0;
+ int col;
int len=0;
int magic_control;
+ struct list_head *l,*e;
MOD_INC_USE_COUNT;
@@ -357,7 +359,7 @@
if (offset < 128)
{
sprintf(temp,
- "Prot SrcIP SPrt DstIP DPrt MAddr MPrt State Flgs Ref Ctl Expires (free=%d,%d,%d)",
+ "Prot SrcIP SPrt DstIP DPrt MAddr MPrt State Flgs Ref Ctl Expires HRow HCol (free=%d,%d,%d)",
atomic_read(ip_masq_free_ports),
atomic_read(ip_masq_free_ports+1),
atomic_read(ip_masq_free_ports+2));
@@ -371,9 +373,12 @@
* Lock is actually only need in next loop
* we are called from uspace: must stop bh.
*/
+ col=0;
read_lock_bh(&__ip_masq_lock);
- for(ms = ip_masq_m_tab[idx]; ms ; ms = ms->m_link)
- {
+ l = &ip_masq_m_table[idx];
+ for (e=l->next; e!=l; e=e->next) {
+ col++;
+ ms = list_entry(e, struct ip_masq, m_list);
if (ms->protocol != proto) {
continue;
}
@@ -392,7 +397,7 @@
magic_control = atomic_read(&ms->n_control);
if (!magic_control && ms->control) magic_control = -1;
- sprintf(temp,"%-4s %08lX:%04X %08lX:%04X %08lX:%04X %-12s %3X %4d %3d %7lu",
+ sprintf(temp,"%-4s %08lX:%04X %08lX:%04X %08lX:%04X %-12s %3X %4d %3d %7lu %4d %4d",
masq_proto_name(ms->protocol),
ntohl(ms->saddr), ntohs(ms->sport),
ntohl(ms->daddr), ntohs(ms->dport),
@@ -401,7 +406,8 @@
ms->flags,
atomic_read(&ms->refcnt),
magic_control,
- (ms->timer.expires-jiffies)/HZ);
+ (ms->timer.expires-jiffies)/HZ,
+ idx, col);
len += sprintf(buffer+len, "%-127s\n", temp);
if(len >= length) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)