2010-05-19 17:02:52 +00:00
|
|
|
/* minimalistic telnet/network interface it might turn into a wire interface */
|
|
|
|
/* (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TELNET_INTERFACE_H
|
|
|
|
#define TELNET_INTERFACE_H
|
|
|
|
|
2011-03-22 15:36:13 +00:00
|
|
|
#include <osmocom/core/logging.h>
|
|
|
|
#include <osmocom/core/select.h>
|
2010-05-19 17:02:52 +00:00
|
|
|
|
|
|
|
#include <osmocom/vty/vty.h>
|
|
|
|
|
2011-08-17 16:52:30 +00:00
|
|
|
/*! \defgroup telnet_interface Telnet Interface
|
2011-08-17 15:13:48 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*! \file telnet_interface.h */
|
|
|
|
|
|
|
|
/*! \brief A telnet connection */
|
2010-05-19 17:02:52 +00:00
|
|
|
struct telnet_connection {
|
2011-08-17 15:13:48 +00:00
|
|
|
/*! \brief linked list header for internal management */
|
2010-05-19 17:02:52 +00:00
|
|
|
struct llist_head entry;
|
2011-08-17 15:13:48 +00:00
|
|
|
/*! \brief private data pointer passed through */
|
2010-05-19 17:02:52 +00:00
|
|
|
void *priv;
|
2011-08-17 15:13:48 +00:00
|
|
|
/*! \brief filedsecriptor (socket ) */
|
2011-05-07 10:42:40 +00:00
|
|
|
struct osmo_fd fd;
|
2011-08-17 15:13:48 +00:00
|
|
|
/*! \brief VTY instance associated with telnet connection */
|
2010-05-19 17:02:52 +00:00
|
|
|
struct vty *vty;
|
2011-08-17 15:13:48 +00:00
|
|
|
/*! \brief logging target associated with this telnet connection */
|
2010-05-19 17:02:52 +00:00
|
|
|
struct log_target *dbg;
|
|
|
|
};
|
|
|
|
|
|
|
|
int telnet_init(void *tall_ctx, void *priv, int port);
|
2012-03-01 19:41:40 +00:00
|
|
|
int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port);
|
2010-05-19 17:02:52 +00:00
|
|
|
|
2011-11-06 19:09:28 +00:00
|
|
|
void telnet_exit(void);
|
|
|
|
|
2012-04-18 19:53:23 +00:00
|
|
|
/*! @} */
|
2011-08-17 15:13:48 +00:00
|
|
|
|
|
|
|
#endif /* TELNET_INTERFACE_H */
|