summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-05-02 21:40:30 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-05-02 21:40:30 +0000
commit233bd39dee08afc5176b203e6348184da56d7bff (patch)
treea6314f3ba006ce9ee50021ac0f216a6bf832e5d6
parentedb4586c5bd45aaa69c0910150f0012ca3251c7e (diff)
Add sdp_get_add_access_protos() function
-rw-r--r--include/sdp_lib.h5
-rw-r--r--src/sdp.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/include/sdp_lib.h b/include/sdp_lib.h
index 715f98cf..0fa7cb7a 100644
--- a/include/sdp_lib.h
+++ b/include/sdp_lib.h
@@ -454,6 +454,11 @@ int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n);
int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos);
/*
+ * Get the additional access protocols from the service record
+ */
+int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap);
+
+/*
* Extract the list of browse groups to which the service belongs.
* When set, seqp contains elements of GroupID (uint16_t)
*/
diff --git a/src/sdp.c b/src/sdp.c
index 6740e9d6..75c8edcb 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -1310,6 +1310,30 @@ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **pap)
return 0;
}
+int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap)
+{
+ sdp_data_t *pdlist, *curr;
+ sdp_list_t *ap = 0;
+
+ pdlist = sdp_data_get(rec, SDP_ATTR_ADD_PROTO_DESC_LIST);
+ if (pdlist == NULL) {
+ errno = ENODATA;
+ return -1;
+ }
+ SDPDBG("AP type : 0%x\n", pdlist->dtd);
+
+ pdlist = pdlist->val.dataseq;
+
+ for (; pdlist; pdlist = pdlist->next) {
+ sdp_list_t *pds = 0;
+ for (curr = pdlist->val.dataseq; curr; curr = curr->next)
+ pds = sdp_list_append(pds, curr->val.dataseq);
+ ap = sdp_list_append(ap, pds);
+ }
+ *pap = ap;
+ return 0;
+}
+
int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp)
{
sdp_data_t *sdpdata = sdp_data_get(rec, attr);