This file roughly describes the inner workings of this patch.
This is not complete, in fact I think you'll have to read the source
to understand it completely.

I don't try to keep this file up to date. It is partly
obsolete as of the patch for 1.1.88.

The following files of the linux kernel are affected by the patch:

linux/kernel/exit.c
linux/kernel/fork.c
linux/kernel/printk.c
linux/include/linux/sched.h
linux/include/linux/sockios.h
linux/net/inet/Makefile
linux/net/inet/af_inet.c
linux/net/inet/ip.c
linux/net/inet/sock.h
linux/net/inet/tcp.c
inux/net/inet/udp.c
linux/net/socket.c
linux/arch/i386/config.in

These files are new:

linux/include/linux/inet_acct.h
linux/net/inet/inet_acct.c


The changes are:

----------------------------------------
linux/include/linux/sched.h
----------------------------------------
One field was added to task_struct, where
accounting information for the task is stored.

----------------------------------------
linux/include/linux/sockios.h
----------------------------------------
Constants for the ioctl's to tune accounting were added.

----------------------------------------
linux/kernel/exit.c
----------------------------------------
A call to inet_acct_process_exit() was added.
It is called whenever a process exits.

----------------------------------------
linux/kernel/fork.c
----------------------------------------
The pointer to accounting information is initialized to NULL whenever
a new process is created.

----------------------------------------
linux/kernel/printk.c
----------------------------------------
An option was added to the syslog syscall to get accounting
information from the kernel.

----------------------------------------
linux/net/inet/Makefile
----------------------------------------
inet_acct.o was added to the object files.


----------------------------------------
linux/net/inet/af_inet.c
----------------------------------------
sk->inet_acct_responsible_task is initialized upon creation of
a new sock.

A function is added to update inet_acct_responsible_task upon exit
of a process.

Two ioctl's are added.

----------------------------------------
linux/net/inet/ip.c
----------------------------------------
A call to inet_acct_send is added. It is called whenever an
IP packet is sent out.


----------------------------------------
linux/net/inet/sock.h
----------------------------------------
A field is added to struct sock where the task belonging to this
sock is stored.


----------------------------------------
linux/net/inet/tcp.c
inux/net/inet/udp.c
---------------------------------------- 
Calls to inet_acct_recv are added. It is called whenever an
IP packet comes in.


----------------------------------------
linux/net/socket.c
----------------------------------------
A function is added. It is called upon exit from a process
to update the inet_acct_responsible_task field of all
socks belonging to the exiting task.
This is ugly.

----------------------------------------
linux/arch/i386/config.in
----------------------------------------
A configuration option for inet accounting is added (CONFIG_INET_ACCT).
Almost all changes in the sources are ifdef'ed and not compiled
in if CONFIG_INET_ACCT is not defined.
Sometimes (sched.h) this was not easily possible.


----------------------------------------
linux/include/linux/inet_acct.h
----------------------------------------
Declarations of public structures and functions.


----------------------------------------
linux/net/inet/inet_acct.c
----------------------------------------
Look at the source :-)






