ifconfig parsing of freebsd silently skips most fields
See original GitHub issueI’m trying to use jc to parse ifconfig output from a variety of FreeBSD systems. Unfortunately, most of the fields in the command output are being silently skipped by jc:
>>> import jc.parsers.ifconfig
>>> ifc0 = '''cxl3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
... options=6ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6,HWRXTSTMP,NOMAP>
... ether 00:07:43:3d:b7:70
... hwaddr 00:07:43:3d:b7:88
... media: Ethernet 10Gbase-LR <full-duplex,rxpause,txpause>
... status: active
... nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
... plugged: SFP/SFP+/SFP28 10G Base-LR (LC)
... vendor: INNOLIGHT PN: TR-PX13L-N00 SN: INJBL0431986 DATE: 2020-01-04
... module temperature: 21.20 C voltage: 3.16 Volts
... lane 1: RX power: 0.49 mW (-3.10 dBm) TX bias: 23.85 mA'''
>>> r0 = jc.parsers.ifconfig.parse(ifc0)
>>> r0
[{'name': 'cxl3', 'flags': 8843, 'state': ['UP', 'BROADCAST', 'RUNNING', 'SIMPLEX', 'MULTICAST'], 'metric': 0, 'mtu': 1500, 'mac_addr': '00:07:43:3d:b7:70', 'type': None, 'ipv4_addr': None, 'ipv4_bcast': None, 'ipv4_mask': None, 'ipv6_addr': None, 'ipv6_mask': None, 'ipv6_scope': None, 'rx_packets': None, 'rx_errors': None, 'rx_dropped': None, 'rx_overruns': None, 'rx_frame': None, 'tx_packets': None, 'tx_errors': None, 'tx_dropped': None, 'tx_overruns': None, 'tx_carrier': None, 'tx_collisions': None, 'rx_bytes': None, 'tx_bytes': None}]
Its unclear whether this is a bug, or expected behavior?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Chapter 32. Firewalls | FreeBSD Documentation Portal
FreeBSD has three firewalls built into the base system: PF, IPFW, and IPFILTER. This chapter covers how to define packet filtering rules, ...
Read more >ipfw(8) - FreeBSD
-s [field] When listing pipes, sort according to one of the four counters (total or current packets or bytes). -t When listing, show...
Read more >ifconfig(8) - FreeBSD
The ifconfig utility must be used at boot time to define the network address of each interface ... See the prefixlen parameter below...
Read more >pf.conf(5) - FreeBSD Manual Pages
For example: set fingerprints "/etc/pf.os.devel" set skip on <ifspec> List ... generate their dont-fragment packets with a zero IP identification field.
Read more >FreeBSD Network Administrators Guide
If you already know how IP routing works and how address resolution is performed, you can skip this chapter. Chapter 3., Configuringthe NetworkingHardware, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies for the delay responding here, I was travelling for much of the past month.
The lane line is not vendor specific, and does refer to optical attenuation metrics. The lane is an integer. Here are a few more examples:
Thanks! I should be able to add the
lane
lines to the next release ofjc
.