e28998e152bc78baabf8be3319533b0a59221917
[govpp.git] / binapi / oddbuf / oddbuf.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
6 // Package oddbuf contains generated bindings for API file oddbuf.api.
7 //
8 // Contents:
9 //   2 messages
10 //
11 package oddbuf
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         interface_types "git.fd.io/govpp.git/binapi/interface_types"
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    = "oddbuf"
27         APIVersion = "0.1.0"
28         VersionCrc = 0x95757869
29 )
30
31 // OddbufEnableDisable defines message 'oddbuf_enable_disable'.
32 type OddbufEnableDisable struct {
33         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
34         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
35 }
36
37 func (m *OddbufEnableDisable) Reset()               { *m = OddbufEnableDisable{} }
38 func (*OddbufEnableDisable) GetMessageName() string { return "oddbuf_enable_disable" }
39 func (*OddbufEnableDisable) GetCrcString() string   { return "3865946c" }
40 func (*OddbufEnableDisable) GetMessageType() api.MessageType {
41         return api.RequestMessage
42 }
43
44 func (m *OddbufEnableDisable) Size() (size int) {
45         if m == nil {
46                 return 0
47         }
48         size += 1 // m.EnableDisable
49         size += 4 // m.SwIfIndex
50         return size
51 }
52 func (m *OddbufEnableDisable) Marshal(b []byte) ([]byte, error) {
53         if b == nil {
54                 b = make([]byte, m.Size())
55         }
56         buf := codec.NewBuffer(b)
57         buf.EncodeBool(m.EnableDisable)
58         buf.EncodeUint32(uint32(m.SwIfIndex))
59         return buf.Bytes(), nil
60 }
61 func (m *OddbufEnableDisable) Unmarshal(b []byte) error {
62         buf := codec.NewBuffer(b)
63         m.EnableDisable = buf.DecodeBool()
64         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
65         return nil
66 }
67
68 // OddbufEnableDisableReply defines message 'oddbuf_enable_disable_reply'.
69 type OddbufEnableDisableReply struct {
70         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
71 }
72
73 func (m *OddbufEnableDisableReply) Reset()               { *m = OddbufEnableDisableReply{} }
74 func (*OddbufEnableDisableReply) GetMessageName() string { return "oddbuf_enable_disable_reply" }
75 func (*OddbufEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
76 func (*OddbufEnableDisableReply) GetMessageType() api.MessageType {
77         return api.ReplyMessage
78 }
79
80 func (m *OddbufEnableDisableReply) Size() (size int) {
81         if m == nil {
82                 return 0
83         }
84         size += 4 // m.Retval
85         return size
86 }
87 func (m *OddbufEnableDisableReply) Marshal(b []byte) ([]byte, error) {
88         if b == nil {
89                 b = make([]byte, m.Size())
90         }
91         buf := codec.NewBuffer(b)
92         buf.EncodeInt32(m.Retval)
93         return buf.Bytes(), nil
94 }
95 func (m *OddbufEnableDisableReply) Unmarshal(b []byte) error {
96         buf := codec.NewBuffer(b)
97         m.Retval = buf.DecodeInt32()
98         return nil
99 }
100
101 func init() { file_oddbuf_binapi_init() }
102 func file_oddbuf_binapi_init() {
103         api.RegisterMessage((*OddbufEnableDisable)(nil), "oddbuf_enable_disable_3865946c")
104         api.RegisterMessage((*OddbufEnableDisableReply)(nil), "oddbuf_enable_disable_reply_e8d4e804")
105 }
106
107 // Messages returns list of all messages in this module.
108 func AllMessages() []api.Message {
109         return []api.Message{
110                 (*OddbufEnableDisable)(nil),
111                 (*OddbufEnableDisableReply)(nil),
112         }
113 }