Subversion Repositories Kolibri OS

Rev

Rev 3444 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3081 leency 1
#define SOCKET_PASSIVE 0
2
#define SOCKET_ACTIVE  1
3958 leency 3
 
4
inline fastcall int GetNumOfActiveNetworkDevices()
5
{
6
	$mov eax,74
7
	BL = -1;
8
	$int 0x40
9
}
10
 
11
inline fastcall dword OpenUnixSocket( ECX, EDX, ESI, EDI)
12
{
13
	$mov eax,75
14
	$mov bl,0
15
	$int 0x40
16
}
17
 
18
 
19
 
20
 
21
 
22
/* ======================= OLD =========================*/
23
 
3081 leency 24
inline fastcall dword OpenSocket( ECX, EDX, ESI, EDI)
25
{
26
	$mov eax,53
27
	$mov ebx,5
28
	$int 0x40
29
}
30
 
3958 leency 31
 
3436 esevece 32
inline fastcall dword CloseSocket( ECX )
33
{
34
	$mov eax, 53
35
	$mov ebx, 8
36
	$int 0x40
37
}
38
 
3081 leency 39
inline fastcall int StatusSocket( ECX)
40
{
41
	$mov eax,53
42
	$mov ebx,6
43
	$int 0x40
44
}
45
 
3444 leency 46
inline fastcall dword ReadSocket( ECX)
3081 leency 47
{
48
	$mov eax,53
49
	$mov ebx,3
50
	$int 0x40
51
	return BL;
52
}
53
 
3436 esevece 54
inline fastcall dword ReadNetworkData( ECX, EDX, ESI)
55
{
56
	$mov eax, 53
57
	$mov ebx, 11
58
	$int 0x40
59
}
60
 
3081 leency 61
inline fastcall dword PollSocket( ECX)
62
{
63
	$mov eax,53
64
	$mov ebx,2
65
	$int 0x40
66
}
67
 
68
 
69
inline fastcall dword WriteSocket( ECX, EDX, ESI)
70
{
71
	$mov eax,53
72
	$mov ebx,7
73
	$int 0x40
74
}
75
 
76
inline fastcall int IsPortFree( ECX)
77
{
78
	$mov eax,53
79
	$mov ebx,9
80
	$int 0x40
81
}
82
 
83
unsigned int GetFreePort(int port_i)
84
{
85
	for (; port_i<65535; port_i++;)
86
		if (IsPortFree(port_i)==1) return port_i;
87
	return 0;
88
}