From: Jouni Malinen Date: Thu, 24 Dec 2009 23:31:28 +0000 (+0200) Subject: Add forgotten src/ap/utils.c file X-Git-Tag: hostap_0_7_1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65668bfb77bacde3dd07a5d35cd5bc9de0dc460e;p=thirdparty%2Fhostap.git Add forgotten src/ap/utils.c file Commit 32da61d9c9594a35db46dacd8ca3e0ae7167bac2 was supposed to add this file. --- diff --git a/src/ap/utils.c b/src/ap/utils.c new file mode 100644 index 000000000..0796107fe --- /dev/null +++ b/src/ap/utils.c @@ -0,0 +1,41 @@ +/* + * AP mode helper functions + * Copyright (c) 2009, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include "includes.h" + +#include "common.h" +#include "hostapd.h" + + +int hostapd_register_probereq_cb(struct hostapd_data *hapd, + void (*cb)(void *ctx, const u8 *sa, + const u8 *ie, size_t ie_len), + void *ctx) +{ + struct hostapd_probereq_cb *n; + + n = os_realloc(hapd->probereq_cb, (hapd->num_probereq_cb + 1) * + sizeof(struct hostapd_probereq_cb)); + if (n == NULL) + return -1; + + hapd->probereq_cb = n; + n = &hapd->probereq_cb[hapd->num_probereq_cb]; + hapd->num_probereq_cb++; + + n->cb = cb; + n->ctx = ctx; + + return 0; +}