"Fossies" - the Fresh Open Source Software Archive

Member "vnstat-2.9/src/daemon.h" (15 Aug 2021, 1422 Bytes) of package /linux/misc/vnstat-2.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "daemon.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.7_vs_2.8.

    1 #ifndef DAEMON_H
    2 #define DAEMON_H
    3 
    4 typedef struct {
    5     int updateinterval, saveinterval;
    6     short running, dodbsave, rundaemon;
    7     short dbsaved, showhelp, sync, forcesave, noadd, initdb;
    8     short bootdetected, cleanuphour, dbretrycount;
    9     uint32_t iflisthash;
   10     uint64_t dbifcount;
   11     char cfgfile[512];
   12     char user[33], group[33];
   13     time_t current, prevdbupdate, prevdbsave, prevwaldbcheckpoint;
   14     datacache *dcache;
   15 } DSTATE;
   16 
   17 void daemonize(void);
   18 void debugtimestamp(void);
   19 
   20 unsigned int addinterfaces(DSTATE *s);
   21 void initdstate(DSTATE *s);
   22 void preparedatabase(DSTATE *s);
   23 unsigned int importlegacydbs(DSTATE *s);
   24 void setsignaltraps(void);
   25 void filldatabaselist(DSTATE *s);
   26 void adjustsaveinterval(DSTATE *s);
   27 void checkdbsaveneed(DSTATE *s);
   28 void processdatacache(DSTATE *s);
   29 void processdatalist(DSTATE *s);
   30 void handleintsignals(DSTATE *s);
   31 void preparedirs(DSTATE *s);
   32 void detectboot(DSTATE *s);
   33 
   34 int initcachevalues(DSTATE *s, datacache **dc);
   35 int processifinfo(DSTATE *s, datacache **dc);
   36 void flushcachetodisk(DSTATE *s);
   37 void handledatabaseerror(DSTATE *s);
   38 void cleanremovedinterfaces(DSTATE *s);
   39 void rescandatabaseforinterfaces(DSTATE *s);
   40 
   41 void datacache_status(datacache **dc);
   42 
   43 void interfacechangecheck(DSTATE *s);
   44 uint32_t simplehash(const char *data, int len);
   45 
   46 void errorexitdaemon(DSTATE *s, const int fataldberror) __attribute__((noreturn));
   47 
   48 short getcurrenthour(void);
   49 int waittimesync(DSTATE *s);
   50 
   51 #endif