Search in sources :

Example 16 with Server

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev171207.server.config.Server in project netvirt by opendaylight.

the class EgressAclServiceImpl method egressAclDhcpv6AllowClientTraffic.

/**
 * Add rule to ensure only DHCPv6 server traffic from the specified mac is
 * allowed.
 *
 * @param dpId the dpid
 * @param allowedAddresses the allowed addresses
 * @param lportTag the lport tag
 * @param addOrRemove whether to add or remove the flow
 */
private void egressAclDhcpv6AllowClientTraffic(BigInteger dpId, List<AllowedAddressPairs> allowedAddresses, int lportTag, int addOrRemove) {
    List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions();
    for (AllowedAddressPairs aap : allowedAddresses) {
        if (AclServiceUtils.isIPv4Address(aap)) {
            continue;
        }
        List<MatchInfoBase> matches = new ArrayList<>();
        matches.addAll(AclServiceUtils.buildDhcpV6Matches(AclConstants.DHCP_CLIENT_PORT_IPV6, AclConstants.DHCP_SERVER_PORT_IPV6, lportTag, serviceMode));
        matches.add(new MatchEthernetSource(aap.getMacAddress()));
        String flowName = "Egress_DHCP_Client_v6" + "_" + dpId + "_" + lportTag + "_" + aap.getMacAddress().getValue() + "_Permit_";
        syncFlow(dpId, getAclAntiSpoofingTable(), flowName, AclConstants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY, "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
    }
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) MatchEthernetSource(org.opendaylight.genius.mdsalutil.matches.MatchEthernetSource) ArrayList(java.util.ArrayList) AllowedAddressPairs(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 17 with Server

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.config.rev171207.server.config.Server in project openflowplugin by opendaylight.

the class SwitchConnectionProviderImpl method createAndConfigureServer.

private ServerFacade createAndConfigureServer() {
    LOG.debug("Configuring ..");
    ServerFacade server = null;
    final ChannelInitializerFactory factory = new ChannelInitializerFactory();
    factory.setSwitchConnectionHandler(switchConnectionHandler);
    factory.setSwitchIdleTimeout(connConfig.getSwitchIdleTimeout());
    factory.setTlsConfig(connConfig.getTlsConfiguration());
    factory.setSerializationFactory(serializationFactory);
    factory.setDeserializationFactory(deserializationFactory);
    factory.setUseBarrier(connConfig.useBarrier());
    factory.setChannelOutboundQueueSize(connConfig.getChannelOutboundQueueSize());
    final TransportProtocol transportProtocol = (TransportProtocol) connConfig.getTransferProtocol();
    // Check if Epoll native transport is available.
    // TODO : Add option to disable Epoll.
    boolean isEpollEnabled = Epoll.isAvailable();
    if (TransportProtocol.TCP.equals(transportProtocol) || TransportProtocol.TLS.equals(transportProtocol)) {
        server = new TcpHandler(connConfig.getAddress(), connConfig.getPort());
        final TcpChannelInitializer channelInitializer = factory.createPublishingChannelInitializer();
        ((TcpHandler) server).setChannelInitializer(channelInitializer);
        ((TcpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled);
        final EventLoopGroup workerGroupFromTcpHandler = ((TcpHandler) server).getWorkerGroup();
        connectionInitializer = new TcpConnectionInitializer(workerGroupFromTcpHandler, isEpollEnabled);
        connectionInitializer.setChannelInitializer(channelInitializer);
        connectionInitializer.run();
    } else if (TransportProtocol.UDP.equals(transportProtocol)) {
        server = new UdpHandler(connConfig.getAddress(), connConfig.getPort());
        ((UdpHandler) server).initiateEventLoopGroups(connConfig.getThreadConfiguration(), isEpollEnabled);
        ((UdpHandler) server).setChannelInitializer(factory.createUdpChannelInitializer());
    } else {
        throw new IllegalStateException("Unknown transport protocol received: " + transportProtocol);
    }
    server.setThreadConfig(connConfig.getThreadConfiguration());
    return server;
}
Also used : EventLoopGroup(io.netty.channel.EventLoopGroup) TransportProtocol(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol)

Aggregations

Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 AddLspOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.AddLspOutput)3 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)3 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)2 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)2 MatchEthernetSource (org.opendaylight.genius.mdsalutil.matches.MatchEthernetSource)2 AsId (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.AsId)2 GracefulRestart (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.GracefulRestart)2 Logging (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Logging)2 Multipath (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Multipath)2 Neighbors (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors)2 Networks (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Networks)2 VrfMaxpath (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.VrfMaxpath)2 Vrfs (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Vrfs)2 AddressFamiliesVrf (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.vrfs.AddressFamiliesVrf)2 PathComputationClientBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.pcep.client.attributes.PathComputationClientBuilder)2 ChannelFuture (io.netty.channel.ChannelFuture)1 EventLoopGroup (io.netty.channel.EventLoopGroup)1