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