vnstat
2.9
About: vnStat is a console-based network traffic monitor (using the /proc filesystem).
![]() ![]() |
#include "dbsql.h"
Go to the source code of this file.
Macros | |
#define | UNITPREFIXCOUNT 7 |
Typedefs | |
typedef enum RequestType | RequestType |
typedef enum ListType | ListType |
Enumerations | |
enum | RequestType { RT_Normal = 1 , RT_Estimate , RT_ImageScale } |
enum | ListType { LT_None = 0 , LT_5min , LT_Hour , LT_Day , LT_Month , LT_Year , LT_Top } |
Functions | |
int | spacecheck (const char *path) |
void | sighandler (int sig) |
uint64_t | getbtime (void) |
char * | getvalue (const uint64_t bytes, const int len, const RequestType type) |
int | getunitspacing (const int len, const int index) |
char * | gettrafficrate (const uint64_t bytes, const time_t interval, const int len) |
const char * | getunitprefix (const int index) |
const char * | getrateunitprefix (const int unitmode, const int index) |
uint64_t | getunitdivisor (const int unitmode, const int index) |
int | getunit (void) |
char * | getratestring (const uint64_t rate, const int len, const int declen) |
int | getratespacing (const int len, const int unitmode, const int unitindex) |
int | getpadding (const int len, const char *str) |
void | cursortocolumn (const int column) |
void | cursorhide (void) |
void | cursorshow (void) |
void | eraseline (void) |
int | validatedatetime (const char *str) |
int | issametimeslot (const ListType listtype, const time_t entry, const time_t updated) |
uint64_t | getperiodseconds (const ListType listtype, const time_t entry, const time_t updated, const short isongoing) |
void | getestimates (uint64_t *rx, uint64_t *tx, const ListType listtype, const time_t updated, dbdatalist **dbdata) |
int | ishelprequest (const char *arg) |
typedef enum RequestType RequestType |
enum ListType |
enum RequestType |
void cursorhide | ( | void | ) |
Definition at line 341 of file misc.c.
Referenced by livetrafficmeter().
void cursorshow | ( | void | ) |
Definition at line 346 of file misc.c.
Referenced by livetrafficmeter().
void cursortocolumn | ( | const int | column | ) |
Definition at line 336 of file misc.c.
Referenced by livetrafficmeter(), and trafficmeter().
void eraseline | ( | void | ) |
Definition at line 351 of file misc.c.
Referenced by livetrafficmeter(), and trafficmeter().
uint64_t getbtime | ( | void | ) |
Definition at line 89 of file misc.c.
References debug, errorstring, noexit, printe(), and PT_Error.
Referenced by detectboot().
void getestimates | ( | uint64_t * | rx, |
uint64_t * | tx, | ||
const ListType | listtype, | ||
const time_t | updated, | ||
dbdatalist ** | dbdata | ||
) |
Definition at line 493 of file misc.c.
References dmonth(), isleapyear(), LT_5min, LT_Day, LT_Hour, LT_Month, LT_Year, mosecs(), dbdatalist::next, dbdatalist::rx, dbdatalist::timestamp, and dbdatalist::tx.
Referenced by drawlist(), showalert(), and showlist().
int getpadding | ( | const int | len, |
const char * | str | ||
) |
Definition at line 320 of file misc.c.
References cfg, and CFG::utflocale.
Referenced by drawlist(), drawsummary_digest(), showlist(), and showsummary().
uint64_t getperiodseconds | ( | const ListType | listtype, |
const time_t | entry, | ||
const time_t | updated, | ||
const short | isongoing | ||
) |
Definition at line 453 of file misc.c.
References dmonth(), isleapyear(), LT_5min, LT_Day, LT_Hour, LT_Month, LT_Top, LT_Year, and mosecs().
Referenced by drawlist(), showalert(), and showlist().
int getratespacing | ( | const int | len, |
const int | unitmode, | ||
const int | unitindex | ||
) |
Definition at line 308 of file misc.c.
References getrateunitprefix().
Referenced by getratestring().
char * getratestring | ( | const uint64_t | rate, |
const int | len, | ||
const int | declen | ||
) |
Definition at line 282 of file misc.c.
References DECCONV, getratespacing(), getrateunitprefix(), getunit(), getunitdivisor(), and UNITPREFIXCOUNT.
Referenced by gettrafficrate().
const char * getrateunitprefix | ( | const int | unitmode, |
const int | index | ||
) |
Definition at line 238 of file misc.c.
References UNITPREFIXCOUNT.
Referenced by getimagescale(), getratespacing(), and getratestring().
char * gettrafficrate | ( | const uint64_t | bytes, |
const time_t | interval, | ||
const int | len | ||
) |
Definition at line 203 of file misc.c.
References cfg, CFG::defaultdecimals, getratestring(), and CFG::rateunit.
Referenced by drawlist(), drawsummary_digest(), livetrafficmeter(), showalert(), showlist(), showoneline(), showsummary(), and trafficmeter().
int getunit | ( | void | ) |
Definition at line 269 of file misc.c.
References cfg, CFG::rateunit, CFG::rateunitmode, and CFG::unitmode.
Referenced by getimagescale(), getimagevalue(), getratestring(), and getscale().
uint64_t getunitdivisor | ( | const int | unitmode, |
const int | index | ||
) |
Definition at line 256 of file misc.c.
References UNITPREFIXCOUNT.
Referenced by getimagevalue(), getratestring(), getvalue(), and parsealertargs().
const char * getunitprefix | ( | const int | index | ) |
Definition at line 222 of file misc.c.
References cfg, CFG::unitmode, and UNITPREFIXCOUNT.
Referenced by getimagescale(), getunitspacing(), getvalue(), parsealertargs(), and showhours().
int getunitspacing | ( | const int | len, |
const int | index | ||
) |
char * getvalue | ( | const uint64_t | bytes, |
const int | len, | ||
const RequestType | type | ||
) |
Definition at line 148 of file misc.c.
References cfg, DECCONV, CFG::defaultdecimals, getunitdivisor(), getunitprefix(), getunitspacing(), RT_Estimate, RT_ImageScale, CFG::unitmode, and UNITPREFIXCOUNT.
Referenced by drawlist(), drawsummary_alltime(), drawsummary_digest(), livetrafficmeter(), showalert(), showlist(), showoneline(), and showsummary().
int ishelprequest | ( | const char * | arg | ) |
Definition at line 553 of file misc.c.
Referenced by parsealertargs(), and parseargs().
int issametimeslot | ( | const ListType | listtype, |
const time_t | entry, | ||
const time_t | updated | ||
) |
Definition at line 403 of file misc.c.
References LT_5min, LT_Day, LT_Hour, LT_Month, LT_None, LT_Top, and LT_Year.
Referenced by drawfiveminutes(), drawlist(), showlist(), and showsummary().
void sighandler | ( | int | sig | ) |
Definition at line 61 of file misc.c.
References debug, errorstring, intsignal, printe(), and PT_Info.
Referenced by livetrafficmeter(), and setsignaltraps().
int spacecheck | ( | const char * | path | ) |
Definition at line 20 of file misc.c.
References cfg, debug, errorstring, noexit, printe(), PT_Error, and CFG::spacecheck.
Referenced by db_open(), handleaddinterface(), and preparedatabase().
int validatedatetime | ( | const char * | str | ) |
Definition at line 357 of file misc.c.
Referenced by parseargs().