Subversion Repositories tpanel

Rev

Rev 464 | Rev 482 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 464 Rev 465
Line 1457... Line 1457...
1457
            }
1457
            }
1458
 
1458
 
1459
            memset(com.data.network.data, 0, sizeof(com.data.network.data));
1459
            memset(com.data.network.data, 0, sizeof(com.data.network.data));
1460
 
1460
 
1461
            com.data.network.bf = 0;    // Satic IP address
1461
            com.data.network.bf = 0;    // Satic IP address
-
 
1462
            size_t pos = 0;
-
 
1463
 
-
 
1464
            if (!host.empty())
-
 
1465
            {
1462
            size_t pos = host.length();
1466
                pos = host.length();
1463
            memcpy(com.data.network.data, host.c_str(), host.length());
1467
                memcpy(com.data.network.data, host.c_str(), host.length());
1464
            *(com.data.network.data+pos) = 0;
1468
                *(com.data.network.data+pos) = 0;
-
 
1469
            }
-
 
1470
 
1465
            pos++;
1471
            pos++;
-
 
1472
 
-
 
1473
            if (!ip.empty())
-
 
1474
            {
1466
            memcpy(com.data.network.data+pos, ip.c_str(), ip.length());
1475
                memcpy(com.data.network.data+pos, ip.c_str(), ip.length());
1467
            pos += ip.length();
1476
                pos += ip.length();
1468
            *(com.data.network.data+pos) = 0;
1477
                *(com.data.network.data+pos) = 0;
-
 
1478
            }
-
 
1479
 
1469
            pos++;
1480
            pos++;
-
 
1481
 
-
 
1482
            if (!netmask.empty())
-
 
1483
            {
1470
            memcpy(com.data.network.data+pos, netmask.c_str(), netmask.length());
1484
                memcpy(com.data.network.data+pos, netmask.c_str(), netmask.length());
1471
            pos += netmask.length();
1485
                pos += netmask.length();
1472
            *(com.data.network.data+pos) = 0;
1486
                *(com.data.network.data+pos) = 0;
-
 
1487
            }
-
 
1488
 
-
 
1489
            pos += 2;
-
 
1490
 
-
 
1491
            if (TStreamError::checkFilter(HLOG_DEBUG))
-
 
1492
            {
1473
            MSG_DEBUG("Counted length: " << pos);
1493
                MSG_DEBUG("Counted length: " << pos);
-
 
1494
                TError::logHex(com.data.network.data, total);
-
 
1495
            }
-
 
1496
 
1474
            com.data.network.len = total + 1;
1497
            com.data.network.len = total;
1475
            com.hlen = 0x0016 - 3 + total + 1;
1498
            com.hlen = 0x0016 - 3 + total + 1;
1476
            comStack.push_back(com);
1499
            comStack.push_back(com);
1477
            mSendReady = true;
1500
            mSendReady = true;
1478
        }
1501
        }
1479
        break;
1502
        break;
Line 2702... Line 2725...
2702
        break;
2725
        break;
2703
 
2726
 
2704
        case 0x020c:
2727
        case 0x020c:
2705
        case 0x020e:
2728
        case 0x020e:
2706
            *(buf+22) = s.data.network.bf;
2729
            *(buf+22) = s.data.network.bf;
-
 
2730
            pos = 23;
2707
            memcpy(buf+23, s.data.network.data, s.data.network.len);
2731
            memcpy(buf+pos, s.data.network.data, s.data.network.len);
-
 
2732
            pos += s.data.network.len;
2708
            *(buf+s.data.network.len+1) = calcChecksum(buf, 23 + s.data.network.len+1);
2733
            *(buf+pos) = calcChecksum(buf, pos);
2709
            valid = true;
2734
            valid = true;
2710
        break;
2735
        break;
2711
 
2736
 
2712
        case 0x0581:    // Pong
2737
        case 0x0581:    // Pong
2713
            *(buf + 22) = s.data.srDeviceInfo.device >> 8;
2738
            *(buf + 22) = s.data.srDeviceInfo.device >> 8;