#define SAMPLE_PERIOD 5
#define THROUGHPUT_OVERALL 0x0001
#define THROUGHPUT_CURRENT 0x0002
#define THROUGHPUT_PEAK 0x0004
#define THROUGHPUT_ALL 0x0007
struct pppThroughput {
time_t uptime, downtime;
unsigned long long OctetsIn;
unsigned long long OctetsOut;
unsigned long long PacketsIn;
unsigned long long PacketsOut;
int SamplePeriod;
struct {
unsigned long long *SampleOctets;
unsigned long long OctetsPerSecond;
} in, out;
unsigned long long BestOctetsPerSecond;
time_t BestOctetsPerSecondTime;
int nSample;
unsigned rolling : 1;
struct pppTimer Timer;
struct {
void *data;
void (*fn)(void *v);
} callback;
};
extern void throughput_init(struct pppThroughput *, int);
extern void throughput_destroy(struct pppThroughput *);
extern void throughput_disp(struct pppThroughput *, struct prompt *);
extern void throughput_log(struct pppThroughput *, int, const char *);
extern void throughput_start(struct pppThroughput *, const char *, int);
extern void throughput_restart(struct pppThroughput *, const char *, int);
extern void throughput_stop(struct pppThroughput *);
extern void throughput_addin(struct pppThroughput *, long long);
extern void throughput_addout(struct pppThroughput *, long long);
extern void throughput_clear(struct pppThroughput *, int, struct prompt *);
extern void throughput_callback(struct pppThroughput *, void (*)(void *),
void *);
extern int throughput_uptime(struct pppThroughput *);