1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

dhcp: keep lease save/load functions private

When we make sd-dhcp public one day we really should not make
sd_dhcp_lease_save() and sd_dhcp_lease_load() public, since it's pretty
much only useful as internal utility for networkd itself.
This commit is contained in:
Lennart Poettering 2015-08-26 20:48:21 +02:00
parent 2f3cf1f9e1
commit bd91b83e57
4 changed files with 7 additions and 6 deletions

View File

@ -100,3 +100,6 @@ int dhcp_lease_set_client_id(sd_dhcp_lease *lease, const uint8_t *client_id,
DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp_lease*, sd_dhcp_lease_unref);
#define _cleanup_dhcp_lease_unref_ _cleanup_(sd_dhcp_lease_unrefp)
int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file);
int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file);

View File

@ -650,7 +650,7 @@ int dhcp_lease_new(sd_dhcp_lease **ret) {
return 0;
}
int sd_dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
_cleanup_free_ char *temp_path = NULL;
_cleanup_fclose_ FILE *f = NULL;
struct sd_dhcp_raw_option *option;
@ -785,7 +785,7 @@ fail:
return log_error_errno(r, "Failed to save lease data %s: %m", lease_file);
}
int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
int 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,

View File

@ -29,6 +29,7 @@
#include "socket-util.h"
#include "bus-util.h"
#include "udev-util.h"
#include "dhcp-lease-internal.h"
#include "network-internal.h"
#include "networkd-link.h"
#include "networkd-netdev.h"
@ -2445,7 +2446,7 @@ int link_save(Link *link) {
if (link->dhcp_lease) {
assert(link->network);
r = sd_dhcp_lease_save(link->dhcp_lease, link->lease_file);
r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
if (r < 0)
goto fail;

View File

@ -51,7 +51,4 @@ int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const uint8_t **client_id,
size_t *client_id_len);
int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone);
int sd_dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file);
int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file);
#endif