/usr/include/pjlib-util/cli_telnet.h is in libpjproject-dev 2.5.5~dfsg-6+deb9u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /* $Id$ */
/*
* Copyright (C) 2010 Teluu Inc. (http://www.teluu.com)
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJLIB_UTIL_CLI_TELNET_H__
#define __PJLIB_UTIL_CLI_TELNET_H__
/**
* @file cli_telnet.h
* @brief Command Line Interface Telnet Front End API
*/
#include <pjlib-util/cli_imp.h>
PJ_BEGIN_DECL
/**
* @ingroup PJLIB_UTIL_CLI_IMP
* @{
*
*/
/**
* This structure contains the information about the telnet.
* Application will get updated information each time the telnet is started/
* restarted.
*/
typedef struct pj_cli_telnet_info
{
/**
* The telnet's ip address.
*/
pj_str_t ip_address;
/**
* The telnet's port number.
*/
pj_uint16_t port;
/* Internal buffer for IP address */
char buf_[32];
} pj_cli_telnet_info;
/**
* This specifies the callback called when telnet is started
*
* @param status The status of telnet startup process.
*
*/
typedef void (*pj_cli_telnet_on_started)(pj_status_t status);
/**
* This structure contains various options to instantiate the telnet daemon.
* Application must call pj_cli_telnet_cfg_default() to initialize
* this structure with its default values.
*/
typedef struct pj_cli_telnet_cfg
{
/**
* Listening port number. The value may be 0 to let the system choose
* the first available port.
*
* Default value: PJ_CLI_TELNET_PORT
*/
pj_uint16_t port;
/**
* Ioqueue instance to be used. If this field is NULL, an internal
* ioqueue and worker thread will be created.
*/
pj_ioqueue_t *ioqueue;
/**
* Default log verbosity level for the session.
*
* Default value: PJ_CLI_TELNET_LOG_LEVEL
*/
int log_level;
/**
* Specify a password to be asked to the end user to access the
* application. Currently this is not implemented yet.
*
* Default: empty (no password)
*/
pj_str_t passwd;
/**
* Specify text message to be displayed to newly connected users.
* Currently this is not implemented yet.
*
* Default: empty
*/
pj_str_t welcome_msg;
/**
* Specify text message as a prompt string to user.
*
* Default: empty
*/
pj_str_t prompt_str;
/**
* Specify the pj_cli_telnet_on_started callback.
*
* Default: empty
*/
pj_cli_telnet_on_started on_started;
} pj_cli_telnet_cfg;
/**
* Initialize pj_cli_telnet_cfg with its default values.
*
* @param param The structure to be initialized.
*/
PJ_DECL(void) pj_cli_telnet_cfg_default(pj_cli_telnet_cfg *param);
/**
* Create, initialize, and start a telnet daemon for the application.
*
* @param cli The CLI application instance.
* @param param Optional parameters for creating the telnet daemon.
* If this value is NULL, default parameters will be used.
* @param p_fe Optional pointer to receive the front-end instance
* of the telnet front-end just created.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_cli_telnet_create(pj_cli_t *cli,
pj_cli_telnet_cfg *param,
pj_cli_front_end **p_fe);
/**
* Retrieve cli telnet info.
*
* @param telnet_info The telnet runtime information.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pj_cli_telnet_get_info(pj_cli_front_end *fe,
pj_cli_telnet_info *info);
/**
* @}
*/
PJ_END_DECL
#endif /* __PJLIB_UTIL_CLI_TELNET_H__ */
|