Merge 0.30.214.
[util-vserver.git] / kernel / network_cmd.h
index 06c7055..3327777 100644 (file)
@@ -24,15 +24,61 @@ struct  vcmd_net_create {
 
 #define VCMD_net_migrate       VC_CMD(NETMIG, 1, 0)
 
-#define VCMD_net_add           VC_CMD(NETALT, 1, 0)
-#define VCMD_net_remove                VC_CMD(NETALT, 2, 0)
+#define VCMD_net_add_v0                VC_CMD(NETALT, 1, 0)
+#define VCMD_net_remove_v0     VC_CMD(NETALT, 2, 0)
 
 struct vcmd_net_addr_v0 {
        uint16_t type;
        uint16_t count;
-       uint32_t ip[4];
-       uint32_t mask[4];
-       /* more to come */
+       struct in_addr ip[4];
+       struct in_addr mask[4];
+};
+
+#define VCMD_net_add_ipv4      VC_CMD(NETALT, 1, 1)
+#define VCMD_net_remove_ipv4   VC_CMD(NETALT, 2, 1)
+
+struct vcmd_net_addr_ipv4_v1 {
+       uint16_t type;
+       uint16_t flags;
+       struct in_addr ip;
+       struct in_addr mask;
+};
+
+#define VCMD_net_add_ipv6      VC_CMD(NETALT, 3, 1)
+#define VCMD_net_remove_ipv6   VC_CMD(NETALT, 4, 1)
+
+struct vcmd_net_addr_ipv6_v1 {
+       uint16_t type;
+       uint16_t flags;
+       uint32_t prefix;
+       struct in6_addr ip;
+       struct in6_addr mask;
+};
+
+#define VCMD_add_match_ipv4    VC_CMD(NETALT, 5, 0)
+#define VCMD_get_match_ipv4    VC_CMD(NETALT, 6, 0)
+
+struct vcmd_match_ipv4_v0 {
+       uint16_t type;
+       uint16_t flags;
+       uint16_t parent;
+       uint16_t prefix;
+       struct in_addr ip;
+       struct in_addr ip2;
+       struct in_addr mask;
+};
+
+#define VCMD_add_match_ipv6    VC_CMD(NETALT, 7, 0)
+#define VCMD_get_match_ipv6    VC_CMD(NETALT, 8, 0)
+
+struct vcmd_match_ipv6_v0 {
+       uint16_t type;
+       uint16_t flags;
+       uint16_t parent;
+       uint16_t prefix;
+       struct in6_addr ip;
+       struct in6_addr ip2;
+       struct in6_addr mask;
 };