gaurav
Committed by Gerrit Code Review

DHCP Relay Application, addressed the review comments for patch-2.

Change-Id: If447f3786c661c667460f43fc659ea71dd198be7
......@@ -98,6 +98,7 @@ APPS = [
# Apps
'//apps/dhcp:onos-apps-dhcp-oar',
'//apps/dhcprelay:onos-apps-dhcprelay-oar',
'//apps/fwd:onos-apps-fwd-oar',
'//apps/acl:onos-apps-acl-oar',
'//apps/bgprouter:onos-apps-bgprouter-oar',
......@@ -147,6 +148,7 @@ APP_JARS = [
'//apps/routing-api:onos-apps-routing-api',
'//apps/dhcp/api:onos-apps-dhcp-api',
'//apps/dhcp/app:onos-apps-dhcp-app',
'//apps/dhcprelay:onos-apps-dhcprelay',
'//apps/fwd:onos-apps-fwd',
'//apps/iptopology-api:onos-apps-iptopology-api',
'//apps/openstacknode:onos-apps-openstacknode',
......
COMPILE_DEPS = [
'//lib:CORE_DEPS',
]
osgi_jar (
deps = COMPILE_DEPS,
)
onos_app (
app_name = 'org.onosproject.dhcprelay',
title = 'DHCP Relay Agent App',
category = 'default',
url = 'http://onosproject.org',
description = 'DHCP Relay Agent Application.',
)
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Open Networking Laboratory
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-apps</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-app-dhcprelay</artifactId>
<packaging>bundle</packaging>
<description>DHCP Relay Agent</description>
<url>http://onosproject.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<onos.version>1.6.0-SNAPSHOT</onos.version>
<onos.app.name>org.onosproject.dhcprelay</onos.app.name>
<onos.app.title>DHCP Relay Agent App</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>DHCP Relay Agent Application.</onos.app.readme>
</properties>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
<version>${onos.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-osgi</artifactId>
<version>${onos.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
<version>${onos.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.12</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.dhcprelay;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.config.Config;
import static org.onosproject.net.config.Config.FieldPresence.MANDATORY;
/**
* DHCP Relay Config class.
*/
public class DhcpRelayConfig extends Config<ApplicationId> {
private static final String DHCP_CONNECT_POINT = "dhcpserverConnectPoint";
@Override
public boolean isValid() {
return hasOnlyFields(DHCP_CONNECT_POINT) &&
isConnectPoint(DHCP_CONNECT_POINT, MANDATORY);
}
/**
* Returns the dhcp server connect point.
*
* @return dhcp server connect point
*/
public ConnectPoint getDhcpServerConnectPoint() {
return ConnectPoint.deviceConnectPoint(object.path(DHCP_CONNECT_POINT).asText());
}
}
/*
* Copyright 2014-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* DHCP-RELAY application.
*/
package org.onosproject.dhcprelay;
{
"apps": {
"org.onosproject.dhcp-relay" : {
"dhcprelay" : {
"dhcpserverConnectPoint": "of:0000000000000002/2"
}
}
}
}
......@@ -53,6 +53,7 @@
<module>flowanalyzer</module>
<module>vtn</module>
<module>dhcp</module>
<module>dhcprelay</module>
<module>mfwd</module>
<module>pim</module>
<module>mlb</module>
......