1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
5 // source: /usr/share/vpp/api/core/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
32 // EidType defines enum 'eid_type'.
36 EID_TYPE_API_PREFIX EidType = 0
37 EID_TYPE_API_MAC EidType = 1
38 EID_TYPE_API_NSH EidType = 2
42 EidType_name = map[uint8]string{
43 0: "EID_TYPE_API_PREFIX",
44 1: "EID_TYPE_API_MAC",
45 2: "EID_TYPE_API_NSH",
47 EidType_value = map[string]uint8{
48 "EID_TYPE_API_PREFIX": 0,
49 "EID_TYPE_API_MAC": 1,
50 "EID_TYPE_API_NSH": 2,
54 func (x EidType) String() string {
55 s, ok := EidType_name[uint8(x)]
59 return "EidType(" + strconv.Itoa(int(x)) + ")"
62 // HmacKeyID defines enum 'hmac_key_id'.
66 KEY_ID_API_HMAC_NO_KEY HmacKeyID = 0
67 KEY_ID_API_HMAC_SHA_1_96 HmacKeyID = 1
68 KEY_ID_API_HMAC_SHA_256_128 HmacKeyID = 2
72 HmacKeyID_name = map[uint8]string{
73 0: "KEY_ID_API_HMAC_NO_KEY",
74 1: "KEY_ID_API_HMAC_SHA_1_96",
75 2: "KEY_ID_API_HMAC_SHA_256_128",
77 HmacKeyID_value = map[string]uint8{
78 "KEY_ID_API_HMAC_NO_KEY": 0,
79 "KEY_ID_API_HMAC_SHA_1_96": 1,
80 "KEY_ID_API_HMAC_SHA_256_128": 2,
84 func (x HmacKeyID) String() string {
85 s, ok := HmacKeyID_name[uint8(x)]
89 return "HmacKeyID(" + strconv.Itoa(int(x)) + ")"
92 // Eid defines type 'eid'.
94 Type EidType `binapi:"eid_type,name=type" json:"type,omitempty"`
95 Address EidAddressUnion `binapi:"eid_address,name=address" json:"address,omitempty"`
98 // HmacKey defines type 'hmac_key'.
100 ID HmacKeyID `binapi:"hmac_key_id,name=id" json:"id,omitempty"`
101 Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
104 // LocalLocator defines type 'local_locator'.
105 type LocalLocator struct {
106 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
107 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
108 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
111 // Nsh defines type 'nsh'.
113 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
114 Si uint8 `binapi:"u8,name=si" json:"si,omitempty"`
117 // RemoteLocator defines type 'remote_locator'.
118 type RemoteLocator struct {
119 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
120 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
121 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
124 // EidAddressUnion defines union 'eid_address'.
125 type EidAddressUnion struct {
126 // EidAddressUnion can be one of:
127 // - Prefix *ip_types.Prefix
128 // - Mac *ethernet_types.MacAddress
130 XXX_UnionData [18]byte
133 func EidAddressUnionPrefix(a ip_types.Prefix) (u EidAddressUnion) {
137 func (u *EidAddressUnion) SetPrefix(a ip_types.Prefix) {
138 buf := codec.NewBuffer(u.XXX_UnionData[:])
139 buf.EncodeUint8(uint8(a.Address.Af))
140 buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 16)
141 buf.EncodeUint8(a.Len)
143 func (u *EidAddressUnion) GetPrefix() (a ip_types.Prefix) {
144 buf := codec.NewBuffer(u.XXX_UnionData[:])
145 a.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
146 copy(a.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
147 a.Len = buf.DecodeUint8()
151 func EidAddressUnionMac(a ethernet_types.MacAddress) (u EidAddressUnion) {
155 func (u *EidAddressUnion) SetMac(a ethernet_types.MacAddress) {
156 buf := codec.NewBuffer(u.XXX_UnionData[:])
157 buf.EncodeBytes(a[:], 6)
159 func (u *EidAddressUnion) GetMac() (a ethernet_types.MacAddress) {
160 buf := codec.NewBuffer(u.XXX_UnionData[:])
161 copy(a[:], buf.DecodeBytes(6))
165 func EidAddressUnionNsh(a Nsh) (u EidAddressUnion) {
169 func (u *EidAddressUnion) SetNsh(a Nsh) {
170 buf := codec.NewBuffer(u.XXX_UnionData[:])
171 buf.EncodeUint32(a.Spi)
172 buf.EncodeUint8(a.Si)
174 func (u *EidAddressUnion) GetNsh() (a Nsh) {
175 buf := codec.NewBuffer(u.XXX_UnionData[:])
176 a.Spi = buf.DecodeUint32()
177 a.Si = buf.DecodeUint8()