blob: 45647b12104d6ca6c594c03282f2942be2d0a2b9 [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 Welte81e20232018-06-04 21:25:56 +020020 /* list of 'struct osysmon_file' */
21 struct llist_head files;
Harald Welte3e5ab692018-06-04 04:26:20 +020022};
Harald Welte1a36f332018-06-04 17:36:33 +020023
24extern struct osysmon_state *g_oss;
25
26
27
28enum osysmon_vty_node {
29 CTRL_CLIENT_NODE = _LAST_OSMOVTY_NODE + 1,
30 CTRL_CLIENT_GETVAR_NODE,
Harald Welte9e7fe002018-06-04 20:09:26 +020031 NETDEV_NODE,
Harald Welte1a36f332018-06-04 17:36:33 +020032};
33
34
35int osysmon_ctrl_go_parent(struct vty *vty);
36int osysmon_ctrl_init();
37int osysmon_ctrl_poll(struct value_node *parent);
Harald Welte32f7a992018-06-04 18:07:33 +020038
Harald Welte9e7fe002018-06-04 20:09:26 +020039int osysmon_rtnl_go_parent(struct vty *vty);
40int osysmon_rtnl_init();
41int osysmon_rtnl_poll(struct value_node *parent);
42
Harald Welte32f7a992018-06-04 18:07:33 +020043int osysmon_sysinfo_init();
44int osysmon_sysinfo_poll(struct value_node *parent);
Harald Welte81e20232018-06-04 21:25:56 +020045
46int osysmon_file_init();
47int osysmon_file_poll(struct value_node *parent);