1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/punt.api.json
7 // Package punt contains generated bindings for API file punt.api.
18 api "git.fd.io/govpp.git/api"
19 ip_types "git.fd.io/govpp.git/binapi/ip_types"
20 codec "git.fd.io/govpp.git/codec"
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
33 VersionCrc = 0x31354154
36 // PuntType defines enum 'punt_type'.
40 PUNT_API_TYPE_L4 PuntType = 1
41 PUNT_API_TYPE_IP_PROTO PuntType = 2
42 PUNT_API_TYPE_EXCEPTION PuntType = 3
46 PuntType_name = map[uint32]string{
47 1: "PUNT_API_TYPE_L4",
48 2: "PUNT_API_TYPE_IP_PROTO",
49 3: "PUNT_API_TYPE_EXCEPTION",
51 PuntType_value = map[string]uint32{
52 "PUNT_API_TYPE_L4": 1,
53 "PUNT_API_TYPE_IP_PROTO": 2,
54 "PUNT_API_TYPE_EXCEPTION": 3,
58 func (x PuntType) String() string {
59 s, ok := PuntType_name[uint32(x)]
63 return "PuntType(" + strconv.Itoa(int(x)) + ")"
66 // Punt defines type 'punt'.
68 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
69 Punt PuntUnion `binapi:"punt_union,name=punt" json:"punt,omitempty"`
72 // PuntException defines type 'punt_exception'.
73 type PuntException struct {
74 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
77 // PuntIPProto defines type 'punt_ip_proto'.
78 type PuntIPProto struct {
79 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
80 Protocol ip_types.IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
83 // PuntL4 defines type 'punt_l4'.
85 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
86 Protocol ip_types.IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
87 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
90 // PuntReason defines type 'punt_reason'.
91 type PuntReason struct {
92 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
93 Name string `binapi:"string[],name=name" json:"name,omitempty"`
96 // PuntUnion defines union 'punt_union'.
97 type PuntUnion struct {
98 // Exception *PuntException
100 // IPProto *PuntIPProto
101 XXX_UnionData [4]byte
104 func PuntUnionException(a PuntException) (u PuntUnion) {
108 func (u *PuntUnion) SetException(a PuntException) {
109 var buf = codec.NewBuffer(u.XXX_UnionData[:])
110 buf.EncodeUint32(uint32(a.ID))
112 func (u *PuntUnion) GetException() (a PuntException) {
113 var buf = codec.NewBuffer(u.XXX_UnionData[:])
114 a.ID = buf.DecodeUint32()
118 func PuntUnionL4(a PuntL4) (u PuntUnion) {
122 func (u *PuntUnion) SetL4(a PuntL4) {
123 var buf = codec.NewBuffer(u.XXX_UnionData[:])
124 buf.EncodeUint8(uint8(a.Af))
125 buf.EncodeUint8(uint8(a.Protocol))
126 buf.EncodeUint16(uint16(a.Port))
128 func (u *PuntUnion) GetL4() (a PuntL4) {
129 var buf = codec.NewBuffer(u.XXX_UnionData[:])
130 a.Af = ip_types.AddressFamily(buf.DecodeUint8())
131 a.Protocol = ip_types.IPProto(buf.DecodeUint8())
132 a.Port = buf.DecodeUint16()
136 func PuntUnionIPProto(a PuntIPProto) (u PuntUnion) {
140 func (u *PuntUnion) SetIPProto(a PuntIPProto) {
141 var buf = codec.NewBuffer(u.XXX_UnionData[:])
142 buf.EncodeUint8(uint8(a.Af))
143 buf.EncodeUint8(uint8(a.Protocol))
145 func (u *PuntUnion) GetIPProto() (a PuntIPProto) {
146 var buf = codec.NewBuffer(u.XXX_UnionData[:])
147 a.Af = ip_types.AddressFamily(buf.DecodeUint8())
148 a.Protocol = ip_types.IPProto(buf.DecodeUint8())
152 // PuntReasonDetails defines message 'punt_reason_details'.
153 type PuntReasonDetails struct {
154 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
157 func (m *PuntReasonDetails) Reset() { *m = PuntReasonDetails{} }
158 func (*PuntReasonDetails) GetMessageName() string { return "punt_reason_details" }
159 func (*PuntReasonDetails) GetCrcString() string { return "2c9d4a40" }
160 func (*PuntReasonDetails) GetMessageType() api.MessageType {
161 return api.ReplyMessage
164 func (m *PuntReasonDetails) Size() int {
169 size += 4 // m.Reason.ID
170 size += 4 + len(m.Reason.Name) // m.Reason.Name
173 func (m *PuntReasonDetails) Marshal(b []byte) ([]byte, error) {
174 var buf *codec.Buffer
176 buf = codec.NewBuffer(make([]byte, m.Size()))
178 buf = codec.NewBuffer(b)
180 buf.EncodeUint32(uint32(m.Reason.ID))
181 buf.EncodeString(m.Reason.Name, 0)
182 return buf.Bytes(), nil
184 func (m *PuntReasonDetails) Unmarshal(b []byte) error {
185 buf := codec.NewBuffer(b)
186 m.Reason.ID = buf.DecodeUint32()
187 m.Reason.Name = buf.DecodeString(0)
191 // PuntReasonDump defines message 'punt_reason_dump'.
192 type PuntReasonDump struct {
193 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
196 func (m *PuntReasonDump) Reset() { *m = PuntReasonDump{} }
197 func (*PuntReasonDump) GetMessageName() string { return "punt_reason_dump" }
198 func (*PuntReasonDump) GetCrcString() string { return "5c0dd4fe" }
199 func (*PuntReasonDump) GetMessageType() api.MessageType {
200 return api.RequestMessage
203 func (m *PuntReasonDump) Size() int {
208 size += 4 // m.Reason.ID
209 size += 4 + len(m.Reason.Name) // m.Reason.Name
212 func (m *PuntReasonDump) Marshal(b []byte) ([]byte, error) {
213 var buf *codec.Buffer
215 buf = codec.NewBuffer(make([]byte, m.Size()))
217 buf = codec.NewBuffer(b)
219 buf.EncodeUint32(uint32(m.Reason.ID))
220 buf.EncodeString(m.Reason.Name, 0)
221 return buf.Bytes(), nil
223 func (m *PuntReasonDump) Unmarshal(b []byte) error {
224 buf := codec.NewBuffer(b)
225 m.Reason.ID = buf.DecodeUint32()
226 m.Reason.Name = buf.DecodeString(0)
230 // PuntSocketDeregister defines message 'punt_socket_deregister'.
231 type PuntSocketDeregister struct {
232 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
235 func (m *PuntSocketDeregister) Reset() { *m = PuntSocketDeregister{} }
236 func (*PuntSocketDeregister) GetMessageName() string { return "punt_socket_deregister" }
237 func (*PuntSocketDeregister) GetCrcString() string { return "98a444f4" }
238 func (*PuntSocketDeregister) GetMessageType() api.MessageType {
239 return api.RequestMessage
242 func (m *PuntSocketDeregister) Size() int {
247 size += 4 // m.Punt.Type
248 size += 1 * 4 // m.Punt.Punt
251 func (m *PuntSocketDeregister) Marshal(b []byte) ([]byte, error) {
252 var buf *codec.Buffer
254 buf = codec.NewBuffer(make([]byte, m.Size()))
256 buf = codec.NewBuffer(b)
258 buf.EncodeUint32(uint32(m.Punt.Type))
259 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0)
260 return buf.Bytes(), nil
262 func (m *PuntSocketDeregister) Unmarshal(b []byte) error {
263 buf := codec.NewBuffer(b)
264 m.Punt.Type = PuntType(buf.DecodeUint32())
265 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(4))
269 // PuntSocketDeregisterReply defines message 'punt_socket_deregister_reply'.
270 type PuntSocketDeregisterReply struct {
271 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
274 func (m *PuntSocketDeregisterReply) Reset() { *m = PuntSocketDeregisterReply{} }
275 func (*PuntSocketDeregisterReply) GetMessageName() string { return "punt_socket_deregister_reply" }
276 func (*PuntSocketDeregisterReply) GetCrcString() string { return "e8d4e804" }
277 func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType {
278 return api.ReplyMessage
281 func (m *PuntSocketDeregisterReply) Size() int {
286 size += 4 // m.Retval
289 func (m *PuntSocketDeregisterReply) Marshal(b []byte) ([]byte, error) {
290 var buf *codec.Buffer
292 buf = codec.NewBuffer(make([]byte, m.Size()))
294 buf = codec.NewBuffer(b)
296 buf.EncodeUint32(uint32(m.Retval))
297 return buf.Bytes(), nil
299 func (m *PuntSocketDeregisterReply) Unmarshal(b []byte) error {
300 buf := codec.NewBuffer(b)
301 m.Retval = int32(buf.DecodeUint32())
305 // PuntSocketDetails defines message 'punt_socket_details'.
306 type PuntSocketDetails struct {
307 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
308 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
311 func (m *PuntSocketDetails) Reset() { *m = PuntSocketDetails{} }
312 func (*PuntSocketDetails) GetMessageName() string { return "punt_socket_details" }
313 func (*PuntSocketDetails) GetCrcString() string { return "1de0ce75" }
314 func (*PuntSocketDetails) GetMessageType() api.MessageType {
315 return api.ReplyMessage
318 func (m *PuntSocketDetails) Size() int {
323 size += 4 // m.Punt.Type
324 size += 1 * 4 // m.Punt.Punt
325 size += 108 // m.Pathname
328 func (m *PuntSocketDetails) Marshal(b []byte) ([]byte, error) {
329 var buf *codec.Buffer
331 buf = codec.NewBuffer(make([]byte, m.Size()))
333 buf = codec.NewBuffer(b)
335 buf.EncodeUint32(uint32(m.Punt.Type))
336 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0)
337 buf.EncodeString(m.Pathname, 108)
338 return buf.Bytes(), nil
340 func (m *PuntSocketDetails) Unmarshal(b []byte) error {
341 buf := codec.NewBuffer(b)
342 m.Punt.Type = PuntType(buf.DecodeUint32())
343 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(4))
344 m.Pathname = buf.DecodeString(108)
348 // PuntSocketDump defines message 'punt_socket_dump'.
349 type PuntSocketDump struct {
350 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
353 func (m *PuntSocketDump) Reset() { *m = PuntSocketDump{} }
354 func (*PuntSocketDump) GetMessageName() string { return "punt_socket_dump" }
355 func (*PuntSocketDump) GetCrcString() string { return "52974935" }
356 func (*PuntSocketDump) GetMessageType() api.MessageType {
357 return api.RequestMessage
360 func (m *PuntSocketDump) Size() int {
368 func (m *PuntSocketDump) Marshal(b []byte) ([]byte, error) {
369 var buf *codec.Buffer
371 buf = codec.NewBuffer(make([]byte, m.Size()))
373 buf = codec.NewBuffer(b)
375 buf.EncodeUint32(uint32(m.Type))
376 return buf.Bytes(), nil
378 func (m *PuntSocketDump) Unmarshal(b []byte) error {
379 buf := codec.NewBuffer(b)
380 m.Type = PuntType(buf.DecodeUint32())
384 // PuntSocketRegister defines message 'punt_socket_register'.
385 type PuntSocketRegister struct {
386 HeaderVersion uint32 `binapi:"u32,name=header_version" json:"header_version,omitempty"`
387 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
388 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
391 func (m *PuntSocketRegister) Reset() { *m = PuntSocketRegister{} }
392 func (*PuntSocketRegister) GetMessageName() string { return "punt_socket_register" }
393 func (*PuntSocketRegister) GetCrcString() string { return "c8cd10fa" }
394 func (*PuntSocketRegister) GetMessageType() api.MessageType {
395 return api.RequestMessage
398 func (m *PuntSocketRegister) Size() int {
403 size += 4 // m.HeaderVersion
404 size += 4 // m.Punt.Type
405 size += 1 * 4 // m.Punt.Punt
406 size += 108 // m.Pathname
409 func (m *PuntSocketRegister) Marshal(b []byte) ([]byte, error) {
410 var buf *codec.Buffer
412 buf = codec.NewBuffer(make([]byte, m.Size()))
414 buf = codec.NewBuffer(b)
416 buf.EncodeUint32(uint32(m.HeaderVersion))
417 buf.EncodeUint32(uint32(m.Punt.Type))
418 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0)
419 buf.EncodeString(m.Pathname, 108)
420 return buf.Bytes(), nil
422 func (m *PuntSocketRegister) Unmarshal(b []byte) error {
423 buf := codec.NewBuffer(b)
424 m.HeaderVersion = buf.DecodeUint32()
425 m.Punt.Type = PuntType(buf.DecodeUint32())
426 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(4))
427 m.Pathname = buf.DecodeString(108)
431 // PuntSocketRegisterReply defines message 'punt_socket_register_reply'.
432 type PuntSocketRegisterReply struct {
433 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
434 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
437 func (m *PuntSocketRegisterReply) Reset() { *m = PuntSocketRegisterReply{} }
438 func (*PuntSocketRegisterReply) GetMessageName() string { return "punt_socket_register_reply" }
439 func (*PuntSocketRegisterReply) GetCrcString() string { return "bd30ae90" }
440 func (*PuntSocketRegisterReply) GetMessageType() api.MessageType {
441 return api.ReplyMessage
444 func (m *PuntSocketRegisterReply) Size() int {
449 size += 4 // m.Retval
450 size += 108 // m.Pathname
453 func (m *PuntSocketRegisterReply) Marshal(b []byte) ([]byte, error) {
454 var buf *codec.Buffer
456 buf = codec.NewBuffer(make([]byte, m.Size()))
458 buf = codec.NewBuffer(b)
460 buf.EncodeUint32(uint32(m.Retval))
461 buf.EncodeString(m.Pathname, 108)
462 return buf.Bytes(), nil
464 func (m *PuntSocketRegisterReply) Unmarshal(b []byte) error {
465 buf := codec.NewBuffer(b)
466 m.Retval = int32(buf.DecodeUint32())
467 m.Pathname = buf.DecodeString(108)
471 // SetPunt defines message 'set_punt'.
472 type SetPunt struct {
473 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
474 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
477 func (m *SetPunt) Reset() { *m = SetPunt{} }
478 func (*SetPunt) GetMessageName() string { return "set_punt" }
479 func (*SetPunt) GetCrcString() string { return "83799618" }
480 func (*SetPunt) GetMessageType() api.MessageType {
481 return api.RequestMessage
484 func (m *SetPunt) Size() int {
490 size += 4 // m.Punt.Type
491 size += 1 * 4 // m.Punt.Punt
494 func (m *SetPunt) Marshal(b []byte) ([]byte, error) {
495 var buf *codec.Buffer
497 buf = codec.NewBuffer(make([]byte, m.Size()))
499 buf = codec.NewBuffer(b)
501 buf.EncodeBool(m.IsAdd)
502 buf.EncodeUint32(uint32(m.Punt.Type))
503 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 0)
504 return buf.Bytes(), nil
506 func (m *SetPunt) Unmarshal(b []byte) error {
507 buf := codec.NewBuffer(b)
508 m.IsAdd = buf.DecodeBool()
509 m.Punt.Type = PuntType(buf.DecodeUint32())
510 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(4))
514 // SetPuntReply defines message 'set_punt_reply'.
515 type SetPuntReply struct {
516 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
519 func (m *SetPuntReply) Reset() { *m = SetPuntReply{} }
520 func (*SetPuntReply) GetMessageName() string { return "set_punt_reply" }
521 func (*SetPuntReply) GetCrcString() string { return "e8d4e804" }
522 func (*SetPuntReply) GetMessageType() api.MessageType {
523 return api.ReplyMessage
526 func (m *SetPuntReply) Size() int {
531 size += 4 // m.Retval
534 func (m *SetPuntReply) Marshal(b []byte) ([]byte, error) {
535 var buf *codec.Buffer
537 buf = codec.NewBuffer(make([]byte, m.Size()))
539 buf = codec.NewBuffer(b)
541 buf.EncodeUint32(uint32(m.Retval))
542 return buf.Bytes(), nil
544 func (m *SetPuntReply) Unmarshal(b []byte) error {
545 buf := codec.NewBuffer(b)
546 m.Retval = int32(buf.DecodeUint32())
550 func init() { file_punt_binapi_init() }
551 func file_punt_binapi_init() {
552 api.RegisterMessage((*PuntReasonDetails)(nil), "punt_reason_details_2c9d4a40")
553 api.RegisterMessage((*PuntReasonDump)(nil), "punt_reason_dump_5c0dd4fe")
554 api.RegisterMessage((*PuntSocketDeregister)(nil), "punt_socket_deregister_98a444f4")
555 api.RegisterMessage((*PuntSocketDeregisterReply)(nil), "punt_socket_deregister_reply_e8d4e804")
556 api.RegisterMessage((*PuntSocketDetails)(nil), "punt_socket_details_1de0ce75")
557 api.RegisterMessage((*PuntSocketDump)(nil), "punt_socket_dump_52974935")
558 api.RegisterMessage((*PuntSocketRegister)(nil), "punt_socket_register_c8cd10fa")
559 api.RegisterMessage((*PuntSocketRegisterReply)(nil), "punt_socket_register_reply_bd30ae90")
560 api.RegisterMessage((*SetPunt)(nil), "set_punt_83799618")
561 api.RegisterMessage((*SetPuntReply)(nil), "set_punt_reply_e8d4e804")
564 // Messages returns list of all messages in this module.
565 func AllMessages() []api.Message {
566 return []api.Message{
567 (*PuntReasonDetails)(nil),
568 (*PuntReasonDump)(nil),
569 (*PuntSocketDeregister)(nil),
570 (*PuntSocketDeregisterReply)(nil),
571 (*PuntSocketDetails)(nil),
572 (*PuntSocketDump)(nil),
573 (*PuntSocketRegister)(nil),
574 (*PuntSocketRegisterReply)(nil),
576 (*SetPuntReply)(nil),