Harald Welte | 3e5ab69 | 2018-06-04 04:26:20 +0200 | [diff] [blame^] | 1 | #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) */ |
| 10 | struct osysmon_state_sysinfo { |
| 11 | unsigned long uptime_secs; |
| 12 | unsigned long loads[3]; |
| 13 | unsigned long freeram; |
| 14 | }; |
| 15 | |
| 16 | /* one network interface */ |
| 17 | struct 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 */ |
| 25 | struct 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 | |
| 34 | struct osysmon_state_gbproxy { |
| 35 | char ns_state[32]; |
| 36 | char bssgp_state[32]; |
| 37 | }; |
| 38 | |
| 39 | struct osysmon_state_bts { |
| 40 | bool rf_locked; |
| 41 | }; |
| 42 | |
| 43 | struct osysmon_state_bsc { |
| 44 | struct osysmon_state_bts bts[8]; |
| 45 | unsigned int num_bts; |
| 46 | char a_state[32]; |
| 47 | }; |
| 48 | |
| 49 | struct 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 | }; |