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.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_types"
19 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x9aa0ebc0
35 // SessionRuleScope defines enum 'session_rule_scope'.
36 type SessionRuleScope uint32
39 SESSION_RULE_SCOPE_API_GLOBAL SessionRuleScope = 0
40 SESSION_RULE_SCOPE_API_LOCAL SessionRuleScope = 1
41 SESSION_RULE_SCOPE_API_BOTH SessionRuleScope = 2
45 SessionRuleScope_name = map[uint32]string{
46 0: "SESSION_RULE_SCOPE_API_GLOBAL",
47 1: "SESSION_RULE_SCOPE_API_LOCAL",
48 2: "SESSION_RULE_SCOPE_API_BOTH",
50 SessionRuleScope_value = map[string]uint32{
51 "SESSION_RULE_SCOPE_API_GLOBAL": 0,
52 "SESSION_RULE_SCOPE_API_LOCAL": 1,
53 "SESSION_RULE_SCOPE_API_BOTH": 2,
57 func (x SessionRuleScope) String() string {
58 s, ok := SessionRuleScope_name[uint32(x)]
62 return "SessionRuleScope(" + strconv.Itoa(int(x)) + ")"
65 // TransportProto defines enum 'transport_proto'.
66 type TransportProto uint8
69 TRANSPORT_PROTO_API_TCP TransportProto = 1
70 TRANSPORT_PROTO_API_UDP TransportProto = 2
71 TRANSPORT_PROTO_API_NONE TransportProto = 3
72 TRANSPORT_PROTO_API_TLS TransportProto = 4
73 TRANSPORT_PROTO_API_QUIC TransportProto = 5
77 TransportProto_name = map[uint8]string{
78 1: "TRANSPORT_PROTO_API_TCP",
79 2: "TRANSPORT_PROTO_API_UDP",
80 3: "TRANSPORT_PROTO_API_NONE",
81 4: "TRANSPORT_PROTO_API_TLS",
82 5: "TRANSPORT_PROTO_API_QUIC",
84 TransportProto_value = map[string]uint8{
85 "TRANSPORT_PROTO_API_TCP": 1,
86 "TRANSPORT_PROTO_API_UDP": 2,
87 "TRANSPORT_PROTO_API_NONE": 3,
88 "TRANSPORT_PROTO_API_TLS": 4,
89 "TRANSPORT_PROTO_API_QUIC": 5,
93 func (x TransportProto) String() string {
94 s, ok := TransportProto_name[uint8(x)]
98 return "TransportProto(" + strconv.Itoa(int(x)) + ")"
101 // AppAddCertKeyPair defines message 'app_add_cert_key_pair'.
102 type AppAddCertKeyPair struct {
103 CertLen uint16 `binapi:"u16,name=cert_len" json:"cert_len,omitempty"`
104 CertkeyLen uint16 `binapi:"u16,name=certkey_len" json:"-"`
105 Certkey []byte `binapi:"u8[certkey_len],name=certkey" json:"certkey,omitempty"`
108 func (m *AppAddCertKeyPair) Reset() { *m = AppAddCertKeyPair{} }
109 func (*AppAddCertKeyPair) GetMessageName() string { return "app_add_cert_key_pair" }
110 func (*AppAddCertKeyPair) GetCrcString() string { return "02eb8016" }
111 func (*AppAddCertKeyPair) GetMessageType() api.MessageType {
112 return api.RequestMessage
115 func (m *AppAddCertKeyPair) 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) {
126 var buf *codec.Buffer
128 buf = codec.NewBuffer(make([]byte, m.Size()))
130 buf = codec.NewBuffer(b)
132 buf.EncodeUint16(uint16(m.CertLen))
133 buf.EncodeUint16(uint16(len(m.Certkey)))
134 buf.EncodeBytes(m.Certkey[:], 0)
135 return buf.Bytes(), nil
137 func (m *AppAddCertKeyPair) Unmarshal(b []byte) error {
138 buf := codec.NewBuffer(b)
139 m.CertLen = buf.DecodeUint16()
140 m.CertkeyLen = buf.DecodeUint16()
141 copy(m.Certkey[:], buf.DecodeBytes(0))
145 // AppAddCertKeyPairReply defines message 'app_add_cert_key_pair_reply'.
146 type AppAddCertKeyPairReply struct {
147 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
148 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
151 func (m *AppAddCertKeyPairReply) Reset() { *m = AppAddCertKeyPairReply{} }
152 func (*AppAddCertKeyPairReply) GetMessageName() string { return "app_add_cert_key_pair_reply" }
153 func (*AppAddCertKeyPairReply) GetCrcString() string { return "b42958d0" }
154 func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType {
155 return api.ReplyMessage
158 func (m *AppAddCertKeyPairReply) Size() int {
163 size += 4 // m.Retval
167 func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
168 var buf *codec.Buffer
170 buf = codec.NewBuffer(make([]byte, m.Size()))
172 buf = codec.NewBuffer(b)
174 buf.EncodeUint32(uint32(m.Retval))
175 buf.EncodeUint32(uint32(m.Index))
176 return buf.Bytes(), nil
178 func (m *AppAddCertKeyPairReply) Unmarshal(b []byte) error {
179 buf := codec.NewBuffer(b)
180 m.Retval = int32(buf.DecodeUint32())
181 m.Index = buf.DecodeUint32()
185 // AppAttach defines message 'app_attach'.
186 type AppAttach struct {
187 Options []uint64 `binapi:"u64[18],name=options" json:"options,omitempty"`
188 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
191 func (m *AppAttach) Reset() { *m = AppAttach{} }
192 func (*AppAttach) GetMessageName() string { return "app_attach" }
193 func (*AppAttach) GetCrcString() string { return "5f4a260d" }
194 func (*AppAttach) GetMessageType() api.MessageType {
195 return api.RequestMessage
198 func (m *AppAttach) Size() int {
203 size += 8 * 18 // m.Options
204 size += 4 + len(m.NamespaceID) // m.NamespaceID
207 func (m *AppAttach) Marshal(b []byte) ([]byte, error) {
208 var buf *codec.Buffer
210 buf = codec.NewBuffer(make([]byte, m.Size()))
212 buf = codec.NewBuffer(b)
214 for i := 0; i < 18; i++ {
216 if i < len(m.Options) {
217 x = uint64(m.Options[i])
219 buf.EncodeUint64(uint64(x))
221 buf.EncodeString(m.NamespaceID, 0)
222 return buf.Bytes(), nil
224 func (m *AppAttach) Unmarshal(b []byte) error {
225 buf := codec.NewBuffer(b)
226 m.Options = make([]uint64, 18)
227 for i := 0; i < len(m.Options); i++ {
228 m.Options[i] = buf.DecodeUint64()
230 m.NamespaceID = buf.DecodeString(0)
234 // AppAttachReply defines message 'app_attach_reply'.
235 type AppAttachReply struct {
236 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
237 AppMq uint64 `binapi:"u64,name=app_mq" json:"app_mq,omitempty"`
238 VppCtrlMq uint64 `binapi:"u64,name=vpp_ctrl_mq" json:"vpp_ctrl_mq,omitempty"`
239 VppCtrlMqThread uint8 `binapi:"u8,name=vpp_ctrl_mq_thread" json:"vpp_ctrl_mq_thread,omitempty"`
240 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
241 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
242 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
243 SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
244 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
245 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
248 func (m *AppAttachReply) Reset() { *m = AppAttachReply{} }
249 func (*AppAttachReply) GetMessageName() string { return "app_attach_reply" }
250 func (*AppAttachReply) GetCrcString() string { return "5c89c3b0" }
251 func (*AppAttachReply) GetMessageType() api.MessageType {
252 return api.ReplyMessage
255 func (m *AppAttachReply) Size() int {
260 size += 4 // m.Retval
262 size += 8 // m.VppCtrlMq
263 size += 1 // m.VppCtrlMqThread
264 size += 4 // m.AppIndex
266 size += 1 // m.FdFlags
267 size += 4 // m.SegmentSize
268 size += 8 // m.SegmentHandle
269 size += 4 + len(m.SegmentName) // m.SegmentName
272 func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) {
273 var buf *codec.Buffer
275 buf = codec.NewBuffer(make([]byte, m.Size()))
277 buf = codec.NewBuffer(b)
279 buf.EncodeUint32(uint32(m.Retval))
280 buf.EncodeUint64(uint64(m.AppMq))
281 buf.EncodeUint64(uint64(m.VppCtrlMq))
282 buf.EncodeUint8(uint8(m.VppCtrlMqThread))
283 buf.EncodeUint32(uint32(m.AppIndex))
284 buf.EncodeUint8(uint8(m.NFds))
285 buf.EncodeUint8(uint8(m.FdFlags))
286 buf.EncodeUint32(uint32(m.SegmentSize))
287 buf.EncodeUint64(uint64(m.SegmentHandle))
288 buf.EncodeString(m.SegmentName, 0)
289 return buf.Bytes(), nil
291 func (m *AppAttachReply) Unmarshal(b []byte) error {
292 buf := codec.NewBuffer(b)
293 m.Retval = int32(buf.DecodeUint32())
294 m.AppMq = buf.DecodeUint64()
295 m.VppCtrlMq = buf.DecodeUint64()
296 m.VppCtrlMqThread = buf.DecodeUint8()
297 m.AppIndex = buf.DecodeUint32()
298 m.NFds = buf.DecodeUint8()
299 m.FdFlags = buf.DecodeUint8()
300 m.SegmentSize = buf.DecodeUint32()
301 m.SegmentHandle = buf.DecodeUint64()
302 m.SegmentName = buf.DecodeString(0)
306 // AppDelCertKeyPair defines message 'app_del_cert_key_pair'.
307 type AppDelCertKeyPair struct {
308 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
311 func (m *AppDelCertKeyPair) Reset() { *m = AppDelCertKeyPair{} }
312 func (*AppDelCertKeyPair) GetMessageName() string { return "app_del_cert_key_pair" }
313 func (*AppDelCertKeyPair) GetCrcString() string { return "8ac76db6" }
314 func (*AppDelCertKeyPair) GetMessageType() api.MessageType {
315 return api.RequestMessage
318 func (m *AppDelCertKeyPair) Size() int {
326 func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) {
327 var buf *codec.Buffer
329 buf = codec.NewBuffer(make([]byte, m.Size()))
331 buf = codec.NewBuffer(b)
333 buf.EncodeUint32(uint32(m.Index))
334 return buf.Bytes(), nil
336 func (m *AppDelCertKeyPair) Unmarshal(b []byte) error {
337 buf := codec.NewBuffer(b)
338 m.Index = buf.DecodeUint32()
342 // AppDelCertKeyPairReply defines message 'app_del_cert_key_pair_reply'.
343 type AppDelCertKeyPairReply struct {
344 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
347 func (m *AppDelCertKeyPairReply) Reset() { *m = AppDelCertKeyPairReply{} }
348 func (*AppDelCertKeyPairReply) GetMessageName() string { return "app_del_cert_key_pair_reply" }
349 func (*AppDelCertKeyPairReply) GetCrcString() string { return "e8d4e804" }
350 func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType {
351 return api.ReplyMessage
354 func (m *AppDelCertKeyPairReply) Size() int {
359 size += 4 // m.Retval
362 func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
363 var buf *codec.Buffer
365 buf = codec.NewBuffer(make([]byte, m.Size()))
367 buf = codec.NewBuffer(b)
369 buf.EncodeUint32(uint32(m.Retval))
370 return buf.Bytes(), nil
372 func (m *AppDelCertKeyPairReply) Unmarshal(b []byte) error {
373 buf := codec.NewBuffer(b)
374 m.Retval = int32(buf.DecodeUint32())
378 // AppNamespaceAddDel defines message 'app_namespace_add_del'.
379 type AppNamespaceAddDel struct {
380 Secret uint64 `binapi:"u64,name=secret" json:"secret,omitempty"`
381 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
382 IP4FibID uint32 `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
383 IP6FibID uint32 `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
384 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
387 func (m *AppNamespaceAddDel) Reset() { *m = AppNamespaceAddDel{} }
388 func (*AppNamespaceAddDel) GetMessageName() string { return "app_namespace_add_del" }
389 func (*AppNamespaceAddDel) GetCrcString() string { return "6306aecb" }
390 func (*AppNamespaceAddDel) GetMessageType() api.MessageType {
391 return api.RequestMessage
394 func (m *AppNamespaceAddDel) Size() int {
399 size += 8 // m.Secret
400 size += 4 // m.SwIfIndex
401 size += 4 // m.IP4FibID
402 size += 4 // m.IP6FibID
403 size += 4 + len(m.NamespaceID) // m.NamespaceID
406 func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) {
407 var buf *codec.Buffer
409 buf = codec.NewBuffer(make([]byte, m.Size()))
411 buf = codec.NewBuffer(b)
413 buf.EncodeUint64(uint64(m.Secret))
414 buf.EncodeUint32(uint32(m.SwIfIndex))
415 buf.EncodeUint32(uint32(m.IP4FibID))
416 buf.EncodeUint32(uint32(m.IP6FibID))
417 buf.EncodeString(m.NamespaceID, 0)
418 return buf.Bytes(), nil
420 func (m *AppNamespaceAddDel) Unmarshal(b []byte) error {
421 buf := codec.NewBuffer(b)
422 m.Secret = buf.DecodeUint64()
423 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
424 m.IP4FibID = buf.DecodeUint32()
425 m.IP6FibID = buf.DecodeUint32()
426 m.NamespaceID = buf.DecodeString(0)
430 // AppNamespaceAddDelReply defines message 'app_namespace_add_del_reply'.
431 type AppNamespaceAddDelReply struct {
432 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
433 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
436 func (m *AppNamespaceAddDelReply) Reset() { *m = AppNamespaceAddDelReply{} }
437 func (*AppNamespaceAddDelReply) GetMessageName() string { return "app_namespace_add_del_reply" }
438 func (*AppNamespaceAddDelReply) GetCrcString() string { return "85137120" }
439 func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType {
440 return api.ReplyMessage
443 func (m *AppNamespaceAddDelReply) Size() int {
448 size += 4 // m.Retval
449 size += 4 // m.AppnsIndex
452 func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) {
453 var buf *codec.Buffer
455 buf = codec.NewBuffer(make([]byte, m.Size()))
457 buf = codec.NewBuffer(b)
459 buf.EncodeUint32(uint32(m.Retval))
460 buf.EncodeUint32(uint32(m.AppnsIndex))
461 return buf.Bytes(), nil
463 func (m *AppNamespaceAddDelReply) Unmarshal(b []byte) error {
464 buf := codec.NewBuffer(b)
465 m.Retval = int32(buf.DecodeUint32())
466 m.AppnsIndex = buf.DecodeUint32()
470 // AppWorkerAddDel defines message 'app_worker_add_del'.
471 type AppWorkerAddDel struct {
472 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
473 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
474 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
477 func (m *AppWorkerAddDel) Reset() { *m = AppWorkerAddDel{} }
478 func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" }
479 func (*AppWorkerAddDel) GetCrcString() string { return "753253dc" }
480 func (*AppWorkerAddDel) GetMessageType() api.MessageType {
481 return api.RequestMessage
484 func (m *AppWorkerAddDel) Size() int {
489 size += 4 // m.AppIndex
490 size += 4 // m.WrkIndex
494 func (m *AppWorkerAddDel) 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.EncodeUint32(uint32(m.AppIndex))
502 buf.EncodeUint32(uint32(m.WrkIndex))
503 buf.EncodeBool(m.IsAdd)
504 return buf.Bytes(), nil
506 func (m *AppWorkerAddDel) Unmarshal(b []byte) error {
507 buf := codec.NewBuffer(b)
508 m.AppIndex = buf.DecodeUint32()
509 m.WrkIndex = buf.DecodeUint32()
510 m.IsAdd = buf.DecodeBool()
514 // AppWorkerAddDelReply defines message 'app_worker_add_del_reply'.
515 type AppWorkerAddDelReply struct {
516 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
517 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
518 AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
519 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
520 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
521 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
522 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
523 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
526 func (m *AppWorkerAddDelReply) Reset() { *m = AppWorkerAddDelReply{} }
527 func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" }
528 func (*AppWorkerAddDelReply) GetCrcString() string { return "5735ffe7" }
529 func (*AppWorkerAddDelReply) GetMessageType() api.MessageType {
530 return api.ReplyMessage
533 func (m *AppWorkerAddDelReply) Size() int {
538 size += 4 // m.Retval
539 size += 4 // m.WrkIndex
540 size += 8 // m.AppEventQueueAddress
542 size += 1 // m.FdFlags
543 size += 8 // m.SegmentHandle
545 size += 4 + len(m.SegmentName) // m.SegmentName
548 func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) {
549 var buf *codec.Buffer
551 buf = codec.NewBuffer(make([]byte, m.Size()))
553 buf = codec.NewBuffer(b)
555 buf.EncodeUint32(uint32(m.Retval))
556 buf.EncodeUint32(uint32(m.WrkIndex))
557 buf.EncodeUint64(uint64(m.AppEventQueueAddress))
558 buf.EncodeUint8(uint8(m.NFds))
559 buf.EncodeUint8(uint8(m.FdFlags))
560 buf.EncodeUint64(uint64(m.SegmentHandle))
561 buf.EncodeBool(m.IsAdd)
562 buf.EncodeString(m.SegmentName, 0)
563 return buf.Bytes(), nil
565 func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error {
566 buf := codec.NewBuffer(b)
567 m.Retval = int32(buf.DecodeUint32())
568 m.WrkIndex = buf.DecodeUint32()
569 m.AppEventQueueAddress = buf.DecodeUint64()
570 m.NFds = buf.DecodeUint8()
571 m.FdFlags = buf.DecodeUint8()
572 m.SegmentHandle = buf.DecodeUint64()
573 m.IsAdd = buf.DecodeBool()
574 m.SegmentName = buf.DecodeString(0)
578 // ApplicationDetach defines message 'application_detach'.
579 type ApplicationDetach struct{}
581 func (m *ApplicationDetach) Reset() { *m = ApplicationDetach{} }
582 func (*ApplicationDetach) GetMessageName() string { return "application_detach" }
583 func (*ApplicationDetach) GetCrcString() string { return "51077d14" }
584 func (*ApplicationDetach) GetMessageType() api.MessageType {
585 return api.RequestMessage
588 func (m *ApplicationDetach) Size() int {
595 func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) {
596 var buf *codec.Buffer
598 buf = codec.NewBuffer(make([]byte, m.Size()))
600 buf = codec.NewBuffer(b)
602 return buf.Bytes(), nil
604 func (m *ApplicationDetach) Unmarshal(b []byte) error {
608 // ApplicationDetachReply defines message 'application_detach_reply'.
609 type ApplicationDetachReply struct {
610 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
613 func (m *ApplicationDetachReply) Reset() { *m = ApplicationDetachReply{} }
614 func (*ApplicationDetachReply) GetMessageName() string { return "application_detach_reply" }
615 func (*ApplicationDetachReply) GetCrcString() string { return "e8d4e804" }
616 func (*ApplicationDetachReply) GetMessageType() api.MessageType {
617 return api.ReplyMessage
620 func (m *ApplicationDetachReply) Size() int {
625 size += 4 // m.Retval
628 func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) {
629 var buf *codec.Buffer
631 buf = codec.NewBuffer(make([]byte, m.Size()))
633 buf = codec.NewBuffer(b)
635 buf.EncodeUint32(uint32(m.Retval))
636 return buf.Bytes(), nil
638 func (m *ApplicationDetachReply) Unmarshal(b []byte) error {
639 buf := codec.NewBuffer(b)
640 m.Retval = int32(buf.DecodeUint32())
644 // ApplicationTLSCertAdd defines message 'application_tls_cert_add'.
645 type ApplicationTLSCertAdd struct {
646 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
647 CertLen uint16 `binapi:"u16,name=cert_len" json:"-"`
648 Cert []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
651 func (m *ApplicationTLSCertAdd) Reset() { *m = ApplicationTLSCertAdd{} }
652 func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
653 func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" }
654 func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
655 return api.RequestMessage
658 func (m *ApplicationTLSCertAdd) Size() int {
663 size += 4 // m.AppIndex
664 size += 2 // m.CertLen
665 size += 1 * len(m.Cert) // m.Cert
668 func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) {
669 var buf *codec.Buffer
671 buf = codec.NewBuffer(make([]byte, m.Size()))
673 buf = codec.NewBuffer(b)
675 buf.EncodeUint32(uint32(m.AppIndex))
676 buf.EncodeUint16(uint16(len(m.Cert)))
677 buf.EncodeBytes(m.Cert[:], 0)
678 return buf.Bytes(), nil
680 func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error {
681 buf := codec.NewBuffer(b)
682 m.AppIndex = buf.DecodeUint32()
683 m.CertLen = buf.DecodeUint16()
684 copy(m.Cert[:], buf.DecodeBytes(0))
688 // ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
689 type ApplicationTLSCertAddReply struct {
690 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
693 func (m *ApplicationTLSCertAddReply) Reset() { *m = ApplicationTLSCertAddReply{} }
694 func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
695 func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" }
696 func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
697 return api.ReplyMessage
700 func (m *ApplicationTLSCertAddReply) Size() int {
705 size += 4 // m.Retval
708 func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
709 var buf *codec.Buffer
711 buf = codec.NewBuffer(make([]byte, m.Size()))
713 buf = codec.NewBuffer(b)
715 buf.EncodeUint32(uint32(m.Retval))
716 return buf.Bytes(), nil
718 func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error {
719 buf := codec.NewBuffer(b)
720 m.Retval = int32(buf.DecodeUint32())
724 // ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
725 type ApplicationTLSKeyAdd struct {
726 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
727 KeyLen uint16 `binapi:"u16,name=key_len" json:"-"`
728 Key []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
731 func (m *ApplicationTLSKeyAdd) Reset() { *m = ApplicationTLSKeyAdd{} }
732 func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
733 func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" }
734 func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
735 return api.RequestMessage
738 func (m *ApplicationTLSKeyAdd) Size() int {
743 size += 4 // m.AppIndex
744 size += 2 // m.KeyLen
745 size += 1 * len(m.Key) // m.Key
748 func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) {
749 var buf *codec.Buffer
751 buf = codec.NewBuffer(make([]byte, m.Size()))
753 buf = codec.NewBuffer(b)
755 buf.EncodeUint32(uint32(m.AppIndex))
756 buf.EncodeUint16(uint16(len(m.Key)))
757 buf.EncodeBytes(m.Key[:], 0)
758 return buf.Bytes(), nil
760 func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error {
761 buf := codec.NewBuffer(b)
762 m.AppIndex = buf.DecodeUint32()
763 m.KeyLen = buf.DecodeUint16()
764 copy(m.Key[:], buf.DecodeBytes(0))
768 // ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
769 type ApplicationTLSKeyAddReply struct {
770 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
773 func (m *ApplicationTLSKeyAddReply) Reset() { *m = ApplicationTLSKeyAddReply{} }
774 func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
775 func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" }
776 func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
777 return api.ReplyMessage
780 func (m *ApplicationTLSKeyAddReply) Size() int {
785 size += 4 // m.Retval
788 func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
789 var buf *codec.Buffer
791 buf = codec.NewBuffer(make([]byte, m.Size()))
793 buf = codec.NewBuffer(b)
795 buf.EncodeUint32(uint32(m.Retval))
796 return buf.Bytes(), nil
798 func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error {
799 buf := codec.NewBuffer(b)
800 m.Retval = int32(buf.DecodeUint32())
804 // SessionEnableDisable defines message 'session_enable_disable'.
805 type SessionEnableDisable struct {
806 IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
809 func (m *SessionEnableDisable) Reset() { *m = SessionEnableDisable{} }
810 func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
811 func (*SessionEnableDisable) GetCrcString() string { return "c264d7bf" }
812 func (*SessionEnableDisable) GetMessageType() api.MessageType {
813 return api.RequestMessage
816 func (m *SessionEnableDisable) Size() int {
821 size += 1 // m.IsEnable
824 func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
825 var buf *codec.Buffer
827 buf = codec.NewBuffer(make([]byte, m.Size()))
829 buf = codec.NewBuffer(b)
831 buf.EncodeBool(m.IsEnable)
832 return buf.Bytes(), nil
834 func (m *SessionEnableDisable) Unmarshal(b []byte) error {
835 buf := codec.NewBuffer(b)
836 m.IsEnable = buf.DecodeBool()
840 // SessionEnableDisableReply defines message 'session_enable_disable_reply'.
841 type SessionEnableDisableReply struct {
842 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
845 func (m *SessionEnableDisableReply) Reset() { *m = SessionEnableDisableReply{} }
846 func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
847 func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" }
848 func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
849 return api.ReplyMessage
852 func (m *SessionEnableDisableReply) Size() int {
857 size += 4 // m.Retval
860 func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
861 var buf *codec.Buffer
863 buf = codec.NewBuffer(make([]byte, m.Size()))
865 buf = codec.NewBuffer(b)
867 buf.EncodeUint32(uint32(m.Retval))
868 return buf.Bytes(), nil
870 func (m *SessionEnableDisableReply) Unmarshal(b []byte) error {
871 buf := codec.NewBuffer(b)
872 m.Retval = int32(buf.DecodeUint32())
876 // SessionRuleAddDel defines message 'session_rule_add_del'.
877 type SessionRuleAddDel struct {
878 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
879 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
880 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
881 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
882 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
883 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
884 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
885 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
886 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
887 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
890 func (m *SessionRuleAddDel) Reset() { *m = SessionRuleAddDel{} }
891 func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
892 func (*SessionRuleAddDel) GetCrcString() string { return "e31f9443" }
893 func (*SessionRuleAddDel) GetMessageType() api.MessageType {
894 return api.RequestMessage
897 func (m *SessionRuleAddDel) Size() int {
902 size += 1 // m.TransportProto
903 size += 1 // m.Lcl.Address.Af
904 size += 1 * 16 // m.Lcl.Address.Un
905 size += 1 // m.Lcl.Len
906 size += 1 // m.Rmt.Address.Af
907 size += 1 * 16 // m.Rmt.Address.Un
908 size += 1 // m.Rmt.Len
909 size += 2 // m.LclPort
910 size += 2 // m.RmtPort
911 size += 4 // m.ActionIndex
913 size += 4 // m.AppnsIndex
918 func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
919 var buf *codec.Buffer
921 buf = codec.NewBuffer(make([]byte, m.Size()))
923 buf = codec.NewBuffer(b)
925 buf.EncodeUint8(uint8(m.TransportProto))
926 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
927 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 0)
928 buf.EncodeUint8(uint8(m.Lcl.Len))
929 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
930 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 0)
931 buf.EncodeUint8(uint8(m.Rmt.Len))
932 buf.EncodeUint16(uint16(m.LclPort))
933 buf.EncodeUint16(uint16(m.RmtPort))
934 buf.EncodeUint32(uint32(m.ActionIndex))
935 buf.EncodeBool(m.IsAdd)
936 buf.EncodeUint32(uint32(m.AppnsIndex))
937 buf.EncodeUint32(uint32(m.Scope))
938 buf.EncodeString(m.Tag, 64)
939 return buf.Bytes(), nil
941 func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
942 buf := codec.NewBuffer(b)
943 m.TransportProto = TransportProto(buf.DecodeUint8())
944 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
945 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
946 m.Lcl.Len = buf.DecodeUint8()
947 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
948 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
949 m.Rmt.Len = buf.DecodeUint8()
950 m.LclPort = buf.DecodeUint16()
951 m.RmtPort = buf.DecodeUint16()
952 m.ActionIndex = buf.DecodeUint32()
953 m.IsAdd = buf.DecodeBool()
954 m.AppnsIndex = buf.DecodeUint32()
955 m.Scope = SessionRuleScope(buf.DecodeUint32())
956 m.Tag = buf.DecodeString(64)
960 // SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
961 type SessionRuleAddDelReply struct {
962 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
965 func (m *SessionRuleAddDelReply) Reset() { *m = SessionRuleAddDelReply{} }
966 func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
967 func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" }
968 func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
969 return api.ReplyMessage
972 func (m *SessionRuleAddDelReply) Size() int {
977 size += 4 // m.Retval
980 func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
981 var buf *codec.Buffer
983 buf = codec.NewBuffer(make([]byte, m.Size()))
985 buf = codec.NewBuffer(b)
987 buf.EncodeUint32(uint32(m.Retval))
988 return buf.Bytes(), nil
990 func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error {
991 buf := codec.NewBuffer(b)
992 m.Retval = int32(buf.DecodeUint32())
996 // SessionRulesDetails defines message 'session_rules_details'.
997 type SessionRulesDetails struct {
998 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
999 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
1000 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
1001 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
1002 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
1003 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
1004 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
1005 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
1006 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
1009 func (m *SessionRulesDetails) Reset() { *m = SessionRulesDetails{} }
1010 func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
1011 func (*SessionRulesDetails) GetCrcString() string { return "304b91f0" }
1012 func (*SessionRulesDetails) GetMessageType() api.MessageType {
1013 return api.ReplyMessage
1016 func (m *SessionRulesDetails) Size() int {
1021 size += 1 // m.TransportProto
1022 size += 1 // m.Lcl.Address.Af
1023 size += 1 * 16 // m.Lcl.Address.Un
1024 size += 1 // m.Lcl.Len
1025 size += 1 // m.Rmt.Address.Af
1026 size += 1 * 16 // m.Rmt.Address.Un
1027 size += 1 // m.Rmt.Len
1028 size += 2 // m.LclPort
1029 size += 2 // m.RmtPort
1030 size += 4 // m.ActionIndex
1031 size += 4 // m.AppnsIndex
1032 size += 4 // m.Scope
1036 func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
1037 var buf *codec.Buffer
1039 buf = codec.NewBuffer(make([]byte, m.Size()))
1041 buf = codec.NewBuffer(b)
1043 buf.EncodeUint8(uint8(m.TransportProto))
1044 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
1045 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 0)
1046 buf.EncodeUint8(uint8(m.Lcl.Len))
1047 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
1048 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 0)
1049 buf.EncodeUint8(uint8(m.Rmt.Len))
1050 buf.EncodeUint16(uint16(m.LclPort))
1051 buf.EncodeUint16(uint16(m.RmtPort))
1052 buf.EncodeUint32(uint32(m.ActionIndex))
1053 buf.EncodeUint32(uint32(m.AppnsIndex))
1054 buf.EncodeUint32(uint32(m.Scope))
1055 buf.EncodeString(m.Tag, 64)
1056 return buf.Bytes(), nil
1058 func (m *SessionRulesDetails) Unmarshal(b []byte) error {
1059 buf := codec.NewBuffer(b)
1060 m.TransportProto = TransportProto(buf.DecodeUint8())
1061 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1062 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1063 m.Lcl.Len = buf.DecodeUint8()
1064 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1065 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1066 m.Rmt.Len = buf.DecodeUint8()
1067 m.LclPort = buf.DecodeUint16()
1068 m.RmtPort = buf.DecodeUint16()
1069 m.ActionIndex = buf.DecodeUint32()
1070 m.AppnsIndex = buf.DecodeUint32()
1071 m.Scope = SessionRuleScope(buf.DecodeUint32())
1072 m.Tag = buf.DecodeString(64)
1076 // SessionRulesDump defines message 'session_rules_dump'.
1077 type SessionRulesDump struct{}
1079 func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} }
1080 func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
1081 func (*SessionRulesDump) GetCrcString() string { return "51077d14" }
1082 func (*SessionRulesDump) GetMessageType() api.MessageType {
1083 return api.RequestMessage
1086 func (m *SessionRulesDump) Size() int {
1093 func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
1094 var buf *codec.Buffer
1096 buf = codec.NewBuffer(make([]byte, m.Size()))
1098 buf = codec.NewBuffer(b)
1100 return buf.Bytes(), nil
1102 func (m *SessionRulesDump) Unmarshal(b []byte) error {
1106 func init() { file_session_binapi_init() }
1107 func file_session_binapi_init() {
1108 api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
1109 api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
1110 api.RegisterMessage((*AppAttach)(nil), "app_attach_5f4a260d")
1111 api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_5c89c3b0")
1112 api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
1113 api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
1114 api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_6306aecb")
1115 api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
1116 api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_753253dc")
1117 api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_5735ffe7")
1118 api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
1119 api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
1120 api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
1121 api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
1122 api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
1123 api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
1124 api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf")
1125 api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
1126 api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_e31f9443")
1127 api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
1128 api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_304b91f0")
1129 api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
1132 // Messages returns list of all messages in this module.
1133 func AllMessages() []api.Message {
1134 return []api.Message{
1135 (*AppAddCertKeyPair)(nil),
1136 (*AppAddCertKeyPairReply)(nil),
1138 (*AppAttachReply)(nil),
1139 (*AppDelCertKeyPair)(nil),
1140 (*AppDelCertKeyPairReply)(nil),
1141 (*AppNamespaceAddDel)(nil),
1142 (*AppNamespaceAddDelReply)(nil),
1143 (*AppWorkerAddDel)(nil),
1144 (*AppWorkerAddDelReply)(nil),
1145 (*ApplicationDetach)(nil),
1146 (*ApplicationDetachReply)(nil),
1147 (*ApplicationTLSCertAdd)(nil),
1148 (*ApplicationTLSCertAddReply)(nil),
1149 (*ApplicationTLSKeyAdd)(nil),
1150 (*ApplicationTLSKeyAddReply)(nil),
1151 (*SessionEnableDisable)(nil),
1152 (*SessionEnableDisableReply)(nil),
1153 (*SessionRuleAddDel)(nil),
1154 (*SessionRuleAddDelReply)(nil),
1155 (*SessionRulesDetails)(nil),
1156 (*SessionRulesDump)(nil),