2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.netconf.ssh.handler;
10 import ch.ethz.ssh2.ServerSession;
11 import io.netty.buffer.ByteBuf;
12 import io.netty.channel.ChannelHandlerContext;
13 import io.netty.channel.SimpleChannelInboundHandler;
15 public class SSHChannelInboundHandler extends SimpleChannelInboundHandler {
17 private ServerSession serverSession;
19 public SSHChannelInboundHandler(ServerSession serverSession) {
20 this.serverSession = serverSession;
24 protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
25 this.serverSession.getStdin().write( ((ByteBuf)msg).readBytes(((ByteBuf)msg).readableBytes()).array());