module openconfig-packet-match { yang-version 1; namespace "http://openconfig.net/yang/header-fields"; prefix oc-pkt-match; import openconfig-inet-types { prefix oc-inet; } import openconfig-yang-types { prefix oc-yang; } import openconfig-packet-match-types { prefix oc-pkt-match-types; } import openconfig-extensions { prefix oc-ext; } import openconfig-mpls-types { prefix oc-mpls; } organization "OpenConfig working group"; contact "OpenConfig working group www.openconfig.net"; description "This module defines data related to packet header fields used in matching operations, for example in ACLs. When a field is omitted from a match expression, the effect is a wildcard ('any') for that field."; revision 2021-06-16 { description "Remove trailing whitespace"; reference "1.3.1"; } revision 2021-05-19 { description "Add the ability to match multiple DSCPs in a rule."; reference "1.3.0"; } revision 2021-03-17 { description "Add MPLS filter Support."; reference "1.2.0"; } revision 2018-11-21 { description "Add OpenConfig module metadata extensions."; reference "1.1.1"; } revision 2017-12-15 { description "Add MPLS packet field matches"; reference "1.1.0"; } revision 2017-05-26 { description "Separated IP matches into AFs"; reference "1.0.0"; } revision 2016-08-08 { description "OpenConfig public release"; reference "0.2.0"; } revision 2016-04-27 { description "Initial revision"; reference "TBD"; } oc-ext:openconfig-version "1.3.1"; oc-ext:regexp-posix; oc-ext:catalog-organization "openconfig"; oc-ext:origin "openconfig"; grouping ethernet-header-config { description "Configuration data of fields in Ethernet header."; leaf source-mac { type oc-yang:mac-address; description "Source IEEE 802 MAC address."; } leaf source-mac-mask { type oc-yang:mac-address; description "Source IEEE 802 MAC address mask."; } leaf destination-mac { type oc-yang:mac-address; description "Destination IEEE 802 MAC address."; } leaf destination-mac-mask { type oc-yang:mac-address; description "Destination IEEE 802 MAC address mask."; } leaf ethertype { type oc-pkt-match-types:ethertype-type; description "Ethertype field to match in Ethernet packets"; } } grouping ethernet-header-state { description "State information of fields in Ethernet header."; } grouping ethernet-header-top { description "Top level container for fields in Ethernet header."; container l2 { description "Ethernet header fields"; container config { description "Configuration data"; uses ethernet-header-config; } container state { config false; description "State Information."; uses ethernet-header-config; uses ethernet-header-state; } } } grouping mpls-header-top { description "Top-level container for fields in an MPLS header."; container mpls { description "MPLS header fields"; container config { description "Configuration parameters relating to fields within the MPLS header."; uses mpls-header-config; } container state { config false; description "Operational state parameters relating to fields within the MPLS header"; uses mpls-header-config; } } } grouping mpls-header-config { description "Configuration parameters relating to matches within MPLS header fields."; leaf traffic-class { type oc-mpls:mpls-tc; description "The value of the MPLS traffic class (TC) bits, formerly known as the EXP bits."; } leaf start-label-value { type oc-mpls:mpls-label; description "Match MPLS label value on the MPLS header. The usage of this field indicated the upper range value in the top of the stack. The range that is used is inclusive. The match that is done for a particular received pkt_label is: start-label-value <= pkt_label <= end-label-value. The 20-bit label value in an MPLS label stack as specified in RFC 3032. This label value does not include the encodings of Traffic Class and TTL."; } leaf end-label-value { type oc-mpls:mpls-label; description "Match MPLS label value on the MPLS header. The usage of this field indicated the upper range value in the top of the stack. The range that is used is inclusive. The match that is done for a particular received pkt_label is: start-label-value <= pkt_label <= end-label-value. The 20-bit label value in an MPLS label stack as specified in RFC 3032. This label value does not include the encodings of Traffic Class and TTL."; } leaf ttl-value { type uint8; description "Time-to-live MPLS packet value match."; reference "RFC 3032: MPLS Label Stack Encoding."; } } grouping ip-protocol-fields-common-config { description "IP protocol fields common to IPv4 and IPv6"; leaf dscp { type oc-inet:dscp; description "Value of diffserv codepoint."; } leaf-list dscp-set { type oc-inet:dscp; description "A list of DSCP values to be matched for incoming packets. AN OR match should be performed, such that a packet must match one of the values defined in this list. If the field is left empty then any DSCP value matches unless the 'dscp' leaf is specified. It is not valid to specify both 'dscp' and 'dscp-set together.'"; } leaf protocol { type oc-pkt-match-types:ip-protocol-type; description "The protocol carried in the IP packet, expressed either as its IP protocol number, or by a defined identity."; } leaf hop-limit { type uint8 { range "0..255"; } description "The IP packet's hop limit -- known as TTL (in hops) in IPv4 packets, and hop limit in IPv6"; } } grouping ipv4-protocol-fields-config { description "Configuration data of IP protocol fields for IPv4"; leaf source-address { type oc-inet:ipv4-prefix; description "Source IPv4 address prefix."; } leaf destination-address { type oc-inet:ipv4-prefix; description "Destination IPv4 address prefix."; } uses ip-protocol-fields-common-config; } grouping ipv4-protocol-fields-state { description "State information of IP header fields for IPv4"; } grouping ipv4-protocol-fields-top { description "IP header fields for IPv4"; container ipv4 { description "Top level container for IPv4 match field data"; container config { description "Configuration data for IPv4 match fields"; uses ipv4-protocol-fields-config; } container state { config false; description "State information for IPv4 match fields"; uses ipv4-protocol-fields-config; uses ipv4-protocol-fields-state; } } } grouping ipv6-protocol-fields-config { description "Configuration data for IPv6 match fields"; leaf source-address { type oc-inet:ipv6-prefix; description "Source IPv6 address prefix."; } leaf source-flow-label { type oc-inet:ipv6-flow-label; description "Source IPv6 Flow label."; } leaf destination-address { type oc-inet:ipv6-prefix; description "Destination IPv6 address prefix."; } leaf destination-flow-label { type oc-inet:ipv6-flow-label; description "Destination IPv6 Flow label."; } uses ip-protocol-fields-common-config; } grouping ipv6-protocol-fields-state { description "Operational state data for IPv6 match fields"; } grouping ipv6-protocol-fields-top { description "Top-level grouping for IPv6 match fields"; container ipv6 { description "Top-level container for IPv6 match field data"; container config { description "Configuration data for IPv6 match fields"; uses ipv6-protocol-fields-config; } container state { config false; description "Operational state data for IPv6 match fields"; uses ipv6-protocol-fields-config; uses ipv6-protocol-fields-state; } } } grouping transport-fields-config { description "Configuration data of transport-layer packet fields"; leaf source-port { type oc-pkt-match-types:port-num-range; description "Source port or range"; } leaf destination-port { type oc-pkt-match-types:port-num-range; description "Destination port or range"; } leaf-list tcp-flags { type identityref { base oc-pkt-match-types:TCP_FLAGS; } description "List of TCP flags to match"; } } grouping transport-fields-state { description "State data of transport-fields"; } grouping transport-fields-top { description "Destination transport-fields top level grouping"; container transport { description "Transport fields container"; container config { description "Configuration data"; uses transport-fields-config; } container state { config false; description "State data"; uses transport-fields-config; uses transport-fields-state; } } } }