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