0ca86a8905f91ca2627f7efabba3fcd165a71317
[transportpce.git] / ordmodels / src / main / yang / ietf-packet-fields@2016-02-18.yang
1 module ietf-packet-fields {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields";
4   prefix packet-fields;
5   import ietf-inet-types {
6     prefix inet; revision-date 2013-07-15;
7   }
8   import ietf-yang-types {
9     prefix yang; revision-date 2013-07-15;
10   }
11   import ietf-interfaces {
12     prefix if; revision-date 2014-05-08;
13   }
14   organization "IETF NETMOD (NETCONF Data Modeling Language) Working
15                 Group";
16   contact
17     "WG Web: http://tools.ietf.org/wg/netmod/
18     WG List: netmod@ietf.org
19     WG Chair: Juergen Schoenwaelder
20     j.schoenwaelder@jacobs-university.de
21     WG Chair: Tom Nadeau
22     tnadeau@lucidvision.com
23     Editor: Dean Bogdanovic
24     deanb@juniper.net
25     Editor: Kiran Agrahara Sreenivasa
26     kkoushik@cisco.com
27     Editor: Lisa Huang
28     lyihuang@juniper.net
29     Editor: Dana Blair
30     dblair@cisco.com";
31   description
32     "This YANG module defines groupings that are used by
33     ietf-access-control-list YANG module. Their usage is not
34     limited to ietf-access-control-list and can be
35     used anywhere as applicable.
36     Copyright (c) 2016 IETF Trust and the persons identified as
37     the document authors.  All rights reserved.
38     Redistribution and use in source and binary forms, with or
39     without modification, is permitted pursuant to, and subject
40     to the license terms contained in, the Simplified BSD
41     License set forth in Section 4.c of the IETF Trust's Legal
42     Provisions Relating to IETF Documents
43     (http://trustee.ietf.org/license-info).
44     This version of this YANG module is part of RFC XXXX; see
45     the RFC itself for full legal notices.";
46   revision 2016-02-18 {
47     description
48       "Initial version of packet fields used by
49       ietf-access-control-list";
50     reference
51       "RFC XXXX: Network Access Control List (ACL)
52       YANG Data  Model";
53   }
54   grouping acl-transport-header-fields {
55     description
56       "Transport header fields";
57     container source-port-range {
58       presence "Enables setting source port range";
59       description
60         "Inclusive range representing source ports to be used.
61         When only lower-port is present, it represents a single port.";
62       leaf lower-port {
63         type inet:port-number;
64         mandatory true;
65         description
66           "Lower boundary for port.";
67       }
68       leaf upper-port {
69         type inet:port-number;
70         must ". >= ../lower-port" {
71           error-message
72           "The upper-port must be greater than or equal to lower-port";
73         }
74         description
75           "Upper boundary for port . If existing, the upper port
76           must be greater or equal to lower-port.";
77       }
78     }
79     container destination-port-range {
80       presence "Enables setting destination port range";
81       description
82         "Inclusive range representing destination ports to be used. When
83         only lower-port is present, it represents a single port.";
84       leaf lower-port {
85         type inet:port-number;
86         mandatory true;
87         description
88           "Lower boundary for port.";
89       }
90       leaf upper-port {
91         type inet:port-number;
92         must ". >= ../lower-port" {
93           error-message
94             "The upper-port must be greater than or equal to lower-port";
95         }
96
97         description
98           "Upper boundary for port. If existing, the upper port must
99           be greater or equal to lower-port";
100       }
101     }
102   }
103   grouping acl-ip-header-fields {
104     description
105       "IP header fields common to ipv4 and ipv6";
106     leaf dscp {
107       type inet:dscp;
108       description
109         "Value of dscp.";
110     }
111     leaf protocol {
112       type uint8;
113       description
114         "Internet Protocol number.";
115     }
116     uses acl-transport-header-fields;
117   }
118   grouping acl-ipv4-header-fields {
119     description
120       "Fields in IPv4 header.";
121     leaf destination-ipv4-network {
122       type inet:ipv4-prefix;
123       description
124         "Destination IPv4 address prefix.";
125     }
126     leaf source-ipv4-network {
127       type inet:ipv4-prefix;
128       description
129         "Source IPv4 address prefix.";
130     }
131   }
132   grouping acl-ipv6-header-fields {
133     description
134       "Fields in IPv6 header";
135     leaf destination-ipv6-network {
136       type inet:ipv6-prefix;
137       description
138         "Destination IPv6 address prefix.";
139     }
140     leaf source-ipv6-network {
141       type inet:ipv6-prefix;
142       description
143         "Source IPv6 address prefix.";
144     }
145     leaf flow-label {
146       type inet:ipv6-flow-label;
147       description
148         "IPv6 Flow label.";
149     }
150     reference
151       "RFC 4291: IP Version 6 Addressing Architecture
152       RFC 4007: IPv6 Scoped Address Architecture
153       RFC 5952: A Recommendation for IPv6 Address Text Representation";
154   }
155   grouping acl-eth-header-fields {
156     description
157       "Fields in Ethernet header.";
158     leaf destination-mac-address {
159       type yang:mac-address;
160       description
161         "Destination IEEE 802 MAC address.";
162     }
163     leaf destination-mac-address-mask {
164       type yang:mac-address;
165       description
166         "Destination IEEE 802 MAC address mask.";
167     }
168     leaf source-mac-address {
169       type yang:mac-address;
170       description
171         "Source IEEE 802 MAC address.";
172     }
173     leaf source-mac-address-mask {
174       type yang:mac-address;
175       description
176         "Source IEEE 802 MAC address mask.";
177     }
178     reference
179       "IEEE 802: IEEE Standard for Local and Metropolitan Area
180       Networks: Overview and Architecture.";
181   }
182
183   grouping metadata {
184     description
185       "Fields associated with a packet whick are not in
186       the header.";
187     leaf input-interface {
188       type if:interface-ref {
189         require-instance false;
190       }
191       description
192         "Packet was received on this interface.";
193     }
194   }
195 }