Page MenuHomeFreeBSD

netlink: dump interface capabilities with other interface data
ClosedPublic

Authored by melifaro on May 30 2023, 10:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 10:22 PM
Unknown Object (File)
Fri, Dec 6, 7:22 AM
Unknown Object (File)
Fri, Dec 6, 7:21 AM
Unknown Object (File)
Fri, Dec 6, 7:21 AM
Unknown Object (File)
Fri, Dec 6, 7:21 AM
Unknown Object (File)
Mon, Dec 2, 8:42 AM
Unknown Object (File)
Wed, Nov 27, 5:19 PM
Unknown Object (File)
Nov 15 2024, 6:06 AM

Details

Summary

This change exports interface capabilities using the standard Netlink attribute type, bitset, and switches ifconfig(8) to use it when displaying interface data.

Bitset comes in two representations. The first one is "compact", where the bits are exported via two arrays - "mask" listing the "valid" bits and "values, providing the values for those bits. The second one is more verbose, listing each bit as a separate item, with its name, id and value. The latter option is handy when submitting update requests.

The support for setting capabilities will be added in the upcoming diffs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51860
Build 48751: arc lint + arc unit

Event Timeline

melifaro retitled this revision from netlink: add support for getting ifcaps to netlink: dump interface capabilities with other interface data.May 30 2023, 10:58 AM
melifaro edited the summary of this revision. (Show Details)
melifaro added reviewers: network, kib.
sys/net/if.h
341

At very least, can you add something along IFCAP_BIT() and make IFCAP_XXX expressed as IFCAP_BIT(IFCAP_B_XXX) and IFCAP2_BIT() as needed?

353

Why do we need this array embedded into each compilation unit including if.h?

melifaro edited the summary of this revision. (Show Details)

Address comments.

sys/net/if.h
341

Indeed. Does it look better now?

353

No. Moved to a separate header.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 16 2023, 3:34 PM
This revision was automatically updated to reflect the committed changes.