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/session.api.json
7 // Package session contains generated bindings for API file session.api.
18 api "git.fd.io/govpp.git/api"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
20 ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 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 = 0x32fe1c77
36 // SessionRuleScope defines enum 'session_rule_scope'.
37 type SessionRuleScope uint32
40 SESSION_RULE_SCOPE_API_GLOBAL SessionRuleScope = 0
41 SESSION_RULE_SCOPE_API_LOCAL SessionRuleScope = 1
42 SESSION_RULE_SCOPE_API_BOTH SessionRuleScope = 2
46 SessionRuleScope_name = map[uint32]string{
47 0: "SESSION_RULE_SCOPE_API_GLOBAL",
48 1: "SESSION_RULE_SCOPE_API_LOCAL",
49 2: "SESSION_RULE_SCOPE_API_BOTH",
51 SessionRuleScope_value = map[string]uint32{
52 "SESSION_RULE_SCOPE_API_GLOBAL": 0,
53 "SESSION_RULE_SCOPE_API_LOCAL": 1,
54 "SESSION_RULE_SCOPE_API_BOTH": 2,
58 func (x SessionRuleScope) String() string {
59 s, ok := SessionRuleScope_name[uint32(x)]
63 return "SessionRuleScope(" + strconv.Itoa(int(x)) + ")"
66 // TransportProto defines enum 'transport_proto'.
67 type TransportProto uint8
70 TRANSPORT_PROTO_API_TCP TransportProto = 1
71 TRANSPORT_PROTO_API_UDP TransportProto = 2
72 TRANSPORT_PROTO_API_NONE TransportProto = 3
73 TRANSPORT_PROTO_API_TLS TransportProto = 4
74 TRANSPORT_PROTO_API_QUIC TransportProto = 5
78 TransportProto_name = map[uint8]string{
79 1: "TRANSPORT_PROTO_API_TCP",
80 2: "TRANSPORT_PROTO_API_UDP",
81 3: "TRANSPORT_PROTO_API_NONE",
82 4: "TRANSPORT_PROTO_API_TLS",
83 5: "TRANSPORT_PROTO_API_QUIC",
85 TransportProto_value = map[string]uint8{
86 "TRANSPORT_PROTO_API_TCP": 1,
87 "TRANSPORT_PROTO_API_UDP": 2,
88 "TRANSPORT_PROTO_API_NONE": 3,
89 "TRANSPORT_PROTO_API_TLS": 4,
90 "TRANSPORT_PROTO_API_QUIC": 5,
94 func (x TransportProto) String() string {
95 s, ok := TransportProto_name[uint8(x)]
99 return "TransportProto(" + strconv.Itoa(int(x)) + ")"
102 // AppAddCertKeyPair defines message 'app_add_cert_key_pair'.
103 type AppAddCertKeyPair struct {
104 CertLen uint16 `binapi:"u16,name=cert_len" json:"cert_len,omitempty"`
105 CertkeyLen uint16 `binapi:"u16,name=certkey_len" json:"-"`
106 Certkey []byte `binapi:"u8[certkey_len],name=certkey" json:"certkey,omitempty"`
109 func (m *AppAddCertKeyPair) Reset() { *m = AppAddCertKeyPair{} }
110 func (*AppAddCertKeyPair) GetMessageName() string { return "app_add_cert_key_pair" }
111 func (*AppAddCertKeyPair) GetCrcString() string { return "02eb8016" }
112 func (*AppAddCertKeyPair) GetMessageType() api.MessageType {
113 return api.RequestMessage
116 func (m *AppAddCertKeyPair) Size() (size int) {
120 size += 2 // m.CertLen
121 size += 2 // m.CertkeyLen
122 size += 1 * len(m.Certkey) // m.Certkey
125 func (m *AppAddCertKeyPair) Marshal(b []byte) ([]byte, error) {
127 b = make([]byte, m.Size())
129 buf := codec.NewBuffer(b)
130 buf.EncodeUint16(m.CertLen)
131 buf.EncodeUint16(uint16(len(m.Certkey)))
132 buf.EncodeBytes(m.Certkey, 0)
133 return buf.Bytes(), nil
135 func (m *AppAddCertKeyPair) Unmarshal(b []byte) error {
136 buf := codec.NewBuffer(b)
137 m.CertLen = buf.DecodeUint16()
138 m.CertkeyLen = buf.DecodeUint16()
139 m.Certkey = make([]byte, m.CertkeyLen)
140 copy(m.Certkey, buf.DecodeBytes(len(m.Certkey)))
144 // AppAddCertKeyPairReply defines message 'app_add_cert_key_pair_reply'.
145 type AppAddCertKeyPairReply struct {
146 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
147 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
150 func (m *AppAddCertKeyPairReply) Reset() { *m = AppAddCertKeyPairReply{} }
151 func (*AppAddCertKeyPairReply) GetMessageName() string { return "app_add_cert_key_pair_reply" }
152 func (*AppAddCertKeyPairReply) GetCrcString() string { return "b42958d0" }
153 func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType {
154 return api.ReplyMessage
157 func (m *AppAddCertKeyPairReply) Size() (size int) {
161 size += 4 // m.Retval
165 func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
167 b = make([]byte, m.Size())
169 buf := codec.NewBuffer(b)
170 buf.EncodeInt32(m.Retval)
171 buf.EncodeUint32(m.Index)
172 return buf.Bytes(), nil
174 func (m *AppAddCertKeyPairReply) Unmarshal(b []byte) error {
175 buf := codec.NewBuffer(b)
176 m.Retval = buf.DecodeInt32()
177 m.Index = buf.DecodeUint32()
181 // AppAttach defines message 'app_attach'.
182 type AppAttach struct {
183 Options []uint64 `binapi:"u64[18],name=options" json:"options,omitempty"`
184 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
187 func (m *AppAttach) Reset() { *m = AppAttach{} }
188 func (*AppAttach) GetMessageName() string { return "app_attach" }
189 func (*AppAttach) GetCrcString() string { return "5f4a260d" }
190 func (*AppAttach) GetMessageType() api.MessageType {
191 return api.RequestMessage
194 func (m *AppAttach) Size() (size int) {
198 size += 8 * 18 // m.Options
199 size += 4 + len(m.NamespaceID) // m.NamespaceID
202 func (m *AppAttach) Marshal(b []byte) ([]byte, error) {
204 b = make([]byte, m.Size())
206 buf := codec.NewBuffer(b)
207 for i := 0; i < 18; i++ {
209 if i < len(m.Options) {
210 x = uint64(m.Options[i])
214 buf.EncodeString(m.NamespaceID, 0)
215 return buf.Bytes(), nil
217 func (m *AppAttach) Unmarshal(b []byte) error {
218 buf := codec.NewBuffer(b)
219 m.Options = make([]uint64, 18)
220 for i := 0; i < len(m.Options); i++ {
221 m.Options[i] = buf.DecodeUint64()
223 m.NamespaceID = buf.DecodeString(0)
227 // AppAttachReply defines message 'app_attach_reply'.
228 type AppAttachReply struct {
229 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
230 AppMq uint64 `binapi:"u64,name=app_mq" json:"app_mq,omitempty"`
231 VppCtrlMq uint64 `binapi:"u64,name=vpp_ctrl_mq" json:"vpp_ctrl_mq,omitempty"`
232 VppCtrlMqThread uint8 `binapi:"u8,name=vpp_ctrl_mq_thread" json:"vpp_ctrl_mq_thread,omitempty"`
233 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
234 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
235 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
236 SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
237 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
238 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
241 func (m *AppAttachReply) Reset() { *m = AppAttachReply{} }
242 func (*AppAttachReply) GetMessageName() string { return "app_attach_reply" }
243 func (*AppAttachReply) GetCrcString() string { return "5c89c3b0" }
244 func (*AppAttachReply) GetMessageType() api.MessageType {
245 return api.ReplyMessage
248 func (m *AppAttachReply) Size() (size int) {
252 size += 4 // m.Retval
254 size += 8 // m.VppCtrlMq
255 size += 1 // m.VppCtrlMqThread
256 size += 4 // m.AppIndex
258 size += 1 // m.FdFlags
259 size += 4 // m.SegmentSize
260 size += 8 // m.SegmentHandle
261 size += 4 + len(m.SegmentName) // m.SegmentName
264 func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) {
266 b = make([]byte, m.Size())
268 buf := codec.NewBuffer(b)
269 buf.EncodeInt32(m.Retval)
270 buf.EncodeUint64(m.AppMq)
271 buf.EncodeUint64(m.VppCtrlMq)
272 buf.EncodeUint8(m.VppCtrlMqThread)
273 buf.EncodeUint32(m.AppIndex)
274 buf.EncodeUint8(m.NFds)
275 buf.EncodeUint8(m.FdFlags)
276 buf.EncodeUint32(m.SegmentSize)
277 buf.EncodeUint64(m.SegmentHandle)
278 buf.EncodeString(m.SegmentName, 0)
279 return buf.Bytes(), nil
281 func (m *AppAttachReply) Unmarshal(b []byte) error {
282 buf := codec.NewBuffer(b)
283 m.Retval = buf.DecodeInt32()
284 m.AppMq = buf.DecodeUint64()
285 m.VppCtrlMq = buf.DecodeUint64()
286 m.VppCtrlMqThread = buf.DecodeUint8()
287 m.AppIndex = buf.DecodeUint32()
288 m.NFds = buf.DecodeUint8()
289 m.FdFlags = buf.DecodeUint8()
290 m.SegmentSize = buf.DecodeUint32()
291 m.SegmentHandle = buf.DecodeUint64()
292 m.SegmentName = buf.DecodeString(0)
296 // AppDelCertKeyPair defines message 'app_del_cert_key_pair'.
297 type AppDelCertKeyPair struct {
298 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
301 func (m *AppDelCertKeyPair) Reset() { *m = AppDelCertKeyPair{} }
302 func (*AppDelCertKeyPair) GetMessageName() string { return "app_del_cert_key_pair" }
303 func (*AppDelCertKeyPair) GetCrcString() string { return "8ac76db6" }
304 func (*AppDelCertKeyPair) GetMessageType() api.MessageType {
305 return api.RequestMessage
308 func (m *AppDelCertKeyPair) Size() (size int) {
315 func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) {
317 b = make([]byte, m.Size())
319 buf := codec.NewBuffer(b)
320 buf.EncodeUint32(m.Index)
321 return buf.Bytes(), nil
323 func (m *AppDelCertKeyPair) Unmarshal(b []byte) error {
324 buf := codec.NewBuffer(b)
325 m.Index = buf.DecodeUint32()
329 // AppDelCertKeyPairReply defines message 'app_del_cert_key_pair_reply'.
330 type AppDelCertKeyPairReply struct {
331 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
334 func (m *AppDelCertKeyPairReply) Reset() { *m = AppDelCertKeyPairReply{} }
335 func (*AppDelCertKeyPairReply) GetMessageName() string { return "app_del_cert_key_pair_reply" }
336 func (*AppDelCertKeyPairReply) GetCrcString() string { return "e8d4e804" }
337 func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType {
338 return api.ReplyMessage
341 func (m *AppDelCertKeyPairReply) Size() (size int) {
345 size += 4 // m.Retval
348 func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
350 b = make([]byte, m.Size())
352 buf := codec.NewBuffer(b)
353 buf.EncodeInt32(m.Retval)
354 return buf.Bytes(), nil
356 func (m *AppDelCertKeyPairReply) Unmarshal(b []byte) error {
357 buf := codec.NewBuffer(b)
358 m.Retval = buf.DecodeInt32()
362 // AppNamespaceAddDel defines message 'app_namespace_add_del'.
363 type AppNamespaceAddDel struct {
364 Secret uint64 `binapi:"u64,name=secret" json:"secret,omitempty"`
365 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
366 IP4FibID uint32 `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
367 IP6FibID uint32 `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
368 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
371 func (m *AppNamespaceAddDel) Reset() { *m = AppNamespaceAddDel{} }
372 func (*AppNamespaceAddDel) GetMessageName() string { return "app_namespace_add_del" }
373 func (*AppNamespaceAddDel) GetCrcString() string { return "6306aecb" }
374 func (*AppNamespaceAddDel) GetMessageType() api.MessageType {
375 return api.RequestMessage
378 func (m *AppNamespaceAddDel) Size() (size int) {
382 size += 8 // m.Secret
383 size += 4 // m.SwIfIndex
384 size += 4 // m.IP4FibID
385 size += 4 // m.IP6FibID
386 size += 4 + len(m.NamespaceID) // m.NamespaceID
389 func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) {
391 b = make([]byte, m.Size())
393 buf := codec.NewBuffer(b)
394 buf.EncodeUint64(m.Secret)
395 buf.EncodeUint32(uint32(m.SwIfIndex))
396 buf.EncodeUint32(m.IP4FibID)
397 buf.EncodeUint32(m.IP6FibID)
398 buf.EncodeString(m.NamespaceID, 0)
399 return buf.Bytes(), nil
401 func (m *AppNamespaceAddDel) Unmarshal(b []byte) error {
402 buf := codec.NewBuffer(b)
403 m.Secret = buf.DecodeUint64()
404 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
405 m.IP4FibID = buf.DecodeUint32()
406 m.IP6FibID = buf.DecodeUint32()
407 m.NamespaceID = buf.DecodeString(0)
411 // AppNamespaceAddDelReply defines message 'app_namespace_add_del_reply'.
412 type AppNamespaceAddDelReply struct {
413 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
414 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
417 func (m *AppNamespaceAddDelReply) Reset() { *m = AppNamespaceAddDelReply{} }
418 func (*AppNamespaceAddDelReply) GetMessageName() string { return "app_namespace_add_del_reply" }
419 func (*AppNamespaceAddDelReply) GetCrcString() string { return "85137120" }
420 func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType {
421 return api.ReplyMessage
424 func (m *AppNamespaceAddDelReply) Size() (size int) {
428 size += 4 // m.Retval
429 size += 4 // m.AppnsIndex
432 func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) {
434 b = make([]byte, m.Size())
436 buf := codec.NewBuffer(b)
437 buf.EncodeInt32(m.Retval)
438 buf.EncodeUint32(m.AppnsIndex)
439 return buf.Bytes(), nil
441 func (m *AppNamespaceAddDelReply) Unmarshal(b []byte) error {
442 buf := codec.NewBuffer(b)
443 m.Retval = buf.DecodeInt32()
444 m.AppnsIndex = buf.DecodeUint32()
448 // AppWorkerAddDel defines message 'app_worker_add_del'.
449 type AppWorkerAddDel struct {
450 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
451 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
452 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
455 func (m *AppWorkerAddDel) Reset() { *m = AppWorkerAddDel{} }
456 func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" }
457 func (*AppWorkerAddDel) GetCrcString() string { return "753253dc" }
458 func (*AppWorkerAddDel) GetMessageType() api.MessageType {
459 return api.RequestMessage
462 func (m *AppWorkerAddDel) Size() (size int) {
466 size += 4 // m.AppIndex
467 size += 4 // m.WrkIndex
471 func (m *AppWorkerAddDel) Marshal(b []byte) ([]byte, error) {
473 b = make([]byte, m.Size())
475 buf := codec.NewBuffer(b)
476 buf.EncodeUint32(m.AppIndex)
477 buf.EncodeUint32(m.WrkIndex)
478 buf.EncodeBool(m.IsAdd)
479 return buf.Bytes(), nil
481 func (m *AppWorkerAddDel) Unmarshal(b []byte) error {
482 buf := codec.NewBuffer(b)
483 m.AppIndex = buf.DecodeUint32()
484 m.WrkIndex = buf.DecodeUint32()
485 m.IsAdd = buf.DecodeBool()
489 // AppWorkerAddDelReply defines message 'app_worker_add_del_reply'.
490 type AppWorkerAddDelReply struct {
491 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
492 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
493 AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
494 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
495 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
496 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
497 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
498 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
501 func (m *AppWorkerAddDelReply) Reset() { *m = AppWorkerAddDelReply{} }
502 func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" }
503 func (*AppWorkerAddDelReply) GetCrcString() string { return "5735ffe7" }
504 func (*AppWorkerAddDelReply) GetMessageType() api.MessageType {
505 return api.ReplyMessage
508 func (m *AppWorkerAddDelReply) Size() (size int) {
512 size += 4 // m.Retval
513 size += 4 // m.WrkIndex
514 size += 8 // m.AppEventQueueAddress
516 size += 1 // m.FdFlags
517 size += 8 // m.SegmentHandle
519 size += 4 + len(m.SegmentName) // m.SegmentName
522 func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) {
524 b = make([]byte, m.Size())
526 buf := codec.NewBuffer(b)
527 buf.EncodeInt32(m.Retval)
528 buf.EncodeUint32(m.WrkIndex)
529 buf.EncodeUint64(m.AppEventQueueAddress)
530 buf.EncodeUint8(m.NFds)
531 buf.EncodeUint8(m.FdFlags)
532 buf.EncodeUint64(m.SegmentHandle)
533 buf.EncodeBool(m.IsAdd)
534 buf.EncodeString(m.SegmentName, 0)
535 return buf.Bytes(), nil
537 func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error {
538 buf := codec.NewBuffer(b)
539 m.Retval = buf.DecodeInt32()
540 m.WrkIndex = buf.DecodeUint32()
541 m.AppEventQueueAddress = buf.DecodeUint64()
542 m.NFds = buf.DecodeUint8()
543 m.FdFlags = buf.DecodeUint8()
544 m.SegmentHandle = buf.DecodeUint64()
545 m.IsAdd = buf.DecodeBool()
546 m.SegmentName = buf.DecodeString(0)
550 // ApplicationDetach defines message 'application_detach'.
551 type ApplicationDetach struct{}
553 func (m *ApplicationDetach) Reset() { *m = ApplicationDetach{} }
554 func (*ApplicationDetach) GetMessageName() string { return "application_detach" }
555 func (*ApplicationDetach) GetCrcString() string { return "51077d14" }
556 func (*ApplicationDetach) GetMessageType() api.MessageType {
557 return api.RequestMessage
560 func (m *ApplicationDetach) Size() (size int) {
566 func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) {
568 b = make([]byte, m.Size())
570 buf := codec.NewBuffer(b)
571 return buf.Bytes(), nil
573 func (m *ApplicationDetach) Unmarshal(b []byte) error {
577 // ApplicationDetachReply defines message 'application_detach_reply'.
578 type ApplicationDetachReply struct {
579 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
582 func (m *ApplicationDetachReply) Reset() { *m = ApplicationDetachReply{} }
583 func (*ApplicationDetachReply) GetMessageName() string { return "application_detach_reply" }
584 func (*ApplicationDetachReply) GetCrcString() string { return "e8d4e804" }
585 func (*ApplicationDetachReply) GetMessageType() api.MessageType {
586 return api.ReplyMessage
589 func (m *ApplicationDetachReply) Size() (size int) {
593 size += 4 // m.Retval
596 func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) {
598 b = make([]byte, m.Size())
600 buf := codec.NewBuffer(b)
601 buf.EncodeInt32(m.Retval)
602 return buf.Bytes(), nil
604 func (m *ApplicationDetachReply) Unmarshal(b []byte) error {
605 buf := codec.NewBuffer(b)
606 m.Retval = buf.DecodeInt32()
610 // ApplicationTLSCertAdd defines message 'application_tls_cert_add'.
611 // Deprecated: to be removed post 21.06
612 type ApplicationTLSCertAdd struct {
613 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
614 CertLen uint16 `binapi:"u16,name=cert_len" json:"-"`
615 Cert []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
618 func (m *ApplicationTLSCertAdd) Reset() { *m = ApplicationTLSCertAdd{} }
619 func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
620 func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" }
621 func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
622 return api.RequestMessage
625 func (m *ApplicationTLSCertAdd) Size() (size int) {
629 size += 4 // m.AppIndex
630 size += 2 // m.CertLen
631 size += 1 * len(m.Cert) // m.Cert
634 func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) {
636 b = make([]byte, m.Size())
638 buf := codec.NewBuffer(b)
639 buf.EncodeUint32(m.AppIndex)
640 buf.EncodeUint16(uint16(len(m.Cert)))
641 buf.EncodeBytes(m.Cert, 0)
642 return buf.Bytes(), nil
644 func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error {
645 buf := codec.NewBuffer(b)
646 m.AppIndex = buf.DecodeUint32()
647 m.CertLen = buf.DecodeUint16()
648 m.Cert = make([]byte, m.CertLen)
649 copy(m.Cert, buf.DecodeBytes(len(m.Cert)))
653 // ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
654 // Deprecated: to be removed post 21.06
655 type ApplicationTLSCertAddReply struct {
656 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
659 func (m *ApplicationTLSCertAddReply) Reset() { *m = ApplicationTLSCertAddReply{} }
660 func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
661 func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" }
662 func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
663 return api.ReplyMessage
666 func (m *ApplicationTLSCertAddReply) Size() (size int) {
670 size += 4 // m.Retval
673 func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
675 b = make([]byte, m.Size())
677 buf := codec.NewBuffer(b)
678 buf.EncodeInt32(m.Retval)
679 return buf.Bytes(), nil
681 func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error {
682 buf := codec.NewBuffer(b)
683 m.Retval = buf.DecodeInt32()
687 // ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
688 // Deprecated: to be removed post 21.06
689 type ApplicationTLSKeyAdd struct {
690 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
691 KeyLen uint16 `binapi:"u16,name=key_len" json:"-"`
692 Key []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
695 func (m *ApplicationTLSKeyAdd) Reset() { *m = ApplicationTLSKeyAdd{} }
696 func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
697 func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" }
698 func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
699 return api.RequestMessage
702 func (m *ApplicationTLSKeyAdd) Size() (size int) {
706 size += 4 // m.AppIndex
707 size += 2 // m.KeyLen
708 size += 1 * len(m.Key) // m.Key
711 func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) {
713 b = make([]byte, m.Size())
715 buf := codec.NewBuffer(b)
716 buf.EncodeUint32(m.AppIndex)
717 buf.EncodeUint16(uint16(len(m.Key)))
718 buf.EncodeBytes(m.Key, 0)
719 return buf.Bytes(), nil
721 func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error {
722 buf := codec.NewBuffer(b)
723 m.AppIndex = buf.DecodeUint32()
724 m.KeyLen = buf.DecodeUint16()
725 m.Key = make([]byte, m.KeyLen)
726 copy(m.Key, buf.DecodeBytes(len(m.Key)))
730 // ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
731 // Deprecated: to be removed post 21.06
732 type ApplicationTLSKeyAddReply struct {
733 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
736 func (m *ApplicationTLSKeyAddReply) Reset() { *m = ApplicationTLSKeyAddReply{} }
737 func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
738 func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" }
739 func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
740 return api.ReplyMessage
743 func (m *ApplicationTLSKeyAddReply) Size() (size int) {
747 size += 4 // m.Retval
750 func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
752 b = make([]byte, m.Size())
754 buf := codec.NewBuffer(b)
755 buf.EncodeInt32(m.Retval)
756 return buf.Bytes(), nil
758 func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error {
759 buf := codec.NewBuffer(b)
760 m.Retval = buf.DecodeInt32()
764 // SessionEnableDisable defines message 'session_enable_disable'.
765 type SessionEnableDisable struct {
766 IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
769 func (m *SessionEnableDisable) Reset() { *m = SessionEnableDisable{} }
770 func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
771 func (*SessionEnableDisable) GetCrcString() string { return "c264d7bf" }
772 func (*SessionEnableDisable) GetMessageType() api.MessageType {
773 return api.RequestMessage
776 func (m *SessionEnableDisable) Size() (size int) {
780 size += 1 // m.IsEnable
783 func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
785 b = make([]byte, m.Size())
787 buf := codec.NewBuffer(b)
788 buf.EncodeBool(m.IsEnable)
789 return buf.Bytes(), nil
791 func (m *SessionEnableDisable) Unmarshal(b []byte) error {
792 buf := codec.NewBuffer(b)
793 m.IsEnable = buf.DecodeBool()
797 // SessionEnableDisableReply defines message 'session_enable_disable_reply'.
798 type SessionEnableDisableReply struct {
799 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
802 func (m *SessionEnableDisableReply) Reset() { *m = SessionEnableDisableReply{} }
803 func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
804 func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" }
805 func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
806 return api.ReplyMessage
809 func (m *SessionEnableDisableReply) Size() (size int) {
813 size += 4 // m.Retval
816 func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
818 b = make([]byte, m.Size())
820 buf := codec.NewBuffer(b)
821 buf.EncodeInt32(m.Retval)
822 return buf.Bytes(), nil
824 func (m *SessionEnableDisableReply) Unmarshal(b []byte) error {
825 buf := codec.NewBuffer(b)
826 m.Retval = buf.DecodeInt32()
830 // SessionRuleAddDel defines message 'session_rule_add_del'.
831 type SessionRuleAddDel struct {
832 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
833 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
834 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
835 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
836 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
837 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
838 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
839 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
840 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
841 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
844 func (m *SessionRuleAddDel) Reset() { *m = SessionRuleAddDel{} }
845 func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
846 func (*SessionRuleAddDel) GetCrcString() string { return "e4895422" }
847 func (*SessionRuleAddDel) GetMessageType() api.MessageType {
848 return api.RequestMessage
851 func (m *SessionRuleAddDel) Size() (size int) {
855 size += 1 // m.TransportProto
856 size += 1 // m.Lcl.Address.Af
857 size += 1 * 16 // m.Lcl.Address.Un
858 size += 1 // m.Lcl.Len
859 size += 1 // m.Rmt.Address.Af
860 size += 1 * 16 // m.Rmt.Address.Un
861 size += 1 // m.Rmt.Len
862 size += 2 // m.LclPort
863 size += 2 // m.RmtPort
864 size += 4 // m.ActionIndex
866 size += 4 // m.AppnsIndex
871 func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
873 b = make([]byte, m.Size())
875 buf := codec.NewBuffer(b)
876 buf.EncodeUint8(uint8(m.TransportProto))
877 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
878 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
879 buf.EncodeUint8(m.Lcl.Len)
880 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
881 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
882 buf.EncodeUint8(m.Rmt.Len)
883 buf.EncodeUint16(m.LclPort)
884 buf.EncodeUint16(m.RmtPort)
885 buf.EncodeUint32(m.ActionIndex)
886 buf.EncodeBool(m.IsAdd)
887 buf.EncodeUint32(m.AppnsIndex)
888 buf.EncodeUint32(uint32(m.Scope))
889 buf.EncodeString(m.Tag, 64)
890 return buf.Bytes(), nil
892 func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
893 buf := codec.NewBuffer(b)
894 m.TransportProto = TransportProto(buf.DecodeUint8())
895 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
896 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
897 m.Lcl.Len = buf.DecodeUint8()
898 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
899 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
900 m.Rmt.Len = buf.DecodeUint8()
901 m.LclPort = buf.DecodeUint16()
902 m.RmtPort = buf.DecodeUint16()
903 m.ActionIndex = buf.DecodeUint32()
904 m.IsAdd = buf.DecodeBool()
905 m.AppnsIndex = buf.DecodeUint32()
906 m.Scope = SessionRuleScope(buf.DecodeUint32())
907 m.Tag = buf.DecodeString(64)
911 // SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
912 type SessionRuleAddDelReply struct {
913 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
916 func (m *SessionRuleAddDelReply) Reset() { *m = SessionRuleAddDelReply{} }
917 func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
918 func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" }
919 func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
920 return api.ReplyMessage
923 func (m *SessionRuleAddDelReply) Size() (size int) {
927 size += 4 // m.Retval
930 func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
932 b = make([]byte, m.Size())
934 buf := codec.NewBuffer(b)
935 buf.EncodeInt32(m.Retval)
936 return buf.Bytes(), nil
938 func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error {
939 buf := codec.NewBuffer(b)
940 m.Retval = buf.DecodeInt32()
944 // SessionRulesDetails defines message 'session_rules_details'.
945 type SessionRulesDetails struct {
946 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
947 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
948 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
949 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
950 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
951 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
952 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
953 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
954 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
957 func (m *SessionRulesDetails) Reset() { *m = SessionRulesDetails{} }
958 func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
959 func (*SessionRulesDetails) GetCrcString() string { return "28d71830" }
960 func (*SessionRulesDetails) GetMessageType() api.MessageType {
961 return api.ReplyMessage
964 func (m *SessionRulesDetails) Size() (size int) {
968 size += 1 // m.TransportProto
969 size += 1 // m.Lcl.Address.Af
970 size += 1 * 16 // m.Lcl.Address.Un
971 size += 1 // m.Lcl.Len
972 size += 1 // m.Rmt.Address.Af
973 size += 1 * 16 // m.Rmt.Address.Un
974 size += 1 // m.Rmt.Len
975 size += 2 // m.LclPort
976 size += 2 // m.RmtPort
977 size += 4 // m.ActionIndex
978 size += 4 // m.AppnsIndex
983 func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
985 b = make([]byte, m.Size())
987 buf := codec.NewBuffer(b)
988 buf.EncodeUint8(uint8(m.TransportProto))
989 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
990 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
991 buf.EncodeUint8(m.Lcl.Len)
992 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
993 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
994 buf.EncodeUint8(m.Rmt.Len)
995 buf.EncodeUint16(m.LclPort)
996 buf.EncodeUint16(m.RmtPort)
997 buf.EncodeUint32(m.ActionIndex)
998 buf.EncodeUint32(m.AppnsIndex)
999 buf.EncodeUint32(uint32(m.Scope))
1000 buf.EncodeString(m.Tag, 64)
1001 return buf.Bytes(), nil
1003 func (m *SessionRulesDetails) Unmarshal(b []byte) error {
1004 buf := codec.NewBuffer(b)
1005 m.TransportProto = TransportProto(buf.DecodeUint8())
1006 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1007 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1008 m.Lcl.Len = buf.DecodeUint8()
1009 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1010 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1011 m.Rmt.Len = buf.DecodeUint8()
1012 m.LclPort = buf.DecodeUint16()
1013 m.RmtPort = buf.DecodeUint16()
1014 m.ActionIndex = buf.DecodeUint32()
1015 m.AppnsIndex = buf.DecodeUint32()
1016 m.Scope = SessionRuleScope(buf.DecodeUint32())
1017 m.Tag = buf.DecodeString(64)
1021 // SessionRulesDump defines message 'session_rules_dump'.
1022 type SessionRulesDump struct{}
1024 func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} }
1025 func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
1026 func (*SessionRulesDump) GetCrcString() string { return "51077d14" }
1027 func (*SessionRulesDump) GetMessageType() api.MessageType {
1028 return api.RequestMessage
1031 func (m *SessionRulesDump) Size() (size int) {
1037 func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
1039 b = make([]byte, m.Size())
1041 buf := codec.NewBuffer(b)
1042 return buf.Bytes(), nil
1044 func (m *SessionRulesDump) Unmarshal(b []byte) error {
1048 func init() { file_session_binapi_init() }
1049 func file_session_binapi_init() {
1050 api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
1051 api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
1052 api.RegisterMessage((*AppAttach)(nil), "app_attach_5f4a260d")
1053 api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_5c89c3b0")
1054 api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
1055 api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
1056 api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_6306aecb")
1057 api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
1058 api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_753253dc")
1059 api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_5735ffe7")
1060 api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
1061 api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
1062 api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
1063 api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
1064 api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
1065 api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
1066 api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf")
1067 api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
1068 api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_e4895422")
1069 api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
1070 api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_28d71830")
1071 api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
1074 // Messages returns list of all messages in this module.
1075 func AllMessages() []api.Message {
1076 return []api.Message{
1077 (*AppAddCertKeyPair)(nil),
1078 (*AppAddCertKeyPairReply)(nil),
1080 (*AppAttachReply)(nil),
1081 (*AppDelCertKeyPair)(nil),
1082 (*AppDelCertKeyPairReply)(nil),
1083 (*AppNamespaceAddDel)(nil),
1084 (*AppNamespaceAddDelReply)(nil),
1085 (*AppWorkerAddDel)(nil),
1086 (*AppWorkerAddDelReply)(nil),
1087 (*ApplicationDetach)(nil),
1088 (*ApplicationDetachReply)(nil),
1089 (*ApplicationTLSCertAdd)(nil),
1090 (*ApplicationTLSCertAddReply)(nil),
1091 (*ApplicationTLSKeyAdd)(nil),
1092 (*ApplicationTLSKeyAddReply)(nil),
1093 (*SessionEnableDisable)(nil),
1094 (*SessionEnableDisableReply)(nil),
1095 (*SessionRuleAddDel)(nil),
1096 (*SessionRuleAddDelReply)(nil),
1097 (*SessionRulesDetails)(nil),
1098 (*SessionRulesDump)(nil),