blob: df8bf8d93ea911b57862554850980a304dd40144 [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>
Harald Welte1a36f332018-06-04 17:36:33 +02005#include <osmocom/vty/command.h>
Harald Welte3e5ab692018-06-04 04:26:20 +02006
7#include <stdbool.h>
Harald Welte3e5ab692018-06-04 04:26:20 +02008
Harald Welte1a36f332018-06-04 17:36:33 +02009#include "value_node.h"
10
Harald Welte9e7fe002018-06-04 20:09:26 +020011struct rtnl_client_state;
Max8066a412019-01-28 23:59:03 +010012struct ping_state;
Harald Welte3e5ab692018-06-04 04:26:20 +020013
14struct osysmon_state {
Harald Welte9e7fe002018-06-04 20:09:26 +020015 struct rtnl_client_state *rcs;
Harald Welte1a36f332018-06-04 17:36:33 +020016 /* list of 'struct ctrl client' */
17 struct llist_head ctrl_clients;
Harald Welte9e7fe002018-06-04 20:09:26 +020018 /* list of 'struct netdev' */
19 struct llist_head netdevs;
Harald Welte81e20232018-06-04 21:25:56 +020020 /* list of 'struct osysmon_file' */
21 struct llist_head files;
Max8066a412019-01-28 23:59:03 +010022 struct ping_state *pings;
Harald Welte3e5ab692018-06-04 04:26:20 +020023};
Harald Welte1a36f332018-06-04 17:36:33 +020024
25extern struct osysmon_state *g_oss;
26
27
28
29enum osysmon_vty_node {
30 CTRL_CLIENT_NODE = _LAST_OSMOVTY_NODE + 1,
31 CTRL_CLIENT_GETVAR_NODE,
Harald Welte9e7fe002018-06-04 20:09:26 +020032 NETDEV_NODE,
Max8066a412019-01-28 23:59:03 +010033 PING_NODE,
Harald Welte1a36f332018-06-04 17:36:33 +020034};
35
36
37int osysmon_ctrl_go_parent(struct vty *vty);
38int osysmon_ctrl_init();
39int osysmon_ctrl_poll(struct value_node *parent);
Harald Welte32f7a992018-06-04 18:07:33 +020040
Harald Welte9e7fe002018-06-04 20:09:26 +020041int osysmon_rtnl_go_parent(struct vty *vty);
42int osysmon_rtnl_init();
43int osysmon_rtnl_poll(struct value_node *parent);
44
Harald Welte32f7a992018-06-04 18:07:33 +020045int osysmon_sysinfo_init();
46int osysmon_sysinfo_poll(struct value_node *parent);
Harald Welte81e20232018-06-04 21:25:56 +020047
Max8066a412019-01-28 23:59:03 +010048int osysmon_ping_init();
49int osysmon_ping_poll(struct value_node *parent);
50
Harald Welte81e20232018-06-04 21:25:56 +020051int osysmon_file_init();
52int osysmon_file_poll(struct value_node *parent);