PROTOCOLS
RuleWatcherV4
Defined in fuchsia.net.routes/ipv4.fidl
An observer protocol for changes in the system's IPv4 rules table.
Watch
Hanging-Get style API for observing routing rule changes.
Clients must only have one pending Watch
call at a time. Calling
Watch
while a request is already pending will cause the protocol to
close.
The first N events will always be existing
where N is the number of
IPv4 rules that already existed when the server-end of the protocol was
initialized. The following event will be idle
signaling the end of the
existing
events. At this point the client has watched all existing
state and will never again observe an existing
event.
- response
events
A vector of at mostMAX_EVENTS
events.
Request
<EMPTY>
Response
Name | Type |
---|---|
events |
vector<RuleEventV4>:512
|
RuleWatcherV6
Defined in fuchsia.net.routes/ipv6.fidl
An observer protocol for changes in the system's IPv6 rules table.
Watch
Hanging-Get style API for observing routing rule changes.
Clients must only have one pending Watch
call at a time. Calling
Watch
while a request is already pending will cause the protocol to
close.
The first N events will always be existing
where N is the number of
IPv6 rules that already existed when the server-end of the protocol was
initialized. The following event will be idle
signaling the end of the
existing
events. At this point the client has watched all existing
state and will never again observe an existing
event.
- response
events
A vector of at mostMAX_EVENTS
events.
Request
<EMPTY>
Response
Name | Type |
---|---|
events |
vector<RuleEventV6>:512
|
State
Defined in fuchsia.net.routes/routes.fidl
Provides access to the system's routing state.
GetRouteTableName
Gets the route table name by its ID.
- request
table_id
the ID of the route table in question.
- response
table_name
the name of the route table, if the route table does not have a name, an empty string is returned.
- error
NO_TABLE
if the route table does not exist.
Request
Name | Type |
---|---|
table_id |
TableId
|
Response
Name | Type |
---|---|
payload |
State_GetRouteTableName_Result
|
Resolve
Resolves the route to a destination.
- request
destination
the IP address to resolve a route to. If the unspecified address (all zeroes) is provided, the default route will be returned. The variant ofdestination
determines variant of fuchsia.net/IpAddress fields in the resolved route.
- response
result
contains the resolved route todestination
.
- error
ZX_ERR_ADDRESS_UNREACHABLE
ifdestination
can't be resolved.
Request
Name | Type |
---|---|
destination |
fuchsia.net/IpAddress
|
Response
Name | Type |
---|---|
payload |
State_Resolve_Result
|
StateV4
Defined in fuchsia.net.routes/ipv4.fidl
Provides observability to the system's IPv4 routing state.
GetRuleWatcherV4
Initialize a watcher for IPv4 rules state.
- request 'watcher' grants access to the
RuleWatcherV4
Protocol. - request
watch_options
specifies the behavior of theRuleWatcherV4
.
Request
Name | Type |
---|---|
watcher |
server_end:RuleWatcherV4
|
options |
RuleWatcherOptionsV4
|
GetWatcherV4
Initialize a watcher for IPv4 routing state.
- request 'watcher' grants access to the
WatcherV4
Protocol. - request
watch_options
specifies the behavior of theWatcherV4
.
Request
Name | Type |
---|---|
watcher |
server_end:WatcherV4
|
options |
WatcherOptionsV4
|
StateV6
Defined in fuchsia.net.routes/ipv6.fidl
Provides observability to the system's IPv6 routing state.
GetRuleWatcherV6
Initialize a watcher for IPv6 rules state.
- request 'watcher' grants access to the
RuleWatcherV6
Protocol. - request
watch_options
specifies the behavior of theRuleWatcherV6
.
Request
Name | Type |
---|---|
watcher |
server_end:RuleWatcherV6
|
options |
RuleWatcherOptionsV6
|
GetWatcherV6
Initialize a watcher for IPv6 routing state.
- request 'watcher' grants access to the
WatcherV6
Protocol. - request
watch_options
specifies the behavior of theWatcherV6
.
Request
Name | Type |
---|---|
watcher |
server_end:WatcherV6
|
options |
WatcherOptionsV6
|
WatcherV4
Defined in fuchsia.net.routes/ipv4.fidl
An observer protocol for changes in system's IPv4 routing state.
Watch
Hanging-Get style API for observing routing changes.
Clients must only have one pending Watch
call at a time. Calling
Watch
while a request is already pending will cause the protocol to
close.
The first N events will always be existing
where N is the number of
IPv4 routes that already existed when the server-end of the protocol was
initialized. The following event will be idle
signaling the end of the
existing
events. At this point the client has watched all existing
state and will never again observe an existing
event.
Events are returned in batches of up to MAX_EVENTS
events. There is no
correlation between the batch size/boundary and it's contents: it is
perfectly valid for the server to split the block of existing
events,
across several batches. Clients should view this API as providing a
stream of events, where batches are used to reduce IPC load on the
system.
- response
events
A vector of at mostMAX_EVENTS
events.
Request
<EMPTY>
Response
Name | Type |
---|---|
events |
vector<EventV4>:512
|
WatcherV6
Defined in fuchsia.net.routes/ipv6.fidl
An observer protocol for changes in system's IPv6 routing state.
Watch
Hanging-Get style API for observing routing changes.
Clients must only have one pending Watch
call at a time. Calling
Watch
while a request is already pending will cause the protocol to
close.
The first N events will always be existing
where N is the number of
IPv6 routes that already existed when the server-end of the protocol was
initialized. The following event will be idle
signaling the end of the
existing
events. At this point the client has watched all existing
state and will never again observe an existing
event.
Events are returned in batches of up to MAX_EVENTS
events. There is no
correlation between the batch size/boundary and it's contents: it is
perfectly valid for the server to split the block of existing
events,
across several batches. Clients should view this API as providing a
stream of events, where batches are used to reduce IPC load on the
system.
- response
events
A vector of at mostMAX_EVENTS
events.
Request
<EMPTY>
Response
Name | Type |
---|---|
events |
vector<EventV6>:512
|
STRUCTS
All
Defined in fuchsia.net.routes/routes.fidl
<EMPTY>
Between
Defined in fuchsia.net.routes/rules.fidl
Field | Type | Description | Default |
---|---|---|---|
start |
uint32
|
start of the range, inclusive. |
No default |
end |
uint32
|
end of the range, inclusive. |
No default |
Empty
Defined in fuchsia.net.routes/routes.fidl
A placeholder for empty values.
<EMPTY>
InstalledRuleV4
Defined in fuchsia.net.routes/ipv4.fidl
An installed IPv4 routing rule.
Field | Type | Description | Default |
---|---|---|---|
rule_set_priority |
RuleSetPriority
|
Rule sets are ordered by the rule set priority, rule sets are disjoint and don’t have interleaving rules among them. |
No default |
rule_index |
RuleIndex
|
Rules within a rule set are locally ordered, together with the rule set priority, this defines a global order for all installed rules. |
No default |
matcher |
RuleMatcherV4
|
The matcher part of the rule, the rule is a no-op if the matcher does not match the packet. |
No default |
action |
RuleAction
|
The action part of the rule that describes what to do if the matcher matches the packet. |
No default |
InstalledRuleV6
Defined in fuchsia.net.routes/ipv6.fidl
An installed IPv6 routing rule.
Field | Type | Description | Default |
---|---|---|---|
rule_set_priority |
RuleSetPriority
|
Rule sets are ordered by the rule set priority, rule sets are disjoint and don’t have interleaving rules among them. |
No default |
rule_index |
RuleIndex
|
Rules within a rule set are locally ordered, together with the rule set priority, this defines a global order for all installed rules. |
No default |
matcher |
RuleMatcherV6
|
The matcher part of the rule, the rule is a no-op if the matcher does not match the packet. |
No default |
action |
RuleAction
|
The action part of the rule that describes what to do if the matcher matches the packet. |
No default |
Main
Defined in fuchsia.net.routes/routes.fidl
<EMPTY>
Marked
Defined in fuchsia.net.routes/rules.fidl
Field | Type | Description | Default |
---|---|---|---|
mask |
uint32
|
Mask to apply before comparing to the range in |
No default |
between |
Between
|
The mark is between the given range. |
No default |
RouteTargetV4
Defined in fuchsia.net.routes/ipv4.fidl
Field | Type | Description | Default |
---|---|---|---|
outbound_interface |
fuchsia.net/InterfaceId
|
The interface ID of the target's outbound interface. |
No default |
next_hop |
fuchsia.net/Ipv4Address?
|
The optional next-hop of the target. If provided, the address must be a unicast address. |
No default |
RouteTargetV6
Defined in fuchsia.net.routes/ipv6.fidl
Field | Type | Description | Default |
---|---|---|---|
outbound_interface |
fuchsia.net/InterfaceId
|
The interface ID of the target's outbound interface. |
No default |
next_hop |
fuchsia.net/Ipv6Address?
|
The optional next-hop of the target. If provided, the address must be a unicast address. |
No default |
RouteV4
Defined in fuchsia.net.routes/ipv4.fidl
A RouteV4
specifies an IPv4 network route.
Field | Type | Description | Default |
---|---|---|---|
destination |
fuchsia.net/Ipv4AddressWithPrefix
|
The destination subnet of the route. When making a routing decision for a given packet the route whose destination forms the longest matching prefix will be selected, with ties being broken by the route's metric. |
No default |
action |
RouteActionV4
|
Packets matching this route will have the specified action applied to them. |
No default |
properties |
RoutePropertiesV4
|
The additional properties of the IPv4 route. |
No default |
RouteV6
Defined in fuchsia.net.routes/ipv6.fidl
A RouteV6
specifies an IPv6 network route.
Field | Type | Description | Default |
---|---|---|---|
destination |
fuchsia.net/Ipv6AddressWithPrefix
|
The destination subnet of the route. When making a routing decision for a given packet the route whose destination forms the longest matching prefix will be selected, with ties being broken by the route's metric. |
No default |
action |
RouteActionV6
|
Packets matching this route will have the specified action applied to them. |
No default |
properties |
RoutePropertiesV6
|
The additional properties of the IPv6 route. |
No default |
State_GetRouteTableName_Response
Defined in fuchsia.net.routes/routes.fidl
Field | Type | Description | Default |
---|---|---|---|
table_name |
TableName
|
No default |
State_Resolve_Response
Defined in fuchsia.net.routes/routes.fidl
Field | Type | Description | Default |
---|---|---|---|
result |
Resolved
|
A resolved route. Contains the information for the "next-hop" or immediate-destination that is the result of a route resolution. A resolved route is only meaningful in the context of a requested destination. |
No default |
Unmarked
Defined in fuchsia.net.routes/rules.fidl
<EMPTY>
Unreachable
Defined in fuchsia.net.routes/rules.fidl
<EMPTY>
ENUMS
State_GetRouteTableName_Error strict
Type: uint32
Defined in fuchsia.net.routes/routes.fidl
Name | Value | Description |
---|---|---|
NO_TABLE |
1 |
TABLES
BaseMatcher
Defined in fuchsia.net.routes/rules.fidl
The common matcher that can be matched to both IPv4 and IPv6 packets.
A matcher matches a packet if all of the present fields match the corresponding properties.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
locally_generated |
bool
|
Matches the packet iff the packet was locally generated. |
2 |
bound_device |
InterfaceMatcher
|
Matches the packet iff the packet is sent with |
3 |
mark_1 |
MarkMatcher
|
Matches the MARK_1 domain. |
4 |
mark_2 |
MarkMatcher
|
Matches for the MARK_2 domain. |
Destination
Defined in fuchsia.net.routes/routes.fidl
Collection of addresses and identifiers describing a network destination.
A Destination
is the "next-hop" for a routed packet.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
address |
fuchsia.net/IpAddress
|
The IP address of the destination. |
2 |
mac |
fuchsia.net/MacAddress
|
The MAC address of the destination. Only set if the destination is on a link that requires a MAC address. |
3 |
interface_id |
fuchsia.net/InterfaceId
|
The interface identifier over which the destination can be reached. |
4 |
source_address |
fuchsia.net/IpAddress
|
The preferred local IP address used to communicate with the destination. |
EffectiveRouteProperties
Defined in fuchsia.net.routes/routes.fidl
The effective properties of a route installed in the system.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
metric |
fuchsia.net/RouteMetric
|
The route's effective metric, dependent on the value of the route's
SpecifiedRouteProperties. If the |
InstalledRouteV4
Defined in fuchsia.net.routes/ipv4.fidl
An InstalledRouteV4
specifies an IPv4 network route that is installed in
the system's routing table.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
route |
RouteV4
|
The route. |
2 |
effective_properties |
EffectiveRouteProperties
|
The route's effective properties. |
3 |
table_id |
TableId
|
The ID of the table to which this route belongs. |
InstalledRouteV6
Defined in fuchsia.net.routes/ipv6.fidl
An InstalledRouteV6
specifies an IPv6 network route that is installed in
the system's routing table.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
route |
RouteV6
|
The route. |
2 |
effective_properties |
EffectiveRouteProperties
|
The route's effective properties. |
3 |
table_id |
TableId
|
The ID of the table to which this route belongs. |
RoutePropertiesV4
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
specified_properties |
SpecifiedRouteProperties
|
The route's specified properties. |
RoutePropertiesV6
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
specified_properties |
SpecifiedRouteProperties
|
The route's specified properties. |
RuleMatcherV4
Defined in fuchsia.net.routes/ipv4.fidl
The matcher part of the rule that is used to match packets.
A matcher matches a packet if all of the present fields match the corresponding properties.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
from |
fuchsia.net/Ipv4AddressWithPrefix
|
Matches whether the source address of the packet is from the subnet. |
2 |
base |
BaseMatcher
|
The rest of the matcher that is common between IP versions. |
RuleMatcherV6
Defined in fuchsia.net.routes/ipv6.fidl
The matcher part of the rule that is used to match packets.
A matcher matches a packet if all of the present fields match the corresponding properties.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
from |
fuchsia.net/Ipv6AddressWithPrefix
|
Matches whether the source address of the packet is from the subnet. |
2 |
base |
BaseMatcher
|
The rest of the matchers that is common between IP versions. |
RuleWatcherOptionsV4
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Field | Type | Description |
---|
RuleWatcherOptionsV6
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Field | Type | Description |
---|
SpecifiedRouteProperties
Defined in fuchsia.net.routes/routes.fidl
The properties of the route that were explicitly specified at the time the route was created.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
metric |
SpecifiedMetric
|
The route's effective metric will be determined by whichever value is specified below. |
WatcherOptionsV4
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
table_interest |
TableInterest
|
Filter events on tables matching Interpreted as |
WatcherOptionsV6
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
table_interest |
TableInterest
|
Filter events on tables matching Interpreted as |
UNIONS
EventV4 flexible
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
existing |
InstalledRouteV4
|
A route that already existed when watching started. |
2 |
idle |
Empty
|
Sentinel value indicating no more |
3 |
added |
InstalledRouteV4
|
A route that was added while watching. |
4 |
removed |
InstalledRouteV4
|
A route that was removed while watching. |
EventV6 flexible
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
existing |
InstalledRouteV6
|
A route that already existed when watching started. |
2 |
idle |
Empty
|
Sentinel value indicating no more |
3 |
added |
InstalledRouteV6
|
A route that was added while watching. |
4 |
removed |
InstalledRouteV6
|
A route that was removed while watching. |
InterfaceMatcher flexible
Defined in fuchsia.net.routes/rules.fidl
Matches on the originating interface of the outgoing packet.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
device_name |
fuchsia.net.interfaces/Name
|
Matches the device iff the names match. The name is not a pattern or regex, it needs to be an exact match for the rule to be chosen. |
MarkMatcher flexible
Defined in fuchsia.net.routes/rules.fidl
Matches the mark value of a packet.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
unmarked |
Unmarked
|
This mark domain does not have a mark. |
2 |
marked |
Marked
|
Resolved strict
Defined in fuchsia.net.routes/routes.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
direct |
Destination
|
The requested destination is directly reachable. |
2 |
gateway |
Destination
|
The requested destination is reachable through a gateway, thus the next hop is the gateway. |
RouteActionV4 flexible
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
forward |
RouteTargetV4
|
Forward the packet to the specified target. |
RouteActionV6 flexible
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
forward |
RouteTargetV6
|
Forward the packet to the specified target. |
RuleAction flexible
Defined in fuchsia.net.routes/rules.fidl
Actions of a rule if the matcher matches.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
lookup |
TableId
|
Look for a route in the indicated route table. If there is no matching route in the target table, the lookup will continue to consider the next rule. |
2 |
unreachable |
Unreachable
|
Return network is unreachable. This is contrary to if a |
RuleEventV4 flexible
Defined in fuchsia.net.routes/ipv4.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
existing |
InstalledRuleV4
|
A rule that already existed when watching started. |
2 |
idle |
Empty
|
Sentinel value indicating no more |
3 |
added |
InstalledRuleV4
|
A rule that was added while watching. |
4 |
removed |
InstalledRuleV4
|
A rule that was removed while watching. |
RuleEventV6 flexible
Defined in fuchsia.net.routes/ipv6.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
existing |
InstalledRuleV6
|
A rule that already existed when watching started. |
2 |
idle |
Empty
|
Sentinel value indicating no more |
3 |
added |
InstalledRuleV6
|
A rule that was added while watching. |
6 |
removed |
InstalledRuleV6
|
A rule that was removed while watching. |
SpecifiedMetric strict
Defined in fuchsia.net.routes/routes.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
explicit_metric |
fuchsia.net/RouteMetric
|
The route's metric will be this explicitly specified value. |
2 |
inherited_from_interface |
Empty
|
The route's metric is inherited from its outbound interface, and will track this value as it changes throughout the route's lifetime. Clients may prefer this approach if they wish to offload the responsibility of "which route is best" to the system. |
State_GetRouteTableName_Result strict
Defined in fuchsia.net.routes/routes.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
State_GetRouteTableName_Response
|
|
2 |
err |
State_GetRouteTableName_Error
|
State_Resolve_Result strict
Defined in fuchsia.net.routes/routes.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
State_Resolve_Response
|
|
2 |
err |
zx/Status
|
TableInterest flexible
Defined in fuchsia.net.routes/routes.fidl
Specifies which table(s) the watcher is interested in.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
only |
TableId
|
Only watch for events on the specified table. |
2 |
main |
Main
|
Watches on the main table without knowing the table ID. |
3 |
all |
All
|
Watches for all routing tables. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
DEFAULT_RULE_SET_PRIORITY |
4294967295
|
uint32 |
A reserved rule set priority for the netstack. This is used by the network stack for installing default rules. Added: HEAD
|
MAX_EVENTS |
512
|
uint16 |
The maximum number of events that can be returned by one call to Added: HEAD
|
MAX_TABLE_NAME_LEN |
255
|
uint64 |
Maximum length of a table name. Added: HEAD
|
ALIASES
Name | Value | Description |
---|---|---|
RuleIndex |
uint32 |
The index of a rule within a provided rule set. Rules within the same Added: HEAD
|
RuleSetPriority |
uint32 |
The priority of the rule set, all rule sets are linearized based on this. Rules of a Added: HEAD
|
TableId |
uint32 |
The ID of a route table.
Added: HEAD
|
TableName |
string [MAX_TABLE_NAME_LEN ] |
The name of a route table. Added: HEAD
|