forked from linux-netdev/ynl-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfou-user.hpp
More file actions
111 lines (94 loc) · 2.57 KB
/
fou-user.hpp
File metadata and controls
111 lines (94 loc) · 2.57 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/* */
/* YNL-GEN user header */
#ifndef _LINUX_FOU_GEN_H
#define _LINUX_FOU_GEN_H
#include <linux/types.h>
#include <stdlib.h>
#include <string.h>
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include <array>
#include "ynl.hpp"
#include <linux/fou.h>
namespace ynl_cpp {
const struct ynl_family& get_ynl_fou_family();
/* Enums */
std::string_view fou_op_str(int op);
std::string_view fou_encap_type_str(int value);
/* Common nested types */
/* ============== FOU_CMD_ADD ============== */
/* FOU_CMD_ADD - do */
struct fou_add_req {
std::optional<__u16> port /* big-endian */;
std::optional<__u8> ipproto;
std::optional<__u8> type;
bool remcsum_nopartial{};
std::optional<__u32> local_v4;
std::optional<__u32> peer_v4;
std::vector<__u8> local_v6;
std::vector<__u8> peer_v6;
std::optional<__u16> peer_port /* big-endian */;
std::optional<__s32> ifindex;
};
/*
* Add port.
*/
int fou_add(ynl_cpp::ynl_socket& ys, fou_add_req& req);
/* ============== FOU_CMD_DEL ============== */
/* FOU_CMD_DEL - do */
struct fou_del_req {
std::optional<__u8> af;
std::optional<__s32> ifindex;
std::optional<__u16> port /* big-endian */;
std::optional<__u16> peer_port /* big-endian */;
std::optional<__u32> local_v4;
std::optional<__u32> peer_v4;
std::vector<__u8> local_v6;
std::vector<__u8> peer_v6;
};
/*
* Delete port.
*/
int fou_del(ynl_cpp::ynl_socket& ys, fou_del_req& req);
/* ============== FOU_CMD_GET ============== */
/* FOU_CMD_GET - do */
struct fou_get_req {
std::optional<__u8> af;
std::optional<__s32> ifindex;
std::optional<__u16> port /* big-endian */;
std::optional<__u16> peer_port /* big-endian */;
std::optional<__u32> local_v4;
std::optional<__u32> peer_v4;
std::vector<__u8> local_v6;
std::vector<__u8> peer_v6;
};
struct fou_get_rsp {
std::optional<__u16> port /* big-endian */;
std::optional<__u8> ipproto;
std::optional<__u8> type;
bool remcsum_nopartial{};
std::optional<__u32> local_v4;
std::optional<__u32> peer_v4;
std::vector<__u8> local_v6;
std::vector<__u8> peer_v6;
std::optional<__u16> peer_port /* big-endian */;
std::optional<__s32> ifindex;
};
/*
* Get tunnel info.
*/
std::unique_ptr<fou_get_rsp>
fou_get(ynl_cpp::ynl_socket& ys, fou_get_req& req);
/* FOU_CMD_GET - dump */
struct fou_get_list {
std::list<fou_get_rsp> objs;
};
std::unique_ptr<fou_get_list> fou_get_dump(ynl_cpp::ynl_socket& ys);
} //namespace ynl_cpp
#endif /* _LINUX_FOU_GEN_H */