You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

533 lines
16 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
  1. #include "basicFunctionality.h"
  2. //#ifdef DEBUG
  3. #include "basicLogCollection.h"
  4. #define URGANT_LOG(X) basicLogCollection::getInstance()->Log("basic Functionality", NULL, X )
  5. //#endif
  6. bool fileExist(const char *strFilename) {
  7. struct stat stFileInfo;
  8. int intStat;
  9. intStat = stat( strFilename ,&stFileInfo);
  10. if( intStat == 0 ){
  11. return true;
  12. };
  13. return false;
  14. };
  15. CSTR trim( CSTR val ){
  16. int i = 0;
  17. int j = strlen( val );
  18. if ( j ){
  19. while(( i < j ) && (((unsigned char)val[i])< 0x21 )) i++;
  20. while(( j > 0 ) && (((unsigned char)val[j])< 0x21 )) j--;
  21. if( ( i > 0 ) && ((j-i-1) > 0 ) ) memcpy( val, val+i, j-i-1 );
  22. val[j-i+1]=(char)0;
  23. };
  24. return val;
  25. };
  26. uint8_t checksum8( uint8_t *Buffer, size_t BufferSize ){
  27. uint16_t TempVal;
  28. TempVal = 0;
  29. for( int index = 0; index < BufferSize; index++ ) {
  30. TempVal+=Buffer[index];
  31. };
  32. return (uint8_t)(TempVal & 0x00FF);
  33. };
  34. uint16_t checksum16( uint8_t *Buffer, size_t BufferSize ){
  35. uint32_t TempVal;
  36. TempVal = 0;
  37. for( int index = 0; index < BufferSize; index++ ) {
  38. TempVal+=Buffer[index];
  39. };
  40. return (uint16_t)(TempVal & 0x0000FFFF);
  41. };
  42. uint8_t checksumLGS( uint8_t *Buffer, size_t BufferSize ){
  43. uint16_t TempVal;
  44. TempVal = 0;
  45. for( int index = 0; index < BufferSize; index++ ) {
  46. TempVal+=Buffer[index];
  47. };
  48. return (uint8_t)(TempVal & 0x00FF);
  49. };
  50. CArray *explode( char Delim, CSTR S_Str ){
  51. CArray *RetVal;
  52. CSTR b_ptr = S_Str;
  53. U16 s_ptr = 0;
  54. RetVal = NULL;
  55. if( S_Str ){
  56. RetVal = new CArray;
  57. while( ( U8 ) S_Str[s_ptr] ){
  58. if( (( U8 ) Delim ) == (( U8 )S_Str[s_ptr]) ){
  59. S_Str[s_ptr] = ( char ) 0;
  60. RetVal->push_back( b_ptr );
  61. s_ptr++;
  62. b_ptr = &S_Str[s_ptr];
  63. } else {
  64. s_ptr++;
  65. };
  66. };
  67. RetVal->push_back( b_ptr );
  68. };
  69. return RetVal;
  70. };
  71. CSTR implode( CArray *Data, CSTR S_Str, U8 Start, U8 End ){
  72. CSTR RetVal;
  73. U8 RStart = Start;
  74. U8 REnd = End;
  75. if( Start > Data->size() ) return NULL;
  76. if( End < Start ) return NULL;
  77. if( End > Data->size() ) REnd = Data->size()-1;
  78. if( strlen( (*Data).at( RStart )) ){
  79. RetVal = (CSTR) malloc( strlen( (*Data).at( RStart )) + 1 );
  80. sprintf( RetVal,"%s",(*Data).at( RStart ));
  81. } else {
  82. RetVal = (CSTR) malloc( 1 );
  83. *RetVal=(char)0;
  84. };
  85. for( int i = RStart+1; i < REnd; i++){
  86. RetVal = (CSTR) realloc ( RetVal, strlen( RetVal ) + strlen( (*Data).at( i )) + 1 + strlen( S_Str ) );
  87. sprintf( RetVal, "%s%s%s", RetVal, S_Str, (*Data).at( i ) );
  88. };
  89. return RetVal;
  90. };
  91. int getIP4( if_info **arrParam, int max_ifs ){
  92. int index = 0;
  93. #ifdef __linux__
  94. struct ifaddrs *addrs, *tmp;
  95. getifaddrs(&addrs);
  96. tmp = addrs;
  97. //arrParam= malloc( 10 * sezeof(if_info) );
  98. while (tmp){
  99. if (tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_INET){
  100. if( strncmp( tmp->ifa_name, "lo", 2 ) != 0 ){
  101. (*arrParam)[index].if_name = (CSTR)malloc(strlen(tmp->ifa_name)+1);
  102. snprintf( (*arrParam)[index].if_name, strlen(tmp->ifa_name)+1,"%s", tmp->ifa_name );
  103. (*arrParam)[index].if_addr = (CSTR)malloc(16);
  104. struct sockaddr_in *pAddr = (struct sockaddr_in *)tmp->ifa_addr;
  105. snprintf( (*arrParam)[index].if_addr, 16, "%s", inet_ntoa(pAddr->sin_addr) );
  106. index++;
  107. if( index == max_ifs ) break;
  108. }
  109. };
  110. tmp = tmp->ifa_next;
  111. };
  112. freeifaddrs(addrs);
  113. #endif
  114. return index;
  115. };
  116. #ifdef __linux__
  117. long long getFreeSpace( CSTR DirName ){
  118. struct statvfs fiData;
  119. if( ( statvfs( DirName, &fiData ) ) < 0 ) {
  120. return -1;
  121. };
  122. return fiData.f_bsize * fiData.f_bfree;
  123. };
  124. long long getTotalSpace( CSTR DirName ){
  125. struct statvfs fiData;
  126. if( ( statvfs( DirName, &fiData ) ) < 0 ) {
  127. return -1;
  128. };
  129. return fiData.f_bsize * fiData.f_blocks;
  130. };
  131. #else
  132. __int64 getFreeSpace( CSTR DirName ){
  133. return -1;
  134. };
  135. __int64 getTotalSpace( CSTR DirName ){
  136. return -1;
  137. };
  138. #endif
  139. CSTR getTStr( CSTR Fmt ){
  140. CSTR RetVal = NULL;
  141. char DateStr[200];
  142. time_t t;
  143. struct tm *tmp;
  144. t = time(NULL);
  145. tmp = gmtime(&t);
  146. if( tmp == NULL) {
  147. fprintf(stderr, "localtime!");
  148. return NULL;
  149. };
  150. if( Fmt == NULL ) {
  151. if( strftime( DateStr, 200, "%F %T GMT", tmp )==0 ){
  152. fprintf( stderr, "strftime returned 0" );
  153. return NULL;
  154. };
  155. } else {
  156. if( strftime( DateStr, 200, Fmt, tmp )==0 ){
  157. fprintf( stderr, "strftime returned 0" );
  158. return NULL;
  159. };
  160. }
  161. RetVal =(CSTR) malloc( strlen(DateStr) +1 );
  162. if( RetVal != NULL ) strcpy( RetVal, DateStr );
  163. return RetVal;
  164. };
  165. #ifdef __linux__
  166. long long getMilliseconds( void ){
  167. long long tMilliseconds;
  168. struct timeval tData;
  169. struct timezone tTZ;
  170. tMilliseconds = (long long) 0;
  171. tTZ.tz_minuteswest = 0;
  172. tTZ.tz_dsttime = 0;
  173. if( gettimeofday( &tData, &tTZ ) == -1 ){
  174. tMilliseconds = (long long) 0;
  175. URGANT_LOG( "EbioMat!");
  176. } else {
  177. tMilliseconds = (long long) tData.tv_sec;
  178. tMilliseconds = ( tMilliseconds * 1000 );
  179. tMilliseconds += (long long)( tData.tv_usec / 1000 );
  180. //URGANT_LOG("MilSecCollected!");
  181. };
  182. #else
  183. unsigned __int64 getMilliseconds( void ){
  184. unsigned __int64 tMilliseconds;
  185. SYSTEMTIME time;
  186. GetSystemTime(&time);
  187. tMilliseconds = (time.wSecond * 1000) + time.wMilliseconds;
  188. #endif
  189. return tMilliseconds;
  190. };
  191. #ifdef __linux__
  192. bool enumerateDevices( enumeratorInfo *mlist, const char *dTemplate){
  193. DIR *d;
  194. struct dirent *dir;
  195. DeviceInfo *tDevInfo;
  196. if( mlist == NULL )return false;
  197. if( dTemplate == NULL )return false;
  198. for( int i = 0; i < mlist->size(); i++ ) {
  199. delete( mlist->at(i) );
  200. };
  201. mlist->clear();
  202. d = opendir("/dev");
  203. if( d ){
  204. while((dir = readdir(d)) != NULL){
  205. if( dir->d_type == DT_CHR || dir->d_type == DT_BLK ){
  206. if( strncmp( dir->d_name, dTemplate, 5 ) == 0 ) {
  207. tDevInfo = (DeviceInfo *) malloc( sizeof(DeviceInfo) );
  208. sprintf( tDevInfo->DevicePath, "/dev/%s", dir->d_name );
  209. tDevInfo->FriendlyName[0] =(char)0;
  210. if( strncmp( dTemplate, "video", 5 ) == 0 ){
  211. FILE *fd;
  212. char CMD[256];
  213. sprintf( CMD, "v4l2-ctl -d %s -D", tDevInfo->DevicePath );
  214. fd = popen( CMD, "r");
  215. if( fd != NULL ) {
  216. char * line = NULL;
  217. size_t len = 0;
  218. ssize_t rd;
  219. while ((rd = getline(&line, &len, fd)) != -1) {
  220. char *tS1, *tS2;
  221. // Future use strcasestr() or make both stings same case
  222. if( ( tS1 = strstr( line, "Bus info" )) != NULL ) {
  223. tS2 = trim( strstr( tS1, ":" ) + 2 );
  224. sprintf( tDevInfo->FriendlyName, "%s", tS2 );
  225. };
  226. };
  227. fclose( fd );
  228. if( line ) free( line );
  229. };
  230. };
  231. mlist->push_back( tDevInfo );
  232. //printf("%s\n", dir->d_name );
  233. };
  234. //if( strncmp( dir->d_name, "ttyS", 4 ) == 0 ){
  235. // tBuffer = ( char * ) malloc( strlen(dir->d_name)+1 );
  236. // strncpy( tBuffer, dir->d_name, strlen(dir->d_name)+1 );
  237. // mlist->pushBack( tBuffer );
  238. // //printf("%s\n", dir->d_name );
  239. //};
  240. };
  241. };
  242. closedir(d);
  243. } else {
  244. return false;
  245. };
  246. return true;
  247. };
  248. #else
  249. #ifndef IID_PPV_ARGS
  250. extern "C++" {
  251. template<typename T> void** IID_PPV_ARGS_Helper(T** pp)
  252. {
  253. // make sure everyone derives from IUnknown
  254. static_cast<IUnknown*>(*pp);
  255. return reinterpret_cast<void**>(pp);
  256. }
  257. }
  258. #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType)
  259. #endif
  260. #pragma comment(lib,"Strmiids.lib")
  261. bool enumerateDevices(enumeratorInfo *mlist, REFGUID category){
  262. HRESULT hr;
  263. bool initOk = true;
  264. hr = CoInitializeEx( NULL, COINIT_SPEED_OVER_MEMORY | COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE );
  265. if( hr == E_INVALIDARG ){
  266. printf("Couldn't Init! hr=0x%x", hr);
  267. return false;
  268. } else if ( hr == E_OUTOFMEMORY ){
  269. printf("Couldn't Init! hr=0x%x", hr);
  270. return false;
  271. } else if ( hr == E_UNEXPECTED ){
  272. printf("Couldn't Init! hr=0x%x", hr);
  273. return false;
  274. } else if( hr == RPC_E_CHANGED_MODE ){
  275. initOk = false;
  276. };
  277. if( hr == S_OK || hr == RPC_E_CHANGED_MODE ){
  278. // Create the system device enumerator
  279. ICreateDevEnum *pDevEnum;
  280. hr = CoCreateInstance( CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDevEnum) );
  281. if( hr != S_OK ){
  282. printf("Couldn't create system enumerator! hr=0x%x", hr);
  283. CoUninitialize();
  284. return false;
  285. };
  286. if( pDevEnum != NULL ){
  287. IEnumMoniker *pClsEnum = NULL;
  288. hr = pDevEnum->CreateClassEnumerator(category, &pClsEnum, 0);
  289. if( hr == S_FALSE ){
  290. // The category is empty. Treat as an error.
  291. pDevEnum->Release();
  292. CoUninitialize();
  293. return false;
  294. };
  295. if( pClsEnum != NULL ){
  296. IMoniker *pMoniker = NULL;
  297. while( pClsEnum->Next(1, &pMoniker, NULL) == S_OK ){
  298. IPropertyBag *pPropBag = NULL;
  299. hr = pMoniker->BindToStorage(0, 0, IID_PPV_ARGS(&pPropBag));
  300. if( FAILED(hr) ){
  301. pMoniker->Release();
  302. continue;
  303. };
  304. VARIANT var;
  305. VariantInit(&var);
  306. DeviceInfo *tRec;
  307. tRec = (DeviceInfo *)malloc(sizeof(DeviceInfo));
  308. // Get description or friendly name.
  309. hr = pPropBag->Read(L"Description", &var, 0);
  310. if( FAILED(hr) ){
  311. hr = pPropBag->Read(L"FriendlyName", &var, 0);
  312. };
  313. if (SUCCEEDED(hr)){
  314. if (tRec != NULL) {
  315. sprintf(tRec->FriendlyName, "%S", var.bstrVal);
  316. mlist->push_back(tRec);
  317. };
  318. VariantClear(&var);
  319. };
  320. hr = pPropBag->Write(L"FriendlyName", &var);
  321. // WaveInID applies only to audio capture devices.
  322. hr = pPropBag->Read(L"WaveInID", &var, 0);
  323. if (SUCCEEDED(hr)){
  324. //printf("WaveIn ID: %d\n", var.lVal);
  325. VariantClear(&var);
  326. };
  327. hr = pPropBag->Read(L"DevicePath", &var, 0);
  328. if (SUCCEEDED(hr)){
  329. // The device path is not intended for display.
  330. if( tRec != NULL) {
  331. sprintf(tRec->DevicePath, "%S", var.bstrVal);
  332. };
  333. VariantClear(&var);
  334. };
  335. pPropBag->Release();
  336. pMoniker->Release();
  337. };
  338. pClsEnum->Release();
  339. };
  340. pDevEnum->Release();
  341. };
  342. if( initOk ) CoUninitialize();
  343. };
  344. return true;
  345. };
  346. #endif
  347. localIpAddresses g_vLocalIpAdressess;
  348. bool g_bAdressesAreDiscovered = false;
  349. #ifdef __linux__
  350. #include <linux/if.h>
  351. localIpAddresses *getLocalIP(){
  352. if( !g_bAdressesAreDiscovered ) {
  353. struct ifaddrs *ifaddr, *ifa;
  354. localIp4Info *tIpAddress = NULL;
  355. if (getifaddrs(&ifaddr) != -1) {
  356. /* Walk through linked list, maintaining head pointer so we can free list later */
  357. for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
  358. char protocol[IFNAMSIZ] = {0};
  359. if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_INET) continue;
  360. tIpAddress = (localIp4Info*)malloc(sizeof(localIp4Info));
  361. if(tIpAddress!=NULL){
  362. sprintf( tIpAddress->address , "%d.%d.%d.%d",
  363. (uint8_t)ifa->ifa_addr->sa_data[2],
  364. (uint8_t)ifa->ifa_addr->sa_data[3],
  365. (uint8_t)ifa->ifa_addr->sa_data[4],
  366. (uint8_t)ifa->ifa_addr->sa_data[5]
  367. );
  368. sprintf( tIpAddress->netmask , "%d.%d.%d.%d",
  369. (uint8_t)ifa->ifa_netmask->sa_data[2],
  370. (uint8_t)ifa->ifa_netmask->sa_data[3],
  371. (uint8_t)ifa->ifa_netmask->sa_data[4],
  372. (uint8_t)ifa->ifa_netmask->sa_data[5]
  373. );
  374. sprintf( tIpAddress->broadcast , "%d.%d.%d.%d",
  375. (uint8_t)ifa->ifa_ifu.ifu_broadaddr->sa_data[2],
  376. (uint8_t)ifa->ifa_ifu.ifu_broadaddr->sa_data[3],
  377. (uint8_t)ifa->ifa_ifu.ifu_broadaddr->sa_data[4],
  378. (uint8_t)ifa->ifa_ifu.ifu_broadaddr->sa_data[5]
  379. );
  380. g_vLocalIpAdressess.push_back(tIpAddress);
  381. };
  382. };
  383. freeifaddrs(ifaddr);
  384. };
  385. g_bAdressesAreDiscovered = true;
  386. };
  387. return &g_vLocalIpAdressess;
  388. };
  389. #else
  390. //https://stackoverflow.com/questions/5213629/how-to-enumerate-all-available-network-interfaces
  391. localIpAddresses *getLocalIP(){
  392. char psBuffer[128];
  393. FILE *fd;
  394. BYTE mB;
  395. localIp4Info *tIpAddress;
  396. if( g_bAdressesAreDiscovered ) return &g_vLocalIpAdressess;
  397. fd = _popen("ipconfig.exe","r");
  398. mB = 0;
  399. tIpAddress = (localIp4Info*)malloc(sizeof(localIp4Info));
  400. if (tIpAddress == NULL){
  401. _pclose(fd);
  402. g_bAdressesAreDiscovered = true;
  403. return &g_vLocalIpAdressess;
  404. };
  405. char tBuff[64];
  406. //#if defined( WIN_XP ) || defined( __linux__ )
  407. if (IsWindows7OrGreater()){
  408. sprintf(tBuff, "IPv4 Address" );
  409. } else {
  410. sprintf(tBuff, "IP Address");
  411. };
  412. while (!feof(fd)){
  413. if( fgets( psBuffer, 128, fd ) != NULL ){
  414. if( strstr( psBuffer, tBuff ) != NULL ){
  415. CSTR tVal = strstr(psBuffer, ":");
  416. int tLen;
  417. tLen = strlen(psBuffer) - (tVal - psBuffer) - 3;
  418. if( tLen > 4){
  419. strncpy(tIpAddress->address, tVal + 2, tLen);
  420. tIpAddress->address[tLen] = (char)0;
  421. } else {
  422. tIpAddress->address[0] = (char)0;
  423. }
  424. mB |= 1;
  425. };
  426. if (strstr(psBuffer, "Subnet Mask") != NULL){
  427. CSTR tVal = strstr(psBuffer, ":");
  428. int tLen;
  429. tLen = strlen(psBuffer) - (tVal - psBuffer) - 3;
  430. if (tLen > 7){
  431. strncpy(tIpAddress->netmask, tVal + 2, tLen);
  432. tIpAddress->netmask[tLen] = (char)0;
  433. char A[4], B[4], C[4], D[4];
  434. strncpy(A, tIpAddress->address, 3);
  435. A[3] = (char)0;
  436. strncpy(B, strstr(tIpAddress->address,".")+1, 3);
  437. B[3] = (char)0;
  438. strncpy(C, strstr(strstr(tIpAddress->address, ".")+1, ".") + 1, 3);
  439. C[3] = (char)0;
  440. strncpy(D, strstr(strstr(strstr(tIpAddress->address, ".") + 1, ".")+1,".") + 1, 3);
  441. D[3] = (char)0;
  442. BYTE a, b, c, d;
  443. a = atoi(A); b = atoi(B); c = atoi(C); d = atoi(D);
  444. char E[4], F[4], G[4], H[4];
  445. strncpy(E, tIpAddress->netmask, 3);
  446. E[3] = (char)0;
  447. strncpy(F, strstr(tIpAddress->netmask, ".") + 1, 3);
  448. F[3] = (char)0;
  449. strncpy(G, strstr(strstr(tIpAddress->netmask, ".") + 1, ".") + 1, 3);
  450. G[3] = (char)0;
  451. strncpy(H, strstr(strstr(strstr(tIpAddress->netmask, ".") + 1, ".") + 1, ".") + 1, 3);
  452. H[3] = (char)0;
  453. BYTE e, f, g, h;
  454. e = atoi(E); f = atoi(F); g = atoi(G); h = atoi(H);
  455. a |= ~e; b |= ~f; c |= ~g; d |= ~h;
  456. sprintf(tIpAddress->broadcast, "%d.%d.%d.%d", a, b, c, d);
  457. } else {
  458. tIpAddress->netmask[0] = (char)0;
  459. tIpAddress->broadcast[0] = (char)0;
  460. }
  461. mB |= 2;
  462. };
  463. if (strstr(psBuffer, "Default Gateway") != NULL){
  464. CSTR tVal = strstr(psBuffer, ":");
  465. int tLen;
  466. tLen = strlen(psBuffer) - (tVal - psBuffer) - 3;
  467. if (tLen > 7){
  468. strncpy(tIpAddress->gateway, tVal + 2, tLen);
  469. tIpAddress->gateway[tLen] = (char)0;
  470. } else {
  471. tIpAddress->gateway[0] = (char)0;
  472. }
  473. mB |= 4;
  474. };
  475. if ((mB & 7) == 7){
  476. g_vLocalIpAdressess.push_back(tIpAddress);
  477. tIpAddress = (localIp4Info*)malloc(sizeof(localIp4Info));
  478. if (tIpAddress == NULL){
  479. _pclose(fd);
  480. g_bAdressesAreDiscovered = true;
  481. return &g_vLocalIpAdressess;
  482. };
  483. mB = 0;
  484. };
  485. };
  486. };
  487. _pclose(fd);
  488. g_bAdressesAreDiscovered = true;
  489. return &g_vLocalIpAdressess;
  490. };
  491. #endif
  492. //#ifdef DEBUG
  493. #undef URGANT_LOG
  494. //#endif