X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemd%2Fsd-dhcp-client.h;h=395c12d2533b2bd48fae76afc55933727127cea7;hb=751246ee37cf0cd72baf378f1b9c1ac04f8b8c9b;hp=acfa3fac24a962cfa99a0bfe2960a64d83910731;hpb=46a66b794a00e0f34981ac25dbf2eae2423b6215;p=elogind.git diff --git a/src/systemd/sd-dhcp-client.h b/src/systemd/sd-dhcp-client.h index acfa3fac2..395c12d25 100644 --- a/src/systemd/sd-dhcp-client.h +++ b/src/systemd/sd-dhcp-client.h @@ -25,8 +25,24 @@ #include #include +#include "sd-event.h" + +enum { + DHCP_EVENT_STOP = 0, + DHCP_EVENT_NO_LEASE = 1, + DHCP_EVENT_IP_ACQUIRE = 2, + DHCP_EVENT_IP_CHANGE = 3, + DHCP_EVENT_EXPIRED = 4, +}; + typedef struct sd_dhcp_client sd_dhcp_client; +typedef void (*sd_dhcp_client_cb_t)(sd_dhcp_client *client, int event, + void *userdata); +int sd_dhcp_client_set_callback(sd_dhcp_client *client, sd_dhcp_client_cb_t cb, + void *userdata); + + int sd_dhcp_client_set_request_option(sd_dhcp_client *client, uint8_t option); int sd_dhcp_client_set_request_address(sd_dhcp_client *client, const struct in_addr *last_address); @@ -34,7 +50,13 @@ int sd_dhcp_client_set_index(sd_dhcp_client *client, int interface_index); int sd_dhcp_client_set_mac(sd_dhcp_client *client, const struct ether_addr *addr); +int sd_dhcp_client_get_address(sd_dhcp_client *client, struct in_addr *addr); +int sd_dhcp_client_get_netmask(sd_dhcp_client *client, struct in_addr *addr); +int sd_dhcp_client_prefixlen(const struct in_addr *addr); +int sd_dhcp_client_get_router(sd_dhcp_client *client, struct in_addr *addr); + +int sd_dhcp_client_stop(sd_dhcp_client *client); int sd_dhcp_client_start(sd_dhcp_client *client); -sd_dhcp_client *sd_dhcp_client_new(void); +sd_dhcp_client *sd_dhcp_client_new(sd_event *event); #endif