#ifndef __G_DHCP_H
#define __G_DHCP_H
+#include <stdint.h>
+
#include <glib.h>
#ifdef __cplusplus
G_DHCP_CLIENT_EVENT_LEASE_LOST,
G_DHCP_CLIENT_EVENT_IPV4LL_LOST,
G_DHCP_CLIENT_EVENT_ADDRESS_CONFLICT,
+ G_DHCP_CLIENT_EVENT_INFORMATION_REQ,
} GDHCPClientEvent;
typedef enum {
#define G_DHCP_HOST_NAME 0x0c
#define G_DHCP_NTP_SERVER 0x2a
+#define G_DHCPV6_CLIENTID 1
+#define G_DHCPV6_SERVERID 2
+#define G_DHCPV6_ORO 6
+#define G_DHCPV6_STATUS_CODE 13
+
+typedef enum {
+ G_DHCPV6_DUID_LLT = 1,
+ G_DHCPV6_DUID_EN = 2,
+ G_DHCPV6_DUID_LL = 3,
+} GDHCPDuidType;
+
typedef void (*GDHCPClientEventFunc) (GDHCPClient *client, gpointer user_data);
typedef void (*GDHCPDebugFunc)(const char *str, gpointer user_data);
GDHCPClient *g_dhcp_client_new(GDHCPType type, int index,
GDHCPClientError *error);
-int g_dhcp_client_start(GDHCPClient *client);
+int g_dhcp_client_start(GDHCPClient *client, const char *last_address);
void g_dhcp_client_stop(GDHCPClient *client);
GDHCPClient *g_dhcp_client_ref(GDHCPClient *client);
gpointer user_data);
GDHCPClientError g_dhcp_client_set_request(GDHCPClient *client,
- unsigned char option_code);
+ unsigned int option_code);
GDHCPClientError g_dhcp_client_set_send(GDHCPClient *client,
unsigned char option_code,
const char *option_value);
char *g_dhcp_client_get_address(GDHCPClient *client);
+char *g_dhcp_client_get_netmask(GDHCPClient *client);
GList *g_dhcp_client_get_option(GDHCPClient *client,
unsigned char option_code);
int g_dhcp_client_get_index(GDHCPClient *client);
void g_dhcp_client_set_debug(GDHCPClient *client,
GDHCPDebugFunc func, gpointer user_data);
+int g_dhcpv6_create_duid(GDHCPDuidType duid_type, int index, int type,
+ unsigned char **duid, int *duid_len);
+int g_dhcpv6_client_set_duid(GDHCPClient *dhcp_client, unsigned char *duid,
+ int duid_len);
+void g_dhcpv6_client_set_send(GDHCPClient *dhcp_client, uint16_t option_code,
+ uint8_t *option_value, uint16_t option_len);
+uint16_t g_dhcpv6_client_get_status(GDHCPClient *dhcp_client);
+int g_dhcpv6_client_set_oro(GDHCPClient *dhcp_client, int args, ...);
/* DHCP Server */
typedef enum {