////////////////////////////////////////////////////////////////////// // PPPTraf 1.0. (C) DiSKiLLeR, 9/2/2000. (diskiller@cnbinc.com) // // // // This program is distributed under the terms of the GNU License. // // Please refer to the file README and COPYING. // ////////////////////////////////////////////////////////////////////// #ifndef DATA_H #define DATA_H struct ahost { char ip[20]; char host[20]; unsigned long in; unsigned long out; }; /* * init the data structure */ void data_init(); /* * Stores packet stats. This is mutex protected (from data_reset()). */ int data_store(char *src, char *dest, int size); /* * Get host[] array. No, we won't be doing any mutexed operations on it * via data_read() and data_write() functions. While i thought about this, * i decided, fuck it. It'll add unneccesary overhead, and who cares if * the data read is inconsistant? It'll be correct on the next read ... */ struct ahost *data_get(); /* * reset bytes in/out count. Mutexed from data_store(). Otherwise fields * may not be properly reset if the other thread is stopped halfway * through a bytes += packetsize; operation. */ void data_reset(); #endif