Commit graph

171 commits

Author SHA1 Message Date
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
Yu Watanabe 5ca5048249 networkctl: fix use of uninitialized value 2019-06-13 10:13:57 +02:00
Zbigniew Jędrzejewski-Szmek aafec74d04
Merge pull request #12733 from keszybz/sd-bus-error-reporting
Bus error reporting improvements
2019-06-04 12:01:52 +02:00
Yu Watanabe 38b9af6154 networkctl: re-cast value stored in Set with INT_TO_PTR() 2019-06-04 09:08:55 +02:00
Zbigniew Jędrzejewski-Szmek 8210a61ad5 networkctl: log quietly if we fail to get bit rates
If we query older networked, they will be missing. This is not an error.
Also, make the error more informative, because the bus error itself might
be just "Unknown interface or property" which is not enough to understand
what is going on.
2019-06-04 08:37:04 +02:00
Yu Watanabe 81914d9f13 networkctl: drop unnecessary use of table_add_cell_full() 2019-06-03 16:43:18 +09:00
Yu Watanabe 335dd8ba13 networkctl: show link bit rates 2019-06-01 10:24:47 +09:00
Yu Watanabe a459b24f7e networkctl: optionally show link statistics 2019-06-01 10:24:47 +09:00
Zbigniew Jędrzejewski-Szmek 90e29fe1a5 networkctl: shorten Minimum/Maximum to min/max
This makes the output slightly "lighter" visually. min/max are well-established
forms, so there's no risk of misunderstanding. Also, not using title-case looks
a bit better.

Follow-up for c06ff86e25.

$ build/networkctl status '*'|grep MTU
                   MTU: 65536
                   MTU: 1500 (min: 68, max: 9000)
                   MTU: 1500 (max: 2048)
                   MTU: 1500 (min: 256, max: 2304)
                   MTU: 1500 (min: 68, max: 65535)
                   MTU: 1500 (min: 68, max: 65521)
                   MTU: 1500 (min: 68, max: 65535)
                   MTU: 1500 (max: 65535)
                   MTU: 1360 (min: 68, max: 65535)
2019-06-01 10:24:08 +09:00
Yu Watanabe c06ff86e25 networkctl: do not show zero maximum MTU 2019-05-31 10:55:07 +02:00
Yu Watanabe e2835111dd networkctl: fix memleak
Closes #12701.
2019-05-30 20:58:36 +09:00
Yu Watanabe 518a66ec08 tree-wide: replace if_indextoname() with format_ifname() 2019-05-29 14:21:19 +09:00
Yu Watanabe 658e910640 networkctl: use Table for 'lldp' command 2019-05-29 14:21:19 +09:00
Yu Watanabe 0232beed9c networkctl: use Table for 'label' command 2019-05-29 14:21:19 +09:00
Yu Watanabe 98d5bef3c5 networkctl: use Table for 'status' command 2019-05-29 14:21:19 +09:00
Yu Watanabe ff7c88a2f3 networkctl: use Table for 'list' command 2019-05-29 14:21:19 +09:00
Yu Watanabe 4bddccc684 networkctl: use parse_ifindex_or_ifname() 2019-05-29 13:22:01 +09:00
Susant Sahani 9cd8c76661 networkctl: add support to delete virtual netdevs
We now don't have the support to delete netdevs and dependent
upon iproute to delete. With this we can delete via networkctl
and use in our test cases too.

Note that it supports deleting multiple links at once.

```
 sudo ./networkctl delete test1 test2 test3 test4
```
2019-05-29 11:00:37 +09:00
Susant Sahani 0307afc681 networkctl: add support to display Transmit/Recieve queue length (#12633)
```
(networkctl) % build/networkctl status veth-test
● 13: veth-test
            Link File: /usr/lib/systemd/network/99-default.link
         Network File: /usr/lib/systemd/network/veth0.network
                 Type: ether
                State: routable (configured)
               Driver: veth
           HW Address: 8a:a6:1c:3f:a6:1a
                  MTU: 1500
          Minimum MTU: 68
          Maximum MTU: 65535
Transmit Queue Length: 1
 Receive Queue Length: 1
              Address: 192.168.5.31
                       fe80::88a6:1cff:fe3f:a61a
              Gateway: 192.168.5.1
                  DNS: 192.168.5.1
                  NTP: 192.168.5.1
            Time Zone: Asia/Kolkata
         Connected To: Zeus on port peer-test
```
2019-05-22 17:53:12 +09:00
Susant Sahani 2c73f59b81 networkctl: Add support to display min and max MTU
(networkctl) % ./networkctl status enp0s31f6                                                                                                                          ~/tt/networkctl/build
● 4: enp0s31f6
       Link File: /usr/lib/systemd/network/99-default.link
    Network File: n/a
            Type: ether
           State: n/a (unmanaged)
            Path: pci-0000:00:1f.6
          Driver: e1000e
          Vendor: Intel Corporation
           Model: Ethernet Connection (2) I219-LM
      HW Address: 8c:16:45:6c:83:b9 (LCFC(HeFei) Electronics Technology co., ltd)
             MTU: 1500
     Minimum MTU: 68
     Maximum MTU: 9000
2019-05-21 17:44:36 +05:30
Susant Sahani 4015d106d4 networkctl: Display MTU
Now the MTU is not displayed. with this patch it's fixed.

(networkctl) % ./networkctl status enp0s31f6                                                                                                                          ~/tt/networkctl/build
WARNING: systemd-networkd is not running, output will be incomplete.

● 4: enp0s31f6
       Link File: /usr/lib/systemd/network/99-default.link
    Network File: n/a
            Type: ether
           State: n/a (unmanaged)
            Path: pci-0000:00:1f.6
          Driver: e1000e
          Vendor: Intel Corporation
           Model: Ethernet Connection (2) I219-LM
      HW Address: 8c:16:45:6c:83:b9 (LCFC(HeFei) Electronics Technology co., ltd)
             MTU: 1500
2019-05-21 17:29:18 +05:30
Lennart Poettering e95be7def2
Merge pull request #12411 from keszybz/pr/12394
run: when emitting the calendarspec warning, use red
2019-05-08 10:11:32 -04:00
Zbigniew Jędrzejewski-Szmek 1a04395959 Enable log colors for most of tools in /usr/bin
When emitting the calendarspec warning we want to see some color.
Follow-up for 04220fda5c.

Exceptions:
- systemctl, because it has a lot hand-crafted coloring
- tmpfiles, sysusers, stdio-bridge, etc, because they are also used in
  services and I'm not sure if this wouldn't mess up something.
2019-05-08 09:50:21 +02:00
Yu Watanabe 67a4683364 network: use IN_ADDR_NULL and ETHER_ADDR_NULL
The change in manager_rtnl_process_address() may not be necessary,
but for safety, let's initialize the value.
2019-05-07 16:55:19 +02:00
Zbigniew Jędrzejewski-Szmek ca78ad1de9 headers: remove unneeded includes from util.h
This means we need to include many more headers in various files that simply
included util.h before, but it seems cleaner to do it this way.
2019-03-27 11:53:12 +01:00
Lennart Poettering 760877e90c util: split out sorting related calls to new sort-util.[ch] 2019-03-13 12:16:43 +01:00
Yu Watanabe c9cc038343 network: introduce 'degraded-carrier' operstate to order all states
Previously, 'degraded' state is ambiguous for bonding or bridge master:
1. one or more slave interfaces does not have carrier,
2. no link local address is assigned to the master,
3. combination of the above two.

This makes the above case 1 and 3 are in the new 'degraded-carrier'
state, and makes 'degraded' state as all slaves are active but no
link local address on master.
2019-03-13 14:29:00 +09:00
Yu Watanabe 85323805be networkctl: make enslaved operstate green 2019-02-18 18:04:18 +09:00
Yu Watanabe a696290474 networkctl: accept wildcards to specify links
Closes #10840.
2019-02-15 13:47:48 +09:00
Lennart Poettering 9a6f746fb6 locale-util: prefix special glyph enum values with SPECIAL_GLYPH_
This has been irritating me for quite a while: let's prefix these enum
values with a common prefix, like we do for almost all other enums.

No change in behaviour, just some renaming.
2018-12-14 08:22:54 +01:00
Zbigniew Jędrzejewski-Szmek 294bf0c34a Split out pretty-print.c and move pager.c and main-func.h to shared/
This is high-level functionality, and fits better in shared/ (which is for
our executables), than in basic/ (which is also for libraries).
2018-11-20 18:40:02 +01:00
Zbigniew Jędrzejewski-Szmek 4e2ca44233 networkctl: define main through macro 2018-11-20 16:48:21 +01:00
Zbigniew Jędrzejewski-Szmek 0221d68a13 basic/pager: convert the pager options to a flags argument
Pretty much everything uses just the first argument, and this doesn't make this
common pattern more complicated, but makes it simpler to pass multiple options.
2018-11-14 16:25:11 +01:00
Yu Watanabe 2c740afd16 tree-wide: do not assign unused return values 2018-09-23 17:18:50 +09:00