Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/netdev.yaml */
4/* YNL-GEN user header */
5
6#ifndef _LINUX_NETDEV_GEN_H
7#define _LINUX_NETDEV_GEN_H
8
9#include <stdlib.h>
10#include <string.h>
11#include <linux/types.h>
12#include <linux/netdev.h>
13
14struct ynl_sock;
15
16extern const struct ynl_family ynl_netdev_family;
17
18/* Enums */
19const char *netdev_op_str(int op);
20const char *netdev_xdp_act_str(enum netdev_xdp_act value);
21const char *netdev_xdp_rx_metadata_str(enum netdev_xdp_rx_metadata value);
22
23/* Common nested types */
24/* ============== NETDEV_CMD_DEV_GET ============== */
25/* NETDEV_CMD_DEV_GET - do */
26struct netdev_dev_get_req {
27 struct {
28 __u32 ifindex:1;
29 } _present;
30
31 __u32 ifindex;
32};
33
34static inline struct netdev_dev_get_req *netdev_dev_get_req_alloc(void)
35{
36 return calloc(1, sizeof(struct netdev_dev_get_req));
37}
38void netdev_dev_get_req_free(struct netdev_dev_get_req *req);
39
40static inline void
41netdev_dev_get_req_set_ifindex(struct netdev_dev_get_req *req, __u32 ifindex)
42{
43 req->_present.ifindex = 1;
44 req->ifindex = ifindex;
45}
46
47struct netdev_dev_get_rsp {
48 struct {
49 __u32 ifindex:1;
50 __u32 xdp_features:1;
51 __u32 xdp_zc_max_segs:1;
52 __u32 xdp_rx_metadata_features:1;
53 } _present;
54
55 __u32 ifindex;
56 __u64 xdp_features;
57 __u32 xdp_zc_max_segs;
58 __u64 xdp_rx_metadata_features;
59};
60
61void netdev_dev_get_rsp_free(struct netdev_dev_get_rsp *rsp);
62
63/*
64 * Get / dump information about a netdev.
65 */
66struct netdev_dev_get_rsp *
67netdev_dev_get(struct ynl_sock *ys, struct netdev_dev_get_req *req);
68
69/* NETDEV_CMD_DEV_GET - dump */
70struct netdev_dev_get_list {
71 struct netdev_dev_get_list *next;
72 struct netdev_dev_get_rsp obj __attribute__((aligned(8)));
73};
74
75void netdev_dev_get_list_free(struct netdev_dev_get_list *rsp);
76
77struct netdev_dev_get_list *netdev_dev_get_dump(struct ynl_sock *ys);
78
79/* NETDEV_CMD_DEV_GET - notify */
80struct netdev_dev_get_ntf {
81 __u16 family;
82 __u8 cmd;
83 struct ynl_ntf_base_type *next;
84 void (*free)(struct netdev_dev_get_ntf *ntf);
85 struct netdev_dev_get_rsp obj __attribute__((aligned(8)));
86};
87
88void netdev_dev_get_ntf_free(struct netdev_dev_get_ntf *rsp);
89
90#endif /* _LINUX_NETDEV_GEN_H */