a1862eff2654224ec284418ba2700aee5307d1ea
[govpp.git] / binapi / oddbuf / oddbuf.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/plugins/oddbuf.api.json
6
7 // Package oddbuf contains generated bindings for API file oddbuf.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package oddbuf
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    = "oddbuf"
28         APIVersion = "0.1.0"
29         VersionCrc = 0x3a1a2c50
30 )
31
32 // OddbufEnableDisable defines message 'oddbuf_enable_disable'.
33 // InProgress: the message form may change in the future versions
34 type OddbufEnableDisable struct {
35         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
36         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 }
38
39 func (m *OddbufEnableDisable) Reset()               { *m = OddbufEnableDisable{} }
40 func (*OddbufEnableDisable) GetMessageName() string { return "oddbuf_enable_disable" }
41 func (*OddbufEnableDisable) GetCrcString() string   { return "3865946c" }
42 func (*OddbufEnableDisable) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *OddbufEnableDisable) Size() (size int) {
47         if m == nil {
48                 return 0
49         }
50         size += 1 // m.EnableDisable
51         size += 4 // m.SwIfIndex
52         return size
53 }
54 func (m *OddbufEnableDisable) Marshal(b []byte) ([]byte, error) {
55         if b == nil {
56                 b = make([]byte, m.Size())
57         }
58         buf := codec.NewBuffer(b)
59         buf.EncodeBool(m.EnableDisable)
60         buf.EncodeUint32(uint32(m.SwIfIndex))
61         return buf.Bytes(), nil
62 }
63 func (m *OddbufEnableDisable) Unmarshal(b []byte) error {
64         buf := codec.NewBuffer(b)
65         m.EnableDisable = buf.DecodeBool()
66         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
67         return nil
68 }
69
70 // OddbufEnableDisableReply defines message 'oddbuf_enable_disable_reply'.
71 // InProgress: the message form may change in the future versions
72 type OddbufEnableDisableReply struct {
73         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
74 }
75
76 func (m *OddbufEnableDisableReply) Reset()               { *m = OddbufEnableDisableReply{} }
77 func (*OddbufEnableDisableReply) GetMessageName() string { return "oddbuf_enable_disable_reply" }
78 func (*OddbufEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
79 func (*OddbufEnableDisableReply) GetMessageType() api.MessageType {
80         return api.ReplyMessage
81 }
82
83 func (m *OddbufEnableDisableReply) Size() (size int) {
84         if m == nil {
85                 return 0
86         }
87         size += 4 // m.Retval
88         return size
89 }
90 func (m *OddbufEnableDisableReply) Marshal(b []byte) ([]byte, error) {
91         if b == nil {
92                 b = make([]byte, m.Size())
93         }
94         buf := codec.NewBuffer(b)
95         buf.EncodeInt32(m.Retval)
96         return buf.Bytes(), nil
97 }
98 func (m *OddbufEnableDisableReply) Unmarshal(b []byte) error {
99         buf := codec.NewBuffer(b)
100         m.Retval = buf.DecodeInt32()
101         return nil
102 }
103
104 func init() { file_oddbuf_binapi_init() }
105 func file_oddbuf_binapi_init() {
106         api.RegisterMessage((*OddbufEnableDisable)(nil), "oddbuf_enable_disable_3865946c")
107         api.RegisterMessage((*OddbufEnableDisableReply)(nil), "oddbuf_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                 (*OddbufEnableDisable)(nil),
114                 (*OddbufEnableDisableReply)(nil),
115         }
116 }