Wireshark-dev: [Wireshark-dev] [patch] YMSG dissector update

From: Gena01 <gena01@xxxxxxxxx>
Date: Thu, 14 Sep 2006 16:07:59 -0400
I am Yahoo plugin developer for Miranda IM  http://www.miranda-im.org

I have put together a patch for YMSG packet dissector. This is based on my own code and service lists (this should match Gaim and Kopete service lists). This new code should bring the code up to par to most of the known services. Which should cover up to Yahoo 7.x or most of it.

I have also setup a new set of constants which are specific to YMSG packets. These are the types that I've seen in miranda network logs and they should reveal more information. The other constants are mostly for buddy statuses and need nor apply to the YMSG header.  I have left them in the code (for now). These constants are currently used in my own code.

P.S. I haven't touched the copyright or author pieces, since I am not sure how those should be updated.

Thank you,

G.F. aka Gena01


Index: packet-ymsg.c
===================================================================
--- packet-ymsg.c	(revision 19230)
+++ packet-ymsg.c	(working copy)
@@ -145,14 +145,29 @@
 	YAHOO_SERVICE_CHATLOGOUT = 0xa0,
 	YAHOO_SERVICE_CHATPING,
 	YAHOO_SERVICE_COMMENT = 0xa8,
+	YAHOO_SERVICE_GAME_INVITE = 0xb7,
+	YAHOO_SERVICE_STEALTH_PERM = 0xb9,
+	YAHOO_SERVICE_STEALTH_SESSION = 0xba,
 	YAHOO_SERVICE_AVATAR = 0xbc,
 	YAHOO_SERVICE_PICTURE_CHECKSUM = 0xbd,
 	YAHOO_SERVICE_PICTURE = 0xbe,
 	YAHOO_SERVICE_PICTURE_UPDATE = 0xc1,
 	YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2,
-	YAHOO_SERVICE_YAHOO6_STATUS_UPDATE = 0xc6,
-	YAHOO_SERVICE_AVATAR_UPDATE = 0xc7,
+	YAHOO_SERVICE_YAB_UPDATE = 0xc4,
+	YAHOO_SERVICE_Y6_VISIBLE_TOGGLE = 0xc5, /* YMSG13, key 13: 2 = invisible, 1 = visible */
+	YAHOO_SERVICE_Y6_STATUS_UPDATE = 0xc6,  /* YMSG13 */
+	YAHOO_SERVICE_PICTURE_STATUS = 0xc7,	/* YMSG13, key 213: 0 = none, 1 = avatar, 2 = picture */
+	YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8,
 	YAHOO_SERVICE_AUDIBLE = 0xd0,
+	YAHOO_SERVICE_Y7_PHOTO_SHARING = 0xd2,
+	YAHOO_SERVICE_Y7_CONTACT_DETAILS = 0xd3,/* YMSG13 */
+	YAHOO_SERVICE_Y7_CHAT_SESSION = 0xd4,	
+	YAHOO_SERVICE_Y7_AUTHORIZATION = 0xd6,	/* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFER = 0xdc,	/* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFERINFO,	/* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFERACCEPT,	/* YMSG13 */
+	YAHOO_SERVICE_Y7_MINGLE = 0xe1, /* YMSG13 */
+	YAHOO_SERVICE_Y7_CHANGE_GROUP = 0xe7, /* YMSG13 */
 	YAHOO_SERVICE_WEBLOGIN = 0x0226,
 	YAHOO_SERVICE_SMS_MSG = 0x02ea
 };
@@ -177,6 +192,17 @@
         YAHOO_STATUS_TYPING = 0x16
 };
 
+enum ypacket_status {
+	YPACKET_STATUS_DISCONNECTED = -1,
+	YPACKET_STATUS_DEFAULT = 0,
+	YPACKET_STATUS_SERVERACK = 1,
+	YPACKET_STATUS_GAME	= 0x2,
+	YPACKET_STATUS_CONTINUED = 0x5,
+	YPACKET_STATUS_INVISIBLE = 12,
+	YPACKET_STATUS_NOTIFY = 0x16, /* TYPING */
+	YPACKET_STATUS_WEBLOGIN = 0x5a55aa55
+};
+
 struct yahoo_rawpacket
 {
 	char ymsg[4];			/* Packet identification string (YMSG) */
@@ -247,36 +273,40 @@
 	{YAHOO_SERVICE_CHATLOGOUT, "YAHOO_SERVICE_CHATLOGOUT"},
 	{YAHOO_SERVICE_CHATPING, "YAHOO_SERVICE_CHATPING"},
 	{YAHOO_SERVICE_COMMENT, "YAHOO_SERVICE_COMMENT"},
+	{YAHOO_SERVICE_GAME_INVITE,"YAHOO_SERVICE_GAME_INVITE "},
+	{YAHOO_SERVICE_STEALTH_PERM, "YAHOO_SERVICE_STEALTH_PERM"},
+	{YAHOO_SERVICE_STEALTH_SESSION, "YAHOO_SERVICE_STEALTH_SESSION"},
 	{YAHOO_SERVICE_AVATAR, "YAHOO_SERVICE_AVATAR"},
 	{YAHOO_SERVICE_PICTURE_CHECKSUM, "YAHOO_SERVICE_PICTURE_CHECKSUM"},
 	{YAHOO_SERVICE_PICTURE, "YAHOO_SERVICE_PICTURE"},
 	{YAHOO_SERVICE_PICTURE_UPDATE, "YAHOO_SERVICE_PICTURE_UPDATE"},
 	{YAHOO_SERVICE_PICTURE_UPLOAD, "YAHOO_SERVICE_PICTURE_UPLOAD"},
-	{YAHOO_SERVICE_YAHOO6_STATUS_UPDATE, "YAHOO_SERVICE_YAHOO6_STATUS_UPDATE"},
-	{YAHOO_SERVICE_AVATAR_UPDATE, "YAHOO_SERVICE_AVATAR_UPDATE"},
+	{YAHOO_SERVICE_YAB_UPDATE,"YAHOO_SERVICE_YAB_UPDATE"},
+	{YAHOO_SERVICE_Y6_VISIBLE_TOGGLE, "YAHOO_SERVICE_Y6_VISIBLE_TOGGLE"},
+	{YAHOO_SERVICE_Y6_STATUS_UPDATE, "YAHOO_SERVICE_Y6_STATUS_UPDATE"},
+	{YAHOO_SERVICE_PICTURE_STATUS, "YAHOO_SERVICE_PICTURE_STATUS"},
+	{YAHOO_SERVICE_VERIFY_ID_EXISTS, "YAHOO_SERVICE_VERIFY_ID_EXISTS"},
 	{YAHOO_SERVICE_AUDIBLE, "YAHOO_SERVICE_AUDIBLE"},
+	{YAHOO_SERVICE_Y7_CONTACT_DETAILS,"YAHOO_SERVICE_Y7_CONTACT_DETAILS"},
+	{YAHOO_SERVICE_Y7_CHAT_SESSION,	"YAHOO_SERVICE_Y7_CHAT_SESSION"},
+	{YAHOO_SERVICE_Y7_AUTHORIZATION,"YAHOO_SERVICE_Y7_AUTHORIZATION"},
+	{YAHOO_SERVICE_Y7_FILETRANSFER,"YAHOO_SERVICE_Y7_FILETRANSFER"},
+	{YAHOO_SERVICE_Y7_FILETRANSFERINFO,"YAHOO_SERVICE_Y7_FILETRANSFERINFO"},
+	{YAHOO_SERVICE_Y7_FILETRANSFERACCEPT,"YAHOO_SERVICE_Y7_FILETRANSFERACCEPT"},
+	{YAHOO_SERVICE_Y7_CHANGE_GROUP, "YAHOO_SERVICE_Y7_CHANGE_GROUP"},
 	{YAHOO_SERVICE_WEBLOGIN, "YAHOO_SERVICE_WEBLOGIN"},
 	{YAHOO_SERVICE_SMS_MSG, "YAHOO_SERVICE_SMS_MSG"},
 	{0, NULL}
 };
 
 static const value_string ymsg_status_vals[] = {
-	{YAHOO_STATUS_AVAILABLE, "YAHOO_STATUS_AVAILABLE"},
-	{YAHOO_STATUS_BRB, "YAHOO_STATUS_BRB"},
-	{YAHOO_STATUS_BUSY, "YAHOO_STATUS_BUSY"},
-	{YAHOO_STATUS_NOTATHOME, "YAHOO_STATUS_NOTATHOME"},
-	{YAHOO_STATUS_NOTATDESK, "YAHOO_STATUS_NOTATDESK"},
-	{YAHOO_STATUS_NOTINOFFICE, "YAHOO_STATUS_NOTINOFFICE"},
-	{YAHOO_STATUS_ONPHONE, "YAHOO_STATUS_ONPHONE"},
-	{YAHOO_STATUS_ONVACATION, "YAHOO_STATUS_ONVACATION"},
-	{YAHOO_STATUS_OUTTOLUNCH, "YAHOO_STATUS_OUTTOLUNCH"},
-	{YAHOO_STATUS_STEPPEDOUT, "YAHOO_STATUS_STEPPEDOUT"},
-	{YAHOO_STATUS_INVISIBLE, "YAHOO_STATUS_INVISIBLE"},
-	{YAHOO_STATUS_CUSTOM, "YAHOO_STATUS_CUSTOM"},
-	{YAHOO_STATUS_IDLE, "YAHOO_STATUS_IDLE"},
-	{YAHOO_STATUS_WEBLOGIN, "YAHOO_STATUS_WEBLOGIN"},
-	{YAHOO_STATUS_OFFLINE, "YAHOO_STATUS_OFFLINE"},
-	{YAHOO_STATUS_TYPING, "YAHOO_STATUS_TYPING"},
+	{YPACKET_STATUS_DISCONNECTED,"Disconnected"},
+	{YPACKET_STATUS_DEFAULT,""},
+	{YPACKET_STATUS_SERVERACK,"Server Ack"},
+	{YPACKET_STATUS_GAME,"Playing Game"},
+	{YPACKET_STATUS_CONTINUED,"More Packets??"},
+	{YPACKET_STATUS_NOTIFY, "Notify"},
+	{YPACKET_STATUS_WEBLOGIN,"Web Login"},
 	{0, NULL}
 };