aboutsummaryrefslogtreecommitdiff
path: root/lib/libsdp
diff options
context:
space:
mode:
authorMaksim Yevmenkin <emax@FreeBSD.org>2004-01-09 22:44:28 +0000
committerMaksim Yevmenkin <emax@FreeBSD.org>2004-01-09 22:44:28 +0000
commita4b187fa33f1856b9c0293b900d36b4c797b459d (patch)
tree6ed17ae08cf9c5d4fd244460555de488ae99253b /lib/libsdp
parent91c9d24e52990321cc7f9b116388386f065b34e5 (diff)
downloadsrc-a4b187fa33f1856b9c0293b900d36b4c797b459d.tar.gz
src-a4b187fa33f1856b9c0293b900d36b4c797b459d.zip
Change sdp_open_local(3) API. It now takes a path to a control socket
Teach sdpcontrol(8) how to talk to the local SDP server Update man pages s/u_int/uint Reviewed by: imp (mentor), ru
Notes
Notes: svn path=/head/; revision=124317
Diffstat (limited to 'lib/libsdp')
-rw-r--r--lib/libsdp/sdp.310
-rw-r--r--lib/libsdp/sdp.h2
-rw-r--r--lib/libsdp/session.c7
3 files changed, 14 insertions, 5 deletions
diff --git a/lib/libsdp/sdp.3 b/lib/libsdp/sdp.3
index 88c6ff7c0f8e..e849780e265e 100644
--- a/lib/libsdp/sdp.3
+++ b/lib/libsdp/sdp.3
@@ -73,7 +73,7 @@
.Ft void *
.Fn sdp_open "bdaddr_t const *l" "bdaddr_t const *r"
.Ft void *
-.Fn sdp_open_local "void"
+.Fn sdp_open_local "char const *control"
.Ft int32_t
.Fn sdp_close "void *xs"
.Ft int32_t
@@ -134,7 +134,13 @@ Remote BD_ADDR can not be
.Dv NG_HCI_BDADDR_ANY .
The
.Fn sdp_open_local
-function takes no arguments and opens a connection to a local SDP server.
+function takes path to the control socket and opens a connection to a local
+SDP server.
+If path to the control socket is
+.Dv NULL
+then default
+.Pa /var/run/sdp
+path will be used.
.Pp
The
.Fn sdp_close
diff --git a/lib/libsdp/sdp.h b/lib/libsdp/sdp.h
index 3987ffb28352..4f5fb277bca4 100644
--- a/lib/libsdp/sdp.h
+++ b/lib/libsdp/sdp.h
@@ -469,7 +469,7 @@ typedef struct sdp_attr * sdp_attr_p;
#endif /* BYTE_ORDER */
void * sdp_open (bdaddr_t const *l, bdaddr_t const *r);
-void * sdp_open_local (void);
+void * sdp_open_local (char const *control);
int32_t sdp_close (void *xs);
int32_t sdp_error (void *xs);
diff --git a/lib/libsdp/session.c b/lib/libsdp/session.c
index 2a1303905b0f..a31f3278dc0f 100644
--- a/lib/libsdp/session.c
+++ b/lib/libsdp/session.c
@@ -102,7 +102,7 @@ fail:
}
void *
-sdp_open_local(void)
+sdp_open_local(char const *control)
{
sdp_session_p ss = NULL;
struct sockaddr_un sa;
@@ -116,9 +116,12 @@ sdp_open_local(void)
goto fail;
}
+ if (control == NULL)
+ control = SDP_LOCAL_PATH;
+
sa.sun_len = sizeof(sa);
sa.sun_family = AF_UNIX;
- strlcpy(sa.sun_path, SDP_LOCAL_PATH, sizeof(sa.sun_path));
+ strlcpy(sa.sun_path, control, sizeof(sa.sun_path));
if (connect(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
ss->error = errno;