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