forked from linux-can/libsocketcan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibsocketcangw.h
More file actions
executable file
·65 lines (54 loc) · 1.71 KB
/
libsocketcangw.h
File metadata and controls
executable file
·65 lines (54 loc) · 1.71 KB
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
56
57
58
59
60
61
62
63
64
65
/*
* libsocketcangw.h
*
* (C) 2025 Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful, but without
* any warranty; without even the implied warranty of merchantability or fitness
* for a particular purpose. see the gnu lesser general public license for more
* details.
*
* you should have received a copy of the gnu lesser general public license
* along with this library; if not, write to the free software foundation, inc.,
* 59 temple place, suite 330, boston, ma 02111-1307 usa
*/
#ifndef _socketcangw_netlink_h
#define _socketcangw_netlink_h
/**
* @file
* @brief API overview
*/
#include <linux/can.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SOCKETCAN_GW_RULE_ECHO (0x00000001U)
#define SOCKETCAN_GW_RULE_FILTER (0x00000002U)
struct s_socketcan_gw_rule {
unsigned int src_ifindex;
unsigned int dst_ifindex;
unsigned int options;
unsigned int echo;
struct can_filter filter;
};
typedef struct s_socketcan_gw_rule socketcan_gw_rule_t;
struct s_socketcan_gw_rules {
size_t rule_num;
socketcan_gw_rule_t **rules;
// internal use
size_t array_num;
};
typedef struct s_socketcan_gw_rules socketcan_gw_rules_t;
int cangw_add_rule(socketcan_gw_rule_t *rule);
int cangw_delete_rule(socketcan_gw_rule_t *rule);
int cangw_clean_rule(void);
int cangw_get_rules(socketcan_gw_rules_t **gw_rules);
int cangw_release_rules(socketcan_gw_rules_t *gw_rules);
#ifdef __cplusplus
}
#endif
#endif