-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes parsing of the
ip
commands on busybox systems. (#1581)
* fix: Fixes parsing of the `ip` commands on busybox systems. Embedded linux systems running busybox don't necessarily include the `iproute2` package, but instead leverage similar functionality from busybox. Unfortunately, the output from busybox `ip` commands appears to be a subset of the `iproute2` ip commands. This commit marks some fields as optional and also allows trailing whitespace (which busybox introduces) in order to parse `ip link show` and `ip address show` commands on busybox systems. * style: Fixed yaml lint errors
- Loading branch information
Showing
7 changed files
with
159 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN | ||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | ||
inet 127.0.0.1/8 scope host lo | ||
valid_lft forever preferred_lft forever | ||
inet6 ::1/128 scope host | ||
valid_lft forever preferred_lft forever | ||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP | ||
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff | ||
inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0 | ||
valid_lft forever preferred_lft forever | ||
inet6 fe80::302:03ff:fe04:0506/64 scope link | ||
valid_lft forever preferred_lft forever | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
parsed_sample: | ||
- broadcast: "00:00:00:00:00:00" | ||
flags: "LOOPBACK,UP,LOWER_UP" | ||
group: "" | ||
id: "1" | ||
interface: "lo" | ||
ip_addresses: | ||
- "127.0.0.1" | ||
ip_masks: | ||
- "8" | ||
ipv6_addresses: | ||
- "::1" | ||
ipv6_masks: | ||
- "128" | ||
mac_address: "00:00:00:00:00:00" | ||
master: "" | ||
mtu: "65536" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UNKNOWN" | ||
type: "loopback" | ||
- broadcast: "ff:ff:ff:ff:ff:ff" | ||
flags: "BROADCAST,MULTICAST,UP,LOWER_UP" | ||
group: "" | ||
id: "2" | ||
interface: "eth0" | ||
ip_addresses: | ||
- "192.168.1.1" | ||
ip_masks: | ||
- "24" | ||
ipv6_addresses: | ||
- "fe80::302:03ff:fe04:0506" | ||
ipv6_masks: | ||
- "64" | ||
mac_address: "01:02:03:04:05:06" | ||
master: "" | ||
mtu: "1500" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UP" | ||
type: "ether" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT | ||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | ||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT | ||
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff | ||
alias WAN | ||
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT | ||
link/ether 01:02:03:04:05:07 brd ff:ff:ff:ff:ff:ff | ||
alias LAN | ||
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT | ||
link/ether 01:02:03:04:05:08 brd ff:ff:ff:ff:ff:ff | ||
alias WAN2 | ||
5: imq0: <NOARP,UP,LOWER_UP> mtu 16000 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 11000 | ||
link/void | ||
alias Priority Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
parsed_sample: | ||
- broadcast: "00:00:00:00:00:00" | ||
flags: "LOOPBACK,UP,LOWER_UP" | ||
group: "" | ||
id: "1" | ||
interface: "lo" | ||
mac_address: "00:00:00:00:00:00" | ||
master: "" | ||
mode: "DEFAULT" | ||
mtu: "65536" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UNKNOWN" | ||
type: "loopback" | ||
alias: "" | ||
- broadcast: "ff:ff:ff:ff:ff:ff" | ||
flags: "BROADCAST,MULTICAST,UP,LOWER_UP" | ||
group: "" | ||
id: "2" | ||
interface: "eth0" | ||
mac_address: "01:02:03:04:05:06" | ||
master: "" | ||
mode: "DEFAULT" | ||
mtu: "1500" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UP" | ||
type: "ether" | ||
alias: "WAN" | ||
- broadcast: "ff:ff:ff:ff:ff:ff" | ||
flags: "BROADCAST,MULTICAST,UP,LOWER_UP" | ||
group: "" | ||
id: "3" | ||
interface: "eth1" | ||
mac_address: "01:02:03:04:05:07" | ||
master: "" | ||
mode: "DEFAULT" | ||
mtu: "1500" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UP" | ||
type: "ether" | ||
alias: "LAN" | ||
- broadcast: "ff:ff:ff:ff:ff:ff" | ||
flags: "BROADCAST,MULTICAST,UP,LOWER_UP" | ||
group: "" | ||
id: "4" | ||
interface: "eth2" | ||
mac_address: "01:02:03:04:05:08" | ||
master: "" | ||
mode: "DEFAULT" | ||
mtu: "1500" | ||
qdisc: "noqueue" | ||
qlen: "" | ||
state: "UP" | ||
type: "ether" | ||
alias: "WAN2" | ||
- broadcast: "" | ||
flags: "NOARP,UP,LOWER_UP" | ||
group: "" | ||
id: "5" | ||
interface: "imq0" | ||
mac_address: "" | ||
master: "" | ||
mode: "DEFAULT" | ||
mtu: "16000" | ||
qdisc: "pfifo_fast" | ||
qlen: "11000" | ||
state: "UNKNOWN" | ||
type: "void" | ||
alias: "Priority Queue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters