Move interface acls to separate yang module
[honeycomb.git] / v3po / api / src / main / yang / vpp-acl.yang
1 module vpp-acl {
2   yang-version 1;
3   namespace "urn:opendaylight:params:xml:ns:yang:vpp:acl";
4   prefix "vpp-acl";
5
6   revision "2016-12-14" {
7     description
8       "Initial revision of vpp-acl model.";
9   }
10
11   import ietf-access-control-list {
12     prefix "acl";
13   }
14
15   import vpp-classifier {
16     prefix "vpp-classifier";
17   }
18
19   typedef interface-mode {
20     type enumeration {
21       enum "l2";
22       enum "l3";
23     }
24   }
25   grouping acl-base-attributes {
26     description
27       "Defines references to classify tables.
28        At least one table reference should be specified.";
29     container l2-acl {
30       leaf classify-table {
31         type vpp-classifier:classify-table-ref;
32         description
33           "An L2 ACL table";
34       }
35     }
36     container ip4-acl {
37       leaf classify-table {
38         type vpp-classifier:classify-table-ref;
39         description
40           "An IPv4 ACL table";
41       }
42     }
43     container ip6-acl {
44       leaf classify-table {
45         type vpp-classifier:classify-table-ref;
46         description
47           "An IPv6 ACL table";
48       }
49     }
50   }
51
52   grouping ietf-acl-base-attributes {
53     description
54       "Provides limited support for ietf-acl model.";
55
56     container access-lists {
57       description
58         "Defines references to ietf-acl lists. Before assignment to interface,
59         ACL lists are merged into 3 type of acls (l2, ip4 and ip6) that are supported by vpp.
60         Then 3 corresponding chains of tables and sessions are created and assigned to the interface
61         as l2, ip4 and ip6 classify table chains.
62         User ordering is preserved in each group separately.
63
64         Assignment update/delete removes all created tables and sessions and repeats process described above.
65         Update/delete of ACL lists referenced here is not permitted (assignment needs to be removed first).
66
67         Read is supported only for acls that were created and assigned by Honeycomb agent
68         (corresponding metadata are present).
69
70         Limitations (due to vpp limitations):
71         - egress rules are currently ignored (HONEYCOMB-234)
72         - L4 rules are currently not supported (limited support will by provided by HONEYCOMB-218)
73         - mixing L2/L3/L4 rules is currently not supported (limited support will by provided by HONEYCOMB-233)
74         - L2 only rules on L3 interfaces are not supported (not allowed by vpp,
75           in the future defining L2/L3 pairs should be partially supported)
76         - vlan tags are supported only for sub-interfaces defined as exact-match";
77       list acl {
78         key "type name";
79         ordered-by user;
80
81         leaf type {
82           type acl:acl-type;
83         }
84
85         leaf name {
86           type acl:access-control-list-ref;
87         }
88       }
89
90       leaf default-action {
91         type enumeration {
92           enum "deny";
93           enum "permit";
94          }
95          default "deny";
96         description
97           "Default action applied to packet that does not match any of rules defined in assigned ACLs.
98            It is translated to single classify table and applied at the end of assigned chains.";
99       }
100
101       leaf mode {
102         type interface-mode;
103         default l3;
104         description
105           "The way ACLs are translated depends on the interface mode.
106            In case of L2 interfaces (bridge/interconnection)
107            classify tables are assigned as l2_table using input_acl_set_interface (ether type matching is automatically
108            added in case of L3 rules).
109            In case of L3 interfaces, classify tables are assigned as ip4/ip6 tables.
110
111            It is the user responsibility to choose mode that matches target interface.
112            ";
113       }
114     }
115   }
116 }