98
98
struct eap_method *m;
101
105
end = pos + buflen;
103
107
for (m = eap_methods; m; m = m->next) {
104
pos += snprintf(pos, end - pos, "%s%s",
105
m == eap_methods ? "" : " ", m->name);
108
ret = snprintf(pos, end - pos, "%s%s",
109
m == eap_methods ? "" : " ", m->name);
110
if (ret < 0 || ret >= end - pos)
114
buf[buflen - 1] = '\0';
108
116
return pos - buf;
121
* eap_get_names_as_string_array - Get supported EAP methods as string array
122
* @len: Buffer for returning the number of items in array, not including %NULL
123
* terminator. This parameter can be %NULL if the length is not needed.
124
* Returns: A %NULL-terminated array of strings, or %NULL on error.
126
* This function returns the list of names for all supported EAP methods as an
127
* array of strings. The caller must free the returned array items and the
130
char ** eap_get_names_as_string_array(size_t *num)
132
struct eap_method *m;
133
size_t array_len = 0;
137
for (m = eap_methods; m; m = m->next)
140
array = wpa_zalloc(sizeof(char *) * (array_len + 1));
144
for (m = eap_methods; m; m = m->next)
145
array[i++] = strdup(m->name);
113
156
* eap_peer_get_methods - Get a list of enabled EAP peer methods
114
157
* @count: Set to number of available methods
115
158
* Returns: List of enabled EAP peer methods