brintos

brintos / linux-shallow public Read only

0
0
Text · 371 B · 0de0357 Raw
21 lines · c
1// SPDX-License-Identifier: GPL-2.02// Copyright (c) 2019 Facebook3#include <linux/bpf.h>4#include <bpf/bpf_helpers.h>5 6#include "bpf_compiler.h"7 8char _license[] SEC("license") = "GPL";9 10SEC("socket")11int combinations(volatile struct __sk_buff* skb)12{13	int ret = 0, i;14 15	__pragma_loop_no_unroll16	for (i = 0; i < 20; i++)17		if (skb->len)18			ret |= 1 << i;19	return ret;20}21