1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
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() int {
59 size += 4 // m.Entry.SwIfIndex
60 size += 1 // m.Entry.Peer.Af
61 size += 1 * 16 // m.Entry.Peer.Un
62 size += 1 // m.Entry.Nh.Af
63 size += 1 * 16 // m.Entry.Nh.Un
64 size += 4 // m.Entry.NhTableID
67 func (m *TeibDetails) Marshal(b []byte) ([]byte, error) {
70 buf = codec.NewBuffer(make([]byte, m.Size()))
72 buf = codec.NewBuffer(b)
74 buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
75 buf.EncodeUint8(uint8(m.Entry.Peer.Af))
76 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 0)
77 buf.EncodeUint8(uint8(m.Entry.Nh.Af))
78 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 0)
79 buf.EncodeUint32(uint32(m.Entry.NhTableID))
80 return buf.Bytes(), nil
82 func (m *TeibDetails) Unmarshal(b []byte) error {
83 buf := codec.NewBuffer(b)
84 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
85 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
86 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
87 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
88 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
89 m.Entry.NhTableID = buf.DecodeUint32()
93 // TeibDump defines message 'teib_dump'.
94 type TeibDump struct{}
96 func (m *TeibDump) Reset() { *m = TeibDump{} }
97 func (*TeibDump) GetMessageName() string { return "teib_dump" }
98 func (*TeibDump) GetCrcString() string { return "51077d14" }
99 func (*TeibDump) GetMessageType() api.MessageType {
100 return api.RequestMessage
103 func (m *TeibDump) Size() int {
110 func (m *TeibDump) Marshal(b []byte) ([]byte, error) {
111 var buf *codec.Buffer
113 buf = codec.NewBuffer(make([]byte, m.Size()))
115 buf = codec.NewBuffer(b)
117 return buf.Bytes(), nil
119 func (m *TeibDump) Unmarshal(b []byte) error {
123 // TeibEntryAddDel defines message 'teib_entry_add_del'.
124 type TeibEntryAddDel struct {
125 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
126 Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"`
129 func (m *TeibEntryAddDel) Reset() { *m = TeibEntryAddDel{} }
130 func (*TeibEntryAddDel) GetMessageName() string { return "teib_entry_add_del" }
131 func (*TeibEntryAddDel) GetCrcString() string { return "5aa0a538" }
132 func (*TeibEntryAddDel) GetMessageType() api.MessageType {
133 return api.RequestMessage
136 func (m *TeibEntryAddDel) Size() int {
142 size += 4 // m.Entry.SwIfIndex
143 size += 1 // m.Entry.Peer.Af
144 size += 1 * 16 // m.Entry.Peer.Un
145 size += 1 // m.Entry.Nh.Af
146 size += 1 * 16 // m.Entry.Nh.Un
147 size += 4 // m.Entry.NhTableID
150 func (m *TeibEntryAddDel) Marshal(b []byte) ([]byte, error) {
151 var buf *codec.Buffer
153 buf = codec.NewBuffer(make([]byte, m.Size()))
155 buf = codec.NewBuffer(b)
157 buf.EncodeUint8(uint8(m.IsAdd))
158 buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
159 buf.EncodeUint8(uint8(m.Entry.Peer.Af))
160 buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 0)
161 buf.EncodeUint8(uint8(m.Entry.Nh.Af))
162 buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 0)
163 buf.EncodeUint32(uint32(m.Entry.NhTableID))
164 return buf.Bytes(), nil
166 func (m *TeibEntryAddDel) Unmarshal(b []byte) error {
167 buf := codec.NewBuffer(b)
168 m.IsAdd = buf.DecodeUint8()
169 m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
170 m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
171 copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
172 m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
173 copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
174 m.Entry.NhTableID = buf.DecodeUint32()
178 // TeibEntryAddDelReply defines message 'teib_entry_add_del_reply'.
179 type TeibEntryAddDelReply struct {
180 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
183 func (m *TeibEntryAddDelReply) Reset() { *m = TeibEntryAddDelReply{} }
184 func (*TeibEntryAddDelReply) GetMessageName() string { return "teib_entry_add_del_reply" }
185 func (*TeibEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
186 func (*TeibEntryAddDelReply) GetMessageType() api.MessageType {
187 return api.ReplyMessage
190 func (m *TeibEntryAddDelReply) Size() int {
195 size += 4 // m.Retval
198 func (m *TeibEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
199 var buf *codec.Buffer
201 buf = codec.NewBuffer(make([]byte, m.Size()))
203 buf = codec.NewBuffer(b)
205 buf.EncodeUint32(uint32(m.Retval))
206 return buf.Bytes(), nil
208 func (m *TeibEntryAddDelReply) Unmarshal(b []byte) error {
209 buf := codec.NewBuffer(b)
210 m.Retval = int32(buf.DecodeUint32())
214 func init() { file_teib_binapi_init() }
215 func file_teib_binapi_init() {
216 api.RegisterMessage((*TeibDetails)(nil), "teib_details_e3b6a503")
217 api.RegisterMessage((*TeibDump)(nil), "teib_dump_51077d14")
218 api.RegisterMessage((*TeibEntryAddDel)(nil), "teib_entry_add_del_5aa0a538")
219 api.RegisterMessage((*TeibEntryAddDelReply)(nil), "teib_entry_add_del_reply_e8d4e804")
222 // Messages returns list of all messages in this module.
223 func AllMessages() []api.Message {
224 return []api.Message{
227 (*TeibEntryAddDel)(nil),
228 (*TeibEntryAddDelReply)(nil),