Upgrade bluez5_37 :Merge the code from private
[platform/upstream/bluez.git] / monitor / l2cap.h
index 711bcb1..813c793 100644 (file)
@@ -34,6 +34,7 @@ struct l2cap_frame {
        uint16_t psm;
        uint16_t chan;
        uint8_t mode;
+       uint8_t seq_num;
        const void *data;
        uint16_t size;
 };
@@ -153,6 +154,22 @@ static inline bool l2cap_frame_get_le64(struct l2cap_frame *frame,
        return true;
 }
 
+static inline bool l2cap_frame_get_be128(struct l2cap_frame *frame,
+                                       uint64_t *lvalue, uint64_t *rvalue)
+{
+       if (frame->size < (sizeof(*lvalue) + sizeof(*rvalue)))
+               return false;
+
+       if (lvalue && rvalue) {
+               *lvalue = get_be64(frame->data);
+               *rvalue = get_be64(frame->data);
+       }
+
+       l2cap_frame_pull(frame, frame, (sizeof(*lvalue) + sizeof(*rvalue)));
+
+       return true;
+}
+
 void l2cap_packet(uint16_t index, bool in, uint16_t handle, uint8_t flags,
                                        const void *data, uint16_t size);