summaryrefslogtreecommitdiffstats
path: root/libnetutils/dhcp_utils.c
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-04-18 21:54:55 -0700
committerJeff Sharkey <jsharkey@android.com>2012-04-19 10:36:05 -0700
commit0fb8ec8e9a056cd219216b1f5724d289b50dc993 (patch)
tree3811a6e65296dd0e004db7d722acc8f2ac879a26 /libnetutils/dhcp_utils.c
parentc28cbb2c5abe9e93a75185dc7c9e4925a0f9a87a (diff)
downloadsystem_core-0fb8ec8e9a056cd219216b1f5724d289b50dc993.zip
system_core-0fb8ec8e9a056cd219216b1f5724d289b50dc993.tar.gz
system_core-0fb8ec8e9a056cd219216b1f5724d289b50dc993.tar.bz2
Pipe DHCP vendor info towards framework.
Bug: 6344821 Change-Id: Iebce3e1b36175fc88f44e18db647c43b1245f18f
Diffstat (limited to 'libnetutils/dhcp_utils.c')
-rw-r--r--libnetutils/dhcp_utils.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index d18931b..398d9c4 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -70,7 +70,8 @@ static int fill_ip_info(const char *interface,
char *dns1,
char *dns2,
char *server,
- uint32_t *lease)
+ uint32_t *lease,
+ char *vendorInfo)
{
char prop_name[PROPERTY_KEY_MAX];
char prop_value[PROPERTY_VALUE_MAX];
@@ -122,6 +123,10 @@ static int fill_ip_info(const char *interface,
if (property_get(prop_name, prop_value, NULL)) {
*lease = atol(prop_value);
}
+
+ snprintf(prop_name, sizeof(prop_name), "%s.%s.vendorInfo", DHCP_PROP_NAME_PREFIX, interface);
+ property_get(prop_name, vendorInfo, NULL);
+
return 0;
}
@@ -158,7 +163,8 @@ int dhcp_do_request(const char *interface,
char *dns1,
char *dns2,
char *server,
- uint32_t *lease)
+ uint32_t *lease,
+ char *vendorInfo)
{
char result_prop_name[PROPERTY_KEY_MAX];
char daemon_prop_name[PROPERTY_KEY_MAX];
@@ -207,8 +213,8 @@ int dhcp_do_request(const char *interface,
}
if (strcmp(prop_value, "ok") == 0) {
char dns_prop_name[PROPERTY_KEY_MAX];
- if (fill_ip_info(interface, ipaddr, gateway, prefixLength, dns1, dns2, server, lease)
- == -1) {
+ if (fill_ip_info(interface, ipaddr, gateway, prefixLength,
+ dns1, dns2, server, lease, vendorInfo) == -1) {
return -1;
}
@@ -305,7 +311,8 @@ int dhcp_do_request_renew(const char *interface,
in_addr_t *dns1,
in_addr_t *dns2,
in_addr_t *server,
- uint32_t *lease)
+ uint32_t *lease,
+ char *vendorInfo)
{
char result_prop_name[PROPERTY_KEY_MAX];
char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
@@ -341,7 +348,8 @@ int dhcp_do_request_renew(const char *interface,
return -1;
}
if (strcmp(prop_value, "ok") == 0) {
- fill_ip_info(interface, ipaddr, gateway, prefixLength, dns1, dns2, server, lease);
+ fill_ip_info(interface, ipaddr, gateway, prefixLength,
+ dns1, dns2, server, lease, vendorInfo);
return 0;
} else {
snprintf(errmsg, sizeof(errmsg), "DHCP Renew result was %s", prop_value);