2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.impl.core;
\r
11 import io.netty.channel.socket.nio.NioDatagramChannel;
\r
14 * @author michal.polkorab
\r
17 public class UdpChannelInitializer extends ProtocolChannelInitializer<NioDatagramChannel> {
\r
20 protected void initChannel(NioDatagramChannel ch) throws Exception {
\r
21 ch.pipeline().addLast(PipelineHandlers.OF_DATAGRAMPACKET_HANDLER.name(),
\r
22 new OFDatagramPacketHandler(getSwitchConnectionHandler()));
\r
23 OFDatagramPacketDecoder ofDatagramPacketDecoder = new OFDatagramPacketDecoder();
\r
24 ofDatagramPacketDecoder.setDeserializationFactory(getDeserializationFactory());
\r
25 ch.pipeline().addLast(PipelineHandlers.OF_DATAGRAMPACKET_DECODER.name(),
\r
26 ofDatagramPacketDecoder);
\r
27 OFDatagramPacketEncoder ofDatagramPacketEncoder = new OFDatagramPacketEncoder();
\r
28 ofDatagramPacketEncoder.setSerializationFactory(getSerializationFactory());
\r
29 ch.pipeline().addLast(PipelineHandlers.OF_ENCODER.name(), ofDatagramPacketEncoder);
\r
30 // connectionFacade.fireConnectionReadyNotification();
\r