6f93d23f4074346294c59531e4b455806ddd0582
[govpp.git] / binapi / avf / avf.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 avf contains generated bindings for API file avf.api.
7 //
8 // Contents:
9 //   4 messages
10 //
11 package avf
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    = "avf"
27         APIVersion = "1.0.0"
28         VersionCrc = 0xbaaa7124
29 )
30
31 // AvfCreate defines message 'avf_create'.
32 type AvfCreate struct {
33         PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
34         EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
35         RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
36         RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
37         TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
38 }
39
40 func (m *AvfCreate) Reset()               { *m = AvfCreate{} }
41 func (*AvfCreate) GetMessageName() string { return "avf_create" }
42 func (*AvfCreate) GetCrcString() string   { return "daab8ae2" }
43 func (*AvfCreate) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *AvfCreate) Size() (size int) {
48         if m == nil {
49                 return 0
50         }
51         size += 4 // m.PciAddr
52         size += 4 // m.EnableElog
53         size += 2 // m.RxqNum
54         size += 2 // m.RxqSize
55         size += 2 // m.TxqSize
56         return size
57 }
58 func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
59         if b == nil {
60                 b = make([]byte, m.Size())
61         }
62         buf := codec.NewBuffer(b)
63         buf.EncodeUint32(m.PciAddr)
64         buf.EncodeInt32(m.EnableElog)
65         buf.EncodeUint16(m.RxqNum)
66         buf.EncodeUint16(m.RxqSize)
67         buf.EncodeUint16(m.TxqSize)
68         return buf.Bytes(), nil
69 }
70 func (m *AvfCreate) Unmarshal(b []byte) error {
71         buf := codec.NewBuffer(b)
72         m.PciAddr = buf.DecodeUint32()
73         m.EnableElog = buf.DecodeInt32()
74         m.RxqNum = buf.DecodeUint16()
75         m.RxqSize = buf.DecodeUint16()
76         m.TxqSize = buf.DecodeUint16()
77         return nil
78 }
79
80 // AvfCreateReply defines message 'avf_create_reply'.
81 type AvfCreateReply struct {
82         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
83         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
84 }
85
86 func (m *AvfCreateReply) Reset()               { *m = AvfCreateReply{} }
87 func (*AvfCreateReply) GetMessageName() string { return "avf_create_reply" }
88 func (*AvfCreateReply) GetCrcString() string   { return "5383d31f" }
89 func (*AvfCreateReply) GetMessageType() api.MessageType {
90         return api.ReplyMessage
91 }
92
93 func (m *AvfCreateReply) Size() (size int) {
94         if m == nil {
95                 return 0
96         }
97         size += 4 // m.Retval
98         size += 4 // m.SwIfIndex
99         return size
100 }
101 func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
102         if b == nil {
103                 b = make([]byte, m.Size())
104         }
105         buf := codec.NewBuffer(b)
106         buf.EncodeInt32(m.Retval)
107         buf.EncodeUint32(uint32(m.SwIfIndex))
108         return buf.Bytes(), nil
109 }
110 func (m *AvfCreateReply) Unmarshal(b []byte) error {
111         buf := codec.NewBuffer(b)
112         m.Retval = buf.DecodeInt32()
113         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
114         return nil
115 }
116
117 // AvfDelete defines message 'avf_delete'.
118 type AvfDelete struct {
119         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
120 }
121
122 func (m *AvfDelete) Reset()               { *m = AvfDelete{} }
123 func (*AvfDelete) GetMessageName() string { return "avf_delete" }
124 func (*AvfDelete) GetCrcString() string   { return "f9e6675e" }
125 func (*AvfDelete) GetMessageType() api.MessageType {
126         return api.RequestMessage
127 }
128
129 func (m *AvfDelete) Size() (size int) {
130         if m == nil {
131                 return 0
132         }
133         size += 4 // m.SwIfIndex
134         return size
135 }
136 func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
137         if b == nil {
138                 b = make([]byte, m.Size())
139         }
140         buf := codec.NewBuffer(b)
141         buf.EncodeUint32(uint32(m.SwIfIndex))
142         return buf.Bytes(), nil
143 }
144 func (m *AvfDelete) Unmarshal(b []byte) error {
145         buf := codec.NewBuffer(b)
146         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
147         return nil
148 }
149
150 // AvfDeleteReply defines message 'avf_delete_reply'.
151 type AvfDeleteReply struct {
152         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
153 }
154
155 func (m *AvfDeleteReply) Reset()               { *m = AvfDeleteReply{} }
156 func (*AvfDeleteReply) GetMessageName() string { return "avf_delete_reply" }
157 func (*AvfDeleteReply) GetCrcString() string   { return "e8d4e804" }
158 func (*AvfDeleteReply) GetMessageType() api.MessageType {
159         return api.ReplyMessage
160 }
161
162 func (m *AvfDeleteReply) Size() (size int) {
163         if m == nil {
164                 return 0
165         }
166         size += 4 // m.Retval
167         return size
168 }
169 func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
170         if b == nil {
171                 b = make([]byte, m.Size())
172         }
173         buf := codec.NewBuffer(b)
174         buf.EncodeInt32(m.Retval)
175         return buf.Bytes(), nil
176 }
177 func (m *AvfDeleteReply) Unmarshal(b []byte) error {
178         buf := codec.NewBuffer(b)
179         m.Retval = buf.DecodeInt32()
180         return nil
181 }
182
183 func init() { file_avf_binapi_init() }
184 func file_avf_binapi_init() {
185         api.RegisterMessage((*AvfCreate)(nil), "avf_create_daab8ae2")
186         api.RegisterMessage((*AvfCreateReply)(nil), "avf_create_reply_5383d31f")
187         api.RegisterMessage((*AvfDelete)(nil), "avf_delete_f9e6675e")
188         api.RegisterMessage((*AvfDeleteReply)(nil), "avf_delete_reply_e8d4e804")
189 }
190
191 // Messages returns list of all messages in this module.
192 func AllMessages() []api.Message {
193         return []api.Message{
194                 (*AvfCreate)(nil),
195                 (*AvfCreateReply)(nil),
196                 (*AvfDelete)(nil),
197                 (*AvfDeleteReply)(nil),
198         }
199 }