X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuclient.git;a=blobdiff_plain;f=uclient.h;h=25990c06fca3a5b6e9855def09ae863cc3e3a0a8;hp=65e48b2f35b68058f3fb2f7ec4ff009ded60a9d5;hb=cb7867a867e45949950e03de0ea845e483ffc6eb;hpb=316bcc8c62e195a892813b050a922ebd3935eba2 diff --git a/uclient.h b/uclient.h index 65e48b2..25990c0 100644 --- a/uclient.h +++ b/uclient.h @@ -18,6 +18,8 @@ #ifndef __LIBUBOX_UCLIENT_H #define __LIBUBOX_UCLIENT_H +#include + #include #include #include @@ -32,10 +34,18 @@ enum uclient_error_code { UCLIENT_ERROR_SSL_CN_MISMATCH, }; +union uclient_addr { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; +}; + struct uclient { const struct uclient_backend *backend; const struct uclient_cb *cb; + union uclient_addr local_addr, remote_addr; + struct uclient_url *url; void *priv; @@ -65,6 +75,8 @@ int uclient_read(struct uclient *cl, char *buf, int len); int uclient_write(struct uclient *cl, char *buf, int len); int uclient_request(struct uclient *cl); +char *uclient_get_addr(char *dest, int *port, union uclient_addr *a); + /* HTTP */ extern const struct uclient_backend uclient_backend_http;