mirror of https://github.com/wolfSSL/wolfssl.git
update IO callback function names with CSharp wrapper
parent
38f916a798
commit
83324f39d7
|
@ -169,7 +169,7 @@ namespace wolfSSL.CSharp {
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate int CallbackIORecv_delegate(IntPtr ssl, IntPtr buf, int sz, IntPtr ctx);
|
public delegate int CallbackIORecv_delegate(IntPtr ssl, IntPtr buf, int sz, IntPtr ctx);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private extern static int wolfSSL_SetIORecv(IntPtr ctx, CallbackIORecv_delegate recv);
|
private extern static int wolfSSL_CTX_SetIORecv(IntPtr ctx, CallbackIORecv_delegate recv);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private extern static int wolfSSL_SetIOReadCtx(IntPtr ssl, IntPtr rctx);
|
private extern static int wolfSSL_SetIOReadCtx(IntPtr ssl, IntPtr rctx);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -178,7 +178,7 @@ namespace wolfSSL.CSharp {
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate int CallbackIOSend_delegate(IntPtr ssl, IntPtr buf, int sz, IntPtr ctx);
|
public delegate int CallbackIOSend_delegate(IntPtr ssl, IntPtr buf, int sz, IntPtr ctx);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private extern static int wolfSSL_SetIOSend(IntPtr ctx, CallbackIOSend_delegate send);
|
private extern static int wolfSSL_CTX_SetIOSend(IntPtr ctx, CallbackIOSend_delegate send);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private extern static int wolfSSL_SetIOWriteCtx(IntPtr ssl, IntPtr wctx);
|
private extern static int wolfSSL_SetIOWriteCtx(IntPtr ssl, IntPtr wctx);
|
||||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
@ -825,7 +825,7 @@ namespace wolfSSL.CSharp {
|
||||||
/* keep new function alive */
|
/* keep new function alive */
|
||||||
handles.set_receive(GCHandle.Alloc(func));
|
handles.set_receive(GCHandle.Alloc(func));
|
||||||
|
|
||||||
wolfSSL_SetIORecv(handles.get_ctx(), func);
|
wolfSSL_CTX_SetIORecv(handles.get_ctx(), func);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -856,7 +856,7 @@ namespace wolfSSL.CSharp {
|
||||||
/* keep new function alive */
|
/* keep new function alive */
|
||||||
handles.set_send(GCHandle.Alloc(func));
|
handles.set_send(GCHandle.Alloc(func));
|
||||||
|
|
||||||
wolfSSL_SetIOSend(handles.get_ctx(), func);
|
wolfSSL_CTX_SetIOSend(handles.get_ctx(), func);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -883,11 +883,11 @@ namespace wolfSSL.CSharp {
|
||||||
|
|
||||||
CallbackIORecv_delegate recv = new CallbackIORecv_delegate(wolfssl.wolfSSLCbIORecv);
|
CallbackIORecv_delegate recv = new CallbackIORecv_delegate(wolfssl.wolfSSLCbIORecv);
|
||||||
io.set_receive(GCHandle.Alloc(recv));
|
io.set_receive(GCHandle.Alloc(recv));
|
||||||
wolfSSL_SetIORecv(ctx, recv);
|
wolfSSL_CTX_SetIORecv(ctx, recv);
|
||||||
|
|
||||||
CallbackIOSend_delegate send = new CallbackIOSend_delegate(wolfssl.wolfSSLCbIOSend);
|
CallbackIOSend_delegate send = new CallbackIOSend_delegate(wolfssl.wolfSSLCbIOSend);
|
||||||
io.set_send(GCHandle.Alloc(send));
|
io.set_send(GCHandle.Alloc(send));
|
||||||
wolfSSL_SetIOSend(ctx, send);
|
wolfSSL_CTX_SetIOSend(ctx, send);
|
||||||
|
|
||||||
/* keep memory pinned */
|
/* keep memory pinned */
|
||||||
return GCHandle.ToIntPtr(GCHandle.Alloc(io, GCHandleType.Pinned));
|
return GCHandle.ToIntPtr(GCHandle.Alloc(io, GCHandleType.Pinned));
|
||||||
|
@ -918,11 +918,11 @@ namespace wolfSSL.CSharp {
|
||||||
|
|
||||||
CallbackIORecv_delegate recv = new CallbackIORecv_delegate(wolfssl.wolfSSL_dtlsCbIORecv);
|
CallbackIORecv_delegate recv = new CallbackIORecv_delegate(wolfssl.wolfSSL_dtlsCbIORecv);
|
||||||
io.set_receive(GCHandle.Alloc(recv));
|
io.set_receive(GCHandle.Alloc(recv));
|
||||||
wolfSSL_SetIORecv(ctx, recv);
|
wolfSSL_CTX_SetIORecv(ctx, recv);
|
||||||
|
|
||||||
CallbackIOSend_delegate send = new CallbackIOSend_delegate(wolfssl.wolfSSL_dtlsCbIOSend);
|
CallbackIOSend_delegate send = new CallbackIOSend_delegate(wolfssl.wolfSSL_dtlsCbIOSend);
|
||||||
io.set_send(GCHandle.Alloc(send));
|
io.set_send(GCHandle.Alloc(send));
|
||||||
wolfSSL_SetIOSend(ctx, send);
|
wolfSSL_CTX_SetIOSend(ctx, send);
|
||||||
|
|
||||||
/* keep memory pinned */
|
/* keep memory pinned */
|
||||||
return GCHandle.ToIntPtr(GCHandle.Alloc(io, GCHandleType.Pinned));
|
return GCHandle.ToIntPtr(GCHandle.Alloc(io, GCHandleType.Pinned));
|
||||||
|
|
Loading…
Reference in New Issue