Class DhcpServiceUtils
- java.lang.Object
-
- org.opendaylight.netvirt.dhcpservice.DhcpServiceUtils
-
public final class DhcpServiceUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addToDpnIdCache(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
static void
bindDhcpService(java.lang.String interfaceName, short tableId, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
protected static void
createSubnetDhcpPortData(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port, java.util.function.BiConsumer<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SubnetToDhcpPort>,SubnetToDhcpPort> consumer)
static @Nullable java.lang.String
getAndUpdateVmMacAddress(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, DhcpManager dhcpManager)
static org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices
getBoundServices(java.lang.String serviceName, short servicePriority, int flowPriority, org.opendaylight.yangtools.yang.common.Uint64 cookie, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo>
getDhcpMatch()
static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo>
getDhcpMatch(java.lang.String vmMacAddress)
static org.opendaylight.yangtools.yang.common.Uint64
getDpnIdFromNodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId nodeConnectorId)
static @NonNull java.util.List<org.opendaylight.yangtools.yang.common.Uint64>
getDpnsForElan(java.lang.String elanInstanceName, org.opendaylight.mdsal.binding.api.DataBroker broker)
static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
getInterfaceFromOperationalDS(java.lang.String interfaceName, org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
static java.util.Optional<java.lang.String>
getIpV4Address(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port)
static java.lang.String
getJobKey(java.lang.String interfaceName)
static java.util.List<org.opendaylight.yangtools.yang.common.Uint64>
getListOfDpns(org.opendaylight.mdsal.binding.api.DataBroker broker)
static java.util.Optional<java.lang.String>
getNeutronSubnetId(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port)
static @Nullable java.lang.String
getSegmentationId(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid networkId, org.opendaylight.mdsal.binding.api.DataBroker broker)
static java.util.Optional<SubnetToDhcpPort>
getSubnetDhcpPortData(org.opendaylight.mdsal.binding.api.DataBroker broker, java.lang.String subnetId)
static @NonNull java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid>
getSubnetIdsFromNetworkId(org.opendaylight.mdsal.binding.api.DataBroker broker, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid networkId)
static boolean
isIpV4AddressAvailable(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps fixedIp)
static boolean
isIpv4Subnet(org.opendaylight.mdsal.binding.api.DataBroker broker, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid subnetUuid)
static void
removeFromDpnIdCache(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
protected static void
removeSubnetDhcpPortData(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port, java.util.function.Consumer<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SubnetToDhcpPort>> consumer)
static void
setupDhcpArpRequest(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, org.opendaylight.yangtools.yang.common.Uint64 vni, java.lang.String dhcpIpAddress, int lportTag, @Nullable java.lang.Long elanTag, boolean add, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
static void
setupDhcpDropAction(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, java.lang.String vmMacAddress, int addOrRemove, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
static void
setupDhcpFlowEntry(@Nullable org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, @Nullable java.lang.String vmMacAddress, int addOrRemove, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
static void
unbindDhcpService(java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
-
-
-
Method Detail
-
setupDhcpFlowEntry
public static void setupDhcpFlowEntry(@Nullable org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, @Nullable java.lang.String vmMacAddress, int addOrRemove, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
setupDhcpDropAction
public static void setupDhcpDropAction(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, java.lang.String vmMacAddress, int addOrRemove, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, DhcpServiceCounters dhcpServiceCounters, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
setupDhcpArpRequest
public static void setupDhcpArpRequest(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, org.opendaylight.yangtools.yang.common.Uint64 vni, java.lang.String dhcpIpAddress, int lportTag, @Nullable java.lang.Long elanTag, boolean add, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalUtil, org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getDhcpMatch
public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo> getDhcpMatch()
-
getDhcpMatch
public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfo> getDhcpMatch(java.lang.String vmMacAddress)
-
getListOfDpns
public static java.util.List<org.opendaylight.yangtools.yang.common.Uint64> getListOfDpns(org.opendaylight.mdsal.binding.api.DataBroker broker)
-
getDpnsForElan
public static @NonNull java.util.List<org.opendaylight.yangtools.yang.common.Uint64> getDpnsForElan(java.lang.String elanInstanceName, org.opendaylight.mdsal.binding.api.DataBroker broker)
-
getInterfaceFromOperationalDS
public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface getInterfaceFromOperationalDS(java.lang.String interfaceName, org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
-
getSegmentationId
public static @Nullable java.lang.String getSegmentationId(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid networkId, org.opendaylight.mdsal.binding.api.DataBroker broker)
-
getJobKey
public static java.lang.String getJobKey(java.lang.String interfaceName)
-
bindDhcpService
public static void bindDhcpService(java.lang.String interfaceName, short tableId, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
-
unbindDhcpService
public static void unbindDhcpService(java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx)
-
getBoundServices
public static org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices getBoundServices(java.lang.String serviceName, short servicePriority, int flowPriority, org.opendaylight.yangtools.yang.common.Uint64 cookie, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
-
createSubnetDhcpPortData
protected static void createSubnetDhcpPortData(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port, java.util.function.BiConsumer<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SubnetToDhcpPort>,SubnetToDhcpPort> consumer)
-
removeSubnetDhcpPortData
protected static void removeSubnetDhcpPortData(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port, java.util.function.Consumer<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SubnetToDhcpPort>> consumer)
-
getSubnetDhcpPortData
public static java.util.Optional<SubnetToDhcpPort> getSubnetDhcpPortData(org.opendaylight.mdsal.binding.api.DataBroker broker, java.lang.String subnetId)
-
getIpV4Address
public static java.util.Optional<java.lang.String> getIpV4Address(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port)
-
getNeutronSubnetId
public static java.util.Optional<java.lang.String> getNeutronSubnetId(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port port)
-
isIpV4AddressAvailable
public static boolean isIpV4AddressAvailable(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps fixedIp)
-
getAndUpdateVmMacAddress
public static @Nullable java.lang.String getAndUpdateVmMacAddress(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, DhcpManager dhcpManager) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getSubnetIdsFromNetworkId
public static @NonNull java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getSubnetIdsFromNetworkId(org.opendaylight.mdsal.binding.api.DataBroker broker, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid networkId)
-
isIpv4Subnet
public static boolean isIpv4Subnet(org.opendaylight.mdsal.binding.api.DataBroker broker, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid subnetUuid)
-
addToDpnIdCache
public static void addToDpnIdCache(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
-
removeFromDpnIdCache
public static void removeFromDpnIdCache(org.opendaylight.yangtools.yang.common.Uint64 dpnId)
-
getDpnIdFromNodeConnectorId
public static org.opendaylight.yangtools.yang.common.Uint64 getDpnIdFromNodeConnectorId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId nodeConnectorId)
-
-