1 module openflow-extensible-match {
2 namespace "urn:openflowopenflow:oxm";
7 import ietf-yang-types {prefix yang;}
8 import ietf-inet-types {prefix inet;}
9 import openflow-types {prefix oft;}
12 revision "2013-07-31" {
13 description "Initial model";
16 identity oxm-match-type {
18 "The OpenFlow Extensible Match type must be supported by all OpenFlow
20 base oft:match-type-base;
26 description "Base identity for OXM classes";
30 identity nxm-0-class {
31 description "Backward compatibility with NXM";
34 identity nxm-1-class {
35 description "Backward compatibility with NXM";
38 identity openflow-basic-class {
39 description "Basic class for OpenFlow";
42 identity experimenter-class {
44 "Marks Experimenter match type class.
45 All experimenter match classes MUST use this class as a base.";
53 identity match-field {
54 description "Base identity for OXM Fields";
59 description "Match for Switch input port.";
61 identity in_phy_port {
63 description "Match for Switch physical input port.";
67 description "Match for Metadata passed between tables.";
71 description "Match for Ethernet destination address.";
75 description "Match for Ethernet source address.";
79 description "Match for Ethernet frame type.";
83 description "Match for VLAN id.";
87 description "Match for VLAN priority.";
91 description "Match for IP DSCP (6 bits in ToS field).";
95 description "Match for IP ECN (2 bits in ToS field).";
99 description "Match for IP protocol.";
103 description "Match for IPv4 source address.";
107 description "Match for IPv4 destination address.";
111 description "Match for TCP source port.";
115 description "Match for TCP destination port.";
119 description "Match for UDP source port.";
123 description "Match for UDP destination port.";
127 description "Match for SCTP source port.";
131 description "Match for SCTP destination port.";
133 identity icmpv4_type {
135 description "Match for ICMP type.";
137 identity icmpv4_code {
139 description "Match for ICMP code.";
143 description "Match for ARP opcode.";
147 description "Match for ARP source IPv4 address.";
151 description "Match for ARP target IPv4 address.";
155 description "Match for ARP source hardware address.";
159 description "Match for ARP target hardware address.";
163 description "Match for IPv6 source address.";
167 description "Match for IPv6 destination address.";
169 identity ipv6_flabel {
171 description "Match for IPv6 Flow Label";
173 identity icmpv6_type {
175 description "Match for ICMPv6 type.";
177 identity icmpv6_code {
179 description "Match for ICMPv6 code.";
181 identity ipv6_nd_target {
183 description "Match for Target address for ND.";
185 identity ipv6_nd_sll {
187 description "Match for Source link-layer for ND.";
189 identity ipv6_nd_tll {
191 description "Match for Target link-layer for ND.";
193 identity mpls_label {
195 description "Match for MPLS label.";
199 description "Match for MPLS TC.";
203 description "Match for MPLS BoS bit.";
207 description "Match for PBB I-SID.";
211 description "Match for Logical Port Metadata";
213 identity ipv6_exthdr {
215 description "Match for IPv6 Extension Header pseudo-field";
218 // Abstract definitions of fields structure
222 "Ingress port. Numerical representation of incoming port, starting at 1. This may be a physical or switch-defined logical port.";
224 type oft:port-number;
227 grouping in-phy-port {
228 description "Physical port. In ofp_packet_in messages, underlying physical port when packet received on a logical port.";
230 type oft:port-number;
234 description "Metadata passed between tables.";
243 description "Ethernet destination address.";
245 type yang:mac-address;
249 description "Ethernet source address.";
251 type yang:mac-address;
258 description "Ethernet frame type.";
260 type oft:ether-type; // Needs to define that as general model
267 description "VLAN id.";
269 type uint16; // TODO: Define proper vlan id type.
276 description "VLAN priority.";
278 type uint8; // TODO: Define PCP type
282 description "IP DSCP (6 bits in ToS field).";
285 type inet:dscp; // TODO: Define DSCP type
289 description "IP ECN (2 bits in ToS field).";
291 type uint8; // TODO define ECN
295 description "IP protocol.";
296 leaf protocol-number {
297 type uint8; // TODO define IP protocol number
301 description "IPv4 source address.";
303 type inet:ipv4-prefix;
307 description "IPv4 destination address.";
309 type inet:ipv4-prefix;
313 description "TCP source port.";
315 type inet:port-number;
319 description "TCP destination port.";
321 type inet:port-number;
325 description "UDP source port.";
327 type inet:port-number;
331 description "UDP destination port.";
333 type inet:port-number;
337 description "SCTP source port.";
339 type inet:port-number;
343 description "SCTP destination port.";
345 type inet:port-number;
348 grouping icmpv4-type {
349 description "ICMP type.";
351 type uint8; // Define ICMP Type
354 grouping icmpv4-code {
355 description "ICMP code.";
357 type uint8; // Define ICMP Code
361 description "ARP opcode.";
367 description "ARP source IPv4 address.";
369 type inet:ipv4-prefix;
373 description "ARP target IPv4 address.";
375 type inet:ipv4-prefix;
379 description "ARP source hardware address.";
381 type yang:mac-address;
388 description "ARP target hardware address.";
390 type yang:mac-address;
397 description "IPv6 source address.";
399 type inet:ipv6-prefix;
403 description "IPv6 destination address.";
405 type inet:ipv6-prefix;
408 grouping ipv6-flabel {
409 description "IPv6 Flow Label";
411 type inet:ipv6-flow-label;
414 grouping icmpv6-type {
415 description "ICMPv6 type.";
420 grouping icmpv6-code {
421 description "ICMPv6 code.";
426 grouping ipv6-nd-target {
427 description "Target address for ND.";
429 type inet:ipv6-address;
432 grouping ipv6-nd-sll {
433 description "Source link-layer for ND.";
435 type yang:mac-address;
438 grouping ipv6-nd-tll {
439 description "Target link-layer for ND.";
441 type yang:mac-address;
444 grouping mpls-label {
445 description "MPLS label.";
447 type uint32; // TODO define type
451 description "MPLS TC.";
457 description "MPLS BoS bit.";
463 description "PBB I-SID.";
472 description "Logical Port Metadata.";
480 grouping ipv6-exthdr {
481 description "IPv6 Extension Header pseudo-field";
485 description "<No next header> encountered.";
489 description "Encrypted Sec Payload header present.";
493 description "Authentication header present.";
497 description "1 or 2 dest headers present.";
501 description "Fragment header present.";
505 description "Router header present.";
509 description "Hop-by-hop header present.";
513 description "Unexpected repeats encountered.";
517 description "Unexpected sequencing encountered.";
527 /* Basic Match Fields :
528 - Maybe it will be better to split into several groupings
529 based on protocol types:
537 Maybe this works belongs to other module.
540 grouping basic-match-fields {
546 container in-phy-port {
636 container icmpv4-type {
641 container icmpv4-code {
681 container ipv6-flabel {
686 container icmpv6-type {
691 container icmpv6-code {
696 container ipv6-nd-target {
701 container ipv6-nd-sll {
706 container ipv6-nd-tll {
711 container mpls-label {
731 container tunnel-id {
736 container ipv6-exthdr {