1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 *
4 * BlueZ - Bluetooth protocol stack for Linux
5 *
6 * Copyright (C) 2001-2002 Nokia Corporation
7 * Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
8 * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
9 * Copyright (C) 2002-2003 Stephen Crane <steve.crane@rococosoft.com>
10 *
11 *
12 */
13
14#ifndef __SDP_LIB_H
15#define __SDP_LIB_H
16
17#include <sys/socket.h>
18#include <bluetooth/bluetooth.h>
19#include <bluetooth/hci.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*
26 * SDP lists
27 */
28typedef void(*sdp_list_func_t)(void *, void *);
29typedef void(*sdp_free_func_t)(void *);
30typedef int (*sdp_comp_func_t)(const void *, const void *);
31
32sdp_list_t *sdp_list_append(sdp_list_t *list, void *d);
33sdp_list_t *sdp_list_remove(sdp_list_t *list, void *d);
34sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *data, sdp_comp_func_t f);
35void sdp_list_free(sdp_list_t *list, sdp_free_func_t f);
36
37static inline int sdp_list_len(const sdp_list_t *list)
38{
39 int n = 0;
40 for (; list; list = list->next)
41 n++;
42 return n;
43}
44
45static inline sdp_list_t *sdp_list_find(sdp_list_t *list, void *u, sdp_comp_func_t f)
46{
47 for (; list; list = list->next)
48 if (f(list->data, u) == 0)
49 return list;
50 return NULL;
51}
52
53static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u)
54{
55 for (; list; list = list->next)
56 f(list->data, u);
57}
58
59/*
60 * Values of the flags parameter to sdp_record_register
61 */
62#define SDP_RECORD_PERSIST 0x01
63#define SDP_DEVICE_RECORD 0x02
64
65/*
66 * Values of the flags parameter to sdp_connect
67 */
68#define SDP_RETRY_IF_BUSY 0x01
69#define SDP_WAIT_ON_CLOSE 0x02
70#define SDP_NON_BLOCKING 0x04
71#define SDP_LARGE_MTU 0x08
72
73/*
74 * a session with an SDP server
75 */
76typedef struct {
77 int sock;
78 int state;
79 int local;
80 int flags;
81 uint16_t tid; /* Current transaction ID */
82 void *priv;
83} sdp_session_t;
84
85typedef enum {
86 /*
87 * Attributes are specified as individual elements
88 */
89 SDP_ATTR_REQ_INDIVIDUAL = 1,
90 /*
91 * Attributes are specified as a range
92 */
93 SDP_ATTR_REQ_RANGE
94} sdp_attrreq_type_t;
95
96/*
97 * When the pdu_id(type) is a sdp error response, check the status value
98 * to figure out the error reason. For status values 0x0001-0x0006 check
99 * Bluetooth SPEC. If the status is 0xffff, call sdp_get_error function
100 * to get the real reason:
101 * - wrong transaction ID(EPROTO)
102 * - wrong PDU id or(EPROTO)
103 * - I/O error
104 */
105typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata);
106
107/*
108 * create an L2CAP connection to a Bluetooth device
109 *
110 * INPUT:
111 *
112 * bdaddr_t *src:
113 * Address of the local device to use to make the connection
114 * (or BDADDR_ANY)
115 *
116 * bdaddr_t *dst:
117 * Address of the SDP server device
118 */
119sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags);
120int sdp_close(sdp_session_t *session);
121int sdp_get_socket(const sdp_session_t *session);
122
123/*
124 * SDP transaction: functions for asynchronous search.
125 */
126sdp_session_t *sdp_create(int sk, uint32_t flags);
127int sdp_get_error(sdp_session_t *session);
128int sdp_process(sdp_session_t *session);
129int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata);
130
131int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num);
132int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
133int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
134
135uint16_t sdp_gen_tid(sdp_session_t *session);
136
137/*
138 * find all devices in the piconet
139 */
140int sdp_general_inquiry(inquiry_info *ii, int dev_num, int duration, uint8_t *found);
141
142/* flexible extraction of basic attributes - Jean II */
143int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attr, int *value);
144int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value,
145 size_t valuelen);
146
147/*
148 * Basic sdp data functions
149 */
150sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value);
151sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length);
152void sdp_data_free(sdp_data_t *data);
153sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id);
154
155sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len);
156sdp_data_t *sdp_seq_alloc_with_length(void **dtds, void **values, int *length, int len);
157sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data);
158
159int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data);
160void sdp_attr_remove(sdp_record_t *rec, uint16_t attr);
161void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *data);
162int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t attr, sdp_list_t *seq);
163int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp);
164
165/*
166 * NOTE that none of the functions below will update the SDP server,
167 * unless the {register, update}sdp_record_t() function is invoked.
168 * All functions which return an integer value, return 0 on success
169 * or -1 on failure.
170 */
171
172/*
173 * Create an attribute and add it to the service record's attribute list.
174 * This consists of the data type descriptor of the attribute,
175 * the value of the attribute and the attribute identifier.
176 */
177int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *p);
178
179/*
180 * Set the information attributes of the service record.
181 * The set of attributes comprises service name, description
182 * and provider name
183 */
184void sdp_set_info_attr(sdp_record_t *rec, const char *name, const char *prov, const char *desc);
185
186/*
187 * Set the ServiceClassID attribute to the sequence specified by seq.
188 * Note that the identifiers need to be in sorted order from the most
189 * specific to the most generic service class that this service
190 * conforms to.
191 */
192static inline int sdp_set_service_classes(sdp_record_t *rec, sdp_list_t *seq)
193{
194 return sdp_set_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seq);
195}
196
197/*
198 * Get the service classes to which the service conforms.
199 *
200 * When set, the list contains elements of ServiceClassIdentifer(uint16_t)
201 * ordered from most specific to most generic
202 */
203static inline int sdp_get_service_classes(const sdp_record_t *rec, sdp_list_t **seqp)
204{
205 return sdp_get_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seqp);
206}
207
208/*
209 * Set the BrowseGroupList attribute to the list specified by seq.
210 *
211 * A service can belong to one or more service groups
212 * and the list comprises such group identifiers (UUIDs)
213 */
214static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq)
215{
216 return sdp_set_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seq);
217}
218
219/*
220 * Set the access protocols of the record to those specified in proto
221 */
222int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
223
224/*
225 * Set the additional access protocols of the record to those specified in proto
226 */
227int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *proto);
228
229/*
230 * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM)
231 */
232int sdp_get_proto_port(const sdp_list_t *list, int proto);
233
234/*
235 * Get protocol descriptor.
236 */
237sdp_data_t *sdp_get_proto_desc(sdp_list_t *list, int proto);
238
239/*
240 * Set the LanguageBase attributes to the values specified in list
241 * (a linked list of sdp_lang_attr_t objects, one for each language in
242 * which user-visible attributes are present).
243 */
244int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *list);
245
246/*
247 * Set the ServiceInfoTimeToLive attribute of the service.
248 * This is the number of seconds that this record is guaranteed
249 * not to change after being obtained by a client.
250 */
251static inline int sdp_set_service_ttl(sdp_record_t *rec, uint32_t ttl)
252{
253 return sdp_attr_add_new(rec, SDP_ATTR_SVCINFO_TTL, SDP_UINT32, p: &ttl);
254}
255
256/*
257 * Set the ServiceRecordState attribute of a service. This is
258 * guaranteed to change if there is any kind of modification to
259 * the record.
260 */
261static inline int sdp_set_record_state(sdp_record_t *rec, uint32_t state)
262{
263 return sdp_attr_add_new(rec, SDP_ATTR_RECORD_STATE, SDP_UINT32, p: &state);
264}
265
266/*
267 * Set the ServiceID attribute of a service.
268 */
269void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid);
270
271/*
272 * Set the GroupID attribute of a service
273 */
274void sdp_set_group_id(sdp_record_t *rec, uuid_t grouuuid);
275
276/*
277 * Set the ServiceAvailability attribute of a service.
278 *
279 * Note that this represents the relative availability
280 * of the service: 0x00 means completely unavailable;
281 * 0xFF means maximum availability.
282 */
283static inline int sdp_set_service_avail(sdp_record_t *rec, uint8_t avail)
284{
285 return sdp_attr_add_new(rec, SDP_ATTR_SERVICE_AVAILABILITY, SDP_UINT8, p: &avail);
286}
287
288/*
289 * Set the profile descriptor list attribute of a record.
290 *
291 * Each element in the list is an object of type
292 * sdp_profile_desc_t which is a definition of the
293 * Bluetooth profile that this service conforms to.
294 */
295int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *desc);
296
297/*
298 * Set URL attributes of a record.
299 *
300 * ClientExecutableURL: a URL to a client's platform specific (WinCE,
301 * PalmOS) executable code that can be used to access this service.
302 *
303 * DocumentationURL: a URL pointing to service documentation
304 *
305 * IconURL: a URL to an icon that can be used to represent this service.
306 *
307 * Note: pass NULL for any URLs that you don't want to set or remove
308 */
309void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char *docURL, const char *iconURL);
310
311/*
312 * a service search request.
313 *
314 * INPUT :
315 *
316 * sdp_list_t *search
317 * list containing elements of the search
318 * pattern. Each entry in the list is a UUID
319 * of the service to be searched
320 *
321 * uint16_t max_rec_num
322 * An integer specifying the maximum number of
323 * entries that the client can handle in the response.
324 *
325 * OUTPUT :
326 *
327 * int return value
328 * 0
329 * The request completed successfully. This does not
330 * mean the requested services were found
331 * -1
332 * The request completed unsuccessfully
333 *
334 * sdp_list_t *rsp_list
335 * This variable is set on a successful return if there are
336 * non-zero service handles. It is a singly linked list of
337 * service record handles (uint16_t)
338 */
339int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp_list);
340
341/*
342 * a service attribute request.
343 *
344 * INPUT :
345 *
346 * uint32_t handle
347 * The handle of the service for which the attribute(s) are
348 * requested
349 *
350 * sdp_attrreq_type_t reqtype
351 * Attribute identifiers are 16 bit unsigned integers specified
352 * in one of 2 ways described below :
353 * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers
354 * They are the actual attribute identifiers in ascending order
355 *
356 * SDP_ATTR_REQ_RANGE - 32bit identifier range
357 * The high-order 16bits is the start of range
358 * the low-order 16bits are the end of range
359 * 0x0000 to 0xFFFF gets all attributes
360 *
361 * sdp_list_t *attrid_list
362 * Singly linked list containing attribute identifiers desired.
363 * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
364 * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
365 *
366 * OUTPUT :
367 * int return value
368 * 0
369 * The request completed successfully. This does not
370 * mean the requested services were found
371 * -1
372 * The request completed unsuccessfully due to a timeout
373 */
374sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list);
375
376/*
377 * This is a service search request combined with the service
378 * attribute request. First a service class match is done and
379 * for matching service, requested attributes are extracted
380 *
381 * INPUT :
382 *
383 * sdp_list_t *search
384 * Singly linked list containing elements of the search
385 * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16)
386 * of the service to be searched
387 *
388 * AttributeSpecification attrSpec
389 * Attribute identifiers are 16 bit unsigned integers specified
390 * in one of 2 ways described below :
391 * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers
392 * They are the actual attribute identifiers in ascending order
393 *
394 * SDP_ATTR_REQ_RANGE - 32bit identifier range
395 * The high-order 16bits is the start of range
396 * the low-order 16bits are the end of range
397 * 0x0000 to 0xFFFF gets all attributes
398 *
399 * sdp_list_t *attrid_list
400 * Singly linked list containing attribute identifiers desired.
401 * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
402 * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
403 *
404 * OUTPUT :
405 * int return value
406 * 0
407 * The request completed successfully. This does not
408 * mean the requested services were found
409 * -1
410 * The request completed unsuccessfully due to a timeout
411 *
412 * sdp_list_t *rsp_list
413 * This variable is set on a successful return to point to
414 * service(s) found. Each element of this list is of type
415 * sdp_record_t *.
416 */
417int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list);
418
419/*
420 * Allocate/free a service record and its attributes
421 */
422sdp_record_t *sdp_record_alloc(void);
423void sdp_record_free(sdp_record_t *rec);
424
425/*
426 * Register a service record.
427 *
428 * Note: It is the responsbility of the Service Provider to create the
429 * record first and set its attributes using setXXX() methods.
430 *
431 * The service provider must then call sdp_record_register() to make
432 * the service record visible to SDP clients. This function returns 0
433 * on success or -1 on failure (and sets errno).
434 */
435int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, uint8_t *data, uint32_t size, uint8_t flags, uint32_t *handle);
436int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags);
437int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags);
438
439/*
440 * Unregister a service record.
441 */
442int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle);
443int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec);
444int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec);
445
446/*
447 * Update an existing service record. (Calling this function
448 * before a previous call to sdp_record_register() will result
449 * in an error.)
450 */
451int sdp_device_record_update_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle, uint8_t *data, uint32_t size);
452int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec);
453int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec);
454
455void sdp_record_print(const sdp_record_t *rec);
456
457/*
458 * UUID functions
459 */
460uuid_t *sdp_uuid16_create(uuid_t *uuid, uint16_t data);
461uuid_t *sdp_uuid32_create(uuid_t *uuid, uint32_t data);
462uuid_t *sdp_uuid128_create(uuid_t *uuid, const void *data);
463int sdp_uuid16_cmp(const void *p1, const void *p2);
464int sdp_uuid128_cmp(const void *p1, const void *p2);
465int sdp_uuid_cmp(const void *p1, const void *p2);
466uuid_t *sdp_uuid_to_uuid128(const uuid_t *uuid);
467void sdp_uuid16_to_uuid128(uuid_t *uuid128, const uuid_t *uuid16);
468void sdp_uuid32_to_uuid128(uuid_t *uuid128, const uuid_t *uuid32);
469int sdp_uuid128_to_uuid(uuid_t *uuid);
470int sdp_uuid_to_proto(uuid_t *uuid);
471int sdp_uuid_extract(const uint8_t *buffer, int bufsize, uuid_t *uuid, int *scanned);
472void sdp_uuid_print(const uuid_t *uuid);
473
474#define MAX_LEN_UUID_STR 37
475#define MAX_LEN_PROTOCOL_UUID_STR 8
476#define MAX_LEN_SERVICECLASS_UUID_STR 28
477#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 28
478
479int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n);
480int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n);
481int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n);
482int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n);
483
484/*
485 * In all the sdp_get_XXX(handle, XXX *xxx) functions below,
486 * the XXX * is set to point to the value, should it exist
487 * and 0 is returned. If the value does not exist, -1 is
488 * returned and errno set to ENODATA.
489 *
490 * In all the methods below, the memory management rules are
491 * simple. Don't free anything! The pointer returned, in the
492 * case of constructed types, is a pointer to the contents
493 * of the sdp_record_t.
494 */
495
496/*
497 * Get the access protocols from the service record
498 */
499int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
500
501/*
502 * Get the additional access protocols from the service record
503 */
504int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
505
506/*
507 * Extract the list of browse groups to which the service belongs.
508 * When set, seqp contains elements of GroupID (uint16_t)
509 */
510static inline int sdp_get_browse_groups(const sdp_record_t *rec, sdp_list_t **seqp)
511{
512 return sdp_get_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seqp);
513}
514
515/*
516 * Extract language attribute meta-data of the service record.
517 * For each language in the service record, LangSeq has a struct of type
518 * sdp_lang_attr_t.
519 */
520int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq);
521
522/*
523 * Extract the Bluetooth profile descriptor sequence from a record.
524 * Each element in the list is of type sdp_profile_desc_t
525 * which contains the UUID of the profile and its version number
526 * (encoded as major and minor in the high-order 8bits
527 * and low-order 8bits respectively of the uint16_t)
528 */
529int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDesc);
530
531/*
532 * Extract SDP server version numbers
533 *
534 * Note: that this is an attribute of the SDP server only and
535 * contains a list of uint16_t each of which represent the
536 * major and minor SDP version numbers supported by this server
537 */
538int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **pVnumList);
539
540int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid);
541int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid);
542int sdp_get_record_state(const sdp_record_t *rec, uint32_t *svcRecState);
543int sdp_get_service_avail(const sdp_record_t *rec, uint8_t *svcAvail);
544int sdp_get_service_ttl(const sdp_record_t *rec, uint32_t *svcTTLInfo);
545int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState);
546
547static inline int sdp_get_service_name(const sdp_record_t *rec, char *str,
548 size_t len)
549{
550 return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, value: str, valuelen: len);
551}
552
553static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str,
554 size_t len)
555{
556 return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, value: str, valuelen: len);
557}
558
559static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str,
560 size_t len)
561{
562 return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, value: str, valuelen: len);
563}
564
565static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str,
566 size_t len)
567{
568 return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, value: str, valuelen: len);
569}
570
571static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str,
572 size_t len)
573{
574 return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, value: str, valuelen: len);
575}
576
577static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str,
578 size_t len)
579{
580 return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, value: str, valuelen: len);
581}
582
583/*
584 * Set the supported features
585 * sf should be a list of list with each feature data
586 * Returns 0 on success -1 on fail
587 */
588int sdp_set_supp_feat(sdp_record_t *rec, const sdp_list_t *sf);
589
590/*
591 * Get the supported features
592 * seqp is set to a list of list with each feature data
593 * Returns 0 on success, if an error occurred -1 is returned and errno is set
594 */
595int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp);
596
597sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int bufsize, int *scanned);
598sdp_record_t *sdp_copy_record(sdp_record_t *rec);
599
600void sdp_data_print(sdp_data_t *data);
601void sdp_print_service_attr(sdp_list_t *alist);
602
603int sdp_attrid_comp_func(const void *key1, const void *key2);
604
605void sdp_set_seq_len(uint8_t *ptr, uint32_t length);
606void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id);
607void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d);
608void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len);
609
610int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data);
611int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu);
612
613int sdp_extract_seqtype(const uint8_t *buf, int bufsize, uint8_t *dtdp, int *size);
614
615sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int bufsize, int *extractedLength, sdp_record_t *rec);
616
617void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid);
618void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq);
619
620int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize);
621
622void sdp_add_lang_attr(sdp_record_t *rec);
623
624#ifdef __cplusplus
625}
626#endif
627
628#endif /* __SDP_LIB_H */
629

source code of include/bluetooth/sdp_lib.h