blob: 6649837be62305ac5b2ad5a614a599957f872ae1 [file] [log] [blame]
Jian Li58b33982020-07-01 19:07:02 +09001/*
2 * Copyright 2020-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.k8snode.api;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
20
21/**
22 * Representation of an external network.
23 */
24public interface K8sExternalNetwork {
25
26 /**
27 * Returns the external bridge's IP address.
28 *
29 * @return IP address; null if the IP address does not exist
30 */
31 IpAddress extBridgeIp();
32
33 /**
34 * Returns the external gateway IP address.
35 *
36 * @return IP address; null if the IP address does not exist
37 */
38 IpAddress extGatewayIp();
39
40 /**
41 * Returns the external gateway MAC address.
42 *
43 * @return MAC address; null if the MAC address does not exist
44 */
45 MacAddress extGatewayMac();
46
47 /**
Jian Li9bc67772020-10-07 02:12:33 +090048 * Returns the external interface name.
49 *
50 * @return interface name
51 */
52 String extIntf();
53
54 /**
Jian Li58b33982020-07-01 19:07:02 +090055 * Builder of new network entity.
56 */
57 interface Builder {
58
59 /**
60 * Builds an immutable kubernetes external network instance.
61 *
62 * @return kubernetes external network
63 */
64 K8sExternalNetwork build();
65
66 /**
Jian Li9bc67772020-10-07 02:12:33 +090067 * Returns kubernetes external network builder with supplied external bridge IP.
Jian Li58b33982020-07-01 19:07:02 +090068 *
69 * @param extBridgeIp external bridge IP
Jian Li9bc67772020-10-07 02:12:33 +090070 * @return kubernetes external network builder
Jian Li58b33982020-07-01 19:07:02 +090071 */
72 Builder extBridgeIp(IpAddress extBridgeIp);
73
74 /**
Jian Li9bc67772020-10-07 02:12:33 +090075 * Returns kubernetes external network builder with supplied gateway IP.
Jian Li58b33982020-07-01 19:07:02 +090076 *
77 * @param extGatewayIp external gateway IP
Jian Li9bc67772020-10-07 02:12:33 +090078 * @return kubernetes external network builder
Jian Li58b33982020-07-01 19:07:02 +090079 */
80 Builder extGatewayIp(IpAddress extGatewayIp);
81
82 /**
Jian Li9bc67772020-10-07 02:12:33 +090083 * Returns kubernetes external network builder with supplied external gateway MAC.
Jian Li58b33982020-07-01 19:07:02 +090084 *
85 * @param extGatewayMac external gateway MAC address
Jian Li9bc67772020-10-07 02:12:33 +090086 * @return kubernetes external network builder
Jian Li58b33982020-07-01 19:07:02 +090087 */
88 Builder extGatewayMac(MacAddress extGatewayMac);
Jian Li9bc67772020-10-07 02:12:33 +090089
90 /**
91 * Returns kubernetes external network builder with supplied external interface.
92 *
93 * @param extIntf external interface name
94 * @return kubernetes external network builder
95 */
96 Builder extIntf(String extIntf);
Jian Li58b33982020-07-01 19:07:02 +090097 }
98}