1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _RMNET_DATA_H_
8 #define _RMNET_DATA_H_
9 #define RMNET_LOCAL_LOGICAL_ENDPOINT - 1
10 #define RMNET_EGRESS_FORMAT__RESERVED__ (1 << 0)
11 #define RMNET_EGRESS_FORMAT_MAP (1 << 1)
12 #define RMNET_EGRESS_FORMAT_AGGREGATION (1 << 2)
13 #define RMNET_EGRESS_FORMAT_MUXING (1 << 3)
14 #define RMNET_EGRESS_FORMAT_MAP_CKSUMV3 (1 << 4)
15 #define RMNET_EGRESS_FORMAT_MAP_CKSUMV4 (1 << 5)
16 #define RMNET_INGRESS_FIX_ETHERNET (1 << 0)
17 #define RMNET_INGRESS_FORMAT_MAP (1 << 1)
18 #define RMNET_INGRESS_FORMAT_DEAGGREGATION (1 << 2)
19 #define RMNET_INGRESS_FORMAT_DEMUXING (1 << 3)
20 #define RMNET_INGRESS_FORMAT_MAP_COMMANDS (1 << 4)
21 #define RMNET_INGRESS_FORMAT_MAP_CKSUMV3 (1 << 5)
22 #define RMNET_INGRESS_FORMAT_MAP_CKSUMV4 (1 << 6)
23 #define RMNET_NETLINK_PROTO 31
24 #define RMNET_MAX_STR_LEN 16
25 #define RMNET_NL_DATA_MAX_LEN 64
26 #define RMNET_NETLINK_MSG_COMMAND 0
27 #define RMNET_NETLINK_MSG_RETURNCODE 1
28 #define RMNET_NETLINK_MSG_RETURNDATA 2
29 struct rmnet_nl_msg_s {
30   uint16_t reserved;
31   uint16_t message_type;
32   uint16_t reserved2 : 14;
33   uint16_t crd : 2;
34   union {
35     uint16_t arg_length;
36     uint16_t return_code;
37   };
38   union {
39     uint8_t data[RMNET_NL_DATA_MAX_LEN];
40     struct {
41       uint8_t dev[RMNET_MAX_STR_LEN];
42       uint32_t flags;
43       uint16_t agg_size;
44       uint16_t agg_count;
45       uint8_t tail_spacing;
46     } data_format;
47     struct {
48       uint8_t dev[RMNET_MAX_STR_LEN];
49       int32_t ep_id;
50       uint8_t operating_mode;
51       uint8_t next_dev[RMNET_MAX_STR_LEN];
52     } local_ep_config;
53     struct {
54       uint32_t id;
55       uint8_t vnd_name[RMNET_MAX_STR_LEN];
56     } vnd;
57     struct {
58       uint32_t id;
59       uint32_t map_flow_id;
60       uint32_t tc_flow_id;
61     } flow_control;
62   };
63 };
64 enum rmnet_netlink_message_types_e {
65   RMNET_NETLINK_ASSOCIATE_NETWORK_DEVICE,
66   RMNET_NETLINK_UNASSOCIATE_NETWORK_DEVICE,
67   RMNET_NETLINK_GET_NETWORK_DEVICE_ASSOCIATED,
68   RMNET_NETLINK_SET_LINK_EGRESS_DATA_FORMAT,
69   RMNET_NETLINK_GET_LINK_EGRESS_DATA_FORMAT,
70   RMNET_NETLINK_SET_LINK_INGRESS_DATA_FORMAT,
71   RMNET_NETLINK_GET_LINK_INGRESS_DATA_FORMAT,
72   RMNET_NETLINK_SET_LOGICAL_EP_CONFIG,
73   RMNET_NETLINK_UNSET_LOGICAL_EP_CONFIG,
74   RMNET_NETLINK_GET_LOGICAL_EP_CONFIG,
75   RMNET_NETLINK_NEW_VND,
76   RMNET_NETLINK_NEW_VND_WITH_PREFIX,
77   RMNET_NETLINK_GET_VND_NAME,
78   RMNET_NETLINK_FREE_VND,
79   RMNET_NETLINK_ADD_VND_TC_FLOW,
80   RMNET_NETLINK_DEL_VND_TC_FLOW,
81   RMNET_NETLINK_NEW_VND_WITH_NAME
82 };
83 #define RMNET_NETLINK_NEW_VND_WITH_NAME RMNET_NETLINK_NEW_VND_WITH_NAME
84 enum rmnet_config_endpoint_modes_e {
85   RMNET_EPMODE_NONE,
86   RMNET_EPMODE_VND,
87   RMNET_EPMODE_BRIDGE,
88   RMNET_EPMODE_LENGTH
89 };
90 enum rmnet_config_return_codes_e {
91   RMNET_CONFIG_OK,
92   RMNET_CONFIG_UNKNOWN_MESSAGE,
93   RMNET_CONFIG_UNKNOWN_ERROR,
94   RMNET_CONFIG_NOMEM,
95   RMNET_CONFIG_DEVICE_IN_USE,
96   RMNET_CONFIG_INVALID_REQUEST,
97   RMNET_CONFIG_NO_SUCH_DEVICE,
98   RMNET_CONFIG_BAD_ARGUMENTS,
99   RMNET_CONFIG_BAD_EGRESS_DEVICE,
100   RMNET_CONFIG_TC_HANDLE_FULL
101 };
102 #endif
103