Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
bf1a54c9
Commit
bf1a54c9
authored
Dec 04, 2017
by
4ast
Committed by
GitHub
Dec 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1473 from iovisor/yhs_dev
sync compat headers with latest net-next
parents
928c7bdd
81b935df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
15 deletions
+96
-15
src/cc/compat/linux/bpf.h
src/cc/compat/linux/bpf.h
+48
-8
src/cc/compat/linux/virtual_bpf.h
src/cc/compat/linux/virtual_bpf.h
+48
-7
No files found.
src/cc/compat/linux/bpf.h
View file @
bf1a54c9
...
@@ -112,6 +112,7 @@ enum bpf_map_type {
...
@@ -112,6 +112,7 @@ enum bpf_map_type {
BPF_MAP_TYPE_HASH_OF_MAPS
,
BPF_MAP_TYPE_HASH_OF_MAPS
,
BPF_MAP_TYPE_DEVMAP
,
BPF_MAP_TYPE_DEVMAP
,
BPF_MAP_TYPE_SOCKMAP
,
BPF_MAP_TYPE_SOCKMAP
,
BPF_MAP_TYPE_CPUMAP
,
};
};
enum
bpf_prog_type
{
enum
bpf_prog_type
{
...
@@ -130,6 +131,7 @@ enum bpf_prog_type {
...
@@ -130,6 +131,7 @@ enum bpf_prog_type {
BPF_PROG_TYPE_LWT_XMIT
,
BPF_PROG_TYPE_LWT_XMIT
,
BPF_PROG_TYPE_SOCK_OPS
,
BPF_PROG_TYPE_SOCK_OPS
,
BPF_PROG_TYPE_SK_SKB
,
BPF_PROG_TYPE_SK_SKB
,
BPF_PROG_TYPE_CGROUP_DEVICE
,
};
};
enum
bpf_attach_type
{
enum
bpf_attach_type
{
...
@@ -139,6 +141,7 @@ enum bpf_attach_type {
...
@@ -139,6 +141,7 @@ enum bpf_attach_type {
BPF_CGROUP_SOCK_OPS
,
BPF_CGROUP_SOCK_OPS
,
BPF_SK_SKB_STREAM_PARSER
,
BPF_SK_SKB_STREAM_PARSER
,
BPF_SK_SKB_STREAM_VERDICT
,
BPF_SK_SKB_STREAM_VERDICT
,
BPF_CGROUP_DEVICE
,
__MAX_BPF_ATTACH_TYPE
__MAX_BPF_ATTACH_TYPE
};
};
...
@@ -217,6 +220,10 @@ enum bpf_attach_type {
...
@@ -217,6 +220,10 @@ enum bpf_attach_type {
#define BPF_OBJ_NAME_LEN 16U
#define BPF_OBJ_NAME_LEN 16U
/* Flags for accessing BPF object */
#define BPF_F_RDONLY (1U << 3)
#define BPF_F_WRONLY (1U << 4)
union
bpf_attr
{
union
bpf_attr
{
struct
{
/* anonymous struct used by BPF_MAP_CREATE command */
struct
{
/* anonymous struct used by BPF_MAP_CREATE command */
__u32
map_type
;
/* one of enum bpf_map_type */
__u32
map_type
;
/* one of enum bpf_map_type */
...
@@ -254,11 +261,13 @@ union bpf_attr {
...
@@ -254,11 +261,13 @@ union bpf_attr {
__u32
kern_version
;
/* checked when prog_type=kprobe */
__u32
kern_version
;
/* checked when prog_type=kprobe */
__u32
prog_flags
;
__u32
prog_flags
;
char
prog_name
[
BPF_OBJ_NAME_LEN
];
char
prog_name
[
BPF_OBJ_NAME_LEN
];
__u32
prog_ifindex
;
/* ifindex of netdev to prep for */
};
};
struct
{
/* anonymous struct used by BPF_OBJ_* commands */
struct
{
/* anonymous struct used by BPF_OBJ_* commands */
__aligned_u64
pathname
;
__aligned_u64
pathname
;
__u32
bpf_fd
;
__u32
bpf_fd
;
__u32
file_flags
;
};
};
struct
{
/* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
struct
{
/* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
...
@@ -286,6 +295,7 @@ union bpf_attr {
...
@@ -286,6 +295,7 @@ union bpf_attr {
__u32
map_id
;
__u32
map_id
;
};
};
__u32
next_id
;
__u32
next_id
;
__u32
open_flags
;
};
};
struct
{
/* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
struct
{
/* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
...
@@ -607,12 +617,22 @@ union bpf_attr {
...
@@ -607,12 +617,22 @@ union bpf_attr {
* int bpf_setsockopt(bpf_socket, level, optname, optval, optlen)
* int bpf_setsockopt(bpf_socket, level, optname, optval, optlen)
* Calls setsockopt. Not all opts are available, only those with
* Calls setsockopt. Not all opts are available, only those with
* integer optvals plus TCP_CONGESTION.
* integer optvals plus TCP_CONGESTION.
* Supported levels: SOL_SOCKET and IPROTO_TCP
* Supported levels: SOL_SOCKET and IPPROTO_TCP
* @bpf_socket: pointer to bpf_socket
* @level: SOL_SOCKET or IPPROTO_TCP
* @optname: option name
* @optval: pointer to option value
* @optlen: length of optval in bytes
* Return: 0 or negative error
*
* int bpf_getsockopt(bpf_socket, level, optname, optval, optlen)
* Calls getsockopt. Not all opts are available.
* Supported levels: IPPROTO_TCP
* @bpf_socket: pointer to bpf_socket
* @bpf_socket: pointer to bpf_socket
* @level:
SOL_SOCKET or I
PROTO_TCP
* @level:
IP
PROTO_TCP
* @optname: option name
* @optname: option name
* @optval: pointer to option value
* @optval: pointer to option value
* @optlen: length of optval in byes
* @optlen: length of optval in by
t
es
* Return: 0 or negative error
* Return: 0 or negative error
*
*
* int bpf_skb_adjust_room(skb, len_diff, mode, flags)
* int bpf_skb_adjust_room(skb, len_diff, mode, flags)
...
@@ -629,7 +649,7 @@ union bpf_attr {
...
@@ -629,7 +649,7 @@ union bpf_attr {
* @map: pointer to sockmap
* @map: pointer to sockmap
* @key: key to lookup sock in map
* @key: key to lookup sock in map
* @flags: reserved for future use
* @flags: reserved for future use
* Return: SK_
REDIRECT
* Return: SK_
PASS
*
*
* int bpf_sock_map_update(skops, map, key, flags)
* int bpf_sock_map_update(skops, map, key, flags)
* @skops: pointer to bpf_sock_ops
* @skops: pointer to bpf_sock_ops
...
@@ -715,7 +735,8 @@ union bpf_attr {
...
@@ -715,7 +735,8 @@ union bpf_attr {
FN(sock_map_update), \
FN(sock_map_update), \
FN(xdp_adjust_meta), \
FN(xdp_adjust_meta), \
FN(perf_event_read_value), \
FN(perf_event_read_value), \
FN(perf_prog_read_value),
FN(perf_prog_read_value), \
FN(getsockopt),
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
* function eBPF program intends to call
* function eBPF program intends to call
...
@@ -870,9 +891,8 @@ struct xdp_md {
...
@@ -870,9 +891,8 @@ struct xdp_md {
};
};
enum
sk_action
{
enum
sk_action
{
SK_ABORTED
=
0
,
SK_DROP
=
0
,
SK_DROP
,
SK_PASS
,
SK_REDIRECT
,
};
};
#define BPF_TAG_SIZE 8
#define BPF_TAG_SIZE 8
...
@@ -949,6 +969,13 @@ enum {
...
@@ -949,6 +969,13 @@ enum {
BPF_SOCK_OPS_NEEDS_ECN
,
/* If connection's congestion control
BPF_SOCK_OPS_NEEDS_ECN
,
/* If connection's congestion control
* needs ECN
* needs ECN
*/
*/
BPF_SOCK_OPS_BASE_RTT
,
/* Get base RTT. The correct value is
* based on the path and may be
* dependent on the congestion control
* algorithm. In general it indicates
* a congestion threshold. RTTs above
* this indicate congestion
*/
};
};
#define TCP_BPF_IW 1001
/* Set TCP initial congestion window */
#define TCP_BPF_IW 1001
/* Set TCP initial congestion window */
...
@@ -960,4 +987,17 @@ struct bpf_perf_event_value {
...
@@ -960,4 +987,17 @@ struct bpf_perf_event_value {
__u64
running
;
__u64
running
;
};
};
#define BPF_DEVCG_ACC_MKNOD (1ULL << 0)
#define BPF_DEVCG_ACC_READ (1ULL << 1)
#define BPF_DEVCG_ACC_WRITE (1ULL << 2)
#define BPF_DEVCG_DEV_BLOCK (1ULL << 0)
#define BPF_DEVCG_DEV_CHAR (1ULL << 1)
struct
bpf_cgroup_dev_ctx
{
__u32
access_type
;
/* (access << 16) | type */
__u32
major
;
__u32
minor
;
};
#endif
/* _UAPI__LINUX_BPF_H__ */
#endif
/* _UAPI__LINUX_BPF_H__ */
src/cc/compat/linux/virtual_bpf.h
View file @
bf1a54c9
...
@@ -113,6 +113,7 @@ enum bpf_map_type {
...
@@ -113,6 +113,7 @@ enum bpf_map_type {
BPF_MAP_TYPE_HASH_OF_MAPS,
BPF_MAP_TYPE_HASH_OF_MAPS,
BPF_MAP_TYPE_DEVMAP,
BPF_MAP_TYPE_DEVMAP,
BPF_MAP_TYPE_SOCKMAP,
BPF_MAP_TYPE_SOCKMAP,
BPF_MAP_TYPE_CPUMAP,
};
};
enum bpf_prog_type {
enum bpf_prog_type {
...
@@ -131,6 +132,7 @@ enum bpf_prog_type {
...
@@ -131,6 +132,7 @@ enum bpf_prog_type {
BPF_PROG_TYPE_LWT_XMIT,
BPF_PROG_TYPE_LWT_XMIT,
BPF_PROG_TYPE_SOCK_OPS,
BPF_PROG_TYPE_SOCK_OPS,
BPF_PROG_TYPE_SK_SKB,
BPF_PROG_TYPE_SK_SKB,
BPF_PROG_TYPE_CGROUP_DEVICE,
};
};
enum bpf_attach_type {
enum bpf_attach_type {
...
@@ -140,6 +142,7 @@ enum bpf_attach_type {
...
@@ -140,6 +142,7 @@ enum bpf_attach_type {
BPF_CGROUP_SOCK_OPS,
BPF_CGROUP_SOCK_OPS,
BPF_SK_SKB_STREAM_PARSER,
BPF_SK_SKB_STREAM_PARSER,
BPF_SK_SKB_STREAM_VERDICT,
BPF_SK_SKB_STREAM_VERDICT,
BPF_CGROUP_DEVICE,
__MAX_BPF_ATTACH_TYPE
__MAX_BPF_ATTACH_TYPE
};
};
...
@@ -217,6 +220,10 @@ enum bpf_attach_type {
...
@@ -217,6 +220,10 @@ enum bpf_attach_type {
#define BPF_OBJ_NAME_LEN 16U
#define BPF_OBJ_NAME_LEN 16U
/* Flags for accessing BPF object */
#define BPF_F_RDONLY (1U << 3)
#define BPF_F_WRONLY (1U << 4)
union bpf_attr {
union bpf_attr {
struct { /* anonymous struct used by BPF_MAP_CREATE command */
struct { /* anonymous struct used by BPF_MAP_CREATE command */
__u32 map_type; /* one of enum bpf_map_type */
__u32 map_type; /* one of enum bpf_map_type */
...
@@ -254,11 +261,13 @@ union bpf_attr {
...
@@ -254,11 +261,13 @@ union bpf_attr {
__u32 kern_version; /* checked when prog_type=kprobe */
__u32 kern_version; /* checked when prog_type=kprobe */
__u32 prog_flags;
__u32 prog_flags;
char prog_name[BPF_OBJ_NAME_LEN];
char prog_name[BPF_OBJ_NAME_LEN];
__u32 prog_ifindex; /* ifindex of netdev to prep for */
};
};
struct { /* anonymous struct used by BPF_OBJ_* commands */
struct { /* anonymous struct used by BPF_OBJ_* commands */
__aligned_u64 pathname;
__aligned_u64 pathname;
__u32 bpf_fd;
__u32 bpf_fd;
__u32 file_flags;
};
};
struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
...
@@ -286,6 +295,7 @@ union bpf_attr {
...
@@ -286,6 +295,7 @@ union bpf_attr {
__u32 map_id;
__u32 map_id;
};
};
__u32 next_id;
__u32 next_id;
__u32 open_flags;
};
};
struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
...
@@ -606,14 +616,24 @@ union bpf_attr {
...
@@ -606,14 +616,24 @@ union bpf_attr {
* int bpf_setsockopt(bpf_socket, level, optname, optval, optlen)
* int bpf_setsockopt(bpf_socket, level, optname, optval, optlen)
* Calls setsockopt. Not all opts are available, only those with
* Calls setsockopt. Not all opts are available, only those with
* integer optvals plus TCP_CONGESTION.
* integer optvals plus TCP_CONGESTION.
* Supported levels: SOL_SOCKET and IPROTO_TCP
* Supported levels: SOL_SOCKET and IP
P
ROTO_TCP
* @bpf_socket: pointer to bpf_socket
* @bpf_socket: pointer to bpf_socket
* @level: SOL_SOCKET or IPROTO_TCP
* @level: SOL_SOCKET or IP
P
ROTO_TCP
* @optname: option name
* @optname: option name
* @optval: pointer to option value
* @optval: pointer to option value
* @optlen: length of optval in byes
* @optlen: length of optval in byes
* Return: 0 or negative error
* Return: 0 or negative error
*
*
* int bpf_getsockopt(bpf_socket, level, optname, optval, optlen)
* Calls getsockopt. Not all opts are available.
* Supported levels: IPPROTO_TCP
* @bpf_socket: pointer to bpf_socket
* @level: IPPROTO_TCP
* @optname: option name
* @optval: pointer to option value
* @optlen: length of optval in bytes
* Return: 0 or negative error
*
* int bpf_skb_adjust_room(skb, len_diff, mode, flags)
* int bpf_skb_adjust_room(skb, len_diff, mode, flags)
* Grow or shrink room in sk_buff.
* Grow or shrink room in sk_buff.
* @skb: pointer to skb
* @skb: pointer to skb
...
@@ -628,7 +648,7 @@ union bpf_attr {
...
@@ -628,7 +648,7 @@ union bpf_attr {
* @map: pointer to sockmap
* @map: pointer to sockmap
* @key: key to lookup sock in map
* @key: key to lookup sock in map
* @flags: reserved for future use
* @flags: reserved for future use
* Return: SK_
REDIRECT
* Return: SK_
PASS
*
*
* int bpf_sock_map_update(skops, map, key, flags)
* int bpf_sock_map_update(skops, map, key, flags)
* @skops: pointer to bpf_sock_ops
* @skops: pointer to bpf_sock_ops
...
@@ -714,7 +734,8 @@ union bpf_attr {
...
@@ -714,7 +734,8 @@ union bpf_attr {
FN(sock_map_update), \
FN(sock_map_update), \
FN(xdp_adjust_meta), \
FN(xdp_adjust_meta), \
FN(perf_event_read_value), \
FN(perf_event_read_value), \
FN(perf_prog_read_value),
FN(perf_prog_read_value), \
FN(getsockopt),
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
* function eBPF program intends to call
* function eBPF program intends to call
...
@@ -869,9 +890,8 @@ struct xdp_md {
...
@@ -869,9 +890,8 @@ struct xdp_md {
};
};
enum sk_action {
enum sk_action {
SK_ABORTED = 0,
SK_DROP = 0,
SK_DROP,
SK_PASS,
SK_REDIRECT,
};
};
#define BPF_TAG_SIZE 8
#define BPF_TAG_SIZE 8
...
@@ -948,6 +968,13 @@ enum {
...
@@ -948,6 +968,13 @@ enum {
BPF_SOCK_OPS_NEEDS_ECN, /* If connection's congestion control
BPF_SOCK_OPS_NEEDS_ECN, /* If connection's congestion control
* needs ECN
* needs ECN
*/
*/
BPF_SOCK_OPS_BASE_RTT, /* Get base RTT. The correct value is
* based on the path and may be
* dependent on the congestion control
* algorithm. In general it indicates
* a congestion threshold. RTTs above
* this indicate congestion
*/
};
};
#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */
#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */
...
@@ -959,5 +986,19 @@ struct bpf_perf_event_value {
...
@@ -959,5 +986,19 @@ struct bpf_perf_event_value {
__u64 running;
__u64 running;
};
};
#define BPF_DEVCG_ACC_MKNOD (1ULL << 0)
#define BPF_DEVCG_ACC_READ (1ULL << 1)
#define BPF_DEVCG_ACC_WRITE (1ULL << 2)
#define BPF_DEVCG_DEV_BLOCK (1ULL << 0)
#define BPF_DEVCG_DEV_CHAR (1ULL << 1)
struct bpf_cgroup_dev_ctx {
__u32 access_type; /* (access << 16) | type */
__u32 major;
__u32 minor;
};
#endif /* _UAPI__LINUX_BPF_H__ */
#endif /* _UAPI__LINUX_BPF_H__ */
)********"
)********"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment