update NetvirtSfc postman collection
[netvirt.git] / openstack / net-virt-sfc / api / src / main / yang / ietf-acl.yang
1 module ietf-acl {
2   yang-version 1;
3
4   namespace "urn:ietf:params:xml:ns:yang:ietf-acl";
5
6   prefix acl;
7
8   import ietf-yang-types {
9       prefix "ietf";
10   }
11
12   import packet-fields {
13       prefix "packet-fields";
14   }
15
16   organization
17     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
18
19   contact
20     "WG Web: http://tools.ietf.org/wg/netmod/
21     WG List: netmod@ietf.org
22
23     WG Chair: Juergen Schoenwaelder
24     j.schoenwaelder@jacobs-university.de
25
26     WG Chair: Tom Nadeau
27     tnadeau@lucidvision.com
28
29     Editor: Dean Bogdanovic
30     deanb@juniper.net
31
32     Editor: Kiran Agrahara Sreenivasa
33     kkoushik@brocade.com
34
35     Editor: Lisa Huang
36     yihuan@cisco.com
37
38     Editor: Dana Blair
39     dblair@cisco.com";
40
41   description
42     "This YANG module defines a component that describing the
43     configuration of Access Control Lists (ACLs).";
44
45   revision 2014-10-10 {
46     description "Creating base model for netmod.";
47     reference
48       "RFC 6020: YANG - A Data Modeling Language for the
49       Network Configuration Protocol (NETCONF)";
50   }
51
52   identity acl-base {
53     description "Base acl type for all ACL type identifiers.";
54   }
55
56   identity ip-acl {
57     base "acl:acl-base";
58     description "layer 3 ACL type";
59   }
60  identity eth-acl {
61     base "acl:acl-base";
62     description "layer 2 ACL type";
63   }
64
65   typedef acl-type {
66     type identityref {
67       base "acl-base";
68     }
69     description
70       "This type is used to refer to an Access Control List
71       (ACL) type";
72   }
73
74   typedef acl-ref {
75     type leafref {
76       path "/acl:access-lists/acl:access-list/acl:acl-name";
77     }
78     description "This type is used by data models that
79     need to referenced an acl";
80   }
81
82   container access-lists {
83     description
84       "Access control lists.";
85
86     list access-list {
87       key acl-name;
88       description "
89         An access list (acl) is an ordered list of
90         access list entries (ace). Each ace has a
91         sequence number to define the order, list
92         of match criteria, and a list of actions.
93         Since there are several kinds of acls
94         implementeded with different attributes for
95         each and different for each vendor, this
96         model accomodates customizing acls for
97         each kind and for each vendor.
98         ";
99
100       leaf acl-name {
101         type string;
102         description "The name of access-list.
103         A device MAY restrict the length and value of
104         this name, possibly space and special
105         characters are not allowed.";
106       }
107
108       leaf acl-type {
109         type acl-type;
110         description "Type of ACL";
111       }
112
113       container acl-oper-data {
114         config false;
115
116         description "Overall ACL operational data";
117         leaf match-counter {
118           type ietf:counter64;
119           description "Total match count for ACL";
120         }
121
122         leaf-list targets {
123           type string;
124           description "List of targets where ACL is applied";
125         }
126       }
127
128       container access-list-entries {
129         description "The access-list-entries container contains
130           a list of access-list-entry(ACE).";
131
132           list access-list-entry {
133             key rule-name;
134             ordered-by user;
135
136             description "List of access list entries(ACE)";
137             leaf rule-name {
138               type string;
139               description "Entry name.";
140             }
141
142             container matches {
143               description "Define match criteria";
144               choice ace-type {
145                 description "Type of ace.";
146                 case ace-ip {
147                   uses packet-fields:acl-ip-header-fields;
148                   choice ace-ip-version {
149                     description "Choice of IP version.";
150                     case ace-ipv4 {
151                       uses packet-fields:acl-ipv4-header-fields;
152                     }
153                     case ace-ipv6 {
154                       uses packet-fields:acl-ipv6-header-fields;
155                     }
156                   }
157                 }
158                 case ace-eth {
159                   uses packet-fields:acl-eth-header-fields;
160                 }
161               }
162               uses packet-fields:metadata;
163           }
164
165           container actions {
166             description "Define action criteria";
167             choice packet-handling {
168               default deny;
169
170               description "Packet handling action.";
171               case deny {
172                 leaf deny {
173                   type empty;
174                   description "Deny action.";
175                 }
176               }
177               case permit {
178                 leaf permit {
179                   type empty;
180                   description "Permit action.";
181                 }
182               }
183             }
184           }
185
186           container ace-oper-data {
187             config false;
188
189             description "Per ace operational data";
190             leaf match-counter {
191               type ietf:counter64;
192               description "Number of matches for an ace";
193             }
194           }
195         }
196       }
197     }
198   }
199 }