Improve binapi generator
[govpp.git] / binapi / tls_openssl / tls_openssl.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5 // source: /usr/share/vpp/api/plugins/tls_openssl.api.json
6
7 // Package tls_openssl contains generated bindings for API file tls_openssl.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package tls_openssl
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         codec "git.fd.io/govpp.git/codec"
17 )
18
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
24
25 const (
26         APIFile    = "tls_openssl"
27         APIVersion = "2.0.0"
28         VersionCrc = 0x7386fbcd
29 )
30
31 // TLSOpensslSetEngine defines message 'tls_openssl_set_engine'.
32 type TLSOpensslSetEngine struct {
33         AsyncEnable uint32 `binapi:"u32,name=async_enable" json:"async_enable,omitempty"`
34         Engine      []byte `binapi:"u8[64],name=engine" json:"engine,omitempty"`
35         Algorithm   []byte `binapi:"u8[64],name=algorithm" json:"algorithm,omitempty"`
36         Ciphers     []byte `binapi:"u8[64],name=ciphers" json:"ciphers,omitempty"`
37 }
38
39 func (m *TLSOpensslSetEngine) Reset()               { *m = TLSOpensslSetEngine{} }
40 func (*TLSOpensslSetEngine) GetMessageName() string { return "tls_openssl_set_engine" }
41 func (*TLSOpensslSetEngine) GetCrcString() string   { return "e34d95c1" }
42 func (*TLSOpensslSetEngine) GetMessageType() api.MessageType {
43         return api.RequestMessage
44 }
45
46 func (m *TLSOpensslSetEngine) Size() int {
47         if m == nil {
48                 return 0
49         }
50         var size int
51         size += 4      // m.AsyncEnable
52         size += 1 * 64 // m.Engine
53         size += 1 * 64 // m.Algorithm
54         size += 1 * 64 // m.Ciphers
55         return size
56 }
57 func (m *TLSOpensslSetEngine) Marshal(b []byte) ([]byte, error) {
58         var buf *codec.Buffer
59         if b == nil {
60                 buf = codec.NewBuffer(make([]byte, m.Size()))
61         } else {
62                 buf = codec.NewBuffer(b)
63         }
64         buf.EncodeUint32(uint32(m.AsyncEnable))
65         buf.EncodeBytes(m.Engine[:], 64)
66         buf.EncodeBytes(m.Algorithm[:], 64)
67         buf.EncodeBytes(m.Ciphers[:], 64)
68         return buf.Bytes(), nil
69 }
70 func (m *TLSOpensslSetEngine) Unmarshal(b []byte) error {
71         buf := codec.NewBuffer(b)
72         m.AsyncEnable = buf.DecodeUint32()
73         copy(m.Engine[:], buf.DecodeBytes(64))
74         copy(m.Algorithm[:], buf.DecodeBytes(64))
75         copy(m.Ciphers[:], buf.DecodeBytes(64))
76         return nil
77 }
78
79 // TLSOpensslSetEngineReply defines message 'tls_openssl_set_engine_reply'.
80 type TLSOpensslSetEngineReply struct {
81         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
82 }
83
84 func (m *TLSOpensslSetEngineReply) Reset()               { *m = TLSOpensslSetEngineReply{} }
85 func (*TLSOpensslSetEngineReply) GetMessageName() string { return "tls_openssl_set_engine_reply" }
86 func (*TLSOpensslSetEngineReply) GetCrcString() string   { return "e8d4e804" }
87 func (*TLSOpensslSetEngineReply) GetMessageType() api.MessageType {
88         return api.ReplyMessage
89 }
90
91 func (m *TLSOpensslSetEngineReply) Size() int {
92         if m == nil {
93                 return 0
94         }
95         var size int
96         size += 4 // m.Retval
97         return size
98 }
99 func (m *TLSOpensslSetEngineReply) Marshal(b []byte) ([]byte, error) {
100         var buf *codec.Buffer
101         if b == nil {
102                 buf = codec.NewBuffer(make([]byte, m.Size()))
103         } else {
104                 buf = codec.NewBuffer(b)
105         }
106         buf.EncodeUint32(uint32(m.Retval))
107         return buf.Bytes(), nil
108 }
109 func (m *TLSOpensslSetEngineReply) Unmarshal(b []byte) error {
110         buf := codec.NewBuffer(b)
111         m.Retval = int32(buf.DecodeUint32())
112         return nil
113 }
114
115 func init() { file_tls_openssl_binapi_init() }
116 func file_tls_openssl_binapi_init() {
117         api.RegisterMessage((*TLSOpensslSetEngine)(nil), "tls_openssl_set_engine_e34d95c1")
118         api.RegisterMessage((*TLSOpensslSetEngineReply)(nil), "tls_openssl_set_engine_reply_e8d4e804")
119 }
120
121 // Messages returns list of all messages in this module.
122 func AllMessages() []api.Message {
123         return []api.Message{
124                 (*TLSOpensslSetEngine)(nil),
125                 (*TLSOpensslSetEngineReply)(nil),
126         }
127 }