http_server.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  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. #ifndef HTTP_SERVER_H
  15. #define HTTP_SERVER_H
  16. struct http_server;
  17. struct http_request;
  18. void http_request_deinit(struct http_request *req);
  19. void http_request_send(struct http_request *req, struct wpabuf *resp);
  20. void http_request_send_and_deinit(struct http_request *req,
  21. struct wpabuf *resp);
  22. enum httpread_hdr_type http_request_get_type(struct http_request *req);
  23. char * http_request_get_uri(struct http_request *req);
  24. char * http_request_get_hdr(struct http_request *req);
  25. char * http_request_get_data(struct http_request *req);
  26. char * http_request_get_hdr_line(struct http_request *req, const char *tag);
  27. struct sockaddr_in * http_request_get_cli_addr(struct http_request *req);
  28. struct http_server * http_server_init(struct in_addr *addr, int port,
  29. void (*cb)(void *ctx,
  30. struct http_request *req),
  31. void *cb_ctx);
  32. void http_server_deinit(struct http_server *srv);
  33. int http_server_get_port(struct http_server *srv);
  34. #endif /* HTTP_SERVER_H */