swconfig: swlib.c: remove const qualifier for val.s since this is supposed to be...
[openwrt/openwrt.git] / package / network / config / swconfig / src / swlib.h
index ff73969c8718cc0edcc1c7010669b44f24da0b14..28bdd7f7cbea22c1070c98cc72c93fe04bc6ae5f 100644 (file)
@@ -109,20 +109,22 @@ enum swlib_port_flags {
 struct switch_dev;
 struct switch_attr;
 struct switch_port;
+struct switch_port_map;
 struct switch_val;
 struct uci_package;
 
 struct switch_dev {
        int id;
        char dev_name[IFNAMSIZ];
-       const char *name;
-       const char *alias;
+       char *name;
+       char *alias;
        int ports;
        int vlans;
        int cpu_port;
        struct switch_attr *ops;
        struct switch_attr *port_ops;
        struct switch_attr *vlan_ops;
+       struct switch_portmap *maps;
        struct switch_dev *next;
        void *priv;
 };
@@ -133,7 +135,7 @@ struct switch_val {
        int err;
        int port_vlan;
        union {
-               const char *s;
+               char *s;
                int i;
                struct switch_port *ports;
        } value;
@@ -154,6 +156,22 @@ struct switch_port {
        unsigned int flags;
 };
 
+struct switch_portmap {
+       unsigned int virt;
+       const char *segment;
+};
+
+/**
+ * swlib_list: list all switches
+ */
+void swlib_list(void);
+
+/**
+ * swlib_print_portmap: get portmap
+ * @dev: switch device struct
+ */
+void swlib_print_portmap(struct switch_dev *dev, char *segment);
+
 /**
  * swlib_connect: connect to the switch through netlink
  * @name: name of the ethernet interface,