blob: 735b11e74175714a82f6aa350d7d17ae53c47ed3 [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;
Harald Welte3e5ab692018-06-04 04:26:20 +020012
13struct osysmon_state {
Harald Welte9e7fe002018-06-04 20:09:26 +020014 struct rtnl_client_state *rcs;
Harald Welte1a36f332018-06-04 17:36:33 +020015 /* list of 'struct ctrl client' */
16 struct llist_head ctrl_clients;
Harald Welte9e7fe002018-06-04 20:09:26 +020017 /* list of 'struct netdev' */
18 struct llist_head netdevs;
Harald Welte81e20232018-06-04 21:25:56 +020019 /* list of 'struct osysmon_file' */
20 struct llist_head files;
Harald Welte3e5ab692018-06-04 04:26:20 +020021};
Harald Welte1a36f332018-06-04 17:36:33 +020022
23extern struct osysmon_state *g_oss;
24
25
26
27enum osysmon_vty_node {
28 CTRL_CLIENT_NODE = _LAST_OSMOVTY_NODE + 1,
29 CTRL_CLIENT_GETVAR_NODE,
Harald Welte9e7fe002018-06-04 20:09:26 +020030 NETDEV_NODE,
Harald Welte1a36f332018-06-04 17:36:33 +020031};
32
33
34int osysmon_ctrl_go_parent(struct vty *vty);
35int osysmon_ctrl_init();
36int osysmon_ctrl_poll(struct value_node *parent);
Harald Welte32f7a992018-06-04 18:07:33 +020037
Harald Welte9e7fe002018-06-04 20:09:26 +020038int osysmon_rtnl_go_parent(struct vty *vty);
39int osysmon_rtnl_init();
40int osysmon_rtnl_poll(struct value_node *parent);
41
Harald Welte32f7a992018-06-04 18:07:33 +020042int osysmon_sysinfo_init();
43int osysmon_sysinfo_poll(struct value_node *parent);
Harald Welte81e20232018-06-04 21:25:56 +020044
45int osysmon_file_init();
46int osysmon_file_poll(struct value_node *parent);