Upgrade bluez5_37 :Merge the code from private
[platform/upstream/bluez.git] / unit / test-sdp.c
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2012  Intel Corporation. All rights reserved.
6  *
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include <unistd.h>
29 #include <stdlib.h>
30 #include <stdbool.h>
31 #include <sys/socket.h>
32
33 #include <glib.h>
34
35 #include "lib/bluetooth.h"
36 #include "lib/sdp.h"
37 #include "lib/sdp_lib.h"
38
39 #include "src/shared/util.h"
40 #include "src/shared/tester.h"
41 #include "src/log.h"
42 #include "src/sdpd.h"
43
44 struct sdp_pdu {
45         bool valid;
46         const void *raw_data;
47         size_t raw_size;
48         uint8_t cont_len;
49 };
50
51 struct test_data {
52         int mtu;
53         struct sdp_pdu *pdu_list;
54 };
55
56 #define raw_data(args...) ((const unsigned char[]) { args })
57 #define build_u128(args...) ((const uint128_t) { .data = { args } })
58
59 #define raw_pdu(args...) \
60         {                                                       \
61                 .valid = true,                                  \
62                 .raw_data = raw_data(args),                     \
63                 .raw_size = sizeof(raw_data(args)),             \
64         }
65
66 #define raw_pdu_cont(cont, args...) \
67         {                                                       \
68                 .valid = true,                                  \
69                 .raw_data = raw_data(args),                     \
70                 .raw_size = sizeof(raw_data(args)),             \
71                 .cont_len = cont,                               \
72         }
73
74 #define define_test(name, _mtu, args...) \
75         do {                                                            \
76                 const struct sdp_pdu pdus[] = {                         \
77                         args, { }                                       \
78                 };                                                      \
79                 static struct test_data data;                           \
80                 data.mtu = _mtu;                                        \
81                 data.pdu_list = g_memdup(pdus, sizeof(pdus));           \
82                 tester_add(name, &data, NULL, test_sdp, NULL);          \
83         } while (0)
84
85 #define define_ss(name, args...) define_test("/TP/SERVER/SS/" name, 48, args)
86 #define define_sa(name, args...) define_test("/TP/SERVER/SA/" name, 48, args)
87 #define define_ssa(name, args...) define_test("/TP/SERVER/SSA/" name, 48, args)
88 #define define_brw(name, args...) define_test("/TP/SERVER/BRW/" name, 672, args)
89
90 /* SDP Data Element (DE) tests */
91 struct test_data_de {
92         const void *input_data;
93         size_t input_size;
94         sdp_data_t expected;
95 };
96
97 #define exp_data(_dtd, val_type, val_data) \
98         ((const sdp_data_t) {                   \
99                 .dtd = _dtd,                    \
100                 .val.val_type = val_data,       \
101         })
102
103 #define define_test_de_attr(name, input, exp) \
104         do {                                                            \
105                 static struct test_data_de data;                        \
106                 data.input_data = input;                                \
107                 data.input_size = sizeof(input);                        \
108                 data.expected = exp;                                    \
109                 tester_add("/sdp/DE/ATTR/" name, &data, NULL,           \
110                                         test_sdp_de_attr, NULL);        \
111         } while (0)
112
113 struct context {
114         guint server_source;
115         guint client_source;
116         int fd;
117         uint8_t cont_data[16];
118         uint8_t cont_size;
119         unsigned int pdu_offset;
120         const struct test_data *data;
121 };
122
123 static void sdp_debug(const char *str, void *user_data)
124 {
125         const char *prefix = user_data;
126
127         tester_debug("%s%s\n", prefix, str);
128 }
129
130 static void destroy_context(struct context *context)
131 {
132         sdp_svcdb_collect_all(context->fd);
133         sdp_svcdb_reset();
134
135         g_source_remove(context->server_source);
136         g_source_remove(context->client_source);
137
138         g_free(context);
139 }
140
141 static gboolean context_quit(gpointer user_data)
142 {
143         struct context *context = user_data;
144         if (context == NULL)
145                 return FALSE;
146
147         destroy_context(context);
148         tester_test_passed();
149
150         return FALSE;
151 }
152
153 static gboolean server_handler(GIOChannel *channel, GIOCondition cond,
154                                                         gpointer user_data)
155 {
156         struct context *context = user_data;
157         sdp_pdu_hdr_t hdr;
158         void *buf;
159         size_t size;
160         ssize_t len;
161         int fd;
162
163         fd = g_io_channel_unix_get_fd(channel);
164
165         if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
166                 sdp_svcdb_collect_all(fd);
167                 return FALSE;
168         }
169
170         len = recv(fd, &hdr, sizeof(sdp_pdu_hdr_t), MSG_PEEK);
171         if (len != sizeof(sdp_pdu_hdr_t)) {
172                 sdp_svcdb_collect_all(fd);
173                 return FALSE;
174         }
175
176         size = sizeof(sdp_pdu_hdr_t) + ntohs(hdr.plen);
177
178         buf = malloc(size);
179         if (!buf)
180                 return TRUE;
181
182         len = recv(fd, buf, size, 0);
183         if (len <= 0) {
184                 sdp_svcdb_collect_all(fd);
185                 free(buf);
186                 return FALSE;
187         }
188
189         util_hexdump('<', buf, len, sdp_debug, "SDP: ");
190
191         handle_internal_request(fd, context->data->mtu, buf, len);
192
193         return TRUE;
194 }
195
196 static gboolean send_pdu(gpointer user_data)
197 {
198         struct context *context = user_data;
199         const struct sdp_pdu *req_pdu;
200         uint16_t pdu_len;
201         unsigned char *buf;
202         ssize_t len;
203
204         req_pdu = &context->data->pdu_list[context->pdu_offset];
205
206         pdu_len = req_pdu->raw_size + context->cont_size;
207
208         buf = g_malloc0(pdu_len);
209
210         memcpy(buf, req_pdu->raw_data, req_pdu->raw_size);
211
212         if (context->cont_size > 0)
213                 memcpy(buf + req_pdu->raw_size, context->cont_data,
214                                                         context->cont_size);
215
216         len = write(context->fd, buf, pdu_len);
217
218         g_free(buf);
219
220         g_assert(len == pdu_len);
221
222         return FALSE;
223 }
224
225 static void context_increment(struct context *context)
226 {
227         context->pdu_offset += 2;
228
229         if (!context->data->pdu_list[context->pdu_offset].valid) {
230                 context_quit(context);
231                 return;
232         }
233
234         g_idle_add(send_pdu, context);
235 }
236
237 static gboolean client_handler(GIOChannel *channel, GIOCondition cond,
238                                                         gpointer user_data)
239 {
240         struct context *context = user_data;
241         const struct sdp_pdu *rsp_pdu;
242         unsigned char buf[512];
243         ssize_t len;
244         int fd;
245
246         rsp_pdu = &context->data->pdu_list[context->pdu_offset + 1];
247
248         if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
249                 return FALSE;
250
251         fd = g_io_channel_unix_get_fd(channel);
252
253         len = read(fd, buf, sizeof(buf));
254         if (len < 0)
255                 return FALSE;
256
257         util_hexdump('>', buf, len, sdp_debug, "SDP: ");
258
259         g_assert(len > 0);
260         g_assert((size_t) len == rsp_pdu->raw_size + rsp_pdu->cont_len);
261
262         g_assert(memcmp(buf, rsp_pdu->raw_data, rsp_pdu->raw_size) == 0);
263
264         if (rsp_pdu->cont_len > 0)
265                 memcpy(context->cont_data, buf + rsp_pdu->raw_size,
266                                                         rsp_pdu->cont_len);
267
268         context->cont_size = rsp_pdu->cont_len;
269
270         context_increment(context);
271
272         return TRUE;
273 }
274
275 static void update_db_timestamp(void)
276 {
277 }
278
279 static void register_serial_port(void)
280 {
281         sdp_list_t *svclass_id, *apseq, *proto[2], *profiles, *root, *aproto;
282         uuid_t root_uuid, sp_uuid, l2cap, rfcomm;
283         sdp_profile_desc_t profile;
284         uint8_t u8 = 1;
285         sdp_data_t *sdp_data, *channel;
286         sdp_record_t *record = sdp_record_alloc();
287
288         record->handle = sdp_next_handle();
289
290         sdp_record_add(BDADDR_ANY, record);
291         sdp_data = sdp_data_alloc(SDP_UINT32, &record->handle);
292         sdp_attr_add(record, SDP_ATTR_RECORD_HANDLE, sdp_data);
293
294         sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
295         root = sdp_list_append(0, &root_uuid);
296         sdp_set_browse_groups(record, root);
297         sdp_list_free(root, 0);
298
299         sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
300         svclass_id = sdp_list_append(0, &sp_uuid);
301         sdp_set_service_classes(record, svclass_id);
302         sdp_list_free(svclass_id, 0);
303
304         sdp_uuid16_create(&profile.uuid, SERIAL_PORT_PROFILE_ID);
305         profile.version = 0x0100;
306         profiles = sdp_list_append(0, &profile);
307         sdp_set_profile_descs(record, profiles);
308         sdp_list_free(profiles, 0);
309
310         sdp_uuid16_create(&l2cap, L2CAP_UUID);
311         proto[0] = sdp_list_append(0, &l2cap);
312         apseq = sdp_list_append(0, proto[0]);
313
314         sdp_uuid16_create(&rfcomm, RFCOMM_UUID);
315         proto[1] = sdp_list_append(0, &rfcomm);
316         channel = sdp_data_alloc(SDP_UINT8, &u8);
317         proto[1] = sdp_list_append(proto[1], channel);
318         apseq = sdp_list_append(apseq, proto[1]);
319
320         aproto = sdp_list_append(0, apseq);
321         sdp_set_access_protos(record, aproto);
322
323         sdp_add_lang_attr(record);
324
325         sdp_set_info_attr(record, "Serial Port", "BlueZ", "COM Port");
326
327         sdp_set_url_attr(record, "http://www.bluez.org/",
328                         "http://www.bluez.org/", "http://www.bluez.org/");
329
330         sdp_set_service_id(record, sp_uuid);
331         sdp_set_service_ttl(record, 0xffff);
332         sdp_set_service_avail(record, 0xff);
333         sdp_set_record_state(record, 0x00001234);
334
335         sdp_data_free(channel);
336         sdp_list_free(proto[0], 0);
337         sdp_list_free(proto[1], 0);
338         sdp_list_free(apseq, 0);
339         sdp_list_free(aproto, 0);
340
341         update_db_timestamp();
342 }
343
344 static void register_object_push(void)
345 {
346         sdp_list_t *svclass_id, *pfseq, *apseq, *root;
347         uuid_t root_uuid, opush_uuid, l2cap_uuid, rfcomm_uuid, obex_uuid;
348         sdp_profile_desc_t profile[1];
349         sdp_list_t *aproto, *proto[3];
350         uint8_t chan = 9;
351         sdp_data_t *channel;
352         uint8_t formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xff };
353         void *dtds[sizeof(formats)], *values[sizeof(formats)];
354         unsigned int i;
355         uint8_t dtd = SDP_UINT8;
356         sdp_data_t *sdp_data, *sflist;
357         sdp_record_t *record = sdp_record_alloc();
358
359         record->handle = sdp_next_handle();
360
361         sdp_record_add(BDADDR_ANY, record);
362         sdp_data = sdp_data_alloc(SDP_UINT32, &record->handle);
363         sdp_attr_add(record, SDP_ATTR_RECORD_HANDLE, sdp_data);
364
365         sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
366         root = sdp_list_append(0, &root_uuid);
367         sdp_set_browse_groups(record, root);
368
369         sdp_uuid16_create(&opush_uuid, OBEX_OBJPUSH_SVCLASS_ID);
370         svclass_id = sdp_list_append(0, &opush_uuid);
371         sdp_set_service_classes(record, svclass_id);
372
373         sdp_uuid16_create(&profile[0].uuid, OBEX_OBJPUSH_PROFILE_ID);
374         profile[0].version = 0x0100;
375         pfseq = sdp_list_append(0, profile);
376         sdp_set_profile_descs(record, pfseq);
377
378         sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
379         proto[0] = sdp_list_append(0, &l2cap_uuid);
380         apseq = sdp_list_append(0, proto[0]);
381
382         sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
383         proto[1] = sdp_list_append(0, &rfcomm_uuid);
384         channel = sdp_data_alloc(SDP_UINT8, &chan);
385         proto[1] = sdp_list_append(proto[1], channel);
386         apseq = sdp_list_append(apseq, proto[1]);
387
388         sdp_uuid16_create(&obex_uuid, OBEX_UUID);
389         proto[2] = sdp_list_append(0, &obex_uuid);
390         apseq = sdp_list_append(apseq, proto[2]);
391
392         aproto = sdp_list_append(0, apseq);
393         sdp_set_access_protos(record, aproto);
394
395         for (i = 0; i < sizeof(formats); i++) {
396                 dtds[i] = &dtd;
397                 values[i] = &formats[i];
398         }
399         sflist = sdp_seq_alloc(dtds, values, sizeof(formats));
400         sdp_attr_add(record, SDP_ATTR_SUPPORTED_FORMATS_LIST, sflist);
401
402         sdp_set_info_attr(record, "OBEX Object Push", 0, 0);
403
404         sdp_data_free(channel);
405         sdp_list_free(root, 0);
406         sdp_list_free(svclass_id, 0);
407         sdp_list_free(pfseq, 0);
408         sdp_list_free(proto[0], 0);
409         sdp_list_free(proto[1], 0);
410         sdp_list_free(proto[2], 0);
411         sdp_list_free(apseq, 0);
412         sdp_list_free(aproto, 0);
413
414         update_db_timestamp();
415 }
416
417 static void register_hid_keyboard(void)
418 {
419         sdp_list_t *svclass_id, *pfseq, *apseq, *root;
420         uuid_t root_uuid, hidkb_uuid, l2cap_uuid, hidp_uuid;
421         sdp_profile_desc_t profile[1];
422         sdp_list_t *aproto, *proto[3];
423         sdp_data_t *psm, *lang_lst, *lang_lst2, *hid_spec_lst, *hid_spec_lst2;
424         unsigned int i;
425         uint8_t dtd = SDP_UINT16;
426         uint8_t dtd2 = SDP_UINT8;
427         uint8_t dtd_data = SDP_TEXT_STR8;
428         void *dtds[2];
429         void *values[2];
430         void *dtds2[2];
431         void *values2[2];
432         int leng[2];
433         uint8_t hid_spec_type = 0x22;
434         uint16_t hid_attr_lang[] = { 0x409, 0x100 };
435         static const uint16_t ctrl = 0x11;
436         static const uint16_t intr = 0x13;
437         static const uint16_t hid_attr[] = { 0x100, 0x111, 0x40, 0x0d,
438                                                                 0x01, 0x01 };
439         static const uint16_t hid_attr2[] = { 0x0, 0x01, 0x100, 0x1f40,
440                                                                 0x01, 0x01 };
441         const uint8_t hid_spec[] = {
442                 0x05, 0x01, // usage page
443                 0x09, 0x06, // keyboard
444                 0xa1, 0x01, // key codes
445                 0x85, 0x01, // minimum
446                 0x05, 0x07, // max
447                 0x19, 0xe0, // logical min
448                 0x29, 0xe7, // logical max
449                 0x15, 0x00, // report size
450                 0x25, 0x01, // report count
451                 0x75, 0x01, // input data variable absolute
452                 0x95, 0x08, // report count
453                 0x81, 0x02, // report size
454                 0x75, 0x08,
455                 0x95, 0x01,
456                 0x81, 0x01,
457                 0x75, 0x01,
458                 0x95, 0x05,
459                 0x05, 0x08,
460                 0x19, 0x01,
461                 0x29, 0x05,
462                 0x91, 0x02,
463                 0x75, 0x03,
464                 0x95, 0x01,
465                 0x91, 0x01,
466                 0x75, 0x08,
467                 0x95, 0x06,
468                 0x15, 0x00,
469                 0x26, 0xff,
470                 0x00, 0x05,
471                 0x07, 0x19,
472                 0x00, 0x2a,
473                 0xff, 0x00,
474                 0x81, 0x00,
475                 0x75, 0x01,
476                 0x95, 0x01,
477                 0x15, 0x00,
478                 0x25, 0x01,
479                 0x05, 0x0c,
480                 0x09, 0xb8,
481                 0x81, 0x06,
482                 0x09, 0xe2,
483                 0x81, 0x06,
484                 0x09, 0xe9,
485                 0x81, 0x02,
486                 0x09, 0xea,
487                 0x81, 0x02,
488                 0x75, 0x01,
489                 0x95, 0x04,
490                 0x81, 0x01,
491                 0xc0         // end tag
492         };
493         sdp_data_t *sdp_data;
494         sdp_record_t *record = sdp_record_alloc();
495
496         record->handle = sdp_next_handle();
497
498         sdp_record_add(BDADDR_ANY, record);
499         sdp_data = sdp_data_alloc(SDP_UINT32, &record->handle);
500         sdp_attr_add(record, SDP_ATTR_RECORD_HANDLE, sdp_data);
501
502         sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
503         root = sdp_list_append(0, &root_uuid);
504         sdp_set_browse_groups(record, root);
505         sdp_list_free(root, 0);
506
507         sdp_add_lang_attr(record);
508
509         sdp_uuid16_create(&hidkb_uuid, HID_SVCLASS_ID);
510         svclass_id = sdp_list_append(0, &hidkb_uuid);
511         sdp_set_service_classes(record, svclass_id);
512         sdp_list_free(svclass_id, 0);
513
514         sdp_uuid16_create(&profile[0].uuid, HID_PROFILE_ID);
515         profile[0].version = 0x0100;
516         pfseq = sdp_list_append(0, profile);
517         sdp_set_profile_descs(record, pfseq);
518         sdp_list_free(pfseq, 0);
519
520         /* protocols */
521         sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
522         proto[1] = sdp_list_append(0, &l2cap_uuid);
523         psm = sdp_data_alloc(SDP_UINT16, &ctrl);
524         proto[1] = sdp_list_append(proto[1], psm);
525         apseq = sdp_list_append(0, proto[1]);
526
527         sdp_uuid16_create(&hidp_uuid, HIDP_UUID);
528         proto[2] = sdp_list_append(0, &hidp_uuid);
529         apseq = sdp_list_append(apseq, proto[2]);
530
531         aproto = sdp_list_append(0, apseq);
532         sdp_set_access_protos(record, aproto);
533
534         sdp_data_free(psm);
535         sdp_list_free(proto[1], 0);
536         sdp_list_free(proto[2], 0);
537         sdp_list_free(apseq, 0);
538         sdp_list_free(aproto, 0);
539
540         /* additional protocols */
541         proto[1] = sdp_list_append(0, &l2cap_uuid);
542         psm = sdp_data_alloc(SDP_UINT16, &intr);
543         proto[1] = sdp_list_append(proto[1], psm);
544         apseq = sdp_list_append(0, proto[1]);
545
546         sdp_uuid16_create(&hidp_uuid, HIDP_UUID);
547         proto[2] = sdp_list_append(0, &hidp_uuid);
548         apseq = sdp_list_append(apseq, proto[2]);
549
550         aproto = sdp_list_append(0, apseq);
551         sdp_set_add_access_protos(record, aproto);
552
553         sdp_data_free(psm);
554         sdp_list_free(proto[1], 0);
555         sdp_list_free(proto[2], 0);
556         sdp_list_free(apseq, 0);
557         sdp_list_free(aproto, 0);
558
559         sdp_set_info_attr(record, "HID Keyboard", NULL, NULL);
560
561         for (i = 0; i < sizeof(hid_attr) / 2; i++)
562                 sdp_attr_add_new(record,
563                                 SDP_ATTR_HID_DEVICE_RELEASE_NUMBER + i,
564                                 SDP_UINT16, &hid_attr[i]);
565
566         dtds[0] = &dtd2;
567         values[0] = &hid_spec_type;
568         dtds[1] = &dtd_data;
569         values[1] = (uint8_t *) hid_spec;
570         leng[0] = 0;
571         leng[1] = sizeof(hid_spec);
572         hid_spec_lst = sdp_seq_alloc_with_length(dtds, values, leng, 2);
573         hid_spec_lst2 = sdp_data_alloc(SDP_SEQ8, hid_spec_lst);
574         sdp_attr_add(record, SDP_ATTR_HID_DESCRIPTOR_LIST, hid_spec_lst2);
575
576         for (i = 0; i < sizeof(hid_attr_lang) / 2; i++) {
577                 dtds2[i] = &dtd;
578                 values2[i] = &hid_attr_lang[i];
579         }
580
581         lang_lst = sdp_seq_alloc(dtds2, values2, sizeof(hid_attr_lang) / 2);
582         lang_lst2 = sdp_data_alloc(SDP_SEQ8, lang_lst);
583         sdp_attr_add(record, SDP_ATTR_HID_LANG_ID_BASE_LIST, lang_lst2);
584
585         sdp_attr_add_new(record, SDP_ATTR_HID_SDP_DISABLE,
586                                                 SDP_UINT16, &hid_attr2[0]);
587
588         for (i = 0; i < sizeof(hid_attr2) / 2 - 1; i++)
589                 sdp_attr_add_new(record, SDP_ATTR_HID_REMOTE_WAKEUP + i,
590                                                 SDP_UINT16, &hid_attr2[i + 1]);
591
592         update_db_timestamp();
593 }
594
595 static void register_file_transfer(void)
596 {
597         sdp_list_t *svclass_id, *pfseq, *apseq, *root;
598         uuid_t root_uuid, ftrn_uuid, l2cap_uuid, rfcomm_uuid, obex_uuid;
599         sdp_profile_desc_t profile[1];
600         sdp_list_t *aproto, *proto[3];
601         uint8_t u8 = 10;
602         sdp_data_t *sdp_data, *channel;
603         sdp_record_t *record = sdp_record_alloc();
604
605         record->handle = sdp_next_handle();
606
607         sdp_record_add(BDADDR_ANY, record);
608         sdp_data = sdp_data_alloc(SDP_UINT32, &record->handle);
609         sdp_attr_add(record, SDP_ATTR_RECORD_HANDLE, sdp_data);
610
611         sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
612         root = sdp_list_append(0, &root_uuid);
613         sdp_set_browse_groups(record, root);
614
615         sdp_uuid16_create(&ftrn_uuid, OBEX_FILETRANS_SVCLASS_ID);
616         svclass_id = sdp_list_append(0, &ftrn_uuid);
617         sdp_set_service_classes(record, svclass_id);
618
619         sdp_uuid16_create(&profile[0].uuid, OBEX_FILETRANS_PROFILE_ID);
620         profile[0].version = 0x0100;
621         pfseq = sdp_list_append(0, &profile[0]);
622         sdp_set_profile_descs(record, pfseq);
623
624         sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
625         proto[0] = sdp_list_append(0, &l2cap_uuid);
626         apseq = sdp_list_append(0, proto[0]);
627
628         sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
629         proto[1] = sdp_list_append(0, &rfcomm_uuid);
630         channel = sdp_data_alloc(SDP_UINT8, &u8);
631         proto[1] = sdp_list_append(proto[1], channel);
632         apseq = sdp_list_append(apseq, proto[1]);
633
634         sdp_uuid16_create(&obex_uuid, OBEX_UUID);
635         proto[2] = sdp_list_append(0, &obex_uuid);
636         apseq = sdp_list_append(apseq, proto[2]);
637
638         aproto = sdp_list_append(0, apseq);
639         sdp_set_access_protos(record, aproto);
640
641         sdp_set_info_attr(record, "OBEX File Transfer", 0, 0);
642
643         sdp_data_free(channel);
644         sdp_list_free(root, 0);
645         sdp_list_free(svclass_id, 0);
646         sdp_list_free(pfseq, 0);
647         sdp_list_free(proto[0], 0);
648         sdp_list_free(proto[1], 0);
649         sdp_list_free(proto[2], 0);
650         sdp_list_free(apseq, 0);
651         sdp_list_free(aproto, 0);
652
653         update_db_timestamp();
654 }
655
656 static struct context *create_context(gconstpointer data)
657 {
658         struct context *context = g_new0(struct context, 1);
659         GIOChannel *channel;
660         int err, sv[2];
661
662         err = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv);
663         g_assert(err == 0);
664
665         channel = g_io_channel_unix_new(sv[0]);
666
667         g_io_channel_set_close_on_unref(channel, TRUE);
668         g_io_channel_set_encoding(channel, NULL, NULL);
669         g_io_channel_set_buffered(channel, FALSE);
670
671         context->server_source = g_io_add_watch(channel,
672                                 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
673                                 server_handler, context);
674         g_assert(context->server_source > 0);
675
676         g_io_channel_unref(channel);
677
678         channel = g_io_channel_unix_new(sv[1]);
679
680         g_io_channel_set_close_on_unref(channel, TRUE);
681         g_io_channel_set_encoding(channel, NULL, NULL);
682         g_io_channel_set_buffered(channel, FALSE);
683
684         context->client_source = g_io_add_watch(channel,
685                                 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
686                                 client_handler, context);
687         g_assert(context->client_source > 0);
688
689         g_io_channel_unref(channel);
690
691         context->fd = sv[1];
692         context->data = data;
693
694         set_fixed_db_timestamp(0x496f0654);
695
696         register_public_browse_group();
697         register_server_service();
698
699         register_serial_port();
700         register_object_push();
701         register_hid_keyboard();
702         register_file_transfer();
703         register_file_transfer();
704         register_file_transfer();
705         register_file_transfer();
706         register_file_transfer();
707
708         return context;
709 }
710
711 static void test_sdp(gconstpointer data)
712 {
713         struct context *context = create_context(data);
714
715         g_idle_add(send_pdu, context);
716 }
717
718 static void test_sdp_de_attr(gconstpointer data)
719 {
720         const struct test_data_de *test = data;
721         uint128_t u128;
722         sdp_data_t *d;
723         int size = 0;
724
725         d = sdp_extract_attr(test->input_data, test->input_size, &size, NULL);
726         g_assert(d != NULL);
727         g_assert_cmpuint(test->input_size, ==, size);
728         g_assert_cmpuint(test->expected.dtd, ==, d->dtd);
729
730         tester_debug("DTD=0x%02x\n", d->dtd);
731
732         switch (d->dtd) {
733         case SDP_TEXT_STR8:
734         case SDP_TEXT_STR16:
735         case SDP_URL_STR8:
736         case SDP_URL_STR16:
737                 g_assert_cmpstr(test->expected.val.str, ==, d->val.str);
738                 break;
739         case SDP_DATA_NIL:
740         case SDP_UINT8:
741                 g_assert_cmpuint(test->expected.val.uint8, ==, d->val.uint8);
742                 break;
743         case SDP_UINT16:
744                 g_assert_cmpuint(test->expected.val.uint16, ==, d->val.uint16);
745                 break;
746         case SDP_UINT32:
747                 g_assert_cmpuint(test->expected.val.uint32, ==, d->val.uint32);
748                 break;
749         case SDP_UINT64:
750                 g_assert_cmpuint(test->expected.val.uint64, ==, d->val.uint64);
751                 break;
752         case SDP_BOOL:
753         case SDP_INT8:
754                 g_assert_cmpuint(test->expected.val.int8, ==, d->val.int8);
755                 break;
756         case SDP_INT16:
757                 g_assert_cmpuint(test->expected.val.int16, ==, d->val.int16);
758                 break;
759         case SDP_INT32:
760                 g_assert_cmpuint(test->expected.val.int32, ==, d->val.int32);
761                 break;
762         case SDP_INT64:
763                 g_assert_cmpuint(test->expected.val.int64, ==, d->val.int64);
764                 break;
765         case SDP_UINT128:
766         case SDP_INT128:
767                 /* Expected bytes are in network order */
768                 hton128(&d->val.uint128, &u128);
769                 g_assert(memcmp(&test->expected.val.uint128, &u128,
770                                                 sizeof(uint128_t)) == 0);
771                 break;
772         default:
773                 g_assert_not_reached();
774         }
775
776         sdp_data_free(d);
777         tester_test_passed();
778 }
779
780 int main(int argc, char *argv[])
781 {
782         tester_init(&argc, &argv);
783
784         __btd_log_init("*", 0);
785
786         /*
787          * Service Search Request
788          *
789          * Verify the correct behaviour of the IUT when searching for
790          * existing service(s).
791          */
792         define_ss("BV-01-C/UUID-16",
793                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
794                         0x11, 0x05, 0x00, 0x01, 0x00),
795                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
796                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00));
797         define_ss("BV-01-C/UUID-32",
798                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
799                         0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00),
800                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
801                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00));
802         define_ss("BV-01-C/UUID-128",
803                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
804                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
805                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
806                         0x00, 0x01, 0x00),
807                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
808                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00));
809
810         /*
811          * Service Search Request
812          *
813          * Verify the correct behaviour of the IUT when searching for
814          * existing service(s), using continuation state.
815          */
816         define_ss("BV-03-C/UUID-16",
817                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
818                         0x01, 0x00, 0xff, 0xff, 0x00),
819                 raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
820                                 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
821                                 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
822                                 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
823                                 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
824                 raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x10, 0x35, 0x03, 0x19,
825                                 0x01, 0x00, 0xff, 0xff, 0x08),
826                 raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
827                         0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
828         define_ss("BV-03-C/UUID-32",
829                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
830                         0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00),
831                 raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
832                                 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
833                                 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
834                                 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
835                                 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
836                 raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x12, 0x35, 0x05, 0x1a,
837                                 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x08),
838                 raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
839                         0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
840         define_ss("BV-03-C/UUID-128",
841                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
842                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
843                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
844                         0xff, 0xff, 0x00),
845                 raw_pdu_cont(8, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x08, 0x00,
846                                 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
847                                 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
848                                 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
849                                 0x05, 0x00, 0x01, 0x00, 0x06, 0x08),
850                 raw_pdu_cont(8, 0x02, 0x00, 0x02, 0x00, 0x1e, 0x35, 0x11, 0x1c,
851                                 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
852                                 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
853                                 0xff, 0xff, 0x08),
854                 raw_pdu(0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0x08, 0x00,
855                         0x01, 0x00, 0x01, 0x00, 0x07, 0x00));
856
857         /*
858          * Service Search Request
859          *
860          * Verify the correct behaviour of the IUT when searching for
861          * no existing service(s).
862          */
863         define_ss("BV-04-C/UUID-16",
864                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
865                         0xff, 0xff, 0x00, 0x01, 0x00),
866                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
867                         0x00, 0x00));
868         define_ss("BV-04-C/UUID-128",
869                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
870                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
871                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
872                         0x00, 0x01, 0x00),
873                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
874                         0x00, 0x00));
875         define_ss("BV-04-C/UUID-32",
876                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
877                         0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00),
878                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
879                         0x00, 0x00));
880
881         /*
882          * Service Search Request
883          *
884          * Verify the correct behaviour of the IUT when searching for
885          * existing service(s), using invalid PDU size.
886          */
887         define_ss("BI-01-C/UUID-16",
888                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
889                         0x01, 0x00, 0x00, 0x05, 0x00),
890                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
891         define_ss("BI-01-C/UUID-32",
892                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
893                         0x00, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00),
894                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
895         define_ss("BI-01-C/UUID-128",
896                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
897                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
898                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
899                         0x00, 0x05, 0x00),
900                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
901
902         /*
903          * Service Search Request
904          *
905          * Verify the correct behaviour of the IUT when searching for
906          * existing service(s), using invalid request syntax.
907          */
908         define_ss("BI-02-C/UUID-16",
909                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x06, 0x35, 0x03, 0x19,
910                         0x01, 0x00, 0x00),
911                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
912         define_ss("BI-02-C/UUID-32",
913                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x05, 0x1a,
914                         0x00, 0x00, 0x01, 0x00, 0x00),
915                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
916         define_ss("BI-02-C/UUID-128",
917                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x14, 0x35, 0x11, 0x1c,
918                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
919                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
920                         0x00),
921                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
922
923         /*
924          * Service Attribute Request
925          *
926          * Verify that the IUT is able to respond with attribute(s).
927          */
928         define_sa("BV-01-C",
929                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
930                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
931                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
932                         0x00, 0x01, 0x00),
933                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
934                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00),
935                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
936                         0x01, 0x00, 0x0a, 0x35, 0x03, 0x09, 0x00, 0x01,
937                         0x00),
938                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
939                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
940                         0x05, 0x00));
941
942         /*
943          * Service Attribute Request
944          *
945          * Verify that the IUT is able to respond with the existing
946          * Attribute(s) using ContinuationState.
947          */
948         define_sa("BV-03-C",
949                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
950                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
951                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
952                         0x00, 0x01, 0x00),
953                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
954                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
955                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x01, 0x00,
956                         0x00, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00,
957                         0x09, 0x00, 0x01, 0x00),
958                 raw_pdu_cont(8, 0x05, 0x00, 0x01, 0x00, 0x12, 0x00, 0x07, 0x35,
959                                 0x10, 0x09, 0x00, 0x00, 0x0a, 0x00, 0x08),
960                 raw_pdu_cont(8, 0x04, 0x00, 0x02, 0x00, 0x17, 0x00, 0x01, 0x00,
961                                 0x00, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00,
962                                 0x09, 0x00, 0x01, 0x08),
963                 raw_pdu_cont(8, 0x05, 0x00, 0x02, 0x00, 0x12, 0x00, 0x07, 0x01,
964                                 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, 0x08),
965                 raw_pdu_cont(8, 0x04, 0x00, 0x03, 0x00, 0x17, 0x00, 0x01, 0x00,
966                                 0x00, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00,
967                                 0x09, 0x00, 0x01, 0x08),
968                 raw_pdu(0x05, 0x00, 0x03, 0x00, 0x07, 0x00, 0x04, 0x03,
969                         0x19, 0x11, 0x01, 0x00));
970
971         /*
972          * Service Attribute Request
973          *
974          * Verify that the IUT is able to respond with an
975          * ServiceID attribute.
976          */
977         define_sa("BV-04-C",
978                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
979                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
980                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
981                         0x00, 0x01, 0x00),
982                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
983                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
984                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
985                         0x00, 0x00, 0x19, 0x35, 0x03, 0x09, 0x00, 0x03,
986                         0x00),
987                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0b, 0x00, 0x08, 0x35,
988                         0x06, 0x09, 0x00, 0x03, 0x19, 0x11, 0x01, 0x00));
989
990         /*
991          * Service Attribute Request
992          *
993          * Verify that the IUT is able to respond with an
994          * ProtocolDescriptorList attribute.
995          */
996         define_sa("BV-05-C",
997                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
998                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
999                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1000                         0x00, 0x01, 0x00),
1001                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1002                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00),
1003                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1004                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x04,
1005                         0x00),
1006                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x1b, 0x00, 0x18, 0x35,
1007                         0x16, 0x09, 0x00, 0x04, 0x35, 0x11, 0x35, 0x03,
1008                         0x19, 0x01, 0x00, 0x35, 0x05, 0x19, 0x00, 0x03,
1009                         0x08, 0x09, 0x35, 0x03, 0x19, 0x00, 0x08, 0x00));
1010
1011         /*
1012          * Service Attribute Request
1013          *
1014          * Verify that the IUT is able to respond with the
1015          * ServiceRecordState attribute.
1016          */
1017         define_sa("BV-06-C",
1018                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1019                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1020                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1021                         0x00, 0x01, 0x00),
1022                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1023                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1024                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1025                         0x00, 0x00, 0x0d, 0x35, 0x03, 0x09, 0x00, 0x02,
1026                         0x00),
1027                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1028                         0x08, 0x09, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x12,
1029                         0x34, 0x00));
1030
1031         /*
1032          * Service Attribute Request
1033          *
1034          * Verify that the IUT is able to respond with the
1035          * ServiceInfoTime attribute.
1036          */
1037         define_sa("BV-07-C",
1038                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1039                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1040                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1041                         0x00, 0x01, 0x00),
1042                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1043                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1044                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1045                         0x00, 0x00, 0x0d, 0x35, 0x03, 0x09, 0x00, 0x07,
1046                         0x00),
1047                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1048                         0x08, 0x09, 0x00, 0x07, 0x0a, 0x00, 0x00, 0xff,
1049                         0xff, 0x00));
1050
1051         /*
1052          * Service Attribute Request
1053          *
1054          * Verify that the IUT is able to respond with an
1055          * BrowseGroupList attribute.
1056          */
1057         define_sa("BV-08-C",
1058                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1059                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1060                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1061                         0x00, 0x01, 0x00),
1062                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1063                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00),
1064                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1065                         0x01, 0x00, 0x0a, 0x35, 0x03, 0x09, 0x00, 0x05,
1066                         0x00),
1067                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1068                         0x08, 0x09, 0x00, 0x05, 0x35, 0x03, 0x19, 0x10,
1069                         0x02, 0x00));
1070
1071         /*
1072          * Service Attribute Request
1073          *
1074          * Verify that the IUT is able to respond with an
1075          * LanguageBaseAttributeIdList attribute.
1076          */
1077         define_sa("BV-09-C",
1078                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1079                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1080                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1081                         0x00, 0x01, 0x00),
1082                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1083                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1084                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1085                         0x00, 0x00, 0x13, 0x35, 0x03, 0x09, 0x00, 0x06,
1086                         0x00),
1087                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x13, 0x00, 0x10, 0x35,
1088                         0x0e, 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, 0x65,
1089                         0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x00));
1090
1091         /*
1092          * Service Attribute Request
1093          *
1094          * Verify that the IUT is able to respond with an
1095          * ServiceAvailability attribute.
1096          */
1097         define_sa("BV-10-C",
1098                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1099                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1100                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1101                         0x00, 0x01, 0x00),
1102                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1103                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1104                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1105                         0x00, 0x00, 0x0a, 0x35, 0x03, 0x09, 0x00, 0x08,
1106                         0x00),
1107                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x07, 0x35,
1108                         0x05, 0x09, 0x00, 0x08, 0x08, 0xff, 0x00));
1109
1110         /*
1111          * Service Attribute Request
1112          *
1113          * Verify that the IUT is able to respond with an
1114          * IconURL attribute.
1115          */
1116         define_sa("BV-11-C",
1117                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1118                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1119                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1120                         0x00, 0x01, 0x00),
1121                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1122                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1123                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1124                         0x00, 0x00, 0x1f, 0x35, 0x03, 0x09, 0x00, 0x0c,
1125                         0x00),
1126                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x1f, 0x00, 0x1c, 0x35,
1127                         0x1a, 0x09, 0x00, 0x0c, 0x45, 0x15, 0x68, 0x74,
1128                         0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
1129                         0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f,
1130                         0x72, 0x67, 0x2f, 0x00));
1131
1132         /*
1133          * Service Attribute Request
1134          *
1135          * Verify that the IUT is able to respond with an
1136          * ServiceName attribute.
1137          */
1138         define_sa("BV-12-C",
1139                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1140                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1141                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1142                         0x00, 0x01, 0x00),
1143                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1144                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1145                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1146                         0x00, 0x00, 0x16, 0x35, 0x03, 0x09, 0x00, 0x06,
1147                         0x00),
1148                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x13, 0x00, 0x10, 0x35,
1149                         0x0e, 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, 0x65,
1150                         0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x00),
1151                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
1152                         0x00, 0x00, 0x15, 0x35, 0x03, 0x09, 0x01, 0x00,
1153                         0x00),
1154                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1155                         0x10, 0x09, 0x01, 0x00, 0x25, 0x0b, 0x53, 0x65,
1156                         0x72, 0x69, 0x61, 0x6c, 0x20, 0x50, 0x6f, 0x72,
1157                         0x74, 0x00));
1158
1159         /*
1160          * Service Attribute Request
1161          *
1162          * Verify that the IUT is able to respond with an
1163          * ServiceDescription attribute.
1164          */
1165         define_sa("BV-13-C",
1166                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1167                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1168                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1169                         0x00, 0x01, 0x00),
1170                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1171                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1172                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1173                         0x00, 0x00, 0x16, 0x35, 0x03, 0x09, 0x00, 0x06,
1174                         0x00),
1175                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x13, 0x00, 0x10, 0x35,
1176                         0x0e, 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, 0x65,
1177                         0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x00),
1178                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1179                         0x00, 0x00, 0x12, 0x35, 0x03, 0x09, 0x01, 0x01,
1180                         0x00),
1181                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x12, 0x00, 0x0f, 0x35,
1182                         0x0d, 0x09, 0x01, 0x01, 0x25, 0x08, 0x43, 0x4f,
1183                         0x4d, 0x20, 0x50, 0x6f, 0x72, 0x74, 0x00));
1184
1185         /*
1186          * Service Attribute Request
1187          *
1188          * Verify that the IUT is able to respond with an
1189          * ProviderName attribute.
1190          */
1191         define_sa("BV-14-C",
1192                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1193                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1194                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1195                         0x00, 0x01, 0x00),
1196                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1197                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1198                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1199                         0x00, 0x00, 0x16, 0x35, 0x03, 0x09, 0x00, 0x06,
1200                         0x00),
1201                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x13, 0x00, 0x10, 0x35,
1202                         0x0e, 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, 0x65,
1203                         0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x00),
1204                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1205                         0x00, 0x00, 0x0f, 0x35, 0x03, 0x09, 0x01, 0x02,
1206                         0x00),
1207                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1208                         0x0a, 0x09, 0x01, 0x02, 0x25, 0x05, 0x42, 0x6c,
1209                         0x75, 0x65, 0x5a, 0x00));
1210
1211         /*
1212          * Service Attribute Request
1213          *
1214          * Verify that the IUT is able to respond with an
1215          * VersionNumberList attribute.
1216          */
1217         define_sa("BV-15-C",
1218                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1219                         0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
1220                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1221                         0x00, 0x01, 0x00),
1222                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1223                         0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
1224                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00,
1225                         0x00, 0x00, 0x0d, 0x35, 0x03, 0x09, 0x02, 0x00,
1226                         0x00),
1227                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1228                         0x08, 0x09, 0x02, 0x00, 0x35, 0x03, 0x09, 0x01,
1229                         0x00, 0x00));
1230
1231         /*
1232          * Service Attribute Request
1233          *
1234          * Verify that the IUT is able to respond with the
1235          * ServiceDatabaseState attribute.
1236          */
1237         define_sa("BV-16-C",
1238                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1239                         0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
1240                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1241                         0x00, 0x01, 0x00),
1242                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1243                         0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
1244                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00,
1245                         0x00, 0x00, 0x0d, 0x35, 0x03, 0x09, 0x02, 0x01,
1246                         0x00),
1247                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1248                         0x08, 0x09, 0x02, 0x01, 0x0a, 0x49, 0x6f, 0x06,
1249                         0x54, 0x00));
1250
1251         /*
1252          * Service Attribute Request
1253          *
1254          * Verify that the IUT is able to respond with the
1255          * BluetoothProfileDescriptorList attribute.
1256          */
1257         define_sa("BV-17-C",
1258                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1259                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1260                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1261                         0x00, 0x01, 0x00),
1262                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1263                         0x01, 0x00, 0x01, 0x00, 0x01, 0x00),
1264                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1265                         0x01, 0x00, 0x0f, 0x35, 0x03, 0x09, 0x00, 0x09,
1266                         0x00),
1267                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x12, 0x00, 0x0f, 0x35,
1268                         0x0d, 0x09, 0x00, 0x09, 0x35, 0x08, 0x35, 0x06,
1269                         0x19, 0x11, 0x05, 0x09, 0x01, 0x00, 0x00));
1270
1271         /*
1272          * Service Attribute Request
1273          *
1274          * Verify that the IUT is able to respond with the
1275          * DocumentationURL attribute.
1276          */
1277         define_sa("BV-18-C",
1278                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1279                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1280                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1281                         0x00, 0x01, 0x00),
1282                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1283                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1284                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1285                         0x00, 0x00, 0x1f, 0x35, 0x03, 0x09, 0x00, 0x0a,
1286                         0x00),
1287                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x1f, 0x00, 0x1c, 0x35,
1288                         0x1a, 0x09, 0x00, 0x0a, 0x45, 0x15, 0x68, 0x74,
1289                         0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
1290                         0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f,
1291                         0x72, 0x67, 0x2f, 0x00));
1292
1293         /*
1294          * Service Attribute Request
1295          *
1296          * Verify that the IUT is able to respond with the
1297          * ClientExecutableURL attribute.
1298          */
1299         define_sa("BV-19-C",
1300                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1301                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1302                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1303                         0x00, 0x01, 0x00),
1304                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1305                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1306                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1307                         0x00, 0x00, 0x1f, 0x35, 0x03, 0x09, 0x00, 0x0b,
1308                         0x00),
1309                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x1f, 0x00, 0x1c, 0x35,
1310                         0x1a, 0x09, 0x00, 0x0b, 0x45, 0x15, 0x68, 0x74,
1311                         0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
1312                         0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f,
1313                         0x72, 0x67, 0x2f, 0x00));
1314
1315         /*
1316          * Service Attribute Request
1317          *
1318          * Verify the correct behaviour of the IUT when searching
1319          * for non-existing Attribute.
1320          */
1321         define_sa("BV-20-C",
1322                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1323                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
1324                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1325                         0x00, 0x01, 0x00),
1326                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1327                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1328                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1329                         0x00, 0x00, 0x07, 0x35, 0x03, 0x09, 0xff, 0xff,
1330                         0x00),
1331                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x05, 0x00, 0x02, 0x35,
1332                         0x00, 0x00));
1333
1334         /*
1335          * Service Attribute Request
1336          *
1337          * Verify that the IUT is able to respond with an
1338          * AdditionalProtocolDescriptorList attribute.
1339          */
1340         define_sa("BV-21-C",
1341                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1342                         0x00, 0x00, 0x11, 0x24, 0x00, 0x00, 0x10, 0x00,
1343                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1344                         0x00, 0x01, 0x00),
1345                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1346                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00),
1347                 raw_pdu(0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x01, 0x00,
1348                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x0d,
1349                         0x00),
1350                 raw_pdu(0x05, 0x00, 0x02, 0x00, 0x19, 0x00, 0x16, 0x35,
1351                         0x14, 0x09, 0x00, 0x0d, 0x35, 0x0f, 0x35, 0x0d,
1352                         0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x00, 0x13,
1353                         0x35, 0x03, 0x19, 0x00, 0x11, 0x00));
1354
1355         /*
1356          * Service Attribute Request
1357          *
1358          * Verify the correct behaviour of the IUT when searching
1359          * for existing Attribute, using invalid ServiceRecordHandle.
1360          */
1361         define_sa("BI-01-C",
1362                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0xff, 0xff, 0xff,
1363                         0xff, 0x00, 0x07, 0x35, 0x03, 0x09, 0x00, 0x01,
1364                         0x00),
1365                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02));
1366
1367         /*
1368          * Service Attribute Request
1369          *
1370          * Verify the correct behaviour of the IUT when searching
1371          * for existing Attribute, using invalid request syntax.
1372          */
1373         define_sa("BI-02-C",
1374                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1375                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
1376                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1377                         0x00, 0x01, 0x00),
1378                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1379                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1380                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x01, 0x00,
1381                         0x00, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
1382                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
1383
1384         /*
1385          * Service Attribute Request
1386          *
1387          * Verify the correct behaviour of the IUT when searching
1388          * for existing Attribute, using invalid PDU-Size.
1389          */
1390         define_sa("BI-03-C",
1391                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
1392                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
1393                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1394                         0x00, 0x01, 0x00),
1395                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
1396                         0x01, 0x00, 0x01, 0x00, 0x00, 0x00),
1397                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x11, 0x00, 0x01, 0x00,
1398                         0x00, 0x00, 0x07, 0x35, 0x03, 0x09, 0x00, 0x01,
1399                         0x00),
1400                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
1401
1402         /*
1403          * Service Search Attribute Request
1404          *
1405          * Verify the correct behaviour of the IUT when searching
1406          * for non-existing Service, existing Attribute using
1407          * ServiceSearchAttributeRequest.
1408          */
1409         define_ssa("BV-01-C/UUID-16",
1410                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1411                         0xff, 0xff, 0x00, 0x0a, 0x35, 0x03, 0x09, 0x00,
1412                         0x01, 0x00),
1413                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1414                         0x00, 0x00));
1415         define_ssa("BV-01-C/UUID-32",
1416                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1417                         0xff, 0xff, 0xff, 0xff, 0x00, 0x0a, 0x35, 0x03,
1418                         0x09, 0x00, 0x01, 0x00),
1419                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1420                         0x00, 0x00));
1421         define_ssa("BV-01-C/UUID-128",
1422                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1423                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1424                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1425                         0x00, 0x0a, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
1426                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1427                         0x00, 0x00));
1428
1429         /*
1430          * Service Search Attribute Request
1431          *
1432          * Verify the correct behaviour of the IUT when searching
1433          * for existing Service, non-existing Attribute using
1434          * ServiceSearchAttributeRequest.
1435          */
1436         define_ssa("BV-02-C/UUID-16",
1437                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1438                         0x11, 0x05, 0x00, 0x0a, 0x35, 0x03, 0x09, 0xff,
1439                         0xff, 0x00),
1440                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1441                         0x00, 0x00));
1442         define_ssa("BV-02-C/UUID-32",
1443                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1444                         0x00, 0x00, 0x11, 0x05, 0x00, 0x0a, 0x35, 0x03,
1445                         0x09, 0xff, 0xff, 0x00),
1446                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1447                         0x00, 0x00));
1448         define_ssa("BV-02-C/UUID-128",
1449                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1450                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1451                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1452                         0x00, 0x0a, 0x35, 0x03, 0x09, 0xff, 0xff, 0x00),
1453                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1454                         0x00, 0x00));
1455
1456         /*
1457          * Service Search Attribute Request
1458          *
1459          * Verify the correct behaviour of the IUT when searching
1460          * for non-existing Service, non-existing Attribute using
1461          * ServiceSearchAttributeRequest.
1462          */
1463         define_ssa("BV-03-C/UUID-16",
1464                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1465                         0xff, 0xff, 0x00, 0x0a, 0x35, 0x03, 0x09, 0xff,
1466                         0xff, 0x00),
1467                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1468                         0x00, 0x00));
1469         define_ssa("BV-03-C/UUID-32",
1470                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1471                         0xff, 0xff, 0xff, 0xff, 0x00, 0x0a, 0x35, 0x03,
1472                         0x09, 0xff, 0xff, 0x00),
1473                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1474                         0x00, 0x00));
1475         define_ssa("BV-03-C/UUID-128",
1476                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1477                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1478                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1479                         0x00, 0x0a, 0x35, 0x03, 0x09, 0xff, 0xff, 0x00),
1480                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x35,
1481                         0x00, 0x00));
1482
1483         /*
1484          * Service Search Attribute Request
1485          *
1486          * Verify the correct behaviour of the IUT when searching
1487          * for existing Service(s) and Attribute(s) using
1488          * ServiceSearchAttributeRequest.
1489          */
1490         define_ssa("BV-04-C/UUID-16",
1491                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1492                         0x11, 0x05, 0x00, 0x11, 0x35, 0x03, 0x09, 0x00,
1493                         0x01, 0x00),
1494                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1495                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
1496                         0x19, 0x11, 0x05, 0x00));
1497         define_ssa("BV-04-C/UUID-32",
1498                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1499                         0x00, 0x00, 0x11, 0x05, 0x00, 0x11, 0x35, 0x03,
1500                         0x09, 0x00, 0x01, 0x00),
1501                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1502                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
1503                         0x19, 0x11, 0x05, 0x00));
1504         define_ssa("BV-04-C/UUID-128",
1505                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1506                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1507                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1508                         0x00, 0x11, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
1509                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1510                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
1511                         0x19, 0x11, 0x05, 0x00));
1512
1513         /*
1514          * Service Search Attribute Request
1515          *
1516          * Verify the correct behaviour of the IUT when searching
1517          * for existing Attributes, using Continuation State and
1518          * ServiceSearchAttributeRequest.
1519          */
1520         define_ssa("BV-06-C/UUID-16",
1521                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x10, 0x35, 0x03, 0x19,
1522                         0x11, 0x05, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00,
1523                         0x00, 0x09, 0x00, 0x01, 0x00),
1524                 raw_pdu_cont(8, 0x07, 0x00, 0x01, 0x00, 0x12, 0x00, 0x07, 0x35,
1525                                 0x12, 0x35, 0x10, 0x09, 0x00, 0x00, 0x08),
1526                 raw_pdu_cont(8, 0x06, 0x00, 0x02, 0x00, 0x18, 0x35, 0x03, 0x19,
1527                                 0x11, 0x05, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00,
1528                                 0x00, 0x09, 0x00, 0x01, 0x08),
1529                 raw_pdu_cont(8, 0x07, 0x00, 0x02, 0x00, 0x12, 0x00, 0x07, 0x0a,
1530                                 0x00, 0x01, 0x00, 0x01, 0x09, 0x00, 0x08),
1531                 raw_pdu_cont(8, 0x06, 0x00, 0x03, 0x00, 0x18, 0x35, 0x03, 0x19,
1532                                 0x11, 0x05, 0x00, 0x07, 0x35, 0x06, 0x09, 0x00,
1533                                 0x00, 0x09, 0x00, 0x01, 0x08),
1534                 raw_pdu(0x07, 0x00, 0x03, 0x00, 0x09, 0x00, 0x06, 0x01,
1535                         0x35, 0x03, 0x19, 0x11, 0x05, 0x00));
1536         define_ssa("BV-06-C/UUID-32",
1537                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x12, 0x35, 0x05, 0x1a,
1538                         0x00, 0x00, 0x11, 0x05, 0x00, 0x07, 0x35, 0x06,
1539                         0x09, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00),
1540                 raw_pdu_cont(8, 0x07, 0x00, 0x01, 0x00, 0x12, 0x00, 0x07, 0x35,
1541                                 0x12, 0x35, 0x10, 0x09, 0x00, 0x00, 0x08),
1542                 raw_pdu_cont(8, 0x06, 0x00, 0x02, 0x00, 0x1a, 0x35, 0x05, 0x1a,
1543                                 0x00, 0x00, 0x11, 0x05, 0x00, 0x07, 0x35, 0x06,
1544                                 0x09, 0x00, 0x00, 0x09, 0x00, 0x01, 0x08),
1545                 raw_pdu_cont(8, 0x07, 0x00, 0x02, 0x00, 0x12, 0x00, 0x07, 0x0a,
1546                                 0x00, 0x01, 0x00, 0x01, 0x09, 0x00, 0x08),
1547                 raw_pdu_cont(8, 0x06, 0x00, 0x03, 0x00, 0x1a, 0x35, 0x05, 0x1a,
1548                                 0x00, 0x00, 0x11, 0x05, 0x00, 0x07, 0x35, 0x06,
1549                                 0x09, 0x00, 0x00, 0x09, 0x00, 0x01, 0x08),
1550                 raw_pdu(0x07, 0x00, 0x03, 0x00, 0x09, 0x00, 0x06, 0x01,
1551                         0x35, 0x03, 0x19, 0x11, 0x05, 0x00));
1552         define_ssa("BV-06-C/UUID-128",
1553                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1e, 0x35, 0x11, 0x1c,
1554                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1555                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1556                         0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00, 0x09,
1557                         0x00, 0x01, 0x00),
1558                 raw_pdu_cont(8, 0x07, 0x00, 0x01, 0x00, 0x12, 0x00, 0x07, 0x35,
1559                                 0x12, 0x35, 0x10, 0x09, 0x00, 0x00, 0x08),
1560                 raw_pdu_cont(8, 0x06, 0x00, 0x02, 0x00, 0x26, 0x35, 0x11, 0x1c,
1561                                 0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1562                                 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1563                                 0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00, 0x09,
1564                                 0x00, 0x01, 0x08),
1565                 raw_pdu_cont(8, 0x07, 0x00, 0x02, 0x00, 0x12, 0x00, 0x07, 0x0a,
1566                                 0x00, 0x01, 0x00, 0x01, 0x09, 0x00, 0x08),
1567                 raw_pdu_cont(8, 0x06, 0x00, 0x03, 0x00, 0x26, 0x35, 0x11, 0x1c,
1568                                 0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1569                                 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1570                                 0x00, 0x07, 0x35, 0x06, 0x09, 0x00, 0x00, 0x09,
1571                                 0x00, 0x01, 0x08),
1572                 raw_pdu(0x07, 0x00, 0x03, 0x00, 0x09, 0x00, 0x06, 0x01,
1573                         0x35, 0x03, 0x19, 0x11, 0x05, 0x00));
1574
1575         /*
1576          * Service Search Attribute Request
1577          *
1578          * Verify the correct behaviour of the IUT when searching
1579          * for existing Service(s) and Attribute ServiceRecordState
1580          * using ServiceSearchAttributeRequest.
1581          */
1582         define_ssa("BV-07-C/UUID-16",
1583                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1584                         0x11, 0x01, 0x00, 0x13, 0x35, 0x03, 0x09, 0x00,
1585                         0x02, 0x00),
1586                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1587                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x02, 0x0a, 0x00,
1588                         0x00, 0x12, 0x34, 0x00));
1589         define_ssa("BV-07-C/UUID-32",
1590                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1591                         0x00, 0x00, 0x11, 0x01, 0x00, 0x13, 0x35, 0x03,
1592                         0x09, 0x00, 0x02, 0x00),
1593                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1594                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x02, 0x0a, 0x00,
1595                         0x00, 0x12, 0x34, 0x00));
1596         define_ssa("BV-07-C/UUID-128",
1597                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1598                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1599                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1600                         0x00, 0x13, 0x35, 0x03, 0x09, 0x00, 0x02, 0x00),
1601                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1602                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x02, 0x0a, 0x00,
1603                         0x00, 0x12, 0x34, 0x00));
1604
1605         /*
1606          * Service Search Attribute Request
1607          *
1608          * Verify the correct behaviour of the IUT when searching
1609          * for existing Service(s) and Attribute ServiceDataBaseState
1610          * using ServiceSearchAttributeRequest.
1611          */
1612         define_ssa("BV-08-C/UUID-16",
1613                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1614                         0x10, 0x00, 0x00, 0x13, 0x35, 0x03, 0x09, 0x02,
1615                         0x01, 0x00),
1616                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1617                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x01, 0x0a, 0x49,
1618                         0x6f, 0x06, 0x54, 0x00));
1619         define_ssa("BV-08-C/UUID-32",
1620                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1621                         0x00, 0x00, 0x10, 0x00, 0x00, 0x13, 0x35, 0x03,
1622                         0x09, 0x02, 0x01, 0x00),
1623                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1624                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x01, 0x0a, 0x49,
1625                         0x6f, 0x06, 0x54, 0x00));
1626         define_ssa("BV-08-C/UUID-128",
1627                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1628                         0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
1629                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1630                         0x00, 0x13, 0x35, 0x03, 0x09, 0x02, 0x01, 0x00),
1631                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1632                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x01, 0x0a, 0x49,
1633                         0x6f, 0x06, 0x54, 0x00));
1634
1635         /*
1636          * Service Search Attribute Request
1637          *
1638          * Verify the correct behaviour of the IUT when searching
1639          * for existing Service(s) and Attribute ServiceInfoTimeToLive
1640          * using ServiceSearchAttributeRequest.
1641          */
1642         define_ssa("BV-09-C/UUID-16",
1643                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1644                         0x11, 0x01, 0x00, 0x13, 0x35, 0x03, 0x09, 0x00,
1645                         0x07, 0x00),
1646                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1647                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x07, 0x0a, 0x00,
1648                         0x00, 0xff, 0xff, 0x00));
1649         define_ssa("BV-09-C/UUID-32",
1650                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1651                         0x00, 0x00, 0x11, 0x01, 0x00, 0x13, 0x35, 0x03,
1652                         0x09, 0x00, 0x07, 0x00),
1653                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1654                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x07, 0x0a, 0x00,
1655                         0x00, 0xff, 0xff, 0x00));
1656         define_ssa("BV-09-C/UUID-128",
1657                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1658                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1659                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1660                         0x00, 0x13, 0x35, 0x03, 0x09, 0x00, 0x07, 0x00),
1661                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1662                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x07, 0x0a, 0x00,
1663                         0x00, 0xff, 0xff, 0x00));
1664
1665         /*
1666          * Service Search Attribute Request
1667          *
1668          * Verify the correct behaviour of the IUT when searching
1669          * for existing Service(s) and Attribute ServiceID using
1670          * ServiceSearchAttributeRequest.
1671          */
1672         define_ssa("BV-10-C/UUID-16",
1673                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1674                         0x11, 0x01, 0x00, 0x1e, 0x35, 0x03, 0x09, 0x00,
1675                         0x03, 0x00),
1676                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1677                         0x08, 0x35, 0x06, 0x09, 0x00, 0x03, 0x19, 0x11,
1678                         0x01, 0x00));
1679         define_ssa("BV-10-C/UUID-32",
1680                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1681                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1e, 0x35, 0x03,
1682                         0x09, 0x00, 0x03, 0x00),
1683                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1684                         0x08, 0x35, 0x06, 0x09, 0x00, 0x03, 0x19, 0x11,
1685                         0x01, 0x00));
1686         define_ssa("BV-10-C/UUID-128",
1687                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1688                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1689                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1690                         0x00, 0x1e, 0x35, 0x03, 0x09, 0x00, 0x03, 0x00),
1691                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
1692                         0x08, 0x35, 0x06, 0x09, 0x00, 0x03, 0x19, 0x11,
1693                         0x01, 0x00));
1694
1695         /*
1696          * Service Search Attribute Request
1697          *
1698          * Verify the correct behaviour of the IUT when searching
1699          * for existing Service(s) and Attribute ProtocolDescriptorList
1700          * using ServiceSearchAttributeRequest.
1701          */
1702         define_ssa("BV-11-C/UUID-16",
1703                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1704                         0x11, 0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
1705                         0x04, 0x00),
1706                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1d, 0x00, 0x1a, 0x35,
1707                         0x18, 0x35, 0x16, 0x09, 0x00, 0x04, 0x35, 0x11,
1708                         0x35, 0x03, 0x19, 0x01, 0x00, 0x35, 0x05, 0x19,
1709                         0x00, 0x03, 0x08, 0x09, 0x35, 0x03, 0x19, 0x00,
1710                         0x08, 0x00));
1711         define_ssa("BV-11-C/UUID-32",
1712                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1713                         0x00, 0x00, 0x11, 0x05, 0xff, 0xff, 0x35, 0x03,
1714                         0x09, 0x00, 0x04, 0x00),
1715                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1d, 0x00, 0x1a, 0x35,
1716                         0x18, 0x35, 0x16, 0x09, 0x00, 0x04, 0x35, 0x11,
1717                         0x35, 0x03, 0x19, 0x01, 0x00, 0x35, 0x05, 0x19,
1718                         0x00, 0x03, 0x08, 0x09, 0x35, 0x03, 0x19, 0x00,
1719                         0x08, 0x00));
1720         define_ssa("BV-11-C/UUID-128",
1721                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1722                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1723                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1724                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x04, 0x00),
1725                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1d, 0x00, 0x1a, 0x35,
1726                         0x18, 0x35, 0x16, 0x09, 0x00, 0x04, 0x35, 0x11,
1727                         0x35, 0x03, 0x19, 0x01, 0x00, 0x35, 0x05, 0x19,
1728                         0x00, 0x03, 0x08, 0x09, 0x35, 0x03, 0x19, 0x00,
1729                         0x08, 0x00));
1730
1731         /*
1732          * Service Search Attribute Request
1733          *
1734          * Verify the correct behaviour of the IUT when searching
1735          * for existing Service(s) and Attribute BrowseGroupList
1736          * using ServiceSearchAttributeRequest.
1737          */
1738         define_ssa("BV-12-C/UUID-16",
1739                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1740                         0x11, 0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
1741                         0x05, 0x00),
1742                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1743                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x05, 0x35, 0x03,
1744                         0x19, 0x10, 0x02, 0x00));
1745         define_ssa("BV-12-C/UUID-32",
1746                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1747                         0x00, 0x00, 0x11, 0x05, 0xff, 0xff, 0x35, 0x03,
1748                         0x09, 0x00, 0x05, 0x00),
1749                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1750                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x05, 0x35, 0x03,
1751                         0x19, 0x10, 0x02, 0x00));
1752         define_ssa("BV-12-C/UUID-128",
1753                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1754                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
1755                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1756                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x05, 0x00),
1757                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
1758                         0x0a, 0x35, 0x08, 0x09, 0x00, 0x05, 0x35, 0x03,
1759                         0x19, 0x10, 0x02, 0x00));
1760
1761         /*
1762          * Service Search Attribute Request
1763          *
1764          * Verify the correct behaviour of the IUT when searching
1765          * for existing Service(s) and Attribute LanguageBaseAttributeIdList
1766          * using ServiceSearchAttributeRequest.
1767          */
1768         define_ssa("BV-13-C/UUID-16",
1769                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1770                         0x11, 0x01, 0x00, 0x18, 0x35, 0x03, 0x09, 0x00,
1771                         0x06, 0x00),
1772                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1773                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1774                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1775                         0x00, 0x00));
1776         define_ssa("BV-13-C/UUID-32",
1777                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1778                         0x00, 0x00, 0x11, 0x01, 0x00, 0x18, 0x35, 0x03,
1779                         0x09, 0x00, 0x06, 0x00),
1780                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1781                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1782                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1783                         0x00, 0x00));
1784         define_ssa("BV-13-C/UUID-128",
1785                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1786                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1787                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1788                         0x00, 0x18, 0x35, 0x03, 0x09, 0x00, 0x06, 0x00),
1789                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1790                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1791                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1792                         0x00, 0x00));
1793
1794         /*
1795          * Service Search Attribute Request
1796          *
1797          * Verify the correct behaviour of the IUT when searching
1798          * for existing Service(s) and Attribute ServiceAvailability
1799          * using ServiceSearchAttributeRequest.
1800          */
1801         define_ssa("BV-14-C/UUID-16",
1802                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1803                         0x11, 0x01, 0x00, 0x0f, 0x35, 0x03, 0x09, 0x00,
1804                         0x08, 0x00),
1805                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x09, 0x35,
1806                         0x07, 0x35, 0x05, 0x09, 0x00, 0x08, 0x08, 0xff,
1807                         0x00));
1808         define_ssa("BV-14-C/UUID-32",
1809                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1810                         0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x35, 0x03,
1811                         0x09, 0x00, 0x08, 0x00),
1812                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x09, 0x35,
1813                         0x07, 0x35, 0x05, 0x09, 0x00, 0x08, 0x08, 0xff,
1814                         0x00));
1815         define_ssa("BV-14-C/UUID-128",
1816                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1817                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1818                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1819                         0x00, 0x0f, 0x35, 0x03, 0x09, 0x00, 0x08, 0x00),
1820                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x09, 0x35,
1821                         0x07, 0x35, 0x05, 0x09, 0x00, 0x08, 0x08, 0xff,
1822                         0x00));
1823
1824         /*
1825          * Service Search Attribute Request
1826          *
1827          * Verify the correct behaviour of the IUT when searching
1828          * for existing Service(s) and Attribute IconURL using
1829          * ServiceSearchAttributeRequest.
1830          */
1831         define_ssa("BV-15-C/UUID-16",
1832                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1833                         0x11, 0x01, 0x00, 0x24, 0x35, 0x03, 0x09, 0x00,
1834                         0x0c, 0x00),
1835                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
1836                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0c, 0x45, 0x15,
1837                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
1838                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
1839                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
1840         define_ssa("BV-15-C/UUID-32",
1841                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1842                         0x00, 0x00, 0x11, 0x01, 0x00, 0x24, 0x35, 0x03,
1843                         0x09, 0x00, 0x0c, 0x00),
1844                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
1845                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0c, 0x45, 0x15,
1846                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
1847                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
1848                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
1849         define_ssa("BV-15-C/UUID-128",
1850                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1851                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1852                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1853                         0x00, 0x24, 0x35, 0x03, 0x09, 0x00, 0x0c, 0x00),
1854                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
1855                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0c, 0x45, 0x15,
1856                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
1857                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
1858                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
1859
1860         /*
1861          * Service Search Attribute Request
1862          *
1863          * Verify the correct behaviour of the IUT when searching
1864          * for existing Service(s) and Attribute ServiceName using
1865          * ServiceSearchAttributeRequest.
1866          */
1867         define_ssa("BV-16-C/UUID-16",
1868                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1869                         0x11, 0x01, 0x00, 0x1b, 0x35, 0x03, 0x09, 0x00,
1870                         0x06, 0x00),
1871                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1872                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1873                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1874                         0x00, 0x00),
1875                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0d, 0x35, 0x03, 0x19,
1876                         0x11, 0x01, 0x00, 0x1d, 0x35, 0x03, 0x09, 0x01,
1877                         0x00, 0x00),
1878                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x17, 0x00, 0x14, 0x35,
1879                         0x12, 0x35, 0x10, 0x09, 0x01, 0x00, 0x25, 0x0b,
1880                         0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x20, 0x50,
1881                         0x6f, 0x72, 0x74, 0x00));
1882         define_ssa("BV-16-C/UUID-32",
1883                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1884                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1b, 0x35, 0x03,
1885                         0x09, 0x00, 0x06, 0x00),
1886                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1887                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1888                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1889                         0x00, 0x00),
1890                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1891                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1d, 0x35, 0x03,
1892                         0x09, 0x01, 0x00, 0x00),
1893                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x17, 0x00, 0x14, 0x35,
1894                         0x12, 0x35, 0x10, 0x09, 0x01, 0x00, 0x25, 0x0b,
1895                         0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x20, 0x50,
1896                         0x6f, 0x72, 0x74, 0x00));
1897         define_ssa("BV-16-C/UUID-128",
1898                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1899                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1900                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1901                         0x00, 0x1b, 0x35, 0x03, 0x09, 0x00, 0x06, 0x00),
1902                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1903                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1904                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1905                         0x00, 0x00),
1906                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1907                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1908                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1909                         0x00, 0x1d, 0x35, 0x03, 0x09, 0x01, 0x00, 0x00),
1910                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x17, 0x00, 0x14, 0x35,
1911                         0x12, 0x35, 0x10, 0x09, 0x01, 0x00, 0x25, 0x0b,
1912                         0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x20, 0x50,
1913                         0x6f, 0x72, 0x74, 0x00));
1914
1915         /*
1916          * Service Search Attribute Request
1917          *
1918          * Verify the correct behaviour of the IUT when searching
1919          * for existing Service(s) and Attribute ServiceDescription
1920          * using ServiceSearchAttributeRequest.
1921          */
1922         define_ssa("BV-17-C/UUID-16",
1923                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1924                         0x11, 0x01, 0x00, 0x1b, 0x35, 0x03, 0x09, 0x00,
1925                         0x06, 0x00),
1926                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1927                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1928                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1929                         0x00, 0x00),
1930                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0d, 0x35, 0x03, 0x19,
1931                         0x11, 0x01, 0x00, 0x1a, 0x35, 0x03, 0x09, 0x01,
1932                         0x01, 0x00),
1933                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x14, 0x00, 0x11, 0x35,
1934                         0x0f, 0x35, 0x0d, 0x09, 0x01, 0x01, 0x25, 0x08,
1935                         0x43, 0x4f, 0x4d, 0x20, 0x50, 0x6f, 0x72, 0x74,
1936                         0x00));
1937         define_ssa("BV-17-C/UUID-32",
1938                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1939                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1b, 0x35, 0x03,
1940                         0x09, 0x00, 0x06, 0x00),
1941                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1942                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1943                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1944                         0x00, 0x00),
1945                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1946                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1a, 0x35, 0x03,
1947                         0x09, 0x01, 0x01, 0x00),
1948                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x14, 0x00, 0x11, 0x35,
1949                         0x0f, 0x35, 0x0d, 0x09, 0x01, 0x01, 0x25, 0x08,
1950                         0x43, 0x4f, 0x4d, 0x20, 0x50, 0x6f, 0x72, 0x74,
1951                         0x00));
1952         define_ssa("BV-17-C/UUID-128",
1953                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1954                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1955                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1956                         0x00, 0x1b, 0x35, 0x03, 0x09, 0x00, 0x06, 0x00),
1957                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1958                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1959                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1960                         0x00, 0x00),
1961                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x1b, 0x35, 0x11, 0x1c,
1962                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
1963                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
1964                         0x00, 0x1a, 0x35, 0x03, 0x09, 0x01, 0x01, 0x00),
1965                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x14, 0x00, 0x11, 0x35,
1966                         0x0f, 0x35, 0x0d, 0x09, 0x01, 0x01, 0x25, 0x08,
1967                         0x43, 0x4f, 0x4d, 0x20, 0x50, 0x6f, 0x72, 0x74,
1968                         0x00));
1969
1970         /*
1971          * Service Search Attribute Request
1972          *
1973          * Verify the correct behaviour of the IUT when searching
1974          * for existing Service(s) and Attribute ProviderName using
1975          * ServiceSearchAttributeRequest.
1976          */
1977         define_ssa("BV-18-C/UUID-16",
1978                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
1979                         0x11, 0x01, 0x00, 0x1b, 0x35, 0x03, 0x09, 0x00,
1980                         0x06, 0x00),
1981                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1982                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1983                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1984                         0x00, 0x00),
1985                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0d, 0x35, 0x03, 0x19,
1986                         0x11, 0x01, 0x00, 0x17, 0x35, 0x03, 0x09, 0x01,
1987                         0x02, 0x00),
1988                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x11, 0x00, 0x0e, 0x35,
1989                         0x0c, 0x35, 0x0a, 0x09, 0x01, 0x02, 0x25, 0x05,
1990                         0x42, 0x6c, 0x75, 0x65, 0x5a, 0x00));
1991         define_ssa("BV-18-C/UUID-32",
1992                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
1993                         0x00, 0x00, 0x11, 0x01, 0x00, 0x1b, 0x35, 0x03,
1994                         0x09, 0x00, 0x06, 0x00),
1995                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
1996                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
1997                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
1998                         0x00, 0x00),
1999                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2000                         0x00, 0x00, 0x11, 0x01, 0x00, 0x17, 0x35, 0x03,
2001                         0x09, 0x01, 0x02, 0x00),
2002                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x11, 0x00, 0x0e, 0x35,
2003                         0x0c, 0x35, 0x0a, 0x09, 0x01, 0x02, 0x25, 0x05,
2004                         0x42, 0x6c, 0x75, 0x65, 0x5a, 0x00));
2005         define_ssa("BV-18-C/UUID-128",
2006                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2007                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
2008                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2009                         0x00, 0x1b, 0x35, 0x03, 0x09, 0x00, 0x06, 0x00),
2010                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x15, 0x00, 0x12, 0x35,
2011                         0x10, 0x35, 0x0e, 0x09, 0x00, 0x06, 0x35, 0x09,
2012                         0x09, 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01,
2013                         0x00, 0x00),
2014                 raw_pdu(0x06, 0x00, 0x02, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2015                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
2016                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2017                         0x00, 0x17, 0x35, 0x03, 0x09, 0x01, 0x02, 0x00),
2018                 raw_pdu(0x07, 0x00, 0x02, 0x00, 0x11, 0x00, 0x0e, 0x35,
2019                         0x0c, 0x35, 0x0a, 0x09, 0x01, 0x02, 0x25, 0x05,
2020                         0x42, 0x6c, 0x75, 0x65, 0x5a, 0x00));
2021
2022         /*
2023          * Service Search Attribute Request
2024          *
2025          * Verify the correct behaviour of the IUT when searching
2026          * for existing Service(s) and Attribute VersionNumberList
2027          * using ServiceSearchAttributeRequest.
2028          */
2029         define_ssa("BV-19-C/UUID-16",
2030                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2031                         0x10, 0x00, 0x00, 0x12, 0x35, 0x03, 0x09, 0x02,
2032                         0x00, 0x00),
2033                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
2034                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x00, 0x35, 0x03,
2035                         0x09, 0x01, 0x00, 0x00));
2036         define_ssa("BV-19-C/UUID-32",
2037                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2038                         0x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x35, 0x03,
2039                         0x09, 0x02, 0x00, 0x00),
2040                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
2041                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x00, 0x35, 0x03,
2042                         0x09, 0x01, 0x00, 0x00));
2043         define_ssa("BV-19-C/UUID-128",
2044                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2045                         0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
2046                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2047                         0x00, 0x12, 0x35, 0x03, 0x09, 0x02, 0x00, 0x00),
2048                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x0c, 0x35,
2049                         0x0a, 0x35, 0x08, 0x09, 0x02, 0x00, 0x35, 0x03,
2050                         0x09, 0x01, 0x00, 0x00));
2051
2052         /*
2053          * Service Search Attribute Request
2054          *
2055          * Verify the correct behaviour of the IUT when searching for
2056          * existing Service(s) and Attribute BluetoothProfileDescriptorList
2057          * using ServiceSearchAttributeRequest.
2058          */
2059         define_ssa("BV-20-C/UUID-16",
2060                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2061                         0x11, 0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
2062                         0x09, 0x00),
2063                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x14, 0x00, 0x11, 0x35,
2064                         0x0f, 0x35, 0x0d, 0x09, 0x00, 0x09, 0x35, 0x08,
2065                         0x35, 0x06, 0x19, 0x11, 0x05, 0x09, 0x01, 0x00,
2066                         0x00));
2067         define_ssa("BV-20-C/UUID-32",
2068                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2069                         0x00, 0x00, 0x11, 0x05, 0xff, 0xff, 0x35, 0x03,
2070                         0x09, 0x00, 0x09, 0x00),
2071                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x14, 0x00, 0x11, 0x35,
2072                         0x0f, 0x35, 0x0d, 0x09, 0x00, 0x09, 0x35, 0x08,
2073                         0x35, 0x06, 0x19, 0x11, 0x05, 0x09, 0x01, 0x00,
2074                         0x00));
2075         define_ssa("BV-20-C/UUID-128",
2076                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2077                         0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
2078                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2079                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x09, 0x00),
2080                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x14, 0x00, 0x11, 0x35,
2081                         0x0f, 0x35, 0x0d, 0x09, 0x00, 0x09, 0x35, 0x08,
2082                         0x35, 0x06, 0x19, 0x11, 0x05, 0x09, 0x01, 0x00,
2083                         0x00));
2084
2085         /*
2086          * Service Search Attribute Request
2087          *
2088          * Verify the correct behaviour of the IUT when searching
2089          * for existing Service(s) and Attribute DocumentationURL
2090          * using ServiceSearchAttributeRequest.
2091          */
2092         define_ssa("BV-21-C/UUID-16",
2093                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2094                         0x11, 0x01, 0x00, 0x24, 0x35, 0x03, 0x09, 0x00,
2095                         0x0a, 0x00),
2096                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2097                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0a, 0x45, 0x15,
2098                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2099                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2100                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2101         define_ssa("BV-21-C/UUID-32",
2102                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2103                         0x00, 0x00, 0x11, 0x01, 0x00, 0x24, 0x35, 0x03,
2104                         0x09, 0x00, 0x0a, 0x00),
2105                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2106                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0a, 0x45, 0x15,
2107                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2108                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2109                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2110         define_ssa("BV-21-C/UUID-128",
2111                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2112                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
2113                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2114                         0x00, 0x24, 0x35, 0x03, 0x09, 0x00, 0x0a, 0x00),
2115                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2116                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0a, 0x45, 0x15,
2117                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2118                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2119                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2120
2121         /*
2122          * Service Search Attribute Request
2123          *
2124          * Verify the correct behaviour of the IUT when searching
2125          * for existing Service(s) and Attribute ClientExecutableURL
2126          * using ServiceSearchAttributeRequest.
2127          */
2128         define_ssa("BV-22-C/UUID-16",
2129                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2130                         0x11, 0x01, 0x00, 0x24, 0x35, 0x03, 0x09, 0x00,
2131                         0x0b, 0x00),
2132                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2133                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0b, 0x45, 0x15,
2134                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2135                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2136                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2137         define_ssa("BV-22-C/UUID-32",
2138                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2139                         0x00, 0x00, 0x11, 0x01, 0x00, 0x24, 0x35, 0x03,
2140                         0x09, 0x00, 0x0b, 0x00),
2141                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2142                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0b, 0x45, 0x15,
2143                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2144                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2145                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2146         define_ssa("BV-22-C/UUID-128",
2147                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2148                         0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,
2149                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2150                         0x00, 0x24, 0x35, 0x03, 0x09, 0x00, 0x0b, 0x00),
2151                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x21, 0x00, 0x1e, 0x35,
2152                         0x1c, 0x35, 0x1a, 0x09, 0x00, 0x0b, 0x45, 0x15,
2153                         0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
2154                         0x77, 0x77, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x7a,
2155                         0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x00));
2156
2157         /*
2158          * Service Search Attribute Request
2159          *
2160          * Verify the correct behaviour of the IUT when searching for
2161          * existing Service(s) and Attribute AdditionalProtocolDescriptorList
2162          * using ServiceSearchAttributeRequest.
2163          */
2164         define_ssa("BV-23-C/UUID-16",
2165                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2166                         0x11, 0x24, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
2167                         0x0d, 0x00),
2168                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1b, 0x00, 0x18, 0x35,
2169                         0x16, 0x35, 0x14, 0x09, 0x00, 0x0d, 0x35, 0x0f,
2170                         0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09,
2171                         0x00, 0x13, 0x35, 0x03, 0x19, 0x00, 0x11, 0x00));
2172         define_ssa("BV-23-C/UUID-32",
2173                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2174                         0x00, 0x00, 0x11, 0x24, 0xff, 0xff, 0x35, 0x03,
2175                         0x09, 0x00, 0x0d, 0x00),
2176                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1b, 0x00, 0x18, 0x35,
2177                         0x16, 0x35, 0x14, 0x09, 0x00, 0x0d, 0x35, 0x0f,
2178                         0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09,
2179                         0x00, 0x13, 0x35, 0x03, 0x19, 0x00, 0x11, 0x00));
2180         define_ssa("BV-23-C/UUID-128",
2181                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2182                         0x00, 0x00, 0x11, 0x24, 0x00, 0x00, 0x10, 0x00,
2183                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2184                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x0d, 0x00),
2185                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x1b, 0x00, 0x18, 0x35,
2186                         0x16, 0x35, 0x14, 0x09, 0x00, 0x0d, 0x35, 0x0f,
2187                         0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09,
2188                         0x00, 0x13, 0x35, 0x03, 0x19, 0x00, 0x11, 0x00));
2189
2190         /*
2191          * Service Search Attribute Request
2192          *
2193          * Verify the correct behaviour of the IUT when searching
2194          * for existing Attribute, using invalid request syntax,
2195          * using the ServiceSearchAttributeRequest PDU.
2196          */
2197         define_ssa("BI-01-C/UUID-16",
2198                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0b, 0x35, 0x03, 0x19,
2199                         0x01, 0x00, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
2200                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
2201         define_ssa("BI-01-C/UUID-32",
2202                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x05, 0x1a,
2203                         0x00, 0x00, 0x01, 0x00, 0x35, 0x03, 0x09, 0x00,
2204                         0x01, 0x00),
2205                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
2206         define_ssa("BI-01-C/UUID-128",
2207                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x19, 0x35, 0x11, 0x1c,
2208                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
2209                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2210                         0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
2211                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03));
2212
2213         /*
2214          * Service Search Attribute Request
2215          *
2216          * Verify the correct behaviour of the IUT when searching
2217          * for existing Attribute, using invalid PDU-size, using the
2218          * ServiceSearchAttributeRequest PDU.
2219          */
2220         define_ssa("BI-02-C/UUID-16",
2221                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x12, 0x35, 0x03, 0x19,
2222                         0x01, 0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
2223                         0x01, 0x00),
2224                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
2225         define_ssa("BI-02-C/UUID-32",
2226                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x14, 0x35, 0x05, 0x1a,
2227                         0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x35, 0x03,
2228                         0x09, 0x00, 0x01, 0x00),
2229                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
2230         define_ssa("BI-02-C/UUID-128",
2231                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x20, 0x35, 0x11, 0x1c,
2232                         0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
2233                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2234                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
2235                 raw_pdu(0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04));
2236
2237         /*
2238          * Service Browse
2239          *
2240          * Verify that the IUT behave correct using SDP_ServiceSearchRequest
2241          * and SDP_ServiceAttributeRequest for Service Browse.
2242          */
2243         define_brw("BV-01-C/UUID-16",
2244                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
2245                         0x10, 0x02, 0xff, 0xff, 0x00),
2246                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2247                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2248                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2249                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2250                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2251                         0x07, 0x00),
2252                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2253                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2254                         0x00),
2255                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2256                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2257                         0x01, 0x00),
2258                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2259                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2260                         0x00),
2261                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2262                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2263                         0x05, 0x00),
2264                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2265                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2266                         0x00),
2267                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2268                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2269                         0x24, 0x00),
2270                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2271                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2272                         0x00),
2273                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2274                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2275                         0x06, 0x00),
2276                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2277                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2278                         0x00),
2279                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2280                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2281                         0x06, 0x00),
2282                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2283                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2284                         0x00),
2285                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2286                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2287                         0x06, 0x00),
2288                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2289                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2290                         0x00),
2291                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2292                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2293                         0x06, 0x00),
2294                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2295                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2296                         0x00),
2297                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2298                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2299                         0x06, 0x00),
2300                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
2301                         0x10, 0x01, 0xff, 0xff, 0x00),
2302                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
2303                         0x01, 0x00, 0x00, 0x00, 0x01, 0x00),
2304                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00,
2305                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x02, 0x00,
2306                         0x00),
2307                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x35,
2308                         0x06, 0x09, 0x02, 0x00, 0x19, 0x10, 0x02, 0x00),
2309                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x08, 0x35, 0x03, 0x19,
2310                         0x10, 0x02, 0xff, 0xff, 0x00),
2311                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2312                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2313                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2314                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2315                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2316                         0x07, 0x00),
2317                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2318                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2319                         0x00),
2320                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2321                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2322                         0x01, 0x00),
2323                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2324                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2325                         0x00),
2326                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2327                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2328                         0x05, 0x00),
2329                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2330                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2331                         0x00),
2332                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2333                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2334                         0x24, 0x00),
2335                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2336                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2337                         0x00),
2338                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2339                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2340                         0x06, 0x00),
2341                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2342                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2343                         0x00),
2344                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2345                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2346                         0x06, 0x00),
2347                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2348                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2349                         0x00),
2350                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2351                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2352                         0x06, 0x00),
2353                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2354                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2355                         0x00),
2356                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2357                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2358                         0x06, 0x00),
2359                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2360                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2361                         0x00),
2362                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2363                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2364                         0x06, 0x00));
2365         define_brw("BV-01-C/UUID-32",
2366                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
2367                         0x00, 0x00, 0x10, 0x02, 0xff, 0xff, 0x00),
2368                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2369                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2370                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2371                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2372                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2373                         0x07, 0x00),
2374                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2375                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2376                         0x00),
2377                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2378                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2379                         0x01, 0x00),
2380                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2381                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2382                         0x00),
2383                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2384                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2385                         0x05, 0x00),
2386                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2387                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2388                         0x00),
2389                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2390                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2391                         0x24, 0x00),
2392                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2393                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2394                         0x00),
2395                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2396                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2397                         0x06, 0x00),
2398                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2399                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2400                         0x00),
2401                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2402                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2403                         0x06, 0x00),
2404                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2405                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2406                         0x00),
2407                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2408                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2409                         0x06, 0x00),
2410                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2411                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2412                         0x00),
2413                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2414                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2415                         0x06, 0x00),
2416                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2417                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2418                         0x00),
2419                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2420                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2421                         0x06, 0x00),
2422                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
2423                         0x00, 0x00, 0x10, 0x01, 0xff, 0xff, 0x00),
2424                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
2425                         0x01, 0x00, 0x00, 0x00, 0x01, 0x00),
2426                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00,
2427                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x02, 0x00,
2428                         0x00),
2429                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x35,
2430                         0x06, 0x09, 0x02, 0x00, 0x19, 0x10, 0x02, 0x00),
2431                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x0a, 0x35, 0x05, 0x1a,
2432                         0x00, 0x00, 0x10, 0x02, 0xff, 0xff, 0x00),
2433                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2434                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2435                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2436                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2437                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2438                         0x07, 0x00),
2439                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2440                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2441                         0x00),
2442                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2443                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2444                         0x01, 0x00),
2445                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2446                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2447                         0x00),
2448                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2449                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2450                         0x05, 0x00),
2451                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2452                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2453                         0x00),
2454                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2455                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2456                         0x24, 0x00),
2457                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2458                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2459                         0x00),
2460                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2461                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2462                         0x06, 0x00),
2463                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2464                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2465                         0x00),
2466                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2467                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2468                         0x06, 0x00),
2469                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2470                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2471                         0x00),
2472                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2473                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2474                         0x06, 0x00),
2475                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2476                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2477                         0x00),
2478                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2479                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2480                         0x06, 0x00),
2481                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2482                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2483                         0x00),
2484                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2485                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2486                         0x06, 0x00));
2487         define_brw("BV-01-C/UUID-128",
2488                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
2489                         0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
2490                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2491                         0xff, 0xff, 0x00),
2492                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2493                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2494                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2495                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2496                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2497                         0x07, 0x00),
2498                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2499                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2500                         0x00),
2501                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2502                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2503                         0x01, 0x00),
2504                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2505                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2506                         0x00),
2507                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2508                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2509                         0x05, 0x00),
2510                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2511                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2512                         0x00),
2513                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2514                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2515                         0x24, 0x00),
2516                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2517                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2518                         0x00),
2519                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2520                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2521                         0x06, 0x00),
2522                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2523                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2524                         0x00),
2525                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2526                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2527                         0x06, 0x00),
2528                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2529                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2530                         0x00),
2531                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2532                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2533                         0x06, 0x00),
2534                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2535                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2536                         0x00),
2537                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2538                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2539                         0x06, 0x00),
2540                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2541                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2542                         0x00),
2543                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2544                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2545                         0x06, 0x00),
2546                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
2547                         0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x00,
2548                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2549                         0xff, 0xff, 0x00),
2550                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x09, 0x00, 0x01, 0x00,
2551                         0x01, 0x00, 0x00, 0x00, 0x01, 0x00),
2552                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00,
2553                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x02, 0x00,
2554                         0x00),
2555                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x35,
2556                         0x06, 0x09, 0x02, 0x00, 0x19, 0x10, 0x02, 0x00),
2557                 raw_pdu(0x02, 0x00, 0x01, 0x00, 0x16, 0x35, 0x11, 0x1c,
2558                         0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
2559                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2560                         0xff, 0xff, 0x00),
2561                 raw_pdu(0x03, 0x00, 0x01, 0x00, 0x25, 0x00, 0x08, 0x00,
2562                         0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
2563                         0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
2564                         0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
2565                         0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x01, 0x00,
2566                         0x07, 0x00),
2567                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2568                         0x00, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2569                         0x00),
2570                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2571                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2572                         0x01, 0x00),
2573                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2574                         0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2575                         0x00),
2576                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2577                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2578                         0x05, 0x00),
2579                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2580                         0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2581                         0x00),
2582                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2583                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2584                         0x24, 0x00),
2585                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2586                         0x03, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2587                         0x00),
2588                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2589                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2590                         0x06, 0x00),
2591                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2592                         0x04, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2593                         0x00),
2594                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2595                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2596                         0x06, 0x00),
2597                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2598                         0x05, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2599                         0x00),
2600                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2601                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2602                         0x06, 0x00),
2603                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2604                         0x06, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2605                         0x00),
2606                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2607                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2608                         0x06, 0x00),
2609                 raw_pdu(0x04, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x01, 0x00,
2610                         0x07, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01,
2611                         0x00),
2612                 raw_pdu(0x05, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2613                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2614                         0x06, 0x00));
2615
2616         /*
2617          * Service Browse
2618          *
2619          * Verify that the IUT behave correct using
2620          * SDP_ServiceSearchAttributeRequest for Service Browse.
2621          */
2622         define_brw("BV-02-C/UUID-16",
2623                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2624                         0x10, 0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
2625                         0x01, 0x00),
2626                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2627                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2628                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2629                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2630                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2631                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2632                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2633                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2634                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2635                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2636                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2637                         0x06, 0x00),
2638                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2639                         0x10, 0x01, 0xff, 0xff, 0x35, 0x03, 0x09, 0x02,
2640                         0x00, 0x00),
2641                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2642                         0x08, 0x35, 0x06, 0x09, 0x02, 0x00, 0x19, 0x10,
2643                         0x02, 0x00),
2644                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0d, 0x35, 0x03, 0x19,
2645                         0x10, 0x02, 0xff, 0xff, 0x35, 0x03, 0x09, 0x00,
2646                         0x01, 0x00),
2647                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2648                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2649                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2650                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2651                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2652                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2653                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2654                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2655                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2656                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2657                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2658                         0x06, 0x00));
2659         define_brw("BV-02-C/UUID-32",
2660                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2661                         0x00, 0x00, 0x10, 0x02, 0xff, 0xff, 0x35, 0x03,
2662                         0x09, 0x00, 0x01, 0x00),
2663                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2664                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2665                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2666                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2667                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2668                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2669                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2670                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2671                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2672                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2673                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2674                         0x06, 0x00),
2675                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2676                         0x00, 0x00, 0x10, 0x01, 0xff, 0xff, 0x35, 0x03,
2677                         0x09, 0x02, 0x00, 0x00),
2678                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2679                         0x08, 0x35, 0x06, 0x09, 0x02, 0x00, 0x19, 0x10,
2680                         0x02, 0x00),
2681                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x0f, 0x35, 0x05, 0x1a,
2682                         0x00, 0x00, 0x10, 0x02, 0xff, 0xff, 0x35, 0x03,
2683                         0x09, 0x00, 0x01, 0x00),
2684                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2685                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2686                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2687                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2688                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2689                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2690                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2691                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2692                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2693                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2694                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2695                         0x06, 0x00));
2696         define_brw("BV-02-C/UUID-128",
2697                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2698                         0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
2699                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2700                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
2701                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2702                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2703                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2704                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2705                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2706                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2707                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2708                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2709                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2710                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2711                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2712                         0x06, 0x00),
2713                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2714                         0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x00,
2715                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2716                         0xff, 0xff, 0x35, 0x03, 0x09, 0x02, 0x00, 0x00),
2717                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x0d, 0x00, 0x0a, 0x35,
2718                         0x08, 0x35, 0x06, 0x09, 0x02, 0x00, 0x19, 0x10,
2719                         0x02, 0x00),
2720                 raw_pdu(0x06, 0x00, 0x01, 0x00, 0x1b, 0x35, 0x11, 0x1c,
2721                         0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
2722                         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb,
2723                         0xff, 0xff, 0x35, 0x03, 0x09, 0x00, 0x01, 0x00),
2724                 raw_pdu(0x07, 0x00, 0x01, 0x00, 0x55, 0x00, 0x52, 0x35,
2725                         0x50, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2726                         0x19, 0x11, 0x01, 0x35, 0x08, 0x09, 0x00, 0x01,
2727                         0x35, 0x03, 0x19, 0x11, 0x05, 0x35, 0x08, 0x09,
2728                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x35,
2729                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2730                         0x06, 0x35, 0x08, 0x09, 0x00, 0x01, 0x35, 0x03,
2731                         0x19, 0x11, 0x06, 0x35, 0x08, 0x09, 0x00, 0x01,
2732                         0x35, 0x03, 0x19, 0x11, 0x06, 0x35, 0x08, 0x09,
2733                         0x00, 0x01, 0x35, 0x03, 0x19, 0x11, 0x06, 0x35,
2734                         0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
2735                         0x06, 0x00));
2736
2737         /*
2738          * SDP Data Element (DE) tests
2739          *
2740          * Test extraction of valid DEs supported by sdp_extract_attr().
2741          */
2742         define_test_de_attr("TEXT_STR8/empty",
2743                         raw_data(0x25, 0x00),
2744                         exp_data(SDP_TEXT_STR8, str, ""));
2745         define_test_de_attr("TEXT_STR8",
2746                         raw_data(0x25, 0x04, 0x41, 0x42, 0x43, 0x44),
2747                         exp_data(SDP_TEXT_STR8, str, "ABCD"));
2748         define_test_de_attr("TEXT_STR16",
2749                         raw_data(0x26, 0x00, 0x04, 0x41, 0x42, 0x43, 0x44),
2750                         exp_data(SDP_TEXT_STR16, str, "ABCD"));
2751         define_test_de_attr("URL_STR8",
2752                         raw_data(0x45, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a,
2753                                 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x62, 0x6c,
2754                                 0x75, 0x65, 0x7a, 0x2e, 0x6f, 0x72, 0x67,
2755                                 0x2f),
2756                         exp_data(SDP_URL_STR8, str, "http://www.bluez.org/"));
2757         define_test_de_attr("URL_STR16",
2758                         raw_data(0x46, 0x00, 0x15, 0x68, 0x74, 0x74, 0x70,
2759                                 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x62,
2760                                 0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f, 0x72, 0x67,
2761                                 0x2f),
2762                         exp_data(SDP_URL_STR16, str, "http://www.bluez.org/"));
2763         define_test_de_attr("NIL",
2764                         raw_data(0x00),
2765                         exp_data(SDP_DATA_NIL, uint8, 0));
2766         define_test_de_attr("UINT8",
2767                         raw_data(0x08, 0xff),
2768                         exp_data(SDP_UINT8, uint8, UINT8_MAX));
2769         define_test_de_attr("INT8",
2770                         raw_data(0x10, 0x80),
2771                         exp_data(SDP_INT8, int8, INT8_MIN));
2772         define_test_de_attr("BOOL",
2773                         raw_data(0x28, 0x01),
2774                         exp_data(SDP_BOOL, int8, 1));
2775         define_test_de_attr("UINT16",
2776                         raw_data(0x09, 0xff, 0xff),
2777                         exp_data(SDP_UINT16, uint16, UINT16_MAX));
2778         define_test_de_attr("INT16",
2779                         raw_data(0x11, 0x80, 0x00),
2780                         exp_data(SDP_INT16, int16, INT16_MIN));
2781         define_test_de_attr("UINT32",
2782                         raw_data(0x0A, 0xff, 0xff, 0xff, 0xff),
2783                         exp_data(SDP_UINT32, uint32, UINT32_MAX));
2784         define_test_de_attr("INT32",
2785                         raw_data(0x12, 0x80, 0x00, 0x00, 0x00),
2786                         exp_data(SDP_INT32, int32, INT32_MIN));
2787         define_test_de_attr("UINT64",
2788                         raw_data(0x0B, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2789                                                                         0xff),
2790                         exp_data(SDP_UINT64, uint64, UINT64_MAX));
2791         define_test_de_attr("INT64",
2792                         raw_data(0x13, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2793                                                                         0x00),
2794                         exp_data(SDP_INT64, int64, INT64_MIN));
2795         /* UINT128/INT128 are just byte arrays parsed as uint128_t */
2796         define_test_de_attr("UINT128",
2797                         raw_data(0x0C, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2798                                         0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2799                                         0xff, 0xff, 0xff),
2800                         exp_data(SDP_UINT128, uint128,
2801                                 build_u128(0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2802                                                 0xff, 0xff, 0xff, 0xff, 0xff,
2803                                                 0xff, 0xff, 0xff, 0xff, 0xff)));
2804         define_test_de_attr("INT128",
2805                         raw_data(0x14, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2806                                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2807                                         0x00, 0x00, 0x00),
2808                         exp_data(SDP_INT128, uint128,
2809                                 build_u128(0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
2810                                                 0x00, 0x00, 0x00, 0x00, 0x00,
2811                                                 0x00, 0x00, 0x00, 0x00, 0x00)));
2812
2813         return tester_run();
2814 }