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