b28bbe72d71becf45e233228ffbe6c96b09a8021
[govpp.git] / binapi / session / session.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/core/session.api.json
6
7 // Package session contains generated bindings for API file session.api.
8 //
9 // Contents:
10 //   2 enums
11 //  28 messages
12 //
13 package session
14
15 import (
16         "strconv"
17
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"
22 )
23
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
29
30 const (
31         APIFile    = "session"
32         APIVersion = "4.0.0"
33         VersionCrc = 0x44a59e26
34 )
35
36 // SessionRuleScope defines enum 'session_rule_scope'.
37 type SessionRuleScope uint32
38
39 const (
40         SESSION_RULE_SCOPE_API_GLOBAL SessionRuleScope = 0
41         SESSION_RULE_SCOPE_API_LOCAL  SessionRuleScope = 1
42         SESSION_RULE_SCOPE_API_BOTH   SessionRuleScope = 2
43 )
44
45 var (
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",
50         }
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,
55         }
56 )
57
58 func (x SessionRuleScope) String() string {
59         s, ok := SessionRuleScope_name[uint32(x)]
60         if ok {
61                 return s
62         }
63         return "SessionRuleScope(" + strconv.Itoa(int(x)) + ")"
64 }
65
66 // TransportProto defines enum 'transport_proto'.
67 type TransportProto uint8
68
69 const (
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
75 )
76
77 var (
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",
84         }
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,
91         }
92 )
93
94 func (x TransportProto) String() string {
95         s, ok := TransportProto_name[uint8(x)]
96         if ok {
97                 return s
98         }
99         return "TransportProto(" + strconv.Itoa(int(x)) + ")"
100 }
101
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"`
107 }
108
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
114 }
115
116 func (m *AppAddCertKeyPair) Size() (size int) {
117         if m == nil {
118                 return 0
119         }
120         size += 2                  // m.CertLen
121         size += 2                  // m.CertkeyLen
122         size += 1 * len(m.Certkey) // m.Certkey
123         return size
124 }
125 func (m *AppAddCertKeyPair) Marshal(b []byte) ([]byte, error) {
126         if b == nil {
127                 b = make([]byte, m.Size())
128         }
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
134 }
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)))
141         return nil
142 }
143
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"`
148 }
149
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
155 }
156
157 func (m *AppAddCertKeyPairReply) Size() (size int) {
158         if m == nil {
159                 return 0
160         }
161         size += 4 // m.Retval
162         size += 4 // m.Index
163         return size
164 }
165 func (m *AppAddCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
166         if b == nil {
167                 b = make([]byte, m.Size())
168         }
169         buf := codec.NewBuffer(b)
170         buf.EncodeInt32(m.Retval)
171         buf.EncodeUint32(m.Index)
172         return buf.Bytes(), nil
173 }
174 func (m *AppAddCertKeyPairReply) Unmarshal(b []byte) error {
175         buf := codec.NewBuffer(b)
176         m.Retval = buf.DecodeInt32()
177         m.Index = buf.DecodeUint32()
178         return nil
179 }
180
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"`
185 }
186
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
192 }
193
194 func (m *AppAttach) Size() (size int) {
195         if m == nil {
196                 return 0
197         }
198         size += 8 * 18                 // m.Options
199         size += 4 + len(m.NamespaceID) // m.NamespaceID
200         return size
201 }
202 func (m *AppAttach) Marshal(b []byte) ([]byte, error) {
203         if b == nil {
204                 b = make([]byte, m.Size())
205         }
206         buf := codec.NewBuffer(b)
207         for i := 0; i < 18; i++ {
208                 var x uint64
209                 if i < len(m.Options) {
210                         x = uint64(m.Options[i])
211                 }
212                 buf.EncodeUint64(x)
213         }
214         buf.EncodeString(m.NamespaceID, 0)
215         return buf.Bytes(), nil
216 }
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()
222         }
223         m.NamespaceID = buf.DecodeString(0)
224         return nil
225 }
226
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"`
239 }
240
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
246 }
247
248 func (m *AppAttachReply) Size() (size int) {
249         if m == nil {
250                 return 0
251         }
252         size += 4                      // m.Retval
253         size += 8                      // m.AppMq
254         size += 8                      // m.VppCtrlMq
255         size += 1                      // m.VppCtrlMqThread
256         size += 4                      // m.AppIndex
257         size += 1                      // m.NFds
258         size += 1                      // m.FdFlags
259         size += 4                      // m.SegmentSize
260         size += 8                      // m.SegmentHandle
261         size += 4 + len(m.SegmentName) // m.SegmentName
262         return size
263 }
264 func (m *AppAttachReply) Marshal(b []byte) ([]byte, error) {
265         if b == nil {
266                 b = make([]byte, m.Size())
267         }
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
280 }
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)
293         return nil
294 }
295
296 // AppDelCertKeyPair defines message 'app_del_cert_key_pair'.
297 type AppDelCertKeyPair struct {
298         Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
299 }
300
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
306 }
307
308 func (m *AppDelCertKeyPair) Size() (size int) {
309         if m == nil {
310                 return 0
311         }
312         size += 4 // m.Index
313         return size
314 }
315 func (m *AppDelCertKeyPair) Marshal(b []byte) ([]byte, error) {
316         if b == nil {
317                 b = make([]byte, m.Size())
318         }
319         buf := codec.NewBuffer(b)
320         buf.EncodeUint32(m.Index)
321         return buf.Bytes(), nil
322 }
323 func (m *AppDelCertKeyPair) Unmarshal(b []byte) error {
324         buf := codec.NewBuffer(b)
325         m.Index = buf.DecodeUint32()
326         return nil
327 }
328
329 // AppDelCertKeyPairReply defines message 'app_del_cert_key_pair_reply'.
330 type AppDelCertKeyPairReply struct {
331         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
332 }
333
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
339 }
340
341 func (m *AppDelCertKeyPairReply) Size() (size int) {
342         if m == nil {
343                 return 0
344         }
345         size += 4 // m.Retval
346         return size
347 }
348 func (m *AppDelCertKeyPairReply) Marshal(b []byte) ([]byte, error) {
349         if b == nil {
350                 b = make([]byte, m.Size())
351         }
352         buf := codec.NewBuffer(b)
353         buf.EncodeInt32(m.Retval)
354         return buf.Bytes(), nil
355 }
356 func (m *AppDelCertKeyPairReply) Unmarshal(b []byte) error {
357         buf := codec.NewBuffer(b)
358         m.Retval = buf.DecodeInt32()
359         return nil
360 }
361
362 // AppNamespaceAddDel defines message 'app_namespace_add_del'.
363 // Deprecated: the message will be removed in the future versions
364 type AppNamespaceAddDel struct {
365         Secret      uint64                         `binapi:"u64,name=secret" json:"secret,omitempty"`
366         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
367         IP4FibID    uint32                         `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
368         IP6FibID    uint32                         `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
369         NamespaceID string                         `binapi:"string[],name=namespace_id" json:"namespace_id,omitempty"`
370 }
371
372 func (m *AppNamespaceAddDel) Reset()               { *m = AppNamespaceAddDel{} }
373 func (*AppNamespaceAddDel) GetMessageName() string { return "app_namespace_add_del" }
374 func (*AppNamespaceAddDel) GetCrcString() string   { return "6306aecb" }
375 func (*AppNamespaceAddDel) GetMessageType() api.MessageType {
376         return api.RequestMessage
377 }
378
379 func (m *AppNamespaceAddDel) Size() (size int) {
380         if m == nil {
381                 return 0
382         }
383         size += 8                      // m.Secret
384         size += 4                      // m.SwIfIndex
385         size += 4                      // m.IP4FibID
386         size += 4                      // m.IP6FibID
387         size += 4 + len(m.NamespaceID) // m.NamespaceID
388         return size
389 }
390 func (m *AppNamespaceAddDel) Marshal(b []byte) ([]byte, error) {
391         if b == nil {
392                 b = make([]byte, m.Size())
393         }
394         buf := codec.NewBuffer(b)
395         buf.EncodeUint64(m.Secret)
396         buf.EncodeUint32(uint32(m.SwIfIndex))
397         buf.EncodeUint32(m.IP4FibID)
398         buf.EncodeUint32(m.IP6FibID)
399         buf.EncodeString(m.NamespaceID, 0)
400         return buf.Bytes(), nil
401 }
402 func (m *AppNamespaceAddDel) Unmarshal(b []byte) error {
403         buf := codec.NewBuffer(b)
404         m.Secret = buf.DecodeUint64()
405         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
406         m.IP4FibID = buf.DecodeUint32()
407         m.IP6FibID = buf.DecodeUint32()
408         m.NamespaceID = buf.DecodeString(0)
409         return nil
410 }
411
412 // AppNamespaceAddDelReply defines message 'app_namespace_add_del_reply'.
413 // Deprecated: the message will be removed in the future versions
414 type AppNamespaceAddDelReply struct {
415         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
416         AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
417 }
418
419 func (m *AppNamespaceAddDelReply) Reset()               { *m = AppNamespaceAddDelReply{} }
420 func (*AppNamespaceAddDelReply) GetMessageName() string { return "app_namespace_add_del_reply" }
421 func (*AppNamespaceAddDelReply) GetCrcString() string   { return "85137120" }
422 func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType {
423         return api.ReplyMessage
424 }
425
426 func (m *AppNamespaceAddDelReply) Size() (size int) {
427         if m == nil {
428                 return 0
429         }
430         size += 4 // m.Retval
431         size += 4 // m.AppnsIndex
432         return size
433 }
434 func (m *AppNamespaceAddDelReply) Marshal(b []byte) ([]byte, error) {
435         if b == nil {
436                 b = make([]byte, m.Size())
437         }
438         buf := codec.NewBuffer(b)
439         buf.EncodeInt32(m.Retval)
440         buf.EncodeUint32(m.AppnsIndex)
441         return buf.Bytes(), nil
442 }
443 func (m *AppNamespaceAddDelReply) Unmarshal(b []byte) error {
444         buf := codec.NewBuffer(b)
445         m.Retval = buf.DecodeInt32()
446         m.AppnsIndex = buf.DecodeUint32()
447         return nil
448 }
449
450 // AppNamespaceAddDelV2 defines message 'app_namespace_add_del_v2'.
451 type AppNamespaceAddDelV2 struct {
452         Secret      uint64                         `binapi:"u64,name=secret" json:"secret,omitempty"`
453         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
454         IP4FibID    uint32                         `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
455         IP6FibID    uint32                         `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
456         NamespaceID string                         `binapi:"string[64],name=namespace_id" json:"namespace_id,omitempty"`
457         Netns       string                         `binapi:"string[64],name=netns" json:"netns,omitempty"`
458 }
459
460 func (m *AppNamespaceAddDelV2) Reset()               { *m = AppNamespaceAddDelV2{} }
461 func (*AppNamespaceAddDelV2) GetMessageName() string { return "app_namespace_add_del_v2" }
462 func (*AppNamespaceAddDelV2) GetCrcString() string   { return "ee0755cf" }
463 func (*AppNamespaceAddDelV2) GetMessageType() api.MessageType {
464         return api.RequestMessage
465 }
466
467 func (m *AppNamespaceAddDelV2) Size() (size int) {
468         if m == nil {
469                 return 0
470         }
471         size += 8  // m.Secret
472         size += 4  // m.SwIfIndex
473         size += 4  // m.IP4FibID
474         size += 4  // m.IP6FibID
475         size += 64 // m.NamespaceID
476         size += 64 // m.Netns
477         return size
478 }
479 func (m *AppNamespaceAddDelV2) Marshal(b []byte) ([]byte, error) {
480         if b == nil {
481                 b = make([]byte, m.Size())
482         }
483         buf := codec.NewBuffer(b)
484         buf.EncodeUint64(m.Secret)
485         buf.EncodeUint32(uint32(m.SwIfIndex))
486         buf.EncodeUint32(m.IP4FibID)
487         buf.EncodeUint32(m.IP6FibID)
488         buf.EncodeString(m.NamespaceID, 64)
489         buf.EncodeString(m.Netns, 64)
490         return buf.Bytes(), nil
491 }
492 func (m *AppNamespaceAddDelV2) Unmarshal(b []byte) error {
493         buf := codec.NewBuffer(b)
494         m.Secret = buf.DecodeUint64()
495         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
496         m.IP4FibID = buf.DecodeUint32()
497         m.IP6FibID = buf.DecodeUint32()
498         m.NamespaceID = buf.DecodeString(64)
499         m.Netns = buf.DecodeString(64)
500         return nil
501 }
502
503 // AppNamespaceAddDelV2Reply defines message 'app_namespace_add_del_v2_reply'.
504 type AppNamespaceAddDelV2Reply struct {
505         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
506         AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
507 }
508
509 func (m *AppNamespaceAddDelV2Reply) Reset()               { *m = AppNamespaceAddDelV2Reply{} }
510 func (*AppNamespaceAddDelV2Reply) GetMessageName() string { return "app_namespace_add_del_v2_reply" }
511 func (*AppNamespaceAddDelV2Reply) GetCrcString() string   { return "85137120" }
512 func (*AppNamespaceAddDelV2Reply) GetMessageType() api.MessageType {
513         return api.ReplyMessage
514 }
515
516 func (m *AppNamespaceAddDelV2Reply) Size() (size int) {
517         if m == nil {
518                 return 0
519         }
520         size += 4 // m.Retval
521         size += 4 // m.AppnsIndex
522         return size
523 }
524 func (m *AppNamespaceAddDelV2Reply) Marshal(b []byte) ([]byte, error) {
525         if b == nil {
526                 b = make([]byte, m.Size())
527         }
528         buf := codec.NewBuffer(b)
529         buf.EncodeInt32(m.Retval)
530         buf.EncodeUint32(m.AppnsIndex)
531         return buf.Bytes(), nil
532 }
533 func (m *AppNamespaceAddDelV2Reply) Unmarshal(b []byte) error {
534         buf := codec.NewBuffer(b)
535         m.Retval = buf.DecodeInt32()
536         m.AppnsIndex = buf.DecodeUint32()
537         return nil
538 }
539
540 // AppNamespaceAddDelV3 defines message 'app_namespace_add_del_v3'.
541 type AppNamespaceAddDelV3 struct {
542         Secret      uint64                         `binapi:"u64,name=secret" json:"secret,omitempty"`
543         IsAdd       bool                           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
544         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
545         IP4FibID    uint32                         `binapi:"u32,name=ip4_fib_id" json:"ip4_fib_id,omitempty"`
546         IP6FibID    uint32                         `binapi:"u32,name=ip6_fib_id" json:"ip6_fib_id,omitempty"`
547         NamespaceID string                         `binapi:"string[64],name=namespace_id" json:"namespace_id,omitempty"`
548         Netns       string                         `binapi:"string[64],name=netns" json:"netns,omitempty"`
549         SockName    string                         `binapi:"string[],name=sock_name" json:"sock_name,omitempty"`
550 }
551
552 func (m *AppNamespaceAddDelV3) Reset()               { *m = AppNamespaceAddDelV3{} }
553 func (*AppNamespaceAddDelV3) GetMessageName() string { return "app_namespace_add_del_v3" }
554 func (*AppNamespaceAddDelV3) GetCrcString() string   { return "8a7e40a1" }
555 func (*AppNamespaceAddDelV3) GetMessageType() api.MessageType {
556         return api.RequestMessage
557 }
558
559 func (m *AppNamespaceAddDelV3) Size() (size int) {
560         if m == nil {
561                 return 0
562         }
563         size += 8                   // m.Secret
564         size += 1                   // m.IsAdd
565         size += 4                   // m.SwIfIndex
566         size += 4                   // m.IP4FibID
567         size += 4                   // m.IP6FibID
568         size += 64                  // m.NamespaceID
569         size += 64                  // m.Netns
570         size += 4 + len(m.SockName) // m.SockName
571         return size
572 }
573 func (m *AppNamespaceAddDelV3) Marshal(b []byte) ([]byte, error) {
574         if b == nil {
575                 b = make([]byte, m.Size())
576         }
577         buf := codec.NewBuffer(b)
578         buf.EncodeUint64(m.Secret)
579         buf.EncodeBool(m.IsAdd)
580         buf.EncodeUint32(uint32(m.SwIfIndex))
581         buf.EncodeUint32(m.IP4FibID)
582         buf.EncodeUint32(m.IP6FibID)
583         buf.EncodeString(m.NamespaceID, 64)
584         buf.EncodeString(m.Netns, 64)
585         buf.EncodeString(m.SockName, 0)
586         return buf.Bytes(), nil
587 }
588 func (m *AppNamespaceAddDelV3) Unmarshal(b []byte) error {
589         buf := codec.NewBuffer(b)
590         m.Secret = buf.DecodeUint64()
591         m.IsAdd = buf.DecodeBool()
592         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
593         m.IP4FibID = buf.DecodeUint32()
594         m.IP6FibID = buf.DecodeUint32()
595         m.NamespaceID = buf.DecodeString(64)
596         m.Netns = buf.DecodeString(64)
597         m.SockName = buf.DecodeString(0)
598         return nil
599 }
600
601 // AppNamespaceAddDelV3Reply defines message 'app_namespace_add_del_v3_reply'.
602 type AppNamespaceAddDelV3Reply struct {
603         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
604         AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
605 }
606
607 func (m *AppNamespaceAddDelV3Reply) Reset()               { *m = AppNamespaceAddDelV3Reply{} }
608 func (*AppNamespaceAddDelV3Reply) GetMessageName() string { return "app_namespace_add_del_v3_reply" }
609 func (*AppNamespaceAddDelV3Reply) GetCrcString() string   { return "85137120" }
610 func (*AppNamespaceAddDelV3Reply) GetMessageType() api.MessageType {
611         return api.ReplyMessage
612 }
613
614 func (m *AppNamespaceAddDelV3Reply) Size() (size int) {
615         if m == nil {
616                 return 0
617         }
618         size += 4 // m.Retval
619         size += 4 // m.AppnsIndex
620         return size
621 }
622 func (m *AppNamespaceAddDelV3Reply) Marshal(b []byte) ([]byte, error) {
623         if b == nil {
624                 b = make([]byte, m.Size())
625         }
626         buf := codec.NewBuffer(b)
627         buf.EncodeInt32(m.Retval)
628         buf.EncodeUint32(m.AppnsIndex)
629         return buf.Bytes(), nil
630 }
631 func (m *AppNamespaceAddDelV3Reply) Unmarshal(b []byte) error {
632         buf := codec.NewBuffer(b)
633         m.Retval = buf.DecodeInt32()
634         m.AppnsIndex = buf.DecodeUint32()
635         return nil
636 }
637
638 // AppWorkerAddDel defines message 'app_worker_add_del'.
639 type AppWorkerAddDel struct {
640         AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
641         WrkIndex uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
642         IsAdd    bool   `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
643 }
644
645 func (m *AppWorkerAddDel) Reset()               { *m = AppWorkerAddDel{} }
646 func (*AppWorkerAddDel) GetMessageName() string { return "app_worker_add_del" }
647 func (*AppWorkerAddDel) GetCrcString() string   { return "753253dc" }
648 func (*AppWorkerAddDel) GetMessageType() api.MessageType {
649         return api.RequestMessage
650 }
651
652 func (m *AppWorkerAddDel) Size() (size int) {
653         if m == nil {
654                 return 0
655         }
656         size += 4 // m.AppIndex
657         size += 4 // m.WrkIndex
658         size += 1 // m.IsAdd
659         return size
660 }
661 func (m *AppWorkerAddDel) Marshal(b []byte) ([]byte, error) {
662         if b == nil {
663                 b = make([]byte, m.Size())
664         }
665         buf := codec.NewBuffer(b)
666         buf.EncodeUint32(m.AppIndex)
667         buf.EncodeUint32(m.WrkIndex)
668         buf.EncodeBool(m.IsAdd)
669         return buf.Bytes(), nil
670 }
671 func (m *AppWorkerAddDel) Unmarshal(b []byte) error {
672         buf := codec.NewBuffer(b)
673         m.AppIndex = buf.DecodeUint32()
674         m.WrkIndex = buf.DecodeUint32()
675         m.IsAdd = buf.DecodeBool()
676         return nil
677 }
678
679 // AppWorkerAddDelReply defines message 'app_worker_add_del_reply'.
680 type AppWorkerAddDelReply struct {
681         Retval               int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
682         WrkIndex             uint32 `binapi:"u32,name=wrk_index" json:"wrk_index,omitempty"`
683         AppEventQueueAddress uint64 `binapi:"u64,name=app_event_queue_address" json:"app_event_queue_address,omitempty"`
684         NFds                 uint8  `binapi:"u8,name=n_fds" json:"n_fds,omitempty"`
685         FdFlags              uint8  `binapi:"u8,name=fd_flags" json:"fd_flags,omitempty"`
686         SegmentHandle        uint64 `binapi:"u64,name=segment_handle" json:"segment_handle,omitempty"`
687         IsAdd                bool   `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
688         SegmentName          string `binapi:"string[],name=segment_name" json:"segment_name,omitempty"`
689 }
690
691 func (m *AppWorkerAddDelReply) Reset()               { *m = AppWorkerAddDelReply{} }
692 func (*AppWorkerAddDelReply) GetMessageName() string { return "app_worker_add_del_reply" }
693 func (*AppWorkerAddDelReply) GetCrcString() string   { return "5735ffe7" }
694 func (*AppWorkerAddDelReply) GetMessageType() api.MessageType {
695         return api.ReplyMessage
696 }
697
698 func (m *AppWorkerAddDelReply) Size() (size int) {
699         if m == nil {
700                 return 0
701         }
702         size += 4                      // m.Retval
703         size += 4                      // m.WrkIndex
704         size += 8                      // m.AppEventQueueAddress
705         size += 1                      // m.NFds
706         size += 1                      // m.FdFlags
707         size += 8                      // m.SegmentHandle
708         size += 1                      // m.IsAdd
709         size += 4 + len(m.SegmentName) // m.SegmentName
710         return size
711 }
712 func (m *AppWorkerAddDelReply) Marshal(b []byte) ([]byte, error) {
713         if b == nil {
714                 b = make([]byte, m.Size())
715         }
716         buf := codec.NewBuffer(b)
717         buf.EncodeInt32(m.Retval)
718         buf.EncodeUint32(m.WrkIndex)
719         buf.EncodeUint64(m.AppEventQueueAddress)
720         buf.EncodeUint8(m.NFds)
721         buf.EncodeUint8(m.FdFlags)
722         buf.EncodeUint64(m.SegmentHandle)
723         buf.EncodeBool(m.IsAdd)
724         buf.EncodeString(m.SegmentName, 0)
725         return buf.Bytes(), nil
726 }
727 func (m *AppWorkerAddDelReply) Unmarshal(b []byte) error {
728         buf := codec.NewBuffer(b)
729         m.Retval = buf.DecodeInt32()
730         m.WrkIndex = buf.DecodeUint32()
731         m.AppEventQueueAddress = buf.DecodeUint64()
732         m.NFds = buf.DecodeUint8()
733         m.FdFlags = buf.DecodeUint8()
734         m.SegmentHandle = buf.DecodeUint64()
735         m.IsAdd = buf.DecodeBool()
736         m.SegmentName = buf.DecodeString(0)
737         return nil
738 }
739
740 // ApplicationDetach defines message 'application_detach'.
741 type ApplicationDetach struct{}
742
743 func (m *ApplicationDetach) Reset()               { *m = ApplicationDetach{} }
744 func (*ApplicationDetach) GetMessageName() string { return "application_detach" }
745 func (*ApplicationDetach) GetCrcString() string   { return "51077d14" }
746 func (*ApplicationDetach) GetMessageType() api.MessageType {
747         return api.RequestMessage
748 }
749
750 func (m *ApplicationDetach) Size() (size int) {
751         if m == nil {
752                 return 0
753         }
754         return size
755 }
756 func (m *ApplicationDetach) Marshal(b []byte) ([]byte, error) {
757         if b == nil {
758                 b = make([]byte, m.Size())
759         }
760         buf := codec.NewBuffer(b)
761         return buf.Bytes(), nil
762 }
763 func (m *ApplicationDetach) Unmarshal(b []byte) error {
764         return nil
765 }
766
767 // ApplicationDetachReply defines message 'application_detach_reply'.
768 type ApplicationDetachReply struct {
769         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
770 }
771
772 func (m *ApplicationDetachReply) Reset()               { *m = ApplicationDetachReply{} }
773 func (*ApplicationDetachReply) GetMessageName() string { return "application_detach_reply" }
774 func (*ApplicationDetachReply) GetCrcString() string   { return "e8d4e804" }
775 func (*ApplicationDetachReply) GetMessageType() api.MessageType {
776         return api.ReplyMessage
777 }
778
779 func (m *ApplicationDetachReply) Size() (size int) {
780         if m == nil {
781                 return 0
782         }
783         size += 4 // m.Retval
784         return size
785 }
786 func (m *ApplicationDetachReply) Marshal(b []byte) ([]byte, error) {
787         if b == nil {
788                 b = make([]byte, m.Size())
789         }
790         buf := codec.NewBuffer(b)
791         buf.EncodeInt32(m.Retval)
792         return buf.Bytes(), nil
793 }
794 func (m *ApplicationDetachReply) Unmarshal(b []byte) error {
795         buf := codec.NewBuffer(b)
796         m.Retval = buf.DecodeInt32()
797         return nil
798 }
799
800 // ApplicationTLSCertAdd defines message 'application_tls_cert_add'.
801 // Deprecated: to be removed post 21.06
802 type ApplicationTLSCertAdd struct {
803         AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
804         CertLen  uint16 `binapi:"u16,name=cert_len" json:"-"`
805         Cert     []byte `binapi:"u8[cert_len],name=cert" json:"cert,omitempty"`
806 }
807
808 func (m *ApplicationTLSCertAdd) Reset()               { *m = ApplicationTLSCertAdd{} }
809 func (*ApplicationTLSCertAdd) GetMessageName() string { return "application_tls_cert_add" }
810 func (*ApplicationTLSCertAdd) GetCrcString() string   { return "3f5cfe45" }
811 func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType {
812         return api.RequestMessage
813 }
814
815 func (m *ApplicationTLSCertAdd) Size() (size int) {
816         if m == nil {
817                 return 0
818         }
819         size += 4               // m.AppIndex
820         size += 2               // m.CertLen
821         size += 1 * len(m.Cert) // m.Cert
822         return size
823 }
824 func (m *ApplicationTLSCertAdd) Marshal(b []byte) ([]byte, error) {
825         if b == nil {
826                 b = make([]byte, m.Size())
827         }
828         buf := codec.NewBuffer(b)
829         buf.EncodeUint32(m.AppIndex)
830         buf.EncodeUint16(uint16(len(m.Cert)))
831         buf.EncodeBytes(m.Cert, 0)
832         return buf.Bytes(), nil
833 }
834 func (m *ApplicationTLSCertAdd) Unmarshal(b []byte) error {
835         buf := codec.NewBuffer(b)
836         m.AppIndex = buf.DecodeUint32()
837         m.CertLen = buf.DecodeUint16()
838         m.Cert = make([]byte, m.CertLen)
839         copy(m.Cert, buf.DecodeBytes(len(m.Cert)))
840         return nil
841 }
842
843 // ApplicationTLSCertAddReply defines message 'application_tls_cert_add_reply'.
844 // Deprecated: to be removed post 21.06
845 type ApplicationTLSCertAddReply struct {
846         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
847 }
848
849 func (m *ApplicationTLSCertAddReply) Reset()               { *m = ApplicationTLSCertAddReply{} }
850 func (*ApplicationTLSCertAddReply) GetMessageName() string { return "application_tls_cert_add_reply" }
851 func (*ApplicationTLSCertAddReply) GetCrcString() string   { return "e8d4e804" }
852 func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType {
853         return api.ReplyMessage
854 }
855
856 func (m *ApplicationTLSCertAddReply) Size() (size int) {
857         if m == nil {
858                 return 0
859         }
860         size += 4 // m.Retval
861         return size
862 }
863 func (m *ApplicationTLSCertAddReply) Marshal(b []byte) ([]byte, error) {
864         if b == nil {
865                 b = make([]byte, m.Size())
866         }
867         buf := codec.NewBuffer(b)
868         buf.EncodeInt32(m.Retval)
869         return buf.Bytes(), nil
870 }
871 func (m *ApplicationTLSCertAddReply) Unmarshal(b []byte) error {
872         buf := codec.NewBuffer(b)
873         m.Retval = buf.DecodeInt32()
874         return nil
875 }
876
877 // ApplicationTLSKeyAdd defines message 'application_tls_key_add'.
878 // Deprecated: to be removed post 21.06
879 type ApplicationTLSKeyAdd struct {
880         AppIndex uint32 `binapi:"u32,name=app_index" json:"app_index,omitempty"`
881         KeyLen   uint16 `binapi:"u16,name=key_len" json:"-"`
882         Key      []byte `binapi:"u8[key_len],name=key" json:"key,omitempty"`
883 }
884
885 func (m *ApplicationTLSKeyAdd) Reset()               { *m = ApplicationTLSKeyAdd{} }
886 func (*ApplicationTLSKeyAdd) GetMessageName() string { return "application_tls_key_add" }
887 func (*ApplicationTLSKeyAdd) GetCrcString() string   { return "5eaf70cd" }
888 func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType {
889         return api.RequestMessage
890 }
891
892 func (m *ApplicationTLSKeyAdd) Size() (size int) {
893         if m == nil {
894                 return 0
895         }
896         size += 4              // m.AppIndex
897         size += 2              // m.KeyLen
898         size += 1 * len(m.Key) // m.Key
899         return size
900 }
901 func (m *ApplicationTLSKeyAdd) Marshal(b []byte) ([]byte, error) {
902         if b == nil {
903                 b = make([]byte, m.Size())
904         }
905         buf := codec.NewBuffer(b)
906         buf.EncodeUint32(m.AppIndex)
907         buf.EncodeUint16(uint16(len(m.Key)))
908         buf.EncodeBytes(m.Key, 0)
909         return buf.Bytes(), nil
910 }
911 func (m *ApplicationTLSKeyAdd) Unmarshal(b []byte) error {
912         buf := codec.NewBuffer(b)
913         m.AppIndex = buf.DecodeUint32()
914         m.KeyLen = buf.DecodeUint16()
915         m.Key = make([]byte, m.KeyLen)
916         copy(m.Key, buf.DecodeBytes(len(m.Key)))
917         return nil
918 }
919
920 // ApplicationTLSKeyAddReply defines message 'application_tls_key_add_reply'.
921 // Deprecated: to be removed post 21.06
922 type ApplicationTLSKeyAddReply struct {
923         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
924 }
925
926 func (m *ApplicationTLSKeyAddReply) Reset()               { *m = ApplicationTLSKeyAddReply{} }
927 func (*ApplicationTLSKeyAddReply) GetMessageName() string { return "application_tls_key_add_reply" }
928 func (*ApplicationTLSKeyAddReply) GetCrcString() string   { return "e8d4e804" }
929 func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType {
930         return api.ReplyMessage
931 }
932
933 func (m *ApplicationTLSKeyAddReply) Size() (size int) {
934         if m == nil {
935                 return 0
936         }
937         size += 4 // m.Retval
938         return size
939 }
940 func (m *ApplicationTLSKeyAddReply) Marshal(b []byte) ([]byte, error) {
941         if b == nil {
942                 b = make([]byte, m.Size())
943         }
944         buf := codec.NewBuffer(b)
945         buf.EncodeInt32(m.Retval)
946         return buf.Bytes(), nil
947 }
948 func (m *ApplicationTLSKeyAddReply) Unmarshal(b []byte) error {
949         buf := codec.NewBuffer(b)
950         m.Retval = buf.DecodeInt32()
951         return nil
952 }
953
954 // SessionEnableDisable defines message 'session_enable_disable'.
955 type SessionEnableDisable struct {
956         IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
957 }
958
959 func (m *SessionEnableDisable) Reset()               { *m = SessionEnableDisable{} }
960 func (*SessionEnableDisable) GetMessageName() string { return "session_enable_disable" }
961 func (*SessionEnableDisable) GetCrcString() string   { return "c264d7bf" }
962 func (*SessionEnableDisable) GetMessageType() api.MessageType {
963         return api.RequestMessage
964 }
965
966 func (m *SessionEnableDisable) Size() (size int) {
967         if m == nil {
968                 return 0
969         }
970         size += 1 // m.IsEnable
971         return size
972 }
973 func (m *SessionEnableDisable) Marshal(b []byte) ([]byte, error) {
974         if b == nil {
975                 b = make([]byte, m.Size())
976         }
977         buf := codec.NewBuffer(b)
978         buf.EncodeBool(m.IsEnable)
979         return buf.Bytes(), nil
980 }
981 func (m *SessionEnableDisable) Unmarshal(b []byte) error {
982         buf := codec.NewBuffer(b)
983         m.IsEnable = buf.DecodeBool()
984         return nil
985 }
986
987 // SessionEnableDisableReply defines message 'session_enable_disable_reply'.
988 type SessionEnableDisableReply struct {
989         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
990 }
991
992 func (m *SessionEnableDisableReply) Reset()               { *m = SessionEnableDisableReply{} }
993 func (*SessionEnableDisableReply) GetMessageName() string { return "session_enable_disable_reply" }
994 func (*SessionEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
995 func (*SessionEnableDisableReply) GetMessageType() api.MessageType {
996         return api.ReplyMessage
997 }
998
999 func (m *SessionEnableDisableReply) Size() (size int) {
1000         if m == nil {
1001                 return 0
1002         }
1003         size += 4 // m.Retval
1004         return size
1005 }
1006 func (m *SessionEnableDisableReply) Marshal(b []byte) ([]byte, error) {
1007         if b == nil {
1008                 b = make([]byte, m.Size())
1009         }
1010         buf := codec.NewBuffer(b)
1011         buf.EncodeInt32(m.Retval)
1012         return buf.Bytes(), nil
1013 }
1014 func (m *SessionEnableDisableReply) Unmarshal(b []byte) error {
1015         buf := codec.NewBuffer(b)
1016         m.Retval = buf.DecodeInt32()
1017         return nil
1018 }
1019
1020 // SessionRuleAddDel defines message 'session_rule_add_del'.
1021 type SessionRuleAddDel struct {
1022         TransportProto TransportProto   `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
1023         Lcl            ip_types.Prefix  `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
1024         Rmt            ip_types.Prefix  `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
1025         LclPort        uint16           `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
1026         RmtPort        uint16           `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
1027         ActionIndex    uint32           `binapi:"u32,name=action_index" json:"action_index,omitempty"`
1028         IsAdd          bool             `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
1029         AppnsIndex     uint32           `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
1030         Scope          SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
1031         Tag            string           `binapi:"string[64],name=tag" json:"tag,omitempty"`
1032 }
1033
1034 func (m *SessionRuleAddDel) Reset()               { *m = SessionRuleAddDel{} }
1035 func (*SessionRuleAddDel) GetMessageName() string { return "session_rule_add_del" }
1036 func (*SessionRuleAddDel) GetCrcString() string   { return "e4895422" }
1037 func (*SessionRuleAddDel) GetMessageType() api.MessageType {
1038         return api.RequestMessage
1039 }
1040
1041 func (m *SessionRuleAddDel) Size() (size int) {
1042         if m == nil {
1043                 return 0
1044         }
1045         size += 1      // m.TransportProto
1046         size += 1      // m.Lcl.Address.Af
1047         size += 1 * 16 // m.Lcl.Address.Un
1048         size += 1      // m.Lcl.Len
1049         size += 1      // m.Rmt.Address.Af
1050         size += 1 * 16 // m.Rmt.Address.Un
1051         size += 1      // m.Rmt.Len
1052         size += 2      // m.LclPort
1053         size += 2      // m.RmtPort
1054         size += 4      // m.ActionIndex
1055         size += 1      // m.IsAdd
1056         size += 4      // m.AppnsIndex
1057         size += 4      // m.Scope
1058         size += 64     // m.Tag
1059         return size
1060 }
1061 func (m *SessionRuleAddDel) Marshal(b []byte) ([]byte, error) {
1062         if b == nil {
1063                 b = make([]byte, m.Size())
1064         }
1065         buf := codec.NewBuffer(b)
1066         buf.EncodeUint8(uint8(m.TransportProto))
1067         buf.EncodeUint8(uint8(m.Lcl.Address.Af))
1068         buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
1069         buf.EncodeUint8(m.Lcl.Len)
1070         buf.EncodeUint8(uint8(m.Rmt.Address.Af))
1071         buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
1072         buf.EncodeUint8(m.Rmt.Len)
1073         buf.EncodeUint16(m.LclPort)
1074         buf.EncodeUint16(m.RmtPort)
1075         buf.EncodeUint32(m.ActionIndex)
1076         buf.EncodeBool(m.IsAdd)
1077         buf.EncodeUint32(m.AppnsIndex)
1078         buf.EncodeUint32(uint32(m.Scope))
1079         buf.EncodeString(m.Tag, 64)
1080         return buf.Bytes(), nil
1081 }
1082 func (m *SessionRuleAddDel) Unmarshal(b []byte) error {
1083         buf := codec.NewBuffer(b)
1084         m.TransportProto = TransportProto(buf.DecodeUint8())
1085         m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1086         copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1087         m.Lcl.Len = buf.DecodeUint8()
1088         m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1089         copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1090         m.Rmt.Len = buf.DecodeUint8()
1091         m.LclPort = buf.DecodeUint16()
1092         m.RmtPort = buf.DecodeUint16()
1093         m.ActionIndex = buf.DecodeUint32()
1094         m.IsAdd = buf.DecodeBool()
1095         m.AppnsIndex = buf.DecodeUint32()
1096         m.Scope = SessionRuleScope(buf.DecodeUint32())
1097         m.Tag = buf.DecodeString(64)
1098         return nil
1099 }
1100
1101 // SessionRuleAddDelReply defines message 'session_rule_add_del_reply'.
1102 type SessionRuleAddDelReply struct {
1103         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1104 }
1105
1106 func (m *SessionRuleAddDelReply) Reset()               { *m = SessionRuleAddDelReply{} }
1107 func (*SessionRuleAddDelReply) GetMessageName() string { return "session_rule_add_del_reply" }
1108 func (*SessionRuleAddDelReply) GetCrcString() string   { return "e8d4e804" }
1109 func (*SessionRuleAddDelReply) GetMessageType() api.MessageType {
1110         return api.ReplyMessage
1111 }
1112
1113 func (m *SessionRuleAddDelReply) Size() (size int) {
1114         if m == nil {
1115                 return 0
1116         }
1117         size += 4 // m.Retval
1118         return size
1119 }
1120 func (m *SessionRuleAddDelReply) Marshal(b []byte) ([]byte, error) {
1121         if b == nil {
1122                 b = make([]byte, m.Size())
1123         }
1124         buf := codec.NewBuffer(b)
1125         buf.EncodeInt32(m.Retval)
1126         return buf.Bytes(), nil
1127 }
1128 func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error {
1129         buf := codec.NewBuffer(b)
1130         m.Retval = buf.DecodeInt32()
1131         return nil
1132 }
1133
1134 // SessionRulesDetails defines message 'session_rules_details'.
1135 type SessionRulesDetails struct {
1136         TransportProto TransportProto   `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"`
1137         Lcl            ip_types.Prefix  `binapi:"prefix,name=lcl" json:"lcl,omitempty"`
1138         Rmt            ip_types.Prefix  `binapi:"prefix,name=rmt" json:"rmt,omitempty"`
1139         LclPort        uint16           `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"`
1140         RmtPort        uint16           `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"`
1141         ActionIndex    uint32           `binapi:"u32,name=action_index" json:"action_index,omitempty"`
1142         AppnsIndex     uint32           `binapi:"u32,name=appns_index" json:"appns_index,omitempty"`
1143         Scope          SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"`
1144         Tag            string           `binapi:"string[64],name=tag" json:"tag,omitempty"`
1145 }
1146
1147 func (m *SessionRulesDetails) Reset()               { *m = SessionRulesDetails{} }
1148 func (*SessionRulesDetails) GetMessageName() string { return "session_rules_details" }
1149 func (*SessionRulesDetails) GetCrcString() string   { return "28d71830" }
1150 func (*SessionRulesDetails) GetMessageType() api.MessageType {
1151         return api.ReplyMessage
1152 }
1153
1154 func (m *SessionRulesDetails) Size() (size int) {
1155         if m == nil {
1156                 return 0
1157         }
1158         size += 1      // m.TransportProto
1159         size += 1      // m.Lcl.Address.Af
1160         size += 1 * 16 // m.Lcl.Address.Un
1161         size += 1      // m.Lcl.Len
1162         size += 1      // m.Rmt.Address.Af
1163         size += 1 * 16 // m.Rmt.Address.Un
1164         size += 1      // m.Rmt.Len
1165         size += 2      // m.LclPort
1166         size += 2      // m.RmtPort
1167         size += 4      // m.ActionIndex
1168         size += 4      // m.AppnsIndex
1169         size += 4      // m.Scope
1170         size += 64     // m.Tag
1171         return size
1172 }
1173 func (m *SessionRulesDetails) Marshal(b []byte) ([]byte, error) {
1174         if b == nil {
1175                 b = make([]byte, m.Size())
1176         }
1177         buf := codec.NewBuffer(b)
1178         buf.EncodeUint8(uint8(m.TransportProto))
1179         buf.EncodeUint8(uint8(m.Lcl.Address.Af))
1180         buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16)
1181         buf.EncodeUint8(m.Lcl.Len)
1182         buf.EncodeUint8(uint8(m.Rmt.Address.Af))
1183         buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16)
1184         buf.EncodeUint8(m.Rmt.Len)
1185         buf.EncodeUint16(m.LclPort)
1186         buf.EncodeUint16(m.RmtPort)
1187         buf.EncodeUint32(m.ActionIndex)
1188         buf.EncodeUint32(m.AppnsIndex)
1189         buf.EncodeUint32(uint32(m.Scope))
1190         buf.EncodeString(m.Tag, 64)
1191         return buf.Bytes(), nil
1192 }
1193 func (m *SessionRulesDetails) Unmarshal(b []byte) error {
1194         buf := codec.NewBuffer(b)
1195         m.TransportProto = TransportProto(buf.DecodeUint8())
1196         m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1197         copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1198         m.Lcl.Len = buf.DecodeUint8()
1199         m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1200         copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1201         m.Rmt.Len = buf.DecodeUint8()
1202         m.LclPort = buf.DecodeUint16()
1203         m.RmtPort = buf.DecodeUint16()
1204         m.ActionIndex = buf.DecodeUint32()
1205         m.AppnsIndex = buf.DecodeUint32()
1206         m.Scope = SessionRuleScope(buf.DecodeUint32())
1207         m.Tag = buf.DecodeString(64)
1208         return nil
1209 }
1210
1211 // SessionRulesDump defines message 'session_rules_dump'.
1212 type SessionRulesDump struct{}
1213
1214 func (m *SessionRulesDump) Reset()               { *m = SessionRulesDump{} }
1215 func (*SessionRulesDump) GetMessageName() string { return "session_rules_dump" }
1216 func (*SessionRulesDump) GetCrcString() string   { return "51077d14" }
1217 func (*SessionRulesDump) GetMessageType() api.MessageType {
1218         return api.RequestMessage
1219 }
1220
1221 func (m *SessionRulesDump) Size() (size int) {
1222         if m == nil {
1223                 return 0
1224         }
1225         return size
1226 }
1227 func (m *SessionRulesDump) Marshal(b []byte) ([]byte, error) {
1228         if b == nil {
1229                 b = make([]byte, m.Size())
1230         }
1231         buf := codec.NewBuffer(b)
1232         return buf.Bytes(), nil
1233 }
1234 func (m *SessionRulesDump) Unmarshal(b []byte) error {
1235         return nil
1236 }
1237
1238 // SessionSapiEnableDisable defines message 'session_sapi_enable_disable'.
1239 type SessionSapiEnableDisable struct {
1240         IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"`
1241 }
1242
1243 func (m *SessionSapiEnableDisable) Reset()               { *m = SessionSapiEnableDisable{} }
1244 func (*SessionSapiEnableDisable) GetMessageName() string { return "session_sapi_enable_disable" }
1245 func (*SessionSapiEnableDisable) GetCrcString() string   { return "c264d7bf" }
1246 func (*SessionSapiEnableDisable) GetMessageType() api.MessageType {
1247         return api.RequestMessage
1248 }
1249
1250 func (m *SessionSapiEnableDisable) Size() (size int) {
1251         if m == nil {
1252                 return 0
1253         }
1254         size += 1 // m.IsEnable
1255         return size
1256 }
1257 func (m *SessionSapiEnableDisable) Marshal(b []byte) ([]byte, error) {
1258         if b == nil {
1259                 b = make([]byte, m.Size())
1260         }
1261         buf := codec.NewBuffer(b)
1262         buf.EncodeBool(m.IsEnable)
1263         return buf.Bytes(), nil
1264 }
1265 func (m *SessionSapiEnableDisable) Unmarshal(b []byte) error {
1266         buf := codec.NewBuffer(b)
1267         m.IsEnable = buf.DecodeBool()
1268         return nil
1269 }
1270
1271 // SessionSapiEnableDisableReply defines message 'session_sapi_enable_disable_reply'.
1272 type SessionSapiEnableDisableReply struct {
1273         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1274 }
1275
1276 func (m *SessionSapiEnableDisableReply) Reset() { *m = SessionSapiEnableDisableReply{} }
1277 func (*SessionSapiEnableDisableReply) GetMessageName() string {
1278         return "session_sapi_enable_disable_reply"
1279 }
1280 func (*SessionSapiEnableDisableReply) GetCrcString() string { return "e8d4e804" }
1281 func (*SessionSapiEnableDisableReply) GetMessageType() api.MessageType {
1282         return api.ReplyMessage
1283 }
1284
1285 func (m *SessionSapiEnableDisableReply) Size() (size int) {
1286         if m == nil {
1287                 return 0
1288         }
1289         size += 4 // m.Retval
1290         return size
1291 }
1292 func (m *SessionSapiEnableDisableReply) Marshal(b []byte) ([]byte, error) {
1293         if b == nil {
1294                 b = make([]byte, m.Size())
1295         }
1296         buf := codec.NewBuffer(b)
1297         buf.EncodeInt32(m.Retval)
1298         return buf.Bytes(), nil
1299 }
1300 func (m *SessionSapiEnableDisableReply) Unmarshal(b []byte) error {
1301         buf := codec.NewBuffer(b)
1302         m.Retval = buf.DecodeInt32()
1303         return nil
1304 }
1305
1306 func init() { file_session_binapi_init() }
1307 func file_session_binapi_init() {
1308         api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016")
1309         api.RegisterMessage((*AppAddCertKeyPairReply)(nil), "app_add_cert_key_pair_reply_b42958d0")
1310         api.RegisterMessage((*AppAttach)(nil), "app_attach_5f4a260d")
1311         api.RegisterMessage((*AppAttachReply)(nil), "app_attach_reply_5c89c3b0")
1312         api.RegisterMessage((*AppDelCertKeyPair)(nil), "app_del_cert_key_pair_8ac76db6")
1313         api.RegisterMessage((*AppDelCertKeyPairReply)(nil), "app_del_cert_key_pair_reply_e8d4e804")
1314         api.RegisterMessage((*AppNamespaceAddDel)(nil), "app_namespace_add_del_6306aecb")
1315         api.RegisterMessage((*AppNamespaceAddDelReply)(nil), "app_namespace_add_del_reply_85137120")
1316         api.RegisterMessage((*AppNamespaceAddDelV2)(nil), "app_namespace_add_del_v2_ee0755cf")
1317         api.RegisterMessage((*AppNamespaceAddDelV2Reply)(nil), "app_namespace_add_del_v2_reply_85137120")
1318         api.RegisterMessage((*AppNamespaceAddDelV3)(nil), "app_namespace_add_del_v3_8a7e40a1")
1319         api.RegisterMessage((*AppNamespaceAddDelV3Reply)(nil), "app_namespace_add_del_v3_reply_85137120")
1320         api.RegisterMessage((*AppWorkerAddDel)(nil), "app_worker_add_del_753253dc")
1321         api.RegisterMessage((*AppWorkerAddDelReply)(nil), "app_worker_add_del_reply_5735ffe7")
1322         api.RegisterMessage((*ApplicationDetach)(nil), "application_detach_51077d14")
1323         api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804")
1324         api.RegisterMessage((*ApplicationTLSCertAdd)(nil), "application_tls_cert_add_3f5cfe45")
1325         api.RegisterMessage((*ApplicationTLSCertAddReply)(nil), "application_tls_cert_add_reply_e8d4e804")
1326         api.RegisterMessage((*ApplicationTLSKeyAdd)(nil), "application_tls_key_add_5eaf70cd")
1327         api.RegisterMessage((*ApplicationTLSKeyAddReply)(nil), "application_tls_key_add_reply_e8d4e804")
1328         api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf")
1329         api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804")
1330         api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_e4895422")
1331         api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804")
1332         api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_28d71830")
1333         api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14")
1334         api.RegisterMessage((*SessionSapiEnableDisable)(nil), "session_sapi_enable_disable_c264d7bf")
1335         api.RegisterMessage((*SessionSapiEnableDisableReply)(nil), "session_sapi_enable_disable_reply_e8d4e804")
1336 }
1337
1338 // Messages returns list of all messages in this module.
1339 func AllMessages() []api.Message {
1340         return []api.Message{
1341                 (*AppAddCertKeyPair)(nil),
1342                 (*AppAddCertKeyPairReply)(nil),
1343                 (*AppAttach)(nil),
1344                 (*AppAttachReply)(nil),
1345                 (*AppDelCertKeyPair)(nil),
1346                 (*AppDelCertKeyPairReply)(nil),
1347                 (*AppNamespaceAddDel)(nil),
1348                 (*AppNamespaceAddDelReply)(nil),
1349                 (*AppNamespaceAddDelV2)(nil),
1350                 (*AppNamespaceAddDelV2Reply)(nil),
1351                 (*AppNamespaceAddDelV3)(nil),
1352                 (*AppNamespaceAddDelV3Reply)(nil),
1353                 (*AppWorkerAddDel)(nil),
1354                 (*AppWorkerAddDelReply)(nil),
1355                 (*ApplicationDetach)(nil),
1356                 (*ApplicationDetachReply)(nil),
1357                 (*ApplicationTLSCertAdd)(nil),
1358                 (*ApplicationTLSCertAddReply)(nil),
1359                 (*ApplicationTLSKeyAdd)(nil),
1360                 (*ApplicationTLSKeyAddReply)(nil),
1361                 (*SessionEnableDisable)(nil),
1362                 (*SessionEnableDisableReply)(nil),
1363                 (*SessionRuleAddDel)(nil),
1364                 (*SessionRuleAddDelReply)(nil),
1365                 (*SessionRulesDetails)(nil),
1366                 (*SessionRulesDump)(nil),
1367                 (*SessionSapiEnableDisable)(nil),
1368                 (*SessionSapiEnableDisableReply)(nil),
1369         }
1370 }