49#define TELOPT_PRINTD(x) printit(x);
50#define TELOPT_PRINTD2(x,n) { \
51 static char buf[20]; \
59#define TELOPT_PRINTD(x) ;
60#define TELOPT_PRINTD2(x,n) ;
106 if (
buf[
x] == (
signed char)
IAC)
117 static char buf[2] = {
IAC};
122 static char buf[3] = {
IAC};
141 unsigned char *
buf = (
unsigned char *)
b;
153 buf[
l] = szResponse[1];
155 buf[
l++] = szResponse[0];
159 buf[
l++] = szResponse[1];
161 buf[
l++] = szResponse[0];
197 const char *pszTerms[] = {
ini.
get_term(),
"ANSI",
"DEC-VT100",
"DEC-VT52",
"UNKNOWN"};
200 if (pszBuffer + 2 < pszBufferEnd) {
201 switch ((
unsigned char)pszBuffer[1]) {
206 switch (pszBuffer[2]){
254 if (pszBuffer + 2 < pszBufferEnd)
262 switch ((
unsigned char)pszBuffer[2]){
302 if (pszBuffer + 2 < pszBufferEnd)
310 switch ((
unsigned char)pszBuffer[2]){
338 if (pszBuffer + 2 < pszBufferEnd)
346 switch ((
unsigned char)pszBuffer[2]){
365 if (pszBuffer + 2 < pszBufferEnd)
373 switch ((
unsigned char)pszBuffer[2]){
375 if (pszBuffer + 5 < pszBufferEnd) {
377 if (pszBuffer[3] == 1){
389 if (pszBuffer + 5 < pszBufferEnd)
394 if(pszBuffer + 5 < pszBufferEnd) {
404 if (pszBuffer + 5 < pszBufferEnd)
432 char *pszHead = pszBuffer;
435 while (pszBuffer < pszBufferEnd) {
437 if((
unsigned char) *pszBuffer ==
IAC) {
440 if((pszBufferEnd >= pszBuffer + 1) &&
441 (
unsigned char)*(pszBuffer + 1) ==
IAC) {
446 memmove(pszHead + 1, pszHead, pszBuffer - pszHead);
452 pszResult =
ParseIAC(pszBuffer, pszBufferEnd);
453 if(pszBuffer == pszResult)
return pszBuffer;
455 memmove(pszHead + (pszResult - pszBuffer), pszHead,
456 pszBuffer - pszHead);
457 pszHead += (pszResult - pszBuffer);
458 pszBuffer = pszResult;
470 pszBuffer = pszBufferEnd;
512 if (Result <= 0 || Result >
dwBuffer ){
518 char* pszNewHead = pszHead;
527 pszHead = pszNewHead;
529 }
while ((pszNewHead != pszHead) && (pszNewHead < pszTail) && !*pParams->
bNetFinish);
530 pszHead = pszNewHead;
536 pszTail =
szBuffer + (pszTail - pszHead);
ACPI_SIZE strlen(const char *String)
const char * get_term() const
int get_buffer_size() const
int ReadString(char *str, const int length)
void set_line_mode(BOOL b)
NetworkType get_net_type()
void set_local_echo(BOOL b)
int WriteString(const char *str, const int length)
const char * GetLocalAddress()
void SetNawsFunc(Naws_func_t func)
virtual char * ParseBuffer(char *pszBuffer, char *pszBufferEnd)=0
void SendIACParams(char c)
char * ParseIAC(char *pszBuffer, char *pszBufferEnd)
void print_telopt(const char *s, int d)
DWORD Go(LPVOID pvParams)
TTelnetHandler(TNetwork &RefNetwork, TConsole &RefConsole, TParser &RefParser)
int escapeIAC(char *buf, int length)
char * ParseBuffer(char *pszBuffer, char *pszBufferEnd)
TTelnetHandler & TelHandler
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
struct task_struct * current
volatile int * bNetPaused
volatile int * bNetFinish
volatile int * bNetFinished
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
int printit(const char *it)
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
#define TELOPT_PRINTD2(x, n)
DWORD WINAPI telProcessNetwork(LPVOID lpParameter)
int naws_string(char *buf, int width, int height)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO