vnstat
2.9
About: vnStat is a console-based network traffic monitor (using the /proc filesystem).
![]() ![]() |
#include <gd.h>
#include <gdfontt.h>
#include <gdfonts.h>
#include <gdfontmb.h>
#include <gdfontl.h>
#include <gdfontg.h>
Go to the source code of this file.
Data Structures | |
struct | IMAGECONTENT |
struct | HOURDATA |
Macros | |
#define | YBEGINOFFSET (-1) |
#define | FIVEMINHEIGHTOFFSET 4 |
#define | FIVEMINWIDTHFULLPADDING 10 |
#define | FIVEMINWIDTHPADDING 2 |
#define | FIVEMINEXTRASPACE 78 |
#define | SCALEMINPIXELS 25 |
Functions | |
void | initimagecontent (IMAGECONTENT *ic) |
void | drawimage (IMAGECONTENT *ic) |
int | drawhours (IMAGECONTENT *ic, const int xpos, const int ypos, const int rate) |
void | drawhourly (IMAGECONTENT *ic, const int rate) |
void | drawlist (IMAGECONTENT *ic, const char *listname) |
void | drawsummary (IMAGECONTENT *ic, const int layout, const int rate) |
void | drawsummary_alltime (IMAGECONTENT *ic, const int x, const int y) |
void | drawsummary_digest (IMAGECONTENT *ic, const int x, const int y, const char *mode) |
void | drawfivegraph (IMAGECONTENT *ic, const int rate, const int resultcount, const int height) |
int | drawfiveminutes (IMAGECONTENT *ic, const int xpos, const int ypos, const int rate, const int resultcount, const int height) |
void drawfivegraph | ( | IMAGECONTENT * | ic, |
const int | rate, | ||
const int | resultcount, | ||
const int | height | ||
) |
Definition at line 903 of file image.c.
References drawfiveminutes(), drawlegend(), FIVEMINEXTRASPACE, imageinit(), IMAGECONTENT::large, layoutinit(), and IMAGECONTENT::showheader.
Referenced by drawimage().
int drawfiveminutes | ( | IMAGECONTENT * | ic, |
const int | xpos, | ||
const int | ypos, | ||
const int | rate, | ||
const int | resultcount, | ||
const int | height | ||
) |
Definition at line 921 of file image.c.
References IMAGECONTENT::cbgoffset, cfg, IMAGECONTENT::cline, IMAGECONTENT::clinel, dbdatalistinfo::count, IMAGECONTENT::crx, IMAGECONTENT::ctext, IMAGECONTENT::ctx, db_getdata(), dbdatalistfree(), debug, drawarrowright(), drawarrowup(), drawpole(), FIVEMINEXTRASPACE, FIVEMINHEIGHTOFFSET, FIVEMINWIDTHFULLPADDING, FIVEMINWIDTHPADDING, IMAGECONTENT::font, getimagescale(), getimagevalue(), getscale(), IMAGECONTENT::im, IMAGECONTENT::interface, issametimeslot(), IMAGECONTENT::large, LT_5min, dbdatalistinfo::maxrx, dbdatalistinfo::maxtime, dbdatalistinfo::maxtx, dbdatalistinfo::mintime, interfaceinfo::name, CFG::rateunit, SCALEMINPIXELS, and interfaceinfo::updated.
Referenced by drawfivegraph(), and drawsummary().
void drawhourly | ( | IMAGECONTENT * | ic, |
const int | rate | ||
) |
Definition at line 284 of file image.c.
References drawhours(), drawlegend(), imageinit(), IMAGECONTENT::large, layoutinit(), and IMAGECONTENT::showheader.
Referenced by drawimage().
int drawhours | ( | IMAGECONTENT * | ic, |
const int | xpos, | ||
const int | ypos, | ||
const int | rate | ||
) |
Definition at line 108 of file image.c.
References cfg, IMAGECONTENT::cline, IMAGECONTENT::clinel, dbdatalistinfo::count, IMAGECONTENT::ctext, IMAGECONTENT::current, HOURDATA::date, db_getdata_range(), dbdatalistfree(), drawarrowright(), drawarrowup(), drawpoles(), IMAGECONTENT::font, getimagescale(), getimagevalue(), getscale(), CFG::hourlygmode, IMAGECONTENT::im, IMAGECONTENT::interface, IMAGECONTENT::large, interfaceinfo::name, CFG::rateunit, HOURDATA::rx, SCALEMINPIXELS, HOURDATA::tx, and interfaceinfo::updated.
Referenced by drawhourly(), and drawsummary().
void drawimage | ( | IMAGECONTENT * | ic | ) |
Definition at line 25 of file image.c.
References IMAGECONTENT::cbackground, cfg, drawfivegraph(), drawhourly(), drawlist(), drawsummary(), CFG::fivegheight, CFG::fivegresultcount, CFG::hourlyrate, IMAGECONTENT::im, CFG::qmode, and CFG::transbg.
Referenced by main().
void drawlist | ( | IMAGECONTENT * | ic, |
const char * | listname | ||
) |
Definition at line 304 of file image.c.
References CFG::barshowsrate, IMAGECONTENT::cbgoffset, cfg, IMAGECONTENT::cline, dbdatalistinfo::count, IMAGECONTENT::ctext, IMAGECONTENT::databegin, IMAGECONTENT::dataend, db_getdata_range(), dbdatalistfree(), CFG::dformat, drawbar(), drawlegend(), CFG::estimatestyle, IMAGECONTENT::font, getestimates(), getpadding(), getperiodseconds(), gettrafficrate(), getvalue(), IMAGECONTENT::im, imageinit(), IMAGECONTENT::interface, issametimeslot(), IMAGECONTENT::large, layoutinit(), IMAGECONTENT::lineheight, CFG::linespaceadjust, CFG::listdays, CFG::listfivemins, CFG::listhours, CFG::listmonths, CFG::listtop, CFG::listyears, LT_5min, LT_Day, LT_Hour, LT_Month, LT_None, LT_Top, LT_Year, dbdatalistinfo::max, CFG::mformat, interfaceinfo::name, CFG::ostyle, RT_Estimate, RT_Normal, IMAGECONTENT::showheader, strncpy_nt(), dbdatalistinfo::sumrx, dbdatalistinfo::sumtx, CFG::tformat, and interfaceinfo::updated.
Referenced by drawimage().
void drawsummary | ( | IMAGECONTENT * | ic, |
const int | layout, | ||
const int | rate | ||
) |
Definition at line 633 of file image.c.
References cfg, IMAGECONTENT::ctext, drawfiveminutes(), drawhours(), drawlegend(), drawsummary_alltime(), drawsummary_digest(), IMAGECONTENT::font, IMAGECONTENT::im, imageinit(), IMAGECONTENT::interface, IMAGECONTENT::large, layoutinit(), IMAGECONTENT::lineheight, interfaceinfo::rxtotal, IMAGECONTENT::showheader, CFG::summarygraph, and interfaceinfo::txtotal.
Referenced by drawimage().
void drawsummary_alltime | ( | IMAGECONTENT * | ic, |
const int | x, | ||
const int | y | ||
) |
Definition at line 698 of file image.c.
References cfg, interfaceinfo::created, IMAGECONTENT::ctext, IMAGECONTENT::font, getvalue(), IMAGECONTENT::im, IMAGECONTENT::interface, IMAGECONTENT::large, IMAGECONTENT::lineheight, RT_Normal, interfaceinfo::rxtotal, CFG::tformat, and interfaceinfo::txtotal.
Referenced by drawsummary().
void drawsummary_digest | ( | IMAGECONTENT * | ic, |
const int | x, | ||
const int | y, | ||
const char * | mode | ||
) |
Definition at line 727 of file image.c.
References cfg, IMAGECONTENT::ctext, IMAGECONTENT::current, db_getdata(), dbdatalistfree(), CFG::dformat, dmonth(), drawdonut(), IMAGECONTENT::font, getpadding(), gettrafficrate(), getvalue(), IMAGECONTENT::im, IMAGECONTENT::interface, IMAGECONTENT::large, IMAGECONTENT::lineheight, CFG::mformat, mosecs(), interfaceinfo::name, dbdatalist::next, RT_Normal, dbdatalist::rx, strncpy_nt(), CFG::summaryrate, dbdatalist::timestamp, dbdatalist::tx, and interfaceinfo::updated.
Referenced by drawsummary().
void initimagecontent | ( | IMAGECONTENT * | ic | ) |
Definition at line 8 of file image.c.
References interfaceinfo::alias, IMAGECONTENT::altdate, IMAGECONTENT::databegin, IMAGECONTENT::dataend, IMAGECONTENT::font, IMAGECONTENT::headertext, IMAGECONTENT::im, IMAGECONTENT::interface, IMAGECONTENT::large, IMAGECONTENT::lineheight, interfaceinfo::name, IMAGECONTENT::showedge, IMAGECONTENT::showheader, and IMAGECONTENT::showlegend.
Referenced by main().