aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/tunnel_types/tunnel_types.ba.go
blob: 6d9e382d74ff420cd48a9d0b6005592aa177f5f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.6.0-dev
//  VPP:              22.02-release
// source: /usr/share/vpp/api/core/tunnel_types.api.json

// Package tunnel_types contains generated bindings for API file tunnel_types.api.
//
// Contents:
//   3 enums
//   1 struct
//
package tunnel_types

import (
	"strconv"

	api "go.fd.io/govpp/api"
	interface_types "go.fd.io/govpp/binapi/interface_types"
	ip_types "go.fd.io/govpp/binapi/ip_types"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2

const (
	APIFile    = "tunnel_types"
	APIVersion = "1.0.1"
	VersionCrc = 0x882f6758
)

// TunnelEncapDecapFlags defines enum 'tunnel_encap_decap_flags'.
type TunnelEncapDecapFlags uint8

const (
	TUNNEL_API_ENCAP_DECAP_FLAG_NONE                  TunnelEncapDecapFlags = 0
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF         TunnelEncapDecapFlags = 1
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF          TunnelEncapDecapFlags = 2
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP       TunnelEncapDecapFlags = 4
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN        TunnelEncapDecapFlags = 8
	TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN        TunnelEncapDecapFlags = 16
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH      TunnelEncapDecapFlags = 32
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT  TunnelEncapDecapFlags = 64
	TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL TunnelEncapDecapFlags = 128
)

var (
	TunnelEncapDecapFlags_name = map[uint8]string{
		0:   "TUNNEL_API_ENCAP_DECAP_FLAG_NONE",
		1:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF",
		2:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF",
		4:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP",
		8:   "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN",
		16:  "TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN",
		32:  "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH",
		64:  "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT",
		128: "TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL",
	}
	TunnelEncapDecapFlags_value = map[string]uint8{
		"TUNNEL_API_ENCAP_DECAP_FLAG_NONE":                  0,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DF":         1,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_SET_DF":          2,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP":       4,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN":        8,
		"TUNNEL_API_ENCAP_DECAP_FLAG_DECAP_COPY_ECN":        16,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH":      32,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_HOP_LIMIT":  64,
		"TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_FLOW_LABEL": 128,
	}
)

func (x TunnelEncapDecapFlags) String() string {
	s, ok := TunnelEncapDecapFlags_name[uint8(x)]
	if ok {
		return s
	}
	str := func(n uint8) string {
		s, ok := TunnelEncapDecapFlags_name[uint8(n)]
		if ok {
			return s
		}
		return "TunnelEncapDecapFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint8(0); i <= 8; i++ {
		val := uint8(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint8(x))
	}
	return s
}

// TunnelMode defines enum 'tunnel_mode'.
type TunnelMode uint8

const (
	TUNNEL_API_MODE_P2P TunnelMode = 0
	TUNNEL_API_MODE_MP  TunnelMode = 1
)

var (
	TunnelMode_name = map[uint8]string{
		0: "TUNNEL_API_MODE_P2P",
		1: "TUNNEL_API_MODE_MP",
	}
	TunnelMode_value = map[string]uint8{
		"TUNNEL_API_MODE_P2P": 0,
		"TUNNEL_API_MODE_MP":  1,
	}
)

func (x TunnelMode) String() string {
	s, ok := TunnelMode_name[uint8(x)]
	if ok {
		return s
	}
	return "TunnelMode(" + strconv.Itoa(int(x)) + ")"
}

// TunnelFlags defines enum 'tunnel_flags'.
type TunnelFlags uint8

const (
	TUNNEL_API_FLAG_TRACK_MTU TunnelFlags = 1
)

var (
	TunnelFlags_name = map[uint8]string{
		1: "TUNNEL_API_FLAG_TRACK_MTU",
	}
	TunnelFlags_value = map[string]uint8{
		"TUNNEL_API_FLAG_TRACK_MTU": 1,
	}
)

func (x TunnelFlags) String() string {
	s, ok := TunnelFlags_name[uint8(x)]
	if ok {
		return s
	}
	str := func(n uint8) string {
		s, ok := TunnelFlags_name[uint8(n)]
		if ok {
			return s
		}
		return "TunnelFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint8(0); i <= 8; i++ {
		val := uint8(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint8(x))
	}
	return s
}

// Tunnel defines type 'tunnel'.
type Tunnel struct {
	Instance        uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
	Src             ip_types.Address               `binapi:"address,name=src" json:"src,omitempty"`
	Dst             ip_types.Address               `binapi:"address,name=dst" json:"dst,omitempty"`
	SwIfIndex       interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	TableID         uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
	EncapDecapFlags TunnelEncapDecapFlags          `binapi:"tunnel_encap_decap_flags,name=encap_decap_flags" json:"encap_decap_flags,omitempty"`
	Mode            TunnelMode                     `binapi:"tunnel_mode,name=mode" json:"mode,omitempty"`
	Flags           TunnelFlags                    `binapi:"tunnel_flags,name=flags" json:"flags,omitempty"`
	Dscp            ip_types.IPDscp                `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
	HopLimit        uint8                          `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
}