Use "tvb_get_ntohieee_float()" to fetch floating-point numbers.
[obnox/wireshark/wip.git] / packet-wap.h
1 /* packet-wap.h
2  *
3  * Declarations for WAP packet disassembly
4  *
5  * $Id: packet-wap.h,v 1.7 2002/01/21 07:36:44 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * WAP dissector based on original work by Ben Fowler
12  * Updated by Neil Hunter <neil.hunter@energis-squared.com>
13  * WTLS support by Alexandre P. Ferreira (Splice IP)
14  * 
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  * 
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  * 
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28  */
29
30 #ifndef __PACKET_WAP_H__
31 #define __PACKET_WAP_H__
32
33 #include <glib.h>
34 #include <epan/packet.h>
35
36 /* Port Numbers as per IANA */
37 /* < URL:http://www.isi.edu/in-notes/iana/assignments/port-numbers/ > */
38 #define UDP_PORT_WSP                    9200            /* wap-wsp                      */
39 #define UDP_PORT_WTP_WSP                9201            /* wap-wsp-wtp          */
40 #define UDP_PORT_WTLS_WSP               9202            /* wap-wsp-s            */
41 #define UDP_PORT_WTLS_WTP_WSP           9203            /* wap-wsp-wtp-s        */
42 #define UDP_PORT_WSP_PUSH               2948            /* wap-wsp              */
43 #define UDP_PORT_WTLS_WSP_PUSH          2949            /* wap-wsp-s            */
44
45 /*
46  * Note:
47  *   There are four dissectors for the WAP protocol:
48  *     WTLS
49  *     WTP
50  *     WSP
51  *     WMLC
52  *   Which of these are necessary is determined by the port number above.
53  *   I.e. port 9200 (wap-wsp) indicates WSP data and possibly WMLC (depending on
54  *   the WSP PDU).
55  *   Port 9203 (wap-wsp-wtp-s), on the other hand, has WTLS, WTP, WSP and
56  *   possibly WMLC data in that order in the packet.
57  *
58  *   Therefore the dissectors are chained as follows:
59  *
60  *   Port        Dissectors
61  *   9200                     WSP  ->  WMLC
62  *   9201            WTP  ->  WSP  ->  WMLC
63  *   9202  WTLS  ->           WSP  ->  WMLC
64  *   9203  WTLS  ->  WTP  ->  WSP  ->  WMLC
65  *
66  *   2948                     WSP  ->  WMLC (Push)
67  *   2949  WTLS  ->           WSP  ->  WMLC (Push)
68  *
69  *   At present, only the unencrypted parts of WTLS can be analysed. Therefore
70  *   the WTP and WSP dissectors are not called.
71  */
72
73 #define HF_EMPTY        ( -1 )
74 #define ETT_EMPTY       ( -1 )
75
76 enum
77 {
78         bo_big_endian           = 0,
79         bo_little_endian        = 1
80 };
81
82 /* Utility function for reading Uintvar encoded values */
83 guint tvb_get_guintvar (tvbuff_t *, guint , guint *);
84
85 /* Character set encoding */
86 extern const value_string vals_character_sets[];
87
88 /*
89  * Misc TODO:
90  *
91  * WMLC Dissector
92  * Check Protocol display
93  * Check Protocol information display
94  * Check CONNECT/CONNECT REPLY headers
95  * Check add_headers code
96  * Check Content-Length code
97  * 
98  */
99
100 #endif /* packet-wap.h */