*** empty log message ***

This commit is contained in:
Martin Baulig
1998-08-16 13:40:15 +00:00
parent b40e08fb74
commit 77f56522c5
6 changed files with 106 additions and 7 deletions

View File

@@ -189,6 +189,9 @@ sys_table (int type, union table *buf, const void *param)
union table tbl;
struct sysinfo i;
struct task_struct *tsk = NULL;
struct ip_chain *chain;
struct ip_fwkernel *rule;
char devname [9];
int index, err;
pid_t pid;
@@ -219,6 +222,14 @@ sys_table (int type, union table *buf, const void *param)
if (tsk == NULL)
return -ESRCH;
break;
case TABLE_NETACCT:
err = verify_area (VERIFY_READ, param, 5);
if (err)
return err;
copy_from_user (devname, param, 5);
devname [5] = 0;
break;
}
/* Main function dispatcher */
@@ -426,6 +437,24 @@ sys_table (int type, union table *buf, const void *param)
tbl.proc_kernel.wchan = get_wchan (tsk);
break;
case TABLE_NETACCT:
for (chain = ip_fw_chains; chain; chain = chain->next) {
for (rule = chain->chain; rule; rule = rule->next) {
const char *name = rule->ipfw.fw_vianame;
int k;
if (name [0] && !strncmp (param, name, 5))
continue;
for (k = 0; k < NUM_SLOTS; k++) {
tbl.netacct.packets +=
rule->counters[k].pcnt;
tbl.netacct.bytes +=
rule->counters[k].bcnt;
}
}
}
break;
default:
return -EINVAL;
}