blob: 650859022771b580fbbc53c056ada3993e3e0567 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2019 Facebook
3#include <linux/bpf.h>
4#include "bpf_helpers.h"
5
6char _license[] SEC("license") = "GPL";
7
8SEC("socket")
9int combinations(volatile struct __sk_buff* skb)
10{
11 int ret = 0, i;
12
13#pragma nounroll
14 for (i = 0; i < 20; i++)
15 if (skb->len)
16 ret |= 1 << i;
17 return ret;
18}