diff options
author | Tom Gundersen <teg@jklm.no> | 2014-11-18 19:10:37 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-11-18 19:10:37 +0100 |
commit | 1dc24d5f48b384c48d5182964579758d7dcbdce2 (patch) | |
tree | 9630872e0041668aa89e5f36bf3f80c1da4765b6 /src/libsystemd-network | |
parent | d8d74ef06fa0ccf39084a6177e70e4c2297cca57 (diff) |
sd-dhcp-lease: expose load/save functions
Based on patch by Dan Williams.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/dhcp-lease-internal.h | 3 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/libsystemd-network/dhcp-lease-internal.h b/src/libsystemd-network/dhcp-lease-internal.h index 9fb4f4b4e4..8806351eb2 100644 --- a/src/libsystemd-network/dhcp-lease-internal.h +++ b/src/libsystemd-network/dhcp-lease-internal.h @@ -76,9 +76,6 @@ int dhcp_lease_new(sd_dhcp_lease **ret); int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, void *user_data); -int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file); -int dhcp_lease_load(const char *lease_file, sd_dhcp_lease **ret); - int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease *lease); DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp_lease*, sd_dhcp_lease_unref); diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index f6b572a996..1a6add0fa3 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -580,7 +580,7 @@ int dhcp_lease_new(sd_dhcp_lease **ret) { return 0; } -int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { +int sd_dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { _cleanup_free_ char *temp_path = NULL; _cleanup_fclose_ FILE *f = NULL; struct in_addr address; @@ -675,7 +675,7 @@ finish: return r; } -int dhcp_lease_load(const char *lease_file, sd_dhcp_lease **ret) { +int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) { _cleanup_dhcp_lease_unref_ sd_dhcp_lease *lease = NULL; _cleanup_free_ char *address = NULL, *router = NULL, *netmask = NULL, *server_address = NULL, *next_server = NULL, |