http_server.h revision 214734
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * http_server - HTTP server
30Sstevel@tonic-gate * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
40Sstevel@tonic-gate *
50Sstevel@tonic-gate * This program is free software; you can redistribute it and/or modify
60Sstevel@tonic-gate * it under the terms of the GNU General Public License version 2 as
70Sstevel@tonic-gate * published by the Free Software Foundation.
80Sstevel@tonic-gate *
90Sstevel@tonic-gate * Alternatively, this software may be distributed under the terms of BSD
100Sstevel@tonic-gate * license.
110Sstevel@tonic-gate *
120Sstevel@tonic-gate * See README and COPYING for more details.
130Sstevel@tonic-gate */
140Sstevel@tonic-gate
150Sstevel@tonic-gate#ifndef HTTP_SERVER_H
160Sstevel@tonic-gate#define HTTP_SERVER_H
170Sstevel@tonic-gate
180Sstevel@tonic-gatestruct http_server;
190Sstevel@tonic-gatestruct http_request;
200Sstevel@tonic-gate
210Sstevel@tonic-gatevoid http_request_deinit(struct http_request *req);
220Sstevel@tonic-gatevoid http_request_send(struct http_request *req, struct wpabuf *resp);
230Sstevel@tonic-gatevoid http_request_send_and_deinit(struct http_request *req,
240Sstevel@tonic-gate				  struct wpabuf *resp);
250Sstevel@tonic-gateenum httpread_hdr_type http_request_get_type(struct http_request *req);
260Sstevel@tonic-gatechar * http_request_get_uri(struct http_request *req);
270Sstevel@tonic-gatechar * http_request_get_hdr(struct http_request *req);
280Sstevel@tonic-gatechar * http_request_get_data(struct http_request *req);
290Sstevel@tonic-gatechar * http_request_get_hdr_line(struct http_request *req, const char *tag);
300Sstevel@tonic-gatestruct sockaddr_in * http_request_get_cli_addr(struct http_request *req);
310Sstevel@tonic-gate
320Sstevel@tonic-gatestruct http_server * http_server_init(struct in_addr *addr, int port,
330Sstevel@tonic-gate				      void (*cb)(void *ctx,
340Sstevel@tonic-gate						 struct http_request *req),
350Sstevel@tonic-gate				      void *cb_ctx);
360Sstevel@tonic-gatevoid http_server_deinit(struct http_server *srv);
370Sstevel@tonic-gateint http_server_get_port(struct http_server *srv);
380Sstevel@tonic-gate
390Sstevel@tonic-gate#endif /* HTTP_SERVER_H */
400Sstevel@tonic-gate