flow_dissector.h (d053cf0d771f6547cb0537759a9af63cf402908d) flow_dissector.h (b27f7bb590ba835b32ef122389db158e44cfda1e)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NET_FLOW_DISSECTOR_H
3#define _NET_FLOW_DISSECTOR_H
4
5#include <linux/types.h>
6#include <linux/in6.h>
7#include <linux/siphash.h>
8#include <linux/string.h>
9#include <uapi/linux/if_ether.h>
10
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NET_FLOW_DISSECTOR_H
3#define _NET_FLOW_DISSECTOR_H
4
5#include <linux/types.h>
6#include <linux/in6.h>
7#include <linux/siphash.h>
8#include <linux/string.h>
9#include <uapi/linux/if_ether.h>
10
11struct bpf_prog;
12struct net;
11struct sk_buff;
12
13/**
14 * struct flow_dissector_key_control:
15 * @thoff: Transport header offset
16 */
17struct flow_dissector_key_control {
18 u16 thoff;

--- 35 unchanged lines hidden (view full) ---

54 vlan_dei:1,
55 vlan_priority:3;
56 };
57 __be16 vlan_tci;
58 };
59 __be16 vlan_tpid;
60};
61
13struct sk_buff;
14
15/**
16 * struct flow_dissector_key_control:
17 * @thoff: Transport header offset
18 */
19struct flow_dissector_key_control {
20 u16 thoff;

--- 35 unchanged lines hidden (view full) ---

56 vlan_dei:1,
57 vlan_priority:3;
58 };
59 __be16 vlan_tci;
60 };
61 __be16 vlan_tpid;
62};
63
62struct flow_dissector_key_mpls {
64struct flow_dissector_mpls_lse {
63 u32 mpls_ttl:8,
64 mpls_bos:1,
65 mpls_tc:3,
66 mpls_label:20;
67};
68
65 u32 mpls_ttl:8,
66 mpls_bos:1,
67 mpls_tc:3,
68 mpls_label:20;
69};
70
71#define FLOW_DIS_MPLS_MAX 7
72struct flow_dissector_key_mpls {
73 struct flow_dissector_mpls_lse ls[FLOW_DIS_MPLS_MAX]; /* Label Stack */
74 u8 used_lses; /* One bit set for each Label Stack Entry in use */
75};
76
77static inline void dissector_set_mpls_lse(struct flow_dissector_key_mpls *mpls,
78 int lse_index)
79{
80 mpls->used_lses |= 1 << lse_index;
81}
82
69#define FLOW_DIS_TUN_OPTS_MAX 255
70/**
71 * struct flow_dissector_key_enc_opts:
72 * @data: tunnel option data
73 * @len: length of tunnel option data
74 * @dst_opt_type: tunnel option type
75 */
76struct flow_dissector_key_enc_opts {

--- 275 unchanged lines hidden (view full) ---

352static inline void
353flow_dissector_init_keys(struct flow_dissector_key_control *key_control,
354 struct flow_dissector_key_basic *key_basic)
355{
356 memset(key_control, 0, sizeof(*key_control));
357 memset(key_basic, 0, sizeof(*key_basic));
358}
359
83#define FLOW_DIS_TUN_OPTS_MAX 255
84/**
85 * struct flow_dissector_key_enc_opts:
86 * @data: tunnel option data
87 * @len: length of tunnel option data
88 * @dst_opt_type: tunnel option type
89 */
90struct flow_dissector_key_enc_opts {

--- 275 unchanged lines hidden (view full) ---

366static inline void
367flow_dissector_init_keys(struct flow_dissector_key_control *key_control,
368 struct flow_dissector_key_basic *key_basic)
369{
370 memset(key_control, 0, sizeof(*key_control));
371 memset(key_basic, 0, sizeof(*key_basic));
372}
373
374#ifdef CONFIG_BPF_SYSCALL
375int flow_dissector_bpf_prog_attach(struct net *net, struct bpf_prog *prog);
376#endif /* CONFIG_BPF_SYSCALL */
377
360#endif
378#endif