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