blob: 088f12d4ab400841f2a3936ba721e3185a3efb5c [file] [log] [blame]
Jian Li38e4d942018-07-03 22:19:16 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.openstackvtap.api;
17
18import org.onlab.packet.IpPrefix;
19import org.onlab.packet.TpPort;
20
21/**
Jimo Jung14e87bf2018-09-03 16:28:13 +090022 * A vtap criterion used for mirroring traffic.
Jian Li38e4d942018-07-03 22:19:16 +090023 */
24public interface OpenstackVtapCriterion {
25
26 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090027 * Returns IP prefix of source.
Jian Li38e4d942018-07-03 22:19:16 +090028 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090029 * @return source IP prefix of vtap criterion
Jian Li38e4d942018-07-03 22:19:16 +090030 */
31 IpPrefix srcIpPrefix();
32
33 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090034 * Returns IP prefix of destination.
Jian Li38e4d942018-07-03 22:19:16 +090035 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090036 * @return destination IP prefix of vtap criterion
Jian Li38e4d942018-07-03 22:19:16 +090037 */
38 IpPrefix dstIpPrefix();
39
40 /**
41 * Returns IP protocol.
42 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090043 * @return IP protocol of vtap criterion
Jian Li38e4d942018-07-03 22:19:16 +090044 */
45 byte ipProtocol();
46
47 /**
48 * Returns source transport port.
49 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090050 * @return source transport port of vtap criterion
Jian Li38e4d942018-07-03 22:19:16 +090051 */
52
53 TpPort srcTpPort();
54
55 /**
56 * Returns destination transport port.
57 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090058 * @return destination transport port of vtap criterion
Jian Li38e4d942018-07-03 22:19:16 +090059 */
60 TpPort dstTpPort();
61
62 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090063 * Builder of new OpenstackVtapCriterion instance.
Jian Li38e4d942018-07-03 22:19:16 +090064 */
65 interface Builder {
Jian Li38e4d942018-07-03 22:19:16 +090066 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090067 * Returns openstack vtap criterion builder with supplied source IP prefix.
Jian Li38e4d942018-07-03 22:19:16 +090068 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090069 * @param srcIpPrefix Source IP prefix
70 * @return openstack vtap criterion builder
Jian Li38e4d942018-07-03 22:19:16 +090071 */
72 Builder srcIpPrefix(IpPrefix srcIpPrefix);
73
74 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090075 * Returns openstack vtap criterion builder with supplied destination IP prefix.
Jian Li38e4d942018-07-03 22:19:16 +090076 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090077 * @param dstIpPrefix Destination IP prefix
78 * @return openstack vtap criterion builder
Jian Li38e4d942018-07-03 22:19:16 +090079 */
80 Builder dstIpPrefix(IpPrefix dstIpPrefix);
81
82 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090083 * Returns openstack vtap criterion builder with supplied ipProtocol.
Jian Li38e4d942018-07-03 22:19:16 +090084 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090085 * @param ipProtocol IP protocol
86 * @return openstack vtap criterion builder
Jian Li38e4d942018-07-03 22:19:16 +090087 */
88 Builder ipProtocol(byte ipProtocol);
89
90 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090091 * Returns openstack vtap criterion builder with supplied source port.
Jian Li38e4d942018-07-03 22:19:16 +090092 *
Jimo Jung14e87bf2018-09-03 16:28:13 +090093 * @param srcTpPort Source transport port
94 * @return openstack vtap criterion builder
Jian Li38e4d942018-07-03 22:19:16 +090095 */
96 Builder srcTpPort(TpPort srcTpPort);
97
98 /**
Jimo Jung14e87bf2018-09-03 16:28:13 +090099 * Returns openstack vtap criterion builder with supplied destination port.
Jian Li38e4d942018-07-03 22:19:16 +0900100 *
Jimo Jung14e87bf2018-09-03 16:28:13 +0900101 * @param dstTpPort Destination transport port
102 * @return openstack vtap criterion builder
Jian Li38e4d942018-07-03 22:19:16 +0900103 */
104 Builder dstTpPort(TpPort dstTpPort);
Jimo Jung14e87bf2018-09-03 16:28:13 +0900105
106 /**
107 * Builds an immutable OpenstackVtapCriterion instance.
108 *
109 * @return OpenstackVtapCriterion criterion
110 */
111 OpenstackVtapCriterion build();
Jian Li38e4d942018-07-03 22:19:16 +0900112 }
113}