aboutsummaryrefslogtreecommitdiffstats
path: root/ARCHITECTURE.txt
blob: 721b09496b547452f58bee379f4dda6dc7b74607 (plain) (blame)
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
47
48
===============================================================================
2012-11-06_00-19

refer to architecture.xoj for big picture
* libglouglou
* viz clients
* probes (trackproc, netsniff, fwsniff)

===============================================================================
libglouglou/includes
* protocol version
* packet structure
* common constants

===============================================================================
libglouglou/lib
* client and server code
* tools

/*
 * start a server
 * totaly unblocking, using libevent
 */
struct gg_server *
gg_server_start(char *ip, int port,
                int (*handle_conn)(struct gg_server *s, int client_id, struct sockaddr_in *addr),
                int (*handle_packet)(struct gg_server *s, struct gg_packet *p));

int
gg_server_send(struct gg_server *s, int client_id, struct gg_packet *p);

void
gg_server_stop(struct gg_server *s);

/*
 * connect to a server
 * totaly unblocking, using libevent
 */
struct gg_client *
gg_client_connect(char *ip, int port,
                  int (*handle_conn)(struct gg_client *c, int status),
                  int (*handle_packet)(struct gg_client *c, struct gg_packet *p));

int
gg_client_send(struct gg_client *c, struct gg_packet *p);

void
gg_client_disconnect(struct gg_client *c);