- struct aim_tool_version tools[] = {
- {0x0001, 0x0003, AIM_TOOL_WIN32, 0x0686},
- {0x0002, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x0003, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x0004, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x0006, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x0008, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x0009, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x000a, 0x0001, AIM_TOOL_WIN32, 0x0001},
- {0x000b, 0x0001, AIM_TOOL_WIN32, 0x0001}
- };
- int i,j;
- struct command_tx_struct *newpacket;
- int toolcount = sizeof(tools)/sizeof(struct aim_tool_version);
-
- if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 1152)))
- return -1;
-
- newpacket->lock = 1;
-
- i = aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
- aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
-
- for (j = 0; j < toolcount; j++) {
- i += aimutil_put16(newpacket->data+i, tools[j].group);
- i += aimutil_put16(newpacket->data+i, tools[j].version);
- i += aimutil_put16(newpacket->data+i, tools[j].tool);
- i += aimutil_put16(newpacket->data+i, tools[j].toolversion);
- }
-
- newpacket->commandlen = i;
- newpacket->lock = 0;
-
- aim_tx_enqueue(sess, newpacket);
-
- return sess->snac_nextid;
+ struct aim_tool_version tools[] = {
+ {0x0001, 0x0003, AIM_TOOL_WIN32, 0x0686},
+ {0x0002, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0003, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0004, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0006, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0008, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x0009, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x000a, 0x0001, AIM_TOOL_WIN32, 0x0001},
+ {0x000b, 0x0001, AIM_TOOL_WIN32, 0x0001}
+ };
+ int j;
+ aim_frame_t *fr;
+ aim_snacid_t snacid;
+ int toolcount = sizeof(tools)/sizeof(struct aim_tool_version);
+
+ if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152)))
+ return -ENOMEM;
+
+ snacid = aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
+ aim_putsnac(&fr->data, 0x0001, 0x0002, 0x0000, snacid);
+
+ for (j = 0; j < toolcount; j++) {
+ aimbs_put16(&fr->data, tools[j].group);
+ aimbs_put16(&fr->data, tools[j].version);
+ aimbs_put16(&fr->data, tools[j].tool);
+ aimbs_put16(&fr->data, tools[j].toolversion);
+ }
+
+ aim_tx_enqueue(sess, fr);
+
+ return 0;