diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index a3e7b0e..7a1d612 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
return transport->getpeername(os->io, name);
}
+int obex_getsockname(struct obex_session *os, char **name)
+{
+ struct obex_transport_driver *transport = os->server->transport;
+
+ if (transport == NULL || transport->getsockname == NULL)
+ return -ENOTSUP;
+
+ return transport->getsockname(os->io, name);
+}
+
int memncmp0(const void *a, size_t na, const void *b, size_t nb)
{
if (na != nb)
diff --git a/obexd/src/obex.h b/obexd/src/obex.h
index 443a748..fc16747 100644
--- a/obexd/src/obex.h
+++ b/obexd/src/obex.h
ssize_t obex_get_non_header_data(struct obex_session *os,
const uint8_t **data);
int obex_getpeername(struct obex_session *os, char **name);
+int obex_getsockname(struct obex_session *os, char **name);
/* Just a thin wrapper around memcmp to deal with NULL values */
int memncmp0(const void *a, size_t na, const void *b, size_t nb);