1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/cop.api.json
7 // Package cop contains generated bindings for API file cop.api.
17 api "git.fd.io/govpp.git/api"
18 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 = 0x59bc1ad8
34 // IfStatusFlags defines enum 'if_status_flags'.
35 type IfStatusFlags uint32
38 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
39 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
43 IfStatusFlags_name = map[uint32]string{
44 1: "IF_STATUS_API_FLAG_ADMIN_UP",
45 2: "IF_STATUS_API_FLAG_LINK_UP",
47 IfStatusFlags_value = map[string]uint32{
48 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
49 "IF_STATUS_API_FLAG_LINK_UP": 2,
53 func (x IfStatusFlags) String() string {
54 s, ok := IfStatusFlags_name[uint32(x)]
58 str := func(n uint32) string {
59 s, ok := IfStatusFlags_name[uint32(n)]
63 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
65 for i := uint32(0); i <= 32; i++ {
80 // IfType defines enum 'if_type'.
84 IF_API_TYPE_HARDWARE IfType = 1
85 IF_API_TYPE_SUB IfType = 2
86 IF_API_TYPE_P2P IfType = 3
87 IF_API_TYPE_PIPE IfType = 4
91 IfType_name = map[uint32]string{
92 1: "IF_API_TYPE_HARDWARE",
95 4: "IF_API_TYPE_PIPE",
97 IfType_value = map[string]uint32{
98 "IF_API_TYPE_HARDWARE": 1,
100 "IF_API_TYPE_P2P": 3,
101 "IF_API_TYPE_PIPE": 4,
105 func (x IfType) String() string {
106 s, ok := IfType_name[uint32(x)]
110 return "IfType(" + strconv.Itoa(int(x)) + ")"
113 // LinkDuplex defines enum 'link_duplex'.
114 type LinkDuplex uint32
117 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
118 LINK_DUPLEX_API_HALF LinkDuplex = 1
119 LINK_DUPLEX_API_FULL LinkDuplex = 2
123 LinkDuplex_name = map[uint32]string{
124 0: "LINK_DUPLEX_API_UNKNOWN",
125 1: "LINK_DUPLEX_API_HALF",
126 2: "LINK_DUPLEX_API_FULL",
128 LinkDuplex_value = map[string]uint32{
129 "LINK_DUPLEX_API_UNKNOWN": 0,
130 "LINK_DUPLEX_API_HALF": 1,
131 "LINK_DUPLEX_API_FULL": 2,
135 func (x LinkDuplex) String() string {
136 s, ok := LinkDuplex_name[uint32(x)]
140 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
143 // MtuProto defines enum 'mtu_proto'.
147 MTU_PROTO_API_L3 MtuProto = 1
148 MTU_PROTO_API_IP4 MtuProto = 2
149 MTU_PROTO_API_IP6 MtuProto = 3
150 MTU_PROTO_API_MPLS MtuProto = 4
151 MTU_PROTO_API_N MtuProto = 5
155 MtuProto_name = map[uint32]string{
156 1: "MTU_PROTO_API_L3",
157 2: "MTU_PROTO_API_IP4",
158 3: "MTU_PROTO_API_IP6",
159 4: "MTU_PROTO_API_MPLS",
160 5: "MTU_PROTO_API_N",
162 MtuProto_value = map[string]uint32{
163 "MTU_PROTO_API_L3": 1,
164 "MTU_PROTO_API_IP4": 2,
165 "MTU_PROTO_API_IP6": 3,
166 "MTU_PROTO_API_MPLS": 4,
167 "MTU_PROTO_API_N": 5,
171 func (x MtuProto) String() string {
172 s, ok := MtuProto_name[uint32(x)]
176 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
179 // RxMode defines enum 'rx_mode'.
183 RX_MODE_API_UNKNOWN RxMode = 0
184 RX_MODE_API_POLLING RxMode = 1
185 RX_MODE_API_INTERRUPT RxMode = 2
186 RX_MODE_API_ADAPTIVE RxMode = 3
187 RX_MODE_API_DEFAULT RxMode = 4
191 RxMode_name = map[uint32]string{
192 0: "RX_MODE_API_UNKNOWN",
193 1: "RX_MODE_API_POLLING",
194 2: "RX_MODE_API_INTERRUPT",
195 3: "RX_MODE_API_ADAPTIVE",
196 4: "RX_MODE_API_DEFAULT",
198 RxMode_value = map[string]uint32{
199 "RX_MODE_API_UNKNOWN": 0,
200 "RX_MODE_API_POLLING": 1,
201 "RX_MODE_API_INTERRUPT": 2,
202 "RX_MODE_API_ADAPTIVE": 3,
203 "RX_MODE_API_DEFAULT": 4,
207 func (x RxMode) String() string {
208 s, ok := RxMode_name[uint32(x)]
212 return "RxMode(" + strconv.Itoa(int(x)) + ")"
215 // SubIfFlags defines enum 'sub_if_flags'.
216 type SubIfFlags uint32
219 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
220 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
221 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
222 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
223 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
224 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
225 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
226 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
227 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
228 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
232 SubIfFlags_name = map[uint32]string{
233 1: "SUB_IF_API_FLAG_NO_TAGS",
234 2: "SUB_IF_API_FLAG_ONE_TAG",
235 4: "SUB_IF_API_FLAG_TWO_TAGS",
236 8: "SUB_IF_API_FLAG_DOT1AD",
237 16: "SUB_IF_API_FLAG_EXACT_MATCH",
238 32: "SUB_IF_API_FLAG_DEFAULT",
239 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
240 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
241 254: "SUB_IF_API_FLAG_MASK_VNET",
242 256: "SUB_IF_API_FLAG_DOT1AH",
244 SubIfFlags_value = map[string]uint32{
245 "SUB_IF_API_FLAG_NO_TAGS": 1,
246 "SUB_IF_API_FLAG_ONE_TAG": 2,
247 "SUB_IF_API_FLAG_TWO_TAGS": 4,
248 "SUB_IF_API_FLAG_DOT1AD": 8,
249 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
250 "SUB_IF_API_FLAG_DEFAULT": 32,
251 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
252 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
253 "SUB_IF_API_FLAG_MASK_VNET": 254,
254 "SUB_IF_API_FLAG_DOT1AH": 256,
258 func (x SubIfFlags) String() string {
259 s, ok := SubIfFlags_name[uint32(x)]
263 str := func(n uint32) string {
264 s, ok := SubIfFlags_name[uint32(n)]
268 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
270 for i := uint32(0); i <= 32; i++ {
280 return str(uint32(x))
285 // InterfaceIndex defines alias 'interface_index'.
286 type InterfaceIndex uint32
288 // CopInterfaceEnableDisable defines message 'cop_interface_enable_disable'.
289 type CopInterfaceEnableDisable struct {
290 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
291 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
294 func (m *CopInterfaceEnableDisable) Reset() { *m = CopInterfaceEnableDisable{} }
295 func (*CopInterfaceEnableDisable) GetMessageName() string { return "cop_interface_enable_disable" }
296 func (*CopInterfaceEnableDisable) GetCrcString() string { return "5501adee" }
297 func (*CopInterfaceEnableDisable) GetMessageType() api.MessageType {
298 return api.RequestMessage
301 func (m *CopInterfaceEnableDisable) Size() (size int) {
305 size += 4 // m.SwIfIndex
306 size += 1 // m.EnableDisable
309 func (m *CopInterfaceEnableDisable) Marshal(b []byte) ([]byte, error) {
311 b = make([]byte, m.Size())
313 buf := codec.NewBuffer(b)
314 buf.EncodeUint32(uint32(m.SwIfIndex))
315 buf.EncodeBool(m.EnableDisable)
316 return buf.Bytes(), nil
318 func (m *CopInterfaceEnableDisable) Unmarshal(b []byte) error {
319 buf := codec.NewBuffer(b)
320 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
321 m.EnableDisable = buf.DecodeBool()
325 // CopInterfaceEnableDisableReply defines message 'cop_interface_enable_disable_reply'.
326 type CopInterfaceEnableDisableReply struct {
327 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
330 func (m *CopInterfaceEnableDisableReply) Reset() { *m = CopInterfaceEnableDisableReply{} }
331 func (*CopInterfaceEnableDisableReply) GetMessageName() string {
332 return "cop_interface_enable_disable_reply"
334 func (*CopInterfaceEnableDisableReply) GetCrcString() string { return "e8d4e804" }
335 func (*CopInterfaceEnableDisableReply) GetMessageType() api.MessageType {
336 return api.ReplyMessage
339 func (m *CopInterfaceEnableDisableReply) Size() (size int) {
343 size += 4 // m.Retval
346 func (m *CopInterfaceEnableDisableReply) Marshal(b []byte) ([]byte, error) {
348 b = make([]byte, m.Size())
350 buf := codec.NewBuffer(b)
351 buf.EncodeInt32(m.Retval)
352 return buf.Bytes(), nil
354 func (m *CopInterfaceEnableDisableReply) Unmarshal(b []byte) error {
355 buf := codec.NewBuffer(b)
356 m.Retval = buf.DecodeInt32()
360 // CopWhitelistEnableDisable defines message 'cop_whitelist_enable_disable'.
361 type CopWhitelistEnableDisable struct {
362 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
363 FibID uint32 `binapi:"u32,name=fib_id" json:"fib_id,omitempty"`
364 IP4 bool `binapi:"bool,name=ip4" json:"ip4,omitempty"`
365 IP6 bool `binapi:"bool,name=ip6" json:"ip6,omitempty"`
366 DefaultCop bool `binapi:"bool,name=default_cop" json:"default_cop,omitempty"`
369 func (m *CopWhitelistEnableDisable) Reset() { *m = CopWhitelistEnableDisable{} }
370 func (*CopWhitelistEnableDisable) GetMessageName() string { return "cop_whitelist_enable_disable" }
371 func (*CopWhitelistEnableDisable) GetCrcString() string { return "debe13ea" }
372 func (*CopWhitelistEnableDisable) GetMessageType() api.MessageType {
373 return api.RequestMessage
376 func (m *CopWhitelistEnableDisable) Size() (size int) {
380 size += 4 // m.SwIfIndex
384 size += 1 // m.DefaultCop
387 func (m *CopWhitelistEnableDisable) Marshal(b []byte) ([]byte, error) {
389 b = make([]byte, m.Size())
391 buf := codec.NewBuffer(b)
392 buf.EncodeUint32(uint32(m.SwIfIndex))
393 buf.EncodeUint32(m.FibID)
394 buf.EncodeBool(m.IP4)
395 buf.EncodeBool(m.IP6)
396 buf.EncodeBool(m.DefaultCop)
397 return buf.Bytes(), nil
399 func (m *CopWhitelistEnableDisable) Unmarshal(b []byte) error {
400 buf := codec.NewBuffer(b)
401 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
402 m.FibID = buf.DecodeUint32()
403 m.IP4 = buf.DecodeBool()
404 m.IP6 = buf.DecodeBool()
405 m.DefaultCop = buf.DecodeBool()
409 // CopWhitelistEnableDisableReply defines message 'cop_whitelist_enable_disable_reply'.
410 type CopWhitelistEnableDisableReply struct {
411 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
414 func (m *CopWhitelistEnableDisableReply) Reset() { *m = CopWhitelistEnableDisableReply{} }
415 func (*CopWhitelistEnableDisableReply) GetMessageName() string {
416 return "cop_whitelist_enable_disable_reply"
418 func (*CopWhitelistEnableDisableReply) GetCrcString() string { return "e8d4e804" }
419 func (*CopWhitelistEnableDisableReply) GetMessageType() api.MessageType {
420 return api.ReplyMessage
423 func (m *CopWhitelistEnableDisableReply) Size() (size int) {
427 size += 4 // m.Retval
430 func (m *CopWhitelistEnableDisableReply) Marshal(b []byte) ([]byte, error) {
432 b = make([]byte, m.Size())
434 buf := codec.NewBuffer(b)
435 buf.EncodeInt32(m.Retval)
436 return buf.Bytes(), nil
438 func (m *CopWhitelistEnableDisableReply) Unmarshal(b []byte) error {
439 buf := codec.NewBuffer(b)
440 m.Retval = buf.DecodeInt32()
444 func init() { file_cop_binapi_init() }
445 func file_cop_binapi_init() {
446 api.RegisterMessage((*CopInterfaceEnableDisable)(nil), "cop_interface_enable_disable_5501adee")
447 api.RegisterMessage((*CopInterfaceEnableDisableReply)(nil), "cop_interface_enable_disable_reply_e8d4e804")
448 api.RegisterMessage((*CopWhitelistEnableDisable)(nil), "cop_whitelist_enable_disable_debe13ea")
449 api.RegisterMessage((*CopWhitelistEnableDisableReply)(nil), "cop_whitelist_enable_disable_reply_e8d4e804")
452 // Messages returns list of all messages in this module.
453 func AllMessages() []api.Message {
454 return []api.Message{
455 (*CopInterfaceEnableDisable)(nil),
456 (*CopInterfaceEnableDisableReply)(nil),
457 (*CopWhitelistEnableDisable)(nil),
458 (*CopWhitelistEnableDisableReply)(nil),