Improve binapi generator
[govpp.git] / binapi / rd_cp / rd_cp.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/core/rd_cp.api.json
6
7 // Package rd_cp contains generated bindings for API file rd_cp.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package rd_cp
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "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    = "rd_cp"
28         APIVersion = "1.0.1"
29         VersionCrc = 0x2caa616
30 )
31
32 // IP6NdAddressAutoconfig defines message 'ip6_nd_address_autoconfig'.
33 type IP6NdAddressAutoconfig struct {
34         SwIfIndex            interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
35         Enable               bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
36         InstallDefaultRoutes bool                           `binapi:"bool,name=install_default_routes" json:"install_default_routes,omitempty"`
37 }
38
39 func (m *IP6NdAddressAutoconfig) Reset()               { *m = IP6NdAddressAutoconfig{} }
40 func (*IP6NdAddressAutoconfig) GetMessageName() string { return "ip6_nd_address_autoconfig" }
41 func (*IP6NdAddressAutoconfig) GetCrcString() string   { return "9e14a4a7" }
42 func (*IP6NdAddressAutoconfig) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *IP6NdAddressAutoconfig) Size() int {
47         if m == nil {
48                 return 0
49         }
50         var size int
51         size += 4 // m.SwIfIndex
52         size += 1 // m.Enable
53         size += 1 // m.InstallDefaultRoutes
54         return size
55 }
56 func (m *IP6NdAddressAutoconfig) Marshal(b []byte) ([]byte, error) {
57         var buf *codec.Buffer
58         if b == nil {
59                 buf = codec.NewBuffer(make([]byte, m.Size()))
60         } else {
61                 buf = codec.NewBuffer(b)
62         }
63         buf.EncodeUint32(uint32(m.SwIfIndex))
64         buf.EncodeBool(m.Enable)
65         buf.EncodeBool(m.InstallDefaultRoutes)
66         return buf.Bytes(), nil
67 }
68 func (m *IP6NdAddressAutoconfig) Unmarshal(b []byte) error {
69         buf := codec.NewBuffer(b)
70         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
71         m.Enable = buf.DecodeBool()
72         m.InstallDefaultRoutes = buf.DecodeBool()
73         return nil
74 }
75
76 // IP6NdAddressAutoconfigReply defines message 'ip6_nd_address_autoconfig_reply'.
77 type IP6NdAddressAutoconfigReply struct {
78         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
79 }
80
81 func (m *IP6NdAddressAutoconfigReply) Reset()               { *m = IP6NdAddressAutoconfigReply{} }
82 func (*IP6NdAddressAutoconfigReply) GetMessageName() string { return "ip6_nd_address_autoconfig_reply" }
83 func (*IP6NdAddressAutoconfigReply) GetCrcString() string   { return "e8d4e804" }
84 func (*IP6NdAddressAutoconfigReply) GetMessageType() api.MessageType {
85         return api.ReplyMessage
86 }
87
88 func (m *IP6NdAddressAutoconfigReply) Size() int {
89         if m == nil {
90                 return 0
91         }
92         var size int
93         size += 4 // m.Retval
94         return size
95 }
96 func (m *IP6NdAddressAutoconfigReply) Marshal(b []byte) ([]byte, error) {
97         var buf *codec.Buffer
98         if b == nil {
99                 buf = codec.NewBuffer(make([]byte, m.Size()))
100         } else {
101                 buf = codec.NewBuffer(b)
102         }
103         buf.EncodeUint32(uint32(m.Retval))
104         return buf.Bytes(), nil
105 }
106 func (m *IP6NdAddressAutoconfigReply) Unmarshal(b []byte) error {
107         buf := codec.NewBuffer(b)
108         m.Retval = int32(buf.DecodeUint32())
109         return nil
110 }
111
112 func init() { file_rd_cp_binapi_init() }
113 func file_rd_cp_binapi_init() {
114         api.RegisterMessage((*IP6NdAddressAutoconfig)(nil), "ip6_nd_address_autoconfig_9e14a4a7")
115         api.RegisterMessage((*IP6NdAddressAutoconfigReply)(nil), "ip6_nd_address_autoconfig_reply_e8d4e804")
116 }
117
118 // Messages returns list of all messages in this module.
119 func AllMessages() []api.Message {
120         return []api.Message{
121                 (*IP6NdAddressAutoconfig)(nil),
122                 (*IP6NdAddressAutoconfigReply)(nil),
123         }
124 }