📄 telnet.h
字号:
/* telnet.h -- Magic C++ header file
(Mostly) portable public-domain implementation
-- Copyright(C) 2003 Magicunix Infomation Technology Limited
This file is part of magicd.
magicd 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.
For details, see the Magic C++ World-Wide-Web page,
`http://www.magicunix.com',
or send a mail to the Magic C++ developers <support@magicunix.com>.
*/
/* Substitute telnet.h file if none is available */
#define IAC 255 /* start of a command */
#define DONT 254 /* don't do... */
#define DO 253 /* will you do?... */
#define WONT 252 /* I won't do... */
#define WILL 251 /* I will do.. */
#ifdef SHORT_IAC
#undef WILL
#define WILL (-5)
#undef WONT
#define WONT (-4)
#undef DO
#define DO (-3)
#undef DONT
#define DONT (-2)
#undef IAC
#define IAC (-1)
#undef NOP
#define NOP (-15)
#endif /* SHORT_IAC */
/* telnet options */
#define TELOPT_BINARY 0 /* binary transmission */
#define TELOPT_ECHO 1 /* echo */
#define TELOPT_RCP 2 /* prepare to reconnect */
#define TELOPT_SGA 3 /* suppress go ahead */
#define TELOPT_NAMS 4 /* message size */
#define TELOPT_STATUS 5 /* tell status */
#define TELOPT_TM 6 /* timing mark */
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
#define APPLYLICENCE 101
#define GET_FILE_INFO 102
#define QUERY_PATH 103
#define RELEASE_LICENCE 104
#define TELOPT_USER_EX_LOGIN_RET 106
#define TELOPT_USER_EX_LOGIN 105
#define TELOPT_USER_FIND_TEXT 108
#define TELOPT_USER_REPLACE_TEXT 109
int init_telnet(int sockfd,int will_echo,char *clientip);
struct Buf_Len *negotiate(int sockfd,struct Buf_Len *recvd,char *clientip);
int user_process(int sockfd , char dowhat , char *clientip);
int ret_command_prompt(int newfd ,int streamfd
,char * clientip , char *prompt , struct passwd *pw);
int read_till_prompt(int fd , char * prompt , int explogin , char *line , char *clientip,int timeout);
int expression_fail(int fd , int n , char *clientip);
int get_last_line(char *str , char *line);
int apply_license(int sockfd , char *clientip);
int get_files_info(int sockfd , char *clientip);
int query_path(int sockfd , char *clientip);
int release_licence(int sockfd, char *clientip);
int writen(int sockfd , char * sendstr, int bytes);
int release_licencecnt();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -