summaryrefslogtreecommitdiff
path: root/obexd/src
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-05-28 14:45:21 -0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-05-29 14:40:05 +0300
commit4d8c46d451ef59459e7c1e6e3d635866a86fc41c (patch)
treef3816d1b44410ed08a4698b9da00f9f5f4ca4751 /obexd/src
parenta8a9649850f8f939ec5df9a53e9eddbbf40afd24 (diff)
obex: get src and dst address and store it
This commit creates src and dst members in obex_session to later use them to export via Session D-Bus API.
Diffstat (limited to 'obexd/src')
-rw-r--r--obexd/src/obex-priv.h2
-rw-r--r--obexd/src/obex.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/obexd/src/obex-priv.h b/obexd/src/obex-priv.h
index 41854bcd9..355a7f87b 100644
--- a/obexd/src/obex-priv.h
+++ b/obexd/src/obex-priv.h
@@ -27,6 +27,8 @@ struct obex_session {
uint32_t id;
uint8_t cmd;
uint8_t action_id;
+ char *src;
+ char *dst;
char *name;
char *destname;
char *type;
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 7a1d6122d..8a7a8a326 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -252,6 +252,9 @@ static void obex_session_free(struct obex_session *os)
if (os->obex)
g_obex_unref(os->obex);
+ g_free(os->src);
+ g_free(os->dst);
+
g_free(os);
}
@@ -1134,6 +1137,9 @@ int obex_session_start(GIOChannel *io, uint16_t tx_mtu, uint16_t rx_mtu,
os->obex = obex;
os->io = g_io_channel_ref(io);
+ obex_getsockname(os, &os->src);
+ obex_getpeername(os, &os->dst);
+
sessions = g_slist_prepend(sessions, os);
return 0;