Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-btmesh.h
blob793d4a4c80ea0ebf1e60ae3fc3768cc330d7b791
1 /* packet-btmesh.h
2 * Structures for determining the dissection context for Bluetooth mesh.
4 * Copyright 2019, Piotr Winiarczyk <wino45@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __PACKET_BTMESH_H__
13 #define __PACKET_BTMESH_H__
15 #include <epan/packet.h>
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
22 #define BTMESH_ADDRESS_UNASSIGNED 0x00
23 #define BTMESH_ADDRESS_UNICAST 0x01
24 #define BTMESH_ADDRESS_VIRTUAL 0x02
25 #define BTMESH_ADDRESS_GROUP 0x03
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;
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;
41 typedef struct {
42 btle_mesh_tr_t transport;
43 bool fragmented;
44 unsigned segment_index;
45 } btle_mesh_transport_ctx_t;
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;
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;
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;
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);
78 #endif /* __PACKET_BTMESH_H__ */
81 * Editor modelines - https://www.wireshark.org/tools/modelines.html
83 * Local variables:
84 * c-basic-offset: 4
85 * tab-width: 8
86 * indent-tabs-mode: nil
87 * End:
89 * vi: set shiftwidth=4 tabstop=8 expandtab:
90 * :indentSize=4:tabSize=8:noTabs=true: