mirror of https://github.com/tp4a/teleport
convert source files to UTF-8 with BOM.
parent
03a21be954
commit
db0990d8c2
|
@ -102,3 +102,5 @@ profile
|
|||
*.moved-aside
|
||||
/server/share/tmp
|
||||
|
||||
/server/tp_core/testssh/Debug
|
||||
/server/tp_core/testssh/Release
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_H__
|
||||
#ifndef __LIB_EX_H__
|
||||
#define __LIB_EX_H__
|
||||
|
||||
#ifdef EX_HAVE_CONFIG
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_CONST_H__
|
||||
#ifndef __LIB_EX_CONST_H__
|
||||
#define __LIB_EX_CONST_H__
|
||||
|
||||
#include "ex_platform.h"
|
||||
|
@ -43,8 +43,8 @@
|
|||
// error code.
|
||||
//====================================================
|
||||
#define EXRV_OK 0
|
||||
#define EXRV_SYS_ERR 1 // 系统错误,可以使用GetLastError或者errno来获取具体错误值
|
||||
#define EXRV_FAILED 2 // 操作失败
|
||||
#define EXRV_SYS_ERR 1 // 系统错误,可以使用GetLastError或者errno来获取具体错误值
|
||||
#define EXRV_FAILED 2 // 操作失败
|
||||
|
||||
//#define EXRV_CANNOT_FOUND 9
|
||||
#define EXRV_CANNOT_CREATE 10
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __EX_INI_H__
|
||||
#ifndef __EX_INI_H__
|
||||
#define __EX_INI_H__
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __EX_LOG_H__
|
||||
#ifndef __EX_LOG_H__
|
||||
#define __EX_LOG_H__
|
||||
|
||||
#include "ex_types.h"
|
||||
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
protected:
|
||||
bool _open_file();
|
||||
bool _rotate_file(void); // 将现有日志文件改名备份,然后新开一个日志文件
|
||||
bool _rotate_file(void); // 将现有日志文件改名备份,然后新开一个日志文件
|
||||
|
||||
public:
|
||||
ExThreadLock lock;
|
||||
|
@ -63,7 +63,7 @@ void EXLOG_USE_LOGGER(ExLogger* logger);
|
|||
void EXLOG_LEVEL(int min_level);
|
||||
void EXLOG_DEBUG(bool debug_mode);
|
||||
|
||||
// 设定日志文件名及路径,如未指定路径,则为可执行程序所在目录下的log目录。
|
||||
// 设定日志文件名及路径,如未指定路径,则为可执行程序所在目录下的log目录。
|
||||
void EXLOG_FILE(const wchar_t* log_file, const wchar_t* log_path = NULL, ex_u32 max_filesize = EX_LOG_FILE_MAX_SIZE, ex_u8 max_filecount = EX_LOG_FILE_MAX_COUNT);
|
||||
|
||||
void EXLOG_CONSOLE(bool output_to_console);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_PATH_H__
|
||||
#ifndef __LIB_EX_PATH_H__
|
||||
#define __LIB_EX_PATH_H__
|
||||
|
||||
#include "ex_platform.h"
|
||||
|
@ -39,7 +39,7 @@ bool ex_path_join(ex_wstr& inout_path, EX_BOOL auto_abspath, ...);
|
|||
bool ex_abspath_to(const ex_wstr& base_abs_path, const ex_wstr& relate_path, ex_wstr& out_path);
|
||||
bool ex_mkdirs(const ex_wstr& in_path);
|
||||
|
||||
// 获取文件名中的扩展名部分(不包括.,例如abc.py,返回 py)
|
||||
// 获取文件名中的扩展名部分(不包括.,例如abc.py,返回 py)
|
||||
bool ex_path_ext_name(const ex_wstr& in_filename, ex_wstr& out_ext);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_PLATFORM_H__
|
||||
#ifndef __LIB_EX_PLATFORM_H__
|
||||
#define __LIB_EX_PLATFORM_H__
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_STR_H__
|
||||
#ifndef __LIB_EX_STR_H__
|
||||
#define __LIB_EX_STR_H__
|
||||
|
||||
#include "ex_types.h"
|
||||
|
@ -77,7 +77,7 @@ void ex_remove_white_space(ex_wstr& str_fix, int ulFlag = EX_RSC_ALL);
|
|||
ex_astr& ex_replace_all(ex_astr& str, const ex_astr& old_value, const ex_astr& new_value);
|
||||
ex_wstr& ex_replace_all(ex_wstr& str, const ex_wstr& old_value, const ex_wstr& new_value);
|
||||
|
||||
// 将UTF8字符串转换为UTF16-LE字符串(输出结果包含\0结束符)
|
||||
// 将UTF8字符串转换为UTF16-LE字符串(输出结果包含\0结束符)
|
||||
bool ex_utf8_to_utf16le(const std::string& from, ex_str_utf16le& to);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __EX_THREAD_H__
|
||||
#ifndef __EX_THREAD_H__
|
||||
#define __EX_THREAD_H__
|
||||
|
||||
#include "ex_str.h"
|
||||
|
@ -23,11 +23,11 @@ public:
|
|||
|
||||
bool is_running(void) { return m_is_running; }
|
||||
|
||||
// 创建并启动线程(执行被重载了的run()函数)
|
||||
// 创建并启动线程(执行被重载了的run()函数)
|
||||
bool start(void);
|
||||
// 结束线程(等待wait_timeout_ms毫秒,如果wait_timeout_ms为0,则无限等待)
|
||||
// 结束线程(等待wait_timeout_ms毫秒,如果wait_timeout_ms为0,则无限等待)
|
||||
bool stop(void);
|
||||
// 直接结束线程(强杀,不建议使用)
|
||||
// 直接结束线程(强杀,不建议使用)
|
||||
bool terminate(void);
|
||||
|
||||
protected:
|
||||
|
@ -52,7 +52,7 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
// 线程锁(进程内使用)
|
||||
// 线程锁(进程内使用)
|
||||
class ExThreadLock
|
||||
{
|
||||
public:
|
||||
|
@ -70,7 +70,7 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
// 线程锁辅助类
|
||||
// 线程锁辅助类
|
||||
class ExThreadSmartLock
|
||||
{
|
||||
public:
|
||||
|
@ -109,12 +109,12 @@ private:
|
|||
};
|
||||
|
||||
|
||||
// 原子操作
|
||||
// 原子操作
|
||||
int ex_atomic_add(volatile int* pt, int t);
|
||||
int ex_atomic_inc(volatile int* pt);
|
||||
int ex_atomic_dec(volatile int* pt);
|
||||
|
||||
// 线程相关操作
|
||||
// 线程相关操作
|
||||
ex_u64 ex_get_thread_id(void);
|
||||
|
||||
#endif // __EX_THREAD_H__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_TYPE_H__
|
||||
#ifndef __LIB_EX_TYPE_H__
|
||||
#define __LIB_EX_TYPE_H__
|
||||
|
||||
#include "ex_platform.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __LIB_EX_UTIL_H__
|
||||
#ifndef __LIB_EX_UTIL_H__
|
||||
#define __LIB_EX_UTIL_H__
|
||||
|
||||
#include "ex_types.h"
|
||||
|
@ -20,7 +20,7 @@ EX_BOOL ex_initialize(const char* lc_ctype);
|
|||
|
||||
void ex_free(void* buffer);
|
||||
|
||||
// 在haystack(长度为haystacklen字节)中查找needle(长度为needlelen)的起始地址,返回NULL表示没有找到
|
||||
// 在haystack(长度为haystacklen字节)中查找needle(长度为needlelen)的起始地址,返回NULL表示没有找到
|
||||
const ex_u8* ex_memmem(const ex_u8* haystack, size_t haystacklen, const ex_u8* needle, size_t needlelen);
|
||||
void ex_mem_reverse(ex_u8* p, size_t l);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __EX_WINSRV_H__
|
||||
#ifndef __EX_WINSRV_H__
|
||||
#define __EX_WINSRV_H__
|
||||
|
||||
#include "ex_str.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_ini.h>
|
||||
#include <ex/ex_ini.h>
|
||||
#include <ex/ex_log.h>
|
||||
#include <ex/ex_util.h>
|
||||
|
||||
|
@ -241,7 +241,7 @@ bool ExIniFile::LoadFromFile(const ex_wstr& strFileName, bool bClearOld)
|
|||
{
|
||||
pOffset += 3;
|
||||
}
|
||||
// 配置文件均使用UTF8编码
|
||||
// 配置文件均使用UTF8编码
|
||||
ex_wstr fileData;
|
||||
if (!ex_astr2wstr(pOffset, fileData, EX_CODEPAGE_UTF8))
|
||||
return false;
|
||||
|
@ -357,7 +357,7 @@ void ExIniFile::Save(int codepage/* = EX_CODEPAGE_UTF8*/)
|
|||
return;
|
||||
}
|
||||
|
||||
// 如果有不属于任何小节的值对,先保存之
|
||||
// 如果有不属于任何小节的值对,先保存之
|
||||
if (m_dumy_sec.Count() > 0)
|
||||
m_dumy_sec.Save(file, codepage);
|
||||
|
||||
|
@ -415,16 +415,16 @@ ExIniSection* ExIniFile::GetSection(const ex_wstr& strName, bool bCreateIfNotExi
|
|||
}
|
||||
|
||||
// static function.
|
||||
// 解析一行,返回值为 [节名/值对/注释/什么也不是/出错了]
|
||||
// 节名 => strKey = [section_name]
|
||||
// 值对 => strKey = strValue
|
||||
// 解析一行,返回值为 [节名/值对/注释/什么也不是/出错了]
|
||||
// 节名 => strKey = [section_name]
|
||||
// 值对 => strKey = strValue
|
||||
ExIniFile::PARSE_RV ExIniFile::_ParseLine(const ex_wstr& strOrigLine, ex_wstr& strKey, ex_wstr& strValue)
|
||||
{
|
||||
// 首先去掉行首的空格或者 TAB 控制
|
||||
// 首先去掉行首的空格或者 TAB 控制
|
||||
ex_wstr strLine(strOrigLine);
|
||||
ex_remove_white_space(strLine, EX_RSC_BEGIN);
|
||||
|
||||
// 判断是否为注释。 .ini 文件以 分号';'/'#' 作为注释行的第一个字符
|
||||
// 判断是否为注释。 .ini 文件以 分号';'/'#' 作为注释行的第一个字符
|
||||
if (';' == strLine[0] || '#' == strLine[0])
|
||||
{
|
||||
return PARSE_COMMENT;
|
||||
|
@ -432,7 +432,7 @@ ExIniFile::PARSE_RV ExIniFile::_ParseLine(const ex_wstr& strOrigLine, ex_wstr& s
|
|||
|
||||
if ('[' == strLine[0])
|
||||
{
|
||||
// 这是一个节(section)
|
||||
// 这是一个节(section)
|
||||
ex_wstr::size_type startPos = strLine.find('[');
|
||||
ex_wstr::size_type endPos = strLine.rfind(']');
|
||||
strLine.erase(endPos);
|
||||
|
@ -443,23 +443,23 @@ ExIniFile::PARSE_RV ExIniFile::_ParseLine(const ex_wstr& strOrigLine, ex_wstr& s
|
|||
}
|
||||
else
|
||||
{
|
||||
// 看看能否找到等号(=),这是 key=value 的判别方法
|
||||
// 看看能否找到等号(=),这是 key=value 的判别方法
|
||||
ex_wstr::size_type pos = strLine.find('=');
|
||||
if (ex_wstr::npos == pos)
|
||||
{
|
||||
//return PARSE_OTHER; // 没有等号
|
||||
//return PARSE_OTHER; // 没有等号
|
||||
ex_remove_white_space(strLine);
|
||||
strKey = strLine;
|
||||
strValue.clear();
|
||||
return PARSE_KEYVALUE;
|
||||
}
|
||||
|
||||
// 将等号前面的与等号后面的分割
|
||||
// 将等号前面的与等号后面的分割
|
||||
strKey.assign(strLine, 0, pos);
|
||||
strValue.assign(strLine, pos + 1, strLine.length() - pos);
|
||||
ex_remove_white_space(strKey);
|
||||
|
||||
// 等号后面的应该原封不动,不应该移除空白字符
|
||||
// 等号后面的应该原封不动,不应该移除空白字符
|
||||
ex_remove_white_space(strValue, EX_RSC_BEGIN);
|
||||
|
||||
return PARSE_KEYVALUE;
|
||||
|
@ -489,7 +489,7 @@ bool ExIniFile::_ProcessLine(const ex_wstr strLine, ExIniSection** pCurSection)
|
|||
break;
|
||||
case PARSE_SECTION:
|
||||
{
|
||||
// 创建一个节
|
||||
// 创建一个节
|
||||
ExIniSection* pSection = GetSection(strKey, true);
|
||||
if (NULL == pSection)
|
||||
{
|
||||
|
@ -508,7 +508,7 @@ bool ExIniFile::_ProcessLine(const ex_wstr strLine, ExIniSection** pCurSection)
|
|||
*pCurSection = &m_dumy_sec;
|
||||
}
|
||||
|
||||
// 创建一个值对
|
||||
// 创建一个值对
|
||||
if (!(*pCurSection)->SetValue(strKey, strValue, true))
|
||||
{
|
||||
bError = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_log.h>
|
||||
#include <ex/ex_log.h>
|
||||
#include <ex/ex_path.h>
|
||||
//#include <ex/ex_thread.h>
|
||||
//#include <vector>
|
||||
|
@ -379,7 +379,7 @@ bool ExLogger::_open_file()
|
|||
}
|
||||
|
||||
#ifdef EX_OS_WIN32
|
||||
// 注意:这里必须使用 CreateFile() 来打开日志文件,使用FILE指针无法传递给动态库进行操作。
|
||||
// 注意:这里必须使用 CreateFile() 来打开日志文件,使用FILE指针无法传递给动态库进行操作。
|
||||
m_file = CreateFileW(m_fullname.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (INVALID_HANDLE_VALUE == m_file)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_path.h>
|
||||
#include <ex/ex_path.h>
|
||||
#include <ex/ex_const.h>
|
||||
#include <ex/ex_util.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_platform.h>
|
||||
#include <ex/ex_platform.h>
|
||||
#include <ex/ex_str.h>
|
||||
#include <ex/ex_util.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_thread.h>
|
||||
#include <ex/ex_thread.h>
|
||||
#include <ex/ex_log.h>
|
||||
|
||||
//=========================================================
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_platform.h>
|
||||
#include <ex/ex_platform.h>
|
||||
#include <ex/ex_util.h>
|
||||
#include <ex/ex_str.h>
|
||||
#include <ex/ex_log.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <ex/ex_winsrv.h>
|
||||
#include <ex/ex_winsrv.h>
|
||||
|
||||
#ifdef EX_OS_WIN32
|
||||
|
||||
|
@ -44,14 +44,14 @@ ex_rv ex_winsrv_install(const ex_wstr& srv_name, const ex_wstr& disp_name, const
|
|||
}
|
||||
|
||||
SERVICE_FAILURE_ACTIONS failure_action;
|
||||
failure_action.dwResetPeriod = 0; // reset failure count to zero 的时间,单位为秒
|
||||
failure_action.dwResetPeriod = 0; // reset failure count to zero 的时间,单位为秒
|
||||
failure_action.lpRebootMsg = NULL; // Message to broadcast to server users before rebooting
|
||||
failure_action.lpCommand = NULL; // Command line of the process for the CreateProcess function to execute in response
|
||||
failure_action.cActions = 3; // action数组的个数
|
||||
failure_action.cActions = 3; // action数组的个数
|
||||
|
||||
SC_ACTION actionarray[3];
|
||||
actionarray[0].Type = SC_ACTION_RESTART; // 重新启动服务
|
||||
actionarray[0].Delay = 60000; // 单位为毫秒
|
||||
actionarray[0].Type = SC_ACTION_RESTART; // 重新启动服务
|
||||
actionarray[0].Delay = 60000; // 单位为毫秒
|
||||
actionarray[1].Type = SC_ACTION_RESTART;
|
||||
actionarray[1].Delay = 60000;
|
||||
actionarray[2].Type = SC_ACTION_RESTART;
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
#ifndef __TELEPORT_CONST_H__
|
||||
#ifndef __TELEPORT_CONST_H__
|
||||
#define __TELEPORT_CONST_H__
|
||||
|
||||
// 注意同步更新三个不同语言的const文件
|
||||
// 注意同步更新三个不同语言的const文件
|
||||
|
||||
// 本文件设定teleport各个模块之间通讯时的错误值(JSON数据),包括:
|
||||
// - WEB界面与助手
|
||||
// - WEB界面与WEB后台
|
||||
// - WEB后台与CORE核心服务
|
||||
// 本文件设定teleport各个模块之间通讯时的错误值(JSON数据),包括:
|
||||
// - WEB界面与助手
|
||||
// - WEB界面与WEB后台
|
||||
// - WEB后台与CORE核心服务
|
||||
|
||||
//=======================================================
|
||||
// Urlprotocol相关
|
||||
// Urlprotocol相关
|
||||
//=======================================================
|
||||
#define TP_URLPROTO_APP_NAME "teleport"
|
||||
|
||||
//=======================================================
|
||||
// 远程连接认证方式
|
||||
// 远程连接认证方式
|
||||
//=======================================================
|
||||
#define TP_AUTH_TYPE_NONE 0
|
||||
#define TP_AUTH_TYPE_PASSWORD 1
|
||||
#define TP_AUTH_TYPE_PRIVATE_KEY 2
|
||||
|
||||
//=======================================================
|
||||
// 远程连接协议
|
||||
// 远程连接协议
|
||||
//=======================================================
|
||||
#define TP_PROTOCOL_TYPE_RDP 1
|
||||
#define TP_PROTOCOL_TYPE_SSH 2
|
||||
#define TP_PROTOCOL_TYPE_TELNET 3
|
||||
|
||||
//=======================================================
|
||||
// 远程连接子协议
|
||||
// 远程连接子协议
|
||||
//=======================================================
|
||||
#define TP_PROTOCOL_TYPE_RDP_DESKTOP 100
|
||||
#define TP_PROTOCOL_TYPE_SSH_SHELL 200
|
||||
|
@ -37,114 +37,114 @@
|
|||
|
||||
|
||||
//=======================================================
|
||||
// 远程主机操作系统
|
||||
// 远程主机操作系统
|
||||
//=======================================================
|
||||
#define TP_OS_TYPE_WINDOWS 1
|
||||
#define TP_OS_TYPE_LINUX 2
|
||||
|
||||
//=======================================================
|
||||
// 远程连接会话状态
|
||||
// 远程连接会话状态
|
||||
//=======================================================
|
||||
#define TP_SESS_STAT_RUNNING 0 // 会话开始了,正在连接
|
||||
#define TP_SESS_STAT_END 9999 // 会话成功结束
|
||||
#define TP_SESS_STAT_ERR_AUTH_DENIED 1 // 会话结束,因为认证失败
|
||||
#define TP_SESS_STAT_ERR_CONNECT 2 // 会话结束,因为无法连接到远程主机
|
||||
#define TP_SESS_STAT_ERR_BAD_SSH_KEY 3 // 会话结束,因为无法识别SSH私钥
|
||||
#define TP_SESS_STAT_ERR_INTERNAL 4 // 会话结束,因为内部错误
|
||||
#define TP_SESS_STAT_ERR_UNSUPPORT_PROTOCOL 5 // 会话结束,因为协议不支持(RDP)
|
||||
#define TP_SESS_STAT_ERR_BAD_PKG 6 // 会话结束,因为收到错误的报文
|
||||
#define TP_SESS_STAT_ERR_RESET 7 // 会话结束,因为teleport核心服务重置了
|
||||
#define TP_SESS_STAT_ERR_IO 8 // 会话结束,因为网络中断
|
||||
#define TP_SESS_STAT_ERR_SESSION 9 // 会话结束,因为无效的会话ID
|
||||
#define TP_SESS_STAT_ERR_AUTH_TYPE 10 // 会话结束,因为不被允许的认证方式
|
||||
#define TP_SESS_STAT_STARTED 100 // 已经连接成功了,开始记录录像了
|
||||
#define TP_SESS_STAT_ERR_START_INTERNAL 104 // 会话结束,因为内部错误
|
||||
#define TP_SESS_STAT_ERR_START_BAD_PKG 106 // 会话结束,因为收到错误的报文
|
||||
#define TP_SESS_STAT_ERR_START_RESET 107 // 会话结束,因为teleport核心服务重置了
|
||||
#define TP_SESS_STAT_ERR_START_IO 108 // 会话结束,因为网络中断
|
||||
#define TP_SESS_STAT_RUNNING 0 // 会话开始了,正在连接
|
||||
#define TP_SESS_STAT_END 9999 // 会话成功结束
|
||||
#define TP_SESS_STAT_ERR_AUTH_DENIED 1 // 会话结束,因为认证失败
|
||||
#define TP_SESS_STAT_ERR_CONNECT 2 // 会话结束,因为无法连接到远程主机
|
||||
#define TP_SESS_STAT_ERR_BAD_SSH_KEY 3 // 会话结束,因为无法识别SSH私钥
|
||||
#define TP_SESS_STAT_ERR_INTERNAL 4 // 会话结束,因为内部错误
|
||||
#define TP_SESS_STAT_ERR_UNSUPPORT_PROTOCOL 5 // 会话结束,因为协议不支持(RDP)
|
||||
#define TP_SESS_STAT_ERR_BAD_PKG 6 // 会话结束,因为收到错误的报文
|
||||
#define TP_SESS_STAT_ERR_RESET 7 // 会话结束,因为teleport核心服务重置了
|
||||
#define TP_SESS_STAT_ERR_IO 8 // 会话结束,因为网络中断
|
||||
#define TP_SESS_STAT_ERR_SESSION 9 // 会话结束,因为无效的会话ID
|
||||
#define TP_SESS_STAT_ERR_AUTH_TYPE 10 // 会话结束,因为不被允许的认证方式
|
||||
#define TP_SESS_STAT_STARTED 100 // 已经连接成功了,开始记录录像了
|
||||
#define TP_SESS_STAT_ERR_START_INTERNAL 104 // 会话结束,因为内部错误
|
||||
#define TP_SESS_STAT_ERR_START_BAD_PKG 106 // 会话结束,因为收到错误的报文
|
||||
#define TP_SESS_STAT_ERR_START_RESET 107 // 会话结束,因为teleport核心服务重置了
|
||||
#define TP_SESS_STAT_ERR_START_IO 108 // 会话结束,因为网络中断
|
||||
|
||||
|
||||
//=======================================================
|
||||
// 授权标记
|
||||
// 授权标记
|
||||
//=======================================================
|
||||
#define TP_FLAG_ALL 0xFFFFFFFF
|
||||
// 会话记录相关
|
||||
#define TP_FLAG_RECORD_REPLAY 0x00000001 // 允许记录历史(录像回放)
|
||||
#define TP_FLAG_RECORD_REAL_TIME 0x00000002 // 允许实时监控
|
||||
// RDP相关
|
||||
#define TP_FLAG_RDP_DESKTOP 0x00000001 // 允许远程桌面
|
||||
#define TP_FLAG_RDP_CLIPBOARD 0x00000002 // 允许剪贴板
|
||||
#define TP_FLAG_RDP_DISK 0x00000004 // 允许磁盘映射
|
||||
#define TP_FLAG_RDP_APP 0x00000008 // 允许远程APP(尚未实现)
|
||||
#define TP_FLAG_RDP_CONSOLE 0x00001000 //允许连接到管理员会话(RDP的console选项)
|
||||
// SSH相关
|
||||
#define TP_FLAG_SSH_SHELL 0x00000001 // 允许SHELL
|
||||
#define TP_FLAG_SSH_SFTP 0x00000002 // 允许SFTP
|
||||
#define TP_FLAG_SSH_X11 0x00000004 // 允许X11转发(尚未实现)
|
||||
#define TP_FLAG_SSH_EXEC 0x00000008 // 允许exec执行远程命令(尚未实现)
|
||||
// 会话记录相关
|
||||
#define TP_FLAG_RECORD_REPLAY 0x00000001 // 允许记录历史(录像回放)
|
||||
#define TP_FLAG_RECORD_REAL_TIME 0x00000002 // 允许实时监控
|
||||
// RDP相关
|
||||
#define TP_FLAG_RDP_DESKTOP 0x00000001 // 允许远程桌面
|
||||
#define TP_FLAG_RDP_CLIPBOARD 0x00000002 // 允许剪贴板
|
||||
#define TP_FLAG_RDP_DISK 0x00000004 // 允许磁盘映射
|
||||
#define TP_FLAG_RDP_APP 0x00000008 // 允许远程APP(尚未实现)
|
||||
#define TP_FLAG_RDP_CONSOLE 0x00001000 //允许连接到管理员会话(RDP的console选项)
|
||||
// SSH相关
|
||||
#define TP_FLAG_SSH_SHELL 0x00000001 // 允许SHELL
|
||||
#define TP_FLAG_SSH_SFTP 0x00000002 // 允许SFTP
|
||||
#define TP_FLAG_SSH_X11 0x00000004 // 允许X11转发(尚未实现)
|
||||
#define TP_FLAG_SSH_EXEC 0x00000008 // 允许exec执行远程命令(尚未实现)
|
||||
#define TP_FLAG_SSH_TUNNEL 0x00000010 // allow ssh tunnel. (not impl.)
|
||||
|
||||
|
||||
//=======================================================
|
||||
// 错误值
|
||||
// 错误值
|
||||
//=======================================================
|
||||
#define TPE_OK 0 // 成功
|
||||
#define TPE_OK 0 // 成功
|
||||
//-------------------------------------------------------
|
||||
// 通用错误值
|
||||
// 通用错误值
|
||||
//-------------------------------------------------------
|
||||
#define TPE_NEED_MORE_DATA 1 // 需要更多数据(不一定是错误)
|
||||
#define TPE_NEED_LOGIN 2 // 需要登录
|
||||
#define TPE_PRIVILEGE 3 // 没有操作权限
|
||||
#define TPE_NOT_IMPLEMENT 7 // 功能尚未实现
|
||||
#define TPE_EXISTS 8 // 目标已经存在
|
||||
#define TPE_NOT_EXISTS 9 // 目标不存在
|
||||
#define TPE_NEED_MORE_DATA 1 // 需要更多数据(不一定是错误)
|
||||
#define TPE_NEED_LOGIN 2 // 需要登录
|
||||
#define TPE_PRIVILEGE 3 // 没有操作权限
|
||||
#define TPE_NOT_IMPLEMENT 7 // 功能尚未实现
|
||||
#define TPE_EXISTS 8 // 目标已经存在
|
||||
#define TPE_NOT_EXISTS 9 // 目标不存在
|
||||
|
||||
// 100~299是通用错误值
|
||||
// 100~299是通用错误值
|
||||
|
||||
#define TPE_FAILED 100 // 内部错误
|
||||
#define TPE_NETWORK 101 // 网络错误
|
||||
#define TPE_DATABASE 102 // 数据库操作失败
|
||||
#define TPE_FAILED 100 // 内部错误
|
||||
#define TPE_NETWORK 101 // 网络错误
|
||||
#define TPE_DATABASE 102 // 数据库操作失败
|
||||
|
||||
// HTTP请求相关错误
|
||||
#define TPE_HTTP_METHOD 120 // 无效的请求方法(不是GET/POST等),或者错误的请求方法(例如需要POST,却使用GET方式请求)
|
||||
#define TPE_HTTP_URL_ENCODE 121 // URL编码错误(无法解码)
|
||||
//#define TPE_HTTP_URI 122 // 无效的URI
|
||||
// HTTP请求相关错误
|
||||
#define TPE_HTTP_METHOD 120 // 无效的请求方法(不是GET/POST等),或者错误的请求方法(例如需要POST,却使用GET方式请求)
|
||||
#define TPE_HTTP_URL_ENCODE 121 // URL编码错误(无法解码)
|
||||
//#define TPE_HTTP_URI 122 // 无效的URI
|
||||
|
||||
#define TPE_UNKNOWN_CMD 124 // 未知的命令
|
||||
#define TPE_JSON_FORMAT 125 // 错误的JSON格式(需要JSON格式数据,但是却无法按JSON格式解码)
|
||||
#define TPE_PARAM 126 // 参数错误
|
||||
#define TPE_DATA 127 // 数据错误
|
||||
#define TPE_UNKNOWN_CMD 124 // 未知的命令
|
||||
#define TPE_JSON_FORMAT 125 // 错误的JSON格式(需要JSON格式数据,但是却无法按JSON格式解码)
|
||||
#define TPE_PARAM 126 // 参数错误
|
||||
#define TPE_DATA 127 // 数据错误
|
||||
|
||||
// #define TPE_OPENFILE_ERROR 0x1007 // 无法打开文件
|
||||
// #define TPE_OPENFILE_ERROR 0x1007 // 无法打开文件
|
||||
// #define TPE_GETTEMPPATH_ERROR 0x1007
|
||||
#define TPE_OPENFILE 300
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
// WEB服务专用错误值
|
||||
// WEB服务专用错误值
|
||||
//-------------------------------------------------------
|
||||
#define TPE_CAPTCHA_EXPIRED 10000 // 验证码已过期
|
||||
#define TPE_CAPTCHA_MISMATCH 10001 // 验证码错误
|
||||
#define TPE_OATH_MISMATCH 10002 // 身份验证器动态验证码错误
|
||||
#define TPE_SYS_MAINTENANCE 10003 // 系统维护中
|
||||
#define TPE_CAPTCHA_EXPIRED 10000 // 验证码已过期
|
||||
#define TPE_CAPTCHA_MISMATCH 10001 // 验证码错误
|
||||
#define TPE_OATH_MISMATCH 10002 // 身份验证器动态验证码错误
|
||||
#define TPE_SYS_MAINTENANCE 10003 // 系统维护中
|
||||
|
||||
#define TPE_USER_LOCKED 10100 // 用户已经被锁定(连续多次错误密码)
|
||||
#define TPE_USER_DISABLED 10101 // 用户已经被禁用
|
||||
#define TPE_USER_AUTH 10102 // 身份验证失败
|
||||
#define TPE_USER_LOCKED 10100 // 用户已经被锁定(连续多次错误密码)
|
||||
#define TPE_USER_DISABLED 10101 // 用户已经被禁用
|
||||
#define TPE_USER_AUTH 10102 // 身份验证失败
|
||||
|
||||
//-------------------------------------------------------
|
||||
// 助手程序专用错误值
|
||||
// 助手程序专用错误值
|
||||
//-------------------------------------------------------
|
||||
#define TPE_NO_ASSIST 100000 // 未能检测到助手程序
|
||||
#define TPE_OLD_ASSIST 100001 // 助手程序版本太低
|
||||
#define TPE_START_CLIENT 100002 // 无法启动客户端程序(无法创建进程)
|
||||
#define TPE_NO_ASSIST 100000 // 未能检测到助手程序
|
||||
#define TPE_OLD_ASSIST 100001 // 助手程序版本太低
|
||||
#define TPE_START_CLIENT 100002 // 无法启动客户端程序(无法创建进程)
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------
|
||||
// 核心服务专用错误值
|
||||
// 核心服务专用错误值
|
||||
//-------------------------------------------------------
|
||||
#define TPE_NO_CORE_SERVER 200000 // 未能检测到核心服务
|
||||
#define TPE_NO_CORE_SERVER 200000 // 未能检测到核心服务
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "base_env.h"
|
||||
#include "base_env.h"
|
||||
|
||||
TppEnvBase::TppEnvBase()
|
||||
{}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TS_BASE_ENV_H__
|
||||
#ifndef __TS_BASE_ENV_H__
|
||||
#define __TS_BASE_ENV_H__
|
||||
|
||||
#include "protocol_interface.h"
|
||||
|
@ -13,7 +13,7 @@ public:
|
|||
|
||||
public:
|
||||
ex_wstr exec_path;
|
||||
ex_wstr etc_path; // 配置文件、SSH服务器的私钥文件的存放路径
|
||||
ex_wstr etc_path; // 配置文件、SSH服务器的私钥文件的存放路径
|
||||
ex_wstr replay_path;
|
||||
|
||||
TPP_GET_CONNNECT_INFO_FUNC get_connect_info;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <memory>
|
||||
#include <memory>
|
||||
|
||||
#include "base_record.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TS_BASE_RECORD_H__
|
||||
#ifndef __TS_BASE_RECORD_H__
|
||||
#define __TS_BASE_RECORD_H__
|
||||
|
||||
#include "base_env.h"
|
||||
|
@ -12,43 +12,43 @@
|
|||
#pragma pack(push,1)
|
||||
|
||||
/*
|
||||
* 录像
|
||||
* 录像
|
||||
*
|
||||
* 一个录像分为两个文件,一个信息文件,一个数据文件。
|
||||
* 服务内部缓存最大4M,或者5秒,就将数据写入数据文件中,并同时更新信息文件。
|
||||
* 一个录像分为两个文件,一个信息文件,一个数据文件。
|
||||
* 服务内部缓存最大4M,或者5秒,就将数据写入数据文件中,并同时更新信息文件。
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// 录像文件头(随着录像数据写入,会改变的部分)
|
||||
// 录像文件头(随着录像数据写入,会改变的部分)
|
||||
typedef struct TS_RECORD_HEADER_INFO
|
||||
{
|
||||
ex_u32 magic; // "TPPR" 标志 TelePort Protocol Record
|
||||
ex_u16 ver; // 录像文件版本,目前为3
|
||||
ex_u32 packages; // 总包数
|
||||
ex_u32 time_ms; // 总耗时(毫秒)
|
||||
//ex_u32 file_size; // 数据文件大小
|
||||
ex_u32 magic; // "TPPR" 标志 TelePort Protocol Record
|
||||
ex_u16 ver; // 录像文件版本,目前为3
|
||||
ex_u32 packages; // 总包数
|
||||
ex_u32 time_ms; // 总耗时(毫秒)
|
||||
//ex_u32 file_size; // 数据文件大小
|
||||
}TS_RECORD_HEADER_INFO;
|
||||
#define ts_record_header_info_size sizeof(TS_RECORD_HEADER_INFO)
|
||||
|
||||
// 录像文件头(固定不变部分)
|
||||
// 录像文件头(固定不变部分)
|
||||
typedef struct TS_RECORD_HEADER_BASIC
|
||||
{
|
||||
ex_u16 protocol_type; // 协议:1=RDP, 2=SSH, 3=Telnet
|
||||
ex_u16 protocol_sub_type; // 子协议:100=RDP-DESKTOP, 200=SSH-SHELL, 201=SSH-SFTP, 300=Telnet
|
||||
ex_u64 timestamp; // 本次录像的起始时间(UTC时间戳)
|
||||
ex_u16 width; // 初始屏幕尺寸:宽
|
||||
ex_u16 height; // 初始屏幕尺寸:高
|
||||
char user_username[64]; // teleport账号
|
||||
char acc_username[64]; // 远程主机用户名
|
||||
ex_u16 protocol_type; // 协议:1=RDP, 2=SSH, 3=Telnet
|
||||
ex_u16 protocol_sub_type; // 子协议:100=RDP-DESKTOP, 200=SSH-SHELL, 201=SSH-SFTP, 300=Telnet
|
||||
ex_u64 timestamp; // 本次录像的起始时间(UTC时间戳)
|
||||
ex_u16 width; // 初始屏幕尺寸:宽
|
||||
ex_u16 height; // 初始屏幕尺寸:高
|
||||
char user_username[64]; // teleport账号
|
||||
char acc_username[64]; // 远程主机用户名
|
||||
|
||||
char host_ip[40]; // 远程主机IP
|
||||
char conn_ip[40]; // 远程主机IP
|
||||
ex_u16 conn_port; // 远程主机端口
|
||||
char host_ip[40]; // 远程主机IP
|
||||
char conn_ip[40]; // 远程主机IP
|
||||
ex_u16 conn_port; // 远程主机端口
|
||||
|
||||
char client_ip[40]; // 客户端IP
|
||||
char client_ip[40]; // 客户端IP
|
||||
|
||||
// RDP专有
|
||||
// RDP专有
|
||||
ex_u8 rdp_security; // 0 = RDP, 1 = TLS
|
||||
|
||||
ex_u8 _reserve[512 - 2 - 2 - 8 - 2 - 2 - 64 - 64 - 40 - 40 - 2 - 40 - 1 - ts_record_header_info_size];
|
||||
|
@ -61,17 +61,17 @@ typedef struct TS_RECORD_HEADER
|
|||
TS_RECORD_HEADER_BASIC basic;
|
||||
}TS_RECORD_HEADER;
|
||||
|
||||
// header部分(header-info + header-basic) = 512B
|
||||
// header部分(header-info + header-basic) = 512B
|
||||
#define ts_record_header_size sizeof(TS_RECORD_HEADER)
|
||||
|
||||
|
||||
// 一个数据包的头
|
||||
// 一个数据包的头
|
||||
typedef struct TS_RECORD_PKG
|
||||
{
|
||||
ex_u8 type; // 包的数据类型
|
||||
ex_u32 size; // 这个包的总大小(不含包头)
|
||||
ex_u32 time_ms; // 这个包距起始时间的时间差(毫秒,意味着一个连接不能持续超过49天)
|
||||
ex_u8 _reserve[3]; // 保留
|
||||
ex_u8 type; // 包的数据类型
|
||||
ex_u32 size; // 这个包的总大小(不含包头)
|
||||
ex_u32 time_ms; // 这个包距起始时间的时间差(毫秒,意味着一个连接不能持续超过49天)
|
||||
ex_u8 _reserve[3]; // 保留
|
||||
}TS_RECORD_PKG;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
@ -90,8 +90,8 @@ protected:
|
|||
virtual bool _on_end() = 0;
|
||||
|
||||
protected:
|
||||
ex_wstr m_base_path; // 录像文件基础路径,例如 /usr/local/teleport/data/replay/ssh/123,数字编号是内部附加的,作为本次会话录像文件的目录名称
|
||||
ex_wstr m_base_fname; // 录像文件的文件名,不含扩展名部分,内部会以此为基础合成文件全名,并将录像文件存放在 m_base_path 指向的目录中
|
||||
ex_wstr m_base_path; // 录像文件基础路径,例如 /usr/local/teleport/data/replay/ssh/123,数字编号是内部附加的,作为本次会话录像文件的目录名称
|
||||
ex_wstr m_base_fname; // 录像文件的文件名,不含扩展名部分,内部会以此为基础合成文件全名,并将录像文件存放在 m_base_path 指向的目录中
|
||||
|
||||
ex_u64 m_start_time;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TP_PROTOCOL_INTERFACE_H__
|
||||
#ifndef __TP_PROTOCOL_INTERFACE_H__
|
||||
#define __TP_PROTOCOL_INTERFACE_H__
|
||||
|
||||
#include "ts_const.h"
|
||||
|
@ -22,20 +22,20 @@ typedef struct TPP_CONNECT_INFO
|
|||
{
|
||||
char* sid;
|
||||
|
||||
// 与此连接信息相关的三个要素的ID
|
||||
// 与此连接信息相关的三个要素的ID
|
||||
int user_id;
|
||||
int host_id;
|
||||
int acc_id;
|
||||
|
||||
char* user_username; // 申请本次连接的用户名
|
||||
char* user_username; // 申请本次连接的用户名
|
||||
|
||||
char* host_ip; // 真正的远程主机IP(如果是直接连接模式,则与remote_host_ip相同)
|
||||
char* conn_ip; // 要连接的远程主机的IP(如果是端口映射模式,则为路由主机的IP)
|
||||
int conn_port; // 要连接的远程主机的端口(如果是端口映射模式,则为路由主机的端口)
|
||||
char* host_ip; // 真正的远程主机IP(如果是直接连接模式,则与remote_host_ip相同)
|
||||
char* conn_ip; // 要连接的远程主机的IP(如果是端口映射模式,则为路由主机的IP)
|
||||
int conn_port; // 要连接的远程主机的端口(如果是端口映射模式,则为路由主机的端口)
|
||||
char* client_ip;
|
||||
|
||||
char* acc_username; // 远程主机的账号
|
||||
char* acc_secret; // 远程主机账号的密码(或者私钥)
|
||||
char* acc_username; // 远程主机的账号
|
||||
char* acc_secret; // 远程主机账号的密码(或者私钥)
|
||||
char* username_prompt; // for telnet
|
||||
char* password_prompt; // for telnet
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TS_ERRNO_H__
|
||||
#ifndef __TS_ERRNO_H__
|
||||
#define __TS_ERRNO_H__
|
||||
|
||||
//#include "ts_types.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "ts_membuf.h"
|
||||
#include "ts_membuf.h"
|
||||
#include <memory.h>
|
||||
|
||||
MemBuffer::MemBuffer()// : m_buffer(NULL), m_data_size(0), m_buffer_size(0)
|
||||
|
@ -45,7 +45,7 @@ void MemBuffer::reserve(size_t size)
|
|||
return;
|
||||
}
|
||||
|
||||
// 将新的缓冲区大小取整到 MEMBUF_BLOCK_SIZE 的整数倍
|
||||
// 将新的缓冲区大小取整到 MEMBUF_BLOCK_SIZE 的整数倍
|
||||
size_t new_size = (size + MEMBUF_BLOCK_SIZE - 1) & ~(MEMBUF_BLOCK_SIZE - 1);
|
||||
//EXLOGD("[mbuf:%p] reserve(2): m_buf: %p, m_buf_size: %d, size: %d, new size: %d.\n", this, m_buffer, m_buffer_size, size, new_size);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TS_MEMBUF_H__
|
||||
#ifndef __TS_MEMBUF_H__
|
||||
#define __TS_MEMBUF_H__
|
||||
|
||||
#include <ex.h>
|
||||
|
@ -11,15 +11,15 @@ public:
|
|||
MemBuffer();
|
||||
virtual ~MemBuffer();
|
||||
|
||||
// 附加size字节的数据到缓冲区末尾(可能会导致缓冲区扩大)
|
||||
// 附加size字节的数据到缓冲区末尾(可能会导致缓冲区扩大)
|
||||
void append(const ex_u8* data, size_t size);
|
||||
// 缓冲区至少为指定字节数(可能会扩大缓冲区,但不会缩小缓冲区,保证有效数据不会被改变)
|
||||
// 缓冲区至少为指定字节数(可能会扩大缓冲区,但不会缩小缓冲区,保证有效数据不会被改变)
|
||||
void reserve(size_t size);
|
||||
// 将m的有效数据附加到自己的有效数据末尾,可能会扩大缓冲区,m内容不变
|
||||
// 将m的有效数据附加到自己的有效数据末尾,可能会扩大缓冲区,m内容不变
|
||||
void concat(const MemBuffer& m);
|
||||
// 从缓冲区头部移除size字节(缓冲区大小可能并不会收缩),剩下的有效数据前移。
|
||||
// 从缓冲区头部移除size字节(缓冲区大小可能并不会收缩),剩下的有效数据前移。
|
||||
void pop(size_t size);
|
||||
// 清空缓冲区(有效数据为0字节,缓冲区不变)
|
||||
// 清空缓冲区(有效数据为0字节,缓冲区不变)
|
||||
void empty(void) { m_data_size = 0; }
|
||||
bool is_empty(void) { return m_data_size == 0; }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "ts_memstream.h"
|
||||
#include "ts_memstream.h"
|
||||
|
||||
MemStream::MemStream(MemBuffer& mbuf) : m_mbuf(mbuf)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __TS_MEMSTREAM_H__
|
||||
#ifndef __TS_MEMSTREAM_H__
|
||||
#define __TS_MEMSTREAM_H__
|
||||
|
||||
#include "ts_membuf.h"
|
||||
|
@ -9,31 +9,31 @@ public:
|
|||
MemStream(MemBuffer& mbuf);
|
||||
~MemStream();
|
||||
|
||||
void reset(void); // 清空缓冲区数据(但不释放内存),指针移动到头部
|
||||
void reset(void); // 清空缓冲区数据(但不释放内存),指针移动到头部
|
||||
|
||||
bool seek(size_t offset); // 移动指针到指定偏移,如果越界,则返回错误
|
||||
bool rewind(size_t n = 0); // 回退n字节,如果越界,返回错误,如果n为0,则回退到最开始处
|
||||
bool skip(size_t n); // 跳过n字节,如果越界,则返回错误
|
||||
bool seek(size_t offset); // 移动指针到指定偏移,如果越界,则返回错误
|
||||
bool rewind(size_t n = 0); // 回退n字节,如果越界,返回错误,如果n为0,则回退到最开始处
|
||||
bool skip(size_t n); // 跳过n字节,如果越界,则返回错误
|
||||
|
||||
ex_u8* ptr(void) { return m_mbuf.data() + m_offset; } // 返回当前数据指针
|
||||
size_t offset(void) { return m_offset; } // 返回当前指针相对数据起始的偏移
|
||||
ex_u8* ptr(void) { return m_mbuf.data() + m_offset; } // 返回当前数据指针
|
||||
size_t offset(void) { return m_offset; } // 返回当前指针相对数据起始的偏移
|
||||
|
||||
size_t left(void) { return m_mbuf.size() - m_offset; } // 返回剩余数据的大小(从当前数据指针到缓冲区结尾)
|
||||
size_t left(void) { return m_mbuf.size() - m_offset; } // 返回剩余数据的大小(从当前数据指针到缓冲区结尾)
|
||||
|
||||
ex_u8 get_u8(void);
|
||||
ex_u16 get_u16_le(void);
|
||||
ex_u16 get_u16_be(void);
|
||||
ex_u32 get_u32_le(void);
|
||||
ex_u32 get_u32_be(void);
|
||||
ex_u8* get_bin(size_t n); // 返回当前指向的数据的指针,内部偏移会向后移动n字节
|
||||
ex_u8* get_bin(size_t n); // 返回当前指向的数据的指针,内部偏移会向后移动n字节
|
||||
|
||||
void put_zero(size_t n); // 填充n字节的0
|
||||
void put_zero(size_t n); // 填充n字节的0
|
||||
void put_u8(ex_u8 v);
|
||||
void put_u16_le(ex_u16 v);
|
||||
void put_u16_be(ex_u16 v);
|
||||
void put_u32_le(ex_u32 v);
|
||||
void put_u32_be(ex_u32 v);
|
||||
void put_bin(const ex_u8* p, size_t n); // 填充p指向的n字节数据
|
||||
void put_bin(const ex_u8* p, size_t n); // 填充p指向的n字节数据
|
||||
|
||||
size_t size(void) { return m_mbuf.size(); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue