diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2015-03-17 11:00:54 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2015-03-17 11:03:19 -0700 |
commit | f73259cc00af557e36add405799b7f2326587c13 (patch) | |
tree | 3d2217c2850c5b07e542509f00426e8b69e44b88 /wpa_supplicant/config.c | |
parent | 4dd28dc25895165566a1c8a9cac7bcd755ff8fe3 (diff) | |
download | android_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.tar.gz android_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.tar.bz2 android_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.zip |
Cumulative patch from commit 0b08f25445caacb502c394e917a292d7fa595447
0b08f25 wpa_gui: Documentation update
6128a90 hostapd: Add channel 140 to allowed HT40 channel pairs
8ffaafa wpa_cli: Add missing parameters for "set" command completion routine
0fd9d95 wpa_cli: Add completion routine for "get" command
5c6c315 Add IPv4 support function for "get" control interface command
74fa78b Add AVG_BEACON_RSSI to SIGNAL_POLL output
4acdc48 nl80211: Handle NL80211_ATTR_EXT_FEATURES attribute
a0563ac Sync with mac80211-next.git include/uapi/linux/nl80211.h
0f89328 P2P: Move upper layer SD interaction into a separate file
8b94980 FT: Avoid unnecessary allocation for MIC calculation
18da814 The master branch is now used for v2.5 development
bc04db9 Change version information for the 2.4 release
bc1d23a Add ChangeLog entries for v2.4
319d9da Fix bitfield_get_first_zero() to not read beyond buffer
39c3bfc Indicate AP-DISABLED on main AP mode deinit path
f10487e Send CTRL-EVENT-DISCONNECTED on wpa_supplicant AP deinit
Change-Id: I0b8459261265a25fe0edd7b435ede32be3cc6616
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wpa_supplicant/config.c')
-rw-r--r-- | wpa_supplicant/config.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 8e6cd200..a01a9109 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -4052,6 +4052,31 @@ static int wpa_config_get_str(const char *name, struct wpa_config *config, } +#ifdef CONFIG_P2P +static int wpa_config_get_ipv4(const char *name, struct wpa_config *config, + long offset, char *buf, size_t buflen, + int pretty_print) +{ + void *val = ((u8 *) config) + (long) offset; + int res; + char addr[INET_ADDRSTRLEN]; + + if (!val || !inet_ntop(AF_INET, val, addr, sizeof(addr))) + return -1; + + if (pretty_print) + res = os_snprintf(buf, buflen, "%s=%s\n", name, addr); + else + res = os_snprintf(buf, buflen, "%s", addr); + + if (os_snprintf_error(buflen, res)) + res = -1; + + return res; +} +#endif /* CONFIG_P2P */ + + #ifdef OFFSET #undef OFFSET #endif /* OFFSET */ @@ -4067,7 +4092,8 @@ static int wpa_config_get_str(const char *name, struct wpa_config *config, #define STR(f) _STR(f), NULL, NULL #define STR_RANGE(f, min, max) _STR(f), (void *) min, (void *) max #define BIN(f) #f, wpa_global_config_parse_bin, NULL, OFFSET(f), NULL, NULL -#define IPV4(f) #f, wpa_global_config_parse_ipv4, NULL, OFFSET(f), NULL, NULL +#define IPV4(f) #f, wpa_global_config_parse_ipv4, wpa_config_get_ipv4, \ + OFFSET(f), NULL, NULL static const struct global_parse_data global_fields[] = { #ifdef CONFIG_CTRL_IFACE |