2 * Routines for AIM Instant Messenger (OSCAR) dissection
3 * Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
5 * $Id: packet-aim-chatnav.c,v 1.4 2004/04/20 04:48:31 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
37 #include <epan/packet.h>
38 #include <epan/strutil.h>
40 #include "packet-aim.h"
42 #define FAMILY_CHAT_NAV 0x000D
44 /* Family Chat Navigation */
45 #define FAMILY_CHATNAV_ERROR 0x0001
46 #define FAMILY_CHATNAV_LIMITS_REQ 0x0002
47 #define FAMILY_CHATNAV_EXCHANGE_REQ 0x0003
48 #define FAMILY_CHATNAV_ROOM_INFO_REQ 0x0004
49 #define FAMILY_CHATNAV_ROOMIF_EXT_REQ 0x0005
50 #define FAMILY_CHATNAV_MEMBERLIST_REQ 0x0006
51 #define FAMILY_CHATNAV_SEARCH_ROOM 0x0007
52 #define FAMILY_CHATNAV_CREATE_ROOM 0x0008
53 #define FAMILY_CHATNAV_INFO_REPLY 0x0009
54 #define FAMILY_CHATNAV_DEFAULT 0xffff
56 static const value_string aim_fnac_family_chatnav[] = {
57 { FAMILY_CHATNAV_ERROR, "Error" },
58 { FAMILY_CHATNAV_LIMITS_REQ, "Request Limits" },
59 { FAMILY_CHATNAV_EXCHANGE_REQ, "Request Exchange" },
60 { FAMILY_CHATNAV_ROOM_INFO_REQ, "Request Room Information" },
61 { FAMILY_CHATNAV_ROOMIF_EXT_REQ, "Request Extended Room Information" },
62 { FAMILY_CHATNAV_MEMBERLIST_REQ, "Request Member List" },
63 { FAMILY_CHATNAV_SEARCH_ROOM, "Search Room" },
64 { FAMILY_CHATNAV_CREATE_ROOM, "Create" },
65 { FAMILY_CHATNAV_INFO_REPLY, "Info" },
66 { FAMILY_CHATNAV_DEFAULT, "ChatNav Default" },
70 /* Initialize the protocol and registered fields */
71 static int proto_aim_chatnav = -1;
73 int ett_aim_chatnav = -1;
75 static int dissect_aim_chatnav(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
77 struct aiminfo *aiminfo = pinfo->private_data;
80 proto_tree *chatnav_tree = NULL;
83 ti = proto_tree_add_text(tree, tvb, 0, -1, "Chat Navigation Service");
84 chatnav_tree = proto_item_add_subtree(ti, ett_aim_chatnav);
87 switch(aiminfo->subtype) {
88 case FAMILY_CHATNAV_ERROR:
89 return dissect_aim_snac_error(tvb, pinfo, 0, chatnav_tree);
90 case FAMILY_CHATNAV_LIMITS_REQ:
93 case FAMILY_CHATNAV_EXCHANGE_REQ:
94 case FAMILY_CHATNAV_ROOM_INFO_REQ:
95 case FAMILY_CHATNAV_ROOMIF_EXT_REQ:
96 case FAMILY_CHATNAV_MEMBERLIST_REQ:
97 case FAMILY_CHATNAV_SEARCH_ROOM:
98 case FAMILY_CHATNAV_CREATE_ROOM:
99 case FAMILY_CHATNAV_INFO_REPLY:
100 case FAMILY_CHATNAV_DEFAULT:
107 /* Register the protocol with Ethereal */
109 proto_register_aim_chatnav(void)
112 /* Setup list of header fields */
114 static hf_register_info hf[] = {
117 /* Setup protocol subtree array */
118 static gint *ett[] = {
121 /* Register the protocol name and description */
122 proto_aim_chatnav = proto_register_protocol("AIM Chat Navigation", "AIM ChatNav", "aim_chatnav");
124 /* Required function calls to register the header fields and subtrees used */
126 proto_register_field_array(proto_aim_chatnav, hf, array_length(hf));*/
127 proto_register_subtree_array(ett, array_length(ett));
131 proto_reg_handoff_aim_chatnav(void)
133 dissector_handle_t aim_handle;
135 aim_handle = new_create_dissector_handle(dissect_aim_chatnav, proto_aim_chatnav);
136 dissector_add("aim.family", FAMILY_CHAT_NAV, aim_handle);
138 aim_init_family(FAMILY_CHAT_NAV, "Chat Navigation", aim_fnac_family_chatnav);