Hi Julien,

On Mon, Dec 20, 2010 at 04:24:01PM +0000, Julien Massot wrote:
> this patch is the second version to get netmask when using IPV4LL.
Patch applied, thanks a lot.

Cheers,
Samuel.


> ---
>  gdhcp/client.c |   24 ++++++++++++++++++++++++
>  gdhcp/gdhcp.h  |    1 +
>  2 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/gdhcp/client.c b/gdhcp/client.c
> index 3508b1e..107077a 100644
> --- a/gdhcp/client.c
> +++ b/gdhcp/client.c
> @@ -1413,6 +1413,30 @@ char *g_dhcp_client_get_address(GDHCPClient 
> *dhcp_client)
>       return g_strdup(dhcp_client->assigned_ip);
>  }
> 
> +char *g_dhcp_client_get_netmask(GDHCPClient *dhcp_client)
> +{
> +     GList *option = NULL;
> +
> +     switch (dhcp_client->state) {
> +     case IPV4LL_DEFEND:
> +     case IPV4LL_MONITOR:
> +             return g_strdup("255.255.0.0");
> +     case BOUND:
> +     case RENEWING:
> +     case REBINDING:
> +             option = g_dhcp_client_get_option(dhcp_client, G_DHCP_SUBNET);
> +             if (option != NULL)
> +                     return g_strdup(option->data);
> +     case INIT_SELECTING:
> +     case REQUESTING:
> +     case RELEASED:
> +     case IPV4LL_PROBE:
> +     case IPV4LL_ANNOUNCE:
> +             break;
> +     }
> +     return NULL;
> +}
> +
>  GDHCPClientError g_dhcp_client_set_request(GDHCPClient *dhcp_client,
>                                               unsigned char option_code)
>  {
> diff --git a/gdhcp/gdhcp.h b/gdhcp/gdhcp.h
> index 63c395d..4f583ff 100644
> --- a/gdhcp/gdhcp.h
> +++ b/gdhcp/gdhcp.h
> @@ -91,6 +91,7 @@ GDHCPClientError g_dhcp_client_set_send(GDHCPClient *client,
>                                               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);
> --
> 1.7.1
> 
> _______________________________________________
> connman mailing list
> [email protected]
> http://lists.connman.net/listinfo/connman

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to