-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdmap-server.h
46 lines (33 loc) · 850 Bytes
/
dmap-server.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __DMAP_SERVER_H__
#define __DMAP_SERVER_H__
#include "dmap-const.h"
#include "dmap-connection.h"
#include "ksocket.h"
#include <linux/mutex.h>
struct dmap_server;
struct dmap_server_con {
struct dmap_server *srv;
struct mutex mutex;
struct list_head list;
struct task_struct *thread;
struct dmap_connection con;
struct dmap_packet request;
struct dmap_packet response;
bool stopping;
u64 id;
};
struct dmap_server {
struct mutex mutex;
char host[DMAP_HOST_SIZE];
int port;
struct task_struct *thread;
struct socket *sock;
bool stopping;
struct list_head con_list;
atomic64_t next_con_id;
};
int dmap_server_init(struct dmap_server *srv);
int dmap_server_start(struct dmap_server *srv, char *host, int port);
int dmap_server_stop(struct dmap_server *srv);
void dmap_server_deinit(struct dmap_server *srv);
#endif