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
|
#ifndef _sinfo_h
#define _sinfo_h
#include <string>
#include <time.h>
#include <netinet/in.h>
#include <list>
#include "cpustat.h"
#include "cpuinfo.h"
#include "loadavg.h"
#include "meminfo.h"
#include "netload.h"
#include "diskload.h"
#include "uname.h"
#include "uptime.h"
#include "users.h"
#include "procinfo.h"
/*
#The Well Known Ports are those from 0 through 1023.
#
#The Registered Ports are those from 1024 through 49151
#
#The Dynamic and/or Private Ports are those from 49152 through 65535
*/
// port for udp broadcast and tcp queries
#define SINFO_REQUEST_PORT @SINFO_REQUEST_PORT@
#define SINFO_REQUEST_PORT_STRING "@SINFO_REQUEST_PORT@"
#define SINFO_BROADCAST_PORT @SINFO_BROADCAST_PORT@
#define SINFO_BROADCAST_PORT_STRING "@SINFO_BROADCAST_PORT@"
struct Wsinfo
{
// set in broadcastreceiver
time_t lastheard;
std::string inetaddr;
std::string name;
time_t name_time;
// transmitted
Loadavg loadavg;
Meminfo meminfo;
Cpustat cpustat;
Cpuinfo cpuinfo;
Uptime uptime;
Users users;
ProcinfoList procinfoList;
Unameinfo unameinfo;
Netload netload;
Diskload diskload;
std::string marker;
};
bool operator<(const Wsinfo& a, const Wsinfo& b);
#endif // _sinfo_h
|