[PATCH v8 1/5] hostapd: afcd: add AFC daemon support
Jouni Malinen
j at w1.fi
Mon Dec 23 06:35:35 PST 2024
On Thu, Nov 28, 2024 at 09:08:31AM +0100, Lorenzo Bianconi wrote:
> Introduce Automated Frequency Coordination Daemon (AFCD) support
> for UNII-5 and UNII-7 6GHz bands.
> AFCD will be used by hostapd AFC client in order to forward the AFC
> request to the AFC coordinator and decouple AFC connection management
> from hostapd.
> AFC is required for Standard Power Devices (SPDs) to determine a lists
> of channels and EIRP/PSD powers that are available in the 6GHz spectrum.
> AFCD is tested with AFC DUT Test Harness [0].
> Add afc-reply.json as reference for replies from the AFC coordinator.
Was that afc-reply.json supposed to be afc-reply.txt or is the added
afc-reply.txt supposed to be renamed to match this? It seems to include
HTTP header with the JSON data, so I'm assuming the former..
> diff --git a/afc/afcd.c b/afc/afcd.c
> +#include <curl/curl.h>
> +#include <sys/un.h>
> +#include <sys/stat.h>
> +
> +#include "utils/includes.h"
hostap.git normally includes that includes.h before any system header
files. Is there some particular reason for not doing that here?
> +int main(int argc, char **argv)
> +{
> + bool daemonize = false;
> + char *pid_file = NULL;
> +
> + if (os_program_init())
> + return -1;
...
> + case 'h':
> + usage();
> + return 0;
...
> + default:
> + usage();
> + return -EINVAL;
...
> + if (!url) {
> + usage();
> + return -EINVAL;
> + }
...
> + if (daemonize && os_daemonize(pid_file)) {
> + wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
> + return -EINVAL;
> + }
...
> + return afcd_server_run();
> +}
There is supposed to be a matching os_program_deinit() call(s) whenever
os_program_init() is used. Not that it makes much of a difference in
this case, but at least that final one for a successful termination case
should do this to allow automated memory allocation checks to be
performed.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list