diff options
author | hyunuktak <hyunuk.tak@samsung.com> | 2015-08-07 17:11:34 +0900 |
---|---|---|
committer | hyunuktak <hyunuk.tak@samsung.com> | 2015-08-07 17:11:56 +0900 |
commit | 6aa4055ef0544ae85457c25c510fe3db04949c43 (patch) | |
tree | 94018be3cef92c33b60650c488dc15536c8f978a /src/inet.c | |
parent | bc55a3df0d4d2d97964ce2fadc9fe3ffc4953f4e (diff) | |
download | connman-6aa4055ef0544ae85457c25c510fe3db04949c43.tar.gz connman-6aa4055ef0544ae85457c25c510fe3db04949c43.tar.bz2 connman-6aa4055ef0544ae85457c25c510fe3db04949c43.zip |
Base Code merged to SPIN 2.4submit/tizen/20150810.034432
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
Diffstat (limited to 'src/inet.c')
-rwxr-xr-x[-rw-r--r--] | src/inet.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/src/inet.c b/src/inet.c index cd220ffc..bfad01cb 100644..100755 --- a/src/inet.c +++ b/src/inet.c @@ -330,6 +330,62 @@ done: return err; } +#if defined TIZEN_EXT +void connman_inet_update_device_ident(struct connman_device *device) +{ + int index; + enum connman_device_type type; + char *ident = NULL, *addr = NULL; + + index = connman_device_get_index(device); + type = connman_device_get_type(device); + + switch (type) { + case CONNMAN_DEVICE_TYPE_UNKNOWN: + return; + case CONNMAN_DEVICE_TYPE_ETHERNET: + case CONNMAN_DEVICE_TYPE_GADGET: + case CONNMAN_DEVICE_TYPE_WIFI: + addr = index2addr(index); + break; + case CONNMAN_DEVICE_TYPE_BLUETOOTH: + case CONNMAN_DEVICE_TYPE_CELLULAR: + case CONNMAN_DEVICE_TYPE_GPS: + case CONNMAN_DEVICE_TYPE_VENDOR: + break; + } + + switch (type) { + case CONNMAN_DEVICE_TYPE_UNKNOWN: + case CONNMAN_DEVICE_TYPE_VENDOR: + case CONNMAN_DEVICE_TYPE_GPS: + break; + case CONNMAN_DEVICE_TYPE_ETHERNET: + case CONNMAN_DEVICE_TYPE_GADGET: + ident = index2ident(index, NULL); + break; + case CONNMAN_DEVICE_TYPE_WIFI: + ident = index2ident(index, NULL); + break; + case CONNMAN_DEVICE_TYPE_BLUETOOTH: + break; + case CONNMAN_DEVICE_TYPE_CELLULAR: + ident = index2ident(index, NULL); + break; + } + + if (ident != NULL) { + connman_device_set_ident(device, ident); + g_free(ident); + } + + if (addr != NULL) { + connman_device_set_string(device, "Address", addr); + g_free(addr); + } +} +#endif + struct in6_ifreq { struct in6_addr ifr6_addr; __u32 ifr6_prefixlen; @@ -2229,10 +2285,8 @@ static int inet_rtnl_recv(GIOChannel *chan, gpointer user_data) h = ptr; - if (!NLMSG_OK(h, len)) { + if (!NLMSG_OK(h, len)) return -1; - break; - } if (h->nlmsg_seq != rth->seq) { /* Skip this msg */ |