90681653aafc2d28173225cb20dcdfe24a245ac9
[transportpce.git] / ordmodels / src / main / yang / ietf-access-control-list@2016-02-18.yang
1 module ietf-access-control-list {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list";
4   prefix acl;
5   import ietf-yang-types {
6     prefix yang; revision-date 2013-07-15;
7   }
8   import ietf-packet-fields {
9     prefix packet-fields; revision-date 2016-02-18;
10   }
11   organization "IETF NETMOD (NETCONF Data Modeling Language)
12            Working 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     ivandean@gmail.com
22     Editor: Kiran Agrahara Sreenivasa
23     kkoushik@cisco.com
24     Editor: Lisa Huang
25     lyihuang@juniper.net
26     Editor: Dana Blair
27     dblair@cisco.com";
28   description
29     "This YANG module defines a component that describing the
30     configuration of Access Control Lists (ACLs).
31     Copyright (c) 2016 IETF Trust and the persons identified as
32     the document authors.  All rights reserved.
33     Redistribution and use in source and binary forms, with or
34     without modification, is permitted pursuant to, and subject
35     to the license terms contained in, the Simplified BSD
36     License set forth in Section 4.c of the IETF Trust's Legal
37     Provisions Relating to IETF Documents
38     (http://trustee.ietf.org/license-info).
39     This version of this YANG module is part of RFC XXXX; see
40     the RFC itself for full legal notices.";
41   revision 2016-02-18 {
42     description
43       "Base model for Network Access Control List (ACL).";
44     reference
45       "RFC XXXX: Network Access Control List (ACL)
46       YANG Data  Model";
47   }
48   identity acl-base {
49     description
50       "Base Access Control List type for all Access Control List type
51       identifiers.";
52   }
53   identity ipv4-acl {
54     base acl:acl-base;
55     description
56        "ACL that primarily matches on fields from the IPv4 header
57        (e.g. IPv4 destination address) and layer 4 headers (e.g. TCP
58        destination port).  An acl of type ipv4-acl does not contain
59        matches on fields in the ethernet header or the IPv6 header.";
60   }
61   identity ipv6-acl {
62     base acl:acl-base;
63     description
64       "ACL that primarily matches on fields from the IPv6 header
65       (e.g. IPv6 destination address) and layer 4 headers (e.g. TCP
66       destination port). An acl of type ipv6-acl does not contain
67       matches on fields in the ethernet header or the IPv4 header.";
68   }
69   identity eth-acl {
70     base acl:acl-base;
71     description
72       "ACL that primarily matches on fields in the ethernet header,
73       like 10/100/1000baseT or WiFi Access Control List. An acl of
74       type eth-acl does not contain matches on fields in the IPv4
75       header, IPv6 header or layer 4 headers.";
76   }
77   typedef acl-type {
78     type identityref {
79       base acl:acl-base;
80     }
81     description
82       "This type is used to refer to an Access Control List
83       (ACL) type";
84   }
85   typedef access-control-list-ref {
86     type leafref {
87       path "/access-lists/acl/acl-name";
88     }
89     description
90       "This type is used by data models that need to reference an
91       Access Control List";
92   }
93   container access-lists {
94     description
95       "This is a top level container for Access Control Lists.
96       It can have one or more Access Control Lists.";
97     list acl {
98       key "acl-type acl-name";
99       description
100         "An Access Control List(ACL) is an ordered list of
101         Access List Entries (ACE). Each Access Control Entry has a
102         list of match criteria and a list of actions.
103         Since there are several kinds of Access Control Lists
104         implemented with different attributes for
105         different vendors, this
106         model accommodates customizing Access Control Lists for
107         each kind and for each vendor.";
108       leaf acl-name {
109         type string;
110         description
111           "The name of access-list. A device MAY restrict the length
112            and value of this name, possibly space and special
113            characters are not allowed.";
114       }
115       leaf acl-type {
116         type acl-type;
117         description
118             "Type of access control list. Indicates the primary intended
119             type of match criteria (e.g. ethernet, IPv4, IPv6, mixed, etc)
120             used in the list instance.";
121       }
122       container acl-oper-data {
123         config false;
124         description
125           "Overall Access Control List operational data";
126       }
127       container access-list-entries {
128         description
129           "The access-list-entries container contains
130           a list of access-list-entries(ACE).";
131         list ace {
132           key "rule-name";
133           ordered-by user;
134           description
135             "List of access list entries(ACE)";
136           leaf rule-name {
137             type string;
138             description
139               "A unique name identifying this Access List
140               Entry(ACE).";
141           }
142           container matches {
143             description
144               "Definitions for match criteria for this Access List
145         Entry.";
146             choice ace-type {
147               description
148                 "Type of access list entry.";
149               case ace-ip {
150                       description "IP Access List Entry.";
151                 choice ace-ip-version {
152                   description
153                     "IP version used in this Access List Entry.";
154                   case ace-ipv4 {
155                     uses packet-fields:acl-ipv4-header-fields;
156                   }
157                   case ace-ipv6 {
158                     uses packet-fields:acl-ipv6-header-fields;
159                   }
160                 }
161                 uses packet-fields:acl-ip-header-fields;
162               }
163               case ace-eth {
164                 description
165                   "Ethernet Access List entry.";
166                 uses packet-fields:acl-eth-header-fields;
167               }
168             }
169             uses packet-fields:metadata;
170           }
171           container actions {
172             description
173               "Definitions of action criteria for this Access List
174         Entry.";
175             choice packet-handling {
176               default "deny";
177               description
178                 "Packet handling action.";
179               case deny {
180                 leaf deny {
181                   type empty;
182                   description
183                     "Deny action.";
184                 }
185               }
186               case permit {
187                 leaf permit {
188                   type empty;
189                   description
190                     "Permit action.";
191                 }
192               }
193             }
194           }
195           container ace-oper-data {
196             config false;
197             description
198               "Operational data for this Access List Entry.";
199             leaf match-counter {
200               type yang:counter64;
201               description
202                 "Number of matches for this Access List Entry";
203             }
204           }
205         }
206       }
207     }
208   }
209 }