Client authentication added.
[xiph/unicode.git] / icecast / src / connection.h
blob8b60772f4bac4bbd341c0db2ec7277ff4c2f9026
1 #ifndef __CONNECTION_H__
2 #define __CONNECTION_H__
4 #include <sys/types.h>
5 #include <time.h>
6 #include "compat.h"
7 #include "httpp/httpp.h"
8 #include "thread/thread.h"
9 #include "net/sock.h"
11 struct _client_tag;
13 typedef struct connection_tag
15 unsigned long id;
17 time_t con_time;
18 uint64_t sent_bytes;
21 int sock;
22 int serversock;
23 int error;
25 char *ip;
26 char *host;
28 /* For 'fake' connections */
29 int event_number;
30 void *event;
31 } connection_t;
33 void connection_initialize(void);
34 void connection_shutdown(void);
35 void connection_accept_loop(void);
36 void connection_close(connection_t *con);
37 connection_t *create_connection(sock_t sock, sock_t serversock, char *ip);
38 int connection_create_source(struct _client_tag *client, connection_t *con,
39 http_parser_t *parser, char *mount);
41 void connection_inject_event(int eventnum, void *event_data);
43 int connection_check_source_pass(http_parser_t *parser, char *mount);
44 int connection_check_relay_pass(http_parser_t *parser);
45 int connection_check_admin_pass(http_parser_t *parser);
47 extern rwlock_t _source_shutdown_rwlock;
49 #endif /* __CONNECTION_H__ */