d4473c75a3d3f2d8eb41796cd1e0c915229ef216
[govpp.git] / binapi / teib / teib.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package teib contains generated bindings for API file teib.api.
7 //
8 // Contents:
9 //   1 struct
10 //   4 messages
11 //
12 package teib
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         ip_types "git.fd.io/govpp.git/binapi/ip_types"
18         codec "git.fd.io/govpp.git/codec"
19 )
20
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
26
27 const (
28         APIFile    = "teib"
29         APIVersion = "1.0.0"
30         VersionCrc = 0xaac93c17
31 )
32
33 // TeibEntry defines type 'teib_entry'.
34 type TeibEntry struct {
35         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
36         Peer      ip_types.Address               `binapi:"address,name=peer" json:"peer,omitempty"`
37         Nh        ip_types.Address               `binapi:"address,name=nh" json:"nh,omitempty"`
38         NhTableID uint32                         `binapi:"u32,name=nh_table_id" json:"nh_table_id,omitempty"`
39 }
40
41 // TeibDetails defines message 'teib_details'.
42 type TeibDetails struct {
43         Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"`
44 }
45
46 func (m *TeibDetails) Reset()               { *m = TeibDetails{} }
47 func (*TeibDetails) GetMessageName() string { return "teib_details" }
48 func (*TeibDetails) GetCrcString() string   { return "e3b6a503" }
49 func (*TeibDetails) GetMessageType() api.MessageType {
50         return api.ReplyMessage
51 }
52
53 func (m *TeibDetails) Size() (size int) {
54         if m == nil {
55                 return 0
56         }
57         size += 4      // m.Entry.SwIfIndex
58         size += 1      // m.Entry.Peer.Af
59         size += 1 * 16 // m.Entry.Peer.Un
60         size += 1      // m.Entry.Nh.Af
61         size += 1 * 16 // m.Entry.Nh.Un
62         size += 4      // m.Entry.NhTableID
63         return size
64 }
65 func (m *TeibDetails) Marshal(b []byte) ([]byte, error) {
66         if b == nil {
67                 b = make([]byte, m.Size())
68         }
69         buf := codec.NewBuffer(b)
70         buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
71         buf.EncodeUint8(uint8(m.Entry.Peer.Af))
72         buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
73         buf.EncodeUint8(uint8(m.Entry.Nh.Af))
74         buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
75         buf.EncodeUint32(m.Entry.NhTableID)
76         return buf.Bytes(), nil
77 }
78 func (m *TeibDetails) Unmarshal(b []byte) error {
79         buf := codec.NewBuffer(b)
80         m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
81         m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
82         copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
83         m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
84         copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
85         m.Entry.NhTableID = buf.DecodeUint32()
86         return nil
87 }
88
89 // TeibDump defines message 'teib_dump'.
90 type TeibDump struct{}
91
92 func (m *TeibDump) Reset()               { *m = TeibDump{} }
93 func (*TeibDump) GetMessageName() string { return "teib_dump" }
94 func (*TeibDump) GetCrcString() string   { return "51077d14" }
95 func (*TeibDump) GetMessageType() api.MessageType {
96         return api.RequestMessage
97 }
98
99 func (m *TeibDump) Size() (size int) {
100         if m == nil {
101                 return 0
102         }
103         return size
104 }
105 func (m *TeibDump) Marshal(b []byte) ([]byte, error) {
106         if b == nil {
107                 b = make([]byte, m.Size())
108         }
109         buf := codec.NewBuffer(b)
110         return buf.Bytes(), nil
111 }
112 func (m *TeibDump) Unmarshal(b []byte) error {
113         return nil
114 }
115
116 // TeibEntryAddDel defines message 'teib_entry_add_del'.
117 type TeibEntryAddDel struct {
118         IsAdd uint8     `binapi:"u8,name=is_add" json:"is_add,omitempty"`
119         Entry TeibEntry `binapi:"teib_entry,name=entry" json:"entry,omitempty"`
120 }
121
122 func (m *TeibEntryAddDel) Reset()               { *m = TeibEntryAddDel{} }
123 func (*TeibEntryAddDel) GetMessageName() string { return "teib_entry_add_del" }
124 func (*TeibEntryAddDel) GetCrcString() string   { return "5aa0a538" }
125 func (*TeibEntryAddDel) GetMessageType() api.MessageType {
126         return api.RequestMessage
127 }
128
129 func (m *TeibEntryAddDel) Size() (size int) {
130         if m == nil {
131                 return 0
132         }
133         size += 1      // m.IsAdd
134         size += 4      // m.Entry.SwIfIndex
135         size += 1      // m.Entry.Peer.Af
136         size += 1 * 16 // m.Entry.Peer.Un
137         size += 1      // m.Entry.Nh.Af
138         size += 1 * 16 // m.Entry.Nh.Un
139         size += 4      // m.Entry.NhTableID
140         return size
141 }
142 func (m *TeibEntryAddDel) Marshal(b []byte) ([]byte, error) {
143         if b == nil {
144                 b = make([]byte, m.Size())
145         }
146         buf := codec.NewBuffer(b)
147         buf.EncodeUint8(m.IsAdd)
148         buf.EncodeUint32(uint32(m.Entry.SwIfIndex))
149         buf.EncodeUint8(uint8(m.Entry.Peer.Af))
150         buf.EncodeBytes(m.Entry.Peer.Un.XXX_UnionData[:], 16)
151         buf.EncodeUint8(uint8(m.Entry.Nh.Af))
152         buf.EncodeBytes(m.Entry.Nh.Un.XXX_UnionData[:], 16)
153         buf.EncodeUint32(m.Entry.NhTableID)
154         return buf.Bytes(), nil
155 }
156 func (m *TeibEntryAddDel) Unmarshal(b []byte) error {
157         buf := codec.NewBuffer(b)
158         m.IsAdd = buf.DecodeUint8()
159         m.Entry.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
160         m.Entry.Peer.Af = ip_types.AddressFamily(buf.DecodeUint8())
161         copy(m.Entry.Peer.Un.XXX_UnionData[:], buf.DecodeBytes(16))
162         m.Entry.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
163         copy(m.Entry.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
164         m.Entry.NhTableID = buf.DecodeUint32()
165         return nil
166 }
167
168 // TeibEntryAddDelReply defines message 'teib_entry_add_del_reply'.
169 type TeibEntryAddDelReply struct {
170         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
171 }
172
173 func (m *TeibEntryAddDelReply) Reset()               { *m = TeibEntryAddDelReply{} }
174 func (*TeibEntryAddDelReply) GetMessageName() string { return "teib_entry_add_del_reply" }
175 func (*TeibEntryAddDelReply) GetCrcString() string   { return "e8d4e804" }
176 func (*TeibEntryAddDelReply) GetMessageType() api.MessageType {
177         return api.ReplyMessage
178 }
179
180 func (m *TeibEntryAddDelReply) Size() (size int) {
181         if m == nil {
182                 return 0
183         }
184         size += 4 // m.Retval
185         return size
186 }
187 func (m *TeibEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
188         if b == nil {
189                 b = make([]byte, m.Size())
190         }
191         buf := codec.NewBuffer(b)
192         buf.EncodeInt32(m.Retval)
193         return buf.Bytes(), nil
194 }
195 func (m *TeibEntryAddDelReply) Unmarshal(b []byte) error {
196         buf := codec.NewBuffer(b)
197         m.Retval = buf.DecodeInt32()
198         return nil
199 }
200
201 func init() { file_teib_binapi_init() }
202 func file_teib_binapi_init() {
203         api.RegisterMessage((*TeibDetails)(nil), "teib_details_e3b6a503")
204         api.RegisterMessage((*TeibDump)(nil), "teib_dump_51077d14")
205         api.RegisterMessage((*TeibEntryAddDel)(nil), "teib_entry_add_del_5aa0a538")
206         api.RegisterMessage((*TeibEntryAddDelReply)(nil), "teib_entry_add_del_reply_e8d4e804")
207 }
208
209 // Messages returns list of all messages in this module.
210 func AllMessages() []api.Message {
211         return []api.Message{
212                 (*TeibDetails)(nil),
213                 (*TeibDump)(nil),
214                 (*TeibEntryAddDel)(nil),
215                 (*TeibEntryAddDelReply)(nil),
216         }
217 }