Subversion Repositories Kolibri OS

Rev

Rev 3444 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #define SOCKET_PASSIVE 0
  2. #define SOCKET_ACTIVE  1
  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.  
  24. inline fastcall dword OpenSocket( ECX, EDX, ESI, EDI)
  25. {
  26.         $mov eax,53
  27.         $mov ebx,5
  28.         $int 0x40
  29. }
  30.  
  31.  
  32. inline fastcall dword CloseSocket( ECX )
  33. {
  34.         $mov eax, 53
  35.         $mov ebx, 8
  36.         $int 0x40
  37. }
  38.  
  39. inline fastcall int StatusSocket( ECX)
  40. {
  41.         $mov eax,53
  42.         $mov ebx,6
  43.         $int 0x40
  44. }
  45.  
  46. inline fastcall dword ReadSocket( ECX)
  47. {
  48.         $mov eax,53
  49.         $mov ebx,3
  50.         $int 0x40
  51.         return BL;
  52. }
  53.  
  54. inline fastcall dword ReadNetworkData( ECX, EDX, ESI)
  55. {
  56.         $mov eax, 53
  57.         $mov ebx, 11
  58.         $int 0x40
  59. }
  60.  
  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. }
  89.