config_get v 'config' 'lldp_class'; append _string "$v" ","
config_get v 'config' 'agentxsocket'; append _string "$v" ","
+ config_get v 'config' 'cid_interface'; append _string "$v" ","
config_get_bool v 'config' 'readonly_mode'; append _string "$v" ","
config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" ","
config_get_bool v 'config' 'enable_cdp'; append _string "$v" ","
export -n "$var=$_hash"
}
+get_config_cid_ifaces() {
+ local _ifaces
+ config_get _ifaces 'config' 'cid_interface'
+
+ local _iface _ifnames=""
+ for _iface in $_ifaces; do
+ local _ifname=""
+ if network_get_device _ifname "$_iface" || [ -e "/sys/class/net/$_iface" ]; then
+ append _ifnames "${_ifname:-$_iface}" ","
+ fi
+ done
+
+ export -n "${1}=$_ifnames"
+}
+
write_lldpd_conf()
{
local lldp_description
[ -n "$lldp_class" ] && procd_append_param command -M "$lldp_class"
[ -n "$agentxsocket" ] && procd_append_param command -x -X "$agentxsocket"
+ # ChassisID interfaces
+ local ifnames
+ get_config_cid_ifaces ifnames
+ [ -n "$ifnames" ] && procd_append_param command -C "$ifnames"
+
# Overwrite default configuration locations processed by lldpcli at start
procd_append_param command -O "$LLDPD_CONF"