通訊協定
RuleWatcherV4
定義於 fuchsia.net.routes/ipv4.fidl
這個觀察器通訊協定,用於瞭解系統 IPv4 規則表格的變更。
觀看
Hanging-Get style API,用於觀察轉送規則變更。
用戶端一次只能有一項待處理的 Watch
呼叫。如果在要求已等待的情況下呼叫 Watch
,將會導致通訊協定關閉。
前 N 個事件一律為 existing
,其中 N 是通訊協定的伺服器端初始化時存在的 IPv4 規則數量。下列事件將 idle
表示 existing
事件已結束。此時,用戶端已觀察到所有現有狀態,再也不會再次觀察 existing
事件。
- 回應
events
最多只能有MAX_EVENTS
事件的向量。
要求
<EMPTY>
回應
名稱 | 類型 |
---|---|
events |
vector<RuleEventV4>[512]
|
RuleWatcherV6
定義於 fuchsia.net.routes/ipv6.fidl
這個觀察器通訊協定,用於瞭解系統 IPv6 規則資料表中的變更。
觀看
Hanging-Get style API,用於觀察轉送規則變更。
用戶端一次只能有一項待處理的 Watch
呼叫。如果在要求已等待的情況下呼叫 Watch
,將會導致通訊協定關閉。
前 N 個事件一律為 existing
,其中 N 是通訊協定的伺服器端初始化時存在的 IPv6 規則數量。下列事件將 idle
表示 existing
事件已結束。此時,用戶端已觀察到所有現有狀態,再也不會再次觀察 existing
事件。
- 回應
events
最多只能有MAX_EVENTS
事件的向量。
要求
<EMPTY>
回應
名稱 | 類型 |
---|---|
events |
vector<RuleEventV6>[512]
|
狀態
定義於 fuchsia.net.routes/routes.fidl
提供系統轉送狀態的存取權。
GetRouteTableName
根據路徑資料表取得路徑資料表名稱。
- 要求
table_id
有問題的路徑資料表 ID。
- 回應
table_name
路徑資料表的名稱,如果路徑資料表沒有名稱,系統會傳回空字串。
- 如果路徑資料表不存在,則會傳回錯誤
NO_TABLE
。
要求
名稱 | 類型 |
---|---|
table_id |
TableId
|
回應
名稱 | 類型 |
---|---|
payload |
State_GetRouteTableName_Result
|
解決
解析前往目的地的路徑。
- 要求
destination
做為解析路徑的 IP 位址。如果您提供未指定的地址 (全部零),就會傳回預設路徑。destination
的變體會決定已解析路徑中 fuchsia.net/IpAddress 欄位的變化版本。
- 回應
result
包含指向destination
的已解析路徑。
- 如果無法解析
destination
,則傳回ZX_ERR_ADDRESS_UNREACHABLE
錯誤。
要求
名稱 | 類型 |
---|---|
destination |
fuchsia.net/IpAddress
|
回應
名稱 | 類型 |
---|---|
payload |
State_Resolve_Result
|
StateV4
定義於 fuchsia.net.routes/ipv4.fidl
可供觀測系統的 IPv4 轉送狀態。
GetRuleWatcherV4
初始化 IPv4 規則狀態的看守工具。
- 要求「監看程式」授予
RuleWatcherV4
通訊協定的存取權。 - 要求
watch_options
會指定RuleWatcherV4
的行為。
要求
名稱 | 類型 |
---|---|
watcher |
server_end<RuleWatcherV4>
|
options |
RuleWatcherOptionsV4
|
GetWatcherV4
初始化 IPv4 轉送狀態的監看程式。
- 要求「監看程式」授予
WatcherV4
通訊協定的存取權。 - 要求
watch_options
會指定WatcherV4
的行為。
要求
名稱 | 類型 |
---|---|
watcher |
server_end<WatcherV4>
|
options |
WatcherOptionsV4
|
StateV6
定義於 fuchsia.net.routes/ipv6.fidl
可供觀測系統的 IPv6 轉送狀態。
GetRuleWatcherV6
初始化 IPv6 規則狀態的監看程式。
- 要求「監看程式」授予
RuleWatcherV6
通訊協定的存取權。 - 要求
watch_options
會指定RuleWatcherV6
的行為。
要求
名稱 | 類型 |
---|---|
watcher |
server_end<RuleWatcherV6>
|
options |
RuleWatcherOptionsV6
|
GetWatcherV6
初始化 IPv6 轉送狀態的監看程式。
- 要求「監看程式」授予
WatcherV6
通訊協定的存取權。 - 要求
watch_options
會指定WatcherV6
的行為。
要求
名稱 | 類型 |
---|---|
watcher |
server_end<WatcherV6>
|
options |
WatcherOptionsV6
|
WatcherV4
定義於 fuchsia.net.routes/ipv4.fidl
這個觀察器通訊協定,用於瞭解系統 IPv4 轉送狀態的變化。
觀看
Hanging-Get style API,用於觀察路線變更。
用戶端一次只能有一項待處理的 Watch
呼叫。如果在要求已等待的情況下呼叫 Watch
,將會導致通訊協定關閉。
前 N 個事件一律為 existing
,其中 N 是通訊協定的伺服器端初始化時存在的 IPv4 路徑數量。下列事件將 idle
表示 existing
事件已結束。此時,用戶端已觀察到所有現有狀態,再也不會再次觀察 existing
事件。
事件會分批傳回,最多包含 MAX_EVENTS
個事件。批次大小/邊界與內容之間沒有關聯:伺服器將 existing
事件的區塊分割成數個批次。用戶端應將這個 API 視為提供事件串流,批次用來降低系統的 IPC 負載。
- 回應
events
最多只能有MAX_EVENTS
事件的向量。
要求
<EMPTY>
回應
名稱 | 類型 |
---|---|
events |
vector<EventV4>[512]
|
WatcherV6
定義於 fuchsia.net.routes/ipv6.fidl
這個觀察器通訊協定,用於瞭解系統 IPv6 轉送狀態的變化。
觀看
Hanging-Get style API,用於觀察路線變更。
用戶端一次只能有一項待處理的 Watch
呼叫。如果在要求已等待的情況下呼叫 Watch
,將會導致通訊協定關閉。
前 N 個事件一律為 existing
,其中 N 是通訊協定的伺服器端初始化時存在的 IPv6 路徑數量。下列事件將 idle
表示 existing
事件已結束。此時,用戶端已觀察到所有現有狀態,再也不會再次觀察 existing
事件。
事件會分批傳回,最多包含 MAX_EVENTS
個事件。批次大小/邊界與內容之間沒有關聯:伺服器將 existing
事件的區塊分割成數個批次。用戶端應將這個 API 視為提供事件串流,批次用來降低系統的 IPC 負載。
- 回應
events
最多只能有MAX_EVENTS
事件的向量。
要求
<EMPTY>
回應
名稱 | 類型 |
---|---|
events |
vector<EventV6>[512]
|
結構化
介於
定義於 fuchsia.net.routes/rules.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
start |
uint32
|
範圍的開頭 (含首尾)。 |
無預設 |
end |
uint32
|
(含)。 |
無預設 |
空白
定義於 fuchsia.net.routes/routes.fidl
空白值的預留位置。
<EMPTY>
InstalledRuleV4
定義於 fuchsia.net.routes/ipv4.fidl
已安裝的 IPv4 轉送規則。
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
rule_set_priority |
RuleSetPriority
|
規則集會依照規則集的優先順序排序,彼此不相連,且規則之間沒有交錯規則。 |
無預設 |
rule_index |
RuleIndex
|
如果規則集內的規則是從本機排列,只要搭配規則集的優先順序,即可定義所有已安裝規則的全域順序。 |
無預設 |
selector |
RuleSelectorV4
|
規則的選取器部分,如果選取器與封包不符,規則則為免人工管理。 |
無預設 |
action |
RuleAction
|
規則的動作部分,說明選取器與封包比對時的處理方式。 |
無預設 |
InstalledRuleV6
定義於 fuchsia.net.routes/ipv6.fidl
已安裝的 IPv6 轉送規則。
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
rule_set_priority |
RuleSetPriority
|
規則集會依照規則集的優先順序排序,彼此不相連,且規則之間沒有交錯規則。 |
無預設 |
rule_index |
RuleIndex
|
如果規則集內的規則是從本機排列,只要搭配規則集的優先順序,即可定義所有已安裝規則的全域順序。 |
無預設 |
selector |
RuleSelectorV6
|
規則的選取器部分,如果選取器與封包不符,規則則為免人工管理。 |
無預設 |
action |
RuleAction
|
規則的動作部分,說明選取器與封包比對時的處理方式。 |
無預設 |
已標示
定義於 fuchsia.net.routes/rules.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
mask |
uint32
|
比較 |
無預設 |
between |
Between
|
標示介於指定範圍之間。 |
無預設 |
RouteTargetV4
定義於 fuchsia.net.routes/ipv4.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
outbound_interface |
fuchsia.net/InterfaceId
|
目標傳出介面的介面 ID。 |
無預設 |
next_hop |
fuchsia.net/Ipv4Address?
|
目標的選用下一個躍點。如有提供,位址必須是單點傳播位址。 |
無預設 |
RouteTargetV6
定義於 fuchsia.net.routes/ipv6.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
outbound_interface |
fuchsia.net/InterfaceId
|
目標傳出介面的介面 ID。 |
無預設 |
next_hop |
fuchsia.net/Ipv6Address?
|
目標的選用下一個躍點。如有提供,位址必須是單點傳播位址。 |
無預設 |
RouteV4
定義於 fuchsia.net.routes/ipv4.fidl
RouteV4
會指定 IPv4 網路路徑。
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
destination |
fuchsia.net/Ipv4AddressWithPrefix
|
路徑的目的地子網路。針對特定封包進行轉送決策時,系統會選取目的地構成相符前置字串最長的路徑,並與路徑的指標建立關聯。 |
無預設 |
action |
RouteActionV4
|
與此路徑相符的封包會套用指定的動作。 |
無預設 |
properties |
RoutePropertiesV4
|
IPv4 路徑的其他屬性。 |
無預設 |
RouteV6
定義於 fuchsia.net.routes/ipv6.fidl
RouteV6
會指定 IPv6 網路路徑。
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
destination |
fuchsia.net/Ipv6AddressWithPrefix
|
路徑的目的地子網路。針對特定封包進行轉送決策時,系統會選取目的地構成相符前置字串最長的路徑,並與路徑的指標建立關聯。 |
無預設 |
action |
RouteActionV6
|
與此路徑相符的封包會套用指定的動作。 |
無預設 |
properties |
RoutePropertiesV6
|
IPv6 路徑的其他屬性。 |
無預設 |
State_GetRouteTableName_Response
定義於 fuchsia.net.routes/routes.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
table_name |
TableName
|
無預設 |
State_Resolve_Response
定義於 fuchsia.net.routes/routes.fidl
廣闊 | 類型 | 說明 | 預設 |
---|---|---|---|
result |
Resolved
|
已解析的路徑。 包含路徑解析結果的「下一個躍點」或立即目的地資訊。已解析的路徑只適用於要求的目的地結構定義。 |
無預設 |
已取消標示
定義於 fuchsia.net.routes/rules.fidl
<EMPTY>
無法連上網路
定義於 fuchsia.net.routes/rules.fidl
<EMPTY>
ENUMS
State_GetRouteTableName_Error strict
類型:uint32
定義於 fuchsia.net.routes/routes.fidl
名稱 | 物超所值 | 說明 |
---|---|---|
NO_TABLE |
1 |
資料表
BaseSelector
定義於 fuchsia.net.routes/rules.fidl
可同時套用至 IPv4 和 IPv6 封包的通用選取器。
如果目前所有欄位都與對應屬性相符,選取器就會比對封包。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
locally_generated |
bool
|
如果封包是在本機產生,則比對封包。 |
2 |
bound_device |
fuchsia.net/InterfaceId
|
如果通訊端使用 |
3 |
mark_1_selector |
MarkSelector
|
MARK_1 網域的選取器。 |
4 |
mark_2_selector |
MarkSelector
|
MARK_2 網域的選取器。 |
目的地
定義於 fuchsia.net.routes/routes.fidl
描述網路目的地的地址和 ID 集合。
Destination
是轉送封包的「下一個躍點」。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
address |
fuchsia.net/IpAddress
|
目的地的 IP 位址。 |
2 |
mac |
fuchsia.net/MacAddress
|
目的地的 MAC 位址。只有在目的地位於需要 MAC 位址的連結上時,才需要設定。 |
3 |
interface_id |
fuchsia.net/InterfaceId
|
可連至目的地的介面 ID。 |
4 |
source_address |
fuchsia.net/IpAddress
|
用來與目的地通訊的偏好本機 IP 位址。 |
EffectiveRouteProperties
定義於 fuchsia.net.routes/routes.fidl
安裝在系統中的路徑有效屬性。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
metric |
fuchsia.net/RouteMetric
|
路徑的有效指標,取決於路徑的 SpecifiedRouteProperties 的值。如果 |
InstalledRouteV4
定義於 fuchsia.net.routes/ipv4.fidl
InstalledRouteV4
會指定安裝在系統路徑資料表中的 IPv4 網路路徑。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
route |
RouteV4
|
路線。 |
2 |
effective_properties |
EffectiveRouteProperties
|
路線的有效屬性。 |
3 |
table_id |
TableId
|
這個路徑所屬的資料表 ID。 |
InstalledRouteV6
定義於 fuchsia.net.routes/ipv6.fidl
InstalledRouteV6
會指定安裝在系統路徑資料表中的 IPv6 網路路徑。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
route |
RouteV6
|
路線。 |
2 |
effective_properties |
EffectiveRouteProperties
|
路線的有效屬性。 |
3 |
table_id |
TableId
|
這個路徑所屬的資料表 ID。 |
RoutePropertiesV4
定義於 fuchsia.net.routes/ipv4.fidl
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
specified_properties |
SpecifiedRouteProperties
|
路線的指定屬性。 |
RoutePropertiesV6
定義於 fuchsia.net.routes/ipv6.fidl
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
specified_properties |
SpecifiedRouteProperties
|
路線的指定屬性。 |
RuleSelectorV4
定義於 fuchsia.net.routes/ipv4.fidl
用來比對封包的規則的選取器部分。
如果目前所有欄位都與對應屬性相符,選取器就會比對封包。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
from |
fuchsia.net/Ipv4AddressWithPrefix
|
比對封包的來源位址是否來自子網路。 |
2 |
base |
BaseSelector
|
其他在 IP 版本之間通用的選取器。 |
RuleSelectorV6
定義於 fuchsia.net.routes/ipv6.fidl
用來比對封包的規則的選取器部分。
如果目前所有欄位都與對應屬性相符,選取器就會比對封包。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
from |
fuchsia.net/Ipv6AddressWithPrefix
|
比對封包的來源位址是否來自子網路。 |
2 |
base |
BaseSelector
|
其他在 IP 版本之間通用的選取器。 |
RuleWatcherOptionsV4
定義於 fuchsia.net.routes/ipv4.fidl
序數 | 廣闊 | 類型 | 說明 |
---|
RuleWatcherOptionsV6
定義於 fuchsia.net.routes/ipv6.fidl
序數 | 廣闊 | 類型 | 說明 |
---|
SpecifiedRouteProperties
定義於 fuchsia.net.routes/routes.fidl
建立路徑時明確指定的路徑屬性。
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
metric |
SpecifiedMetric
|
路徑的有效指標取決於下方指定的值。 |
WatcherOptionsV4
定義於 fuchsia.net.routes/ipv4.fidl
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
table_id |
TableId
|
只監控指定資料表中的事件。 |
WatcherOptionsV6
定義於 fuchsia.net.routes/ipv6.fidl
序數 | 廣闊 | 類型 | 說明 |
---|---|---|---|
1 |
table_id |
TableId
|
只監控指定資料表中的事件。 |
聯合國
EventV4 彈性
定義於 fuchsia.net.routes/ipv4.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
existing |
InstalledRouteV4
|
觀看開始時已存在的路徑。 |
2 |
idle |
Empty
|
Sentinel 值表示不會再接收到其他 |
3 |
added |
InstalledRouteV4
|
觀看時新增的路線。 |
4 |
removed |
InstalledRouteV4
|
觀看時移除的路徑。 |
EventV6 彈性
定義於 fuchsia.net.routes/ipv6.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
existing |
InstalledRouteV6
|
觀看開始時已存在的路徑。 |
2 |
idle |
Empty
|
Sentinel 值表示不會再接收到其他 |
3 |
added |
InstalledRouteV6
|
觀看時新增的路線。 |
4 |
removed |
InstalledRouteV6
|
觀看時移除的路徑。 |
MarkSelector 彈性
定義於 fuchsia.net.routes/rules.fidl
用於標記值的選取器。
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
unmarked |
Unmarked
|
這個標示網域沒有標記。 |
2 |
marked |
Marked
|
已解決嚴格
定義於 fuchsia.net.routes/routes.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
direct |
Destination
|
要求的目的地可直接到達。 |
2 |
gateway |
Destination
|
要求的目的地可以透過閘道連上,因此下一個躍點就是閘道。 |
RouteActionV4 彈性
定義於 fuchsia.net.routes/ipv4.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
forward |
RouteTargetV4
|
將封包轉送至指定目標。 |
RouteActionV6 彈性
定義於 fuchsia.net.routes/ipv6.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
forward |
RouteTargetV6
|
將封包轉送至指定目標。 |
RuleAction 彈性
定義於 fuchsia.net.routes/rules.fidl
與選取器相符時要執行的規則動作。
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
lookup |
TableId
|
請在指示的路線表中尋找路徑。如果目標表格中沒有相符的路徑,查詢將繼續考量下一個規則。 |
2 |
unreachable |
Unreachable
|
無法連上回撥網路。與此相反,如果 |
RuleEventV4 彈性
定義於 fuchsia.net.routes/ipv4.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
existing |
InstalledRuleV4
|
觀看開始時就有的規則。 |
2 |
idle |
Empty
|
Sentinel 值表示不會再接收到其他 |
3 |
added |
InstalledRuleV4
|
在觀看時新增的規則。 |
4 |
removed |
InstalledRuleV4
|
系統在觀看時移除的規則。 |
RuleEventV6 彈性
定義於 fuchsia.net.routes/ipv6.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
existing |
InstalledRuleV6
|
觀看開始時就有的規則。 |
2 |
idle |
Empty
|
Sentinel 值表示不會再接收到其他 |
3 |
added |
InstalledRuleV6
|
在觀看時新增的規則。 |
6 |
removed |
InstalledRuleV6
|
系統在觀看時移除的規則。 |
指定指標嚴格
定義於 fuchsia.net.routes/routes.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
explicit_metric |
fuchsia.net/RouteMetric
|
路徑的指標會是明確指定的值。 |
2 |
inherited_from_interface |
Empty
|
路徑的指標會繼承其傳出介面,並在路徑生命週期的任何變更時追蹤這個值。如果用戶端想卸載「哪個路徑最好」的責任,可能會偏好使用這個方法。 |
State_GetRouteTableName_Result 嚴格
定義於 fuchsia.net.routes/routes.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
response |
State_GetRouteTableName_Response
|
|
2 |
err |
State_GetRouteTableName_Error
|
State_Resolve_Result 嚴格
定義於 fuchsia.net.routes/routes.fidl
序數 | Variant | 類型 | 說明 |
---|---|---|---|
1 |
response |
State_Resolve_Response
|
|
2 |
err |
zx/Status
|
業者
名稱 | 物超所值 | 類型 | 說明 |
---|---|---|---|
MAX_EVENTS |
512
|
uint16 |
一次呼叫 已新增:HEAD
|
MAX_TABLE_NAME_LEN |
255
|
uint64 |
資料表名稱的長度上限。 已新增:HEAD
|
別名
名稱 | 物超所值 | 說明 |
---|---|---|
RuleIndex |
uint32 |
指定規則集內規則的索引。 同一個 已新增:HEAD
|
RuleSetPriority |
uint32 |
規則組合的優先順序,所有規則集都會根據這項資訊線性分配。 系統會先執行 RuleSetPriority 比較小的 已新增:HEAD
|
TableId |
uint32 |
路線表的 ID。
已新增:HEAD
|
TableName |
string [MAX_TABLE_NAME_LEN ] |
路線表的名稱。 已新增:HEAD
|