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, May 24, 1:03 AM
Unknown Object (File)
Sat, May 18, 6:48 PM
Unknown Object (File)
Fri, May 10, 4:04 PM
Unknown Object (File)
Thu, May 9, 9:46 AM
Unknown Object (File)
Thu, May 9, 1:22 AM
Unknown Object (File)
Wed, May 8, 10:54 PM
Unknown Object (File)
Wed, May 8, 8:16 PM
Unknown Object (File)
Tue, May 7, 4:37 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 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.