⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xtunnelschilddata.h

📁 xtunnel nat/fw traversal source code
💻 H
字号:
/*	File:       XTunnelsChildData.h	Contains:   X-Tunnels data members only child maintains	Copyright:  (c) 2003 by Xten Networks, Inc., all rights reserved.*/#ifndef XTUNNELSCHILDDATA_H__5DE62CC1_8D5F_49A5_B9EB_BFB20D9F4B41_#define XTUNNELSCHILDDATA_H__5DE62CC1_8D5F_49A5_B9EB_BFB20D9F4B41_ 1#include "uiciudp.h"#include "XTunnelsProtocol.h"namespace XTunnels {// for sending (receiving is in each packet) -- specified by echoing last algorithm received from clientextern long sServerPacketEncryption;extern unsigned long g_ulPacketIndex; // all packets sent and received count, for the new security fieldextern unsigned long sQuitReason; extern const char* sQuitMessage;// passed to RunChild(), this can be disabled by SIGALRMextern int sClientTCPSocket;// cached by parent's ip allowableness inquiryextern struct in_addr g_tConnectedClientsIP;// opened on successful connection for UDP redirectionextern int sClientUDPRedirectSocket;extern u_buf_t sLastUDPRedirectSource;// timeout related informationextern unsigned long g_ulChildDeathwatchTimeout; // may be changed by clientextern time_t g_tLastSentToClient;extern time_t g_tLastReceivedFromClient;// this must be set before fork() to be valid, otherwise child will disconnect as too busyextern int sCurrentChildIndex;extern SChild g_tCurrentChildInfo;class CXTunnelsChildData   {   public:      static CXTunnelsChildData* s_pCurrentChildData;   static bool                InitializeChildData();   static void                DestroyChildData() { delete s_pCurrentChildData; s_pCurrentChildData = NULL; }   CXTunnelsChildData();   ~CXTunnelsChildData();      // sent from client   const char* UserID() { return m_szCachedUserID ? m_szCachedUserID : ""; }   const char* Host() { return m_szCachedHost ? m_szCachedHost : ""; }   const char* Password() { return m_szCachedPassword ? m_szCachedPassword : ""; }   bool  IsAnonymous() { return NULL == m_szCachedUserID; }   bool  SupportsXCipher() { return m_tVersion.m_byProtocolMajor > 0; }   struct TVersionParam  m_tVersion;   // cached from account existence and ip allowableness inquiries   char* m_szCachedUserID;   char* m_szCachedHost;   char* m_szCachedPassword;   void  SetUserID(const char* szUserID);   void  SetHost(const char* szHost);   void  SetPassword(const char* szPassword);   // ardana_robin: szKey is the string version of MD5 or SHA   // of "otherparty_sessionkey" + ":" + "password"   unsigned long m_ulKeyEncryptionType; // EAlgorithm_None/EAlgorithm_MD5/EAlgorithm_SHA1   unsigned long m_ulClientChallengeBlobSize;   unsigned long m_ulServerChallengeBlobSize;   char szClientChallengeBlob[ChallengeReplyParam::kMaxChallengeReplyBlobSize];   char szServerChallengeBlob[ChallengeReplyParam::kMaxChallengeReplyBlobSize];   char* m_szClientDecryptionKey;   char* m_szServerEncryptionKey;   void MakeServerChallengeBlob(unsigned long inUniqueIDSize, char* inUniqueID);   void MakeClientChallengeBlob(unsigned long inUniqueIDSize, char* inUniqueID);   void GetClientChallengeBlob(unsigned long& outBlobSize, char* outBlob);   bool CheckServerChallengeBlob(unsigned long inClientBlobSize, char* inClientBlob);   void MakeServerEncryptionKey(unsigned long inServerSessionIDSize, char* szServerSessionID);   void MakeClientDecryptionKey(unsigned long inClientSessionIDSize, char* szClientSessionID);      const char* GetDigestString(char* pDigest, char* szOutString);   void  MakeDigestWithColonPassword(      unsigned long ulSessionKeySize,      char* szSessionKey,	   unsigned long& ulOutDigestSize,	   char* pOutDigest   );   char* MakeDigestStringWithColonPassword(      unsigned long ulSessionKeySize,      char* szSessionKey   );      int SendPacketToClient(      TXTunnelsPacket* packet,      ssize_t inUnencryptedSize,       bool bInUseUDPRedirectPort   );   void SetAlarm(int iEventType);      };inline CXTunnelsChildData* ChildData() { return CXTunnelsChildData::s_pCurrentChildData; }} // end namespace XTunnels#endif // XTUNNELSCHILDDATA_H__5DE62CC1_8D5F_49A5_B9EB_BFB20D9F4B41_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -