[PATCH v4 1/4] hostapd: afcd: add AFC daemon support

Lorenzo Bianconi lorenzo at kernel.org
Tue Apr 16 08:22:40 PDT 2024


> On Wed, Apr 10, 2024 at 7:05 PM Lorenzo Bianconi <lorenzo at kernel.org> wrote:
> > +         "requestId":"11235814",
> 11235813 to match the default request ID
> > +
> > +static void usage(void)
> > +{
> > +       wpa_printf(MSG_ERROR,
> > +                  "%s:\n"
> > +                  "afcd -u<url> [-p<port>][-t<token>][-D<unix-sock dir>][-P<PID file>][-dB]",
> > +                  __func__);
> > +}
> missing `-d` usage

what do you mean?

> > +
> Also, for setting `Content-Length` I had to use the below script,
> should we add this as well
> or at least put it in a README?

ack, thx. I will fix the afc-reply example.

Regards,
Lorenzo

> 
> $ cat afc_server_sim.sh
> #!/bin/bash
> 
> # Define the JSON content
> json_content=$(cat afc-reply.json)
> 
> # Calculate the length of the JSON content
> content_length=$(echo "$json_content" | wc -m)
> 
> # Create the HTTP response
> http_response="HTTP/1.1 200 OK
> Content-Type: application/json
> Content-Length: $content_length
> 
> $json_content"
> 
> # Write the HTTP response to a file
> echo -e "$http_response" > response.txt
> 
> # Use netcat to listen on a specific port and send the response to any
> incoming requests
> while true; do nc -l 9999 < response.txt; done
> ### END OF SCRIPT##
> and then I run `sudo ./afcd -u http://localhost -p 9999 -ddd`
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20240416/98c37eda/attachment.sig>


More information about the Hostap mailing list