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