1 module vpp-classifier {
3 namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier";
4 prefix "vpp-classifier";
6 revision "2015-06-03" {
8 "Initial revision of model for VPP packet classifier.
9 The model can be used ony to implement ACLs.
10 Other classify table usages are not supported yet,
11 see https://jira.fd.io/browse/VPP-203 for details.";
13 "https://wiki.fd.io/view/VPP/Introduction_To_N-tuple_Classifiers";
16 import ietf-yang-types {
20 typedef classify-table-ref {
22 path "/vpp-classifier:vpp-classifier/classify-table/name";
25 "This type is used by data models that need to reference
26 configured classify tables.";
29 typedef packet-handling-action {
32 // by VPP convention, first neighbour node (at index 0) is a drop node
36 value -1; // indicates that the next node not set
43 // FIXME: enable after VPP-203 is fixed
44 // type string; // name of vpp-node neighbour, TODO: base node also needs to be defined
45 type packet-handling-action;
48 "Defines VPP node reference using relative node name or packet handling action.";
51 typedef opaque-index {
57 "Defines opaque-index type - metadata that can be attached to session-hit packets.
58 Vpp nodes can't be referenced by index, because node indexes might change after vpp restart.";
61 grouping classify-session-attributes {
63 "Defines classify session attributes that are mapped to classify_add_del_session
64 and classify_session_details messages parameters.";
70 "Vpp node to which packet will be send when it produces a match.";
79 "Nodes like ip4/6-classify use the parameter to \"consume\" networking layer.
80 Example: tunnel decapsulation.";
84 grouping classify-table-base-attributes {
86 "Defines classify table attributes that are mapped to classify_add_del_table message parameters.";
92 "Used by classifier hashing algorithm. It is not possible to resize the bucket array,
93 therefore suggested value is approximate number of expected entries.";
99 "Memory size for classify table and its entries.";
101 leaf skip_n_vectors {
105 "Number of 16 byte vectors to be skipped before applying mask.";
108 type classify-table-ref;
110 "Reference to the next classify table. Required when multiple table chaining is used.";
116 "Vpp node to which packet will be send when it falis to produce a match";
119 type yang:hex-string;
122 "Defines match mask (multiple of 16 bytes)";
125 list classify-session {
129 type yang:hex-string;
131 "Defines actual value to be matched that is
132 a byte vector, which length is multiple of 16 bytes";
134 must "string-length(match) = string-length(../../mask)" {
136 "Match length is not equal to classify table mask length.";
138 "Match length must be equal to classify table mask length.";
142 uses classify-session-attributes;
146 grouping classify-table-operational-attributes {
148 "Defines classify table operational attributes (present in classify_table_info_reply message
149 but not in classify_add_del_table).";
151 leaf active_sessions {
155 "Number of sessions defined for the classify table.";
159 container vpp-classifier {
160 list classify-table {
166 "Hides classify table identifier managed by vpp.";
169 uses classify-table-base-attributes;
173 container vpp-classifier-state {
176 list classify-table {
182 "Hides classify table identifier managed by vpp.";
185 uses classify-table-base-attributes;
186 uses classify-table-operational-attributes;