Search in sources :

Example 16 with PortNumber

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project bgpcep by opendaylight.

the class AbstractPCEPSessionTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    this.receivedMsgs = new ArrayList<>();
    doAnswer(invocation -> {
        final Object[] args = invocation.getArguments();
        AbstractPCEPSessionTest.this.receivedMsgs.add((Notification) args[0]);
        return this.channelFuture;
    }).when(this.clientListener).writeAndFlush(any(Notification.class));
    doReturn(null).when(this.channelFuture).addListener(Mockito.any());
    doReturn("TestingChannel").when(this.clientListener).toString();
    doReturn(this.pipeline).when(this.clientListener).pipeline();
    doReturn(this.pipeline).when(this.pipeline).replace(any(ChannelHandler.class), any(String.class), any(ChannelHandler.class));
    doReturn(this.eventLoop).when(this.clientListener).eventLoop();
    doNothing().when(this.statsRegistry).bind(any(), any());
    doNothing().when(this.statsRegistry).unbind(any());
    doReturn(null).when(this.eventLoop).schedule(any(Runnable.class), any(long.class), any(TimeUnit.class));
    doReturn(true).when(this.clientListener).isActive();
    final InetSocketAddress ra = new InetSocketAddress(this.testAddress, 4189);
    doReturn(ra).when(this.clientListener).remoteAddress();
    final InetSocketAddress la = new InetSocketAddress(this.testAddress, InetSocketAddressUtil.getRandomPort());
    doReturn(la).when(this.clientListener).localAddress();
    doReturn(mock(ChannelFuture.class)).when(this.clientListener).close();
    doReturn(getDataBroker()).when(this.topologyDependencies).getDataBroker();
    doReturn(this.statsRegistry).when(this.topologyDependencies).getStateRegistry();
    @SuppressWarnings("unchecked") final T listenerFactory = (T) ((Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0]).newInstance();
    doReturn(new IpAddress(new Ipv4Address(this.testAddress))).when(this.sessionConfig).getListenAddress();
    doReturn(new PortNumber(4189)).when(this.sessionConfig).getListenPort();
    doReturn(RPC_TIMEOUT).when(this.sessionConfig).getRpcTimeout();
    doReturn(TEST_TOPOLOGY_ID).when(this.topology).getTopologyId();
    doReturn(Collections.emptyList()).when(this.topology).getNode();
    final PCEPTopologyConfiguration configDep = new PCEPTopologyConfiguration(this.sessionConfig, this.topology);
    this.manager = new ServerSessionManager(this.topologyDependencies, listenerFactory, configDep);
    startSessionManager();
    this.neg = new DefaultPCEPSessionNegotiator(this.promise, this.clientListener, this.manager.getSessionListener(), (short) 1, 5, this.localPrefs);
    this.topologyRpcs = new TopologyRPCs(this.manager);
}
Also used : ChannelFuture(io.netty.channel.ChannelFuture) PCEPTopologyConfiguration(org.opendaylight.bgpcep.pcep.topology.provider.config.PCEPTopologyConfiguration) InetSocketAddress(java.net.InetSocketAddress) ChannelHandler(io.netty.channel.ChannelHandler) Notification(org.opendaylight.yangtools.yang.binding.Notification) TimeUnit(java.util.concurrent.TimeUnit) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) DefaultPCEPSessionNegotiator(org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiator) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address) Before(org.junit.Before)

Example 17 with PortNumber

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.

the class OxmSctpDstDeserializer method addSctpDstValue.

private static void addSctpDstValue(ByteBuf input, MatchEntryBuilder builder) {
    SctpDstCaseBuilder caseBuilder = new SctpDstCaseBuilder();
    SctpDstBuilder sctpBuilder = new SctpDstBuilder();
    sctpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
    caseBuilder.setSctpDst(sctpBuilder.build());
    builder.setMatchEntryValue(caseBuilder.build());
}
Also used : SctpDstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.dst._case.SctpDstBuilder) SctpDstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCaseBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)

Example 18 with PortNumber

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.

the class OxmTcpDstDeserializer method addTcpDstValue.

private static void addTcpDstValue(ByteBuf input, MatchEntryBuilder builder) {
    TcpDstCaseBuilder caseBuilder = new TcpDstCaseBuilder();
    TcpDstBuilder tcpBuilder = new TcpDstBuilder();
    tcpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
    caseBuilder.setTcpDst(tcpBuilder.build());
    builder.setMatchEntryValue(caseBuilder.build());
}
Also used : TcpDstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.dst._case.TcpDstBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) TcpDstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCaseBuilder)

Example 19 with PortNumber

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.

the class OxmUdpSrcDeserializer method addUdpSrcValue.

private static void addUdpSrcValue(ByteBuf input, MatchEntryBuilder builder) {
    UdpSrcCaseBuilder caseBuilder = new UdpSrcCaseBuilder();
    UdpSrcBuilder udpBuilder = new UdpSrcBuilder();
    udpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
    caseBuilder.setUdpSrc(udpBuilder.build());
    builder.setMatchEntryValue(caseBuilder.build());
}
Also used : UdpSrcBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.src._case.UdpSrcBuilder) UdpSrcCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)

Example 20 with PortNumber

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.

the class OxmInPortDeserializer method addInPortValue.

private static void addInPortValue(ByteBuf input, MatchEntryBuilder builder) {
    InPortCaseBuilder caseBuilder = new InPortCaseBuilder();
    InPortBuilder inPortBuilder = new InPortBuilder();
    inPortBuilder.setPortNumber(new PortNumber(input.readUnsignedInt()));
    caseBuilder.setInPort(inPortBuilder.build());
    builder.setMatchEntryValue(caseBuilder.build());
}
Also used : InPortCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder) InPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Aggregations

PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)98 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)81 Test (org.junit.Test)72 ArrayList (java.util.ArrayList)50 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)33 ByteBuf (io.netty.buffer.ByteBuf)29 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)29 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action)26 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)23 BigInteger (java.math.BigInteger)21 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder)19 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)18 TransportAddressBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)17 TcpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder)17 OutputActionCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder)17 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)16 UdpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder)16 SctpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder)14 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)13 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)12