Debian Codegraph @

buildlib/fixup-include/netlink-attr.h

raw
1 #ifndef _FIXUP_NETLINK_ATTR_H
2 #define _FIXUP_NETLINK_ATTR_H
3
4 #include <linux/netlink.h>
5
6 #include <netdb.h>
7 #include <stdint.h>
8 #include <stdlib.h>
9
10 struct nlmsghdr;
11 struct nl_msg;
12 struct nl_sock;
13 struct nlattr;
14 struct nl_cb;
15 struct sockaddr_nl;
16 struct nlmsgerr;
17 struct nl_addr;
18 struct nl_cache;
19 struct nl_object;
20
21 typedef int (*nl_recvmsg_msg_cb_t)(struct nl_msg *msg, void *arg);
22 typedef int (*nl_recvmsg_err_cb_t)(struct sockaddr_nl *nla,
23 struct nlmsgerr *nlerr, void *arg);
24
25 struct nla_policy {
26 int type;
27 };
28
29 enum {
30 NLA_U8,
31 NLA_U32,
32 NLA_U64,
33 NL_AUTO_PORT,
34 NL_AUTO_SEQ,
35 NL_STOP,
36 NL_OK,
37 NL_CB_DEFAULT,
38 NL_CB_VALID,
39 NL_CB_CUSTOM,
40 NLE_PARSE_ERR,
41 NLE_NOMEM,
42 };
43
44 static inline struct nl_sock *nl_socket_alloc(void)
45 {
46 return NULL;
47 }
48
49 static inline int nl_connect(struct nl_sock *sk, int kind)
50 {
51 return -1;
52 }
53
54 static inline void nl_socket_free(struct nl_sock *sk)
55 {
56 }
57
58 static inline void nl_socket_disable_auto_ack(struct nl_sock *sk)
59 {
60 }
61
62 static inline void nl_socket_disable_msg_peek(struct nl_sock *sk)
63 {
64 }
65
66 static inline void nl_socket_disable_seq_check(struct nl_sock *sk)
67 {
68 }
69
70 static inline int nl_socket_get_fd(struct nl_sock *sk)
71 {
72 return -1;
73 }
74
75 static inline int nl_socket_add_membership(struct nl_sock *sk, int group)
76 {
77 return -1;
78 }
79
80 static inline struct nlmsghdr *nlmsg_put(struct nl_msg *msg, uint32_t pid,
81 uint32_t seq, int type, int payload,
82 int flags)
83 {
84 return NULL;
85 }
86
87 static inline struct nl_msg *nlmsg_alloc(void)
88 {
89 return NULL;
90 }
91
92 static inline struct nl_msg *nlmsg_alloc_simple(int nlmsgtype, int flags)
93
94 {
95 return NULL;
96 }
97
98 static inline void nlmsg_free(struct nl_msg *msg)
99 {
100 }
101
102 static inline int nl_send_auto(struct nl_sock *sk, struct nl_msg *msg)
103 {
104 return -1;
105 }
106
107 static inline struct nlmsghdr *nlmsg_hdr(struct nl_msg *msg)
108 {
109 return NULL;
110 }
111
112 static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen,
113 struct nlattr *tb[], int maxtype,
114 struct nla_policy *policy)
115 {
116 return -1;
117 }
118
119 static inline int nl_msg_parse(struct nl_msg *msg,
120 void (*cb)(struct nl_object *, void *),
121 void *arg)
122 {
123 return -1;
124 }
125
126 static inline int nlmsg_append(struct nl_msg *n, void *data, size_t len,
127 int pad)
128 {
129 return -1;
130 }
131
132 static inline int nl_send_simple(struct nl_sock *sk, int type, int flags,
133 void *buf, size_t size)
134 {
135 return -1;
136 }
137
138 static inline int nl_recvmsgs(struct nl_sock *sk, struct nl_cb *cb)
139 {
140 return -1;
141 }
142
143 static inline int nl_recvmsgs_default(struct nl_sock *sk)
144 {
145 return -1;
146 }
147
148 static inline struct nl_cb *nl_cb_alloc(int kind)
149 {
150 return NULL;
151 }
152
153 static inline int nl_cb_set(struct nl_cb *cb, int type, int kind,
154 nl_recvmsg_msg_cb_t func, void *arg)
155 {
156 return -1;
157 }
158
159 static inline int nl_socket_modify_err_cb(struct nl_sock *sk, int kind,
160 nl_recvmsg_err_cb_t func, void *arg)
161 {
162 return -1;
163 }
164
165 static inline int nl_socket_modify_cb(struct nl_sock *sk, int type, int kind,
166 nl_recvmsg_msg_cb_t func, void *arg)
167 {
168 return -1;
169 }
170
171 #define NLA_PUT_U32(msg, attrtype, value) ({ goto nla_put_failure; })
172 #define NLA_PUT_STRING(msg, attrtype, value) ({ goto nla_put_failure; })
173 #define NLA_PUT_ADDR(msg, attrtype, value) ({ goto nla_put_failure; })
174
175 static inline const char *nla_get_string(struct nlattr *tb)
176 {
177 return NULL;
178 }
179
180 static inline uint8_t nla_get_u8(struct nlattr *tb)
181 {
182 return 0;
183 }
184
185 static inline uint32_t nla_get_u32(struct nlattr *tb)
186 {
187 return 0;
188 }
189
190 static inline uint64_t nla_get_u64(struct nlattr *tb)
191 {
192 return 0;
193 }
194
195 static inline struct nl_addr *nl_addr_clone(struct nl_addr *src)
196 {
197 return NULL;
198 }
199
200 static inline int nl_addr_info(struct nl_addr *addr, struct addrinfo **result)
201 {
202 return -1;
203 }
204
205 static inline struct nl_addr *nl_addr_build(int family, void *buf, size_t size)
206 {
207 return NULL;
208 }
209
210 static inline unsigned int nl_addr_get_len(struct nl_addr *addr)
211 {
212 return 0;
213 }
214
215 static inline void *nl_addr_get_binary_addr(struct nl_addr *addr)
216 {
217 return NULL;
218 }
219
220 static inline int nl_addr_get_family(struct nl_addr *addr)
221 {
222 return -1;
223 }
224
225 static inline int nl_addr_get_prefixlen(struct nl_addr *addr)
226 {
227 return -1;
228 }
229
230 static inline int nl_addr_fill_sockaddr(struct nl_addr *addr,
231 struct sockaddr *sa, socklen_t *salen)
232 {
233 return -1;
234 }
235
236 static inline void nl_addr_put(struct nl_addr *addr)
237 {
238 }
239
240 static inline void nl_addr_set_prefixlen(struct nl_addr *addr, int prefixlen)
241 {
242 }
243
244 static inline void nl_cache_mngt_unprovide(struct nl_cache *cache)
245 {
246 }
247
248 static inline void nl_cache_free(struct nl_cache *cache)
249 {
250 }
251
252 static inline int nl_object_match_filter(struct nl_object *obj,
253 struct nl_object *filter)
254 {
255 return -1;
256 }
257
258 static inline int nl_cache_refill(struct nl_sock *sk, struct nl_cache *cache)
259 {
260 return -1;
261 }
262
263 static inline void nl_cache_mngt_provide(struct nl_cache *cache)
264 {
265 }
266
267 #endif