1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
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() (size int) {
55 size += 4 // m.SwIfIndex
56 size += 2 // m.PciAddr.Domain
57 size += 1 // m.PciAddr.Bus
58 size += 1 // m.PciAddr.Slot
59 size += 1 // m.PciAddr.Function
60 size += 1 * 6 // m.MacAddr
61 size += 2 // m.TxRingSz
62 size += 2 // m.RxRingSz
63 size += 8 // m.Features
66 func (m *SwInterfaceVirtioPciDetails) Marshal(b []byte) ([]byte, error) {
68 b = make([]byte, m.Size())
70 buf := codec.NewBuffer(b)
71 buf.EncodeUint32(uint32(m.SwIfIndex))
72 buf.EncodeUint16(m.PciAddr.Domain)
73 buf.EncodeUint8(m.PciAddr.Bus)
74 buf.EncodeUint8(m.PciAddr.Slot)
75 buf.EncodeUint8(m.PciAddr.Function)
76 buf.EncodeBytes(m.MacAddr[:], 6)
77 buf.EncodeUint16(m.TxRingSz)
78 buf.EncodeUint16(m.RxRingSz)
79 buf.EncodeUint64(m.Features)
80 return buf.Bytes(), nil
82 func (m *SwInterfaceVirtioPciDetails) Unmarshal(b []byte) error {
83 buf := codec.NewBuffer(b)
84 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
85 m.PciAddr.Domain = buf.DecodeUint16()
86 m.PciAddr.Bus = buf.DecodeUint8()
87 m.PciAddr.Slot = buf.DecodeUint8()
88 m.PciAddr.Function = buf.DecodeUint8()
89 copy(m.MacAddr[:], buf.DecodeBytes(6))
90 m.TxRingSz = buf.DecodeUint16()
91 m.RxRingSz = buf.DecodeUint16()
92 m.Features = buf.DecodeUint64()
96 // SwInterfaceVirtioPciDump defines message 'sw_interface_virtio_pci_dump'.
97 type SwInterfaceVirtioPciDump struct{}
99 func (m *SwInterfaceVirtioPciDump) Reset() { *m = SwInterfaceVirtioPciDump{} }
100 func (*SwInterfaceVirtioPciDump) GetMessageName() string { return "sw_interface_virtio_pci_dump" }
101 func (*SwInterfaceVirtioPciDump) GetCrcString() string { return "51077d14" }
102 func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType {
103 return api.RequestMessage
106 func (m *SwInterfaceVirtioPciDump) Size() (size int) {
112 func (m *SwInterfaceVirtioPciDump) Marshal(b []byte) ([]byte, error) {
114 b = make([]byte, m.Size())
116 buf := codec.NewBuffer(b)
117 return buf.Bytes(), nil
119 func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error {
123 // VirtioPciCreate defines message 'virtio_pci_create'.
124 type VirtioPciCreate struct {
125 PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
126 UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
127 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
128 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
129 ChecksumOffloadEnabled bool `binapi:"bool,name=checksum_offload_enabled" json:"checksum_offload_enabled,omitempty"`
130 Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
133 func (m *VirtioPciCreate) Reset() { *m = VirtioPciCreate{} }
134 func (*VirtioPciCreate) GetMessageName() string { return "virtio_pci_create" }
135 func (*VirtioPciCreate) GetCrcString() string { return "a9f1370c" }
136 func (*VirtioPciCreate) GetMessageType() api.MessageType {
137 return api.RequestMessage
140 func (m *VirtioPciCreate) Size() (size int) {
144 size += 2 // m.PciAddr.Domain
145 size += 1 // m.PciAddr.Bus
146 size += 1 // m.PciAddr.Slot
147 size += 1 // m.PciAddr.Function
148 size += 1 // m.UseRandomMac
149 size += 1 * 6 // m.MacAddress
150 size += 1 // m.GsoEnabled
151 size += 1 // m.ChecksumOffloadEnabled
152 size += 8 // m.Features
155 func (m *VirtioPciCreate) Marshal(b []byte) ([]byte, error) {
157 b = make([]byte, m.Size())
159 buf := codec.NewBuffer(b)
160 buf.EncodeUint16(m.PciAddr.Domain)
161 buf.EncodeUint8(m.PciAddr.Bus)
162 buf.EncodeUint8(m.PciAddr.Slot)
163 buf.EncodeUint8(m.PciAddr.Function)
164 buf.EncodeBool(m.UseRandomMac)
165 buf.EncodeBytes(m.MacAddress[:], 6)
166 buf.EncodeBool(m.GsoEnabled)
167 buf.EncodeBool(m.ChecksumOffloadEnabled)
168 buf.EncodeUint64(m.Features)
169 return buf.Bytes(), nil
171 func (m *VirtioPciCreate) Unmarshal(b []byte) error {
172 buf := codec.NewBuffer(b)
173 m.PciAddr.Domain = buf.DecodeUint16()
174 m.PciAddr.Bus = buf.DecodeUint8()
175 m.PciAddr.Slot = buf.DecodeUint8()
176 m.PciAddr.Function = buf.DecodeUint8()
177 m.UseRandomMac = buf.DecodeBool()
178 copy(m.MacAddress[:], buf.DecodeBytes(6))
179 m.GsoEnabled = buf.DecodeBool()
180 m.ChecksumOffloadEnabled = buf.DecodeBool()
181 m.Features = buf.DecodeUint64()
185 // VirtioPciCreateReply defines message 'virtio_pci_create_reply'.
186 type VirtioPciCreateReply struct {
187 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
188 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
191 func (m *VirtioPciCreateReply) Reset() { *m = VirtioPciCreateReply{} }
192 func (*VirtioPciCreateReply) GetMessageName() string { return "virtio_pci_create_reply" }
193 func (*VirtioPciCreateReply) GetCrcString() string { return "5383d31f" }
194 func (*VirtioPciCreateReply) GetMessageType() api.MessageType {
195 return api.ReplyMessage
198 func (m *VirtioPciCreateReply) Size() (size int) {
202 size += 4 // m.Retval
203 size += 4 // m.SwIfIndex
206 func (m *VirtioPciCreateReply) Marshal(b []byte) ([]byte, error) {
208 b = make([]byte, m.Size())
210 buf := codec.NewBuffer(b)
211 buf.EncodeInt32(m.Retval)
212 buf.EncodeUint32(uint32(m.SwIfIndex))
213 return buf.Bytes(), nil
215 func (m *VirtioPciCreateReply) Unmarshal(b []byte) error {
216 buf := codec.NewBuffer(b)
217 m.Retval = buf.DecodeInt32()
218 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
222 // VirtioPciDelete defines message 'virtio_pci_delete'.
223 type VirtioPciDelete struct {
224 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
227 func (m *VirtioPciDelete) Reset() { *m = VirtioPciDelete{} }
228 func (*VirtioPciDelete) GetMessageName() string { return "virtio_pci_delete" }
229 func (*VirtioPciDelete) GetCrcString() string { return "f9e6675e" }
230 func (*VirtioPciDelete) GetMessageType() api.MessageType {
231 return api.RequestMessage
234 func (m *VirtioPciDelete) Size() (size int) {
238 size += 4 // m.SwIfIndex
241 func (m *VirtioPciDelete) Marshal(b []byte) ([]byte, error) {
243 b = make([]byte, m.Size())
245 buf := codec.NewBuffer(b)
246 buf.EncodeUint32(uint32(m.SwIfIndex))
247 return buf.Bytes(), nil
249 func (m *VirtioPciDelete) Unmarshal(b []byte) error {
250 buf := codec.NewBuffer(b)
251 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
255 // VirtioPciDeleteReply defines message 'virtio_pci_delete_reply'.
256 type VirtioPciDeleteReply struct {
257 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
260 func (m *VirtioPciDeleteReply) Reset() { *m = VirtioPciDeleteReply{} }
261 func (*VirtioPciDeleteReply) GetMessageName() string { return "virtio_pci_delete_reply" }
262 func (*VirtioPciDeleteReply) GetCrcString() string { return "e8d4e804" }
263 func (*VirtioPciDeleteReply) GetMessageType() api.MessageType {
264 return api.ReplyMessage
267 func (m *VirtioPciDeleteReply) Size() (size int) {
271 size += 4 // m.Retval
274 func (m *VirtioPciDeleteReply) Marshal(b []byte) ([]byte, error) {
276 b = make([]byte, m.Size())
278 buf := codec.NewBuffer(b)
279 buf.EncodeInt32(m.Retval)
280 return buf.Bytes(), nil
282 func (m *VirtioPciDeleteReply) Unmarshal(b []byte) error {
283 buf := codec.NewBuffer(b)
284 m.Retval = buf.DecodeInt32()
288 func init() { file_virtio_binapi_init() }
289 func file_virtio_binapi_init() {
290 api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_16187f3a")
291 api.RegisterMessage((*SwInterfaceVirtioPciDump)(nil), "sw_interface_virtio_pci_dump_51077d14")
292 api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_a9f1370c")
293 api.RegisterMessage((*VirtioPciCreateReply)(nil), "virtio_pci_create_reply_5383d31f")
294 api.RegisterMessage((*VirtioPciDelete)(nil), "virtio_pci_delete_f9e6675e")
295 api.RegisterMessage((*VirtioPciDeleteReply)(nil), "virtio_pci_delete_reply_e8d4e804")
298 // Messages returns list of all messages in this module.
299 func AllMessages() []api.Message {
300 return []api.Message{
301 (*SwInterfaceVirtioPciDetails)(nil),
302 (*SwInterfaceVirtioPciDump)(nil),
303 (*VirtioPciCreate)(nil),
304 (*VirtioPciCreateReply)(nil),
305 (*VirtioPciDelete)(nil),
306 (*VirtioPciDeleteReply)(nil),