1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package avf contains generated bindings for API file avf.api.
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"
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
28 VersionCrc = 0xbaaa7124
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"`
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
47 func (m *AvfCreate) Size() (size int) {
51 size += 4 // m.PciAddr
52 size += 4 // m.EnableElog
54 size += 2 // m.RxqSize
55 size += 2 // m.TxqSize
58 func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
60 b = make([]byte, m.Size())
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
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()
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"`
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
93 func (m *AvfCreateReply) Size() (size int) {
98 size += 4 // m.SwIfIndex
101 func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
103 b = make([]byte, m.Size())
105 buf := codec.NewBuffer(b)
106 buf.EncodeInt32(m.Retval)
107 buf.EncodeUint32(uint32(m.SwIfIndex))
108 return buf.Bytes(), nil
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())
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"`
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
129 func (m *AvfDelete) Size() (size int) {
133 size += 4 // m.SwIfIndex
136 func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
138 b = make([]byte, m.Size())
140 buf := codec.NewBuffer(b)
141 buf.EncodeUint32(uint32(m.SwIfIndex))
142 return buf.Bytes(), nil
144 func (m *AvfDelete) Unmarshal(b []byte) error {
145 buf := codec.NewBuffer(b)
146 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
150 // AvfDeleteReply defines message 'avf_delete_reply'.
151 type AvfDeleteReply struct {
152 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
162 func (m *AvfDeleteReply) Size() (size int) {
166 size += 4 // m.Retval
169 func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
171 b = make([]byte, m.Size())
173 buf := codec.NewBuffer(b)
174 buf.EncodeInt32(m.Retval)
175 return buf.Bytes(), nil
177 func (m *AvfDeleteReply) Unmarshal(b []byte) error {
178 buf := codec.NewBuffer(b)
179 m.Retval = buf.DecodeInt32()
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")
191 // Messages returns list of all messages in this module.
192 func AllMessages() []api.Message {
193 return []api.Message{
195 (*AvfCreateReply)(nil),
197 (*AvfDeleteReply)(nil),