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 = 0x9aa0ebc0
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 type ApplicationTLSCertAdd struct {
612 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
613 CertLen uint16 `binapi:"u16,name=cert_len" json:"-"`
614 Cert []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
617 func (m *ApplicationTLSCertAdd) Reset() { *m = ApplicationTLSCertAdd{} }
618 func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
619 func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" }
620 func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
621 return api.RequestMessage
624 func (m *ApplicationTLSCertAdd) Size() (size int) {
628 size += 4 // m.AppIndex
629 size += 2 // m.CertLen
630 size += 1 * len(m.Cert) // m.Cert
633 func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) {
635 b = make([]byte, m.Size())
637 buf := codec.NewBuffer(b)
638 buf.EncodeUint32(m.AppIndex)
639 buf.EncodeUint16(uint16(len(m.Cert)))
640 buf.EncodeBytes(m.Cert, 0)
641 return buf.Bytes(), nil
643 func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error {
644 buf := codec.NewBuffer(b)
645 m.AppIndex = buf.DecodeUint32()
646 m.CertLen = buf.DecodeUint16()
647 m.Cert = make([]byte, m.CertLen)
648 copy(m.Cert, buf.DecodeBytes(len(m.Cert)))
652 // ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
653 type ApplicationTLSCertAddReply struct {
654 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
657 func (m *ApplicationTLSCertAddReply) Reset() { *m = ApplicationTLSCertAddReply{} }
658 func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
659 func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" }
660 func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
661 return api.ReplyMessage
664 func (m *ApplicationTLSCertAddReply) Size() (size int) {
668 size += 4 // m.Retval
671 func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
673 b = make([]byte, m.Size())
675 buf := codec.NewBuffer(b)
676 buf.EncodeInt32(m.Retval)
677 return buf.Bytes(), nil
679 func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error {
680 buf := codec.NewBuffer(b)
681 m.Retval = buf.DecodeInt32()
685 // ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
686 type ApplicationTLSKeyAdd struct {
687 AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
688 KeyLen uint16 `binapi:"u16,name=key_len" json:"-"`
689 Key []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
692 func (m *ApplicationTLSKeyAdd) Reset() { *m = ApplicationTLSKeyAdd{} }
693 func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
694 func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" }
695 func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
696 return api.RequestMessage
699 func (m *ApplicationTLSKeyAdd) Size() (size int) {
703 size += 4 // m.AppIndex
704 size += 2 // m.KeyLen
705 size += 1 * len(m.Key) // m.Key
708 func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) {
710 b = make([]byte, m.Size())
712 buf := codec.NewBuffer(b)
713 buf.EncodeUint32(m.AppIndex)
714 buf.EncodeUint16(uint16(len(m.Key)))
715 buf.EncodeBytes(m.Key, 0)
716 return buf.Bytes(), nil
718 func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error {
719 buf := codec.NewBuffer(b)
720 m.AppIndex = buf.DecodeUint32()
721 m.KeyLen = buf.DecodeUint16()
722 m.Key = make([]byte, m.KeyLen)
723 copy(m.Key, buf.DecodeBytes(len(m.Key)))
727 // ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
728 type ApplicationTLSKeyAddReply struct {
729 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
732 func (m *ApplicationTLSKeyAddReply) Reset() { *m = ApplicationTLSKeyAddReply{} }
733 func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
734 func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" }
735 func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
736 return api.ReplyMessage
739 func (m *ApplicationTLSKeyAddReply) Size() (size int) {
743 size += 4 // m.Retval
746 func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
748 b = make([]byte, m.Size())
750 buf := codec.NewBuffer(b)
751 buf.EncodeInt32(m.Retval)
752 return buf.Bytes(), nil
754 func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error {
755 buf := codec.NewBuffer(b)
756 m.Retval = buf.DecodeInt32()
760 // SessionEnableDisable defines message 'session_enable_disable'.
761 type SessionEnableDisable struct {
762 IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
765 func (m *SessionEnableDisable) Reset() { *m = SessionEnableDisable{} }
766 func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
767 func (*SessionEnableDisable) GetCrcString() string { return "c264d7bf" }
768 func (*SessionEnableDisable) GetMessageType() api.MessageType {
769 return api.RequestMessage
772 func (m *SessionEnableDisable) Size() (size int) {
776 size += 1 // m.IsEnable
779 func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
781 b = make([]byte, m.Size())
783 buf := codec.NewBuffer(b)
784 buf.EncodeBool(m.IsEnable)
785 return buf.Bytes(), nil
787 func (m *SessionEnableDisable) Unmarshal(b []byte) error {
788 buf := codec.NewBuffer(b)
789 m.IsEnable = buf.DecodeBool()
793 // SessionEnableDisableReply defines message 'session_enable_disable_reply'.
794 type SessionEnableDisableReply struct {
795 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
798 func (m *SessionEnableDisableReply) Reset() { *m = SessionEnableDisableReply{} }
799 func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
800 func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" }
801 func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
802 return api.ReplyMessage
805 func (m *SessionEnableDisableReply) Size() (size int) {
809 size += 4 // m.Retval
812 func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
814 b = make([]byte, m.Size())
816 buf := codec.NewBuffer(b)
817 buf.EncodeInt32(m.Retval)
818 return buf.Bytes(), nil
820 func (m *SessionEnableDisableReply) Unmarshal(b []byte) error {
821 buf := codec.NewBuffer(b)
822 m.Retval = buf.DecodeInt32()
826 // SessionRuleAddDel defines message 'session_rule_add_del'.
827 type SessionRuleAddDel struct {
828 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
829 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
830 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
831 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
832 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
833 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
834 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
835 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
836 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
837 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
840 func (m *SessionRuleAddDel) Reset() { *m = SessionRuleAddDel{} }
841 func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
842 func (*SessionRuleAddDel) GetCrcString() string { return "e31f9443" }
843 func (*SessionRuleAddDel) GetMessageType() api.MessageType {
844 return api.RequestMessage
847 func (m *SessionRuleAddDel) Size() (size int) {
851 size += 1 // m.TransportProto
852 size += 1 // m.Lcl.Address.Af
853 size += 1 * 16 // m.Lcl.Address.Un
854 size += 1 // m.Lcl.Len
855 size += 1 // m.Rmt.Address.Af
856 size += 1 * 16 // m.Rmt.Address.Un
857 size += 1 // m.Rmt.Len
858 size += 2 // m.LclPort
859 size += 2 // m.RmtPort
860 size += 4 // m.ActionIndex
862 size += 4 // m.AppnsIndex
867 func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
869 b = make([]byte, m.Size())
871 buf := codec.NewBuffer(b)
872 buf.EncodeUint8(uint8(m.TransportProto))
873 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
874 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
875 buf.EncodeUint8(m.Lcl.Len)
876 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
877 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
878 buf.EncodeUint8(m.Rmt.Len)
879 buf.EncodeUint16(m.LclPort)
880 buf.EncodeUint16(m.RmtPort)
881 buf.EncodeUint32(m.ActionIndex)
882 buf.EncodeBool(m.IsAdd)
883 buf.EncodeUint32(m.AppnsIndex)
884 buf.EncodeUint32(uint32(m.Scope))
885 buf.EncodeString(m.Tag, 64)
886 return buf.Bytes(), nil
888 func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
889 buf := codec.NewBuffer(b)
890 m.TransportProto = TransportProto(buf.DecodeUint8())
891 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
892 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
893 m.Lcl.Len = buf.DecodeUint8()
894 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
895 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
896 m.Rmt.Len = buf.DecodeUint8()
897 m.LclPort = buf.DecodeUint16()
898 m.RmtPort = buf.DecodeUint16()
899 m.ActionIndex = buf.DecodeUint32()
900 m.IsAdd = buf.DecodeBool()
901 m.AppnsIndex = buf.DecodeUint32()
902 m.Scope = SessionRuleScope(buf.DecodeUint32())
903 m.Tag = buf.DecodeString(64)
907 // SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
908 type SessionRuleAddDelReply struct {
909 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
912 func (m *SessionRuleAddDelReply) Reset() { *m = SessionRuleAddDelReply{} }
913 func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
914 func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" }
915 func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
916 return api.ReplyMessage
919 func (m *SessionRuleAddDelReply) Size() (size int) {
923 size += 4 // m.Retval
926 func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
928 b = make([]byte, m.Size())
930 buf := codec.NewBuffer(b)
931 buf.EncodeInt32(m.Retval)
932 return buf.Bytes(), nil
934 func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error {
935 buf := codec.NewBuffer(b)
936 m.Retval = buf.DecodeInt32()
940 // SessionRulesDetails defines message 'session_rules_details'.
941 type SessionRulesDetails struct {
942 TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
943 Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
944 Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
945 LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
946 RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
947 ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"`
948 AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
949 Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
950 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
953 func (m *SessionRulesDetails) Reset() { *m = SessionRulesDetails{} }
954 func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
955 func (*SessionRulesDetails) GetCrcString() string { return "304b91f0" }
956 func (*SessionRulesDetails) GetMessageType() api.MessageType {
957 return api.ReplyMessage
960 func (m *SessionRulesDetails) Size() (size int) {
964 size += 1 // m.TransportProto
965 size += 1 // m.Lcl.Address.Af
966 size += 1 * 16 // m.Lcl.Address.Un
967 size += 1 // m.Lcl.Len
968 size += 1 // m.Rmt.Address.Af
969 size += 1 * 16 // m.Rmt.Address.Un
970 size += 1 // m.Rmt.Len
971 size += 2 // m.LclPort
972 size += 2 // m.RmtPort
973 size += 4 // m.ActionIndex
974 size += 4 // m.AppnsIndex
979 func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
981 b = make([]byte, m.Size())
983 buf := codec.NewBuffer(b)
984 buf.EncodeUint8(uint8(m.TransportProto))
985 buf.EncodeUint8(uint8(m.Lcl.Address.Af))
986 buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
987 buf.EncodeUint8(m.Lcl.Len)
988 buf.EncodeUint8(uint8(m.Rmt.Address.Af))
989 buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
990 buf.EncodeUint8(m.Rmt.Len)
991 buf.EncodeUint16(m.LclPort)
992 buf.EncodeUint16(m.RmtPort)
993 buf.EncodeUint32(m.ActionIndex)
994 buf.EncodeUint32(m.AppnsIndex)
995 buf.EncodeUint32(uint32(m.Scope))
996 buf.EncodeString(m.Tag, 64)
997 return buf.Bytes(), nil
999 func (m *SessionRulesDetails) Unmarshal(b []byte) error {
1000 buf := codec.NewBuffer(b)
1001 m.TransportProto = TransportProto(buf.DecodeUint8())
1002 m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1003 copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1004 m.Lcl.Len = buf.DecodeUint8()
1005 m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1006 copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1007 m.Rmt.Len = buf.DecodeUint8()
1008 m.LclPort = buf.DecodeUint16()
1009 m.RmtPort = buf.DecodeUint16()
1010 m.ActionIndex = buf.DecodeUint32()
1011 m.AppnsIndex = buf.DecodeUint32()
1012 m.Scope = SessionRuleScope(buf.DecodeUint32())
1013 m.Tag = buf.DecodeString(64)
1017 // SessionRulesDump defines message 'session_rules_dump'.
1018 type SessionRulesDump struct{}
1020 func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} }
1021 func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
1022 func (*SessionRulesDump) GetCrcString() string { return "51077d14" }
1023 func (*SessionRulesDump) GetMessageType() api.MessageType {
1024 return api.RequestMessage
1027 func (m *SessionRulesDump) Size() (size int) {
1033 func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
1035 b = make([]byte, m.Size())
1037 buf := codec.NewBuffer(b)
1038 return buf.Bytes(), nil
1040 func (m *SessionRulesDump) Unmarshal(b []byte) error {
1044 func init() { file_session_binapi_init() }
1045 func file_session_binapi_init() {
1046 api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
1047 api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
1048 api.RegisterMessage((*AppAttach)(nil), "app_attach_5f4a260d")
1049 api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_5c89c3b0")
1050 api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
1051 api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
1052 api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_6306aecb")
1053 api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
1054 api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_753253dc")
1055 api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_5735ffe7")
1056 api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
1057 api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
1058 api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
1059 api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
1060 api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
1061 api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
1062 api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf")
1063 api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
1064 api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_e31f9443")
1065 api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
1066 api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_304b91f0")
1067 api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
1070 // Messages returns list of all messages in this module.
1071 func AllMessages() []api.Message {
1072 return []api.Message{
1073 (*AppAddCertKeyPair)(nil),
1074 (*AppAddCertKeyPairReply)(nil),
1076 (*AppAttachReply)(nil),
1077 (*AppDelCertKeyPair)(nil),
1078 (*AppDelCertKeyPairReply)(nil),
1079 (*AppNamespaceAddDel)(nil),
1080 (*AppNamespaceAddDelReply)(nil),
1081 (*AppWorkerAddDel)(nil),
1082 (*AppWorkerAddDelReply)(nil),
1083 (*ApplicationDetach)(nil),
1084 (*ApplicationDetachReply)(nil),
1085 (*ApplicationTLSCertAdd)(nil),
1086 (*ApplicationTLSCertAddReply)(nil),
1087 (*ApplicationTLSKeyAdd)(nil),
1088 (*ApplicationTLSKeyAddReply)(nil),
1089 (*SessionEnableDisable)(nil),
1090 (*SessionEnableDisableReply)(nil),
1091 (*SessionRuleAddDel)(nil),
1092 (*SessionRuleAddDelReply)(nil),
1093 (*SessionRulesDetails)(nil),
1094 (*SessionRulesDump)(nil),