@@ -112,6 +112,7 @@ public enum unitytls_x509verify_result : UInt32
112
112
UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR = 0x08000000 ,
113
113
}
114
114
115
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
115
116
public delegate unitytls_x509verify_result unitytls_x509verify_callback ( void * userData , unitytls_x509_ref cert , unitytls_x509verify_result result , unitytls_errorstate * errorState ) ;
116
117
117
118
// ------------------------------------
@@ -144,10 +145,15 @@ public struct unitytls_tlsctx_protocolrange
144
145
public unitytls_protocol max ;
145
146
} ;
146
147
148
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
147
149
public delegate size_t unitytls_tlsctx_write_callback ( void * userData , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
150
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
148
151
public delegate size_t unitytls_tlsctx_read_callback ( void * userData , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
152
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
149
153
public delegate void unitytls_tlsctx_trace_callback ( void * userData , unitytls_tlsctx * ctx , Int8 * traceMessage , size_t traceMessageLen ) ;
154
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
150
155
public delegate void unitytls_tlsctx_certificate_callback ( void * userData , unitytls_tlsctx * ctx , Int8 * cn , size_t cnLen , unitytls_x509name * caList , size_t caListLen , unitytls_x509list_ref * chain , unitytls_key_ref * key , unitytls_errorstate * errorState ) ;
156
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
151
157
public delegate unitytls_x509verify_result unitytls_tlsctx_x509verify_callback ( void * userData , unitytls_x509list_ref chain , unitytls_errorstate * errorState ) ;
152
158
153
159
[ StructLayout ( LayoutKind . Sequential ) ]
@@ -172,72 +178,103 @@ public class unitytls_interface_struct
172
178
public readonly UInt64 UNITYTLS_INVALID_HANDLE ;
173
179
public readonly unitytls_tlsctx_protocolrange UNITYTLS_TLSCTX_PROTOCOLRANGE_DEFAULT ;
174
180
181
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
175
182
public delegate unitytls_errorstate unitytls_errorstate_create_t ( ) ;
176
183
public unitytls_errorstate_create_t unitytls_errorstate_create ;
184
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
177
185
public delegate void unitytls_errorstate_raise_error_t ( unitytls_errorstate * errorState , unitytls_error_code errorCode ) ;
178
186
public unitytls_errorstate_raise_error_t unitytls_errorstate_raise_error ;
179
187
188
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
180
189
public delegate unitytls_key_ref unitytls_key_get_ref_t ( unitytls_key * key , unitytls_errorstate * errorState ) ;
181
190
public unitytls_key_get_ref_t unitytls_key_get_ref ;
191
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
182
192
public delegate unitytls_key * unitytls_key_parse_der_t ( UInt8 * buffer , size_t bufferLen , Int8 * password , size_t passwordLen , unitytls_errorstate * errorState ) ;
183
193
public unitytls_key_parse_der_t unitytls_key_parse_der ;
194
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
184
195
public delegate unitytls_key * unitytls_key_parse_pem_t ( Int8 * buffer , size_t bufferLen , Int8 * password , size_t passwordLen , unitytls_errorstate * errorState ) ;
185
196
public unitytls_key_parse_pem_t unitytls_key_parse_pem ;
197
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
186
198
public delegate void unitytls_key_free_t ( unitytls_key * key ) ;
187
199
public unitytls_key_free_t unitytls_key_free ;
188
200
201
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
189
202
public delegate size_t unitytls_x509_export_der_t ( unitytls_x509_ref cert , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
190
203
public unitytls_x509_export_der_t unitytls_x509_export_der ;
191
204
205
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
192
206
public delegate unitytls_x509list_ref unitytls_x509list_get_ref_t ( unitytls_x509list * list , unitytls_errorstate * errorState ) ;
193
207
public unitytls_x509list_get_ref_t unitytls_x509list_get_ref ;
208
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
194
209
public delegate unitytls_x509_ref unitytls_x509list_get_x509_t ( unitytls_x509list_ref list , size_t index , unitytls_errorstate * errorState ) ;
195
210
public unitytls_x509list_get_x509_t unitytls_x509list_get_x509 ;
211
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
196
212
public delegate unitytls_x509list * unitytls_x509list_create_t ( unitytls_errorstate * errorState ) ;
197
213
public unitytls_x509list_create_t unitytls_x509list_create ;
214
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
198
215
public delegate void unitytls_x509list_append_t ( unitytls_x509list * list , unitytls_x509_ref cert , unitytls_errorstate * errorState ) ;
199
216
public unitytls_x509list_append_t unitytls_x509list_append ;
217
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
200
218
public delegate void unitytls_x509list_append_der_t ( unitytls_x509list * list , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
201
219
public unitytls_x509list_append_der_t unitytls_x509list_append_der ;
220
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
202
221
public delegate void unitytls_x509list_append_pem_t ( unitytls_x509list * list , Int8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
203
222
public unitytls_x509list_append_der_t unitytls_x509list_append_pem ;
223
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
204
224
public delegate void unitytls_x509list_free_t ( unitytls_x509list * list ) ;
205
225
public unitytls_x509list_free_t unitytls_x509list_free ;
206
226
227
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
207
228
public delegate unitytls_x509verify_result unitytls_x509verify_default_ca_t ( unitytls_x509list_ref chain , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
208
229
public unitytls_x509verify_default_ca_t unitytls_x509verify_default_ca ;
230
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
209
231
public delegate unitytls_x509verify_result unitytls_x509verify_explicit_ca_t ( unitytls_x509list_ref chain , unitytls_x509list_ref trustCA , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
210
232
public unitytls_x509verify_explicit_ca_t unitytls_x509verify_explicit_ca ;
211
233
234
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
212
235
public delegate unitytls_tlsctx * unitytls_tlsctx_create_server_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , unitytls_x509list_ref certChain , unitytls_key_ref leafCertificateKey , unitytls_errorstate * errorState ) ;
213
236
public unitytls_tlsctx_create_server_t unitytls_tlsctx_create_server ;
237
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
214
238
public delegate unitytls_tlsctx * unitytls_tlsctx_create_client_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , Int8 * cn , size_t cnLen , unitytls_errorstate * errorState ) ;
215
239
public unitytls_tlsctx_create_client_t unitytls_tlsctx_create_client ;
240
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
216
241
public delegate void unitytls_tlsctx_server_require_client_authentication_t ( unitytls_tlsctx * ctx , unitytls_x509list_ref clientAuthCAList , unitytls_errorstate * errorState ) ;
217
242
public unitytls_tlsctx_server_require_client_authentication_t unitytls_tlsctx_server_require_client_authentication ;
243
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
218
244
public delegate void unitytls_tlsctx_set_certificate_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_certificate_callback cb , void * userData , unitytls_errorstate * errorState ) ;
219
245
public unitytls_tlsctx_set_certificate_callback_t unitytls_tlsctx_set_certificate_callback ;
246
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
220
247
public delegate void unitytls_tlsctx_set_trace_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_trace_callback cb , void * userData , unitytls_errorstate * errorState ) ;
221
248
public unitytls_tlsctx_set_trace_callback_t unitytls_tlsctx_set_trace_callback ;
249
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
222
250
public delegate void unitytls_tlsctx_set_x509verify_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
223
251
public unitytls_tlsctx_set_x509verify_callback_t unitytls_tlsctx_set_x509verify_callback ;
252
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
224
253
public delegate void unitytls_tlsctx_set_supported_ciphersuites_t ( unitytls_tlsctx * ctx , unitytls_ciphersuite * supportedCiphersuites , size_t supportedCiphersuitesLen , unitytls_errorstate * errorState ) ;
225
254
public unitytls_tlsctx_set_supported_ciphersuites_t unitytls_tlsctx_set_supported_ciphersuites ;
255
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
226
256
public delegate unitytls_ciphersuite unitytls_tlsctx_get_ciphersuite_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
227
257
public unitytls_tlsctx_get_ciphersuite_t unitytls_tlsctx_get_ciphersuite ;
258
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
228
259
public delegate unitytls_protocol unitytls_tlsctx_get_protocol_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
229
260
public unitytls_tlsctx_get_protocol_t unitytls_tlsctx_get_protocol ;
261
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
230
262
public delegate unitytls_x509verify_result unitytls_tlsctx_process_handshake_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
231
263
public unitytls_tlsctx_process_handshake_t unitytls_tlsctx_process_handshake ;
264
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
232
265
public delegate size_t unitytls_tlsctx_read_t ( unitytls_tlsctx * ctx , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
233
266
public unitytls_tlsctx_read_t unitytls_tlsctx_read ;
267
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
234
268
public delegate size_t unitytls_tlsctx_write_t ( unitytls_tlsctx * ctx , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
235
269
public unitytls_tlsctx_write_t unitytls_tlsctx_write ;
270
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
236
271
public delegate void unitytls_tlsctx_notify_close_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
237
272
public unitytls_tlsctx_notify_close_t unitytls_tlsctx_notify_close ;
273
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
238
274
public delegate void unitytls_tlsctx_free_t ( unitytls_tlsctx * ctx ) ;
239
275
public unitytls_tlsctx_free_t unitytls_tlsctx_free ;
240
276
277
+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
241
278
public delegate void unitytls_random_generate_bytes_t ( UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
242
279
public unitytls_random_generate_bytes_t unitytls_random_generate_bytes ;
243
280
}
0 commit comments