diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-16 13:14:07 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-16 13:14:07 +0000 |
commit | e968bf544679fbf8565b2354cb4beac3641538e4 (patch) | |
tree | 22d64726c480e58b3541b194ac07ddbebc9f9d14 /network/server.c | |
parent | e5ba646776ba7c5c5c9c9d630bbfc8793f1c3b4e (diff) |
network: added server_remove_stored function
Diffstat (limited to 'network/server.c')
-rw-r--r-- | network/server.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/network/server.c b/network/server.c index 9a7cd4d4..160f8910 100644 --- a/network/server.c +++ b/network/server.c @@ -1099,3 +1099,21 @@ int server_store(DBusConnection *conn, const char *path) return 0; } + +int server_remove_stored(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"); + + return remove(filename); +} |