-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrmc_proto_test_common.h
55 lines (43 loc) · 1.61 KB
/
rmc_proto_test_common.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
47
48
49
50
51
52
53
54
55
// Copyright (C) 2018, Jaguar Land Rover
// This program is licensed under the terms and conditions of the
// Mozilla Public License, version 2.0. The full text of the
// Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
//
// Author: Magnus Feuer ([email protected])
#ifndef __RMC_PROTO_TEST_COMMON_H__
#define __RMC_PROTO_TEST_COMMON_H__
#include "reliable_multicast.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <errno.h>
typedef struct __attribute__((packed))
signal {
uint32_t node_id; // 4
uint32_t signal_id; // 4
uint32_t max_signal_id; // 4
uint64_t filler; // 8
} signal_t; // 20 bytes.
extern void* _test_proto_alloc(payload_len_t plen);
extern void test_proto_free(void* payload, payload_len_t plen);
extern void _test(char* fmt_string, int major, int minor, int error);
extern void poll_add(user_data_t user_data,
int descriptor,
rmc_index_t index,
rmc_poll_action_t action);
extern void poll_modify(user_data_t user_data,
int descriptor,
rmc_index_t index,
rmc_poll_action_t old_action,
rmc_poll_action_t new_action);
extern void poll_remove(user_data_t user_data,
int descriptor,
rmc_index_t index);
extern char* _op_res_string(uint8_t res);
#endif // __RMC_PROTO_TEST_COMMON_H__