diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-11-17 01:52:12 +0900 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-11-17 01:52:12 +0900 |
commit | 793cc67596cc77186dc40cb87caf470d216ff959 (patch) | |
tree | 67e3aff5273e64578f6ae5c5bdb67efc2f9269d1 /monitor/l2cap.h | |
parent | 9bbac96fefb9b35b8370781dd9be4a2ef82de2e8 (diff) | |
download | bluez-793cc67596cc77186dc40cb87caf470d216ff959.tar.gz |
monitor: Add basic decoding for SDP transactions
Diffstat (limited to 'monitor/l2cap.h')
-rw-r--r-- | monitor/l2cap.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/monitor/l2cap.h b/monitor/l2cap.h index 503bacaf9..30bcb6a5e 100644 --- a/monitor/l2cap.h +++ b/monitor/l2cap.h @@ -25,5 +25,37 @@ #include <stdint.h> #include <stdbool.h> +struct l2cap_frame { + uint16_t index; + bool in; + uint16_t handle; + uint16_t cid; + const void *data; + uint16_t size; +}; + +static inline void l2cap_frame_init(struct l2cap_frame *frame, + uint16_t index, bool in, uint16_t handle, + uint16_t cid, const void *data, uint16_t size) +{ + frame->index = index; + frame->in = in; + frame->handle = handle; + frame->cid = cid; + frame->data = data; + frame->size = size; +} + +static inline void l2cap_frame_pull(struct l2cap_frame *frame, + const struct l2cap_frame *source, uint16_t len) +{ + frame->index = source->index; + frame->in = source->in; + frame->handle = source->handle; + frame->cid = source->cid; + frame->data = source->data + len; + frame->size = source->size - len; +} + void l2cap_packet(uint16_t index, bool in, uint16_t handle, uint8_t flags, const void *data, uint16_t size); |