[go: up one dir, main page]

Menu

[r1]: / Net.h  Maximize  Restore  History

Download this file

125 lines (98 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Net.h: interface for the Net class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#include "Worker.h"
#ifdef UNICODE
#define FORCE_UNICODE
#endif
#include <Lmshare.h>
#define IP_STR_LEN 16
class Network : public CWorker {
public:
bool LoadAsync(LPTSTR file);
Network(HWND control);
bool Load(LPCTSTR file);
bool Save(LPCTSTR file);
~Network();
private:
static DWORD LoadThread(Network* This);
void Init();
void Work();
bool EnumRecurse(NETRESOURCE * resource );
LPTSTR filename;
};
class DirectScan : public CWorker {
public:
DirectScan(HWND control);
~DirectScan();
void SetScanRange(IN_ADDR from_IP, IN_ADDR to_IP);
void Draw(LPNMTVCUSTOMDRAW tv, PCOLUMNS cols);
private:
typedef struct CHECK_IP_STRUCT {
IN_ADDR IP;
DirectScan * This;
} CHECK_IP_STRUCT;
static DWORD CheckIP(CHECK_IP_STRUCT * IP);
void Init();
void Work();
IN_ADDR IP_from,
IP_to,
IP_cur;
};
class Domain : public CWorker {
public:
Domain(LPCTSTR domain, HWND control);
Domain(HANDLE file, CWorker* parentnode, HWND control);
~Domain();
private:
void Work();
};
class Computer : public CWorker {
public:
bool Ping();
int Filter(CToken *filter, int col);
bool Save(HANDLE file);
int GetIPName(LPTSTR outbuf, int len);
LPCTSTR GetIPName();
void Draw(LPNMTVCUSTOMDRAW tv, PCOLUMNS cols);
Computer(LPCTSTR ComputerName, HWND control);
Computer(IN_ADDR ComputerIP, HWND control );
Computer(HANDLE file, CWorker* parentnode, HWND control);
~Computer();
int ResolveIP(bool async, bool refresh=false); // return Socket Error
//unsigned long __stdcall Computer::ResolveIP(void*);
private:
bool HasLoginAdmin;
HANDLE icmp;
bool TryLogin(LPCTSTR host = NULL);
static DWORD WINAPI ResolveIP_Thread(Computer* This);
TCHAR IP_str[IP_STR_LEN]; // XXX.XXX.XXX.XXX + 0
IN_ADDR IP_inet;
void Work();
};
class Share : public CWorker {
public:
void Draw(LPNMTVCUSTOMDRAW tv, PCOLUMNS cols);
void FullName(LPTSTR buf);
LPTSTR FullName();
bool Search(LPCTSTR mask, DWORD minSizeMB, DWORD maxSizeMB);
Share(LPCTSTR share, HWND control);
Share(HANDLE file, CWorker* parentnode , HWND control);
~Share();
LPCTSTR operator[](unsigned idx) const;
inline unsigned GetCount();
inline bool HasAnything();
//LPCTSTR fullname;
private:
LPTSTR* found;
unsigned found_count;
unsigned found_alloc;
void Work();
bool SearchRecursive(LPCTSTR mask);
bool AddString(LPCTSTR item);
LPCTSTR FindString(LPCTSTR item);
void ClearStrings();
CTokenFile *search;
LPCTSTR current;
}; // EnumerateComputer