summaryrefslogtreecommitdiff
path: root/src/parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.h')
-rw-r--r--src/parse.h47
1 files changed, 35 insertions, 12 deletions
diff --git a/src/parse.h b/src/parse.h
index 9cbc74d..19abf10 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -51,6 +51,9 @@ typedef enum {
NETPLAN_DEF_TYPE_VLAN,
NETPLAN_DEF_TYPE_TUNNEL,
NETPLAN_DEF_TYPE_PORT,
+ /* Type fallback/passthrough */
+ NETPLAN_DEF_TYPE_NM,
+ NETPLAN_DEF_TYPE_MAX_
} NetplanDefType;
typedef enum {
@@ -218,6 +221,19 @@ typedef struct ovs_settings {
NetplanAuthenticationSettings ssl;
} NetplanOVSSettings;
+typedef union {
+ struct NetplanNMSettings {
+ char *name;
+ char *uuid;
+ char *stable_id;
+ char *device;
+ GData* passthrough;
+ } nm;
+ struct NetplanNetworkdSettings {
+ char *unit;
+ } networkd;
+} NetplanBackendSettings;
+
/**
* Represent a configuration stanza
*/
@@ -230,6 +246,7 @@ struct net_definition {
NetplanDefType type;
NetplanBackend backend;
char* id;
+ char* filename;
/* only necessary for NetworkManager connection UUIDs in some cases */
uuid_t uuid;
@@ -375,25 +392,24 @@ struct net_definition {
/* netplan-feature: openvswitch */
NetplanOVSSettings ovs_settings;
- union {
- struct NetplanNMSettings {
- char *name;
- char *uuid;
- char *stable_id;
- char *device;
- } nm;
- struct NetplanNetworkdSettings {
- char *unit;
- } networkd;
- } backend_settings;
+ NetplanBackendSettings backend_settings;
};
typedef enum {
NETPLAN_WIFI_MODE_INFRASTRUCTURE,
NETPLAN_WIFI_MODE_ADHOC,
- NETPLAN_WIFI_MODE_AP
+ NETPLAN_WIFI_MODE_AP,
+ NETPLAN_WIFI_MODE_OTHER,
+ NETPLAN_WIFI_MODE_MAX_
} NetplanWifiMode;
+static const char* const netplan_wifi_mode_to_str[NETPLAN_WIFI_MODE_MAX_] = {
+ [NETPLAN_WIFI_MODE_INFRASTRUCTURE] = "infrastructure",
+ [NETPLAN_WIFI_MODE_ADHOC] = "adhoc",
+ [NETPLAN_WIFI_MODE_AP] = "ap",
+ [NETPLAN_WIFI_MODE_OTHER] = NULL,
+};
+
typedef struct {
char *endpoint;
char *public_key;
@@ -424,6 +440,8 @@ typedef struct {
NetplanAuthenticationSettings auth;
gboolean has_auth;
+
+ NetplanBackendSettings backend_settings;
} NetplanWifiAccessPoint;
#define NETPLAN_ADVERTISED_RECEIVE_WINDOW_UNSPEC 0
@@ -482,5 +500,10 @@ extern NetplanOVSSettings ovs_settings_global;
gboolean netplan_parse_yaml(const char* filename, GError** error);
GHashTable* netplan_finish_parse(GError** error);
+guint netplan_clear_netdefs();
NetplanBackend netplan_get_global_backend();
const char* tunnel_mode_to_string(NetplanTunnelMode mode);
+NetplanNetDefinition* netplan_netdef_new(const char* id, NetplanDefType type, NetplanBackend renderer);
+
+void process_input_file(const char* f);
+gboolean process_yaml_hierarchy(const char* rootdir);