-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.h
More file actions
20 lines (17 loc) · 861 Bytes
/
message.h
File metadata and controls
20 lines (17 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
struct message
{
unsigned char protocol_id[16];
unsigned int payload_len;
unsigned char payload[];
};
static const int MP_ID_LEN = 16;
static unsigned char MESSAGE_PROTO_ID[16] =
{0x53, 0x50, 0x6f, 0x11, 0x6b, 0xd2, 0x4f, 0x47, 0xa9, 0x7f, 0xcd, 0x53, 0x9f, 0x12, 0xa8, 0xf9};
static unsigned char PING_PROTO_ID[16] =
{0xe9, 0xee, 0x12, 0x6f, 0x2a, 0x85, 0x4c, 0xd4, 0xaa, 0x6c, 0xa4, 0xbc, 0xe4, 0x49, 0xd4, 0x6c};
static unsigned char PONG_PROTO_ID[16] =
{0xba, 0xf8, 0x85, 0x54, 0x52, 0x83, 0x41, 0x25, 0xac, 0xf0, 0x42, 0xa2, 0xf5, 0x52, 0x25, 0xe7};
int send_message(int, unsigned char *, unsigned int, unsigned char *, unsigned int);
struct message * create_message(unsigned char *, unsigned int);
int send_message_un(int, struct message *, struct sockaddr_un *, socklen_t);
struct message * get_message(unsigned char *, unsigned int);