Skip to content

Action properties#993

Open
MorganaFuture wants to merge 2 commits into
oxidecomputer:masterfrom
MorganaFuture:action-properties
Open

Action properties#993
MorganaFuture wants to merge 2 commits into
oxidecomputer:masterfrom
MorganaFuture:action-properties

Conversation

@MorganaFuture
Copy link
Copy Markdown

Adds an ActionProperties trait so each Action can advertise its read-only config as K/V pairs, plus an opteadm show-prop subcommand to read them (with a -c mode for parseable output, like dladm show-linkprop -c). The motivating case is finding which VNI a port is encapsulating into - now exposed by EncapAction. RuleDump gains a Vec<ActionProperty>;
API_VERSION bumped to 41.

Tested with cargo test -p opte -p opte-api -p oxide-vpc (10 new tests).
Closes #960.

Add an ActionProperties trait (no-op defaults, so nothing else has to
change) and require it on the four Action super-traits. RuleDump now
carries a Vec<ActionProperty> so dump-layer callers can read each
action's config; bump API_VERSION to 41.

Hook up the existing engine and oxide-vpc actions. The motivating one
is EncapAction, which now exposes vni and phys_ip_src — so an operator
can finally tell which VNI a port is encapsulating into.
Reads the action properties via the existing dump-layer ioctl and
prints them as a small table — or, with -c, as
LAYER:DIR:RULE:PROPERTY:VALUE lines (colons and backslashes escaped,
dladm show-linkprop -c style). Filters: -l, -d, -r, --prop.

Filtering and formatting helpers live in opte::print so they can be
unit-tested without linking the illumos-only binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions and other NetworkImpl-defined objects could expose simple K/V property reads

1 participant