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
185
|
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.5.0
// VPP: 22.02-release
// source: /usr/share/vpp/api/plugins/lisp_types.api.json
// Package lisp_types contains generated bindings for API file lisp_types.api.
//
// Contents:
// 2 enums
// 5 structs
// 1 union
//
package lisp_types
import (
"strconv"
api "git.fd.io/govpp.git/api"
ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
interface_types "git.fd.io/govpp.git/binapi/interface_types"
ip_types "git.fd.io/govpp.git/binapi/ip_types"
codec "git.fd.io/govpp.git/codec"
)
// 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 = "lisp_types"
APIVersion = "1.0.0"
VersionCrc = 0xf05d92a6
)
// EidType defines enum 'eid_type'.
type EidType uint8
const (
EID_TYPE_API_PREFIX EidType = 0
EID_TYPE_API_MAC EidType = 1
EID_TYPE_API_NSH EidType = 2
)
var (
EidType_name = map[uint8]string{
0: "EID_TYPE_API_PREFIX",
1: "EID_TYPE_API_MAC",
2: "EID_TYPE_API_NSH",
}
EidType_value = map[string]uint8{
"EID_TYPE_API_PREFIX": 0,
"EID_TYPE_API_MAC": 1,
"EID_TYPE_API_NSH": 2,
}
)
func (x EidType) String() string {
s, ok := EidType_name[uint8(x)]
if ok {
return s
}
return "EidType(" + strconv.Itoa(int(x)) + ")"
}
// HmacKeyID defines enum 'hmac_key_id'.
type HmacKeyID uint8
const (
KEY_ID_API_HMAC_NO_KEY HmacKeyID = 0
KEY_ID_API_HMAC_SHA_1_96 HmacKeyID = 1
KEY_ID_API_HMAC_SHA_256_128 HmacKeyID = 2
)
var (
HmacKeyID_name = map[uint8]string{
0: "KEY_ID_API_HMAC_NO_KEY",
1: "KEY_ID_API_HMAC_SHA_1_96",
2: "KEY_ID_API_HMAC_SHA_256_128",
}
HmacKeyID_value = map[string]uint8{
"KEY_ID_API_HMAC_NO_KEY": 0,
"KEY_ID_API_HMAC_SHA_1_96": 1,
"KEY_ID_API_HMAC_SHA_256_128": 2,
}
)
func (x HmacKeyID) String() string {
s, ok := HmacKeyID_name[uint8(x)]
if ok {
return s
}
return "HmacKeyID(" + strconv.Itoa(int(x)) + ")"
}
// Eid defines type 'eid'.
type Eid struct {
Type EidType `binapi:"eid_type,name=type" json:"type,omitempty"`
Address EidAddressUnion `binapi:"eid_address,name=address" json:"address,omitempty"`
}
// HmacKey defines type 'hmac_key'.
type HmacKey struct {
ID HmacKeyID `binapi:"hmac_key_id,name=id" json:"id,omitempty"`
Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
}
// LocalLocator defines type 'local_locator'.
type LocalLocator struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
}
// Nsh defines type 'nsh'.
type Nsh struct {
Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
Si uint8 `binapi:"u8,name=si" json:"si,omitempty"`
}
// RemoteLocator defines type 'remote_locator'.
type RemoteLocator struct {
Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
}
// EidAddressUnion defines union 'eid_address'.
type EidAddressUnion struct {
// EidAddressUnion can be one of:
// - Prefix *ip_types.Prefix
// - Mac *ethernet_types.MacAddress
// - Nsh *Nsh
XXX_UnionData [18]byte
}
func EidAddressUnionPrefix(a ip_types.Prefix) (u EidAddressUnion) {
u.SetPrefix(a)
return
}
func (u *EidAddressUnion) SetPrefix(a ip_types.Prefix) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
buf.EncodeUint8(uint8(a.Address.Af))
buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 16)
buf.EncodeUint8(a.Len)
}
func (u *EidAddressUnion) GetPrefix() (a ip_types.Prefix) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
a.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
copy(a.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
a.Len = buf.DecodeUint8()
return
}
func EidAddressUnionMac(a ethernet_types.MacAddress) (u EidAddressUnion) {
u.SetMac(a)
return
}
func (u *EidAddressUnion) SetMac(a ethernet_types.MacAddress) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
buf.EncodeBytes(a[:], 6)
}
func (u *EidAddressUnion) GetMac() (a ethernet_types.MacAddress) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
copy(a[:], buf.DecodeBytes(6))
return
}
func EidAddressUnionNsh(a Nsh) (u EidAddressUnion) {
u.SetNsh(a)
return
}
func (u *EidAddressUnion) SetNsh(a Nsh) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
buf.EncodeUint32(a.Spi)
buf.EncodeUint8(a.Si)
}
func (u *EidAddressUnion) GetNsh() (a Nsh) {
buf := codec.NewBuffer(u.XXX_UnionData[:])
a.Spi = buf.DecodeUint32()
a.Si = buf.DecodeUint8()
return
}
|