1 module openconfig-packet-match {
6 namespace "http://openconfig.net/yang/header-fields";
10 // import some basic types
11 import openconfig-inet-types { prefix oc-inet; }
12 import openconfig-yang-types { prefix oc-yang; }
13 import openconfig-packet-match-types { prefix oc-pkt-match-types; }
14 import openconfig-extensions { prefix oc-ext; }
17 organization "OpenConfig working group";
20 "OpenConfig working group
24 "This module defines data related to packet header fields
25 used in matching operations, for example in ACLs. When a
26 field is omitted from a match expression, the effect is a
27 wildcard ('any') for that field.";
29 oc-ext:openconfig-version "1.1.0";
31 revision "2017-12-15" {
33 "Add MPLS packet field matches";
37 revision "2017-05-26" {
39 "Separated IP matches into AFs";
43 revision "2016-08-08" {
45 "OpenConfig public release";
49 revision "2016-04-27" {
56 // Physical Layer fields
58 grouping ethernet-header-config {
60 "Configuration data of fields in Ethernet header.";
63 type oc-yang:mac-address;
65 "Source IEEE 802 MAC address.";
68 leaf source-mac-mask {
69 type oc-yang:mac-address;
71 "Source IEEE 802 MAC address mask.";
74 leaf destination-mac {
75 type oc-yang:mac-address;
77 "Destination IEEE 802 MAC address.";
80 leaf destination-mac-mask {
81 type oc-yang:mac-address;
83 "Destination IEEE 802 MAC address mask.";
87 type oc-pkt-match-types:ethertype-type;
89 "Ethertype field to match in Ethernet packets";
93 grouping ethernet-header-state {
95 "State information of fields in Ethernet header.";
98 grouping ethernet-header-top {
100 "Top level container for fields in Ethernet header.";
104 "Ethernet header fields";
108 "Configuration data";
109 uses ethernet-header-config;
115 "State Information.";
116 uses ethernet-header-config;
117 uses ethernet-header-state;
122 grouping mpls-header-top {
124 "Top-level container for fields in an MPLS header.";
128 "MPLS header fields";
132 "Configuration parameters relating to fields within
134 uses mpls-header-config;
140 "Operational state parameters relating to fields
141 within the MPLS header";
142 uses mpls-header-config;
147 grouping mpls-header-config {
149 "Configuration parameters relating to matches within
150 MPLS header fields.";
157 "The value of the MPLS traffic class (TC) bits,
158 formerly known as the EXP bits.";
162 grouping ip-protocol-fields-common-config {
164 "IP protocol fields common to IPv4 and IPv6";
169 "Value of diffserv codepoint.";
173 type oc-pkt-match-types:ip-protocol-type;
175 "The protocol carried in the IP packet, expressed either
176 as its IP protocol number, or by a defined identity.";
184 "The IP packet's hop limit -- known as TTL (in hops) in
185 IPv4 packets, and hop limit in IPv6";
190 // ip-protocol-fields
191 grouping ipv4-protocol-fields-config {
193 "Configuration data of IP protocol fields
196 leaf source-address {
197 type oc-inet:ipv4-prefix;
199 "Source IPv4 address prefix.";
202 leaf destination-address {
203 type oc-inet:ipv4-prefix;
205 "Destination IPv4 address prefix.";
208 uses ip-protocol-fields-common-config;
212 grouping ipv4-protocol-fields-state {
214 "State information of IP header fields for IPv4";
217 grouping ipv4-protocol-fields-top {
219 "IP header fields for IPv4";
223 "Top level container for IPv4 match field data";
227 "Configuration data for IPv4 match fields";
228 uses ipv4-protocol-fields-config;
234 "State information for IPv4 match fields";
235 uses ipv4-protocol-fields-config;
236 uses ipv4-protocol-fields-state;
241 grouping ipv6-protocol-fields-config {
243 "Configuration data for IPv6 match fields";
245 leaf source-address {
246 type oc-inet:ipv6-prefix;
248 "Source IPv6 address prefix.";
251 leaf source-flow-label {
252 type oc-inet:ipv6-flow-label;
254 "Source IPv6 Flow label.";
257 leaf destination-address {
258 type oc-inet:ipv6-prefix;
260 "Destination IPv6 address prefix.";
263 leaf destination-flow-label {
264 type oc-inet:ipv6-flow-label;
266 "Destination IPv6 Flow label.";
269 uses ip-protocol-fields-common-config;
272 grouping ipv6-protocol-fields-state {
274 "Operational state data for IPv6 match fields";
277 grouping ipv6-protocol-fields-top {
279 "Top-level grouping for IPv6 match fields";
283 "Top-level container for IPv6 match field data";
287 "Configuration data for IPv6 match fields";
289 uses ipv6-protocol-fields-config;
297 "Operational state data for IPv6 match fields";
299 uses ipv6-protocol-fields-config;
300 uses ipv6-protocol-fields-state;
306 grouping transport-fields-config {
308 "Configuration data of transport-layer packet fields";
311 type oc-pkt-match-types:port-num-range;
313 "Source port or range";
316 leaf destination-port {
317 type oc-pkt-match-types:port-num-range;
319 "Destination port or range";
322 leaf-list tcp-flags {
324 base oc-pkt-match-types:TCP_FLAGS;
327 "List of TCP flags to match";
331 grouping transport-fields-state {
333 "State data of transport-fields";
336 grouping transport-fields-top {
338 "Destination transport-fields top level grouping";
340 container transport {
342 "Transport fields container";
346 "Configuration data";
347 uses transport-fields-config;
354 uses transport-fields-config;
355 uses transport-fields-state;