1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
5 // source: /usr/share/vpp/api/core/crypto.api.json
7 // Package crypto contains generated bindings for API file crypto.api.
18 api "git.fd.io/govpp.git/api"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x22355ec6
34 // CryptoDispatchMode defines enum 'crypto_dispatch_mode'.
35 type CryptoDispatchMode uint8
38 CRYPTO_ASYNC_DISPATCH_POLLING CryptoDispatchMode = 0
39 CRYPTO_ASYNC_DISPATCH_INTERRUPT CryptoDispatchMode = 1
43 CryptoDispatchMode_name = map[uint8]string{
44 0: "CRYPTO_ASYNC_DISPATCH_POLLING",
45 1: "CRYPTO_ASYNC_DISPATCH_INTERRUPT",
47 CryptoDispatchMode_value = map[string]uint8{
48 "CRYPTO_ASYNC_DISPATCH_POLLING": 0,
49 "CRYPTO_ASYNC_DISPATCH_INTERRUPT": 1,
53 func (x CryptoDispatchMode) String() string {
54 s, ok := CryptoDispatchMode_name[uint8(x)]
58 return "CryptoDispatchMode(" + strconv.Itoa(int(x)) + ")"
61 // CryptoOpClassType defines enum 'crypto_op_class_type'.
62 type CryptoOpClassType uint8
65 CRYPTO_API_OP_SIMPLE CryptoOpClassType = 0
66 CRYPTO_API_OP_CHAINED CryptoOpClassType = 1
67 CRYPTO_API_OP_BOTH CryptoOpClassType = 2
71 CryptoOpClassType_name = map[uint8]string{
72 0: "CRYPTO_API_OP_SIMPLE",
73 1: "CRYPTO_API_OP_CHAINED",
74 2: "CRYPTO_API_OP_BOTH",
76 CryptoOpClassType_value = map[string]uint8{
77 "CRYPTO_API_OP_SIMPLE": 0,
78 "CRYPTO_API_OP_CHAINED": 1,
79 "CRYPTO_API_OP_BOTH": 2,
83 func (x CryptoOpClassType) String() string {
84 s, ok := CryptoOpClassType_name[uint8(x)]
88 return "CryptoOpClassType(" + strconv.Itoa(int(x)) + ")"
91 // CryptoSetAsyncDispatch defines message 'crypto_set_async_dispatch'.
92 type CryptoSetAsyncDispatch struct {
93 Mode CryptoDispatchMode `binapi:"crypto_dispatch_mode,name=mode" json:"mode,omitempty"`
96 func (m *CryptoSetAsyncDispatch) Reset() { *m = CryptoSetAsyncDispatch{} }
97 func (*CryptoSetAsyncDispatch) GetMessageName() string { return "crypto_set_async_dispatch" }
98 func (*CryptoSetAsyncDispatch) GetCrcString() string { return "5ca4adc0" }
99 func (*CryptoSetAsyncDispatch) GetMessageType() api.MessageType {
100 return api.RequestMessage
103 func (m *CryptoSetAsyncDispatch) Size() (size int) {
110 func (m *CryptoSetAsyncDispatch) Marshal(b []byte) ([]byte, error) {
112 b = make([]byte, m.Size())
114 buf := codec.NewBuffer(b)
115 buf.EncodeUint8(uint8(m.Mode))
116 return buf.Bytes(), nil
118 func (m *CryptoSetAsyncDispatch) Unmarshal(b []byte) error {
119 buf := codec.NewBuffer(b)
120 m.Mode = CryptoDispatchMode(buf.DecodeUint8())
124 // CryptoSetAsyncDispatchReply defines message 'crypto_set_async_dispatch_reply'.
125 type CryptoSetAsyncDispatchReply struct {
126 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
129 func (m *CryptoSetAsyncDispatchReply) Reset() { *m = CryptoSetAsyncDispatchReply{} }
130 func (*CryptoSetAsyncDispatchReply) GetMessageName() string { return "crypto_set_async_dispatch_reply" }
131 func (*CryptoSetAsyncDispatchReply) GetCrcString() string { return "e8d4e804" }
132 func (*CryptoSetAsyncDispatchReply) GetMessageType() api.MessageType {
133 return api.ReplyMessage
136 func (m *CryptoSetAsyncDispatchReply) Size() (size int) {
140 size += 4 // m.Retval
143 func (m *CryptoSetAsyncDispatchReply) Marshal(b []byte) ([]byte, error) {
145 b = make([]byte, m.Size())
147 buf := codec.NewBuffer(b)
148 buf.EncodeInt32(m.Retval)
149 return buf.Bytes(), nil
151 func (m *CryptoSetAsyncDispatchReply) Unmarshal(b []byte) error {
152 buf := codec.NewBuffer(b)
153 m.Retval = buf.DecodeInt32()
157 // CryptoSetHandler defines message 'crypto_set_handler'.
158 type CryptoSetHandler struct {
159 AlgName string `binapi:"string[32],name=alg_name" json:"alg_name,omitempty"`
160 Engine string `binapi:"string[16],name=engine" json:"engine,omitempty"`
161 Oct CryptoOpClassType `binapi:"crypto_op_class_type,name=oct" json:"oct,omitempty"`
162 IsAsync uint8 `binapi:"u8,name=is_async" json:"is_async,omitempty"`
165 func (m *CryptoSetHandler) Reset() { *m = CryptoSetHandler{} }
166 func (*CryptoSetHandler) GetMessageName() string { return "crypto_set_handler" }
167 func (*CryptoSetHandler) GetCrcString() string { return "ce9ad00d" }
168 func (*CryptoSetHandler) GetMessageType() api.MessageType {
169 return api.RequestMessage
172 func (m *CryptoSetHandler) Size() (size int) {
176 size += 32 // m.AlgName
177 size += 16 // m.Engine
179 size += 1 // m.IsAsync
182 func (m *CryptoSetHandler) Marshal(b []byte) ([]byte, error) {
184 b = make([]byte, m.Size())
186 buf := codec.NewBuffer(b)
187 buf.EncodeString(m.AlgName, 32)
188 buf.EncodeString(m.Engine, 16)
189 buf.EncodeUint8(uint8(m.Oct))
190 buf.EncodeUint8(m.IsAsync)
191 return buf.Bytes(), nil
193 func (m *CryptoSetHandler) Unmarshal(b []byte) error {
194 buf := codec.NewBuffer(b)
195 m.AlgName = buf.DecodeString(32)
196 m.Engine = buf.DecodeString(16)
197 m.Oct = CryptoOpClassType(buf.DecodeUint8())
198 m.IsAsync = buf.DecodeUint8()
202 // CryptoSetHandlerReply defines message 'crypto_set_handler_reply'.
203 type CryptoSetHandlerReply struct {
204 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
207 func (m *CryptoSetHandlerReply) Reset() { *m = CryptoSetHandlerReply{} }
208 func (*CryptoSetHandlerReply) GetMessageName() string { return "crypto_set_handler_reply" }
209 func (*CryptoSetHandlerReply) GetCrcString() string { return "e8d4e804" }
210 func (*CryptoSetHandlerReply) GetMessageType() api.MessageType {
211 return api.ReplyMessage
214 func (m *CryptoSetHandlerReply) Size() (size int) {
218 size += 4 // m.Retval
221 func (m *CryptoSetHandlerReply) Marshal(b []byte) ([]byte, error) {
223 b = make([]byte, m.Size())
225 buf := codec.NewBuffer(b)
226 buf.EncodeInt32(m.Retval)
227 return buf.Bytes(), nil
229 func (m *CryptoSetHandlerReply) Unmarshal(b []byte) error {
230 buf := codec.NewBuffer(b)
231 m.Retval = buf.DecodeInt32()
235 func init() { file_crypto_binapi_init() }
236 func file_crypto_binapi_init() {
237 api.RegisterMessage((*CryptoSetAsyncDispatch)(nil), "crypto_set_async_dispatch_5ca4adc0")
238 api.RegisterMessage((*CryptoSetAsyncDispatchReply)(nil), "crypto_set_async_dispatch_reply_e8d4e804")
239 api.RegisterMessage((*CryptoSetHandler)(nil), "crypto_set_handler_ce9ad00d")
240 api.RegisterMessage((*CryptoSetHandlerReply)(nil), "crypto_set_handler_reply_e8d4e804")
243 // Messages returns list of all messages in this module.
244 func AllMessages() []api.Message {
245 return []api.Message{
246 (*CryptoSetAsyncDispatch)(nil),
247 (*CryptoSetAsyncDispatchReply)(nil),
248 (*CryptoSetHandler)(nil),
249 (*CryptoSetHandlerReply)(nil),