summaryrefslogtreecommitdiffstats
path: root/network/server.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-13 20:38:37 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-13 20:38:37 +0000
commita4bc8363b53f68c20bed8dcf5bf436c8609be199 (patch)
treef3e960ac9d760b97baf5f9575cfa18f713900fbe /network/server.c
parent235f0862a242772d8e3e51cd4f4dd8277939bbe5 (diff)
network: moved register_nap_from_file to server_register_from file to support gn and nap registration
Diffstat (limited to 'network/server.c')
-rw-r--r--network/server.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/network/server.c b/network/server.c
index be6316a1..a7dc3f6b 100644
--- a/network/server.c
+++ b/network/server.c
@@ -1012,7 +1012,7 @@ int server_register(DBusConnection *conn, const char *addr, const char *path,
ns->conn = dbus_connection_ref(conn);
str2ba(addr, &ns->src);
- info("Registered server path:%s", ns->path);
+ info("Registered server path:%s", path);
return 0;
fail:
@@ -1020,21 +1020,22 @@ fail:
return -1;
}
-int register_nap_from_file(DBusConnection *conn, const char *path,
- const bdaddr_t *src, const char *filename)
+int server_register_from_file(DBusConnection *conn, const char *path,
+ const bdaddr_t *src, uint16_t id, const char *filename)
{
struct network_server *ns;
char *str;
ns = g_new0(struct network_server, 1);
- ns->id = BNEP_SVC_NAP;
+ ns->id = id;
ns->name = textfile_get(filename, "name");
- if (ns->name) {
+ if (!ns->name) {
/* Name is mandatory */
server_free(ns);
return -1;
}
+
ns->secure = FALSE;
str = textfile_get(filename, "secure");
if (str) {
@@ -1056,12 +1057,7 @@ int register_nap_from_file(DBusConnection *conn, const char *path,
/* FIXME: Missing enabled the server(if applied) */
- return 0;
-}
+ info("Registered server path:%s", path);
-int register_gn_from_file(DBusConnection *conn, const char *path,
- const bdaddr_t *src, const char *filename)
-{
- /* FIXME: extract name, description, secure, enabled, address range ...*/
return 0;
}