c3121ebf1e4eede037db4e8539918c844e8cb686
[netvirt.git] / sfc / classifier / impl / src / main / java / org / opendaylight / netvirt / sfc / classifier / service / domain / api / ClassifierEntryRenderer.java
1 /*
2  * Copyright (c) 2017 Ericsson Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.netvirt.sfc.classifier.service.domain.api;
10
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.Matches;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
14
15 /**
16  * The interface of classifier entry renderers.
17  *
18  * <p>
19  * There are different independent render types:
20  * - Ingress (i.e. ingress bind to interface).
21  * - Node (i.e. node initialization).
22  * - Path (i.e. write path egress flows).
23  * - Match (i.e. write ACL flow).
24  * - Egress (i.e egress bind to interface).
25  *
26  * <p>
27  * A renderer may not implement all the render types and is responsible to know
28  * if the render applies to it or not (for example, an openflow renderer should
29  * not write to a non openflow node).
30  */
31 public interface ClassifierEntryRenderer {
32
33     /**
34      * Render ingress interface actions.
35      *
36      * @param interfaceKey the ingress interface key.
37      */
38     void renderIngress(InterfaceKey interfaceKey);
39
40     /**
41      * Render node wide actions.
42      *
43      * @param nodeId the classifier node identifier.
44      */
45     void renderNode(NodeId nodeId);
46
47     /**
48      * Render path based actions.
49      *
50      * @param nodeId the classifier node identifier.
51      * @param nsp the path identifier.
52      * @param nsi the path starting index.
53      * @param nsl the path length.
54      * @param firstHopIp the first SFF ip address. Null if the SFF is nodeId.
55      */
56     void renderPath(NodeId nodeId, Long nsp, short nsi, short nsl, String firstHopIp);
57
58     /**
59      * Rended match based actions.
60      *
61      * @param nodeId the classifier node identifier.
62      * @param connector the node connector for the ingress interface.
63      * @param matches the ACL matches.
64      * @param nsp the path identifier.
65      * @param nsi the initial path index.
66      */
67     void renderMatch(NodeId nodeId, String connector, Matches matches, Long nsp, Short nsi);
68
69     /**
70      * Render egress interface actions.
71      *
72      * @param interfaceKey the egress interface key.
73      * @param destinationIp the destination IP address associated to the
74      *                      interface. If the interface is a local interface,
75      *                      this should be a node local IP address, otherwise
76      *                      the remote IP address.
77      */
78     void renderEgress(InterfaceKey interfaceKey, String destinationIp);
79
80     /**
81      * Suppress ingress interface actions.
82      *
83      * @param interfaceKey the ingress interface key.
84      */
85     void suppressIngress(InterfaceKey interfaceKey);
86
87     /**
88      * Suppress node wide actions.
89      *
90      * @param nodeId the classifier node identifier.
91      */
92     void suppressNode(NodeId nodeId);
93
94     /**
95      * Supress path based actions.
96      *
97      * @param nodeId the classifier node identifier.
98      * @param nsp the path identifier.
99      * @param nsi the path starting index.
100      * @param nsl the path length.
101      * @param firstHopIp the first SFF ip address. Null if the SFF is nodeId.
102      */
103     void suppressPath(NodeId nodeId, Long nsp, short nsi, short nsl, String firstHopIp);
104
105     /**
106      * Supress match based actions.
107      *
108      * @param nodeId the classifier node identifier.
109      * @param connector the node connector for the ingress interface.
110      * @param matches the ACL matches.
111      * @param nsp the path identifier.
112      * @param nsi the initial path index.
113      */
114     void suppressMatch(NodeId nodeId, String connector, Matches matches, Long nsp, Short nsi);
115
116     /**
117      * Supress egress interface actions.
118      *
119      * @param interfaceKey the egress interface key.
120      * @param destinationIp the destination IP address associated to the
121      *                      interface. If the interface is a local interface,
122      *                      this should be a node local IP address, otherwise
123      *                      the remote IP address.
124      */
125     void suppressEgress(InterfaceKey interfaceKey, String destinationIp);
126 }