modify some SDP data parsing function names to avoid conflicts with similar

functions that are intended to be imported to libsdp.

(this will use the library routines when they are done)
This commit is contained in:
plunky 2008-12-06 20:01:14 +00:00
parent bcb1925cba
commit 1bbd35ddef
3 changed files with 24 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: client.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */
/* $NetBSD: client.c,v 1.2 2008/12/06 20:01:14 plunky Exp $ */
/*-
* Copyright (c) 2008 Iain Hibbert
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: client.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
__RCSID("$NetBSD: client.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
#include <bluetooth.h>
#include <errno.h>
@ -182,12 +182,12 @@ client_query(void)
* seq len
* uuid value == BNEP
*/
if (sdp_get_seq(&attr.value, attr.value + attr.vlen, &seq0)
&& sdp_get_seq(&seq0, attr.value, &seq1)
&& sdp_match_uuid16(&seq1, seq0, SDP_UUID_PROTOCOL_L2CAP)
&& sdp_get_uint16(&seq1, seq0, &l2cap_psm)
&& sdp_get_seq(&seq0, attr.value, &seq1)
&& sdp_match_uuid16(&seq1, seq0, SDP_UUID_PROTOCOL_BNEP)) {
if (_sdp_get_seq(&attr.value, attr.value + attr.vlen, &seq0)
&& _sdp_get_seq(&seq0, attr.value, &seq1)
&& _sdp_match_uuid16(&seq1, seq0, SDP_UUID_PROTOCOL_L2CAP)
&& _sdp_get_uint16(&seq1, seq0, &l2cap_psm)
&& _sdp_get_seq(&seq0, attr.value, &seq1)
&& _sdp_match_uuid16(&seq1, seq0, SDP_UUID_PROTOCOL_BNEP)) {
log_info("Found PSM %d for service %s", l2cap_psm, service_name);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdp.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */
/* $NetBSD: sdp.c,v 1.2 2008/12/06 20:01:14 plunky Exp $ */
/*-
* Copyright (c) 2008 Iain Hibbert
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: sdp.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
__RCSID("$NetBSD: sdp.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
#include <string.h>
@ -47,14 +47,14 @@ static const uuid_t BASE_UUID = {
};
/*
* sdp_match_uuid16(ptr, limit, uuid)
* _sdp_match_uuid16(ptr, limit, uuid)
*
* examine SDP data stream at ptr for a UUID, and return
* true if it matches the supplied short alias bluetooth UUID.
* limit is the first address past the end of valid data.
*/
bool
sdp_match_uuid16(uint8_t **ptr, uint8_t *limit, uint16_t uuid)
_sdp_match_uuid16(uint8_t **ptr, uint8_t *limit, uint16_t uuid)
{
uint8_t *p = *ptr;
uuid_t u1, u2;
@ -62,7 +62,7 @@ sdp_match_uuid16(uint8_t **ptr, uint8_t *limit, uint16_t uuid)
memcpy(&u1, &BASE_UUID, sizeof(uuid_t));
u1.time_low = uuid;
if (!sdp_get_uuid(&p, limit, &u2)
if (!_sdp_get_uuid(&p, limit, &u2)
|| !uuid_equal(&u1, &u2, NULL))
return false;
@ -71,14 +71,14 @@ sdp_match_uuid16(uint8_t **ptr, uint8_t *limit, uint16_t uuid)
}
/*
* sdp_get_uuid(ptr, limit, uuid)
* _sdp_get_uuid(ptr, limit, uuid)
*
* examine SDP data stream at ptr for a UUID, and extract
* to given storage, advancing ptr.
* limit is the first address past the end of valid data.
*/
bool
sdp_get_uuid(uint8_t **ptr, uint8_t *limit, uuid_t *uuid)
_sdp_get_uuid(uint8_t **ptr, uint8_t *limit, uuid_t *uuid)
{
uint8_t *p = *ptr;
@ -121,14 +121,14 @@ sdp_get_uuid(uint8_t **ptr, uint8_t *limit, uuid_t *uuid)
}
/*
* sdp_get_seq(ptr, limit, seq)
* _sdp_get_seq(ptr, limit, seq)
*
* examine SDP data stream at ptr for a sequence. return
* seq pointer if found and advance ptr to next object.
* limit is the first address past the end of valid data.
*/
bool
sdp_get_seq(uint8_t **ptr, uint8_t *limit, uint8_t **seq)
_sdp_get_seq(uint8_t **ptr, uint8_t *limit, uint8_t **seq)
{
uint8_t *p = *ptr;
int32_t l;
@ -173,14 +173,14 @@ sdp_get_seq(uint8_t **ptr, uint8_t *limit, uint8_t **seq)
}
/*
* sdp_get_uint16(ptr, limit, value)
* _sdp_get_uint16(ptr, limit, value)
*
* examine SDP data stream at ptr for a uint16_t, and
* extract to given storage, advancing ptr.
* limit is the first address past the end of valid data.
*/
bool
sdp_get_uint16(uint8_t **ptr, uint8_t *limit, uint16_t *value)
_sdp_get_uint16(uint8_t **ptr, uint8_t *limit, uint16_t *value)
{
uint8_t *p = *ptr;
uint16_t v;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdp.h,v 1.1 2008/08/17 13:20:57 plunky Exp $ */
/* $NetBSD: sdp.h,v 1.2 2008/12/06 20:01:15 plunky Exp $ */
/*-
* Copyright (c) 2008 Iain Hibbert
@ -30,7 +30,7 @@
#include <stdbool.h>
#include <uuid.h>
bool sdp_match_uuid16(uint8_t **, uint8_t *, uint16_t);
bool sdp_get_uuid(uint8_t **, uint8_t *, uuid_t *);
bool sdp_get_seq(uint8_t **, uint8_t *, uint8_t **);
bool sdp_get_uint16(uint8_t **, uint8_t *, uint16_t *);
bool _sdp_match_uuid16(uint8_t **, uint8_t *, uint16_t);
bool _sdp_get_uuid(uint8_t **, uint8_t *, uuid_t *);
bool _sdp_get_seq(uint8_t **, uint8_t *, uint8_t **);
bool _sdp_get_uint16(uint8_t **, uint8_t *, uint16_t *);