summaryrefslogtreecommitdiffhomepage
path: root/system.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-02-28 10:57:05 +0100
committerFelix Fietkau <nbd@nbd.name>2017-03-07 11:47:46 +0100
commit91810ecc13239f3b18c8299de265b4f3531c0017 (patch)
tree1f274a6b35ae4db1e8fbe6749cdfbea9f38459a9 /system.c
parentf1076561f4cd4e391ca654d76498b0429413c61e (diff)
system-linux: add VXLAN support
VXLAN shares many attributes with the tunnel devices, so it is implemented as a new tunnel type. The 'remote' attribute can be used for an unicast peer or a multicast group. The IANA-assigned port 4789 is used by default, instead of the non-standard port Linux defaults to. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'system.c')
-rw-r--r--system.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/system.c b/system.c
index e57084f..52172c3 100644
--- a/system.c
+++ b/system.c
@@ -28,6 +28,7 @@ static const struct blobmsg_policy tunnel_attrs[__TUNNEL_ATTR_MAX] = {
[TUNNEL_ATTR_LINK] = { .name = "link", .type = BLOBMSG_TYPE_STRING },
[TUNNEL_ATTR_FMRS] = { .name = "fmrs", .type = BLOBMSG_TYPE_ARRAY },
[TUNNEL_ATTR_INFO] = { .name = "info", .type = BLOBMSG_TYPE_STRING },
+ [TUNNEL_ATTR_DATA] = { .name = "data", .type = BLOBMSG_TYPE_TABLE },
};
const struct uci_blob_param_list tunnel_attr_list = {
@@ -35,6 +36,17 @@ const struct uci_blob_param_list tunnel_attr_list = {
.params = tunnel_attrs,
};
+static const struct blobmsg_policy vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
+ [VXLAN_DATA_ATTR_ID] = { .name = "id", .type = BLOBMSG_TYPE_INT32 },
+ [VXLAN_DATA_ATTR_PORT] = { .name = "port", .type = BLOBMSG_TYPE_INT32 },
+ [VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type = BLOBMSG_TYPE_STRING },
+};
+
+const struct uci_blob_param_list vxlan_data_attr_list = {
+ .n_params = __VXLAN_DATA_ATTR_MAX,
+ .params = vxlan_data_attrs,
+};
+
void system_fd_set_cloexec(int fd)
{
#ifdef FD_CLOEXEC