This repository was archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathctl.h
More file actions
89 lines (73 loc) · 1.4 KB
/
ctl.h
File metadata and controls
89 lines (73 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef CTL_H
#define CTL_H
#include <sys/time.h>
#include <stdint.h>
#include "ggaoed.h"
/**********************************************************************
* Constants
*/
/* Commands that can be sent through the control socket */
typedef enum {
CTL_CMD_HELLO,
CTL_CMD_GET_STATS,
CTL_CMD_RELOAD,
CTL_CMD_GET_CONFIG,
CTL_CMD_GET_MACMASK,
CTL_CMD_GET_RESERVE,
CTL_CMD_CLEAR_STATS,
CTL_CMD_CLEAR_CONFIG,
CTL_CMD_CLEAR_MACMASK,
CTL_CMD_CLEAR_RESERVE
} ctl_command;
typedef enum {
CTL_MSG_HELLO,
CTL_MSG_UPTIME,
CTL_MSG_DEVSTAT,
CTL_MSG_NETSTAT,
CTL_MSG_OK,
CTL_MSG_MACLIST,
CTL_MSG_CONFIG
} ctl_message;
#define CONFIG_LOCATION SYSCONFDIR "/ggaoed.conf"
#define SOCKET_LOCATION LOCALSTATEDIR "/run/ggaoed.sock"
#define PIDFILE_LOCATION LOCALSTATEDIR "/run/ggaoed.pid"
#define CTL_PROTO_VERSION 1
#define CTL_MAX_PACKET 4096
/**********************************************************************
* Data structures
*/
struct msg_hello
{
uint32_t type;
uint32_t version;
};
struct msg_uptime
{
uint32_t type;
struct timespec uptime;
};
struct msg_devstat
{
uint32_t type;
struct device_stats stats;
char name[0];
};
struct msg_netstat
{
uint32_t type;
struct netif_stats stats;
char name[0];
};
struct msg_maclist
{
uint32_t type;
struct acl_map list;
char name[0];
};
struct msg_config
{
uint32_t type;
struct config_map cfg;
char name[0];
};
#endif /* CTL_H */