http_client.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * http_client - HTTP client
  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_CLIENT_H
  15. #define HTTP_CLIENT_H
  16. struct http_client;
  17. enum http_client_event {
  18. HTTP_CLIENT_FAILED,
  19. HTTP_CLIENT_TIMEOUT,
  20. HTTP_CLIENT_OK,
  21. HTTP_CLIENT_INVALID_REPLY,
  22. };
  23. char * http_client_url_parse(const char *url, struct sockaddr_in *dst,
  24. char **path);
  25. struct http_client * http_client_addr(struct sockaddr_in *dst,
  26. struct wpabuf *req, size_t max_response,
  27. void (*cb)(void *ctx,
  28. struct http_client *c,
  29. enum http_client_event event),
  30. void *cb_ctx);
  31. struct http_client * http_client_url(const char *url,
  32. struct wpabuf *req, size_t max_response,
  33. void (*cb)(void *ctx,
  34. struct http_client *c,
  35. enum http_client_event event),
  36. void *cb_ctx);
  37. void http_client_free(struct http_client *c);
  38. struct wpabuf * http_client_get_body(struct http_client *c);
  39. char * http_link_update(char *url, const char *base);
  40. #endif /* HTTP_CLIENT_H */