github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/idpf/idpf.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/idpf.api.json 6 7 // Package idpf contains generated bindings for API file idpf.api. 8 // 9 // Contents: 10 // - 4 messages 11 package idpf 12 13 import ( 14 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 15 api "go.fd.io/govpp/api" 16 codec "go.fd.io/govpp/codec" 17 ) 18 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 24 25 const ( 26 APIFile = "idpf" 27 APIVersion = "1.0.0" 28 VersionCrc = 0x48384ea8 29 ) 30 31 // - client_index - opaque cookie to identify the sender 32 // - pci_addr - pci address as unsigned 32bit integer: 33 // 0-15 domain, 16-23 bus, 24-28 slot, 29-31 function 34 // ddddddddddddddddbbbbbbbbsssssfff 35 // - rxq_num - number of receive queues 36 // - rxq_size - receive queue size 37 // - txq_size - transmit queue size 38 // 39 // IdpfCreate defines message 'idpf_create'. 40 type IdpfCreate struct { 41 PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"` 42 RxqSingle uint16 `binapi:"u16,name=rxq_single" json:"rxq_single,omitempty"` 43 TxqSingle uint16 `binapi:"u16,name=txq_single" json:"txq_single,omitempty"` 44 RxqNum uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"` 45 TxqNum uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"` 46 RxqSize uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"` 47 TxqSize uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"` 48 ReqVportNb uint16 `binapi:"u16,name=req_vport_nb" json:"req_vport_nb,omitempty"` 49 } 50 51 func (m *IdpfCreate) Reset() { *m = IdpfCreate{} } 52 func (*IdpfCreate) GetMessageName() string { return "idpf_create" } 53 func (*IdpfCreate) GetCrcString() string { return "2ba86d91" } 54 func (*IdpfCreate) GetMessageType() api.MessageType { 55 return api.RequestMessage 56 } 57 58 func (m *IdpfCreate) Size() (size int) { 59 if m == nil { 60 return 0 61 } 62 size += 4 // m.PciAddr 63 size += 2 // m.RxqSingle 64 size += 2 // m.TxqSingle 65 size += 2 // m.RxqNum 66 size += 2 // m.TxqNum 67 size += 2 // m.RxqSize 68 size += 2 // m.TxqSize 69 size += 2 // m.ReqVportNb 70 return size 71 } 72 func (m *IdpfCreate) Marshal(b []byte) ([]byte, error) { 73 if b == nil { 74 b = make([]byte, m.Size()) 75 } 76 buf := codec.NewBuffer(b) 77 buf.EncodeUint32(m.PciAddr) 78 buf.EncodeUint16(m.RxqSingle) 79 buf.EncodeUint16(m.TxqSingle) 80 buf.EncodeUint16(m.RxqNum) 81 buf.EncodeUint16(m.TxqNum) 82 buf.EncodeUint16(m.RxqSize) 83 buf.EncodeUint16(m.TxqSize) 84 buf.EncodeUint16(m.ReqVportNb) 85 return buf.Bytes(), nil 86 } 87 func (m *IdpfCreate) Unmarshal(b []byte) error { 88 buf := codec.NewBuffer(b) 89 m.PciAddr = buf.DecodeUint32() 90 m.RxqSingle = buf.DecodeUint16() 91 m.TxqSingle = buf.DecodeUint16() 92 m.RxqNum = buf.DecodeUint16() 93 m.TxqNum = buf.DecodeUint16() 94 m.RxqSize = buf.DecodeUint16() 95 m.TxqSize = buf.DecodeUint16() 96 m.ReqVportNb = buf.DecodeUint16() 97 return nil 98 } 99 100 // - context - sender context, to match reply w/ request 101 // - retval - return value for request 102 // - sw_if_index - software index for the new idpf interface 103 // 104 // IdpfCreateReply defines message 'idpf_create_reply'. 105 type IdpfCreateReply struct { 106 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 107 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 108 } 109 110 func (m *IdpfCreateReply) Reset() { *m = IdpfCreateReply{} } 111 func (*IdpfCreateReply) GetMessageName() string { return "idpf_create_reply" } 112 func (*IdpfCreateReply) GetCrcString() string { return "5383d31f" } 113 func (*IdpfCreateReply) GetMessageType() api.MessageType { 114 return api.ReplyMessage 115 } 116 117 func (m *IdpfCreateReply) Size() (size int) { 118 if m == nil { 119 return 0 120 } 121 size += 4 // m.Retval 122 size += 4 // m.SwIfIndex 123 return size 124 } 125 func (m *IdpfCreateReply) Marshal(b []byte) ([]byte, error) { 126 if b == nil { 127 b = make([]byte, m.Size()) 128 } 129 buf := codec.NewBuffer(b) 130 buf.EncodeInt32(m.Retval) 131 buf.EncodeUint32(uint32(m.SwIfIndex)) 132 return buf.Bytes(), nil 133 } 134 func (m *IdpfCreateReply) Unmarshal(b []byte) error { 135 buf := codec.NewBuffer(b) 136 m.Retval = buf.DecodeInt32() 137 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 138 return nil 139 } 140 141 // - client_index - opaque cookie to identify the sender 142 // - sw_if_index - interface index 143 // 144 // IdpfDelete defines message 'idpf_delete'. 145 type IdpfDelete struct { 146 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 147 } 148 149 func (m *IdpfDelete) Reset() { *m = IdpfDelete{} } 150 func (*IdpfDelete) GetMessageName() string { return "idpf_delete" } 151 func (*IdpfDelete) GetCrcString() string { return "f9e6675e" } 152 func (*IdpfDelete) GetMessageType() api.MessageType { 153 return api.RequestMessage 154 } 155 156 func (m *IdpfDelete) Size() (size int) { 157 if m == nil { 158 return 0 159 } 160 size += 4 // m.SwIfIndex 161 return size 162 } 163 func (m *IdpfDelete) Marshal(b []byte) ([]byte, error) { 164 if b == nil { 165 b = make([]byte, m.Size()) 166 } 167 buf := codec.NewBuffer(b) 168 buf.EncodeUint32(uint32(m.SwIfIndex)) 169 return buf.Bytes(), nil 170 } 171 func (m *IdpfDelete) Unmarshal(b []byte) error { 172 buf := codec.NewBuffer(b) 173 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 174 return nil 175 } 176 177 // IdpfDeleteReply defines message 'idpf_delete_reply'. 178 type IdpfDeleteReply struct { 179 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 180 } 181 182 func (m *IdpfDeleteReply) Reset() { *m = IdpfDeleteReply{} } 183 func (*IdpfDeleteReply) GetMessageName() string { return "idpf_delete_reply" } 184 func (*IdpfDeleteReply) GetCrcString() string { return "e8d4e804" } 185 func (*IdpfDeleteReply) GetMessageType() api.MessageType { 186 return api.ReplyMessage 187 } 188 189 func (m *IdpfDeleteReply) Size() (size int) { 190 if m == nil { 191 return 0 192 } 193 size += 4 // m.Retval 194 return size 195 } 196 func (m *IdpfDeleteReply) Marshal(b []byte) ([]byte, error) { 197 if b == nil { 198 b = make([]byte, m.Size()) 199 } 200 buf := codec.NewBuffer(b) 201 buf.EncodeInt32(m.Retval) 202 return buf.Bytes(), nil 203 } 204 func (m *IdpfDeleteReply) Unmarshal(b []byte) error { 205 buf := codec.NewBuffer(b) 206 m.Retval = buf.DecodeInt32() 207 return nil 208 } 209 210 func init() { file_idpf_binapi_init() } 211 func file_idpf_binapi_init() { 212 api.RegisterMessage((*IdpfCreate)(nil), "idpf_create_2ba86d91") 213 api.RegisterMessage((*IdpfCreateReply)(nil), "idpf_create_reply_5383d31f") 214 api.RegisterMessage((*IdpfDelete)(nil), "idpf_delete_f9e6675e") 215 api.RegisterMessage((*IdpfDeleteReply)(nil), "idpf_delete_reply_e8d4e804") 216 } 217 218 // Messages returns list of all messages in this module. 219 func AllMessages() []api.Message { 220 return []api.Message{ 221 (*IdpfCreate)(nil), 222 (*IdpfCreateReply)(nil), 223 (*IdpfDelete)(nil), 224 (*IdpfDeleteReply)(nil), 225 } 226 }