summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/throughput.h
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-08-05 10:32:16 +0000
committerbrian <brian@FreeBSD.org>1999-08-05 10:32:16 +0000
commit75000c38838f6ae4afe9de4dd06bd3fde6120e1b (patch)
tree26404e4742c87264dac32602be9ec171a2100df1 /usr.sbin/ppp/throughput.h
parentc32597f76112e043f5178c1c2237ad6d753da072 (diff)
downloadFreeBSD-src-75000c38838f6ae4afe9de4dd06bd3fde6120e1b.zip
FreeBSD-src-75000c38838f6ae4afe9de4dd06bd3fde6120e1b.tar.gz
o Obsolete the undocumented ``set weight'' command.
o If we're using RADIUS and the RADIUS mtu is less than our peers mru/mrru, reduce our mtu to this value for NetBSD too. o Make struct throughput's sample period dynamic and tweak the ppp version number to reflect the extra stuff being passed through the local domain socket as a result (MP mode). o Measure the current throughput based on the number of samples actually taken rather than on the full sample period. o Keep the throughput statisics persistent while being passed to another ppp invocation through the local domain socket. o When showing throughput statistics after the timer has stopped, use the stopped time for overall calculations, not the current time. Also show the stopped time and how long the current throughput has been sampled for. o Use time() consistently in throughput.c o Tighten up the ``show bundle'' output. o Introduce the ``set bandwidth'' command. o Rewrite the ``set autoload'' command. It now takes three arguments and works based on a rolling bundle throughput average compared against the theoretical bundle bandwidth over a given period (read: it's now functional).
Diffstat (limited to 'usr.sbin/ppp/throughput.h')
-rw-r--r--usr.sbin/ppp/throughput.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/usr.sbin/ppp/throughput.h b/usr.sbin/ppp/throughput.h
index 85003f5..256a842 100644
--- a/usr.sbin/ppp/throughput.h
+++ b/usr.sbin/ppp/throughput.h
@@ -23,35 +23,44 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: throughput.h,v 1.5 1998/06/12 20:12:26 brian Exp $
+ * $Id: throughput.h,v 1.6 1999/05/08 11:07:49 brian Exp $
*/
-#define SAMPLE_PERIOD 5
+#define SAMPLE_PERIOD 5 /* Default sample period */
#define THROUGHPUT_OVERALL 0x0001
#define THROUGHPUT_CURRENT 0x0002
#define THROUGHPUT_PEAK 0x0004
-#define THROUGHPUT_ALL THROUGHPUT_OVERALL | THROUGHPUT_CURRENT \
- | THROUGHPUT_PEAK
+#define THROUGHPUT_ALL 0x0007
struct pppThroughput {
- time_t uptime;
+ time_t uptime, downtime;
unsigned long long OctetsIn;
unsigned long long OctetsOut;
- unsigned long long SampleOctets[SAMPLE_PERIOD];
+ int SamplePeriod;
+ unsigned long long *SampleOctets;
unsigned long long OctetsPerSecond;
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 *);
+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 *);
OpenPOWER on IntegriCloud