http_client.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * http_client - HTTP client
  3. * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef HTTP_CLIENT_H
  9. #define HTTP_CLIENT_H
  10. struct http_client;
  11. enum http_client_event {
  12. HTTP_CLIENT_FAILED,
  13. HTTP_CLIENT_TIMEOUT,
  14. HTTP_CLIENT_OK,
  15. HTTP_CLIENT_INVALID_REPLY,
  16. };
  17. char * http_client_url_parse(const char *url, struct sockaddr_in *dst,
  18. char **path);
  19. struct http_client * http_client_addr(struct sockaddr_in *dst,
  20. struct wpabuf *req, size_t max_response,
  21. void (*cb)(void *ctx,
  22. struct http_client *c,
  23. enum http_client_event event),
  24. void *cb_ctx);
  25. struct http_client * http_client_url(const char *url,
  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. void http_client_free(struct http_client *c);
  32. struct wpabuf * http_client_get_body(struct http_client *c);
  33. char * http_client_get_hdr_line(struct http_client *c, const char *tag);
  34. char * http_link_update(char *url, const char *base);
  35. #endif /* HTTP_CLIENT_H */