]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/networkd/port.h
port: Implement reading/writing VLAN settings
[people/ms/network.git] / src / networkd / port.h
index 2f4319b843fc641cf2c87a67c9d3da470e242ba4..d89e1e0634a755080adb445e4262ffbb00b033c8 100644 (file)
 typedef enum nw_port_type {
        NW_PORT_UNKNOWN = 0,
        NW_PORT_DUMMY,
+       NW_PORT_VLAN,
 } nw_port_type_t;
 
+// VLAN
+#define NW_VLAN_ID_INVALID             0
+#define NW_VLAN_ID_MIN                 1
+#define NW_VLAN_ID_MAX                 4096
+
 typedef struct nw_port nw_port;
 
 #include "address.h"
@@ -61,4 +67,11 @@ const struct rtnl_link_stats64* nw_port_get_stats64(nw_port* port);
 int __nw_port_update_stats(nw_daemon* daemon, nw_port* port, void* data);
 int nw_port_update_stats(nw_port* port);
 
+// VLAN
+int nw_port_get_vlan_id(nw_port* port);
+int nw_port_set_vlan_id(nw_port* port, int id);
+
+nw_port* nw_port_get_vlan_parent(nw_port* port);
+int nw_port_set_vlan_parent(nw_port* port, nw_port* parent);
+
 #endif /* NETWORKD_PORT_H */