1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
5 // source: /usr/share/vpp/api/plugins/lisp_types.api.json
7 // Package lisp_types contains generated bindings for API file lisp_types.api.
19 api "git.fd.io/govpp.git/api"
20 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
21 interface_types "git.fd.io/govpp.git/binapi/interface_types"
22 ip_types "git.fd.io/govpp.git/binapi/ip_types"
23 codec "git.fd.io/govpp.git/codec"
26 // This is a compile-time assertion to ensure that this generated file
27 // is compatible with the GoVPP api package it is being compiled against.
28 // A compilation error at this line likely means your copy of the
29 // GoVPP api package needs to be updated.
30 const _ = api.GoVppAPIPackageIsVersion2
33 APIFile = "lisp_types"
35 VersionCrc = 0xf05d92a6
38 // EidType defines enum 'eid_type'.
42 EID_TYPE_API_PREFIX EidType = 0
43 EID_TYPE_API_MAC EidType = 1
44 EID_TYPE_API_NSH EidType = 2
48 EidType_name = map[uint8]string{
49 0: "EID_TYPE_API_PREFIX",
50 1: "EID_TYPE_API_MAC",
51 2: "EID_TYPE_API_NSH",
53 EidType_value = map[string]uint8{
54 "EID_TYPE_API_PREFIX": 0,
55 "EID_TYPE_API_MAC": 1,
56 "EID_TYPE_API_NSH": 2,
60 func (x EidType) String() string {
61 s, ok := EidType_name[uint8(x)]
65 return "EidType(" + strconv.Itoa(int(x)) + ")"
68 // HmacKeyID defines enum 'hmac_key_id'.
72 KEY_ID_API_HMAC_NO_KEY HmacKeyID = 0
73 KEY_ID_API_HMAC_SHA_1_96 HmacKeyID = 1
74 KEY_ID_API_HMAC_SHA_256_128 HmacKeyID = 2
78 HmacKeyID_name = map[uint8]string{
79 0: "KEY_ID_API_HMAC_NO_KEY",
80 1: "KEY_ID_API_HMAC_SHA_1_96",
81 2: "KEY_ID_API_HMAC_SHA_256_128",
83 HmacKeyID_value = map[string]uint8{
84 "KEY_ID_API_HMAC_NO_KEY": 0,
85 "KEY_ID_API_HMAC_SHA_1_96": 1,
86 "KEY_ID_API_HMAC_SHA_256_128": 2,
90 func (x HmacKeyID) String() string {
91 s, ok := HmacKeyID_name[uint8(x)]
95 return "HmacKeyID(" + strconv.Itoa(int(x)) + ")"
98 // Eid defines type 'eid'.
100 Type EidType `binapi:"eid_type,name=type" json:"type,omitempty"`
101 Address EidAddressUnion `binapi:"eid_address,name=address" json:"address,omitempty"`
104 // HmacKey defines type 'hmac_key'.
105 type HmacKey struct {
106 ID HmacKeyID `binapi:"hmac_key_id,name=id" json:"id,omitempty"`
107 Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
110 // LocalLocator defines type 'local_locator'.
111 type LocalLocator struct {
112 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
113 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
114 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
117 // Nsh defines type 'nsh'.
119 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
120 Si uint8 `binapi:"u8,name=si" json:"si,omitempty"`
123 // RemoteLocator defines type 'remote_locator'.
124 type RemoteLocator struct {
125 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
126 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
127 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
130 // EidAddressUnion defines union 'eid_address'.
131 type EidAddressUnion struct {
132 // EidAddressUnion can be one of:
133 // - Prefix *ip_types.Prefix
134 // - Mac *ethernet_types.MacAddress
136 XXX_UnionData [18]byte
139 func EidAddressUnionPrefix(a ip_types.Prefix) (u EidAddressUnion) {
143 func (u *EidAddressUnion) SetPrefix(a ip_types.Prefix) {
144 buf := codec.NewBuffer(u.XXX_UnionData[:])
145 buf.EncodeUint8(uint8(a.Address.Af))
146 buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 16)
147 buf.EncodeUint8(a.Len)
149 func (u *EidAddressUnion) GetPrefix() (a ip_types.Prefix) {
150 buf := codec.NewBuffer(u.XXX_UnionData[:])
151 a.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
152 copy(a.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
153 a.Len = buf.DecodeUint8()
157 func EidAddressUnionMac(a ethernet_types.MacAddress) (u EidAddressUnion) {
161 func (u *EidAddressUnion) SetMac(a ethernet_types.MacAddress) {
162 buf := codec.NewBuffer(u.XXX_UnionData[:])
163 buf.EncodeBytes(a[:], 6)
165 func (u *EidAddressUnion) GetMac() (a ethernet_types.MacAddress) {
166 buf := codec.NewBuffer(u.XXX_UnionData[:])
167 copy(a[:], buf.DecodeBytes(6))
171 func EidAddressUnionNsh(a Nsh) (u EidAddressUnion) {
175 func (u *EidAddressUnion) SetNsh(a Nsh) {
176 buf := codec.NewBuffer(u.XXX_UnionData[:])
177 buf.EncodeUint32(a.Spi)
178 buf.EncodeUint8(a.Si)
180 func (u *EidAddressUnion) GetNsh() (a Nsh) {
181 buf := codec.NewBuffer(u.XXX_UnionData[:])
182 a.Spi = buf.DecodeUint32()
183 a.Si = buf.DecodeUint8()