Logo

Linux 内核

6.16.0-rc4

快速搜索

目录

  • 开发流程
  • 提交补丁
  • 行为准则
  • 维护者手册
  • 所有开发流程文档
  • 核心 API
  • 驱动 API
  • 子系统
    • 核心子系统
    • 人机接口
    • 网络接口
      • 网络
      • NetLabel
      • InfiniBand
      • ISDN
      • MHI
    • 存储接口
    • 其他子系统
  • 锁
  • 许可规则
  • 编写文档
  • 开发工具
  • 测试指南
  • Hacking 指南
  • 追踪
  • 故障注入
  • Livepatching
  • Rust
  • 管理
  • 构建系统
  • 报告问题
  • 用户空间工具
  • 用户空间 API
  • 固件
  • 固件和设备树
  • CPU 架构
  • 未分类文档
  • 翻译

本页

  • 显示源码

Family ovs_flow netlink 规范¶

目录

  • Family ovs_flow netlink 规范

    • 概要

    • 操作

      • get

      • new

    • 多播组

    • 定义

      • ovs-header

      • ovs-flow-stats

      • ovs-key-ethernet

      • ovs-key-mpls

      • ovs-key-ipv4

      • ovs-key-ipv6

      • ovs-key-ipv6-exthdrs

      • ovs-frag-type

      • ovs-key-tcp

      • ovs-key-udp

      • ovs-key-sctp

      • ovs-key-icmp

      • ovs-key-arp

      • ovs-key-nd

      • ovs-key-ct-tuple-ipv4

      • ovs-action-push-vlan

      • ovs-ufid-flags

      • ovs-action-hash

      • ovs-hash-alg

      • ovs-action-push-mpls

      • ovs-action-add-mpls

      • ct-state-flags

    • 属性集

      • flow-attrs

      • key-attrs

      • action-attrs

      • tunnel-key-attrs

      • check-pkt-len-attrs

      • sample-attrs

      • userspace-attrs

      • ovs-nsh-key-attrs

      • ct-attrs

      • nat-attrs

      • dec-ttl-attrs

      • vxlan-ext-attrs

      • psample-attrs

概要¶

通过通用 netlink 进行 OVS 流配置。

操作¶

get¶

获取/转储 OVS 流配置和状态

值:

3

属性集:

flow-attrs

操作:
请求
属性:

[key, ufid, ufid-flags]

回复
属性:

[key, ufid, mask, stats, actions]

转储:
请求
属性:

[key, ufid, ufid-flags]

回复
属性:

[key, ufid, mask, stats, actions]

new¶

在数据路径中创建 OVS 流配置

值:

1

属性集:

flow-attrs

操作:
请求
属性:

[key, ufid, mask, actions]

多播组¶

  • ovs_flow

定义¶

ovs-header¶

类型:

结构体

文档:

OVS 通用 Netlink 消息的头部。

成员:
dp-ifindex (u32):

数据路径本地端口的 ifindex(0 表示请求不特定于某个数据路径)。

ovs-flow-stats¶

类型:

结构体

成员:
n-packets (u64):

匹配的数据包数量。

n-bytes (u64):

匹配的字节数量。

ovs-key-ethernet¶

类型:

结构体

成员:
eth-src (binary):

eth-dst (binary):

ovs-key-mpls¶

类型:

结构体

成员:
mpls-lse (u32):

ovs-key-ipv4¶

类型:

结构体

成员:
ipv4-src (u32):

ipv4-dst (u32):

ipv4-proto (u8):

ipv4-tos (u8):

ipv4-ttl (u8):

ipv4-frag (u8):

ovs-key-ipv6¶

类型:

结构体

成员:
ipv6-src (binary):

ipv6-dst (binary):

ipv6-label (u32):

ipv6-proto (u8):

ipv6-tclass (u8):

ipv6-hlimit (u8):

ipv6-frag (u8):

ovs-key-ipv6-exthdrs¶

类型:

结构体

成员:
hdrs (u16):

ovs-frag-type¶

name-prefix:

ovs-frag-type-

enum-name:

ovs-frag-type

类型:

枚举

条目:
none:

数据包不是分片。

first:

数据包是偏移量为 0 的分片。

later:

数据包是偏移量非零的分片。

any:

ovs-key-tcp¶

类型:

结构体

成员:
tcp-src (u16):

tcp-dst (u16):

ovs-key-udp¶

类型:

结构体

成员:
udp-src (u16):

udp-dst (u16):

ovs-key-sctp¶

类型:

结构体

成员:
sctp-src (u16):

sctp-dst (u16):

ovs-key-icmp¶

类型:

结构体

成员:
icmp-type (u8):

icmp-code (u8):

ovs-key-arp¶

类型:

结构体

成员:
arp-sip (u32):

arp-tip (u32):

arp-op (u16):

arp-sha (binary):

arp-tha (binary):

ovs-key-nd¶

类型:

结构体

成员:
nd-target (binary):

nd-sll (binary):

nd-tll (binary):

ovs-key-ct-tuple-ipv4¶

类型:

结构体

成员:
ipv4-src (u32):

ipv4-dst (u32):

src-port (u16):

dst-port (u16):

ipv4-proto (u8):

ovs-action-push-vlan¶

类型:

结构体

成员:
vlan-tpid (u16):

要推送的标签协议标识符 (TPID)。

vlan-tci (u16):

要推送的标签控制标识符 (TCI)。

ovs-ufid-flags¶

name-prefix:

ovs-ufid-f-

enum-name:

无

类型:

标志

条目:
  • omit-key

  • omit-mask

  • omit-actions

ovs-action-hash¶

类型:

结构体

成员:
hash-alg (u32):

用于在循环前计算哈希的算法。

hash-basis (u32):

用于计算哈希的基础。

ovs-hash-alg¶

enum-name:

ovs-hash-alg

类型:

枚举

文档:

数据路径哈希算法,用于计算数据路径哈希。 算法类型仅指定流中的哪些字段将用作哈希的一部分。 每个数据路径都可以自由使用其自己的哈希算法。 哈希值对于用户空间守护程序是不透明的。

条目:
  • ovs-hash-alg-l4

ovs-action-push-mpls¶

类型:

结构体

成员:
mpls-lse (u32):

要推送的 MPLS 标签栈条目

mpls-ethertype (u32):

要在封装的以太网帧中设置的 Ethertype。 ethertype 唯一应该给出的值是 ETH_P_MPLS_UC 和 ETH_P_MPLS_MC,表示 MPLS 单播或多播。 其他值将被拒绝。

ovs-action-add-mpls¶

类型:

结构体

成员:
mpls-lse (u32):

要推送的 MPLS 标签栈条目

mpls-ethertype (u32):

要在封装的以太网帧中设置的 Ethertype。 ethertype 唯一应该给出的值是 ETH_P_MPLS_UC 和 ETH_P_MPLS_MC,表示 MPLS 单播或多播。 其他值将被拒绝。

tun-flags (u16):

MPLS 隧道属性。

ct-state-flags¶

enum-name:

无

类型:

标志

name-prefix:

ovs-cs-f-

条目:
new:

新连接的开始。

established:

现有连接的一部分

related:

与现有连接相关。

reply-dir:

流在回复方向。

invalid:

无法跟踪连接。

tracked:

已发生 Conntrack。

src-nat:

数据包的源地址/端口被 NAT 修改。

dst-nat:

数据包的目的地址/端口被 NAT 修改。

属性集¶

flow-attrs¶

key (nest)¶

nested-attributes:

key-attrs

文档:

指定流键的嵌套属性。 始终存在于通知中。 所有请求都需要(转储除外)。

actions (nest)¶

nested-attributes:

action-attrs

文档:

指定要对匹配键的数据包采取的操作的嵌套属性。 始终存在于通知中。 OVS_FLOW_CMD_NEW 请求需要,OVS_FLOW_CMD_SET 请求可选。 没有 OVS_FLOW_ATTR_ACTIONS 的 OVS_FLOW_CMD_SET 不会修改操作。 要清除操作,必须提供没有任何嵌套属性的 OVS_FLOW_ATTR_ACTIONS。

stats (binary)¶

struct:

ovs-flow-stats

文档:

此流的统计信息。 如果统计信息非零,则存在于通知中。 请求中忽略。

tcp-flags (u8)¶

文档:

一个 8 位值,给出在此流中数据包上看到的所有 TCP 标志的 ORed 值。 仅存在于 TCP 流的通知中,并且仅当它非零时。 请求中忽略。

used (u64)¶

文档:

一个 64 位整数,给出系统单调时钟上的时间(以毫秒为单位),该时间是上次为此流处理数据包的时间。 仅当已为此流处理数据包时才存在于通知中。 请求中忽略。

clear (flag)¶

文档:

如果在 OVS_FLOW_CMD_SET 请求中存在,则清除此流的上次使用时间、累积的 TCP 标志和统计信息。 否则在请求中忽略。 永远不会出现在通知中。

mask (nest)¶

nested-attributes:

key-attrs

文档:

指定通配符流匹配的掩码位的嵌套属性。 掩码位值“1”指定与相应流键位完全匹配,而掩码位值“0”指定通配符匹配。 省略属性被视为通配所有相应字段。 所有请求都是可选的。 如果不存在,则所有流键位都是完全匹配位。

probe (binary)¶

文档:

流操作是功能探测,应禁止错误日志记录。

ufid (binary)¶

文档:

一个介于 1-16 个八位字节之间的值,用于指定流的唯一标识符。 使流通过此值而不是 OVS_FLOW_ATTR_KEY 属性的值进行索引。 所有请求都是可选的。 如果使用此属性创建流,则存在于通知中。

display-hint:

uuid

ufid-flags (u32)¶

enum:

ovs-ufid-flags

文档:

一个 32 位值,其中包含为流安装和检索提供替代语义的 ORed 标志。 所有请求都是可选的。

pad (binary)¶

key-attrs¶

encap (nest)¶

nested-attributes:

key-attrs

优先级 (u32)¶

入端口 (u32)¶

以太网 (binary)¶

struct:

ovs-key-ethernet

文档:

结构体 ovs_key_ethernet

VLAN (u16)¶

字节序:

大端

以太类型 (u16)¶

字节序:

大端

IPv4 (binary)¶

struct:

ovs-key-ipv4

IPv6 (binary)¶

struct:

ovs-key-ipv6

文档:

结构体 ovs_key_ipv6

TCP (binary)¶

struct:

ovs-key-tcp

UDP (binary)¶

struct:

ovs-key-udp

ICMP (binary)¶

struct:

ovs-key-icmp

ICMPv6 (binary)¶

struct:

ovs-key-icmp

ARP (binary)¶

struct:

ovs-key-arp

文档:

结构体 ovs_key_arp

ND (binary)¶

struct:

ovs-key-nd

文档:

结构体 ovs_key_nd

skb-mark (u32)¶

隧道 (nest)¶

nested-attributes:

tunnel-key-attrs

SCTP (binary)¶

struct:

ovs-key-sctp

TCP 标志 (u16)¶

字节序:

大端

dp-hash (u32)¶

文档:

值 0 表示哈希不是由数据路径计算的。

recirc-id (u32)¶

MPLS (binary)¶

struct:

ovs-key-mpls

ct-state (u32)¶

enum:

ct-state-flags

枚举作为标志:

真

ct-zone (u16)¶

文档:

连接跟踪区域

ct-mark (u32)¶

文档:

连接跟踪标记

ct-labels (binary)¶

display-hint:

十六进制

文档:

16 字节连接跟踪标签

ct-orig-tuple-ipv4 (binary)¶

struct:

ovs-key-ct-tuple-ipv4

ct-orig-tuple-ipv6 (binary)¶

文档:

结构体 ovs_key_ct_tuple_ipv6

NSH (nest)¶

nested-attributes:

ovs-nsh-key-attrs

packet-type (u32)¶

字节序:

大端

文档:

不应发送到内核

nd-extensions (binary)¶

文档:

不应发送到内核

tunnel-info (binary)¶

文档:

结构体 ip_tunnel_info

ipv6-exthdrs (binary)¶

struct:

ovs-key-ipv6-exthdrs

文档:

结构体 ovs_key_ipv6_exthdr

action-attrs¶

输出 (u32)¶

文档:

数据路径中的 OVS 端口号

用户空间 (nest)¶

nested-attributes:

userspace-attrs

设置 (nest)¶

nested-attributes:

key-attrs

文档:

替换现有报头的内容。 单个嵌套属性指定要修改的报头及其值。

push-vlan (binary)¶

struct:

ovs-action-push-vlan

文档:

将新的最外层 802.1Q 或 802.1ad 报头推送到数据包上。

pop-vlan (flag)¶

文档:

从数据包中弹出最外层的 802.1Q 或 802.1ad 报头。

采样 (nest)¶

nested-attributes:

sample-attrs

文档:

以概率方式执行动作,如嵌套属性中所指定。

recirc (u32)¶

文档:

recirc ID

哈希 (binary)¶

struct:

ovs-action-hash

push-mpls (binary)¶

struct:

ovs-action-push-mpls

文档:

将新的 MPLS 标签栈条目推送到数据包的 MPLS 标签栈顶部。 将封装帧的以太类型设置为 ETH_P_MPLS_UC 或 ETH_P_MPLS_MC,以指示新的数据包内容。

pop-mpls (u16)¶

字节序:

大端

文档:

以太类型

set-masked (nest)¶

nested-attributes:

key-attrs

文档:

替换现有报头的内容。 嵌套属性指定要修改的报头、其值和掩码。 对于掩码中设置的每个位,相应的位值将从该值复制到数据包报头字段,其余位保持不变。 非掩码值位必须作为零传递。 OVS_KEY_ATTR_TUNNEL 属性不支持掩码。

ct (nest)¶

nested-attributes:

ct-attrs

文档:

跟踪连接。 在流密钥中填充与 conntrack 相关的条目。

trunc (u32)¶

文档:

结构体 ovs_action_trunc 是一个 u32 最大长度

push-eth (binary)¶

文档:

结构体 ovs_action_push_eth

pop-eth (flag)¶

ct-clear (flag)¶

push-nsh (nest)¶

nested-attributes:

ovs-nsh-key-attrs

文档:

将 NSH 报头推送到数据包。

pop-nsh (flag)¶

文档:

从数据包中弹出最外层的 NSH 报头。

meter (u32)¶

文档:

通过 meter 运行数据包,meter 可能会丢弃数据包,或修改数据包(例如,更改 DSCP 字段)

clone (nest)¶

nested-attributes:

action-attrs

文档:

创建数据包的副本,并执行一系列动作,而不会影响原始数据包和密钥。

check-pkt-len (nest)¶

nested-attributes:

check-pkt-len-attrs

文档:

检查数据包长度,如果大于指定的数据包长度,则执行一组动作,否则执行另一组动作。

add-mpls (binary)¶

struct:

ovs-action-add-mpls

文档:

将新的 MPLS 标签栈条目推送到数据包的开头,或根据此 OVS_ACTION_ATTR_ADD_MPLS 参数的 tun_flags 字段中的 l3 隧道标志的值,将其推送到 l3 报头的开头。

dec-ttl (nest)¶

nested-attributes:

dec-ttl-attrs

psample (nest)¶

nested-attributes:

psample-attrs

文档:

将数据包样本发送到 psample 以进行外部观察。

tunnel-key-attrs¶

ID (u64)¶

字节序:

大端

值:

0

ipv4-src (u32)¶

字节序:

大端

ipv4-dst (u32)¶

字节序:

大端

TOS (u8)¶

TTL (u8)¶

dont-fragment (flag)¶

csum (flag)¶

OAM (flag)¶

geneve-opts (binary)¶

子类型:

u32

tp-src (u16)¶

字节序:

大端

tp-dst (u16)¶

字节序:

大端

vxlan-opts (nest)¶

nested-attributes:

vxlan-ext-attrs

ipv6-src (binary)¶

文档:

结构体 in6_addr 源 IPv6 地址

ipv6-dst (binary)¶

文档:

结构体 in6_addr 目标 IPv6 地址

pad (binary)¶

erspan-opts (binary)¶

文档:

结构体 erspan_metadata

ipv4-info-bridge (flag)¶

check-pkt-len-attrs¶

pkt-len (u16)¶

actions-if-greater (nest)¶

nested-attributes:

action-attrs

actions-if-less-equal (nest)¶

nested-attributes:

action-attrs

sample-attrs¶

概率 (u32)¶

动作 (nest)¶

nested-attributes:

action-attrs

userspace-attrs¶

PID (u32)¶

userdata (binary)¶

egress-tun-port (u32)¶

动作 (flag)¶

ovs-nsh-key-attrs¶

base (binary)¶

md1 (binary)¶

md2 (binary)¶

ct-attrs¶

commit (flag)¶

zone (u16)¶

mark (binary)¶

labels (binary)¶

helper (string)¶

nat (nest)¶

nested-attributes:

nat-attrs

force-commit (flag)¶

eventmask (u32)¶

timeout (string)¶

nat-attrs¶

src (flag)¶

dst (flag)¶

ip-min (binary)¶

ip-max (binary)¶

proto-min (u16)¶

proto-max (u16)¶

persistent (flag)¶

proto-hash (flag)¶

proto-random (flag)¶

dec-ttl-attrs¶

动作 (nest)¶

nested-attributes:

action-attrs

vxlan-ext-attrs¶

GBP (u32)¶

psample-attrs¶

组 (u32)¶

cookie (binary)¶

©内核开发社区。 | 由 Sphinx 5.3.0 & Alabaster 0.7.16 驱动 | 页面源