Update Free Software Foundation address.
[metze/wireshark/wip.git] / epan / dissectors / packet-aim.h
1 /* packet-aim.h
2  * Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24
25 #ifndef __PACKET_AIM_H__
26 #define __PACKET_AIM_H__
27
28 /* For e_uuid_t */
29 #include "packet-dcerpc.h"
30
31 #define MAX_BUDDYNAME_LENGTH 30
32
33 typedef struct _aim_tlv {
34   guint16 valueid;
35   const char *desc;
36   int (*dissector) (proto_item *ti, guint16 value_id, tvbuff_t *tvb, packet_info *);
37 } aim_tlv;
38
39 struct aiminfo {
40   guint16 family;
41   guint16 subtype;
42   struct tcpinfo *tcpinfo;
43 };
44
45 typedef struct _aim_subtype {
46         guint16 id;
47         const char *name;
48         int (*dissector) (tvbuff_t *, packet_info *, proto_tree *);
49 } aim_subtype;
50
51 typedef struct _aim_family {
52         int ett;
53         int proto_id;
54         protocol_t *proto;
55         guint16 family;
56         const char *name;
57         const aim_subtype *subtypes;
58 } aim_family;
59
60 void aim_init_family(int proto, int ett, guint16 family, const aim_subtype *subtypes);
61
62 int dissect_aim_buddyname(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
63 void aim_get_message( guchar *msg, tvbuff_t *tvb, int msg_offset, int msg_length);
64 int aim_get_buddyname( guchar *name, tvbuff_t *tvb, int len_offset, int name_offset);
65 int dissect_aim_userinfo(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree);
66
67 int dissect_aim_snac_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aim_tree);
68
69 int dissect_aim_ssi_result(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aim_tree);
70
71 int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
72 int dissect_aim_tlv_list(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
73 int dissect_aim_tlv_sequence(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, const aim_tlv *);
74
75 const aim_family *aim_get_family( guint16 family );
76 const aim_subtype *aim_get_subtype( guint16 family, guint16 subtype);
77
78 int dissect_aim_tlv_value_string(proto_item *ti, guint16, tvbuff_t *, packet_info *);
79 int dissect_aim_tlv_value_string08_array(proto_item *ti, guint16, tvbuff_t *, packet_info *);
80 int dissect_aim_tlv_value_uint8(proto_item *ti, guint16, tvbuff_t *, packet_info *);
81 int dissect_aim_tlv_value_uint16(proto_item *ti, guint16, tvbuff_t *, packet_info *);
82 int dissect_aim_tlv_value_uint32(proto_item *ti, guint16, tvbuff_t *, packet_info *);
83 int dissect_aim_tlv_value_bytes(proto_item *ti, guint16, tvbuff_t *, packet_info *);
84 int dissect_aim_tlv_value_ipv4(proto_item *ti, guint16, tvbuff_t *, packet_info *);
85 int dissect_aim_tlv_value_time(proto_item *ti, guint16, tvbuff_t *, packet_info *);
86 int dissect_aim_tlv_value_client_capabilities(proto_item *ti, guint16, tvbuff_t *, packet_info *);
87 int dissect_aim_capability(proto_tree *entry, tvbuff_t *tvb, int offset);
88 int dissect_aim_userclass(tvbuff_t *tvb, int offset, int len, proto_item *ti, guint32 flags);
89 int dissect_aim_tlv_value_userclass(proto_item *ti, guint16, tvbuff_t *, packet_info *);
90 int dissect_aim_tlv_value_messageblock (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, packet_info *);
91
92 extern const aim_tlv aim_client_tlvs[];
93 extern const aim_tlv aim_onlinebuddy_tlvs[];
94 extern const aim_tlv aim_motd_tlvs[];
95
96 #endif