1 /* irda-appl.h
2  * Interface for IrDA application dissectors
3  * By Jan Kiszka <jan.kiszka@web.de>
4  * Copyright 2003 Jan Kiszka
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@unicom.net>
8  * Copyright 1998 Gerald Combs
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  */
12 
13 
14 #ifndef __IRDA_APPL_H__
15 #define __IRDA_APPL_H__
16 
17 /*
18  * Prototypes, defines, and typedefs needed for implementing IrDA application
19  * layer dissectors.
20  * There should be no need to modify this part.
21  */
22 
23 /* LM-IAS Attribute types */
24 #define IAS_MISSING         0
25 #define IAS_INTEGER         1
26 #define IAS_OCT_SEQ         2
27 #define IAS_STRING          3
28 
29 /* Maximum number of handled list entries of an IAP result */
30 #define MAX_IAP_ENTRIES     32
31 
32 
33 typedef enum {
34     CONNECT_PDU,
35     DISCONNECT_PDU,
36     DATA_PDU
37 } pdu_type_t;
38 
39 typedef gboolean (*ias_value_dissector_t)(tvbuff_t* tvb, guint offset, packet_info* pinfo, proto_tree* tree,
40                                           guint list_index, guint8 attr_type, guint8 circuit_id);
41 
42 typedef const struct ias_attr_dissector {
43     const char*             attr_name;
44     ias_value_dissector_t   value_dissector;
45 } ias_attr_dissector_t;
46 
47 typedef const struct ias_class_dissector {
48     const char*             class_name;
49     ias_attr_dissector_t*   pattr_dissector;
50 } ias_class_dissector_t;
51 
52 
53 extern gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, guint offset,
54                                        const char* attr_name, guint8 attr_type);
55 extern guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, guint offset,
56                                     const char* attr_name, guint8 attr_type);
57 
58 extern void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissector_handle_t dissector, guint8 circuit_id);
59 
60 extern unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, guint offset);
61 
62 /*
63  * Protocol exports.
64  * Modify the lines below to add new protocols.
65  */
66 
67 /* IrCOMM/IrLPT protocol */
68 extern void proto_register_ircomm(void);
69 extern ias_attr_dissector_t ircomm_attr_dissector[];
70 extern ias_attr_dissector_t irlpt_attr_dissector[];
71 
72 /* Serial Infrared (SIR) */
73 extern void proto_register_irsir(void);
74 
75 
76 /*
77  * Protocol hooks
78  */
79 
80 /* IAS class dissectors */
81 #define CLASS_DISSECTORS                                    \
82     { "Device",         device_attr_dissector },            \
83     { "IrDA:IrCOMM",    ircomm_attr_dissector },            \
84     { "IrLPT",          irlpt_attr_dissector },             \
85     { NULL,             NULL }
86 
87 #endif /* __IRDA_APPL_H__ */
88