src/server/ssh_server/ssh_callbacks.cc
/**
 * Handle SSH session open channel requests
 */
Handle SSH session open channel requests
Handle SSH session open channel requests
ssh_channel session_channel_open_request_cb(ssh_session session,
                                            void *userdata)
{
	using namespace Genode;
	Ssh::Server  &server = *reinterpret_cast<Ssh::Server*>(userdata);
	Ssh::Session *p      = server.lookup_session(session);
	if (!p) {
		error("could not look up session");
		return nullptr;
	}
	if (p->channel) {
		log("Only one channel per session supported");
		return nullptr;
	}
	ssh_channel channel = ssh_channel_new(p->session);
	if (!channel) {
		error("could not create new channel: '", ssh_get_error(p->session));
		return nullptr;
	}
	p->add_channel(channel);
	return channel;
}
ssh_channel session_channel_open_request_cb ( ssh_session session , void * userdata ) { using namespace Genode ; Ssh :: Server & server = * reinterpret_cast < Ssh :: Server * > ( userdata ) ; Ssh :: Session * p = server . lookup_session ( session ) ; if ( ! p ) { error ( " " ) ; return nullptr ; } if ( p -> channel ) { log ( " " ) ; return nullptr ; } ssh_channel channel = ssh_channel_new ( p -> session ) ; if ( ! channel ) { error ( " " , ssh_get_error ( p -> session ) ) ; return nullptr ; } p -> add_channel ( channel ) ; return channel ; }
Handle SSH session open channel requests
Handle SSH session open channel requests
/* for now only one channel */