| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
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 bool fragmented;
44 unsigned segment_index;
45} btle_mesh_transport_ctx_t;
46
47 typedef struct {
48 uint32_t interface_id;
49 uint32_t adapter_id;
50 uint16_t chandle;
51 uint16_t bt_uuid;
52 uint32_t access_address;
53 btle_mesh_proxy_side_t proxy_side;
54} btle_mesh_proxy_ctx_t;
55
56 typedef struct {
57 /* Network Layer */
58 uint32_t src;
59 uint32_t seq;
60 uint8_t seq_src_buf[5];
61 uint8_t ivindex_buf[4];
62 uint8_t net_nonce_type;
63 uint32_t net_key_iv_index_hash;
64
65 /* Transport layer */
66 uint32_t dst;
67 uint8_t dst_buf[2];
68 int32_t label_uuid_idx;
69 uint32_t seg; /* Segmentation */
70 uint8_t aid;
71 uint8_t app_nonce_type;
72 uint32_t seqzero;
73 int transmic_size;
74} network_decryption_ctx_t;
75
76 tvbuff_t *btmesh_network_find_key_and_decrypt(tvbuff_t *tvb, packet_info *pinfo, uint8_t **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 */
packet.h
_packet_info
Definition packet_info.h:43
btle_mesh_proxy_ctx_t
Definition packet-btmesh.h:47
btle_mesh_transport_ctx_t
Definition packet-btmesh.h:41
network_decryption_ctx_t
Definition packet-btmesh.h:56
tvbuff
Definition tvbuff-int.h:36