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() (size int) {
119 size += 2 // m.CertLen
120 size += 2 // m.CertkeyLen
121 size += 1 * len(m.Certkey) // m.Certkey
124 func (m *AppAddCertKeyPair) Marshal(b []byte) ([]byte, error) {
126 b = make([]byte, m.Size())
128 buf := codec.NewBuffer(b)
129 buf.EncodeUint16(m.CertLen)
130 buf.EncodeUint16(uint16(len(m.Certkey)))
131 buf.EncodeBytes(m.Certkey, 0)
132 return buf.Bytes(), nil
134 func (m *AppAddCertKeyPair) Unmarshal(b []byte) error {
135 buf := codec.NewBuffer(b)
136 m.CertLen = buf.DecodeUint16()
137 m.CertkeyLen = buf.DecodeUint16()
138 m.Certkey = make([]byte, m.CertkeyLen)
139 copy(m.Certkey, buf.DecodeBytes(len(m.Certkey)))
143 // AppAddCertKeyPairReply defines message 'app_add_cert_key_pair_reply'.
144 type AppAddCertKeyPairReply struct {
145 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
146 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
149 func (m *AppAddCertKeyPairReply) Reset() { *m = AppAddCertKeyPairReply{} }
150 func (*AppAddCertKeyPairReply) GetMessageName() string { return "app_add_cert_key_pair_reply" }
151 func (*AppAddCertKeyPairReply) GetCrcString() string { return "b42958d0" }
152 func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType {
153 return api.ReplyMessage
156 func (m *AppAddCertKeyPairReply) Size() (size int) {
160 size += 4 // m.Retval
164 func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
166 b = make([]byte, m.Size())
168 buf := codec.NewBuffer(b)
169 buf.EncodeInt32(m.Retval)
170 buf.EncodeUint32(m.Index)
171 return buf.Bytes(), nil
173 func (m *AppAddCertKeyPairReply) Unmarshal(b []byte) error {
174 buf := codec.NewBuffer(b)
175 m.Retval = buf.DecodeInt32()
176 m.Index = buf.DecodeUint32()
180 // AppAttach defines message 'app_attach'.
181 type AppAttach struct {
182 Options []uint64 `binapi:"u64[18],name=options" json:"options,omitempty"`
183 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
186 func (m *AppAttach) Reset() { *m = AppAttach{} }
187 func (*AppAttach) GetMessageName() string { return "app_attach" }
188 func (*AppAttach) GetCrcString() string { return "5f4a260d" }
189 func (*AppAttach) GetMessageType() api.MessageType {
190 return api.RequestMessage
193 func (m *AppAttach) Size() (size int) {
197 size += 8 * 18 // m.Options
198 size += 4 + len(m.NamespaceID) // m.NamespaceID
201 func (m *AppAttach) Marshal(b []byte) ([]byte, error) {
203 b = make([]byte, m.Size())
205 buf := codec.NewBuffer(b)
206 for i := 0; i < 18; i++ {
208 if i < len(m.Options) {
209 x = uint64(m.Options[i])
213 buf.EncodeString(m.NamespaceID, 0)
214 return buf.Bytes(), nil
216 func (m *AppAttach) Unmarshal(b []byte) error {
217 buf := codec.NewBuffer(b)
218 m.Options = make([]uint64, 18)
219 for i := 0; i < len(m.Options); i++ {
220 m.Options[i] = buf.DecodeUint64()
222 m.NamespaceID = buf.DecodeString(0)
226 // AppAttachReply defines message 'app_attach_reply'.
227 type AppAttachReply struct {
228 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
229 AppMq uint64 `binapi:"u64,name=app_mq" json:"app_mq,omitempty"`
230 VppCtrlMq uint64 `binapi:"u64,name=vpp_ctrl_mq" json:"vpp_ctrl_mq,omitempty"`
231 VppCtrlMqThread uint8 `binapi:"u8,name=vpp_ctrl_mq_thread" json:"vpp_ctrl_mq_thread,omitempty"`
232 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
233 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
234 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
235 SegmentSize uint32 `binapi:"u32,name=segment_size" json:"segment_size,omitempty"`
236 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
237 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
240 func (m *AppAttachReply) Reset() { *m = AppAttachReply{} }
241 func (*AppAttachReply) GetMessageName() string { return "app_attach_reply" }
242 func (*AppAttachReply) GetCrcString() string { return "5c89c3b0" }
243 func (*AppAttachReply) GetMessageType() api.MessageType {
244 return api.ReplyMessage
247 func (m *AppAttachReply) Size() (size int) {
251 size += 4 // m.Retval
253 size += 8 // m.VppCtrlMq
254 size += 1 // m.VppCtrlMqThread
255 size += 4 // m.AppIndex
257 size += 1 // m.FdFlags
258 size += 4 // m.SegmentSize
259 size += 8 // m.SegmentHandle
260 size += 4 + len(m.SegmentName) // m.SegmentName
263 func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) {
265 b = make([]byte, m.Size())
267 buf := codec.NewBuffer(b)
268 buf.EncodeInt32(m.Retval)
269 buf.EncodeUint64(m.AppMq)
270 buf.EncodeUint64(m.VppCtrlMq)
271 buf.EncodeUint8(m.VppCtrlMqThread)
272 buf.EncodeUint32(m.AppIndex)
273 buf.EncodeUint8(m.NFds)
274 buf.EncodeUint8(m.FdFlags)
275 buf.EncodeUint32(m.SegmentSize)
276 buf.EncodeUint64(m.SegmentHandle)
277 buf.EncodeString(m.SegmentName, 0)
278 return buf.Bytes(), nil
280 func (m *AppAttachReply) Unmarshal(b []byte) error {
281 buf := codec.NewBuffer(b)
282 m.Retval = buf.DecodeInt32()
283 m.AppMq = buf.DecodeUint64()
284 m.VppCtrlMq = buf.DecodeUint64()
285 m.VppCtrlMqThread = buf.DecodeUint8()
286 m.AppIndex = buf.DecodeUint32()
287 m.NFds = buf.DecodeUint8()
288 m.FdFlags = buf.DecodeUint8()
289 m.SegmentSize = buf.DecodeUint32()
290 m.SegmentHandle = buf.DecodeUint64()
291 m.SegmentName = buf.DecodeString(0)
295 // AppDelCertKeyPair defines message 'app_del_cert_key_pair'.
296 type AppDelCertKeyPair struct {
297 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
300 func (m *AppDelCertKeyPair) Reset() { *m = AppDelCertKeyPair{} }
301 func (*AppDelCertKeyPair) GetMessageName() string { return "app_del_cert_key_pair" }
302 func (*AppDelCertKeyPair) GetCrcString() string { return "8ac76db6" }
303 func (*AppDelCertKeyPair) GetMessageType() api.MessageType {
304 return api.RequestMessage
307 func (m *AppDelCertKeyPair) Size() (size int) {
314 func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) {
316 b = make([]byte, m.Size())
318 buf := codec.NewBuffer(b)
319 buf.EncodeUint32(m.Index)
320 return buf.Bytes(), nil
322 func (m *AppDelCertKeyPair) Unmarshal(b []byte) error {
323 buf := codec.NewBuffer(b)
324 m.Index = buf.DecodeUint32()
328 // AppDelCertKeyPairReply defines message 'app_del_cert_key_pair_reply'.
329 type AppDelCertKeyPairReply struct {
330 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
333 func (m *AppDelCertKeyPairReply) Reset() { *m = AppDelCertKeyPairReply{} }
334 func (*AppDelCertKeyPairReply) GetMessageName() string { return "app_del_cert_key_pair_reply" }
335 func (*AppDelCertKeyPairReply) GetCrcString() string { return "e8d4e804" }
336 func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType {
337 return api.ReplyMessage
340 func (m *AppDelCertKeyPairReply) Size() (size int) {
344 size += 4 // m.Retval
347 func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
349 b = make([]byte, m.Size())
351 buf := codec.NewBuffer(b)
352 buf.EncodeInt32(m.Retval)
353 return buf.Bytes(), nil
355 func (m *AppDelCertKeyPairReply) Unmarshal(b []byte) error {
356 buf := codec.NewBuffer(b)
357 m.Retval = buf.DecodeInt32()
361 // AppNamespaceAddDel defines message 'app_namespace_add_del'.
362 type AppNamespaceAddDel struct {
363 Secret uint64 `binapi:"u64,name=secret" json:"secret,omitempty"`
364 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
365 IP4FibID uint32 `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
366 IP6FibID uint32 `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
367 NamespaceID string `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
370 func (m *AppNamespaceAddDel) Reset() { *m = AppNamespaceAddDel{} }
371 func (*AppNamespaceAddDel) GetMessageName() string { return "app_namespace_add_del" }
372 func (*AppNamespaceAddDel) GetCrcString() string { return "6306aecb" }
373 func (*AppNamespaceAddDel) GetMessageType() api.MessageType {
374 return api.RequestMessage
377 func (m *AppNamespaceAddDel) Size() (size int) {
381 size += 8 // m.Secret
382 size += 4 // m.SwIfIndex
383 size += 4 // m.IP4FibID
384 size += 4 // m.IP6FibID
385 size += 4 + len(m.NamespaceID) // m.NamespaceID
388 func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) {
390 b = make([]byte, m.Size())
392 buf := codec.NewBuffer(b)
393 buf.EncodeUint64(m.Secret)
394 buf.EncodeUint32(uint32(m.SwIfIndex))
395 buf.EncodeUint32(m.IP4FibID)
396 buf.EncodeUint32(m.IP6FibID)
397 buf.EncodeString(m.NamespaceID, 0)
398 return buf.Bytes(), nil
400 func (m *AppNamespaceAddDel) Unmarshal(b []byte) error {
401 buf := codec.NewBuffer(b)
402 m.Secret = buf.DecodeUint64()
403 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
404 m.IP4FibID = buf.DecodeUint32()
405 m.IP6FibID = buf.DecodeUint32()
406 m.NamespaceID = buf.DecodeString(0)
410 // AppNamespaceAddDelReply defines message 'app_namespace_add_del_reply'.
411 type AppNamespaceAddDelReply struct {
412 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
413 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
416 func (m *AppNamespaceAddDelReply) Reset() { *m = AppNamespaceAddDelReply{} }
417 func (*AppNamespaceAddDelReply) GetMessageName() string { return "app_namespace_add_del_reply" }
418 func (*AppNamespaceAddDelReply) GetCrcString() string { return "85137120" }
419 func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType {
420 return api.ReplyMessage
423 func (m *AppNamespaceAddDelReply) Size() (size int) {
427 size += 4 // m.Retval
428 size += 4 // m.AppnsIndex
431 func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) {
433 b = make([]byte, m.Size())
435 buf := codec.NewBuffer(b)
436 buf.EncodeInt32(m.Retval)
437 buf.EncodeUint32(m.AppnsIndex)
438 return buf.Bytes(), nil
440 func (m *AppNamespaceAddDelReply) Unmarshal(b []byte) error {
441 buf := codec.NewBuffer(b)
442 m.Retval = buf.DecodeInt32()
443 m.AppnsIndex = buf.DecodeUint32()
447 // AppWorkerAddDel defines message 'app_worker_add_del'.
448 type AppWorkerAddDel struct {
449 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
450 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
451 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
454 func (m *AppWorkerAddDel) Reset() { *m = AppWorkerAddDel{} }
455 func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" }
456 func (*AppWorkerAddDel) GetCrcString() string { return "753253dc" }
457 func (*AppWorkerAddDel) GetMessageType() api.MessageType {
458 return api.RequestMessage
461 func (m *AppWorkerAddDel) Size() (size int) {
465 size += 4 // m.AppIndex
466 size += 4 // m.WrkIndex
470 func (m *AppWorkerAddDel) Marshal(b []byte) ([]byte, error) {
472 b = make([]byte, m.Size())
474 buf := codec.NewBuffer(b)
475 buf.EncodeUint32(m.AppIndex)
476 buf.EncodeUint32(m.WrkIndex)
477 buf.EncodeBool(m.IsAdd)
478 return buf.Bytes(), nil
480 func (m *AppWorkerAddDel) Unmarshal(b []byte) error {
481 buf := codec.NewBuffer(b)
482 m.AppIndex = buf.DecodeUint32()
483 m.WrkIndex = buf.DecodeUint32()
484 m.IsAdd = buf.DecodeBool()
488 // AppWorkerAddDelReply defines message 'app_worker_add_del_reply'.
489 type AppWorkerAddDelReply struct {
490 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
491 WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
492 AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
493 NFds uint8 `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
494 FdFlags uint8 `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
495 SegmentHandle uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
496 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
497 SegmentName string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
500 func (m *AppWorkerAddDelReply) Reset() { *m = AppWorkerAddDelReply{} }
501 func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" }
502 func (*AppWorkerAddDelReply) GetCrcString() string { return "5735ffe7" }
503 func (*AppWorkerAddDelReply) GetMessageType() api.MessageType {
504 return api.ReplyMessage
507 func (m *AppWorkerAddDelReply) Size() (size int) {
511 size += 4 // m.Retval
512 size += 4 // m.WrkIndex
513 size += 8 // m.AppEventQueueAddress
515 size += 1 // m.FdFlags
516 size += 8 // m.SegmentHandle
518 size += 4 + len(m.SegmentName) // m.SegmentName
521 func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) {
523 b = make([]byte, m.Size())
525 buf := codec.NewBuffer(b)
526 buf.EncodeInt32(m.Retval)
527 buf.EncodeUint32(m.WrkIndex)
528 buf.EncodeUint64(m.AppEventQueueAddress)
529 buf.EncodeUint8(m.NFds)
530 buf.EncodeUint8(m.FdFlags)
531 buf.EncodeUint64(m.SegmentHandle)
532 buf.EncodeBool(m.IsAdd)
533 buf.EncodeString(m.SegmentName, 0)
534 return buf.Bytes(), nil
536 func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error {
537 buf := codec.NewBuffer(b)
538 m.Retval = buf.DecodeInt32()
539 m.WrkIndex = buf.DecodeUint32()
540 m.AppEventQueueAddress = buf.DecodeUint64()
541 m.NFds = buf.DecodeUint8()
542 m.FdFlags = buf.DecodeUint8()
543 m.SegmentHandle = buf.DecodeUint64()
544 m.IsAdd = buf.DecodeBool()
545 m.SegmentName = buf.DecodeString(0)
549 // ApplicationDetach defines message 'application_detach'.
550 type ApplicationDetach struct{}
552 func (m *ApplicationDetach) Reset() { *m = ApplicationDetach{} }
553 func (*ApplicationDetach) GetMessageName() string { return "application_detach" }
554 func (*ApplicationDetach) GetCrcString() string { return "51077d14" }
555 func (*ApplicationDetach) GetMessageType() api.MessageType {
556 return api.RequestMessage
559 func (m *ApplicationDetach) Size() (size int) {
565 func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) {
567 b = make([]byte, m.Size())
569 buf := codec.NewBuffer(b)
570 return buf.Bytes(), nil
572 func (m *ApplicationDetach) Unmarshal(b []byte) error {
576 // ApplicationDetachReply defines message 'application_detach_reply'.
577 type ApplicationDetachReply struct {
578 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
581 func (m *ApplicationDetachReply) Reset() { *m = ApplicationDetachReply{} }
582 func (*ApplicationDetachReply) GetMessageName() string { return "application_detach_reply" }
583 func (*ApplicationDetachReply) GetCrcString() string { return "e8d4e804" }
584 func (*ApplicationDetachReply) GetMessageType() api.MessageType {
585 return api.ReplyMessage
588 func (m *ApplicationDetachReply) Size() (size int) {
592 size += 4 // m.Retval
595 func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) {
597 b = make([]byte, m.Size())
599 buf := codec.NewBuffer(b)
600 buf.EncodeInt32(m.Retval)
601 return buf.Bytes(), nil
603 func (m *ApplicationDetachReply) Unmarshal(b []byte) error {
604 buf := codec.NewBuffer(b)
605 m.Retval = buf.DecodeInt32()
609 // ApplicationTLSCertAdd defines message 'application_tls_cert_add'.
610 type ApplicationTLSCertAdd struct {
611 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
612 CertLen uint16 `binapi:"u16,name=cert_len" json:"-"`
613 Cert []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
616 func (m *ApplicationTLSCertAdd) Reset() { *m = ApplicationTLSCertAdd{} }
617 func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
618 func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" }
619 func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
620 return api.RequestMessage
623 func (m *ApplicationTLSCertAdd) Size() (size int) {
627 size += 4 // m.AppIndex
628 size += 2 // m.CertLen
629 size += 1 * len(m.Cert) // m.Cert
632 func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) {
634 b = make([]byte, m.Size())
636 buf := codec.NewBuffer(b)
637 buf.EncodeUint32(m.AppIndex)
638 buf.EncodeUint16(uint16(len(m.Cert)))
639 buf.EncodeBytes(m.Cert, 0)
640 return buf.Bytes(), nil
642 func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error {
643 buf := codec.NewBuffer(b)
644 m.AppIndex = buf.DecodeUint32()
645 m.CertLen = buf.DecodeUint16()
646 m.Cert = make([]byte, m.CertLen)
647 copy(m.Cert, buf.DecodeBytes(len(m.Cert)))
651 // ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
652 type ApplicationTLSCertAddReply struct {
653 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
656 func (m *ApplicationTLSCertAddReply) Reset() { *m = ApplicationTLSCertAddReply{} }
657 func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
658 func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" }
659 func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
660 return api.ReplyMessage
663 func (m *ApplicationTLSCertAddReply) Size() (size int) {
667 size += 4 // m.Retval
670 func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
672 b = make([]byte, m.Size())
674 buf := codec.NewBuffer(b)
675 buf.EncodeInt32(m.Retval)
676 return buf.Bytes(), nil
678 func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error {
679 buf := codec.NewBuffer(b)
680 m.Retval = buf.DecodeInt32()
684 // ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
685 type ApplicationTLSKeyAdd struct {
686 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
687 KeyLen uint16 `binapi:"u16,name=key_len" json:"-"`
688 Key []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
691 func (m *ApplicationTLSKeyAdd) Reset() { *m = ApplicationTLSKeyAdd{} }
692 func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
693 func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" }
694 func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
695 return api.RequestMessage
698 func (m *ApplicationTLSKeyAdd) Size() (size int) {
702 size += 4 // m.AppIndex
703 size += 2 // m.KeyLen
704 size += 1 * len(m.Key) // m.Key
707 func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) {
709 b = make([]byte, m.Size())
711 buf := codec.NewBuffer(b)
712 buf.EncodeUint32(m.AppIndex)
713 buf.EncodeUint16(uint16(len(m.Key)))
714 buf.EncodeBytes(m.Key, 0)
715 return buf.Bytes(), nil
717 func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error {
718 buf := codec.NewBuffer(b)
719 m.AppIndex = buf.DecodeUint32()
720 m.KeyLen = buf.DecodeUint16()
721 m.Key = make([]byte, m.KeyLen)
722 copy(m.Key, buf.DecodeBytes(len(m.Key)))
726 // ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
727 type ApplicationTLSKeyAddReply struct {
728 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
731 func (m *ApplicationTLSKeyAddReply) Reset() { *m = ApplicationTLSKeyAddReply{} }
732 func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
733 func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" }
734 func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
735 return api.ReplyMessage
738 func (m *ApplicationTLSKeyAddReply) Size() (size int) {
742 size += 4 // m.Retval
745 func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
747 b = make([]byte, m.Size())
749 buf := codec.NewBuffer(b)
750 buf.EncodeInt32(m.Retval)
751 return buf.Bytes(), nil
753 func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error {
754 buf := codec.NewBuffer(b)
755 m.Retval = buf.DecodeInt32()
759 // SessionEnableDisable defines message 'session_enable_disable'.
760 type SessionEnableDisable struct {
761 IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
764 func (m *SessionEnableDisable) Reset() { *m = SessionEnableDisable{} }
765 func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
766 func (*SessionEnableDisable) GetCrcString() string { return "c264d7bf" }
767 func (*SessionEnableDisable) GetMessageType() api.MessageType {
768 return api.RequestMessage
771 func (m *SessionEnableDisable) Size() (size int) {
775 size += 1 // m.IsEnable
778 func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
780 b = make([]byte, m.Size())
782 buf := codec.NewBuffer(b)
783 buf.EncodeBool(m.IsEnable)
784 return buf.Bytes(), nil
786 func (m *SessionEnableDisable) Unmarshal(b []byte) error {
787 buf := codec.NewBuffer(b)
788 m.IsEnable = buf.DecodeBool()
792 // SessionEnableDisableReply defines message 'session_enable_disable_reply'.
793 type SessionEnableDisableReply struct {
794 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
797 func (m *SessionEnableDisableReply) Reset() { *m = SessionEnableDisableReply{} }
798 func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
799 func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" }
800 func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
801 return api.ReplyMessage
804 func (m *SessionEnableDisableReply) Size() (size int) {
808 size += 4 // m.Retval
811 func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
813 b = make([]byte, m.Size())
815 buf := codec.NewBuffer(b)
816 buf.EncodeInt32(m.Retval)
817 return buf.Bytes(), nil
819 func (m *SessionEnableDisableReply) Unmarshal(b []byte) error {
820 buf := codec.NewBuffer(b)
821 m.Retval = buf.DecodeInt32()
825 // SessionRuleAddDel defines message 'session_rule_add_del'.
826 type SessionRuleAddDel struct {
827 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
828 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
829 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
830 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
831 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
832 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
833 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
834 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
835 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
836 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
839 func (m *SessionRuleAddDel) Reset() { *m = SessionRuleAddDel{} }
840 func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
841 func (*SessionRuleAddDel) GetCrcString() string { return "e31f9443" }
842 func (*SessionRuleAddDel) GetMessageType() api.MessageType {
843 return api.RequestMessage
846 func (m *SessionRuleAddDel) Size() (size int) {
850 size += 1 // m.TransportProto
851 size += 1 // m.Lcl.Address.Af
852 size += 1 * 16 // m.Lcl.Address.Un
853 size += 1 // m.Lcl.Len
854 size += 1 // m.Rmt.Address.Af
855 size += 1 * 16 // m.Rmt.Address.Un
856 size += 1 // m.Rmt.Len
857 size += 2 // m.LclPort
858 size += 2 // m.RmtPort
859 size += 4 // m.ActionIndex
861 size += 4 // m.AppnsIndex
866 func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
868 b = make([]byte, m.Size())
870 buf := codec.NewBuffer(b)
871 buf.EncodeUint8(uint8(m.TransportProto))
872 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
873 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
874 buf.EncodeUint8(m.Lcl.Len)
875 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
876 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
877 buf.EncodeUint8(m.Rmt.Len)
878 buf.EncodeUint16(m.LclPort)
879 buf.EncodeUint16(m.RmtPort)
880 buf.EncodeUint32(m.ActionIndex)
881 buf.EncodeBool(m.IsAdd)
882 buf.EncodeUint32(m.AppnsIndex)
883 buf.EncodeUint32(uint32(m.Scope))
884 buf.EncodeString(m.Tag, 64)
885 return buf.Bytes(), nil
887 func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
888 buf := codec.NewBuffer(b)
889 m.TransportProto = TransportProto(buf.DecodeUint8())
890 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
891 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
892 m.Lcl.Len = buf.DecodeUint8()
893 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
894 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
895 m.Rmt.Len = buf.DecodeUint8()
896 m.LclPort = buf.DecodeUint16()
897 m.RmtPort = buf.DecodeUint16()
898 m.ActionIndex = buf.DecodeUint32()
899 m.IsAdd = buf.DecodeBool()
900 m.AppnsIndex = buf.DecodeUint32()
901 m.Scope = SessionRuleScope(buf.DecodeUint32())
902 m.Tag = buf.DecodeString(64)
906 // SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
907 type SessionRuleAddDelReply struct {
908 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
911 func (m *SessionRuleAddDelReply) Reset() { *m = SessionRuleAddDelReply{} }
912 func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
913 func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" }
914 func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
915 return api.ReplyMessage
918 func (m *SessionRuleAddDelReply) Size() (size int) {
922 size += 4 // m.Retval
925 func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
927 b = make([]byte, m.Size())
929 buf := codec.NewBuffer(b)
930 buf.EncodeInt32(m.Retval)
931 return buf.Bytes(), nil
933 func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error {
934 buf := codec.NewBuffer(b)
935 m.Retval = buf.DecodeInt32()
939 // SessionRulesDetails defines message 'session_rules_details'.
940 type SessionRulesDetails struct {
941 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
942 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
943 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
944 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
945 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
946 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
947 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
948 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
949 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
952 func (m *SessionRulesDetails) Reset() { *m = SessionRulesDetails{} }
953 func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
954 func (*SessionRulesDetails) GetCrcString() string { return "304b91f0" }
955 func (*SessionRulesDetails) GetMessageType() api.MessageType {
956 return api.ReplyMessage
959 func (m *SessionRulesDetails) Size() (size int) {
963 size += 1 // m.TransportProto
964 size += 1 // m.Lcl.Address.Af
965 size += 1 * 16 // m.Lcl.Address.Un
966 size += 1 // m.Lcl.Len
967 size += 1 // m.Rmt.Address.Af
968 size += 1 * 16 // m.Rmt.Address.Un
969 size += 1 // m.Rmt.Len
970 size += 2 // m.LclPort
971 size += 2 // m.RmtPort
972 size += 4 // m.ActionIndex
973 size += 4 // m.AppnsIndex
978 func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
980 b = make([]byte, m.Size())
982 buf := codec.NewBuffer(b)
983 buf.EncodeUint8(uint8(m.TransportProto))
984 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
985 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
986 buf.EncodeUint8(m.Lcl.Len)
987 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
988 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
989 buf.EncodeUint8(m.Rmt.Len)
990 buf.EncodeUint16(m.LclPort)
991 buf.EncodeUint16(m.RmtPort)
992 buf.EncodeUint32(m.ActionIndex)
993 buf.EncodeUint32(m.AppnsIndex)
994 buf.EncodeUint32(uint32(m.Scope))
995 buf.EncodeString(m.Tag, 64)
996 return buf.Bytes(), nil
998 func (m *SessionRulesDetails) Unmarshal(b []byte) error {
999 buf := codec.NewBuffer(b)
1000 m.TransportProto = TransportProto(buf.DecodeUint8())
1001 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1002 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1003 m.Lcl.Len = buf.DecodeUint8()
1004 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1005 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1006 m.Rmt.Len = buf.DecodeUint8()
1007 m.LclPort = buf.DecodeUint16()
1008 m.RmtPort = buf.DecodeUint16()
1009 m.ActionIndex = buf.DecodeUint32()
1010 m.AppnsIndex = buf.DecodeUint32()
1011 m.Scope = SessionRuleScope(buf.DecodeUint32())
1012 m.Tag = buf.DecodeString(64)
1016 // SessionRulesDump defines message 'session_rules_dump'.
1017 type SessionRulesDump struct{}
1019 func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} }
1020 func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
1021 func (*SessionRulesDump) GetCrcString() string { return "51077d14" }
1022 func (*SessionRulesDump) GetMessageType() api.MessageType {
1023 return api.RequestMessage
1026 func (m *SessionRulesDump) Size() (size int) {
1032 func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
1034 b = make([]byte, m.Size())
1036 buf := codec.NewBuffer(b)
1037 return buf.Bytes(), nil
1039 func (m *SessionRulesDump) Unmarshal(b []byte) error {
1043 func init() { file_session_binapi_init() }
1044 func file_session_binapi_init() {
1045 api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
1046 api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
1047 api.RegisterMessage((*AppAttach)(nil), "app_attach_5f4a260d")
1048 api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_5c89c3b0")
1049 api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
1050 api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
1051 api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_6306aecb")
1052 api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
1053 api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_753253dc")
1054 api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_5735ffe7")
1055 api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
1056 api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
1057 api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
1058 api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
1059 api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
1060 api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
1061 api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf")
1062 api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
1063 api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_e31f9443")
1064 api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
1065 api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_304b91f0")
1066 api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
1069 // Messages returns list of all messages in this module.
1070 func AllMessages() []api.Message {
1071 return []api.Message{
1072 (*AppAddCertKeyPair)(nil),
1073 (*AppAddCertKeyPairReply)(nil),
1075 (*AppAttachReply)(nil),
1076 (*AppDelCertKeyPair)(nil),
1077 (*AppDelCertKeyPairReply)(nil),
1078 (*AppNamespaceAddDel)(nil),
1079 (*AppNamespaceAddDelReply)(nil),
1080 (*AppWorkerAddDel)(nil),
1081 (*AppWorkerAddDelReply)(nil),
1082 (*ApplicationDetach)(nil),
1083 (*ApplicationDetachReply)(nil),
1084 (*ApplicationTLSCertAdd)(nil),
1085 (*ApplicationTLSCertAddReply)(nil),
1086 (*ApplicationTLSKeyAdd)(nil),
1087 (*ApplicationTLSKeyAddReply)(nil),
1088 (*SessionEnableDisable)(nil),
1089 (*SessionEnableDisableReply)(nil),
1090 (*SessionRuleAddDel)(nil),
1091 (*SessionRuleAddDelReply)(nil),
1092 (*SessionRulesDetails)(nil),
1093 (*SessionRulesDump)(nil),