Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame^] | 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 | |
| 15 | #ifndef HTTP_CLIENT_H |
| 16 | #define HTTP_CLIENT_H |
| 17 | |
| 18 | struct http_client; |
| 19 | |
| 20 | enum http_client_event { |
| 21 | HTTP_CLIENT_FAILED, |
| 22 | HTTP_CLIENT_TIMEOUT, |
| 23 | HTTP_CLIENT_OK, |
| 24 | HTTP_CLIENT_INVALID_REPLY, |
| 25 | }; |
| 26 | |
| 27 | char * http_client_url_parse(const char *url, struct sockaddr_in *dst, |
| 28 | char **path); |
| 29 | struct http_client * http_client_addr(struct sockaddr_in *dst, |
| 30 | struct wpabuf *req, size_t max_response, |
| 31 | void (*cb)(void *ctx, |
| 32 | struct http_client *c, |
| 33 | enum http_client_event event), |
| 34 | void *cb_ctx); |
| 35 | struct http_client * http_client_url(const char *url, |
| 36 | struct wpabuf *req, size_t max_response, |
| 37 | void (*cb)(void *ctx, |
| 38 | struct http_client *c, |
| 39 | enum http_client_event event), |
| 40 | void *cb_ctx); |
| 41 | void http_client_free(struct http_client *c); |
| 42 | struct wpabuf * http_client_get_body(struct http_client *c); |
| 43 | char * http_client_get_hdr_line(struct http_client *c, const char *tag); |
| 44 | char * http_link_update(char *url, const char *base); |
| 45 | |
| 46 | #endif /* HTTP_CLIENT_H */ |