diff options
author | meurisa <alexander.meuris@technicolor.com> | 2019-04-12 09:56:28 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-04-15 22:31:38 +0200 |
commit | 08989e46b9030671ce57b8872538d40e2ddcbbe0 (patch) | |
tree | c0119c3ca57b572adcfa6462d34411a6e0c2f0ac /interface-ip.h | |
parent | bfd4de3666901070d805878e55b02417fef6277c (diff) |
interface: add neighbor config support
The neighbor or neighbor6 network section makes neighbours
configurable via UCI or proto shell handlers. It allows to
install neighbor proxy entries or static neighbor entries
The neighbor or neighbor6 section has the following types:
interface : declares the logical OpenWrt interface
ipaddr : the ip address of the neighbor
mac : the mac address of the neighbor
proxy : specifies whether the neighbor ia a proxy
entry (can be 1 or 0)
router : specifies whether the neighbor is a router
(can be 1 or 0)
Signed-off-by: Alexander Meuris <meurisalexander@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface-ip.h')
-rw-r--r-- | interface-ip.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/interface-ip.h b/interface-ip.h index 21c6e9b..3f99eb9 100644 --- a/interface-ip.h +++ b/interface-ip.h @@ -48,6 +48,9 @@ enum device_addr_flags { /* route overrides the default route type */ DEVROUTE_TYPE = (1 << 10), + + /* neighbor mac address */ + DEVNEIGH_MAC = (1 << 11), }; union if_addr { @@ -106,6 +109,20 @@ struct device_route { union if_addr source; }; +struct device_neighbor { + struct vlist_node node; + + bool failed; + bool proxy; + bool keep; + bool enabled; + bool router; + + uint8_t macaddr[6]; + enum device_addr_flags flags; + union if_addr addr; +}; + struct device_addr { struct vlist_node node; bool enabled; @@ -150,6 +167,7 @@ struct dns_search_domain { }; extern const struct uci_blob_param_list route_attr_list; +extern const struct uci_blob_param_list neighbor_attr_list; extern struct list_head prefixes; void interface_ip_init(struct interface *iface); @@ -158,7 +176,7 @@ void interface_add_dns_search_list(struct interface_ip_settings *ip, struct blob void interface_write_resolv_conf(void); void interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6); - +void interface_ip_add_neighbor(struct interface *iface, struct blob_attr *attr, bool v6); void interface_ip_update_start(struct interface_ip_settings *ip); void interface_ip_update_complete(struct interface_ip_settings *ip); void interface_ip_flush(struct interface_ip_settings *ip); |