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
14a535a6
Commit
14a535a6
authored
Mar 03, 2016
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #424 from iovisor/bblanco_dev
Update headers with 4.5+ features
parents
242f7106
9bd3749c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
src/cc/compat/linux/bpf.h
src/cc/compat/linux/bpf.h
+61
-1
src/cc/export/helpers.h
src/cc/export/helpers.h
+10
-0
No files found.
src/cc/compat/linux/bpf.h
View file @
14a535a6
...
...
@@ -81,6 +81,9 @@ enum bpf_map_type {
BPF_MAP_TYPE_ARRAY
,
BPF_MAP_TYPE_PROG_ARRAY
,
BPF_MAP_TYPE_PERF_EVENT_ARRAY
,
BPF_MAP_TYPE_PERCPU_HASH
,
BPF_MAP_TYPE_PERCPU_ARRAY
,
BPF_MAP_TYPE_STACK_TRACE
,
};
enum
bpf_prog_type
{
...
...
@@ -269,9 +272,61 @@ enum bpf_func_id {
* Return: 0 on success
*/
BPF_FUNC_perf_event_output
,
BPF_FUNC_skb_load_bytes
,
/**
* bpf_get_stackid(ctx, map, flags) - walk user or kernel stack and return id
* @ctx: struct pt_regs*
* @map: pointer to stack_trace map
* @flags: bits 0-7 - numer of stack frames to skip
* bit 8 - collect user stack instead of kernel
* bit 9 - compare stacks by hash only
* bit 10 - if two different stacks hash into the same stackid
* discard old
* other bits - reserved
* Return: >= 0 stackid on success or negative error
*/
BPF_FUNC_get_stackid
,
/**
* bpf_csum_diff(from, from_size, to, to_size, seed) - calculate csum diff
* @from: raw from buffer
* @from_size: length of from buffer
* @to: raw to buffer
* @to_size: length of to buffer
* @seed: optional seed
* Return: csum result
*/
BPF_FUNC_csum_diff
,
__BPF_FUNC_MAX_ID
,
};
/* All flags used by eBPF helper functions, placed here. */
/* BPF_FUNC_skb_store_bytes flags. */
#define BPF_F_RECOMPUTE_CSUM (1ULL << 0)
/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.
* First 4 bits are for passing the header field size.
*/
#define BPF_F_HDR_FIELD_MASK 0xfULL
/* BPF_FUNC_l4_csum_replace flags. */
#define BPF_F_PSEUDO_HDR (1ULL << 4)
#define BPF_F_MARK_MANGLED_0 (1ULL << 5)
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
#define BPF_F_INGRESS (1ULL << 0)
/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
#define BPF_F_TUNINFO_IPV6 (1ULL << 0)
/* BPF_FUNC_get_stackid flags. */
#define BPF_F_SKIP_FIELD_MASK 0xffULL
#define BPF_F_USER_STACK (1ULL << 8)
#define BPF_F_FAST_STACK_CMP (1ULL << 9)
#define BPF_F_REUSE_STACKID (1ULL << 10)
/* user accessible mirror of in-kernel sk_buff.
* new fields can only be added to the end of this structure
*/
...
...
@@ -295,7 +350,12 @@ struct __sk_buff {
struct
bpf_tunnel_key
{
__u32
tunnel_id
;
__u32
remote_ipv4
;
union
{
__u32
remote_ipv4
;
__u32
remote_ipv6
[
4
];
};
__u8
tunnel_tos
;
__u8
tunnel_ttl
;
};
#endif
/* _UAPI__LINUX_BPF_H__ */
src/cc/export/helpers.h
View file @
14a535a6
...
...
@@ -165,6 +165,16 @@ static u32 (*bpf_get_route_realm)(void *ctx) =
static int (*bpf_perf_event_output)(void *ctx, void *map, u32 index, void *data, u32 size) =
(void *) BPF_FUNC_perf_event_output;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
static int (*bpf_skb_load_bytes)(void *ctx, int offset, void *to, u32 len) =
(void *) BPF_FUNC_skb_load_bytes;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
static int (*bpf_get_stackid)(void *ctx, void *map) =
(void *) BPF_FUNC_get_stackid;
static int (*bpf_csum_diff)(void *from, u64 from_size, void *to, u64 to_size, u64 seed) =
(void *) BPF_FUNC_csum_diff;
#endif
/* llvm builtin functions that eBPF C program may use to
* emit BPF_LD_ABS and BPF_LD_IND instructions
...
...
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