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/teib.api.json
7 // Package teib contains generated bindings for API file teib.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xaac93c17
34 // TeibEntry defines type 'teib_entry'.
35 type TeibEntry struct {
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 Peer ip_types.Address `binapi:"address,name=peer" json:"peer,omitempty"`
38 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"`
39 NhTableID uint32 `binapi:"u32,name=nh_table_id" json:"nh_table_id,omitempty"`
42 // TeibDetails defines message 'teib_details'.
43 type TeibDetails struct {
44 Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"`
47 func (m *TeibDetails) Reset() { *m = TeibDetails{} }
48 func (*TeibDetails) GetMessageName() string { return "teib_details" }
49 func (*TeibDetails) GetCrcString() string { return "e3b6a503" }
50 func (*TeibDetails) GetMessageType() api.MessageType {
51 return api.ReplyMessage
54 func (m *TeibDetails) Size() (size int) {
58 size += 4 // m.Entry.SwIfIndex
59 size += 1 // m.Entry.Peer.Af
60 size += 1 * 16 // m.Entry.Peer.Un
61 size += 1 // m.Entry.Nh.Af
62 size += 1 * 16 // m.Entry.Nh.Un
63 size += 4 // m.Entry.NhTableID
66 func (m *TeibDetails) Marshal(b []byte) ([]byte, error) {
68 b = make([]byte, m.Size())
70 buf := codec.NewBuffer(b)
71 buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
72 buf.EncodeUint8(uint8(m.Entry.Peer.Af))
73 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
74 buf.EncodeUint8(uint8(m.Entry.Nh.Af))
75 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
76 buf.EncodeUint32(m.Entry.NhTableID)
77 return buf.Bytes(), nil
79 func (m *TeibDetails) Unmarshal(b []byte) error {
80 buf := codec.NewBuffer(b)
81 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
82 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
83 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
84 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
85 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
86 m.Entry.NhTableID = buf.DecodeUint32()
90 // TeibDump defines message 'teib_dump'.
91 type TeibDump struct{}
93 func (m *TeibDump) Reset() { *m = TeibDump{} }
94 func (*TeibDump) GetMessageName() string { return "teib_dump" }
95 func (*TeibDump) GetCrcString() string { return "51077d14" }
96 func (*TeibDump) GetMessageType() api.MessageType {
97 return api.RequestMessage
100 func (m *TeibDump) Size() (size int) {
106 func (m *TeibDump) Marshal(b []byte) ([]byte, error) {
108 b = make([]byte, m.Size())
110 buf := codec.NewBuffer(b)
111 return buf.Bytes(), nil
113 func (m *TeibDump) Unmarshal(b []byte) error {
117 // TeibEntryAddDel defines message 'teib_entry_add_del'.
118 type TeibEntryAddDel struct {
119 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
120 Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"`
123 func (m *TeibEntryAddDel) Reset() { *m = TeibEntryAddDel{} }
124 func (*TeibEntryAddDel) GetMessageName() string { return "teib_entry_add_del" }
125 func (*TeibEntryAddDel) GetCrcString() string { return "5aa0a538" }
126 func (*TeibEntryAddDel) GetMessageType() api.MessageType {
127 return api.RequestMessage
130 func (m *TeibEntryAddDel) Size() (size int) {
135 size += 4 // m.Entry.SwIfIndex
136 size += 1 // m.Entry.Peer.Af
137 size += 1 * 16 // m.Entry.Peer.Un
138 size += 1 // m.Entry.Nh.Af
139 size += 1 * 16 // m.Entry.Nh.Un
140 size += 4 // m.Entry.NhTableID
143 func (m *TeibEntryAddDel) Marshal(b []byte) ([]byte, error) {
145 b = make([]byte, m.Size())
147 buf := codec.NewBuffer(b)
148 buf.EncodeUint8(m.IsAdd)
149 buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
150 buf.EncodeUint8(uint8(m.Entry.Peer.Af))
151 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
152 buf.EncodeUint8(uint8(m.Entry.Nh.Af))
153 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
154 buf.EncodeUint32(m.Entry.NhTableID)
155 return buf.Bytes(), nil
157 func (m *TeibEntryAddDel) Unmarshal(b []byte) error {
158 buf := codec.NewBuffer(b)
159 m.IsAdd = buf.DecodeUint8()
160 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
161 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
162 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
163 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
164 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
165 m.Entry.NhTableID = buf.DecodeUint32()
169 // TeibEntryAddDelReply defines message 'teib_entry_add_del_reply'.
170 type TeibEntryAddDelReply struct {
171 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
174 func (m *TeibEntryAddDelReply) Reset() { *m = TeibEntryAddDelReply{} }
175 func (*TeibEntryAddDelReply) GetMessageName() string { return "teib_entry_add_del_reply" }
176 func (*TeibEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
177 func (*TeibEntryAddDelReply) GetMessageType() api.MessageType {
178 return api.ReplyMessage
181 func (m *TeibEntryAddDelReply) Size() (size int) {
185 size += 4 // m.Retval
188 func (m *TeibEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
190 b = make([]byte, m.Size())
192 buf := codec.NewBuffer(b)
193 buf.EncodeInt32(m.Retval)
194 return buf.Bytes(), nil
196 func (m *TeibEntryAddDelReply) Unmarshal(b []byte) error {
197 buf := codec.NewBuffer(b)
198 m.Retval = buf.DecodeInt32()
202 func init() { file_teib_binapi_init() }
203 func file_teib_binapi_init() {
204 api.RegisterMessage((*TeibDetails)(nil), "teib_details_e3b6a503")
205 api.RegisterMessage((*TeibDump)(nil), "teib_dump_51077d14")
206 api.RegisterMessage((*TeibEntryAddDel)(nil), "teib_entry_add_del_5aa0a538")
207 api.RegisterMessage((*TeibEntryAddDelReply)(nil), "teib_entry_add_del_reply_e8d4e804")
210 // Messages returns list of all messages in this module.
211 func AllMessages() []api.Message {
212 return []api.Message{
215 (*TeibEntryAddDel)(nil),
216 (*TeibEntryAddDelReply)(nil),