Commit graph

204 commits

Author SHA1 Message Date
Yu Watanabe 5029912157 network,udev: use uint64_t for bit rate
Fixes #14620.
2020-01-21 16:51:19 +01:00
Zbigniew Jędrzejewski-Szmek 98f44b97bb
Merge pull request #14562 from yuwata/table-strv
introduce TABLE_STRV and use it in networkctl and resolvectl
2020-01-15 13:59:11 +01:00
Yu Watanabe 222a6aace7
Merge pull request #14547 from keszybz/networkctl-matching
networkctl: return error or warning when interfaces are not matched
2020-01-15 11:56:01 +09:00
Yu Watanabe 536cdd07b3 networkctl: use TABLE_STRV 2020-01-15 11:52:40 +09:00
Zbigniew Jędrzejewski-Szmek 0ef84b80c5 networkctl: return error or warning when interfaces are not matched
We'd just print nothing and exit with 0. If the user gave an explicit
name, we should fail. If a pattern didn't match, we should at least warn.

$ networkctl status enx54ee75cb1dc0a* --no-pager && echo $?
No interfaces matched.
0

$ networkctl status enx54ee75cb1dc0a --no-pager
Interface "enx54ee75cb1dc0a" not found.
1
2020-01-14 13:09:46 +01:00
Lennart Poettering 04d8507f68
Merge pull request #14381 from keszybz/ifindex-cleanup
Resolve alternative names
2020-01-13 17:57:59 +01:00
Zbigniew Jędrzejewski-Szmek 117caf3765 networkctl: break long line 2020-01-12 11:24:35 +01:00
Zbigniew Jędrzejewski-Szmek d308bb99d2 Resolve alternative ifnames wherever we would resolve an interface name
To keep the names manageable, "ifname_or_ifindex" is replaced by "interface".
2020-01-12 11:24:35 +01:00
Zbigniew Jędrzejewski-Szmek 231d9de1e3 networkctl: define a helper for interface name resolution 2020-01-11 12:07:28 +01:00
Zbigniew Jędrzejewski-Szmek 597da51bae tree-wide: make parse_ifindex simply return the index
We don't need a seperate output parameter that is of type int.  glibc() says
that the type is "unsigned", but the kernel thinks it's "int".  And the
"alternative names" interface also uses ints. So let's standarize on ints,
since it's clearly not realisitic to have interface numbers in the upper half
of unsigned int range.
2020-01-11 12:06:08 +01:00
Yu Watanabe bd17fa8cd8 tree-wide: use table_log_add_error() 2020-01-10 18:28:30 +09:00
Yu Watanabe a42d949080 networkctl: set table width 0 when --full is specified 2020-01-10 12:12:00 +09:00
Yu Watanabe 125c7814fa
Merge pull request #14523 from keszybz/refactorings
Refactorings inspired by recent pull requests
2020-01-09 12:50:11 +09:00
Zbigniew Jędrzejewski-Szmek 6666c4faee network: do not require ethtool_get_permanent_macaddr() to get an fd 2020-01-08 17:14:56 +01:00
Lennart Poettering 0aa9bffe10
Merge pull request #14448 from yuwata/network-permanent-mac-address
network, udev: support permanent mac address
2020-01-08 15:36:27 +01:00
Yu Watanabe caa8538a22 networkctl: show permanent mac address if it is not used now 2020-01-08 17:54:59 +09:00
Yu Watanabe 10c71c3605 networkctl: status command also shows logs of networkd
Closes #14050.
2020-01-07 22:20:37 +09:00
Lennart Poettering 0c8e33b6e9
Merge pull request #14377 from keszybz/fixups
Fixups
2019-12-18 16:21:20 +01:00
Zbigniew Jędrzejewski-Szmek 4023637a8a Restore silent handling of BUS_ERROR_SPEED_METER_INACTIVE
This only matters for the case where new networkctl is running against older
networkd. We should still handle the old error to avoid unnecessary warning
about speedmeeter being disabled.

This partially reverts commit e813de549b.
2019-12-18 08:48:33 +01:00
Yu Watanabe f7581ed6e0 networkctl: support alternative name to specify interface 2019-12-18 00:05:50 +09:00
Yu Watanabe 511070ee95 networkctl: show alternative names 2019-12-16 10:56:02 +09:00
Yu Watanabe e813de549b network: do not return error but return UINT64_MAX if speed meter is disabled
Fixes #14222.
2019-12-04 09:11:34 +01:00
Yu Watanabe 33ebda2e81 networkctl: fix to show BSSID
This fixes an issue caused by a typo in
78404d22cc.
2019-12-03 20:00:05 +01:00
Lennart Poettering 353b2baa20 tree-wide: clean up --help texts a bit
This cleans up and unifies the outut of --help texts a bit:

1. Highlight the human friendly description string, not the command
   line via ANSI sequences. Previously both this description string and
   the brief command line summary was marked with the same ANSI
   highlight sequence, but given we auto-page to less and less does not
   honour multi-line highlights only the command line summary was
   affectively highlighted. Rationale: for highlighting the description
   instead of the command line: the command line summary is relatively
   boring, and mostly the same for out tools, the description on the
   other hand is pregnant, important and captions the whole thing and
   hence deserves highlighting.

2. Always suffix "Options" with ":" in the help text

3. Rename "Flags" →  "Options" in one case

4. Move commands to the top in a few cases

5. add coloring to many more help pages

6. Unify on COMMAND instead of {COMMAND} in the command line summary.
   Some tools did it one way, others the other way. I am not sure what
   precisely {} is supposed to mean, that uppercasing doesn't, hence
   let's simplify and stick to the {}-less syntax

And minor other tweaks.
2019-11-18 15:14:43 +01:00
Yu Watanabe 8e1e87a5de tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
Yu Watanabe 78404d22cc network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
Yu Watanabe 8dc85c5ef1 networkctl: introduce reconfigure method 2019-10-24 14:23:12 +09:00
Yu Watanabe e4857ee2f2 networkctl: use format_ifname_full() 2019-10-24 14:20:48 +09:00
Yu Watanabe d56d6cb8ca networkctl: fix error message 2019-10-24 14:20:48 +09:00
Yu Watanabe a227674cfb networkctl: add reload command 2019-10-24 14:20:42 +09:00
Zbigniew Jędrzejewski-Szmek 8d07de2534 networkctl: print ssid and bssid 2019-10-24 00:02:43 +02:00
Zbigniew Jędrzejewski-Szmek 172353b110 networkctl: create the sd_device structure just once
This is mostly in preparation for future changes: a proper freeing function
is now called on the LinkInfo items.
2019-10-24 00:02:43 +02:00
Zbigniew Jędrzejewski-Szmek 516e9c802f networkctl: split out helper function 2019-10-23 12:29:04 +02:00
Zbigniew Jędrzejewski-Szmek ceb366df29 networkctl: show carrier in green for loopback iface
We don't ever expect anything different, so let's hightlight
that carrier in this case is OK.
2019-10-23 11:10:32 +02:00
Zbigniew Jędrzejewski-Szmek ce2529b4a2 Highlight the synopsis and summary in --help
This doesn't cover all the binaries, but I don't know how to script
this, and I run out of steam ;)
2019-10-08 18:21:27 +02:00
Zbigniew Jędrzejewski-Szmek 9daa657836 networkctl: add missing dots in --help 2019-10-08 18:21:27 +02:00
Zbigniew Jędrzejewski-Szmek e1fac8a68a Move the Commands section above Options section
For executables which take a verb, we should list the verbs first, and
then options which modify those verbs second. The general layout of
the man page is from general description to specific details, usually
Overview, Commands, Options, Return Value, Examples, References.
2019-10-08 18:21:26 +02:00
Yu Watanabe 82d1264048
Merge pull request #11883 from yuwata/network-dhcp-renew
network: dhcp renew
2019-09-22 07:44:23 +02:00
Yu Watanabe 308e7dfdce networkctl: add renew command 2019-09-21 20:27:43 +09:00
Susant Sahani cdf01b36db networkctl: Display address is a DHCP4 address
CLoses https://github.com/systemd/systemd/issues/10839
2019-09-09 20:01:54 +05:30
Lennart Poettering e226badc9c networkctl: avoid outputting '(null)' for LLDP ports without description 2019-08-16 07:43:34 +09:00
Yu Watanabe 45160216b7 networkctl: TABLE_BPS requires uint64_t 2019-07-30 15:09:16 +02:00
Susant Sahani b24281aaca networkctl : Add support to display vxlan properties 2019-07-30 00:02:14 +09:00
Susant Sahani c82d1bf2b3 networkctl: Add support to display bridge properties 2019-07-30 00:02:02 +09:00
Yu Watanabe 8d0e0af2a0 networkctl: merge multiple table_add_cell() by using table_add_many() 2019-07-29 23:19:08 +09:00
Zbigniew Jędrzejewski-Szmek 4252171a94 tree-wide: use lowercase table headers
https://github.com/systemd/systemd/pull/13062#discussion_r303847484
> the formatter uppercases them anyway, and this way the JSON output of the
> formatter is nicer as it uses the table header fields 1:1 for the json
> output.
2019-07-16 14:29:04 +02:00
Yu Watanabe 49808e0e2d network: NDA_LLADDR attribute can also take struct in_addr 2019-07-11 22:22:29 +09:00
Yu Watanabe 64e7ebde8b networkctl: do not show '(null)' in HW Address entry
This also fixes indentation.
2019-06-30 10:46:35 +02:00
Yu Watanabe c967d2c7ce networkctl: show link speed, duplex, auto negotiation, and port 2019-06-20 04:42:55 +09:00
Yu Watanabe 42a63431d3 network: change type of BitRates= bus property 2019-06-19 23:15:19 +09:00