Initial commit to the repository
[deb_shairplay.git] / src / httpd.h
1 #ifndef HTTPD_H
2 #define HTTPD_H
3
4 #include "logger.h"
5 #include "http_request.h"
6 #include "http_response.h"
7
8 typedef struct httpd_s httpd_t;
9
10 struct httpd_callbacks_s {
11 void* opaque;
12 void* (*conn_init)(void *opaque, unsigned char *local, int locallen, unsigned char *remote, int remotelen);
13 void (*conn_request)(void *ptr, http_request_t *request, http_response_t **response);
14 void (*conn_destroy)(void *ptr);
15 };
16 typedef struct httpd_callbacks_s httpd_callbacks_t;
17
18
19 httpd_t *httpd_init(logger_t *logger, httpd_callbacks_t *callbacks, int max_connections, int use_rtsp);
20
21 int httpd_start(httpd_t *httpd, unsigned short *port);
22 void httpd_stop(httpd_t *httpd);
23
24 void httpd_destroy(httpd_t *httpd);
25
26
27 #endif