xref: /freebsd/contrib/wpa/src/wps/http_server.h (revision f05cddf9)
1e28a4053SRui Paulo /*
2e28a4053SRui Paulo  * http_server - HTTP server
3e28a4053SRui Paulo  * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo  *
5*f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6*f05cddf9SRui Paulo  * See README for more details.
7e28a4053SRui Paulo  */
8e28a4053SRui Paulo 
9e28a4053SRui Paulo #ifndef HTTP_SERVER_H
10e28a4053SRui Paulo #define HTTP_SERVER_H
11e28a4053SRui Paulo 
12e28a4053SRui Paulo struct http_server;
13e28a4053SRui Paulo struct http_request;
14e28a4053SRui Paulo 
15e28a4053SRui Paulo void http_request_deinit(struct http_request *req);
16e28a4053SRui Paulo void http_request_send(struct http_request *req, struct wpabuf *resp);
17e28a4053SRui Paulo void http_request_send_and_deinit(struct http_request *req,
18e28a4053SRui Paulo 				  struct wpabuf *resp);
19e28a4053SRui Paulo enum httpread_hdr_type http_request_get_type(struct http_request *req);
20e28a4053SRui Paulo char * http_request_get_uri(struct http_request *req);
21e28a4053SRui Paulo char * http_request_get_hdr(struct http_request *req);
22e28a4053SRui Paulo char * http_request_get_data(struct http_request *req);
23e28a4053SRui Paulo char * http_request_get_hdr_line(struct http_request *req, const char *tag);
24e28a4053SRui Paulo struct sockaddr_in * http_request_get_cli_addr(struct http_request *req);
25e28a4053SRui Paulo 
26e28a4053SRui Paulo struct http_server * http_server_init(struct in_addr *addr, int port,
27e28a4053SRui Paulo 				      void (*cb)(void *ctx,
28e28a4053SRui Paulo 						 struct http_request *req),
29e28a4053SRui Paulo 				      void *cb_ctx);
30e28a4053SRui Paulo void http_server_deinit(struct http_server *srv);
31e28a4053SRui Paulo int http_server_get_port(struct http_server *srv);
32e28a4053SRui Paulo 
33e28a4053SRui Paulo #endif /* HTTP_SERVER_H */
34