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> |
Harald Welte | 1a36f33 | 2018-06-04 17:36:33 +0200 | [diff] [blame] | 5 | #include <osmocom/vty/command.h> |
Harald Welte | 3e5ab69 | 2018-06-04 04:26:20 +0200 | [diff] [blame] | 6 | |
| 7 | #include <stdbool.h> |
Harald Welte | 3e5ab69 | 2018-06-04 04:26:20 +0200 | [diff] [blame] | 8 | |
Harald Welte | 1a36f33 | 2018-06-04 17:36:33 +0200 | [diff] [blame] | 9 | #include "value_node.h" |
| 10 | |
Harald Welte | 9e7fe00 | 2018-06-04 20:09:26 +0200 | [diff] [blame] | 11 | struct rtnl_client_state; |
Max | 8066a41 | 2019-01-28 23:59:03 +0100 | [diff] [blame] | 12 | struct ping_state; |
Harald Welte | 3e5ab69 | 2018-06-04 04:26:20 +0200 | [diff] [blame] | 13 | |
| 14 | struct osysmon_state { |
Harald Welte | 9e7fe00 | 2018-06-04 20:09:26 +0200 | [diff] [blame] | 15 | struct rtnl_client_state *rcs; |
Harald Welte | 1a36f33 | 2018-06-04 17:36:33 +0200 | [diff] [blame] | 16 | /* list of 'struct ctrl client' */ |
| 17 | struct llist_head ctrl_clients; |
Max | 9a852f2 | 2019-01-31 15:58:57 +0100 | [diff] [blame] | 18 | /* list of 'struct openvpn_client' */ |
| 19 | struct llist_head openvpn_clients; |
Harald Welte | 9e7fe00 | 2018-06-04 20:09:26 +0200 | [diff] [blame] | 20 | /* list of 'struct netdev' */ |
| 21 | struct llist_head netdevs; |
Harald Welte | 81e2023 | 2018-06-04 21:25:56 +0200 | [diff] [blame] | 22 | /* list of 'struct osysmon_file' */ |
| 23 | struct llist_head files; |
Max | 8066a41 | 2019-01-28 23:59:03 +0100 | [diff] [blame] | 24 | struct ping_state *pings; |
Harald Welte | 3e5ab69 | 2018-06-04 04:26:20 +0200 | [diff] [blame] | 25 | }; |
Harald Welte | 1a36f33 | 2018-06-04 17:36:33 +0200 | [diff] [blame] | 26 | |
| 27 | extern struct osysmon_state *g_oss; |
| 28 | |
| 29 | |
| 30 | |
| 31 | enum osysmon_vty_node { |
| 32 | CTRL_CLIENT_NODE = _LAST_OSMOVTY_NODE + 1, |
| 33 | CTRL_CLIENT_GETVAR_NODE, |
Harald Welte | 9e7fe00 | 2018-06-04 20:09:26 +0200 | [diff] [blame] | 34 | NETDEV_NODE, |
Max | 9a852f2 | 2019-01-31 15:58:57 +0100 | [diff] [blame] | 35 | OPENVPN_NODE, |
Max | 8066a41 | 2019-01-28 23:59:03 +0100 | [diff] [blame] | 36 | PING_NODE, |
Harald Welte | 1a36f33 | 2018-06-04 17:36:33 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | |
| 40 | int osysmon_ctrl_go_parent(struct vty *vty); |
| 41 | int osysmon_ctrl_init(); |
| 42 | int osysmon_ctrl_poll(struct value_node *parent); |
Harald Welte | 32f7a99 | 2018-06-04 18:07:33 +0200 | [diff] [blame] | 43 | |
Harald Welte | 9e7fe00 | 2018-06-04 20:09:26 +0200 | [diff] [blame] | 44 | int osysmon_rtnl_go_parent(struct vty *vty); |
| 45 | int osysmon_rtnl_init(); |
| 46 | int osysmon_rtnl_poll(struct value_node *parent); |
| 47 | |
Harald Welte | 32f7a99 | 2018-06-04 18:07:33 +0200 | [diff] [blame] | 48 | int osysmon_sysinfo_init(); |
| 49 | int osysmon_sysinfo_poll(struct value_node *parent); |
Harald Welte | 81e2023 | 2018-06-04 21:25:56 +0200 | [diff] [blame] | 50 | |
Max | 8066a41 | 2019-01-28 23:59:03 +0100 | [diff] [blame] | 51 | int osysmon_ping_init(); |
| 52 | int osysmon_ping_poll(struct value_node *parent); |
| 53 | |
Max | 9a852f2 | 2019-01-31 15:58:57 +0100 | [diff] [blame] | 54 | int osysmon_openvpn_init(); |
| 55 | int osysmon_openvpn_poll(struct value_node *parent); |
| 56 | |
Harald Welte | 81e2023 | 2018-06-04 21:25:56 +0200 | [diff] [blame] | 57 | int osysmon_file_init(); |
| 58 | int osysmon_file_poll(struct value_node *parent); |