35a19c827629a95698e4689773a8f9f52c5ea8c3
[netvirt.git] / neutronvpn / api / src / main / java / org / opendaylight / netvirt / neutronvpn / api / utils / NeutronConstants.java
1 /*
2  * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netvirt.neutronvpn.api.utils;
9
10 import java.util.function.Predicate;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
12
13 public interface NeutronConstants {
14
15     String DEVICE_OWNER_GATEWAY_INF = "network:router_gateway";
16     String DEVICE_OWNER_ROUTER_INF = "network:router_interface";
17     String DEVICE_OWNER_FLOATING_IP = "network:floatingip";
18     String DEVICE_OWNER_DHCP = "network:dhcp";
19     String FLOATING_IP_DEVICE_ID_PENDING = "PENDING";
20     String PREFIX_TAP = "tap";
21     String PREFIX_VHOSTUSER = "vhu";
22     String RD_IDPOOL_NAME = "RouteDistinguisherPool";
23     String RD_IDPOOL_SIZE = "65535";// 16 bit AS specific part of RD
24     long RD_IDPOOL_START = 1L;
25     String RD_PROPERTY_KEY = "vpnservice.admin.rdvalue";//stored in etc/custom.properties
26     String VIF_TYPE_VHOSTUSER = "vhostuser";
27     String VIF_TYPE_UNBOUND = "unbound";
28     String VIF_TYPE_BINDING_FAILED = "binding_failed";
29     String VIF_TYPE_DISTRIBUTED = "distributed";
30     String VIF_TYPE_OVS = "ovs";
31     String VIF_TYPE_BRIDGE = "bridge";
32     String VIF_TYPE_OTHER = "other";
33     String VIF_TYPE_MACVTAP = "macvtap";
34     String VNIC_TYPE_NORMAL = "normal";
35     String VNIC_TYPE_DIRECT = "direct";
36     String BINDING_PROFILE_CAPABILITIES = "capabilities";
37     String SWITCHDEV = "switchdev";
38     int MAX_ROUTERS_PER_BGPVPN = 2;
39     int INVALID_ID = 0;
40
41     Predicate<Port> IS_DHCP_PORT = port -> port != null
42             && DEVICE_OWNER_DHCP.equals(port.getDeviceOwner());
43
44     Predicate<Port> IS_ODL_DHCP_PORT = port -> port != null
45             && DEVICE_OWNER_DHCP.equals(port.getDeviceOwner()) && port.getDeviceId() != null
46             && port.getDeviceId().startsWith("OpenDaylight");
47     long LOCK_WAIT_TIME = 10L;
48
49 }