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