diff options
Diffstat (limited to 'pjlib-util/include')
-rw-r--r-- | pjlib-util/include/pjlib-util.h | 3 | ||||
-rw-r--r-- | pjlib-util/include/pjlib-util/cli_telnet.h | 33 | ||||
-rw-r--r-- | pjlib-util/include/pjlib-util/config.h | 2 |
3 files changed, 36 insertions, 2 deletions
diff --git a/pjlib-util/include/pjlib-util.h b/pjlib-util/include/pjlib-util.h index ee3b2768..b4e34656 100644 --- a/pjlib-util/include/pjlib-util.h +++ b/pjlib-util/include/pjlib-util.h @@ -63,4 +63,7 @@ /* HTTP */ #include <pjlib-util/http_client.h> +/** CLI Telnet **/ +#include <pjlib-util/cli_telnet.h> + #endif /* __PJLIB_UTIL_H__ */ diff --git a/pjlib-util/include/pjlib-util/cli_telnet.h b/pjlib-util/include/pjlib-util/cli_telnet.h index bf8dafbc..f640de04 100644 --- a/pjlib-util/include/pjlib-util/cli_telnet.h +++ b/pjlib-util/include/pjlib-util/cli_telnet.h @@ -34,6 +34,31 @@ PJ_BEGIN_DECL * */ + /** + * 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; +} pj_cli_telnet_info; + +/** + * This specifies the callback called when telnet is started + * + * @param telnet_info The telnet runtime information. + * + */ +typedef void (*pj_cli_telnet_on_started)(pj_cli_telnet_info *telnet_info); /** * This structure contains various options to instantiate the telnet daemon. @@ -85,8 +110,14 @@ typedef struct pj_cli_telnet_cfg */ pj_str_t prompt_str; -} pj_cli_telnet_cfg; + /** + * 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. diff --git a/pjlib-util/include/pjlib-util/config.h b/pjlib-util/include/pjlib-util/config.h index 19821c0b..99da78df 100644 --- a/pjlib-util/include/pjlib-util/config.h +++ b/pjlib-util/include/pjlib-util/config.h @@ -291,7 +291,7 @@ * Default: 120 */ #ifndef PJ_CLI_MAX_CMDBUF -# define PJ_CLI_MAX_CMDBUF 120 +# define PJ_CLI_MAX_CMDBUF 512 #endif /** |