1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package virtio contains generated bindings for API file virtio.api.
14 api "git.fd.io/govpp.git/api"
15 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 pci_types "git.fd.io/govpp.git/binapi/pci_types"
18 codec "git.fd.io/govpp.git/codec"
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
30 VersionCrc = 0x601b1fdc
33 // SwInterfaceVirtioPciDetails defines message 'sw_interface_virtio_pci_details'.
34 type SwInterfaceVirtioPciDetails struct {
35 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
36 PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
37 MacAddr ethernet_types.MacAddress `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"`
38 TxRingSz uint16 `binapi:"u16,name=tx_ring_sz" json:"tx_ring_sz,omitempty"`
39 RxRingSz uint16 `binapi:"u16,name=rx_ring_sz" json:"rx_ring_sz,omitempty"`
40 Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
43 func (m *SwInterfaceVirtioPciDetails) Reset() { *m = SwInterfaceVirtioPciDetails{} }
44 func (*SwInterfaceVirtioPciDetails) GetMessageName() string { return "sw_interface_virtio_pci_details" }
45 func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "16187f3a" }
46 func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType {
47 return api.ReplyMessage
50 func (m *SwInterfaceVirtioPciDetails) Size() (size int) {
54 size += 4 // m.SwIfIndex
55 size += 2 // m.PciAddr.Domain
56 size += 1 // m.PciAddr.Bus
57 size += 1 // m.PciAddr.Slot
58 size += 1 // m.PciAddr.Function
59 size += 1 * 6 // m.MacAddr
60 size += 2 // m.TxRingSz
61 size += 2 // m.RxRingSz
62 size += 8 // m.Features
65 func (m *SwInterfaceVirtioPciDetails) Marshal(b []byte) ([]byte, error) {
67 b = make([]byte, m.Size())
69 buf := codec.NewBuffer(b)
70 buf.EncodeUint32(uint32(m.SwIfIndex))
71 buf.EncodeUint16(m.PciAddr.Domain)
72 buf.EncodeUint8(m.PciAddr.Bus)
73 buf.EncodeUint8(m.PciAddr.Slot)
74 buf.EncodeUint8(m.PciAddr.Function)
75 buf.EncodeBytes(m.MacAddr[:], 6)
76 buf.EncodeUint16(m.TxRingSz)
77 buf.EncodeUint16(m.RxRingSz)
78 buf.EncodeUint64(m.Features)
79 return buf.Bytes(), nil
81 func (m *SwInterfaceVirtioPciDetails) Unmarshal(b []byte) error {
82 buf := codec.NewBuffer(b)
83 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
84 m.PciAddr.Domain = buf.DecodeUint16()
85 m.PciAddr.Bus = buf.DecodeUint8()
86 m.PciAddr.Slot = buf.DecodeUint8()
87 m.PciAddr.Function = buf.DecodeUint8()
88 copy(m.MacAddr[:], buf.DecodeBytes(6))
89 m.TxRingSz = buf.DecodeUint16()
90 m.RxRingSz = buf.DecodeUint16()
91 m.Features = buf.DecodeUint64()
95 // SwInterfaceVirtioPciDump defines message 'sw_interface_virtio_pci_dump'.
96 type SwInterfaceVirtioPciDump struct{}
98 func (m *SwInterfaceVirtioPciDump) Reset() { *m = SwInterfaceVirtioPciDump{} }
99 func (*SwInterfaceVirtioPciDump) GetMessageName() string { return "sw_interface_virtio_pci_dump" }
100 func (*SwInterfaceVirtioPciDump) GetCrcString() string { return "51077d14" }
101 func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType {
102 return api.RequestMessage
105 func (m *SwInterfaceVirtioPciDump) Size() (size int) {
111 func (m *SwInterfaceVirtioPciDump) Marshal(b []byte) ([]byte, error) {
113 b = make([]byte, m.Size())
115 buf := codec.NewBuffer(b)
116 return buf.Bytes(), nil
118 func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error {
122 // VirtioPciCreate defines message 'virtio_pci_create'.
123 type VirtioPciCreate struct {
124 PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
125 UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
126 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
127 GsoEnabled bool `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
128 ChecksumOffloadEnabled bool `binapi:"bool,name=checksum_offload_enabled" json:"checksum_offload_enabled,omitempty"`
129 Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
132 func (m *VirtioPciCreate) Reset() { *m = VirtioPciCreate{} }
133 func (*VirtioPciCreate) GetMessageName() string { return "virtio_pci_create" }
134 func (*VirtioPciCreate) GetCrcString() string { return "a9f1370c" }
135 func (*VirtioPciCreate) GetMessageType() api.MessageType {
136 return api.RequestMessage
139 func (m *VirtioPciCreate) Size() (size int) {
143 size += 2 // m.PciAddr.Domain
144 size += 1 // m.PciAddr.Bus
145 size += 1 // m.PciAddr.Slot
146 size += 1 // m.PciAddr.Function
147 size += 1 // m.UseRandomMac
148 size += 1 * 6 // m.MacAddress
149 size += 1 // m.GsoEnabled
150 size += 1 // m.ChecksumOffloadEnabled
151 size += 8 // m.Features
154 func (m *VirtioPciCreate) Marshal(b []byte) ([]byte, error) {
156 b = make([]byte, m.Size())
158 buf := codec.NewBuffer(b)
159 buf.EncodeUint16(m.PciAddr.Domain)
160 buf.EncodeUint8(m.PciAddr.Bus)
161 buf.EncodeUint8(m.PciAddr.Slot)
162 buf.EncodeUint8(m.PciAddr.Function)
163 buf.EncodeBool(m.UseRandomMac)
164 buf.EncodeBytes(m.MacAddress[:], 6)
165 buf.EncodeBool(m.GsoEnabled)
166 buf.EncodeBool(m.ChecksumOffloadEnabled)
167 buf.EncodeUint64(m.Features)
168 return buf.Bytes(), nil
170 func (m *VirtioPciCreate) Unmarshal(b []byte) error {
171 buf := codec.NewBuffer(b)
172 m.PciAddr.Domain = buf.DecodeUint16()
173 m.PciAddr.Bus = buf.DecodeUint8()
174 m.PciAddr.Slot = buf.DecodeUint8()
175 m.PciAddr.Function = buf.DecodeUint8()
176 m.UseRandomMac = buf.DecodeBool()
177 copy(m.MacAddress[:], buf.DecodeBytes(6))
178 m.GsoEnabled = buf.DecodeBool()
179 m.ChecksumOffloadEnabled = buf.DecodeBool()
180 m.Features = buf.DecodeUint64()
184 // VirtioPciCreateReply defines message 'virtio_pci_create_reply'.
185 type VirtioPciCreateReply struct {
186 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
187 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
190 func (m *VirtioPciCreateReply) Reset() { *m = VirtioPciCreateReply{} }
191 func (*VirtioPciCreateReply) GetMessageName() string { return "virtio_pci_create_reply" }
192 func (*VirtioPciCreateReply) GetCrcString() string { return "5383d31f" }
193 func (*VirtioPciCreateReply) GetMessageType() api.MessageType {
194 return api.ReplyMessage
197 func (m *VirtioPciCreateReply) Size() (size int) {
201 size += 4 // m.Retval
202 size += 4 // m.SwIfIndex
205 func (m *VirtioPciCreateReply) Marshal(b []byte) ([]byte, error) {
207 b = make([]byte, m.Size())
209 buf := codec.NewBuffer(b)
210 buf.EncodeInt32(m.Retval)
211 buf.EncodeUint32(uint32(m.SwIfIndex))
212 return buf.Bytes(), nil
214 func (m *VirtioPciCreateReply) Unmarshal(b []byte) error {
215 buf := codec.NewBuffer(b)
216 m.Retval = buf.DecodeInt32()
217 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
221 // VirtioPciDelete defines message 'virtio_pci_delete'.
222 type VirtioPciDelete struct {
223 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
226 func (m *VirtioPciDelete) Reset() { *m = VirtioPciDelete{} }
227 func (*VirtioPciDelete) GetMessageName() string { return "virtio_pci_delete" }
228 func (*VirtioPciDelete) GetCrcString() string { return "f9e6675e" }
229 func (*VirtioPciDelete) GetMessageType() api.MessageType {
230 return api.RequestMessage
233 func (m *VirtioPciDelete) Size() (size int) {
237 size += 4 // m.SwIfIndex
240 func (m *VirtioPciDelete) Marshal(b []byte) ([]byte, error) {
242 b = make([]byte, m.Size())
244 buf := codec.NewBuffer(b)
245 buf.EncodeUint32(uint32(m.SwIfIndex))
246 return buf.Bytes(), nil
248 func (m *VirtioPciDelete) Unmarshal(b []byte) error {
249 buf := codec.NewBuffer(b)
250 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
254 // VirtioPciDeleteReply defines message 'virtio_pci_delete_reply'.
255 type VirtioPciDeleteReply struct {
256 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
259 func (m *VirtioPciDeleteReply) Reset() { *m = VirtioPciDeleteReply{} }
260 func (*VirtioPciDeleteReply) GetMessageName() string { return "virtio_pci_delete_reply" }
261 func (*VirtioPciDeleteReply) GetCrcString() string { return "e8d4e804" }
262 func (*VirtioPciDeleteReply) GetMessageType() api.MessageType {
263 return api.ReplyMessage
266 func (m *VirtioPciDeleteReply) Size() (size int) {
270 size += 4 // m.Retval
273 func (m *VirtioPciDeleteReply) Marshal(b []byte) ([]byte, error) {
275 b = make([]byte, m.Size())
277 buf := codec.NewBuffer(b)
278 buf.EncodeInt32(m.Retval)
279 return buf.Bytes(), nil
281 func (m *VirtioPciDeleteReply) Unmarshal(b []byte) error {
282 buf := codec.NewBuffer(b)
283 m.Retval = buf.DecodeInt32()
287 func init() { file_virtio_binapi_init() }
288 func file_virtio_binapi_init() {
289 api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_16187f3a")
290 api.RegisterMessage((*SwInterfaceVirtioPciDump)(nil), "sw_interface_virtio_pci_dump_51077d14")
291 api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_a9f1370c")
292 api.RegisterMessage((*VirtioPciCreateReply)(nil), "virtio_pci_create_reply_5383d31f")
293 api.RegisterMessage((*VirtioPciDelete)(nil), "virtio_pci_delete_f9e6675e")
294 api.RegisterMessage((*VirtioPciDeleteReply)(nil), "virtio_pci_delete_reply_e8d4e804")
297 // Messages returns list of all messages in this module.
298 func AllMessages() []api.Message {
299 return []api.Message{
300 (*SwInterfaceVirtioPciDetails)(nil),
301 (*SwInterfaceVirtioPciDump)(nil),
302 (*VirtioPciCreate)(nil),
303 (*VirtioPciCreateReply)(nil),
304 (*VirtioPciDelete)(nil),
305 (*VirtioPciDeleteReply)(nil),