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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689
|
#ifndef ICQPACKET_H
#define ICQPACKET_H
#include "licq_user.h"
#include "licq_buffer.h"
#include "licq_socket.h"
#include "licq_icq.h"
class CICQColor;
// values of extra info to identify plugin request
const unsigned short DirectInfoPluginRequest = 1;
const unsigned short DirectStatusPluginRequest = 2;
const unsigned short ServerInfoPluginRequest = 3;
const unsigned short ServerStatusPluginRequest = 4;
const unsigned short GUID_LENGTH = 18;
const unsigned short CAP_LENGTH = 16;
// list of plugins we currently support
struct PluginList
{
const char *name;
const char *guid;
const char *description;
};
extern struct PluginList info_plugins[];
extern struct PluginList status_plugins[];
unsigned short ReversePort(unsigned short p);
unsigned short LengthField(const char *szField);
char *PipeInput(char *m_szMessage);
//
// These classes, CPX_*, are general classes for different packets that do the
// same function that may be sent through the server or directly to the client.
// This gives the direct and server packets a multiple inheritence.
//
//-----FileTransfer------------------------------------------------------------
class CPX_FileTransfer
{
public:
CPX_FileTransfer(ConstFileList &lFileList, const char *szFileName);
virtual ~CPX_FileTransfer() { }
bool IsValid() { return m_bValid; }
ConstFileList GetFileList() { return m_lFileList; }
const char *GetFilename() { return m_szFilename; }
const char *GetDescription() { return m_szDesc; }
unsigned long GetFileSize() { return m_nFileSize; }
protected:
CPX_FileTransfer();
bool m_bValid;
char *m_szDesc;
char *m_szFilename;
ConstFileList m_lFileList;
unsigned long m_nFileSize;
};
//=====Packet===================================================================
class CPacket
{
public:
virtual ~CPacket() { if (buffer != NULL) delete buffer; }
CBuffer *getBuffer() { return buffer; };
virtual CBuffer *Finalize(INetSocket *) { return NULL; }
virtual const unsigned short Sequence() = 0;
virtual const unsigned short SubSequence() = 0;
virtual const unsigned short Command() = 0;
virtual const unsigned short SubCommand() = 0;
virtual const unsigned char Channel() { return ICQ_CHNxNONE; }
virtual const unsigned long SNAC() { return 0; }
virtual const unsigned short ExtraInfo() { return 0; }
static void SetMode(char c) { s_nMode = c; }
static char Mode() { return s_nMode; }
static void SetLocalIp(unsigned long n) { s_nLocalIp = n; }
static void SetLocalPort(unsigned short n) { s_nLocalPort = n; }
static void SetRealIp(unsigned long n) { s_nRealIp = n; }
static void SetIps(INetSocket *s);
static bool Firewall() { return s_nLocalIp != s_nRealIp; }
static unsigned long RealIp() { return s_nRealIp; }
static unsigned long LocalIp() { return s_nLocalIp; }
protected:
CPacket() { buffer = NULL; };
CBuffer *buffer;
unsigned short m_nSize;
static unsigned long s_nLocalIp;
static unsigned long s_nRealIp;
static unsigned short s_nLocalPort;
static char s_nMode;
};
//=====ServerTCP===============================================================
//-----SrvPacketTcp------------------------------------------------------------
class CSrvPacketTcp : public CPacket
{
public:
// Packet details
virtual const unsigned char Channel() { return m_nChannel; }
virtual const unsigned short Sequence() { return m_nSequence; }
virtual const unsigned short SubSequence() { return m_nSubSequence; }
virtual const unsigned long SNAC() { return ((m_nFamily << 16) | (m_nSubType)); }
virtual const unsigned short SubCommand() { return m_nSubCommand; }
// Not used anymore here, use SNAC instead.
virtual const unsigned short Command() { return 0; }
// Misc.
virtual const unsigned short ExtraInfo() { return m_nExtraInfo; }
virtual CBuffer *Finalize(INetSocket *);
void SetExtraInfo(unsigned short e) { m_nExtraInfo = e; }
protected:
CSrvPacketTcp(unsigned char);
void InitBuffer();
static bool s_bRegistered;
static unsigned short s_nSequence;
static unsigned short s_nSubSequence;
static pthread_mutex_t s_xMutex;
unsigned char m_nChannel;
unsigned short m_nSequence;
unsigned short m_nSubSequence;
unsigned short m_nFamily;
unsigned short m_nSubType;
unsigned short m_nSubCommand;
unsigned short m_nExtraInfo;
char *m_szSequenceOffset;
};
//=====UDP======================================================================
//-----PacketUdp----------------------------------------------------------------
class CPacketUdp : public CPacket
{
public:
virtual CBuffer *Finalize(INetSocket *);
virtual const unsigned short Sequence() { return m_nSequence; }
virtual const unsigned short SubSequence() { return m_nSubSequence; }
virtual const unsigned short Command() { return m_nCommand; }
virtual const unsigned short SubCommand() { return 0; }
protected:
CPacketUdp(unsigned short _nCommand);
void InitBuffer();
static bool s_bRegistered;
#if ICQ_VERSION == 2
unsigned short m_nVersion;
unsigned short m_nCommand;
unsigned short m_nSequence;
unsigned short m_nSubSequence;
#elif ICQ_VERSION == 4
unsigned short m_nVersion;
unsigned short m_nRandom;
unsigned short m_nZero;
unsigned short m_nCommand;
unsigned short m_nSequence;
unsigned short m_nSubSequence;
unsigned long m_nCheckSum;
#else
unsigned short m_nVersion;
unsigned long m_nZero;
unsigned long m_nSessionId;
unsigned short m_nCommand;
unsigned short m_nSequence;
unsigned short m_nSubSequence;
unsigned long m_nCheckSum;
#endif
static unsigned short s_nSequence;
static unsigned short s_nSubSequence;
static unsigned long s_nSessionId;
};
//-----Logon--------------------------------------------------------------------
class CPU_Logon : public CSrvPacketTcp
{
public:
CPU_Logon(const char *_szPassword, const char *_szUin, unsigned short _nLogonStatus);
protected:
unsigned long m_nLogonStatus;
unsigned long m_nTcpVersion;
};
//-----Logoff-------------------------------------------------------------------
class CPU_Logoff : public CSrvPacketTcp
{
public:
CPU_Logoff();
};
//-----SendCookie---------------------------------------------------------------
class CPU_SendCookie : public CSrvPacketTcp
{
public:
CPU_SendCookie(const char *, int len);
};
//-----CommonFamily----------------------------------------------------------
class CPU_CommonFamily : public CSrvPacketTcp
{
public:
CPU_CommonFamily(unsigned short Family, unsigned short SubType);
protected:
void InitBuffer();
};
class CPU_GenericFamily : public CPU_CommonFamily
{
public:
CPU_GenericFamily(unsigned short Family, unsigned short SubType);
};
#if ICQ_VERSION == 2 || ICQ_VERSION == 6
//-----Register----------------------------------------------------------------
// Doesn't actually descend from CPacketUdp in version 2 but we keep the
// name the same for simplicity
class CPU_Register : public CPacketUdp
{
public:
CPU_Register(const char *_szPasswd);
virtual ~CPU_Register();
virtual const unsigned short Sequence() { return m_nSequence; }
virtual const unsigned short SubSequence() { return 0; }
virtual const unsigned short Command() { return m_nCommand; }
virtual const unsigned short SubCommand() { return 0; }
protected:
virtual unsigned long getSize() { return 1; }
/* 02 00 FC 03 01 00 02 00 04 00 65 66 67 00 72 00 00 00 00 00 00 00 */
unsigned short m_nVersion;
unsigned short m_nCommand;
unsigned short m_nSequence;
unsigned short m_nUnknown1;
unsigned short m_nPasswdLen;
char *m_szPasswd;
unsigned long m_nUnknown2;
unsigned long m_nUnknown3;
};
#elif ICQ_VERSION == 4 || ICQ_VERSION == 5
//-----Register----------------------------------------------------------------
class CPU_Register : public CPacketUdp
{
public:
CPU_Register(const char *_szPasswd);
};
#elif ICQ_VERSION > 6
class CPU_RegisterFirst : public CSrvPacketTcp
{
public:
CPU_RegisterFirst();
};
class CPU_Register : public CPU_CommonFamily
{
public:
CPU_Register(const char *_szPasswd);
};
#endif
//-----VerifyRegistration------------------------------------------------------
class CPU_VerifyRegistration : public CPU_CommonFamily
{
public:
CPU_VerifyRegistration();
};
//-----SendVerification--------------------------------------------------------
class CPU_SendVerification : public CPU_CommonFamily
{
public:
CPU_SendVerification(const char *, const char *);
};
//-----ImICQ------------------------------------------------------------------
class CPU_ImICQ : public CPU_CommonFamily
{
public:
CPU_ImICQ();
};
//-----ICQMode------------------------------------------------------------------
class CPU_ICQMode : public CPU_CommonFamily
{
public:
CPU_ICQMode(unsigned short nChannel, unsigned long nFlags);
};
//-----CapabilitySettings-------------------------------------------------------------
class CPU_CapabilitySettings : public CPU_CommonFamily
{
public:
CPU_CapabilitySettings();
};
//-----RateAck-----------------------------------------------------------------
class CPU_RateAck : public CPU_CommonFamily
{
public:
CPU_RateAck();
};
//-----GenericUinList------------------------------------------------------------
class CPU_GenericUinList : public CPU_CommonFamily
{
public:
CPU_GenericUinList(const char *szId, unsigned short Family, unsigned short Subtype);
CPU_GenericUinList(UserStringList &, unsigned short, unsigned short);
CPU_GenericUinList(unsigned long _nUin, unsigned short Family, unsigned short Subtype);
};
//-----RequestList--------------------------------------------------------------
class CPU_RequestList : public CPU_CommonFamily
{
public:
CPU_RequestList();
protected:
time_t m_nSavedTime;
unsigned short m_nRecords;
};
//-----ExportContactStart-------------------------------------------------------
class CPU_ExportContactStart : public CPU_CommonFamily
{
public:
CPU_ExportContactStart();
};
//-----ExportToServerList-------------------------------------------------------
class CPU_ExportToServerList : public CPU_CommonFamily
{
public:
CPU_ExportToServerList(UserStringList &, unsigned short);
};
//-----ExportGroupsToServerList-------------------------------------------------
class CPU_ExportGroupsToServerList : public CPU_CommonFamily
{
public:
CPU_ExportGroupsToServerList(GroupList &);
};
//-----AddPrivacyInfo-----------------------------------------------------------
class CPU_AddPDINFOToServerList : public CPU_CommonFamily
{
public:
CPU_AddPDINFOToServerList();
unsigned short GetSID() { return m_nSID; }
unsigned short GetGSID() { return m_nGSID; }
protected:
unsigned short m_nSID,
m_nGSID;
};
//-----AddToServerList----------------------------------------------------------
class CPU_AddToServerList : public CPU_CommonFamily
{
public:
CPU_AddToServerList(const char *_szName, unsigned short _nType,
unsigned short _nGroup = 0,
bool _bAuthReq = false, bool _bTopLevel = false);
unsigned short GetSID() { return m_nSID; }
unsigned short GetGSID() { return m_nGSID; }
protected:
unsigned short m_nSID,
m_nGSID;
};
//-----RemoveFromServerList-----------------------------------------------------
class CPU_RemoveFromServerList : public CPU_CommonFamily
{
public:
CPU_RemoveFromServerList(const char * _szName, unsigned short _nGSID,
unsigned short _nSID, unsigned short _nType);
};
//-----ClearServerList----------------------------------------------------------
class CPU_ClearServerList : public CPU_CommonFamily
{
public:
CPU_ClearServerList(UserStringList &, unsigned short);
};
//-----UpdateToServerList-------------------------------------------------------
class CPU_UpdateToServerList : public CPU_CommonFamily
{
public:
CPU_UpdateToServerList(const char *_szName, unsigned short _nType,
unsigned short _nSID = 0, bool _bAuthReq = false);
};
//-----SetPrivacy---------------------------------------------------------------
class CPU_SetPrivacy : public CPU_CommonFamily
{
public:
CPU_SetPrivacy(unsigned char _nPrivacy);
};
//-----SetStatus----------------------------------------------------------------
class CPU_SetStatus : public CPU_CommonFamily
{
public:
CPU_SetStatus(unsigned long _nNewStatus);
private:
unsigned long m_nNewStatus;
};
class CPU_SetStatusFamily : public CPU_CommonFamily
{
public:
CPU_SetStatusFamily();
protected:
void InitBuffer();
unsigned long m_nNewStatus;
};
class CPU_SetLogonStatus : public CPU_SetStatusFamily
{
public:
CPU_SetLogonStatus(unsigned long _nNewStatus);
};
class CPU_UpdateInfoTimestamp : public CPU_SetStatusFamily
{
public:
CPU_UpdateInfoTimestamp(const char *GUID);
};
class CPU_UpdateStatusTimestamp : public CPU_SetStatusFamily
{
public:
CPU_UpdateStatusTimestamp(const char *GUID, unsigned long nState,
unsigned long nStatus = ICQ_STATUS_OFFLINE);
};
class CPU_UpdateTimestamp : public CPU_SetStatusFamily
{
public:
CPU_UpdateTimestamp();
};
//-----ClientReady--------------------------------------------------------------
class CPU_ClientReady : public CPU_CommonFamily
{
public:
CPU_ClientReady();
};
//-----ClientAckNameInfo--------------------------------------------------------
class CPU_AckNameInfo : public CPU_CommonFamily
{
public:
CPU_AckNameInfo();
};
//-----RequestSysMsg------------------------------------------------------------
class CPU_RequestSysMsg : public CPU_CommonFamily
{
public:
CPU_RequestSysMsg();
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
};
//-----SysMsgDoneAck------------------------------------------------------------
class CPU_SysMsgDoneAck : public CPU_CommonFamily
{
public:
CPU_SysMsgDoneAck(unsigned short nId);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
};
//-----TypingNotification------------------------------------------------------
class CPU_TypingNotification : public CPU_CommonFamily
{
public:
CPU_TypingNotification(const char *szId, bool bActive);
};
//-----CheckInvisible----------------------------------------------------------
class CPU_CheckInvisible : public CPU_CommonFamily
{
public:
CPU_CheckInvisible(const char *szId);
};
//-----Ack---------------------------------------------------------------------
class CPU_Ack : public CPacketUdp
{
public:
#if ICQ_VERSION == 2
CPU_Ack(unsigned short _nSequence);
#else
CPU_Ack(unsigned short _nSequence, unsigned short _nSubSequence);
#endif
};
//-----AddUser------------------------------------------------------------------
class CPU_AddUser : public CPacketUdp
{
public:
CPU_AddUser(unsigned long _nAddedUin);
protected:
/* 02 00 3C 05 06 00 50 A5 82 00 8F 76 20 00 */
unsigned long m_nAddedUin;
};
//-----SearchWhitePages---------------------------------------------------------
class CPU_SearchWhitePages : public CPU_CommonFamily
{
public:
CPU_SearchWhitePages(const char *szFirstName, const char *szLastName,
const char *szAlias, const char *szEmail,
unsigned short nMinAge, unsigned short nMaxAge,
char nGender, char nLanguage, const char *szCity,
const char *szState, unsigned short nCountryCode,
const char *szCoName, const char *szCoDept,
const char *szCoPos, const char *szKeyword, bool bOnlineOnly);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
unsigned long Uin() { return 0; }
void PackSearch(unsigned short nCmd, const char *szField);
protected:
unsigned long m_nMetaCommand;
};
//-----SearchByUin--------------------------------------------------------------
class CPU_SearchByUin : public CPU_CommonFamily
{
public:
CPU_SearchByUin(unsigned long nUin);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned long m_nMetaCommand;
};
//-----UpdatePersonalBasicInfo--------------------------------------------------
class CPU_UpdatePersonalBasicInfo : public CPacketUdp
{
public:
CPU_UpdatePersonalBasicInfo(const char *_sAlias, const char *_sFirstName,
const char *_sLastName, const char *_sEmail,
bool _bAuthorization);
const char *Alias() { return m_szAlias; }
const char *FirstName() { return m_szFirstName; }
const char *LastName() { return m_szLastName; }
const char *Email() { return m_szEmail; }
bool Authorization() { return m_nAuthorization == 0; }
protected:
char *m_szAlias;
char *m_szFirstName;
char *m_szLastName;
char *m_szEmail;
char m_nAuthorization;
};
//-----UpdatePersonalExtInfo-------------------------------------------------------
class CPU_UpdatePersonalExtInfo : public CPacketUdp
{
public:
CPU_UpdatePersonalExtInfo(const char *_sCity, unsigned short _nCountry,
const char *_sState, unsigned short _nAge,
char _cSex, const char *_sPhone,
const char *_sHomepage, const char *_sAbout,
unsigned long _nZipcode);
const char *City() { return m_szCity; }
unsigned short Country() { return m_nCountry; }
const char *State() { return m_szState; }
unsigned short Age() { return m_nAge; }
char Sex() { return m_cSex; }
const char *PhoneNumber() { return m_szPhone; }
const char *Homepage() { return m_szHomepage; }
const char *About() { return m_szAbout; }
unsigned long Zipcode() { return m_nZipcode; }
protected:
char *m_szCity;
unsigned short m_nCountry;
char m_cTimezone;
char *m_szState;
unsigned short m_nAge;
char m_cSex;
char *m_szPhone;
char *m_szHomepage;
char *m_szAbout;
unsigned long m_nZipcode;
};
//-----Ping---------------------------------------------------------------------
class CPU_Ping : public CSrvPacketTcp
{
public:
CPU_Ping();
};
//-----ThroughServer-----------------------------------------------------------
class CPU_ThroughServer : public CPU_CommonFamily
{
public:
CPU_ThroughServer(const char *szId, unsigned char format, char *_sMessage,
unsigned short _nCharset = 0, bool bOffline = true,
size_t _nLen = 0);
CPU_ThroughServer(unsigned long _nDestinationUin, unsigned char format,
char *_sMessage);
protected:
unsigned char m_nMsgType;
};
//-----Type2Message-------------------------------------------------------------
class CPU_Type2Message : public CPU_CommonFamily
{
public:
CPU_Type2Message(ICQUser *u, bool _bAck, bool _bDirectInfo, const char *cap,
unsigned long nMsgID1 = 0,
unsigned long nMsgID2 = 0);
protected:
void InitBuffer();
ICQUser *m_pUser;
bool m_bAck;
bool m_bDirectInfo;
unsigned long m_nMsgID[2];
char m_cap[CAP_LENGTH];
unsigned long m_nExtraLen; // length of data following 0x2711 tlv
};
//-----ReverseConnect-----------------------------------------------------------
class CPU_ReverseConnect : public CPU_Type2Message
{
public:
CPU_ReverseConnect(ICQUser *u, unsigned long nLocalIP,
unsigned short nLocalPort, unsigned short nRemotePort);
};
//-----ReverseConnectFailed-----------------------------------------------------
class CPU_ReverseConnectFailed : public CPU_CommonFamily
{
public:
CPU_ReverseConnectFailed(unsigned long nUin, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nFailedPort,
unsigned short nOurPort, unsigned long nConnectID);
};
//-----PluginMessage-----------------------------------------------------------
class CPU_PluginMessage : public CPU_Type2Message
{
public:
CPU_PluginMessage(ICQUser *u, bool bAck, const char *PluginGUID,
unsigned long nMsgID1 = 0, unsigned long nMsgID2 = 0);
protected:
void InitBuffer();
char m_PluginGUID[GUID_LENGTH];
};
//-----InfoPluginRequest-------------------------------------------------------
class CPU_InfoPluginReq : public CPU_PluginMessage
{
public:
CPU_InfoPluginReq(ICQUser *u, const char *GUID, unsigned long nTime);
virtual const char *RequestGUID() { return m_ReqGUID; }
virtual const unsigned short ExtraInfo() { return ServerInfoPluginRequest; }
protected:
char m_ReqGUID[GUID_LENGTH];
};
//-----StatusPluginRequest-----------------------------------------------------
class CPU_StatusPluginReq : public CPU_PluginMessage
{
public:
CPU_StatusPluginReq(ICQUser *u, const char *GUID, unsigned long nTime);
virtual const unsigned short ExtraInfo() { return ServerStatusPluginRequest; }
virtual const char *RequestGUID() { return m_ReqGUID; }
protected:
char m_ReqGUID[GUID_LENGTH];
};
//-----AdvancedMessage---------------------------------------------------------
class CPU_AdvancedMessage : public CPU_Type2Message
{
public:
CPU_AdvancedMessage(ICQUser *u, unsigned short _nMsgType,
unsigned short _nMsgFlags, bool _bAck,
unsigned short _nSequence,
unsigned long nID1 = 0,
unsigned long nID2 = 0);
protected:
void InitBuffer();
unsigned short m_nMsgType;
unsigned short m_nMsgFlags;
unsigned short m_nSequence;
};
//-----ChatRequest-------------------------------------------------------------
class CPU_ChatRequest : public CPU_AdvancedMessage
{
public:
CPU_ChatRequest(char *szReason, const char *szChatUsers, unsigned short nPort,
unsigned short nLevel, ICQUser *pUser, bool bICBM);
};
//-----FileTransfer------------------------------------------------------------
class CPU_FileTransfer : public CPU_AdvancedMessage, public CPX_FileTransfer
{
public:
CPU_FileTransfer(ICQUser *, ConstFileList &lFileList, const char *_szFile,
const char *_szDesc, unsigned short nLevel, bool bICBM);
};
//-----NoManager--------------------------------------------------------
class CPU_NoManager : public CPU_CommonFamily
{
public:
CPU_NoManager(ICQUser *u, unsigned long nMsgID1, unsigned long nMsgID2);
};
//-----AckThroughServer--------------------------------------------------------
class CPU_AckThroughServer : public CPU_CommonFamily
{
public:
CPU_AckThroughServer(ICQUser *u, unsigned long msgid1,
unsigned long msgid2, unsigned short sequence,
unsigned short msgType, bool bAccept,
unsigned short nLevel, const char *GUID);
protected:
void InitBuffer();
unsigned long m_nUin, m_nMsgID[2];
unsigned short m_nSequence, m_nMsgType, m_nStatus, m_nUinLen, m_nLevel;
char m_szUin[13];
char *m_szMessage;
char m_GUID[GUID_LENGTH];
};
//-----AckGeneral--------------------------------------------------------------
class CPU_AckGeneral : public CPU_AckThroughServer
{
public:
CPU_AckGeneral(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence,
unsigned short nMsgType, bool bAccept, unsigned short nLevel);
};
//-----AckFileAccept-----------------------------------------------------------
class CPU_AckFileAccept : public CPU_AdvancedMessage
{
public:
CPU_AckFileAccept(ICQUser *u, unsigned long nMsgID[],
unsigned short nSequence, unsigned short nPort,
const char *szDesc, const char *szFile,
unsigned long nFileSize);
};
//-----AckFileRefuse-----------------------------------------------------------
class CPU_AckFileRefuse : public CPU_AckThroughServer
{
public:
CPU_AckFileRefuse(ICQUser *u, unsigned long nMsgID[],
unsigned short nSequence, const char *msg);
};
//-----AckChatAccept-----------------------------------------------------------
class CPU_AckChatAccept : public CPU_AdvancedMessage
{
public:
CPU_AckChatAccept(ICQUser *u, const char *szClients, unsigned long nMsgID[],
unsigned short nSequence, unsigned short nPort);
};
//-----AckChatRefuse-----------------------------------------------------------
class CPU_AckChatRefuse : public CPU_AckThroughServer
{
public:
CPU_AckChatRefuse(ICQUser *u, unsigned long nMsgID[],
unsigned short nSequence, const char *msg);
};
//-----PluginError-------------------------------------------------------------
class CPU_PluginError : public CPU_AckThroughServer
{
public:
CPU_PluginError(ICQUser *u, unsigned long nMsgID1, unsigned long nMsgID2,
unsigned short nSequence, const char *GUID);
};
//-----InfoPluginListResp------------------------------------------------------
class CPU_InfoPluginListResp : public CPU_AckThroughServer
{
public:
CPU_InfoPluginListResp(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence);
};
//-----InfoPhoneBookResp-------------------------------------------------------
class CPU_InfoPhoneBookResp : public CPU_AckThroughServer
{
public:
CPU_InfoPhoneBookResp(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence);
};
//-----InfoPictureResp---------------------------------------------------------
class CPU_InfoPictureResp : public CPU_AckThroughServer
{
public:
CPU_InfoPictureResp(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence);
};
//-----StatusPluginListResp----------------------------------------------------
class CPU_StatusPluginListResp : public CPU_AckThroughServer
{
public:
CPU_StatusPluginListResp(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence);
};
//-----StatusPluginResp-----------------------------------------------------
class CPU_StatusPluginResp : public CPU_AckThroughServer
{
public:
CPU_StatusPluginResp(ICQUser *u, unsigned long nMsgID1,
unsigned long nMsgID2, unsigned short nSequence,
unsigned long nStatus);
};
//-----SendSms-----------------------------------------------------------
class CPU_SendSms : public CPU_CommonFamily
{
public:
CPU_SendSms(const char *szNumber, const char *szMessage);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned long m_nMetaCommand;
};
//-----ReverseTCPRequest--------------------------------------------------------
class CPU_ReverseTCPRequest : public CPacketUdp
{
public:
CPU_ReverseTCPRequest(unsigned long _nDestinationUin, unsigned long _nIP,
unsigned short _nPort, unsigned short _nPort2);
protected:
unsigned long m_nDestinationUin;
};
//-----RequestAuth--------------------------------------------------------------
class CPU_RequestAuth : public CPU_CommonFamily
{
public:
CPU_RequestAuth(unsigned long, const char *);
};
//-----Authorize----------------------------------------------------------------
class CPU_Authorize : public CPacketUdp
{
public:
CPU_Authorize(unsigned long _nAuthorizeUin);
protected:
/* 02 00 56 04 05 00 50 A5 82 00 A7 B8 19 00 08 00 01 00 00 */
unsigned long m_nAuthorizeUin;
};
//-----SetRandomChatGroup----------------------------------------------------
class CPU_SetRandomChatGroup : public CPU_CommonFamily
{
public:
CPU_SetRandomChatGroup(unsigned long nGroup);
unsigned long Group() { return m_nGroup; }
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned long m_nGroup;
unsigned long m_nMetaCommand;
};
//-----RandomChatSearch----------------------------------------------------
class CPU_RandomChatSearch : public CPU_CommonFamily
{
public:
CPU_RandomChatSearch(unsigned long nGroup);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned long m_nMetaCommand;
};
//-----Meta_SetGeneralInfo-----------------------------------------------------
class CPU_Meta_SetGeneralInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetGeneralInfo(const char *szAlias,
const char *szFirstName,
const char *szLastName,
const char *szEmailPrimary,
const char *szCity,
const char *szState,
const char *szPhoneNumber,
const char *szFaxNumber,
const char *szAddress,
const char *szCellularNumber,
const char *szZipCode,
unsigned short nCountryCode,
bool bHideEmail);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
char *m_szAlias;
char *m_szFirstName;
char *m_szLastName;
char *m_szEmailPrimary;
char *m_szCity;
char *m_szState;
char *m_szPhoneNumber;
char *m_szFaxNumber;
char *m_szAddress;
char *m_szCellularNumber;
char *m_szZipCode;
unsigned short m_nCountryCode;
char m_nTimezone;
char m_nHideEmail;
friend class CICQDaemon;
};
//-----Meta_SetMoreEmailInfo---------------------------------------------------
class CPU_Meta_SetEmailInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetEmailInfo(const char *szEmailSecondary,
const char *szEmailOld);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
char *m_szEmailSecondary;
char *m_szEmailOld;
friend class CICQDaemon;
};
//-----Meta_SetMoreInfo------------------------------------------------------
class CPU_Meta_SetMoreInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetMoreInfo(unsigned short nAge,
char nGender,
const char *szHomepage,
unsigned short nBirthYear,
char nBirthMonth,
char nBirthDay,
char nLanguage1,
char nLanguage2,
char nLanguage3);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
unsigned short m_nAge;
char m_nGender;
char *m_szHomepage;
unsigned short m_nBirthYear;
char m_nBirthMonth;
char m_nBirthDay;
char m_nLanguage1;
char m_nLanguage2;
char m_nLanguage3;
friend class CICQDaemon;
};
//-----Meta_SetInterestsInfo----------------------------------------------------
class CPU_Meta_SetInterestsInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetInterestsInfo(const ICQUserCategory* interests);
~CPU_Meta_SetInterestsInfo();
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
ICQUserCategory *m_Interests;
friend class CICQDaemon;
};
//-----Meta_SetOrgBackInfo------------------------------------------------------
class CPU_Meta_SetOrgBackInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetOrgBackInfo(const ICQUserCategory* orgs,
const ICQUserCategory* background);
~CPU_Meta_SetOrgBackInfo();
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
ICQUserCategory *m_Orgs;
ICQUserCategory *m_Background;
friend class CICQDaemon;
};
//-----Meta_SetWorkInfo------------------------------------------------------
class CPU_Meta_SetWorkInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetWorkInfo(const char *szCity,
const char *szState,
const char *szPhoneNumber,
const char *szFaxNumber,
const char *szAddress,
const char *szZip,
unsigned short nCompanyCountry,
const char *szName,
const char *szDepartment,
const char *szPosition,
unsigned short nCompanyOccupation,
const char *szHomepage);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
char *m_szCity;
char *m_szState;
char *m_szPhoneNumber;
char *m_szFaxNumber;
char *m_szAddress;
char *m_szZip;
unsigned short m_nCompanyCountry;
char *m_szName;
char *m_szDepartment;
char *m_szPosition;
unsigned short m_nCompanyOccupation;
char *m_szHomepage;
friend class CICQDaemon;
};
//-----Meta_SetAbout---------------------------------------------------------
class CPU_Meta_SetAbout : public CPU_CommonFamily
{
public:
CPU_Meta_SetAbout(const char *szAbout);
~CPU_Meta_SetAbout();
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
protected:
unsigned short m_nMetaCommand;
char *m_szAbout;
friend class CICQDaemon;
};
//-----RequestInfo-----------------------------------------------------------
class CPU_RequestInfo : public CPU_CommonFamily
{
public:
CPU_RequestInfo(const char *szId);
};
//-----AIMFetchAwayMessage--------------------------------------------------
class CPU_AIMFetchAwayMessage : public CPU_CommonFamily
{
public:
CPU_AIMFetchAwayMessage(const char *szId);
};
//-----SetPassword---------------------------------------------------------
class CPU_SetPassword : public CPU_CommonFamily
{
public:
CPU_SetPassword(const char *szPassword);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
unsigned long Uin() { return 0; }
protected:
unsigned short m_nMetaCommand;
char *m_szPassword;
friend class CICQDaemon;
};
//-----Meta_SetSecurityInfo--------------------------------------------------
class CPU_Meta_SetSecurityInfo : public CPU_CommonFamily
{
public:
CPU_Meta_SetSecurityInfo(bool bAuthorization,
bool bHideIp,
bool bWebAware);
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
bool Authorization() { return m_nAuthorization == 0; }
bool HideIp() { return m_nHideIp == 1; }
bool WebAware() { return m_nWebAware == 1; }
protected:
unsigned short m_nMetaCommand;
char m_nAuthorization;
char m_nHideIp;
char m_nWebAware;
};
//-----Meta_RequestAllInfo------------------------------------------------------
class CPU_Meta_RequestAllInfo : public CPU_CommonFamily
{
public:
CPU_Meta_RequestAllInfo(const char *_szId);
virtual ~CPU_Meta_RequestAllInfo() { free(m_szId); }
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
const char *Id() { return m_szId; }
protected:
unsigned short m_nMetaCommand;
char *m_szId;
};
//-----Meta_RequestBasicInfo------------------------------------------------------
class CPU_Meta_RequestBasicInfo : public CPU_CommonFamily
{
public:
CPU_Meta_RequestBasicInfo(const char *_szId);
virtual ~CPU_Meta_RequestBasicInfo() { free(m_szId); }
virtual const unsigned short SubCommand() { return m_nMetaCommand; }
const char *Id() { return m_szId; }
protected:
unsigned short m_nMetaCommand;
char *m_szId;
};
//=====TCP======================================================================
bool Decrypt_Client(CBuffer *pkt, unsigned long version);
void Encrypt_Client(CBuffer *pkt, unsigned long version);
//-----PacketTcp_Handshake------------------------------------------------------
class CPacketTcp_Handshake : public CPacket
{
public:
virtual const unsigned short Sequence() { return 0; }
virtual const unsigned short SubSequence() { return 0; }
virtual const unsigned short Command() { return ICQ_CMDxTCP_HANDSHAKE; }
virtual const unsigned short SubCommand() { return 0; }
};
//-----PacketTcp_Handshake------------------------------------------------------
/* FF 03 00 00 00 3D 62 00 00 50 A5 82 00 CF 60 AD 95 CF 60 AD 95 04 3D 62
00 00 */
class CPacketTcp_Handshake_v2 : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_v2(unsigned long _nLocalPort);
protected:
unsigned long m_nLocalPort;
unsigned long m_nLocalHost;
};
class CPacketTcp_Handshake_v4 : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_v4(unsigned long _nLocalPort);
protected:
unsigned long m_nLocalPort;
unsigned long m_nLocalHost;
};
class CPacketTcp_Handshake_v6 : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_v6(unsigned long nDestinationUin,
unsigned long nSessionId, unsigned short nLocalPort = 0);
CPacketTcp_Handshake_v6(CBuffer *);
char Handshake() { return m_nHandshake; }
unsigned short VersionMajor() { return m_nVersionMajor; }
unsigned short VersionMinor() { return m_nVersionMinor; }
unsigned long DestinationUin() { return m_nDestinationUin; }
unsigned short LocalPort() { return m_nLocalPort; }
unsigned long SourceUin() { return m_nSourceUin; }
unsigned long LocalIp() { return m_nLocalIp; }
unsigned long RealIp() { return m_nRealIp; }
char Mode() { return m_nMode; }
unsigned long SessionId() { return m_nSessionId; }
protected:
char m_nHandshake;
unsigned short m_nVersionMajor;
unsigned short m_nVersionMinor;
unsigned long m_nDestinationUin;
unsigned long m_nSourceUin;
unsigned short m_nLocalPort;
unsigned long m_nLocalIp;
unsigned long m_nRealIp;
char m_nMode;
unsigned long m_nSessionId;
};
class CPacketTcp_Handshake_v7 : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_v7(unsigned long nDestinationUin,
unsigned long nSessionId, unsigned short nLocalPort = 0,
unsigned long nId = 0);
CPacketTcp_Handshake_v7(CBuffer *);
char Handshake() { return m_nHandshake; }
unsigned short VersionMajor() { return m_nVersionMajor; }
unsigned short VersionMinor() { return m_nVersionMinor; }
unsigned long DestinationUin() { return m_nDestinationUin; }
unsigned short LocalPort() { return m_nLocalPort; }
unsigned long SourceUin() { return m_nSourceUin; }
unsigned long LocalIp() { return m_nLocalIp; }
unsigned long RealIp() { return m_nRealIp; }
char Mode() { return m_nMode; }
unsigned long SessionId() { return m_nSessionId; }
unsigned long Id() { return m_nId; }
protected:
char m_nHandshake;
unsigned short m_nVersionMajor;
unsigned short m_nVersionMinor;
unsigned long m_nDestinationUin;
unsigned long m_nSourceUin;
unsigned short m_nLocalPort;
unsigned long m_nLocalIp;
unsigned long m_nRealIp;
char m_nMode;
unsigned long m_nSessionId;
unsigned long m_nId;
};
class CPacketTcp_Handshake_Ack : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_Ack();
};
class CPacketTcp_Handshake_Confirm : public CPacketTcp_Handshake
{
public:
CPacketTcp_Handshake_Confirm(unsigned char nChannel, unsigned short nSequence);
CPacketTcp_Handshake_Confirm(CBuffer *inbuf);
virtual const unsigned char Channel() { return m_nChannel; }
unsigned long Id() { return m_nId; }
protected:
unsigned char m_nChannel;
unsigned long m_nId;
};
//-----CPacketTcp---------------------------------------------------------------
class CPacketTcp : public CPacket
{
public:
virtual ~CPacketTcp();
virtual CBuffer *Finalize(INetSocket *);
virtual const unsigned short Sequence() { return m_nSequence; }
virtual const unsigned short SubSequence() { return 0; }
virtual const unsigned short Command() { return m_nCommand; }
virtual const unsigned short SubCommand() { return m_nSubCommand; }
char *LocalPortOffset() { return m_szLocalPortOffset; }
unsigned short Level() { return m_nLevel; }
unsigned short Version() { return m_nVersion; }
protected:
CPacketTcp(unsigned long _nCommand, unsigned short _nSubCommand,
const char *szMessage, bool _bAccept, unsigned short nLevel,
ICQUser *_cUser, size_t _nLen = 0);
void InitBuffer();
void PostBuffer();
void InitBuffer_v2();
void PostBuffer_v2();
void InitBuffer_v4();
void PostBuffer_v4();
void InitBuffer_v6();
void PostBuffer_v6();
void InitBuffer_v7();
void PostBuffer_v7();
unsigned long m_nSourceUin;
unsigned long m_nCommand;
unsigned short m_nSubCommand;
char *m_szMessage;
unsigned long m_nLocalPort;
unsigned short m_nStatus;
unsigned short m_nMsgType;
unsigned short m_nSequence;
bool m_bPluginReq;
size_t m_nMsgLen;
char *m_szLocalPortOffset;
unsigned short m_nLevel;
unsigned short m_nVersion;
};
//-----Message------------------------------------------------------------------
class CPT_Message : public CPacketTcp
{
public:
CPT_Message(char *_sMessage, unsigned short nLevel, bool bMR,
CICQColor *pColor, ICQUser *pUser, size_t nLen = 0);
};
//-----Url----------------------------------------------------------------------
/* BA 95 47 00 03 00 EE 07 00 00 BA 95 47 00 04 00 24 00 67 6F 6F 64 20 70 6F
72 6E 20 73 69 74 65 FE 68 74 74 70 3A 2F 2F 63 6F 6F 6C 70 6F 72 74 6E 2E
63 6F 6D 00 81 61 1D 9E 7F 00 00 01 3F 07 00 00 04 00 00 10 00 03 00 00 00 */
class CPT_Url : public CPacketTcp
{
public:
CPT_Url(char *_sMessage, unsigned short nLevel, bool bMR,
CICQColor *pColor, ICQUser *pUser);
};
class CPT_ContactList : public CPacketTcp
{
public:
CPT_ContactList(char *szMessage, unsigned short nLevel, bool bMR,
CICQColor *pColor, ICQUser *pUser);
};
//-----ReadAwayMessage----------------------------------------------------------
class CPT_ReadAwayMessage : public CPacketTcp
{
public:
CPT_ReadAwayMessage(ICQUser *_cUser);
/* 76 1E 3F 00 03 00 EE 07 00 00 76 1E 3F 00 E8 03 01 00 00 81 61 1D 9D 81 61
1D 9D C9 05 00 00 04 00 00 10 00 FE FF FF FF */
};
//-----ChatRequest--------------------------------------------------------------
/* 50 A5 82 00 03 00 EE 07 00 00 50 A5 82 00 02 00 0D 00 63 68 61 74 20 72
65 71 75 65 73 74 00 CF 60 AD D3 CF 60 AD D3 28 12 00 00 04 00 00 10 00
01 00 00 00 00 00 00 00 00 00 00 06 00 00 00 */
class CPT_ChatRequest : public CPacketTcp
{
public:
CPT_ChatRequest(char *_sMessage, const char *szChatUsers, unsigned short nPort,
unsigned short nLevel, ICQUser *pUser, bool bICBM);
};
//-----FileTransfer-------------------------------------------------------------
class CPT_FileTransfer : public CPacketTcp, public CPX_FileTransfer
{
public:
CPT_FileTransfer(ConstFileList &lFileList, const char *_szFilename,
const char *_szDescription, unsigned short nLevel, ICQUser *pUser);
const char *GetDescription() { return m_szMessage; }
protected:
/* 50 A5 82 00 03 00 EE 07 00 00 50 A5 82 00 03 00 0F 00 74 68 69 73 20 69
73 20 61 20 66 69 6C 65 00 CF 60 AD D3 CF 60 AD D3 60 12 00 00 04 00 00
10 00 00 00 00 00 09 00 4D 61 6B 65 66 69 6C 65 00 55 0C 00 00 00 00 00
00 04 00 00 00 */
};
//-----OpenSecureChannel------------------------------------------------------------
class CPT_OpenSecureChannel : public CPacketTcp
{
public:
CPT_OpenSecureChannel(ICQUser *pUser);
};
class CPT_CloseSecureChannel : public CPacketTcp
{
public:
CPT_CloseSecureChannel(ICQUser *pUser);
};
//++++Ack++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/* 50 A5 82 00 03 00 DA 07 00 00 50 A5 82 00 01 00 01 00 00 CF 60 AD D3 CF
60 AD D3 60 12 00 00 04 00 00 00 00 02 00 00 00 */
class CPT_Ack : public CPacketTcp
{
protected:
CPT_Ack(unsigned short _nSubCommand, unsigned short _nSequence,
bool _bAccept, bool _bUrgent, ICQUser *_cUser);
};
//-----AckGeneral------------------------------------------------------------
class CPT_AckGeneral : public CPT_Ack
{
public:
CPT_AckGeneral(unsigned short nSubCommand, unsigned short nSequence,
bool bAccept, bool bUrgent, ICQUser *pUser);
};
//-----AckKey------------------------------------------------------------
class CPT_AckOldSecureChannel : public CPT_Ack
{
public:
CPT_AckOldSecureChannel(unsigned short nSequence, ICQUser *pUser);
};
//-----AckKey------------------------------------------------------------
class CPT_AckOpenSecureChannel : public CPT_Ack
{
public:
CPT_AckOpenSecureChannel(unsigned short nSequence, bool ok, ICQUser *pUser);
};
//-----AckKey------------------------------------------------------------
class CPT_AckCloseSecureChannel : public CPT_Ack
{
public:
CPT_AckCloseSecureChannel(unsigned short nSequence, ICQUser *pUser);
};
#if 0
//-----AckMessage------------------------------------------------------------
class CPT_AckMessage : public CPT_Ack
{
public:
CPT_AckMessage(unsigned short _nSequence, bool _bAccept, bool _bUrgent, ICQUser *_cUser);
};
//-----AckReadAwayMessage-------------------------------------------------------
class CPT_AckReadAwayMessage : public CPT_Ack
{
public:
CPT_AckReadAwayMessage(unsigned short _nSubCommand, unsigned short _nSequence,
bool _bAccept, ICQUser *_cUser);
};
//-----AckUrl-------------------------------------------------------------------
class CPT_AckUrl : public CPT_Ack
{
public:
CPT_AckUrl(unsigned short _nSequence, bool _bAccept, bool _bUrgent, ICQUser *_cUser);
};
//-----AckContactList----------------------------------------------------------
class CPT_AckContactList : public CPT_Ack
{
public:
CPT_AckContactList(unsigned short _nSequence, bool _bAccept, bool _bUrgent,
ICQUser *_cUser);
};
#endif
//-----AckChatRefuse------------------------------------------------------------
class CPT_AckChatRefuse : public CPT_Ack
{
public:
CPT_AckChatRefuse(const char *_sReason, unsigned short _nSequence, ICQUser *_cUser);
/* 50 A5 82 00 03 00 DA 07 00 00 50 A5 82 00 02 00 03 00 6E 6F 00 CF 60 AD
95 CF 60 AD 95 1E 3C 00 00 04 01 00 00 00 01 00 00 00 00 00 00 00 00 00
00 01 00 00 00 */
};
//-----AckChatAccept------------------------------------------------------------
class CPT_AckChatAccept : public CPT_Ack
{
public:
CPT_AckChatAccept(unsigned short _nPort, const char *szClients,
unsigned short _nSequence, ICQUser *_cUser, bool bICBM);
/* 50 A5 82 00 03 00 DA 07 00 00 50 A5 82 00 02 00 01 00 00 CF 60 AD 95 CF
60 AD 95 1E 3C 00 00 04 00 00 00 00 01 00 00 40 78 00 00 78 40 00 00 02
00 00 00 */
unsigned long m_nPort;
};
//-----AckFileAccept------------------------------------------------------------
class CPT_AckFileAccept : public CPT_Ack
{
public:
CPT_AckFileAccept(unsigned short _nPort, unsigned short _nSequence,
ICQUser *_cUser);
protected:
/* 50 A5 82 00 03 00 DA 07 00 00 50 A5 82 00 03 00 01 00 00 D1 EF 04 9F 7F
00 00 01 4A 1F 00 00 04 00 00 00 00 20 3A 00 00 01 00 00 00 00 00 00 3A
20 00 00 05 00 00 00 */
unsigned long m_nFileSize; // not used in the ack
unsigned long m_nPort;
};
//-----AckFileRefuse------------------------------------------------------------
class CPT_AckFileRefuse : public CPT_Ack
{
public:
CPT_AckFileRefuse(const char *_sReason, unsigned short _nSequence, ICQUser *_cUser);
protected:
/* 50 A5 82 00 03 00 DA 07 00 00 50 A5 82 00 03 00 0A 00 6E 6F 20 74 68 61
6E 6B 73 00 D1 EF 04 9F 7F 00 00 01 4A 1F 00 00 04 01 00 00 00 00 00 00
00 01 00 00 00 00 00 00 00 00 00 00 03 00 00 00 */
};
//++++Cancel++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class CPT_Cancel : public CPacketTcp
{
protected:
CPT_Cancel(unsigned short _nSubCommand, unsigned short _nSequence,
ICQUser *_cUser);
};
//-----ChatCancel---------------------------------------------------------------
class CPT_CancelChat : public CPT_Cancel
{
public:
CPT_CancelChat(unsigned short _nSequence, ICQUser *_cUser);
/* 50 A5 82 00 03 00 D0 07 00 00 50 A5 82 00 02 00 01 00 00 CF 60 AD D3 CF
60 AD D3 28 12 00 00 04 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 06
00 00 00 */
};
//-----FileCancel---------------------------------------------------------------
class CPT_CancelFile : public CPT_Cancel
{
public:
CPT_CancelFile(unsigned short _nSequence, ICQUser *_cUser);
/* 50 A5 82 00 03 00 D0 07 00 00 50 A5 82 00 02 00 01 00 00 CF 60 AD D3 CF
60 AD D3 28 12 00 00 04 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 06
00 00 00 */
};
//----Send error reply----------------------------------------------------------
class CPT_PluginError : public CPacketTcp
{
public:
CPT_PluginError(ICQUser *_cUser, unsigned short nSequence,
unsigned char nChannel);
virtual const unsigned char Channel() { return m_nChannel; }
protected:
unsigned char m_nChannel;
};
//----Request info plugin list--------------------------------------------------
class CPT_InfoPluginReq : public CPacketTcp
{
public:
CPT_InfoPluginReq(ICQUser *_cUser, const char *GUID, unsigned long int nTime);
virtual const unsigned char Channel() { return ICQ_CHNxINFO; }
virtual const char *RequestGUID() { return m_ReqGUID; }
virtual const unsigned short ExtraInfo() { return DirectInfoPluginRequest; }
protected:
char m_ReqGUID[GUID_LENGTH];
};
//----Response to phone book request--------------------------------------------
class CPT_InfoPhoneBookResp : public CPacketTcp
{
public:
CPT_InfoPhoneBookResp(ICQUser *_cUser, unsigned short nSequence);
virtual const unsigned char Channel() { return ICQ_CHNxINFO; }
};
//-----Response to picture request----------------------------------------------
class CPT_InfoPictureResp : public CPacketTcp
{
public:
CPT_InfoPictureResp(ICQUser *_cUser, unsigned short nSequence);
virtual const unsigned char Channel() { return ICQ_CHNxINFO; }
};
//----Response to info plugin list request--------------------------------------
class CPT_InfoPluginListResp : public CPacketTcp
{
public:
CPT_InfoPluginListResp(ICQUser *_cUser, unsigned short nSequence);
virtual const unsigned char Channel() { return ICQ_CHNxINFO; }
};
//----Send status plugin request------------------------------------------------
class CPT_StatusPluginReq : public CPacketTcp
{
public:
CPT_StatusPluginReq(ICQUser *_cUser, const char *GUID, unsigned long nTime);
virtual const unsigned char Channel() { return ICQ_CHNxSTATUS; }
virtual const unsigned short ExtraInfo() { return DirectStatusPluginRequest;}
virtual const char *RequestGUID() { return m_ReqGUID; }
protected:
char m_ReqGUID[GUID_LENGTH];
};
//----Response to status plugin list request------------------------------------
class CPT_StatusPluginListResp : public CPacketTcp
{
public:
CPT_StatusPluginListResp(ICQUser *_cUser, unsigned short nSequence);
virtual const unsigned char Channel() { return ICQ_CHNxSTATUS; }
};
//----Response to status request------------------------------------------------
class CPT_StatusPluginResp : public CPacketTcp
{
public:
CPT_StatusPluginResp(ICQUser *_cUser, unsigned short nSequence,
unsigned long nStatus);
virtual const unsigned char Channel() { return ICQ_CHNxSTATUS; }
};
#endif
|