proto-shell: Model config parameter "no-proto-task" as a proto flag Export the config parameter "no-proto-task" as a proto flag so it's available for other other netifd modules Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto-shell: Support teardown on layer 3 link loss Commit c6858766 added interface teardown support on layer 3 device link loss mainly for shell protocols who have no proto task like xl2tp. However for shell protocols having a proto task it is not always the correct action to teardown the interface; as an example the PPP daemon can be put into persist state trying to re-establish the link via a hold-off mechanism if layer 3 link loss is detected. Therefore shell handlers can enable via TEARDOWN_ON_L3_LINK_DOWN a proto flag which will teardown the interface when layer 3 link loss is detected Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
netifd: Interface last error support Adds interface last error support which preserves the last reported error reported by the protocol handler till the interface is up; e.g. survives network reload and interface restarts. This is mainly usefull for tracking down why an interface fails to establish; eg auth failure/traffic limit for PPP interfaces Protocol handlers register last error support by setting lasterror=1 in the proto_init function Signed-off-by: Johan Peeters <johan.peeters111@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface: enable force_link by default for proto=static Signed-off-by: Felix Fietkau <nbd@openwrt.org>
netifd: Reload proto on topology change Introduce a new device event "topology change" that gets signaled by bridges on adding/removing members. On "topology changes" the proto handlers are requested to "renew" which is most useful for DHCP. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
proto-shell: defer init until after command line option processing Signed-off-by: Felix Fietkau <nbd@openwrt.org>
config: use the new uci_blob library code Signed-off-by: Felix Fietkau <nbd@openwrt.org>
add an ubus method for dumping available protocol handlers
split applying static proto setting from handler settings
add copyright headers
make proto_parse_ip_addr_string() static
proto: add an option for specifying external addresses using proto_apply_ip_settings()
move static address setup to proto.c in preparation for unifying it with the proto-shell code doing similar things
proto-shell: handle the "available" config flag
proto-shell: allow passing netmask in ip address format
move ip address parsing code to proto.c
make proto_apply_static_settings static, make helper functions take a struct interface instead of the proto state
add a protocol event for link loss
add an interface for notifying protocol handlers of state changes via ubus
move protocol flags to the handler, add a pointer to the handler in the proto state, add PROTO_FLAG_NODEV