// If the parent has not been read from the configuration we will
// save the name and try to find it later.
- char __parent_name[IF_NAMESIZE];
+ char __parent_name[IFNAMSIZ];
};
extern const nw_port_type_t nw_port_type_vlan;
#include <systemd/sd-netlink.h>
-#ifndef IF_NAMESIZE
-#define IF_NAMESIZE 16
-#endif
-
#define PORT_CONFIG_DIR CONFIG_DIR "/ports"
typedef struct nw_port nw_port;
nw_link* link;
const nw_port_type_t* type;
- char name[IF_NAMESIZE];
+ char name[IFNAMSIZ];
// Configuration
nw_config *config;
NW_STRING_TABLE_LOOKUP(nw_zone_type_id_t, nw_zone_type_id)
-struct nw_zone {
- nw_daemon* daemon;
- int nrefs;
-
- // Link
- nw_link* link;
-
- char name[NETWORK_ZONE_NAME_MAX_LENGTH];
-
- // Configuration
- nw_config *config;
-};
-
static void nw_zone_free(nw_zone* zone) {
if (zone->link)
nw_link_unref(zone->link);
#define ZONE_CONFIG_DIR CONFIG_DIR "/zones"
-#define NETWORK_ZONE_NAME_MAX_LENGTH 16
#define NETWORK_ZONE_DEFAULT_MTU 1500
typedef struct nw_zone nw_zone;
__EMPTY
} nw_zone_type_id_t;
+#include <linux/if.h>
#include <linux/if_link.h>
#include "config.h"
#include "daemon.h"
+#include "link.h"
+
+struct nw_zone {
+ nw_daemon* daemon;
+ int nrefs;
+
+ // Link
+ nw_link* link;
+
+ char name[IFNAMSIZ];
+
+ // Configuration
+ nw_config *config;
+};
int nw_zone_create(nw_zone** zone, nw_daemon* daemon, const nw_zone_type_id_t type,
const char* name, nw_config* config);