Add ubus function to create nested interfaces
[project/netifd.git] / interface.h
index b8c9cad..e4d92aa 100644 (file)
@@ -59,7 +59,6 @@ struct interface_ip_settings {
        bool enabled;
        bool no_defaultroute;
        bool no_dns;
-       uint8_t assignment_length;
 
        struct vlist_tree addr;
        struct vlist_tree route;
@@ -74,6 +73,11 @@ struct interface_data {
        struct blob_attr data[];
 };
 
+struct interface_assignment_class {
+       struct list_head head;
+       char name[];
+};
+
 /*
  * interface configuration
  */
@@ -89,6 +93,7 @@ struct interface {
        bool autostart;
        bool config_autostart;
        bool device_config;
+       bool dynamic;
 
        time_t start_time;
        enum interface_state state;
@@ -116,6 +121,13 @@ struct interface {
        struct vlist_tree host_routes;
 
        int metric;
+       unsigned int ip4table;
+       unsigned int ip6table;
+
+       /* IPv6 assignment parameters */
+       uint8_t assignment_length;
+       int32_t assignment_hint;
+       struct list_head assignment_classes;
 
        /* errors/warnings while trying to bring up the interface */
        struct list_head errors;
@@ -129,10 +141,10 @@ struct interface {
 
 
 extern struct vlist_tree interfaces;
-extern const struct config_param_list interface_attr_list;
+extern const struct uci_blob_param_list interface_attr_list;
 
 void interface_init(struct interface *iface, const char *name,
-                   struct blob_attr *config);
+                   struct blob_attr *config, bool dynamic);
 
 void interface_add(struct interface *iface, struct blob_attr *config);
 bool interface_add_alias(struct interface *iface, struct blob_attr *config);