1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/memif.api.json
7 // Package memif contains generated bindings for API file memif.api.
16 api "git.fd.io/govpp.git/api"
17 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x1a1c95b8
35 // MemifMode defines enum 'memif_mode'.
39 MEMIF_MODE_API_ETHERNET MemifMode = 0
40 MEMIF_MODE_API_IP MemifMode = 1
41 MEMIF_MODE_API_PUNT_INJECT MemifMode = 2
45 MemifMode_name = map[uint32]string{
46 0: "MEMIF_MODE_API_ETHERNET",
47 1: "MEMIF_MODE_API_IP",
48 2: "MEMIF_MODE_API_PUNT_INJECT",
50 MemifMode_value = map[string]uint32{
51 "MEMIF_MODE_API_ETHERNET": 0,
52 "MEMIF_MODE_API_IP": 1,
53 "MEMIF_MODE_API_PUNT_INJECT": 2,
57 func (x MemifMode) String() string {
58 s, ok := MemifMode_name[uint32(x)]
62 return "MemifMode(" + strconv.Itoa(int(x)) + ")"
65 // MemifRole defines enum 'memif_role'.
69 MEMIF_ROLE_API_MASTER MemifRole = 0
70 MEMIF_ROLE_API_SLAVE MemifRole = 1
74 MemifRole_name = map[uint32]string{
75 0: "MEMIF_ROLE_API_MASTER",
76 1: "MEMIF_ROLE_API_SLAVE",
78 MemifRole_value = map[string]uint32{
79 "MEMIF_ROLE_API_MASTER": 0,
80 "MEMIF_ROLE_API_SLAVE": 1,
84 func (x MemifRole) String() string {
85 s, ok := MemifRole_name[uint32(x)]
89 return "MemifRole(" + strconv.Itoa(int(x)) + ")"
92 // MemifCreate defines message 'memif_create'.
93 type MemifCreate struct {
94 Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"`
95 Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
96 RxQueues uint8 `binapi:"u8,name=rx_queues" json:"rx_queues,omitempty"`
97 TxQueues uint8 `binapi:"u8,name=tx_queues" json:"tx_queues,omitempty"`
98 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
99 SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
100 RingSize uint32 `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
101 BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
102 NoZeroCopy bool `binapi:"bool,name=no_zero_copy" json:"no_zero_copy,omitempty"`
103 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
104 Secret string `binapi:"string[24],name=secret" json:"secret,omitempty"`
107 func (m *MemifCreate) Reset() { *m = MemifCreate{} }
108 func (*MemifCreate) GetMessageName() string { return "memif_create" }
109 func (*MemifCreate) GetCrcString() string { return "b1b25061" }
110 func (*MemifCreate) GetMessageType() api.MessageType {
111 return api.RequestMessage
114 func (m *MemifCreate) Size() int {
121 size += 1 // m.RxQueues
122 size += 1 // m.TxQueues
124 size += 4 // m.SocketID
125 size += 4 // m.RingSize
126 size += 2 // m.BufferSize
127 size += 1 // m.NoZeroCopy
128 size += 1 * 6 // m.HwAddr
129 size += 24 // m.Secret
132 func (m *MemifCreate) Marshal(b []byte) ([]byte, error) {
133 var buf *codec.Buffer
135 buf = codec.NewBuffer(make([]byte, m.Size()))
137 buf = codec.NewBuffer(b)
139 buf.EncodeUint32(uint32(m.Role))
140 buf.EncodeUint32(uint32(m.Mode))
141 buf.EncodeUint8(uint8(m.RxQueues))
142 buf.EncodeUint8(uint8(m.TxQueues))
143 buf.EncodeUint32(uint32(m.ID))
144 buf.EncodeUint32(uint32(m.SocketID))
145 buf.EncodeUint32(uint32(m.RingSize))
146 buf.EncodeUint16(uint16(m.BufferSize))
147 buf.EncodeBool(m.NoZeroCopy)
148 buf.EncodeBytes(m.HwAddr[:], 6)
149 buf.EncodeString(m.Secret, 24)
150 return buf.Bytes(), nil
152 func (m *MemifCreate) Unmarshal(b []byte) error {
153 buf := codec.NewBuffer(b)
154 m.Role = MemifRole(buf.DecodeUint32())
155 m.Mode = MemifMode(buf.DecodeUint32())
156 m.RxQueues = buf.DecodeUint8()
157 m.TxQueues = buf.DecodeUint8()
158 m.ID = buf.DecodeUint32()
159 m.SocketID = buf.DecodeUint32()
160 m.RingSize = buf.DecodeUint32()
161 m.BufferSize = buf.DecodeUint16()
162 m.NoZeroCopy = buf.DecodeBool()
163 copy(m.HwAddr[:], buf.DecodeBytes(6))
164 m.Secret = buf.DecodeString(24)
168 // MemifCreateReply defines message 'memif_create_reply'.
169 type MemifCreateReply struct {
170 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
171 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
174 func (m *MemifCreateReply) Reset() { *m = MemifCreateReply{} }
175 func (*MemifCreateReply) GetMessageName() string { return "memif_create_reply" }
176 func (*MemifCreateReply) GetCrcString() string { return "5383d31f" }
177 func (*MemifCreateReply) GetMessageType() api.MessageType {
178 return api.ReplyMessage
181 func (m *MemifCreateReply) Size() int {
186 size += 4 // m.Retval
187 size += 4 // m.SwIfIndex
190 func (m *MemifCreateReply) Marshal(b []byte) ([]byte, error) {
191 var buf *codec.Buffer
193 buf = codec.NewBuffer(make([]byte, m.Size()))
195 buf = codec.NewBuffer(b)
197 buf.EncodeUint32(uint32(m.Retval))
198 buf.EncodeUint32(uint32(m.SwIfIndex))
199 return buf.Bytes(), nil
201 func (m *MemifCreateReply) Unmarshal(b []byte) error {
202 buf := codec.NewBuffer(b)
203 m.Retval = int32(buf.DecodeUint32())
204 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
208 // MemifDelete defines message 'memif_delete'.
209 type MemifDelete struct {
210 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
213 func (m *MemifDelete) Reset() { *m = MemifDelete{} }
214 func (*MemifDelete) GetMessageName() string { return "memif_delete" }
215 func (*MemifDelete) GetCrcString() string { return "f9e6675e" }
216 func (*MemifDelete) GetMessageType() api.MessageType {
217 return api.RequestMessage
220 func (m *MemifDelete) Size() int {
225 size += 4 // m.SwIfIndex
228 func (m *MemifDelete) Marshal(b []byte) ([]byte, error) {
229 var buf *codec.Buffer
231 buf = codec.NewBuffer(make([]byte, m.Size()))
233 buf = codec.NewBuffer(b)
235 buf.EncodeUint32(uint32(m.SwIfIndex))
236 return buf.Bytes(), nil
238 func (m *MemifDelete) Unmarshal(b []byte) error {
239 buf := codec.NewBuffer(b)
240 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
244 // MemifDeleteReply defines message 'memif_delete_reply'.
245 type MemifDeleteReply struct {
246 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
249 func (m *MemifDeleteReply) Reset() { *m = MemifDeleteReply{} }
250 func (*MemifDeleteReply) GetMessageName() string { return "memif_delete_reply" }
251 func (*MemifDeleteReply) GetCrcString() string { return "e8d4e804" }
252 func (*MemifDeleteReply) GetMessageType() api.MessageType {
253 return api.ReplyMessage
256 func (m *MemifDeleteReply) Size() int {
261 size += 4 // m.Retval
264 func (m *MemifDeleteReply) Marshal(b []byte) ([]byte, error) {
265 var buf *codec.Buffer
267 buf = codec.NewBuffer(make([]byte, m.Size()))
269 buf = codec.NewBuffer(b)
271 buf.EncodeUint32(uint32(m.Retval))
272 return buf.Bytes(), nil
274 func (m *MemifDeleteReply) Unmarshal(b []byte) error {
275 buf := codec.NewBuffer(b)
276 m.Retval = int32(buf.DecodeUint32())
280 // MemifDetails defines message 'memif_details'.
281 type MemifDetails struct {
282 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
283 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
284 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
285 Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"`
286 Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
287 ZeroCopy bool `binapi:"bool,name=zero_copy" json:"zero_copy,omitempty"`
288 SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
289 RingSize uint32 `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
290 BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
291 Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
292 IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
295 func (m *MemifDetails) Reset() { *m = MemifDetails{} }
296 func (*MemifDetails) GetMessageName() string { return "memif_details" }
297 func (*MemifDetails) GetCrcString() string { return "d0382c4c" }
298 func (*MemifDetails) GetMessageType() api.MessageType {
299 return api.ReplyMessage
302 func (m *MemifDetails) Size() int {
307 size += 4 // m.SwIfIndex
308 size += 1 * 6 // m.HwAddr
312 size += 1 // m.ZeroCopy
313 size += 4 // m.SocketID
314 size += 4 // m.RingSize
315 size += 2 // m.BufferSize
317 size += 64 // m.IfName
320 func (m *MemifDetails) Marshal(b []byte) ([]byte, error) {
321 var buf *codec.Buffer
323 buf = codec.NewBuffer(make([]byte, m.Size()))
325 buf = codec.NewBuffer(b)
327 buf.EncodeUint32(uint32(m.SwIfIndex))
328 buf.EncodeBytes(m.HwAddr[:], 6)
329 buf.EncodeUint32(uint32(m.ID))
330 buf.EncodeUint32(uint32(m.Role))
331 buf.EncodeUint32(uint32(m.Mode))
332 buf.EncodeBool(m.ZeroCopy)
333 buf.EncodeUint32(uint32(m.SocketID))
334 buf.EncodeUint32(uint32(m.RingSize))
335 buf.EncodeUint16(uint16(m.BufferSize))
336 buf.EncodeUint32(uint32(m.Flags))
337 buf.EncodeString(m.IfName, 64)
338 return buf.Bytes(), nil
340 func (m *MemifDetails) Unmarshal(b []byte) error {
341 buf := codec.NewBuffer(b)
342 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
343 copy(m.HwAddr[:], buf.DecodeBytes(6))
344 m.ID = buf.DecodeUint32()
345 m.Role = MemifRole(buf.DecodeUint32())
346 m.Mode = MemifMode(buf.DecodeUint32())
347 m.ZeroCopy = buf.DecodeBool()
348 m.SocketID = buf.DecodeUint32()
349 m.RingSize = buf.DecodeUint32()
350 m.BufferSize = buf.DecodeUint16()
351 m.Flags = interface_types.IfStatusFlags(buf.DecodeUint32())
352 m.IfName = buf.DecodeString(64)
356 // MemifDump defines message 'memif_dump'.
357 type MemifDump struct{}
359 func (m *MemifDump) Reset() { *m = MemifDump{} }
360 func (*MemifDump) GetMessageName() string { return "memif_dump" }
361 func (*MemifDump) GetCrcString() string { return "51077d14" }
362 func (*MemifDump) GetMessageType() api.MessageType {
363 return api.RequestMessage
366 func (m *MemifDump) Size() int {
373 func (m *MemifDump) Marshal(b []byte) ([]byte, error) {
374 var buf *codec.Buffer
376 buf = codec.NewBuffer(make([]byte, m.Size()))
378 buf = codec.NewBuffer(b)
380 return buf.Bytes(), nil
382 func (m *MemifDump) Unmarshal(b []byte) error {
386 // MemifSocketFilenameAddDel defines message 'memif_socket_filename_add_del'.
387 type MemifSocketFilenameAddDel struct {
388 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
389 SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
390 SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
393 func (m *MemifSocketFilenameAddDel) Reset() { *m = MemifSocketFilenameAddDel{} }
394 func (*MemifSocketFilenameAddDel) GetMessageName() string { return "memif_socket_filename_add_del" }
395 func (*MemifSocketFilenameAddDel) GetCrcString() string { return "a2ce1a10" }
396 func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType {
397 return api.RequestMessage
400 func (m *MemifSocketFilenameAddDel) Size() int {
406 size += 4 // m.SocketID
407 size += 108 // m.SocketFilename
410 func (m *MemifSocketFilenameAddDel) Marshal(b []byte) ([]byte, error) {
411 var buf *codec.Buffer
413 buf = codec.NewBuffer(make([]byte, m.Size()))
415 buf = codec.NewBuffer(b)
417 buf.EncodeBool(m.IsAdd)
418 buf.EncodeUint32(uint32(m.SocketID))
419 buf.EncodeString(m.SocketFilename, 108)
420 return buf.Bytes(), nil
422 func (m *MemifSocketFilenameAddDel) Unmarshal(b []byte) error {
423 buf := codec.NewBuffer(b)
424 m.IsAdd = buf.DecodeBool()
425 m.SocketID = buf.DecodeUint32()
426 m.SocketFilename = buf.DecodeString(108)
430 // MemifSocketFilenameAddDelReply defines message 'memif_socket_filename_add_del_reply'.
431 type MemifSocketFilenameAddDelReply struct {
432 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
435 func (m *MemifSocketFilenameAddDelReply) Reset() { *m = MemifSocketFilenameAddDelReply{} }
436 func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
437 return "memif_socket_filename_add_del_reply"
439 func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" }
440 func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType {
441 return api.ReplyMessage
444 func (m *MemifSocketFilenameAddDelReply) Size() int {
449 size += 4 // m.Retval
452 func (m *MemifSocketFilenameAddDelReply) Marshal(b []byte) ([]byte, error) {
453 var buf *codec.Buffer
455 buf = codec.NewBuffer(make([]byte, m.Size()))
457 buf = codec.NewBuffer(b)
459 buf.EncodeUint32(uint32(m.Retval))
460 return buf.Bytes(), nil
462 func (m *MemifSocketFilenameAddDelReply) Unmarshal(b []byte) error {
463 buf := codec.NewBuffer(b)
464 m.Retval = int32(buf.DecodeUint32())
468 // MemifSocketFilenameDetails defines message 'memif_socket_filename_details'.
469 type MemifSocketFilenameDetails struct {
470 SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
471 SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
474 func (m *MemifSocketFilenameDetails) Reset() { *m = MemifSocketFilenameDetails{} }
475 func (*MemifSocketFilenameDetails) GetMessageName() string { return "memif_socket_filename_details" }
476 func (*MemifSocketFilenameDetails) GetCrcString() string { return "7ff326f7" }
477 func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType {
478 return api.ReplyMessage
481 func (m *MemifSocketFilenameDetails) Size() int {
486 size += 4 // m.SocketID
487 size += 108 // m.SocketFilename
490 func (m *MemifSocketFilenameDetails) Marshal(b []byte) ([]byte, error) {
491 var buf *codec.Buffer
493 buf = codec.NewBuffer(make([]byte, m.Size()))
495 buf = codec.NewBuffer(b)
497 buf.EncodeUint32(uint32(m.SocketID))
498 buf.EncodeString(m.SocketFilename, 108)
499 return buf.Bytes(), nil
501 func (m *MemifSocketFilenameDetails) Unmarshal(b []byte) error {
502 buf := codec.NewBuffer(b)
503 m.SocketID = buf.DecodeUint32()
504 m.SocketFilename = buf.DecodeString(108)
508 // MemifSocketFilenameDump defines message 'memif_socket_filename_dump'.
509 type MemifSocketFilenameDump struct{}
511 func (m *MemifSocketFilenameDump) Reset() { *m = MemifSocketFilenameDump{} }
512 func (*MemifSocketFilenameDump) GetMessageName() string { return "memif_socket_filename_dump" }
513 func (*MemifSocketFilenameDump) GetCrcString() string { return "51077d14" }
514 func (*MemifSocketFilenameDump) GetMessageType() api.MessageType {
515 return api.RequestMessage
518 func (m *MemifSocketFilenameDump) Size() int {
525 func (m *MemifSocketFilenameDump) Marshal(b []byte) ([]byte, error) {
526 var buf *codec.Buffer
528 buf = codec.NewBuffer(make([]byte, m.Size()))
530 buf = codec.NewBuffer(b)
532 return buf.Bytes(), nil
534 func (m *MemifSocketFilenameDump) Unmarshal(b []byte) error {
538 func init() { file_memif_binapi_init() }
539 func file_memif_binapi_init() {
540 api.RegisterMessage((*MemifCreate)(nil), "memif_create_b1b25061")
541 api.RegisterMessage((*MemifCreateReply)(nil), "memif_create_reply_5383d31f")
542 api.RegisterMessage((*MemifDelete)(nil), "memif_delete_f9e6675e")
543 api.RegisterMessage((*MemifDeleteReply)(nil), "memif_delete_reply_e8d4e804")
544 api.RegisterMessage((*MemifDetails)(nil), "memif_details_d0382c4c")
545 api.RegisterMessage((*MemifDump)(nil), "memif_dump_51077d14")
546 api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif_socket_filename_add_del_a2ce1a10")
547 api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif_socket_filename_add_del_reply_e8d4e804")
548 api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif_socket_filename_details_7ff326f7")
549 api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif_socket_filename_dump_51077d14")
552 // Messages returns list of all messages in this module.
553 func AllMessages() []api.Message {
554 return []api.Message{
556 (*MemifCreateReply)(nil),
558 (*MemifDeleteReply)(nil),
559 (*MemifDetails)(nil),
561 (*MemifSocketFilenameAddDel)(nil),
562 (*MemifSocketFilenameAddDelReply)(nil),
563 (*MemifSocketFilenameDetails)(nil),
564 (*MemifSocketFilenameDump)(nil),