#pragma once #include "device.h" #include "vector.h" #include #include #include typedef struct _ipaddr { int af; union { struct in_addr addr4; struct in6_addr addr6; }; } ipaddr_t; typedef struct _ipprefix { ipaddr_t addr; uint8_t plen; } ipaddr_prefix_t; typedef VECTOR(ipaddr_prefix_t) ipaddr_prefix_vector_t; typedef struct _device_common { struct ether_addr macaddr; uint16_t mtu; ipaddr_prefix_vector_t addrs; char master[IF_NAMESIZE]; } device_common_t; bool device_common_process_config(device_common_t *device, struct json_object *config); void device_common_init(device_common_t *device, int ifindex); void device_common_release(device_common_t *device, int ifindex);