1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/virtio.api.json
7 // Package virtio contains generated bindings for API file virtio.api.
15 api "git.fd.io/govpp.git/api"
16 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 pci_types "git.fd.io/govpp.git/binapi/pci_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x601b1fdc
34 // SwInterfaceVirtioPciDetails defines message 'sw_interface_virtio_pci_details'.
35 type SwInterfaceVirtioPciDetails struct {
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
38 MacAddr ethernet_types.MacAddress `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"`
39 TxRingSz uint16 `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
40 RxRingSz uint16 `binapi:"u16,name=rx_ring_sz" json:"rx_ring_sz,omitempty"`
41 Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
44 func (m *SwInterfaceVirtioPciDetails) Reset() { *m = SwInterfaceVirtioPciDetails{} }
45 func (*SwInterfaceVirtioPciDetails) GetMessageName() string { return "sw_interface_virtio_pci_details" }
46 func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "16187f3a" }
47 func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType {
48 return api.ReplyMessage
51 func (m *SwInterfaceVirtioPciDetails) Size() int {
56 size += 4 // m.SwIfIndex
57 size += 2 // m.PciAddr.Domain
58 size += 1 // m.PciAddr.Bus
59 size += 1 // m.PciAddr.Slot
60 size += 1 // m.PciAddr.Function
61 size += 1 * 6 // m.MacAddr
62 size += 2 // m.TxRingSz
63 size += 2 // m.RxRingSz
64 size += 8 // m.Features
67 func (m *SwInterfaceVirtioPciDetails) Marshal(b []byte) ([]byte, error) {
70 buf = codec.NewBuffer(make([]byte, m.Size()))
72 buf = codec.NewBuffer(b)
74 buf.EncodeUint32(uint32(m.SwIfIndex))
75 buf.EncodeUint16(uint16(m.PciAddr.Domain))
76 buf.EncodeUint8(uint8(m.PciAddr.Bus))
77 buf.EncodeUint8(uint8(m.PciAddr.Slot))
78 buf.EncodeUint8(uint8(m.PciAddr.Function))
79 buf.EncodeBytes(m.MacAddr[:], 6)
80 buf.EncodeUint16(uint16(m.TxRingSz))
81 buf.EncodeUint16(uint16(m.RxRingSz))
82 buf.EncodeUint64(uint64(m.Features))
83 return buf.Bytes(), nil
85 func (m *SwInterfaceVirtioPciDetails) Unmarshal(b []byte) error {
86 buf := codec.NewBuffer(b)
87 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
88 m.PciAddr.Domain = buf.DecodeUint16()
89 m.PciAddr.Bus = buf.DecodeUint8()
90 m.PciAddr.Slot = buf.DecodeUint8()
91 m.PciAddr.Function = buf.DecodeUint8()
92 copy(m.MacAddr[:], buf.DecodeBytes(6))
93 m.TxRingSz = buf.DecodeUint16()
94 m.RxRingSz = buf.DecodeUint16()
95 m.Features = buf.DecodeUint64()
99 // SwInterfaceVirtioPciDump defines message 'sw_interface_virtio_pci_dump'.
100 type SwInterfaceVirtioPciDump struct{}
102 func (m *SwInterfaceVirtioPciDump) Reset() { *m = SwInterfaceVirtioPciDump{} }
103 func (*SwInterfaceVirtioPciDump) GetMessageName() string { return "sw_interface_virtio_pci_dump" }
104 func (*SwInterfaceVirtioPciDump) GetCrcString() string { return "51077d14" }
105 func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType {
106 return api.RequestMessage
109 func (m *SwInterfaceVirtioPciDump) Size() int {
116 func (m *SwInterfaceVirtioPciDump) Marshal(b []byte) ([]byte, error) {
117 var buf *codec.Buffer
119 buf = codec.NewBuffer(make([]byte, m.Size()))
121 buf = codec.NewBuffer(b)
123 return buf.Bytes(), nil
125 func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error {
129 // VirtioPciCreate defines message 'virtio_pci_create'.
130 type VirtioPciCreate struct {
131 PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
132 UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
133 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
134 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
135 ChecksumOffloadEnabled bool `binapi:"bool,name=checksum_offload_enabled" json:"checksum_offload_enabled,omitempty"`
136 Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
139 func (m *VirtioPciCreate) Reset() { *m = VirtioPciCreate{} }
140 func (*VirtioPciCreate) GetMessageName() string { return "virtio_pci_create" }
141 func (*VirtioPciCreate) GetCrcString() string { return "a9f1370c" }
142 func (*VirtioPciCreate) GetMessageType() api.MessageType {
143 return api.RequestMessage
146 func (m *VirtioPciCreate) Size() int {
151 size += 2 // m.PciAddr.Domain
152 size += 1 // m.PciAddr.Bus
153 size += 1 // m.PciAddr.Slot
154 size += 1 // m.PciAddr.Function
155 size += 1 // m.UseRandomMac
156 size += 1 * 6 // m.MacAddress
157 size += 1 // m.GsoEnabled
158 size += 1 // m.ChecksumOffloadEnabled
159 size += 8 // m.Features
162 func (m *VirtioPciCreate) Marshal(b []byte) ([]byte, error) {
163 var buf *codec.Buffer
165 buf = codec.NewBuffer(make([]byte, m.Size()))
167 buf = codec.NewBuffer(b)
169 buf.EncodeUint16(uint16(m.PciAddr.Domain))
170 buf.EncodeUint8(uint8(m.PciAddr.Bus))
171 buf.EncodeUint8(uint8(m.PciAddr.Slot))
172 buf.EncodeUint8(uint8(m.PciAddr.Function))
173 buf.EncodeBool(m.UseRandomMac)
174 buf.EncodeBytes(m.MacAddress[:], 6)
175 buf.EncodeBool(m.GsoEnabled)
176 buf.EncodeBool(m.ChecksumOffloadEnabled)
177 buf.EncodeUint64(uint64(m.Features))
178 return buf.Bytes(), nil
180 func (m *VirtioPciCreate) Unmarshal(b []byte) error {
181 buf := codec.NewBuffer(b)
182 m.PciAddr.Domain = buf.DecodeUint16()
183 m.PciAddr.Bus = buf.DecodeUint8()
184 m.PciAddr.Slot = buf.DecodeUint8()
185 m.PciAddr.Function = buf.DecodeUint8()
186 m.UseRandomMac = buf.DecodeBool()
187 copy(m.MacAddress[:], buf.DecodeBytes(6))
188 m.GsoEnabled = buf.DecodeBool()
189 m.ChecksumOffloadEnabled = buf.DecodeBool()
190 m.Features = buf.DecodeUint64()
194 // VirtioPciCreateReply defines message 'virtio_pci_create_reply'.
195 type VirtioPciCreateReply struct {
196 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
197 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
200 func (m *VirtioPciCreateReply) Reset() { *m = VirtioPciCreateReply{} }
201 func (*VirtioPciCreateReply) GetMessageName() string { return "virtio_pci_create_reply" }
202 func (*VirtioPciCreateReply) GetCrcString() string { return "5383d31f" }
203 func (*VirtioPciCreateReply) GetMessageType() api.MessageType {
204 return api.ReplyMessage
207 func (m *VirtioPciCreateReply) Size() int {
212 size += 4 // m.Retval
213 size += 4 // m.SwIfIndex
216 func (m *VirtioPciCreateReply) Marshal(b []byte) ([]byte, error) {
217 var buf *codec.Buffer
219 buf = codec.NewBuffer(make([]byte, m.Size()))
221 buf = codec.NewBuffer(b)
223 buf.EncodeUint32(uint32(m.Retval))
224 buf.EncodeUint32(uint32(m.SwIfIndex))
225 return buf.Bytes(), nil
227 func (m *VirtioPciCreateReply) Unmarshal(b []byte) error {
228 buf := codec.NewBuffer(b)
229 m.Retval = int32(buf.DecodeUint32())
230 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
234 // VirtioPciDelete defines message 'virtio_pci_delete'.
235 type VirtioPciDelete struct {
236 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
239 func (m *VirtioPciDelete) Reset() { *m = VirtioPciDelete{} }
240 func (*VirtioPciDelete) GetMessageName() string { return "virtio_pci_delete" }
241 func (*VirtioPciDelete) GetCrcString() string { return "f9e6675e" }
242 func (*VirtioPciDelete) GetMessageType() api.MessageType {
243 return api.RequestMessage
246 func (m *VirtioPciDelete) Size() int {
251 size += 4 // m.SwIfIndex
254 func (m *VirtioPciDelete) Marshal(b []byte) ([]byte, error) {
255 var buf *codec.Buffer
257 buf = codec.NewBuffer(make([]byte, m.Size()))
259 buf = codec.NewBuffer(b)
261 buf.EncodeUint32(uint32(m.SwIfIndex))
262 return buf.Bytes(), nil
264 func (m *VirtioPciDelete) Unmarshal(b []byte) error {
265 buf := codec.NewBuffer(b)
266 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
270 // VirtioPciDeleteReply defines message 'virtio_pci_delete_reply'.
271 type VirtioPciDeleteReply struct {
272 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
275 func (m *VirtioPciDeleteReply) Reset() { *m = VirtioPciDeleteReply{} }
276 func (*VirtioPciDeleteReply) GetMessageName() string { return "virtio_pci_delete_reply" }
277 func (*VirtioPciDeleteReply) GetCrcString() string { return "e8d4e804" }
278 func (*VirtioPciDeleteReply) GetMessageType() api.MessageType {
279 return api.ReplyMessage
282 func (m *VirtioPciDeleteReply) Size() int {
287 size += 4 // m.Retval
290 func (m *VirtioPciDeleteReply) Marshal(b []byte) ([]byte, error) {
291 var buf *codec.Buffer
293 buf = codec.NewBuffer(make([]byte, m.Size()))
295 buf = codec.NewBuffer(b)
297 buf.EncodeUint32(uint32(m.Retval))
298 return buf.Bytes(), nil
300 func (m *VirtioPciDeleteReply) Unmarshal(b []byte) error {
301 buf := codec.NewBuffer(b)
302 m.Retval = int32(buf.DecodeUint32())
306 func init() { file_virtio_binapi_init() }
307 func file_virtio_binapi_init() {
308 api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_16187f3a")
309 api.RegisterMessage((*SwInterfaceVirtioPciDump)(nil), "sw_interface_virtio_pci_dump_51077d14")
310 api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_a9f1370c")
311 api.RegisterMessage((*VirtioPciCreateReply)(nil), "virtio_pci_create_reply_5383d31f")
312 api.RegisterMessage((*VirtioPciDelete)(nil), "virtio_pci_delete_f9e6675e")
313 api.RegisterMessage((*VirtioPciDeleteReply)(nil), "virtio_pci_delete_reply_e8d4e804")
316 // Messages returns list of all messages in this module.
317 func AllMessages() []api.Message {
318 return []api.Message{
319 (*SwInterfaceVirtioPciDetails)(nil),
320 (*SwInterfaceVirtioPciDump)(nil),
321 (*VirtioPciCreate)(nil),
322 (*VirtioPciCreateReply)(nil),
323 (*VirtioPciDelete)(nil),
324 (*VirtioPciDeleteReply)(nil),