summaryrefslogtreecommitdiffstats
path: root/network/server.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-14 00:19:59 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-14 00:19:59 +0000
commit47895f4ab3f4de2682088dfba156106c772a92da (patch)
tree977f1cbb2492462a2a8f5a220a1c053c47d91fe2 /network/server.c
parentdca71fe5565605289407c0d0810d066ed1f7e93f (diff)
network: addded server_store
Diffstat (limited to 'network/server.c')
-rw-r--r--network/server.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/server.c b/network/server.c
index 053c2517..9a7cd4d4 100644
--- a/network/server.c
+++ b/network/server.c
@@ -1071,3 +1071,31 @@ int server_register_from_file(DBusConnection *conn, const char *path,
return 0;
}
+
+int server_store(DBusConnection *conn, const char *path)
+{
+ struct network_server *ns;
+ char filename[PATH_MAX + 1];
+ char addr[18];
+
+ if (!dbus_connection_get_object_path_data(conn, path, (void *) &ns))
+ return -ENOENT;
+
+ ba2str(&ns->src, addr);
+ if (ns->id == BNEP_SVC_NAP)
+ create_name(filename, PATH_MAX, STORAGEDIR, addr, "nap");
+ else
+ create_name(filename, PATH_MAX, STORAGEDIR, addr, "gn");
+
+ textfile_put(filename, "name", ns->name);
+
+ if (ns->iface)
+ textfile_put(filename, "routing", ns->iface);
+
+ if (ns->range)
+ textfile_put(filename, "range", ns->range);
+
+ textfile_put(filename, "secure", ns->secure ? "1": "0");
+
+ return 0;
+}