25 lines
542 B
C
Executable File
25 lines
542 B
C
Executable File
#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
|