1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package lisp_types contains generated bindings for API file lisp_types.api.
18 api "git.fd.io/govpp.git/api"
19 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
20 interface_types "git.fd.io/govpp.git/binapi/interface_types"
21 ip_types "git.fd.io/govpp.git/binapi/ip_types"
22 codec "git.fd.io/govpp.git/codec"
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
31 // EidType defines enum 'eid_type'.
35 EID_TYPE_API_PREFIX EidType = 0
36 EID_TYPE_API_MAC EidType = 1
37 EID_TYPE_API_NSH EidType = 2
41 EidType_name = map[uint8]string{
42 0: "EID_TYPE_API_PREFIX",
43 1: "EID_TYPE_API_MAC",
44 2: "EID_TYPE_API_NSH",
46 EidType_value = map[string]uint8{
47 "EID_TYPE_API_PREFIX": 0,
48 "EID_TYPE_API_MAC": 1,
49 "EID_TYPE_API_NSH": 2,
53 func (x EidType) String() string {
54 s, ok := EidType_name[uint8(x)]
58 return "EidType(" + strconv.Itoa(int(x)) + ")"
61 // HmacKeyID defines enum 'hmac_key_id'.
65 KEY_ID_API_HMAC_NO_KEY HmacKeyID = 0
66 KEY_ID_API_HMAC_SHA_1_96 HmacKeyID = 1
67 KEY_ID_API_HMAC_SHA_256_128 HmacKeyID = 2
71 HmacKeyID_name = map[uint8]string{
72 0: "KEY_ID_API_HMAC_NO_KEY",
73 1: "KEY_ID_API_HMAC_SHA_1_96",
74 2: "KEY_ID_API_HMAC_SHA_256_128",
76 HmacKeyID_value = map[string]uint8{
77 "KEY_ID_API_HMAC_NO_KEY": 0,
78 "KEY_ID_API_HMAC_SHA_1_96": 1,
79 "KEY_ID_API_HMAC_SHA_256_128": 2,
83 func (x HmacKeyID) String() string {
84 s, ok := HmacKeyID_name[uint8(x)]
88 return "HmacKeyID(" + strconv.Itoa(int(x)) + ")"
91 // Eid defines type 'eid'.
93 Type EidType `binapi:"eid_type,name=type" json:"type,omitempty"`
94 Address EidAddress `binapi:"eid_address,name=address" json:"address,omitempty"`
97 // HmacKey defines type 'hmac_key'.
99 ID HmacKeyID `binapi:"hmac_key_id,name=id" json:"id,omitempty"`
100 Key []byte `binapi:"u8[64],name=key" json:"key,omitempty"`
103 // LocalLocator defines type 'local_locator'.
104 type LocalLocator struct {
105 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
106 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
107 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
110 // Nsh defines type 'nsh'.
112 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
113 Si uint8 `binapi:"u8,name=si" json:"si,omitempty"`
116 // RemoteLocator defines type 'remote_locator'.
117 type RemoteLocator struct {
118 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
119 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
120 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
123 // EidAddress defines union 'eid_address'.
124 type EidAddress struct {
125 // Prefix *ip_types.Prefix
126 // Mac *ethernet_types.MacAddress
128 XXX_UnionData [6]byte
131 func EidAddressPrefix(a ip_types.Prefix) (u EidAddress) {
135 func (u *EidAddress) SetPrefix(a ip_types.Prefix) {
136 buf := codec.NewBuffer(u.XXX_UnionData[:])
137 buf.EncodeUint8(uint8(a.Address.Af))
138 buf.EncodeBytes(a.Address.Un.XXX_UnionData[:], 16)
139 buf.EncodeUint8(a.Len)
141 func (u *EidAddress) GetPrefix() (a ip_types.Prefix) {
142 buf := codec.NewBuffer(u.XXX_UnionData[:])
143 a.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
144 copy(a.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
145 a.Len = buf.DecodeUint8()
149 func EidAddressMac(a ethernet_types.MacAddress) (u EidAddress) {
153 func (u *EidAddress) SetMac(a ethernet_types.MacAddress) {
154 buf := codec.NewBuffer(u.XXX_UnionData[:])
155 buf.EncodeBytes(a[:], 6)
157 func (u *EidAddress) GetMac() (a ethernet_types.MacAddress) {
158 buf := codec.NewBuffer(u.XXX_UnionData[:])
159 copy(a[:], buf.DecodeBytes(6))
163 func EidAddressNsh(a Nsh) (u EidAddress) {
167 func (u *EidAddress) SetNsh(a Nsh) {
168 buf := codec.NewBuffer(u.XXX_UnionData[:])
169 buf.EncodeUint32(a.Spi)
170 buf.EncodeUint8(a.Si)
172 func (u *EidAddress) GetNsh() (a Nsh) {
173 buf := codec.NewBuffer(u.XXX_UnionData[:])
174 a.Spi = buf.DecodeUint32()
175 a.Si = buf.DecodeUint8()