Home | History | Annotate | Download | only in wps
      1 /*
      2  * http_server - HTTP server
      3  * Copyright (c) 2009, Jouni Malinen <j (at) 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 
     18 struct http_server;
     19 struct http_request;
     20 
     21 void http_request_deinit(struct http_request *req);
     22 void http_request_send(struct http_request *req, struct wpabuf *resp);
     23 void http_request_send_and_deinit(struct http_request *req,
     24 				  struct wpabuf *resp);
     25 enum httpread_hdr_type http_request_get_type(struct http_request *req);
     26 char * http_request_get_uri(struct http_request *req);
     27 char * http_request_get_hdr(struct http_request *req);
     28 char * http_request_get_data(struct http_request *req);
     29 char * http_request_get_hdr_line(struct http_request *req, const char *tag);
     30 struct sockaddr_in * http_request_get_cli_addr(struct http_request *req);
     31 
     32 struct 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);
     36 void http_server_deinit(struct http_server *srv);
     37 int http_server_get_port(struct http_server *srv);
     38 
     39 #endif /* HTTP_SERVER_H */
     40