File: pload.c

package info (click to toggle)
pload 0.9.5-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 208 kB
  • ctags: 96
  • sloc: ansic: 897; makefile: 88; sh: 63
file content (707 lines) | stat: -rw-r--r-- 18,130 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
/*
    This file is part of pload - a program to monitor ppp activity for X
    Copyright (C) 1999-2000  Matt Smith <mdsmith@engr.utk.edu>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/Label.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/StripChart.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "pload.h"
#include "pload.xbm"

/************* Function Prototypes ********/
static void GetIChartPoint(Widget,XtPointer,XtPointer);
static void GetOChartPoint(Widget,XtPointer,XtPointer);
static void Usage(void);
static void HandleExit(void);
static void CheckForWMExit(Widget, XtPointer, XEvent*, Boolean*);
static void CheckForIconState(Widget, XtPointer, XEvent*, Boolean*);
static void update(XtPointer, XtIntervalId*);
static void make_label(char*,unsigned long,double,double);
static void do_rate(char*,double);
static void do_total(char*, double);

/************* Global Variables **********/
static char		progver[]= VERSION;
static char		buff[128];
static if_data 		ifd;
static XtAppContext 	context;
static Widget		toplevel, topform, iform, oform;
static Widget		ilabel, ichart, ochart, olabel;
static Arg		arglist[8];
static int		i;
static Atom 		wm_delete_window;
static char		*Progname;
static int		iconstate;
static XrmOptionDescRec options[] =
{
{"-minscale",	"*minScale",		XrmoptionSepArg,	NULL},
{"-indiv",	"*inDiv",		XrmoptionSepArg,	(XtPointer)1024},
{"-outdiv",	"*outDiv",		XrmoptionSepArg,	(XtPointer)1024},
{"-hl",		"*highlight",		XrmoptionSepArg,	NULL},
{"-jumpscroll",	"*jumpScroll",		XrmoptionSepArg,	NULL},
{"-update",	"*update",		XrmoptionSepArg,	NULL},
{"-in",		"*showOut",		XrmoptionNoArg,		"False"},
{"-out",	"*showIn",		XrmoptionNoArg,		"False"},
{"-nolabel",	"*showLabel",		XrmoptionNoArg,		"False"},
{"-device",	"*device",		XrmoptionSepArg,	NULL},
{"-incolor",	"*ichart.foreground",	XrmoptionSepArg,	NULL},
{"-outcolor",	"*ochart.foreground",	XrmoptionSepArg,	NULL},
{"-average",	"*averagePoints",	XrmoptionSepArg,	(XtPointer)10},
{"-horiz",	"*horiz",		XrmoptionNoArg,		"True"},
{"-nochart",	"*showChart",		XrmoptionNoArg,		"False"},
{"-logscale",	"*logScale",		XrmoptionNoArg,		"True"},
#ifdef LINUXPROC
{"-noproc",	"*useProc",		XrmoptionNoArg,		"False"},
#endif
{"-ncmsg",	"*noConnectMsg",	XrmoptionSepArg,	NULL},
{"-iformat",	"*inFormat",		XrmoptionSepArg,	NULL},
{"-oformat",	"*outFormat",		XrmoptionSepArg,	NULL},
};
static String default_resources[] =
{
#if 0
	"*minscale		:	3",
	"*ilabel.background	:	red",
	"*olabel.background	:	lightblue",
	"*ochart.background	:	pink",
	"*ichart.background	:	yellow",
#endif
	"*update		:	1",
	"*ichart.foreground	:	red",
	"*ichart.jumpScroll	:	1",
	"*ochart.foreground	:	darkgreen",
	"*ochart.jumpScroll	:	1",
	"*topform*borderWidth	:	0",
/*	"*topform*font		:	fixed",   */
/*	"*Pload.geometry	:	180x200", */	 /* vertical   */
/*	"*Pload.geometry	:	300x120", */	/* horizontal */
/*	"*Pload.geometry	:	180x35",  */	/* labels only */
	"*showIn		:	True",
	"*showOut		:	True",
	"*device		:	ppp0",
	"*showLabel		:	True",
	"*averagePoints		:	10",
	"*inDiv			:	1024",
	"*outDiv		:	1024",
	"*horiz			:	False",
	"*showChart		:	True",
	"*logScale		:	False",
#ifdef LINUXPROC
	"*useProc		:	True",
#endif
	"*noConnectMsg		:	No Connection",
	"*inFormat		:	%t %r in",
	"*outFormat		:	%t %r out",
NULL};

typedef struct
{
	String device;
	String ncMsg;
	String ifmt;
	String ofmt;
	Boolean showIn;
	Boolean showOut;
	Boolean showLabel;
	Boolean horiz;
	Boolean showChart;
#ifdef LINUXPROC
	Boolean useProc;
#endif
	Boolean logScale;
	int avgpts;
	int indiv;
	int outdiv;
	int update;
} PloadResources;

/* another global */
static PloadResources resources;

static XtResource pload_resources[] = {
{
	"averagePoints",		/* Resource name */
	"AveragePoints",		/* Resource class */
	XtRInt,				/* Represenation type */
	sizeof(int),			/* size of representation type */
     	XtOffsetOf(PloadResources, avgpts), /* Offset from base */
	XtRImmediate,			/* Representation of specified default */
	(XtPointer)10			/* Address of default resource */
},
{
	"logScale",		
	XtCBoolean,			
	XtRBoolean,			
	sizeof(Boolean),	
     	XtOffsetOf(PloadResources, logScale), 
	XtRImmediate,		
	(XtPointer)False
},
{
	"showChart",		
	XtCBoolean,			
	XtRBoolean,			
	sizeof(Boolean),	
     	XtOffsetOf(PloadResources, showChart), 
	XtRImmediate,		
	(XtPointer)True
},
{
	"update",
	"Update",
	XtRInt,
	sizeof(int),
     	XtOffsetOf(PloadResources, update),
	XtRImmediate,
	(XtPointer)1
},
#ifdef LINUXPROC
{
	"useProc",
	XtCBoolean,
	XtRBoolean,
	sizeof(Boolean),
     	XtOffsetOf(PloadResources, useProc),
	XtRImmediate,	
	(XtPointer)True
},
#endif
{
	"horiz",
	XtCBoolean,
	XtRBoolean,
	sizeof(Boolean),
     	XtOffsetOf(PloadResources, horiz),
	XtRImmediate,	
	(XtPointer)False
},
{
	"inDiv",
	"InDiv",
	XtRInt,
	sizeof(int),
     	XtOffsetOf(PloadResources, indiv),
	XtRImmediate,
	(XtPointer)1024
},
{
	"outDiv",
	"OutDiv",
	XtRInt,
	sizeof(int),
     	XtOffsetOf(PloadResources, outdiv),
	XtRImmediate,
	(XtPointer)1024
},
{
	"device",			
	XtCString,		
	XtRString,		
	sizeof(String),		
     	XtOffsetOf(PloadResources, device),
	XtRString,		
	"ppp0"				
},
{
	"noConnectMsg",			
	XtCString,		
	XtRString,		
	sizeof(String),		
     	XtOffsetOf(PloadResources, ncMsg),
	XtRString,		
	"No Connection"				
},
{
	"inFormat",			
	XtCString,		
	XtRString,		
	sizeof(String),		
     	XtOffsetOf(PloadResources, ifmt),
	XtRString,		
	"%t %r in"				
},
{
	"outFormat",			
	XtCString,		
	XtRString,		
	sizeof(String),		
     	XtOffsetOf(PloadResources, ofmt),
	XtRString,		
	"%t %r out"				
},
{
	"showLabel",			
	XtCBoolean,		
	XtRBoolean,			
	sizeof(Boolean),		
     	XtOffsetOf(PloadResources, showLabel), 
	XtRImmediate,			
	(XtPointer)True		
},
{
	"showIn",		
	XtCBoolean,			
	XtRBoolean,			
	sizeof(Boolean),	
     	XtOffsetOf(PloadResources, showIn), 
	XtRImmediate,		
	(XtPointer)True
},
{
	"showOut",
	XtCBoolean,
	XtRBoolean,
	sizeof(Boolean),
     	XtOffsetOf(PloadResources, showOut),
	XtRImmediate,
	(XtPointer)True
}
};

/************* Main () ******************/
int main (int argc, char *argv[])
{
	Progname = argv[0];
	
	toplevel = XtAppInitialize (
		&context,			/* context */
		"Pload",			/* app name, class */
		options,			/* options */
		XtNumber(options),		/* num_options */
		&argc, argv,			/* command line */
		default_resources,		/* fallback resources */
		NULL, ZERO);
	
	/* all command line options are handled as X resources,
	   if an unknown option, like "-help" is found, show usage
	   and exit */	
	if (argc != 1) Usage();
	
	XtGetApplicationResources(
		toplevel,			/* widget */
		(XtPointer) &resources, 	/* where to put */
		pload_resources,		/* XtResourceList */
		XtNumber(pload_resources),	/* Cardinal num_resources */
		NULL, ZERO);
	
	/* set the title to reflect the device monitored */
	i=0;
	sprintf(buff, "Pload: %s", resources.device);
	XtSetArg(arglist[i], XtNtitle, buff); i++;
	XtSetValues(toplevel, arglist, i);

#ifdef LINUXPROC
	ifd_initialize(&ifd, resources.device,
		resources.avgpts,resources.useProc);
#else
	ifd_initialize(&ifd, resources.device,
		resources.avgpts,0);
#endif
		
	/* set the default icon */
	i=0;
	XtSetArg(
		arglist[i],				/* Arg */
		XtNiconPixmap,				/* String name */
		XCreateBitmapFromData(			/* XtArgVal */
			XtDisplay(toplevel),		/* Display* */
			XtScreen(toplevel)->root,	/* Drawable d */
			(char *)pload_bits,		/* char *data */
			pload_width,			/* unsigned */
			pload_height)); i++;		/* unsigned */
	
	XtSetValues(toplevel, arglist, i);
	
	/* get notified of a change in icon state */
	XtAddEventHandler(
			toplevel,		/* Widget w */
			StructureNotifyMask,	/* EventMask mask */
			False,			/* Boolean nonmaskable */
			CheckForIconState,	/* XtEventHandler proc */
			NULL);			/* XtPointer client_data */
			
	/******* create the topform widget *************/
	i=0;
	XtSetArg(arglist[i], XtNdefaultDistance, 0); i++;
	topform = XtCreateManagedWidget (
		"topform", formWidgetClass,
		toplevel,
		arglist, i);
	
	/******* create two more forms ***************/
	if (resources.showIn)
	{
		i=0;
		XtSetArg(arglist[i], XtNdefaultDistance, 0); i++;
		XtSetArg(arglist[i], XtNbottom, XawRubber); i++;
		XtSetArg(arglist[i], XtNresizable, True); i++;
		
		iform = XtCreateManagedWidget (
			"iform", formWidgetClass,
			topform,
			arglist, i);
	}
	if (resources.showOut)
	{
		i=0;
		XtSetArg(arglist[i], XtNdefaultDistance, 0); i++;
		XtSetArg(arglist[i], XtNtop, XawRubber); i++;
		XtSetArg(arglist[i], XtNresizable, True); i++;
		if (resources.showIn)
		{
			if (resources.horiz)
			{
				XtSetArg(arglist[i], XtNfromHoriz, iform);
				i++;
			}
			else
			{
				XtSetArg(arglist[i], XtNfromVert, iform);
				i++;
			}
		}
		oform = XtCreateManagedWidget (
			"oform", formWidgetClass,
			topform,
			arglist, i);
	}
	/* Gee, were those if statements tacked on later ? */
	if (resources.showIn)
	{
		if (resources.showLabel)
		{
	/* create a label widget */
	i=0;
	/* XtSetArg(arglist[i], XtNlabel, "starting..."); i++; */
	XtSetArg(arglist[i], XtNjustify, XtJustifyLeft); i++;
	XtSetArg(arglist[i], XtNbottom, XawChainTop); i++;
	XtSetArg(arglist[i], XtNtop, XawChainTop); i++;
	XtSetArg(arglist[i], XtNresizable, True); i++; 
	ilabel = XtCreateManagedWidget (
		"ilabel", labelWidgetClass,	/* name, widgetclass */
		iform,				/* parent */
		arglist, i );			/* arglist, num_args */
		}
		if (resources.showChart)
		{
	/* create a stripchart widget */
	i=0;
	if (resources.showLabel)
	{
		XtSetArg(arglist[i], XtNfromVert, ilabel); i++;
	}
	XtSetArg(arglist[i], XtNtop, XawChainTop); i++;
	ichart = XtCreateManagedWidget (
		"ichart", stripChartWidgetClass,/* name, widgetclass */
		iform,				/* parent */
		arglist, i );			/* arglist, num_args */
	
	/* add a callback for the stripchart */
	XtAddCallback(
		ichart,				/* widget */
		XtNgetValue,			/* callback name */
		GetIChartPoint,			/* callback proc */
		NULL );				/* client data */
		}
	}
		
	if (resources.showOut)
	{
		if (resources.showLabel)
		{
	/***********************************************************/
	/* create another label widget */
	i=0;
	/* XtSetArg(arglist[i], XtNlabel, "starting..."); i++; */
	XtSetArg(arglist[i], XtNjustify, XtJustifyLeft); i++;
	XtSetArg(arglist[i], XtNbottom, XawChainTop); i++;
	XtSetArg(arglist[i], XtNtop, XawChainTop); i++;
	XtSetArg(arglist[i], XtNresizable, True); i++;
	olabel = XtCreateManagedWidget (
		"olabel", labelWidgetClass,	/* name, widgetclass */
		oform,				/* parent */
		arglist, i );			/* arglist, num_args */
		}
	/**********************************************************/
	/* add another stripchart */
		if (resources.showChart)
		{
	i=0;
	if (resources.showLabel)
	{
		XtSetArg(arglist[i], XtNfromVert, olabel); i++;
	}
	XtSetArg(arglist[i], XtNtop, XawChainTop); i++;
	ochart = XtCreateManagedWidget (
		"ochart", stripChartWidgetClass,/* name, widgetclass */
		oform,				/* parent */
		arglist, i );			/* arglist, num_args */
	/* add a callback for the stripchart */
	XtAddCallback(
		ochart,				/* widget */
		XtNgetValue,			/* callback name */
		GetOChartPoint,			/* callback proc */
		NULL );				/* client data */
		}
	}
	
	/* manage and realize initial widget tree */
	XtRealizeWidget(toplevel);
	
	/* register interest in WM_DELETE_WINDOW */
	HandleExit();
	
	/* manually update */
	update(0,0);
	
	/* submit to the great X */
	XtAppMainLoop(context);
	return 0;
}

void update(XtPointer data, XtIntervalId *id)
{
	
	get_stat(&ifd);
	
	if ( 	(resources.showLabel && resources.showIn) ||
		(iconstate == IconicState) )
	{
		if (ifd.in_bytes == 0UL)
			sprintf(buff,"%s",resources.ncMsg);
		else
			make_label(resources.ifmt, ifd.in_bytes,
				ifd.in_rate, ifd.in_max);
	}
	
	if ( resources.showLabel && resources.showIn )	
		XtVaSetValues(ilabel, XtNlabel, buff, NULL);
	
	if (iconstate == IconicState)
		XtVaSetValues(toplevel, XtNiconName, buff, NULL);
		
	if (resources.showLabel && resources.showOut)
	{
		if (ifd.out_bytes == 0UL)
			sprintf(buff,"%s",resources.ncMsg);
		else
			make_label(resources.ofmt, ifd.out_bytes,
				ifd.out_rate, ifd.out_max);
		
		XtVaSetValues(olabel, XtNlabel, buff, NULL);
	}
	
	XtAppAddTimeOut(context, 1000*resources.update, update, NULL);
	return;
}

void GetIChartPoint( Widget w,			/* not used */
		    XtPointer client_data,	/* not used */
		    XtPointer call_data)	/* *double point to return */
{
	/* the update function handles refreshing the interface data */
	double d = ifd.in_rate / (double)resources.indiv;
	
	if (resources.logScale) d = (d < 1.0) ? 0.0 : log10(d);
	
	*(double *)call_data = d;
 	return;
}

void GetOChartPoint( Widget w,			/* not used */
		    XtPointer client_data,	/* not used */
		    XtPointer call_data)	/* *double point to return */
{
	double d = ifd.out_rate / (double)resources.outdiv;
	
	if (resources.logScale) d = (d < 1.0) ? 0.0 : log10(d);
	
	*(double *)call_data = d;
	return;
}


void HandleExit()
{
	wm_delete_window = XInternAtom(
		XtDisplay(toplevel),		/* Display *display */
		"WM_DELETE_WINDOW",		/* char *atom_name */
		False);				/* Bool only_if_exits */
	(void)XSetWMProtocols(		
		XtDisplay(toplevel),		/* Display *display */
		XtWindow(toplevel),		/* Window w */
		&wm_delete_window,		/* Atom *protocols */
		1);				/* int count */
	XtAddEventHandler(			
		toplevel,			/* Widget w */
		NoEventMask,			/* EventMask mask */
		True,				/* Bool nonmaskable */
		CheckForWMExit,			/* XtEventHandler */
		NULL);				/* XtPointer client_data */
}

void CheckForIconState(	Widget w, 
			XtPointer client_data, 
			XEvent *event, 
			Boolean *dispatch)
{
	switch(event->type)
	{
		case UnmapNotify:	iconstate = IconicState; break;
		case MapNotify:		iconstate = NormalState;
		default:		break;
	}
}

void CheckForWMExit(	Widget w, 
			XtPointer client_data, 
			XEvent *event, 
			Boolean *dispatch)
{
	if ((event->type == ClientMessage) &&
	(event->xclient.data.l[0] == wm_delete_window))
	{
		/* unload */
		ifd_stop(&ifd);
		XtDestroyApplicationContext(XtWidgetToApplicationContext(w));
		exit(EXIT_SUCCESS);
	}
	return;
}

void do_total(char *b, double total)
{
	if (total < 1024.0)
		sprintf(b, "%s%0.0f b", b, total);
	else if (total < (1024.0*1024.0))
		sprintf(b, "%s%0.2f k", b, total/1024.0);
	else if (total < (1024.0*1024.0*1024.0))
		sprintf(b, "%s%0.2f M", b, total/1024.0/1024.0);
	else
		sprintf(b, "%s%0.2f G", b, total/1024.0/1024.0/1024.0);
	
	return;
}

void do_rate(char *b, double rate)
{
	if (rate < 1024.0)
		sprintf(b, "%s%0.0f b/s",b, rate);
	else if (rate < (1024.0*1024.0))
		sprintf(b, "%s%0.2f k/s",b, rate/1024.0);
	else if (rate < (1024.0*1024.0*1024.0))
		sprintf(b, "%s%0.2f M/s",b, rate/1024.0/1024.0);
	else
		sprintf(b, "%s%0.2f G/s", b, rate/1024.0/1024.0/1024.0);
	return;
}

/* stores label in global 'buff' */
void make_label(char *fmt, unsigned long total, double rate, double max)
{
	char *p;
	int i;
	
	*buff = '\0';
	
	for(p=fmt;*p;p++)
	{
		if (*p == '%')
		{
			p++;
			switch(*p)
			{
				case 't':
					do_total(buff, (double)total);
					break;
				case 'r':
					do_rate(buff, rate);
					break;
				case 'M':
					do_rate(buff, max);
					break;
				case '%':	/* literal % */
					i = strlen(buff);
					*(buff + i) = *p;
					*(buff + i+1) = '\0';
					break;
				default:
					fprintf(stderr,
					"Unknown format specifier: %%%c\n",*p);
					break;
			}
		}
		else
		{
			/* sprintf(buf, "%s%c", buf, *p); */
			i = strlen(buff);
			*(buff + i) = *p;
			*(buff + i+1) = '\0'; 
		}
		assert(strlen(buff) < sizeof(buff));
	}
	return;
}

void Usage()
{
	fprintf(stderr,
"\n%s : show data for a network interface (ppp)\n", progver);
	fprintf(stderr,
"Usage: %s [options]\n", Progname);
	fprintf(stderr,
" where options includes, in addition to standard toolkit options,\n"
" option            default     description\n"
" -indiv <n>       : 1024      : show dividing lines every n bytes/s for in data\n"
" -outdiv <n>      : 1024      : show dividing lines every n bytes/s for out data\n"
" -logscale        : False     : use base 10 logarithmic scale for rate charts\n"
" -minscale <n>    : 1         : minimum chart scale n\n"
" -jumpscroll <n>  : 1         : jump n pixels on new data, 1 for smooth\n"
" -update <n>      : 1         : update chart every n seconds\n"
" -in              : False     : only show receive chart\n"
" -out             : False     : only show send chart\n"
" -horiz           : False     : arrange horizontally\n"
" -nolabel         : False     : don't show text labels\n"
" -nochart         : False     : don't show charts (labels only)\n"
" -average <n>     : 10        : average data over n points, 1 for no average\n"
" -device <X>      : ppp0      : monitor device X\n"
" -hl <color>      : default   : chart highlight color\n"
" -incolor <color> : red       : receive chart foreground color\n"
" -outcolor <color>: darkgreen : send chart foreground color\n"
" -fg <color>      : default   : foreground color\n"
" -bg <color>      : default   : background color\n"
" -fn <fontspec>   : default   : label font\n"
#ifdef LINUXPROC
" -noproc          : False     : don't use proc interface, use ioctl\n"
#endif
" -iformat <fmt>   : %%t %%r in  : format for inbound label\n"
" -oformat <fmt>   : %%t %%r out : format for outbound label\n"
" -ncmsg <message> : No Connection : label to show when offline\n"
"\nsee the manual page for more information\n\n");
	
	exit(EXIT_FAILURE);
}