Improve binapi generator
[govpp.git] / binapi / mdata / mdata.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 // source: /usr/share/vpp/api/plugins/mdata.api.json
6
7 // Package mdata contains generated bindings for API file mdata.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package mdata
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         _ "git.fd.io/govpp.git/binapi/interface_types"
17         codec "git.fd.io/govpp.git/codec"
18 )
19
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
25
26 const (
27         APIFile    = "mdata"
28         APIVersion = "0.1.0"
29         VersionCrc = 0x3a1911dd
30 )
31
32 // MdataEnableDisable defines message 'mdata_enable_disable'.
33 type MdataEnableDisable struct {
34         EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
35 }
36
37 func (m *MdataEnableDisable) Reset()               { *m = MdataEnableDisable{} }
38 func (*MdataEnableDisable) GetMessageName() string { return "mdata_enable_disable" }
39 func (*MdataEnableDisable) GetCrcString() string   { return "2e7b47df" }
40 func (*MdataEnableDisable) GetMessageType() api.MessageType {
41         return api.RequestMessage
42 }
43
44 func (m *MdataEnableDisable) Size() int {
45         if m == nil {
46                 return 0
47         }
48         var size int
49         size += 1 // m.EnableDisable
50         return size
51 }
52 func (m *MdataEnableDisable) Marshal(b []byte) ([]byte, error) {
53         var buf *codec.Buffer
54         if b == nil {
55                 buf = codec.NewBuffer(make([]byte, m.Size()))
56         } else {
57                 buf = codec.NewBuffer(b)
58         }
59         buf.EncodeBool(m.EnableDisable)
60         return buf.Bytes(), nil
61 }
62 func (m *MdataEnableDisable) Unmarshal(b []byte) error {
63         buf := codec.NewBuffer(b)
64         m.EnableDisable = buf.DecodeBool()
65         return nil
66 }
67
68 // MdataEnableDisableReply defines message 'mdata_enable_disable_reply'.
69 type MdataEnableDisableReply struct {
70         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
71 }
72
73 func (m *MdataEnableDisableReply) Reset()               { *m = MdataEnableDisableReply{} }
74 func (*MdataEnableDisableReply) GetMessageName() string { return "mdata_enable_disable_reply" }
75 func (*MdataEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
76 func (*MdataEnableDisableReply) GetMessageType() api.MessageType {
77         return api.ReplyMessage
78 }
79
80 func (m *MdataEnableDisableReply) Size() int {
81         if m == nil {
82                 return 0
83         }
84         var size int
85         size += 4 // m.Retval
86         return size
87 }
88 func (m *MdataEnableDisableReply) Marshal(b []byte) ([]byte, error) {
89         var buf *codec.Buffer
90         if b == nil {
91                 buf = codec.NewBuffer(make([]byte, m.Size()))
92         } else {
93                 buf = codec.NewBuffer(b)
94         }
95         buf.EncodeUint32(uint32(m.Retval))
96         return buf.Bytes(), nil
97 }
98 func (m *MdataEnableDisableReply) Unmarshal(b []byte) error {
99         buf := codec.NewBuffer(b)
100         m.Retval = int32(buf.DecodeUint32())
101         return nil
102 }
103
104 func init() { file_mdata_binapi_init() }
105 func file_mdata_binapi_init() {
106         api.RegisterMessage((*MdataEnableDisable)(nil), "mdata_enable_disable_2e7b47df")
107         api.RegisterMessage((*MdataEnableDisableReply)(nil), "mdata_enable_disable_reply_e8d4e804")
108 }
109
110 // Messages returns list of all messages in this module.
111 func AllMessages() []api.Message {
112         return []api.Message{
113                 (*MdataEnableDisable)(nil),
114                 (*MdataEnableDisableReply)(nil),
115         }
116 }