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)
Fri, Nov 15, 6:06 AM
Unknown Object (File)
Fri, Nov 15, 6:04 AM
Unknown Object (File)
Fri, Nov 15, 5:39 AM
Unknown Object (File)
Sun, Nov 3, 8:01 PM
Unknown Object (File)
Sun, Nov 3, 8:01 PM
Unknown Object (File)
Sun, Nov 3, 8:01 PM
Unknown Object (File)
Sun, Nov 3, 8:00 PM
Unknown Object (File)
Sun, Nov 3, 7:47 PM

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 Not Applicable
Unit
Tests Not Applicable

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.