blob: 399a2bc36b3933136e4746b1e44858d074445d02 [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>
8#include <linux/if.h>
9
Harald Welte1a36f332018-06-04 17:36:33 +020010#include "value_node.h"
11
Harald Welte9e7fe002018-06-04 20:09:26 +020012struct rtnl_client_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 Welte3e5ab692018-06-04 04:26:20 +020020};
Harald Welte1a36f332018-06-04 17:36:33 +020021
22extern struct osysmon_state *g_oss;
23
24
25
26enum osysmon_vty_node {
27 CTRL_CLIENT_NODE = _LAST_OSMOVTY_NODE + 1,
28 CTRL_CLIENT_GETVAR_NODE,
Harald Welte9e7fe002018-06-04 20:09:26 +020029 NETDEV_NODE,
Harald Welte1a36f332018-06-04 17:36:33 +020030};
31
32
33int osysmon_ctrl_go_parent(struct vty *vty);
34int osysmon_ctrl_init();
35int osysmon_ctrl_poll(struct value_node *parent);
Harald Welte32f7a992018-06-04 18:07:33 +020036
Harald Welte9e7fe002018-06-04 20:09:26 +020037int osysmon_rtnl_go_parent(struct vty *vty);
38int osysmon_rtnl_init();
39int osysmon_rtnl_poll(struct value_node *parent);
40
Harald Welte32f7a992018-06-04 18:07:33 +020041int osysmon_sysinfo_init();
42int osysmon_sysinfo_poll(struct value_node *parent);