Merge branch 'master' of ssh://repo.or.cz/srv/git/ana-net
[ana-net.git] / src / xt_user.h
blobcb804f40039162d148f9377c7380038a399d2a9f
1 /*
2 * Lightweight Autonomic Network Architecture
4 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL.
7 */
9 #ifndef XT_USER_H
10 #define XT_USER_H
12 #include <linux/types.h>
14 #include "xt_vlink.h"
15 #include "xt_fblock.h"
17 #define NETLINK_USERCTL 24
19 enum userctl_groups {
20 USERCTLGRP_NONE = VLINKNLGRP_MAX, /* Reserved */
21 #define USERCTLGRP_NONE USERCTLGRP_NONE
22 USERCTLGRP_CONF,
23 #define USERCTLGRP_CONF USERCTLGRP_CONF
24 __USERCTLGRP_MAX
27 #define USERCTLGRP_MAX (__USERCTLGRP_MAX - 1)
28 #define USERCTL_BUF_LEN 1500
30 #define NETLINK_USERCTL_CMD_ADD 1
31 #define NETLINK_USERCTL_CMD_SET 2
32 #define NETLINK_USERCTL_CMD_RM 3
33 #define NETLINK_USERCTL_CMD_BIND 4
34 #define NETLINK_USERCTL_CMD_UNBIND 5
35 #define NETLINK_USERCTL_CMD_REPLACE 6
36 #define NETLINK_USERCTL_CMD_SUBSCRIBE 7
37 #define NETLINK_USERCTL_CMD_UNSUBSCRIBE 8
39 struct lananlmsg_add {
40 char name[FBNAMSIZ];
41 char type[TYPNAMSIZ];
44 struct lananlmsg_rm {
45 char name[FBNAMSIZ];
48 struct lananlmsg_set {
49 char name[FBNAMSIZ];
50 /* 0-terminated string, e.g. "myip=192.168.1.111" */
51 char option[USERCTL_BUF_LEN - FBNAMSIZ];
54 struct lananlmsg_tuple {
55 char name1[FBNAMSIZ];
56 char name2[FBNAMSIZ];
59 struct lananlmsg_replace {
60 char name1[FBNAMSIZ];
61 char name2[FBNAMSIZ];
62 uint8_t drop_priv;
65 extern int init_userctl_system(void);
66 extern void cleanup_userctl_system(void);
68 struct lananlmsg {
69 uint32_t cmd;
70 uint8_t buff[USERCTL_BUF_LEN];
73 #endif /* XT_USER_H */