GNOME Bugzilla – Bug 757307
[review] nmcli: add command for displaying LLDP neighbors
Last modified: 2015-11-10 13:11:29 UTC
The list of LLDP neighbors is available through the D-Bus interface and libnm already provides functions to retrieve it; make the list available through nmcli as well.
Created attachment 314395 [details] [review] [PATCH] cli: add command for displaying LLDP neighbors
The patch looks good to me. I just wonder whether the is a plan to have additional commands except 'list', in the future. And maybe the command could support multiple device arguments?
+ nmc->print_fields.header_name = (char *) construct_header_name (_("Device LLDP neighbors"), nm_device_get_iface (device)); + nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL); just spotted that parse_output_fields() should be passed an error and checked that. Because it parses fields_str from user. See e.g. show_nm_status() in general.c.
Created attachment 314615 [details] [review] [PATCH v2] cli: add command for displaying LLDP neighbors (In reply to Jiri Klimes from comment #2) > I just wonder whether the is a plan to have additional commands except > 'list', in the future. > And maybe the command could support multiple device arguments? I don't know, probably not. Now I've changed the command syntax to be similar to the 'wifi list' command: lldp [list [ifname <ifname>]] so that one can simply issue a 'nmcli d lldp' to get the list for all devices, and we still can add other commands in the future. About allowing multiple 'ifname' options, I would keep it simple for now and add this later if needed. (In reply to Jiri Klimes from comment #3) > just spotted that parse_output_fields() should be passed an error and > checked that. Because it parses fields_str from user. See e.g. > show_nm_status() in general.c. Fixed, thanks.
Missing bash completion. rest LGTM
Added bash completion and repushed.
> bg/lldp-cli Pushed a fixup to the branch for $nmcli dev lldp list blabla Unknown parameter: blabla Success Other than that, the branch looks good to me.
Merged to master: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=5b3137984d108ca8933fd7a78c5cb36ac17b04ea