]> git.ipfire.org Git - thirdparty/lldpd.git/commit
client: Added support to override system capabilities
authorIgnacio Sanchez Navarro <igsanchez@github.com>
Mon, 1 Aug 2022 17:22:40 +0000 (13:22 -0400)
committerVincent Bernat <vincent@bernat.ch>
Thu, 11 Aug 2022 10:30:34 +0000 (12:30 +0200)
commit4c8e6e37142b2d92dc4879ef502cca9e8b02ddd9
tree2234afc6dd9273e4c208febe53b68278625e7db7
parent31c49c1593bf2ca436fd96cdd7b71694551b48a3
client: Added support to override system capabilities

1) configure system capabilities enabled <capability_0,capability_1,...>

    Override system capabilities with the provided value instead of using kernel information. Several capabilities can be specified separated by commas. Only available capabilities can be enabled. Valid capabilities are:

        other
        repeater
        bridge
        wlan
        router
        telephone
        docsis
        station

    Here is an example of use:

        lldpcli configure system capabilities enabled bridge,router

2) unconfigure system capabilities enabled

    Do not override capabilities and use the kernel information. This option undoes the previous one.

Ignacio Sanchez Navarro (Ignacio.Sanchez@uws.ac.uk) - University of the West of Scotland - Supported by H2020-ICT-2020-2/101017226 6G-BRAINS

-------------------------------------------------------------------------------
Modified files

lldpd-structs.h
    - Added new attribute "c_cap_override" to "lldpd_config" struct

conf-system.c
    - Added new function "cmd_capability" for new command to override the chassis capabilities
    - Added new function "register_commands_capabilities" to registers new commands to override the chassis capabilities
    - Added call to "register_commands_capabilities" in "register_commands_configure_system"

chassis.c
    - Added new function "_lldpctl_atom_st_int_chassis" to set "int" type vars in chassis
    - Added assignation of ".set_int" function in "chassis" var build

config.c
    - Added case for "lldpctl_k_config_chassis_cap_override" to get value of "c_cap_override" in "_lldpctl_atom_get_int_config" function
    - Added case for "lldpctl_k_config_chassis_cap_override" to set value of "c_cap_override" in "_lldpctl_atom_set_int_config" function

client.c
    - Added changes check for "c_cap_override" var in "client_handle_set_configuration" function
    - Added changes check for "c_cap_enabled" var in "client_handle_set_local_chassis" function

lldpctl.h
    - Added new enum values un "lldpctl_key_t" enum : "lldpctl_k_chassis_cap_enabled" and "lldpctl_k_config_chassis_cap_override"
    - Corrected some typos in previous comments

lldpd.c
    - Added check of capabilities override before setting new values in "lldpd_update_localchassis" function
    - Added check of capabilities override before setting initial value of "c_cap_enabled" to 0 in "lldpd_loop" function
    - Added initial set of "cfg->g_config.c_cap_override" to 0 in "lldpd_main" function

interfaces.c
    - Added check of capabilities override before setting new values in "interfaces_helper_chassis" function

display.c
    - Added new line to display the status of capabilities override in "show configration" command

lldpcli.8.in
    - Added new commands and descriptions to man file
12 files changed:
NEWS
src/client/conf-system.c
src/client/display.c
src/client/lldpcli.8.in
src/daemon/client.c
src/daemon/interfaces.c
src/daemon/lldpd.c
src/lib/atoms/chassis.c
src/lib/atoms/config.c
src/lib/lldpctl.h
src/lldpd-structs.h
tests/integration/test_lldpcli.py