blob: 219941c5ab5a56d52e6b14709706002d349244f3 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * http_server - HTTP server
3 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
13 */
14
15#ifndef HTTP_SERVER_H
16#define HTTP_SERVER_H
17
18struct http_server;
19struct http_request;
20
21void http_request_deinit(struct http_request *req);
22void http_request_send(struct http_request *req, struct wpabuf *resp);
23void http_request_send_and_deinit(struct http_request *req,
24 struct wpabuf *resp);
25enum httpread_hdr_type http_request_get_type(struct http_request *req);
26char * http_request_get_uri(struct http_request *req);
27char * http_request_get_hdr(struct http_request *req);
28char * http_request_get_data(struct http_request *req);
29char * http_request_get_hdr_line(struct http_request *req, const char *tag);
30struct sockaddr_in * http_request_get_cli_addr(struct http_request *req);
31
32struct http_server * http_server_init(struct in_addr *addr, int port,
33 void (*cb)(void *ctx,
34 struct http_request *req),
35 void *cb_ctx);
36void http_server_deinit(struct http_server *srv);
37int http_server_get_port(struct http_server *srv);
38
39#endif /* HTTP_SERVER_H */