blob: d9d1a115aa263660708aab648f1503805f8e2a94 [file] [log] [blame]
Harald Welte3e5ab692018-06-04 04:26:20 +02001#pragma once
2
3#include <osmocom/core/select.h>
4#include <osmocom/core/utils.h>
5
6#include <stdbool.h>
7#include <linux/if.h>
8
9/* information gathered from sysinfo(2) */
10struct osysmon_state_sysinfo {
11 unsigned long uptime_secs;
12 unsigned long loads[3];
13 unsigned long freeram;
14};
15
16/* one network interface */
17struct osysmon_state_iface {
18 char name[IFNAMSIZ+1];
19 uint32_t flags; /* enum net_device_flags IFF_* */
20 uint8_t hwasddr[6];
21 uint32_t ipaddr;
22};
23
24/* information gathered from RTNL via libmnl */
25struct osysmon_state_rtnl {
26 struct osysmon_state_iface iface[8];
27 unsigned int num_iface;
28 struct {
29 char *ifname;
30 uint32_t ipaddr;
31 } default_route;
32};
33
34struct osysmon_state_gbproxy {
35 char ns_state[32];
36 char bssgp_state[32];
37};
38
39struct osysmon_state_bts {
40 bool rf_locked;
41};
42
43struct osysmon_state_bsc {
44 struct osysmon_state_bts bts[8];
45 unsigned int num_bts;
46 char a_state[32];
47};
48
49struct osysmon_state {
50 struct osysmon_state_sysinfo sysinfo;
51 struct osysmon_state_rtnl rtnl;
52 struct osysmon_state_rtnl gbproxy;
53 struct osysmon_state_rtnl bsc;
54};