summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-raknet.h
blob: 9534534350915d998a9ea849998dc3f3897f324d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* packet-raknet.h
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __PACKET_RAKNET_H__
#define __PACKET_RAKNET_H__

#include <epan/packet.h>
#include "ws_symbol_export.h"

/*
 * Different protocols (i.e. games) use different set of message IDs,
 * and we can't infer protocols from message ID because there is no
 * central registry. So the only thing we can do is to use port number
 * or heuristics to determine the protocol.
 *
 * If your protocol has a fixed port number, you can register it with
 * this function. The registered dissector will be called with a tvb
 * buffer which contains a RakNet message including message ID at its
 * first octet. Header analysis, packet reassembly, and RakNet system
 * messages are all handled by the RakNet dissector so you don't need
 * to worry about them.
 */
WS_DLL_PUBLIC
void
raknet_add_udp_dissector(guint32 port, const dissector_handle_t handle);

/*
 * Opposite of "raknet_add_udp_dissector()".
 */
WS_DLL_PUBLIC
void
raknet_delete_udp_dissector(guint32 port, const dissector_handle_t handle);

/*
 * You can also register a heuristic dissector for your protocol with
 * the standard "heur_dissector_add()" function with parent protocol
 * "raknet". Protocols with no fixed port are especially encouraged to
 * do so. Once your heuristic dissector finds that the protocol of the
 * conversation is indeed yours, call this function to skip further
 * heuristics. DO NOT USE the standard "conversation_set_dissector()".
 */
WS_DLL_PUBLIC
void
raknet_conversation_set_dissector(packet_info *pinfo, const dissector_handle_t handle);

#endif /* __PACKET_RAKNET_H__ */