Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 // Copyright (c) 2019 Facebook
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 
0006 char _license[] SEC("license") = "GPL";
0007 
0008 SEC("socket")
0009 int combinations(volatile struct __sk_buff* skb)
0010 {
0011     int ret = 0, i;
0012 
0013 #pragma nounroll
0014     for (i = 0; i < 20; i++)
0015         if (skb->len)
0016             ret |= 1 << i;
0017     return ret;
0018 }