#include "hostname-util.h"
#include "io-util.h"
#include "memory-util.h"
+#include "network-common.h"
#include "random-util.h"
#include "set.h"
#include "sort-util.h"
int event_priority;
sd_event_source *timeout_resend;
int ifindex;
+ char *ifname;
int fd;
uint16_t port;
union sockaddr_union link;
return 0;
}
+int sd_dhcp_client_set_ifname(sd_dhcp_client *client, const char *ifname) {
+ assert_return(client, -EINVAL);
+ assert_return(ifname, -EINVAL);
+
+ if (!ifname_valid_full(ifname, IFNAME_VALID_ALTERNATIVE))
+ return -EINVAL;
+
+ return free_and_strdup(&client->ifname, ifname);
+}
+
+const char *sd_dhcp_client_get_ifname(sd_dhcp_client *client) {
+ if (!client)
+ return NULL;
+
+ return get_ifname(client->ifindex, &client->ifname);
+}
+
int sd_dhcp_client_set_mac(
sd_dhcp_client *client,
const uint8_t *addr,
client->user_class = strv_free(client->user_class);
ordered_hashmap_free(client->extra_options);
ordered_hashmap_free(client->vendor_options);
+ free(client->ifname);
return mfree(client);
}