2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
8 package org.opendaylight.vpnservice.dhcpservice;
10 import java.util.ArrayList;
11 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnet.attributes.HostRoutes;
16 public class DhcpInfo {
17 private String _clientIp;
18 private String _serverIp;
19 private String _gatewayIp;
21 private List<String> _dnsServers;
22 private List<HostRoutes> _hostRoutes;
28 protected DhcpInfo setClientIp(String clientIp) {
33 protected DhcpInfo setCidr(String cidr) {
38 protected DhcpInfo setServerIp(String serverIp) {
43 protected DhcpInfo setGatewayIp(String gwIp) {
48 protected DhcpInfo setHostRoutes(List<HostRoutes> hostRoutes) {
49 _hostRoutes = hostRoutes;
53 protected DhcpInfo setDnsServers(List<String> dnsServers) {
54 _dnsServers = dnsServers;
58 protected DhcpInfo setDnsServersIpAddrs(List<IpAddress> dnsServers) {
59 for (IpAddress ipAddr: dnsServers) {
60 addDnsServer(ipAddr.getIpv4Address().getValue());
65 protected DhcpInfo addDnsServer(String dnsServerIp) {
66 if(_dnsServers == null) {
67 _dnsServers = new ArrayList<String>();
69 _dnsServers.add(dnsServerIp);
74 protected String getClientIp() {
78 protected String getCidr() {
82 protected String getServerIp() {
86 protected String getGatewayIp() {
90 protected List<String> getDnsServers() {
94 protected List<HostRoutes> getHostRoutes() {