connection.h 405 Bytes
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1 2 3
#ifndef __CONNECTION_H__
#define __CONNECTION_H__

4 5
#include <stdint.h>

Jack Moffitt's avatar
Jack Moffitt committed
6 7 8 9 10
typedef struct connection_tag
{
	unsigned long id;

	time_t con_time;
11
	uint64_t sent_bytes;
Jack Moffitt's avatar
Jack Moffitt committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25

	int sock;
	int error;

	char *ip;
	char *host;
} connection_t;

void connection_initialize(void);
void connection_shutdown(void);
void connection_accept_loop(void);
void connection_close(connection_t *con);

#endif  /* __CONNECTION_H__ */