1 module vpp-classifier {
3 namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier";
4 prefix "vpp-classifier";
6 revision "2016-12-14" {
8 "This revision adds the following new features:
9 - updates order of union types for opaque-index";
12 revision "2015-06-03" {
14 "Initial revision of model for VPP packet classifier.
15 The model can be used ony to implement ACLs.
16 Other classify table usages are not supported yet,
17 see https://jira.fd.io/browse/VPP-203 for details.";
19 "https://wiki.fd.io/view/VPP/Introduction_To_N-tuple_Classifiers";
22 import ietf-yang-types {
26 typedef classify-table-ref {
28 path "/vpp-classifier:vpp-classifier/classify-table/name";
31 "This type is used by data models that need to reference
32 configured classify tables.";
35 typedef packet-handling-action {
38 // by VPP convention, first neighbour node (at index 0) is a drop node
42 value -1; // indicates that the next node not set
47 typedef vpp-node-name {
53 type packet-handling-action;
57 "Defines VPP node reference using packet handling action or relative node name
58 (if definition in terms of packet handling action is not possible).";
61 typedef opaque-index {
67 "Defines opaque-index type - metadata that can be attached to session-hit packets.
68 Vpp nodes can't be referenced by index, because node indexes might change after vpp restart.";
71 grouping classify-session-attributes {
73 "Defines classify session attributes that are mapped to classify_add_del_session
74 and classify_session_details messages parameters.";
80 "Vpp node to which packet will be send when it produces a match.";
89 "Nodes like ip4/6-classify use the parameter to \"consume\" networking layer.
90 Example: tunnel decapsulation.";
94 grouping classify-table-base-attributes {
96 "Defines classify table attributes that are mapped to classify_add_del_table message parameters.";
98 leaf classifier-node {
101 "Name of VPP node the table is defined for.";
107 "Used by classifier hashing algorithm. It is not possible to resize the bucket array,
108 therefore suggested value is approximate number of expected entries.";
110 leaf skip_n_vectors {
114 "Number of 16 byte vectors to be skipped before applying mask.";
117 type classify-table-ref;
119 "Reference to the next classify table. Required when multiple table chaining is used.";
125 "Vpp node to which packet will be send when it falis to produce a match";
128 type yang:hex-string;
131 "Defines match mask (multiple of 16 bytes)";
134 list classify-session {
138 type yang:hex-string;
140 "Defines actual value to be matched that is
141 a byte vector, which length is multiple of 16 bytes";
143 must "string-length(match) = string-length(../../mask)" {
145 "Match length is not equal to classify table mask length.";
147 "Match length must be equal to classify table mask length.";
151 uses classify-session-attributes;
155 grouping classify-table-config-attributes {
157 "Defines classify table config only attributes (present in classify_add_del_table message
158 but not in classify_table_info_reply).";
160 // FIXME move to classify-table-base-attributes
161 // after https://jira.fd.io/browse/VPP-208 is fixed
166 "Memory size for classify table and its entries.";
170 grouping classify-table-operational-attributes {
172 "Defines classify table operational attributes (present in classify_table_info_reply message
173 but not in classify_add_del_table).";
175 leaf active_sessions {
179 "Number of sessions defined for the classify table.";
183 container vpp-classifier {
184 list classify-table {
190 "Hides classify table identifier managed by vpp.";
193 uses classify-table-base-attributes;
194 uses classify-table-config-attributes;
198 container vpp-classifier-state {
201 list classify-table {
207 "Hides classify table identifier managed by vpp.";
210 uses classify-table-base-attributes;
211 uses classify-table-operational-attributes;