diff options
Diffstat (limited to 'include/net.h')
-rwxr-xr-x | include/net.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h new file mode 100755 index 0000000..af6bf57 --- /dev/null +++ b/include/net.h @@ -0,0 +1,24 @@ +#ifndef _NET_H_ +#define _NET_H_ +#include "config.h" +#include "request.h" +#include "response.h" + +/** + * Sends a `struct request` to the current `struct connection` contained within + * `struct config *conf`. + */ +int send_request(struct config *conf, struct request *req); + +/** + * Reads a response from the current `struct connection` and parses it into + * `struct response *res` + */ +int read_response(struct config *conf, struct response *res); + +enum NetError { + SSL_SEND_ERROR = -1, + ALLOC_ERROR = -2, + RESPONSE_PARSE_ERROR = -3, +}; +#endif |