1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: /usr/share/vpp/api/plugins/avf.api.json
7 // Package avf contains generated bindings for API file avf.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
29 VersionCrc = 0x9f5a6a20
32 // AvfCreate defines message 'avf_create'.
33 type AvfCreate struct {
34 PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
35 EnableElog int32 `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
36 RxqNum uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
37 RxqSize uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
38 TxqSize uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
41 func (m *AvfCreate) Reset() { *m = AvfCreate{} }
42 func (*AvfCreate) GetMessageName() string { return "avf_create" }
43 func (*AvfCreate) GetCrcString() string { return "daab8ae2" }
44 func (*AvfCreate) GetMessageType() api.MessageType {
45 return api.RequestMessage
48 func (m *AvfCreate) Size() (size int) {
52 size += 4 // m.PciAddr
53 size += 4 // m.EnableElog
55 size += 2 // m.RxqSize
56 size += 2 // m.TxqSize
59 func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
61 b = make([]byte, m.Size())
63 buf := codec.NewBuffer(b)
64 buf.EncodeUint32(m.PciAddr)
65 buf.EncodeInt32(m.EnableElog)
66 buf.EncodeUint16(m.RxqNum)
67 buf.EncodeUint16(m.RxqSize)
68 buf.EncodeUint16(m.TxqSize)
69 return buf.Bytes(), nil
71 func (m *AvfCreate) Unmarshal(b []byte) error {
72 buf := codec.NewBuffer(b)
73 m.PciAddr = buf.DecodeUint32()
74 m.EnableElog = buf.DecodeInt32()
75 m.RxqNum = buf.DecodeUint16()
76 m.RxqSize = buf.DecodeUint16()
77 m.TxqSize = buf.DecodeUint16()
81 // AvfCreateReply defines message 'avf_create_reply'.
82 type AvfCreateReply struct {
83 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
84 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
87 func (m *AvfCreateReply) Reset() { *m = AvfCreateReply{} }
88 func (*AvfCreateReply) GetMessageName() string { return "avf_create_reply" }
89 func (*AvfCreateReply) GetCrcString() string { return "5383d31f" }
90 func (*AvfCreateReply) GetMessageType() api.MessageType {
91 return api.ReplyMessage
94 func (m *AvfCreateReply) Size() (size int) {
99 size += 4 // m.SwIfIndex
102 func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
104 b = make([]byte, m.Size())
106 buf := codec.NewBuffer(b)
107 buf.EncodeInt32(m.Retval)
108 buf.EncodeUint32(uint32(m.SwIfIndex))
109 return buf.Bytes(), nil
111 func (m *AvfCreateReply) Unmarshal(b []byte) error {
112 buf := codec.NewBuffer(b)
113 m.Retval = buf.DecodeInt32()
114 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
118 // AvfDelete defines message 'avf_delete'.
119 type AvfDelete struct {
120 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
123 func (m *AvfDelete) Reset() { *m = AvfDelete{} }
124 func (*AvfDelete) GetMessageName() string { return "avf_delete" }
125 func (*AvfDelete) GetCrcString() string { return "f9e6675e" }
126 func (*AvfDelete) GetMessageType() api.MessageType {
127 return api.RequestMessage
130 func (m *AvfDelete) Size() (size int) {
134 size += 4 // m.SwIfIndex
137 func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
139 b = make([]byte, m.Size())
141 buf := codec.NewBuffer(b)
142 buf.EncodeUint32(uint32(m.SwIfIndex))
143 return buf.Bytes(), nil
145 func (m *AvfDelete) Unmarshal(b []byte) error {
146 buf := codec.NewBuffer(b)
147 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
151 // AvfDeleteReply defines message 'avf_delete_reply'.
152 type AvfDeleteReply struct {
153 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
156 func (m *AvfDeleteReply) Reset() { *m = AvfDeleteReply{} }
157 func (*AvfDeleteReply) GetMessageName() string { return "avf_delete_reply" }
158 func (*AvfDeleteReply) GetCrcString() string { return "e8d4e804" }
159 func (*AvfDeleteReply) GetMessageType() api.MessageType {
160 return api.ReplyMessage
163 func (m *AvfDeleteReply) Size() (size int) {
167 size += 4 // m.Retval
170 func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
172 b = make([]byte, m.Size())
174 buf := codec.NewBuffer(b)
175 buf.EncodeInt32(m.Retval)
176 return buf.Bytes(), nil
178 func (m *AvfDeleteReply) Unmarshal(b []byte) error {
179 buf := codec.NewBuffer(b)
180 m.Retval = buf.DecodeInt32()
184 func init() { file_avf_binapi_init() }
185 func file_avf_binapi_init() {
186 api.RegisterMessage((*AvfCreate)(nil), "avf_create_daab8ae2")
187 api.RegisterMessage((*AvfCreateReply)(nil), "avf_create_reply_5383d31f")
188 api.RegisterMessage((*AvfDelete)(nil), "avf_delete_f9e6675e")
189 api.RegisterMessage((*AvfDeleteReply)(nil), "avf_delete_reply_e8d4e804")
192 // Messages returns list of all messages in this module.
193 func AllMessages() []api.Message {
194 return []api.Message{
196 (*AvfCreateReply)(nil),
198 (*AvfDeleteReply)(nil),