Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-btmesh.h
1 /* packet-btmesh.h
2  * Structures for determining the dissection context for Bluetooth mesh.
3  *
4  * Copyright 2019, Piotr Winiarczyk <wino45@gmail.com>
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  */
12 #ifndef __PACKET_BTMESH_H__
13 #define __PACKET_BTMESH_H__
14 
15 #include <epan/packet.h>
16 
17 #define BTMESH_NONCE_TYPE_NETWORK 0x00
18 #define BTMESH_NONCE_TYPE_APPLICATION 0x01
19 #define BTMESH_NONCE_TYPE_DEVICE 0x02
20 #define BTMESH_NONCE_TYPE_PROXY 0x03
21 
22 #define BTMESH_ADDRESS_UNASSIGNED 0x00
23 #define BTMESH_ADDRESS_UNICAST 0x01
24 #define BTMESH_ADDRESS_VIRTUAL 0x02
25 #define BTMESH_ADDRESS_GROUP 0x03
26 
27 typedef enum {
28  E_BTMESH_TR_UNKNOWN = 0,
29  E_BTMESH_TR_ADV,
30  E_BTMESH_TR_PB_ADV,
31  E_BTMESH_TR_PROXY
32 } btle_mesh_tr_t;
33 
34 typedef enum {
35  E_BTMESH_PROXY_SIDE_UNKNOWN = 0,
36  E_BTMESH_PROXY_SIDE_SERVER,
37  E_BTMESH_PROXY_SIDE_CLIENT,
38  E_BTMESH_PROXY_SIDE_LAST
39 } btle_mesh_proxy_side_t;
40 
41 typedef struct {
42  btle_mesh_tr_t transport;
43  gboolean fragmented;
44  guint segment_index;
46 
47 typedef struct {
48  guint32 interface_id;
49  guint32 adapter_id;
50  guint16 chandle;
51  guint16 bt_uuid;
52  guint32 access_address;
53  btle_mesh_proxy_side_t proxy_side;
55 
56 typedef struct {
57  /* Network Layer */
58  guint32 src;
59  guint32 seq;
60  guint8 seq_src_buf[5];
61  guint8 ivindex_buf[4];
62  guint8 net_nonce_type;
63  guint32 net_key_iv_index_hash;
64 
65  /* Transport layer */
66  guint32 dst;
67  guint8 dst_buf[2];
68  gint32 label_uuid_idx;
69  guint32 seg; /* Segmentation */
70  guint8 aid;
71  guint8 app_nonce_type;
72  guint32 seqzero;
73  int transmic_size;
75 
76 tvbuff_t *btmesh_network_find_key_and_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint8 **decrypted_data, int *enc_data_len, network_decryption_ctx_t *dec_ctx);
77 
78 #endif /* __PACKET_BTMESH_H__ */
79 
80 /*
81  * Editor modelines - https://www.wireshark.org/tools/modelines.html
82  *
83  * Local variables:
84  * c-basic-offset: 4
85  * tab-width: 8
86  * indent-tabs-mode: nil
87  * End:
88  *
89  * vi: set shiftwidth=4 tabstop=8 expandtab:
90  * :indentSize=4:tabSize=8:noTabs=true:
91  */
Definition: packet_info.h:44
Definition: packet-btmesh.h:47
Definition: packet-btmesh.h:41
Definition: packet-btmesh.h:56
Definition: tvbuff-int.h:35