[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.54,1.55 int_table.
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.54,1.55 int_table.c,1.56,1.57 lib_socket.c,1.10,1.11 |
Date: |
Thu, 03 Apr 2003 00:39:36 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv30098/engine
Modified Files:
int_proto.h int_table.c lib_socket.c
Log Message:
New internalcalls for socket support.
Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** int_proto.h 1 Apr 2003 22:30:07 -0000 1.54
--- int_proto.h 3 Apr 2003 05:39:33 -0000 1.55
***************
*** 235,240 ****
extern ILObject * _IL_ClrSecurity_GetPermissionsFrom(ILExecThread * _thread,
ILInt32 _p1);
- extern ILObject * _IL_ClrSecurity_GetPermissions(ILExecThread * _thread,
ILInt32 _p1);
extern void _IL_ClrSecurity_SetPermissions(ILExecThread * _thread, ILObject *
_p1, ILInt32 _p2);
extern void _IL_GCHandle_GCFree(ILExecThread * _thread, ILInt32 _p1);
--- 235,240 ----
extern ILObject * _IL_ClrSecurity_GetPermissionsFrom(ILExecThread * _thread,
ILInt32 _p1);
extern void _IL_ClrSecurity_SetPermissions(ILExecThread * _thread, ILObject *
_p1, ILInt32 _p2);
+ extern ILObject * _IL_ClrSecurity_GetPermissions(ILExecThread * _thread,
ILInt32 _p1);
extern void _IL_GCHandle_GCFree(ILExecThread * _thread, ILInt32 _p1);
***************
*** 486,490 ****
extern ILBool _IL_FileMethods_Open(ILExecThread * _thread, ILString * _p1,
ILInt32 _p2, ILInt32 _p3, ILInt32 _p4, ILNativeInt * handle);
extern ILInt32 _IL_FileMethods_GetErrno(ILExecThread * _thread);
- extern ILBool _IL_FileMethods_HasAsync(ILExecThread * _thread);
extern ILBool _IL_FileMethods_CanSeek(ILExecThread * _thread, ILNativeInt
_p1);
extern ILBool _IL_FileMethods_CheckHandleAccess(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2);
--- 486,489 ----
***************
*** 501,504 ****
--- 500,504 ----
extern ILInt32 _IL_FileMethods_SetLastAccessTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
extern ILInt32 _IL_FileMethods_SetLastWriteTime(ILExecThread * _thread,
ILString * _p1, ILInt64 _p2);
+ extern ILBool _IL_FileMethods_HasAsync(ILExecThread * _thread);
extern ILBool _IL_RuntimeSecurityManager_CanUseFileHandle(ILExecThread *
_thread, ILObject * _this, ILNativeInt _p1);
***************
*** 547,550 ****
--- 547,551 ----
extern void _IL_CryptoMethods_StoreKey(ILExecThread * _thread, ILInt32 _p1,
ILString * _p2, System_Array * _p3);
+ extern ILNativeInt _IL_SocketMethods_GetInvalidHandle(ILExecThread * _thread);
extern ILBool _IL_SocketMethods_Create(ILExecThread * _thread, ILInt32 _p1,
ILInt32 _p2, ILInt32 _p3, ILNativeInt * handle);
extern ILBool _IL_SocketMethods_Bind(ILExecThread * _thread, ILNativeInt _p1,
ILInt32 _p2, ILInt64 _p3, ILInt32 _p4);
***************
*** 559,564 ****
--- 560,578 ----
extern ILBool _IL_SocketMethods_Close(ILExecThread * _thread, ILNativeInt
_p1);
extern ILInt32 _IL_SocketMethods_Select(ILExecThread * _thread, System_Array
* _p1, System_Array * _p2, System_Array * _p3, ILInt64 _p4);
+ extern ILBool _IL_SocketMethods_SetBlocking(ILExecThread * _thread,
ILNativeInt _p1, ILBool _p2);
+ extern ILInt32 _IL_SocketMethods_GetAvailable(ILExecThread * _thread,
ILNativeInt _p1);
+ extern ILBool _IL_SocketMethods_GetSockName(ILExecThread * _thread,
ILNativeInt _p1, ILInt64 * address, ILInt32 * port);
+ extern ILBool _IL_SocketMethods_SetSocketOption(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 _p4);
+ extern ILBool _IL_SocketMethods_GetSocketOption(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt32 _p3, ILInt32 * value);
+ extern ILBool _IL_SocketMethods_SetLingerOption(ILExecThread * _thread,
ILNativeInt _p1, ILBool _p2, ILInt32 _p3);
+ extern ILBool _IL_SocketMethods_GetLingerOption(ILExecThread * _thread,
ILNativeInt _p1, ILBool * enabled, ILInt32 * seconds);
+ extern ILBool _IL_SocketMethods_SetMulticastOption(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt64 _p3, ILInt64 _p4);
+ extern ILBool _IL_SocketMethods_GetMulticastOption(ILExecThread * _thread,
ILNativeInt _p1, ILInt32 _p2, ILInt64 * group, ILInt64 * mcint);
extern ILInt32 _IL_SocketMethods_GetErrno(ILExecThread * _thread);
extern ILString * _IL_SocketMethods_GetErrnoMessage(ILExecThread * _thread,
ILInt32 _p1);
+ extern ILBool _IL_SocketMethods_CanStartThreads(ILExecThread * _thread);
+ extern ILBool _IL_SocketMethods_QueueCompletionItem(ILExecThread * _thread,
ILObject * _p1, ILObject * _p2);
+ extern ILObject * _IL_SocketMethods_CreateManualResetEvent(ILExecThread *
_thread);
+ extern void _IL_SocketMethods_WaitHandleSet(ILExecThread * _thread, ILObject
* _p1);
extern ILInt32 _IL_IPAddress_HostToNetworkOrder_i(ILExecThread * _thread,
ILInt32 _p1);
Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** int_table.c 1 Apr 2003 22:30:07 -0000 1.56
--- int_table.c 3 Apr 2003 05:39:33 -0000 1.57
***************
*** 1246,1251 ****
IL_METHOD_BEGIN(ClrSecurity_Methods)
IL_METHOD("GetPermissionsFrom", "(i)oSystem.Security.ClrPermissions;",
_IL_ClrSecurity_GetPermissionsFrom, marshal_ppi)
- IL_METHOD("GetPermissions", "(i)oSystem.Security.ClrPermissions;",
_IL_ClrSecurity_GetPermissions, marshal_ppi)
IL_METHOD("SetPermissions", "(oSystem.Security.ClrPermissions;i)V",
_IL_ClrSecurity_SetPermissions, marshal_vppi)
IL_METHOD_END
--- 1246,1251 ----
IL_METHOD_BEGIN(ClrSecurity_Methods)
IL_METHOD("GetPermissionsFrom", "(i)oSystem.Security.ClrPermissions;",
_IL_ClrSecurity_GetPermissionsFrom, marshal_ppi)
IL_METHOD("SetPermissions", "(oSystem.Security.ClrPermissions;i)V",
_IL_ClrSecurity_SetPermissions, marshal_vppi)
+ IL_METHOD("GetPermissions", "(i)oSystem.Security.ClrPermissions;",
_IL_ClrSecurity_GetPermissions, marshal_ppi)
IL_METHOD_END
***************
*** 2343,2347 ****
IL_METHOD("Open",
"(oSystem.String;vSystem.IO.FileMode;vSystem.IO.FileAccess;vSystem.IO.FileShare;&j)Z",
_IL_FileMethods_Open, marshal_bppiiip)
IL_METHOD("GetErrno", "()vPlatform.Errno;", _IL_FileMethods_GetErrno,
marshal_ip)
- IL_METHOD("HasAsync", "()Z", _IL_FileMethods_HasAsync, marshal_bp)
IL_METHOD("CanSeek", "(j)Z", _IL_FileMethods_CanSeek, marshal_bpj)
IL_METHOD("CheckHandleAccess", "(jvSystem.IO.FileAccess;)Z",
_IL_FileMethods_CheckHandleAccess, marshal_bpji)
--- 2343,2346 ----
***************
*** 2358,2361 ****
--- 2357,2361 ----
IL_METHOD("SetLastAccessTime", "(oSystem.String;l)vPlatform.Errno;",
_IL_FileMethods_SetLastAccessTime, marshal_ippl)
IL_METHOD("SetLastWriteTime", "(oSystem.String;l)vPlatform.Errno;",
_IL_FileMethods_SetLastWriteTime, marshal_ippl)
+ IL_METHOD("HasAsync", "()Z", _IL_FileMethods_HasAsync, marshal_bp)
IL_METHOD_END
***************
*** 2563,2569 ****
--- 2563,2633 ----
#endif
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjb(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt,
ILInt8))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), *((ILInt8
*)(avalue[2])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjpp(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, void *,
void *))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])), *((void *
*)(avalue[2])), *((void * *)(avalue[3])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjiii(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, ILInt32,
ILInt32, ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])),
*((ILInt32 *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((ILInt32
*)(avalue[4])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjiip(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, ILInt32,
ILInt32, void *))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])),
*((ILInt32 *)(avalue[2])), *((ILInt32 *)(avalue[3])), *((void * *)(avalue[4])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjbi(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, ILInt8,
ILInt32))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])),
*((ILInt8 *)(avalue[2])), *((ILInt32 *)(avalue[3])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjill(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, ILInt32,
ILInt64, ILInt64))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])),
*((ILInt32 *)(avalue[2])), *((ILInt64 *)(avalue[3])), *((ILInt64
*)(avalue[4])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_bpjipp(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((ILNativeInt *)rvalue) = (*(ILInt8 (*)(void *, ILNativeUInt, ILInt32,
void *, void *))fn)(*((void * *)(avalue[0])), *((ILNativeUInt *)(avalue[1])),
*((ILInt32 *)(avalue[2])), *((void * *)(avalue[3])), *((void * *)(avalue[4])));
+ }
+
+ #endif
+
#ifndef _IL_SocketMethods_suppressed
IL_METHOD_BEGIN(SocketMethods_Methods)
+ IL_METHOD("GetInvalidHandle", "()j",
_IL_SocketMethods_GetInvalidHandle, marshal_jp)
IL_METHOD("Create", "(iii&j)Z", _IL_SocketMethods_Create,
marshal_bpiiip)
IL_METHOD("Bind", "(jili)Z", _IL_SocketMethods_Bind, marshal_bpjili)
***************
*** 2578,2583 ****
--- 2642,2660 ----
IL_METHOD("Close", "(j)Z", _IL_SocketMethods_Close, marshal_bpj)
IL_METHOD("Select", "([j[j[jl)i", _IL_SocketMethods_Select,
marshal_ippppl)
+ IL_METHOD("SetBlocking", "(jZ)Z", _IL_SocketMethods_SetBlocking,
marshal_bpjb)
+ IL_METHOD("GetAvailable", "(j)i", _IL_SocketMethods_GetAvailable,
marshal_ipj)
+ IL_METHOD("GetSockName", "(j&l&i)Z", _IL_SocketMethods_GetSockName,
marshal_bpjpp)
+ IL_METHOD("SetSocketOption", "(jiii)Z",
_IL_SocketMethods_SetSocketOption, marshal_bpjiii)
+ IL_METHOD("GetSocketOption", "(jii&i)Z",
_IL_SocketMethods_GetSocketOption, marshal_bpjiip)
+ IL_METHOD("SetLingerOption", "(jZi)Z",
_IL_SocketMethods_SetLingerOption, marshal_bpjbi)
+ IL_METHOD("GetLingerOption", "(j&Z&i)Z",
_IL_SocketMethods_GetLingerOption, marshal_bpjpp)
+ IL_METHOD("SetMulticastOption", "(jill)Z",
_IL_SocketMethods_SetMulticastOption, marshal_bpjill)
+ IL_METHOD("GetMulticastOption", "(ji&l&l)Z",
_IL_SocketMethods_GetMulticastOption, marshal_bpjipp)
IL_METHOD("GetErrno", "()vPlatform.Errno;", _IL_SocketMethods_GetErrno,
marshal_ip)
IL_METHOD("GetErrnoMessage", "(vPlatform.Errno;)oSystem.String;",
_IL_SocketMethods_GetErrnoMessage, marshal_ppi)
+ IL_METHOD("CanStartThreads", "()Z", _IL_SocketMethods_CanStartThreads,
marshal_bp)
+ IL_METHOD("QueueCompletionItem",
"(oSystem.AsyncCallback;oSystem.IAsyncResult;)Z",
_IL_SocketMethods_QueueCompletionItem, marshal_bppp)
+ IL_METHOD("CreateManualResetEvent", "()oSystem.Threading.WaitHandle;",
_IL_SocketMethods_CreateManualResetEvent, marshal_pp)
+ IL_METHOD("WaitHandleSet", "(oSystem.Threading.WaitHandle;)V",
_IL_SocketMethods_WaitHandleSet, marshal_vpp)
IL_METHOD_END
Index: lib_socket.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_socket.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** lib_socket.c 13 Dec 2002 11:36:00 -0000 1.10
--- lib_socket.c 3 Apr 2003 05:39:33 -0000 1.11
***************
*** 40,43 ****
--- 40,51 ----
/*
+ * public static IntPtr GetInvalidHandle();
+ */
+ ILNativeInt _IL_SocketMethods_GetInvalidHandle(ILExecThread *_thread)
+ {
+ return _IL_FileMethods_GetInvalidHandle(_thread);
+ }
+
+ /*
* public static bool Create(int af, int st, int pt, out IntPtr handle);
*/
***************
*** 215,218 ****
--- 223,382 ----
/*
+ * public static bool SetBlocking(IntPtr handle, bool blocking);
+ */
+ ILBool _IL_SocketMethods_SetBlocking(ILExecThread *_thread,
+
ILNativeInt handle, ILBool blocking)
+ {
+ return (ILSysIOSocketSetBlocking
+ ((ILSysIOHandle)handle, (int)blocking) != 0);
+ }
+
+ /*
+ * public static int GetAvailable(IntPtr handle);
+ */
+ ILInt32 _IL_SocketMethods_GetAvailable(ILExecThread *_thread,
+
ILNativeInt handle)
+ {
+ return ILSysIOSocketGetAvailable((ILSysIOHandle)handle);
+ }
+
+ /*
+ * public static bool GetSockName(IntPtr handle, out long address,
+ * out int port);
+ */
+ ILBool _IL_SocketMethods_GetSockName(ILExecThread * _thread,
+
ILNativeInt handle,
+
ILInt64 *address, ILInt32 *port)
+ {
+ ILSysIOSockAddr addr;
+ if(ILSysIOSocketGetName((ILSysIOHandle)handle, &addr))
+ {
+ *address = (ILInt64)(addr.addr);
+ *port = (ILInt32)(addr.port);
+ return 1;
+ }
+ else
+ {
+ *address = 0;
+ *port = 0;
+ return 0;
+ }
+ }
+
+ /*
+ * public static bool SetSocketOption(IntPtr handle, int level,
+ * int
name, int value);
+ */
+ ILBool _IL_SocketMethods_SetSocketOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILInt32 level,
+
ILInt32 name,
+
ILInt32 value)
+ {
+ return (ILSysIOSocketSetOption((ILSysIOHandle)handle,
+ level, name,
value) != 0);
+ }
+
+ /*
+ * public static bool GetSocketOption(IntPtr handle, int level,
+ * int
name, out int value);
+ */
+ ILBool _IL_SocketMethods_GetSocketOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILInt32 level,
+
ILInt32 name,
+
ILInt32 *value)
+ {
+ *value = 0;
+ return (ILSysIOSocketGetOption((ILSysIOHandle)handle,
+ level, name,
value) != 0);
+ }
+
+ /*
+ * public static bool SetLingerOption(IntPtr handle, bool enabled,
+ * int
seconds);
+ */
+ ILBool _IL_SocketMethods_SetLingerOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILBool enabled,
+
ILInt32 seconds)
+ {
+ return (ILSysIOSocketSetLinger((ILSysIOHandle)handle,
+ (enabled !=
0), (int)seconds) != 0);
+ }
+
+ /*
+ * public static bool GetLingerOption(IntPtr handle, out bool enabled,
+ * out
int seconds);
+ */
+ extern ILBool _IL_SocketMethods_GetLingerOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILBool *enabled,
+
ILInt32 *seconds)
+ {
+ int enab, secs;
+ if(ILSysIOSocketGetLinger((ILSysIOHandle)handle, &enab, &secs))
+ {
+ *enabled = (enab != 0);
+ *seconds = (ILInt32)secs;
+ return 1;
+ }
+ else
+ {
+ *enabled = 0;
+ *seconds = 0;
+ return 0;
+ }
+ }
+
+ /*
+ * public static bool SetMulticastOption(IntPtr handle, int name,
+ *
long group, long mcint);
+ */
+ ILBool _IL_SocketMethods_SetMulticastOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILInt32 name,
+
ILInt64 group,
+
ILInt64 mcint)
+ {
+ ILSysIOSockAddr g, m;
+ g.family = AF_INET;
+ g.addr = (unsigned long)group;
+ g.port = 0;
+ m.family = AF_INET;
+ m.addr = (unsigned long)mcint;
+ m.port = 0;
+ return (ILSysIOSocketSetMulticast((ILSysIOHandle)handle,
+ name,
&g, &m) != 0);
+ }
+
+ /*
+ * public static bool GetMulticastOption(IntPtr handle, int name,
+ *
out long group, out long mcint);
+ */
+ ILBool _IL_SocketMethods_GetMulticastOption(ILExecThread *_thread,
+
ILNativeInt handle,
+
ILInt32 name,
+
ILInt64 *group,
+
ILInt64 *mcint)
+ {
+ ILSysIOSockAddr g, m;
+ ILMemZero(&g, sizeof(g));
+ ILMemZero(&m, sizeof(m));
+ if(ILSysIOSocketGetMulticast((ILSysIOHandle)handle, name, &g, &m))
+ {
+ *group = (ILInt64)(g.addr);
+ *mcint = (ILInt64)(m.addr);
+ return 1;
+ }
+ else
+ {
+ *group = 0;
+ *mcint = 0;
+ return 0;
+ }
+ }
+
+ /*
* public static Errno GetErrno();
*/
***************
*** 236,239 ****
--- 400,451 ----
return 0;
}
+ }
+
+ /*
+ * public static bool CanStartThreads();
+ */
+ ILBool _IL_SocketMethods_CanStartThreads(ILExecThread *_thread)
+ {
+ return _IL_Thread_CanStartThreads(_thread);
+ }
+
+ /*
+ * public static bool QueueCompletionItem(AsyncCallback callback,
+ *
IAsyncResult state);
+ */
+ ILBool _IL_SocketMethods_QueueCompletionItem(ILExecThread *_thread,
+
ILObject *callback,
+
ILObject *state)
+ {
+ /* This provides backdoor access to "ThreadPool.QueueCompletionItem",
+ which cannot be called directly from C# code due to security checks
*/
+ ILBool result = 0;
+ ILExecThreadCallNamed(_thread, "System.Threading.ThreadPool",
+ "QueueCompletionItem",
+
"(oSystem.AsyncCallback;oSystem.IAsyncResult;)Z",
+ &result, callback, state);
+ return result;
+ }
+
+ /*
+ * public static WaitHandle CreateManualResetEvent();
+ */
+ ILObject *_IL_SocketMethods_CreateManualResetEvent(ILExecThread *_thread)
+ {
+ return ILExecThreadNew(_thread, "System.Threading.ManualResetEvent",
+ "(TZ)V", (ILVaInt)0);
+ }
+
+ /*
+ * public static void WaitHandleSet(WaitHandle waitHandle);
+ */
+ void _IL_SocketMethods_WaitHandleSet(ILExecThread *_thread,
+
ILObject *waitHandle)
+ {
+ /* This provides backdoor access to "ManualResetEvent.Set",
+ which cannot be called directly in ECMA_COMPAT mode */
+ ILBool result = 0;
+ ILExecThreadCallNamed(_thread, "System.Threading.ManualResetEvent",
+ "Set", "(T)Z", &result,
waitHandle);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.54,1.55 int_table.c,1.56,1.57 lib_socket.c,1.10,1.11,
Rhys Weatherley <address@hidden> <=