X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemd%2Fsd-dhcp-client.h;h=68fcba5495b9152fa09ca7b6926f6c2f5496002e;hp=5c9c32793e4ded4f8a87759b781a48de997716b4;hb=9f9a964f195df68175cd3d5c9c90a476fa474073;hpb=d3d8ac2f2bac721d99f893c0a0128d21db636d4c diff --git a/src/systemd/sd-dhcp-client.h b/src/systemd/sd-dhcp-client.h index 5c9c32793..68fcba549 100644 --- a/src/systemd/sd-dhcp-client.h +++ b/src/systemd/sd-dhcp-client.h @@ -27,8 +27,22 @@ #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); @@ -36,8 +50,15 @@ 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_get_dns(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_free(sd_dhcp_client *client); sd_dhcp_client *sd_dhcp_client_new(sd_event *event); #endif