]> git.proxmox.com Git - mirror_frr.git/blob - include/linux/seg6_local.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / include / linux / seg6_local.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * SR-IPv6 implementation
4 *
5 * Author:
6 * David Lebrun <david.lebrun@uclouvain.be>
7 */
8
9 #ifndef _LINUX_SEG6_LOCAL_H
10 #define _LINUX_SEG6_LOCAL_H
11
12 #include <linux/seg6.h>
13
14 enum {
15 SEG6_LOCAL_UNSPEC,
16 SEG6_LOCAL_ACTION,
17 SEG6_LOCAL_SRH,
18 SEG6_LOCAL_TABLE,
19 SEG6_LOCAL_NH4,
20 SEG6_LOCAL_NH6,
21 SEG6_LOCAL_IIF,
22 SEG6_LOCAL_OIF,
23 SEG6_LOCAL_BPF,
24 SEG6_LOCAL_VRFTABLE,
25 SEG6_LOCAL_COUNTERS,
26 __SEG6_LOCAL_MAX,
27 };
28 #define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
29
30 enum {
31 SEG6_LOCAL_ACTION_UNSPEC = 0,
32 /* node segment */
33 SEG6_LOCAL_ACTION_END = 1,
34 /* adjacency segment (IPv6 cross-connect) */
35 SEG6_LOCAL_ACTION_END_X = 2,
36 /* lookup of next seg NH in table */
37 SEG6_LOCAL_ACTION_END_T = 3,
38 /* decap and L2 cross-connect */
39 SEG6_LOCAL_ACTION_END_DX2 = 4,
40 /* decap and IPv6 cross-connect */
41 SEG6_LOCAL_ACTION_END_DX6 = 5,
42 /* decap and IPv4 cross-connect */
43 SEG6_LOCAL_ACTION_END_DX4 = 6,
44 /* decap and lookup of DA in v6 table */
45 SEG6_LOCAL_ACTION_END_DT6 = 7,
46 /* decap and lookup of DA in v4 table */
47 SEG6_LOCAL_ACTION_END_DT4 = 8,
48 /* binding segment with insertion */
49 SEG6_LOCAL_ACTION_END_B6 = 9,
50 /* binding segment with encapsulation */
51 SEG6_LOCAL_ACTION_END_B6_ENCAP = 10,
52 /* binding segment with MPLS encap */
53 SEG6_LOCAL_ACTION_END_BM = 11,
54 /* lookup last seg in table */
55 SEG6_LOCAL_ACTION_END_S = 12,
56 /* forward to SR-unaware VNF with static proxy */
57 SEG6_LOCAL_ACTION_END_AS = 13,
58 /* forward to SR-unaware VNF with masquerading */
59 SEG6_LOCAL_ACTION_END_AM = 14,
60 /* custom BPF action */
61 SEG6_LOCAL_ACTION_END_BPF = 15,
62 /* decap and lookup of DA in v4 or v6 table */
63 SEG6_LOCAL_ACTION_END_DT46 = 16,
64
65 __SEG6_LOCAL_ACTION_MAX,
66 };
67
68 #define SEG6_LOCAL_ACTION_MAX (__SEG6_LOCAL_ACTION_MAX - 1)
69
70 enum {
71 SEG6_LOCAL_BPF_PROG_UNSPEC,
72 SEG6_LOCAL_BPF_PROG,
73 SEG6_LOCAL_BPF_PROG_NAME,
74 __SEG6_LOCAL_BPF_PROG_MAX,
75 };
76
77 #define SEG6_LOCAL_BPF_PROG_MAX (__SEG6_LOCAL_BPF_PROG_MAX - 1)
78
79 /* SRv6 Behavior counters are encoded as netlink attributes guaranteeing the
80 * correct alignment.
81 * Each counter is identified by a different attribute type (i.e.
82 * SEG6_LOCAL_CNT_PACKETS).
83 *
84 * - SEG6_LOCAL_CNT_PACKETS: identifies a counter that counts the number of
85 * packets that have been CORRECTLY processed by an SRv6 Behavior instance
86 * (i.e., packets that generate errors or are dropped are NOT counted).
87 *
88 * - SEG6_LOCAL_CNT_BYTES: identifies a counter that counts the total amount
89 * of traffic in bytes of all packets that have been CORRECTLY processed by
90 * an SRv6 Behavior instance (i.e., packets that generate errors or are
91 * dropped are NOT counted).
92 *
93 * - SEG6_LOCAL_CNT_ERRORS: identifies a counter that counts the number of
94 * packets that have NOT been properly processed by an SRv6 Behavior instance
95 * (i.e., packets that generate errors or are dropped).
96 */
97 enum {
98 SEG6_LOCAL_CNT_UNSPEC,
99 SEG6_LOCAL_CNT_PAD, /* pad for 64 bits values */
100 SEG6_LOCAL_CNT_PACKETS,
101 SEG6_LOCAL_CNT_BYTES,
102 SEG6_LOCAL_CNT_ERRORS,
103 __SEG6_LOCAL_CNT_MAX,
104 };
105
106 #define SEG6_LOCAL_CNT_MAX (__SEG6_LOCAL_CNT_MAX - 1)
107
108 #endif