blob: 503280065ec388f8f2129b0ed6acbb3d824bf11e [file] [log] [blame]
Daniele Moro94660a02019-12-02 12:02:07 -08001/*
Joey Armstronga68e7852024-01-28 13:27:02 -05002 * Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
Daniele Moro94660a02019-12-02 12:02:07 -08003 *
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 */
16
17package org.opencord.bng.config;
18
Daniele Moro94660a02019-12-02 12:02:07 -080019import org.onosproject.core.ApplicationId;
20import org.onosproject.net.ConnectPoint;
21import org.onosproject.net.config.Config;
22
23/**
24 * Configuration for the PPPoE control packet relay service.
25 */
26public class PppoeRelayConfig extends Config<ApplicationId> {
27 public static final String KEY = "pppoerelay";
28
29 private static final String PPPOE_SERVER_CONNECT_POINT = "pppoeServerConnectPoint";
30 private static final String OLT_CONNECT_POINT = "oltConnectPoint";
Daniele Moro94660a02019-12-02 12:02:07 -080031
32 @Override
33 public boolean isValid() {
Daniele Morof8a28ce2019-12-12 09:26:25 -080034 return hasOnlyFields(PPPOE_SERVER_CONNECT_POINT, OLT_CONNECT_POINT) &&
35 hasFields(PPPOE_SERVER_CONNECT_POINT, OLT_CONNECT_POINT);
Daniele Moro94660a02019-12-02 12:02:07 -080036 }
37
38 /**
39 * Gets the PPPoE server connect point.
40 *
41 * @return PPPoE server connect point
42 */
43 public ConnectPoint getPppoeServerConnectPoint() {
44 return ConnectPoint.deviceConnectPoint(object.path(PPPOE_SERVER_CONNECT_POINT).asText());
45 }
46
47 /**
48 * Gets the connect point where the OLT is connected to the ASG.
49 *
50 * @return ASG to OLT connect point
51 */
52 public ConnectPoint getAsgToOltConnectPoint() {
53 return ConnectPoint.deviceConnectPoint(object.path(OLT_CONNECT_POINT).asText());
54 }
Daniele Moro94660a02019-12-02 12:02:07 -080055}
56