blob: 3a4904ee4a67b70269a093354c5aa0ad6012c68f (
plain)
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
|
#ifndef NETWORK_H
#define NETWORK_H
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdint.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
typedef struct packet packet;
typedef struct cmd cmd;
typedef struct cmd_header cmd_header;
struct cmd_header {
uint32_t size;
uint16_t magic;
uint16_t id;
};
struct cmd {
cmd_header header;
uint8_t data[];
};
struct packet {
uint32_t size;
cmd cmd;
};
#endif
|