Changed net branch specific kernel function numbers to make room for function 73 in main branch.

git-svn-id: svn://kolibrios.org@2364 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-02-21 10:57:36 +00:00
parent 0ec151c852
commit e8a8f9b75d
7 changed files with 188 additions and 187 deletions

View File

@ -43,7 +43,7 @@ START: ; start of execution
mov [last],0 mov [last],0
.loop: .loop:
mcall 75, 0x06080003, [last],,,ARP_ENTRY mcall 76, 0x06080003, [last],,,ARP_ENTRY
cmp eax, -1 cmp eax, -1
je mainloop je mainloop

View File

@ -676,13 +676,13 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
mov eax, 0x01000100 mov eax, 0x01000100
stosd stosd
; 7. Get DNS server address. ; 7. Get DNS server address.
mcall 75, 0x00000004 ; protocol IP=0, device number=0, function=get DNS address mcall 76, 0x00000004 ; protocol IP=0, device number=0, function=get DNS address
cmp eax, -1 cmp eax, -1
je .ret.dnserr je .ret.dnserr
mov esi, eax ; put server address to esi mov esi, eax ; put server address to esi
; 8. Open UDP socketnum to DNS server, port 53. ; 8. Open UDP socketnum to DNS server, port 53.
; 8a. Create new socketnum. ; 8a. Create new socketnum.
mcall 74, 0, AF_INET4, SOCK_DGRAM mcall 75, 0, AF_INET4, SOCK_DGRAM
cmp eax, -1 ; error? cmp eax, -1 ; error?
jz .ret.dnserr jz .ret.dnserr
mov ecx, eax ; put socketnum handle to ecx mov ecx, eax ; put socketnum handle to ecx
@ -693,7 +693,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
push AF_INET4 + (53 shl 16) push AF_INET4 + (53 shl 16)
; sin_family and sin_port in network byte order ; sin_family and sin_port in network byte order
; 8c. Connect. ; 8c. Connect.
mcall 74, 4, , esp, sizeof.sockaddr_in mcall 75, 4, , esp, sizeof.sockaddr_in
; 8d. Restore the stack, undo 8b. ; 8d. Restore the stack, undo 8b.
add esp, esi add esp, esi
; 8e. Check result. ; 8e. Check result.
@ -703,7 +703,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
sub edi, esp ; get packet length sub edi, esp ; get packet length
mov esi, edi mov esi, edi
xor edi, edi xor edi, edi
mcall 74, 6, , esp mcall 75, 6, , esp
cmp eax, -1 cmp eax, -1
jz .ret.close jz .ret.close
mov eax, [.reqdata] mov eax, [.reqdata]
@ -712,7 +712,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
pop eax ; return status: more processing required pop eax ; return status: more processing required
jmp .ret.dns jmp .ret.dns
.ret.close: .ret.close:
mcall 74, 1 mcall 75, 1
.ret.dnserr: .ret.dnserr:
push EAI_AGAIN push EAI_AGAIN
pop eax pop eax
@ -762,7 +762,7 @@ end virtual
; 2. Read UDP datagram. ; 2. Read UDP datagram.
mov ecx, [edi+__gai_reqdata.socketnum] mov ecx, [edi+__gai_reqdata.socketnum]
push edi push edi
mcall 74, 7, , , 512, 0 mcall 75, 7, , , 512, 0
pop edi pop edi
; 3. Ignore events for other socketnums (return if no data read) ; 3. Ignore events for other socketnums (return if no data read)
test eax, eax test eax, eax
@ -923,7 +923,7 @@ end virtual
push eax push eax
mov ecx, [.reqdata] mov ecx, [.reqdata]
mov ecx, [ecx+__gai_reqdata.socketnum] mov ecx, [ecx+__gai_reqdata.socketnum]
mcall 74, 1 mcall 75, 1
pop eax pop eax
; 16. Restore used registers, destroy stack frame and return. ; 16. Restore used registers, destroy stack frame and return.
.ret: .ret:
@ -1223,7 +1223,7 @@ getaddrinfo_abort: ;;
; 1. Allocated resources: only socketnum, so close it and return. ; 1. Allocated resources: only socketnum, so close it and return.
mov eax, [esp+8] mov eax, [esp+8]
mov ecx, [eax+__gai_reqdata.socketnum] mov ecx, [eax+__gai_reqdata.socketnum]
mcall 74, 1 mcall 75, 1
; 2. Restore used registers and return. ; 2. Restore used registers and return.
pop ebx pop ebx
ret 4 ret 4

View File

@ -143,13 +143,13 @@ hook:
reset: reset:
movzx ebx, byte[drivernumber] movzx ebx, byte[drivernumber]
mcall 73,,2 mcall 74,,2
jmp still jmp still
unload: unload:
movzx ebx, byte[drivernumber] movzx ebx, byte[drivernumber]
mcall 73,,3 mcall 74,,3
jmp still jmp still

View File

@ -79,7 +79,7 @@ START: ; start of execution
mov ebx,1337 shl 16 + 4 mov ebx,1337 shl 16 + 4
mov bh, [device] mov bh, [device]
mcall 75 mcall 76
push eax push eax
push bx push bx
@ -112,22 +112,22 @@ START: ; start of execution
mov ebx, 0 shl 16 + 8 mov ebx, 0 shl 16 + 8
mov bh, [device] mov bh, [device]
mcall 75 mcall 76
push eax push eax
dec bl dec bl
dec bl dec bl
mcall 75 mcall 76
push eax push eax
dec bl dec bl
dec bl dec bl
mcall 75 mcall 76
push eax push eax
dec bl dec bl
dec bl dec bl
mcall 75 mcall 76
push eax push eax
mov edx, 135 shl 16 + 75 + 2*18 mov edx, 135 shl 16 + 75 + 2*18
@ -199,7 +199,7 @@ START: ; start of execution
mov bh, [device] mov bh, [device]
@@: @@:
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -211,7 +211,7 @@ START: ; start of execution
@@: @@:
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -252,12 +252,12 @@ START: ; start of execution
mov ebx, 0 shl 16 mov ebx, 0 shl 16
mov bh, [device] mov bh, [device]
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -284,17 +284,17 @@ START: ; start of execution
mov ebx, 0x0608 shl 16 + 0 mov ebx, 0x0608 shl 16 + 0
mov bh, [device] mov bh, [device]
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -323,12 +323,12 @@ not_103:
mov ebx, 1 shl 16 + 0 mov ebx, 1 shl 16 + 0
mov bh, [device] mov bh, [device]
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -354,12 +354,12 @@ not_104:
mov ebx, 17 shl 16 + 0 mov ebx, 17 shl 16 + 0
mov bh, [device] mov bh, [device]
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
@ -385,12 +385,12 @@ not_105:
mov ebx, 6 shl 16 + 0 mov ebx, 6 shl 16 + 0
mov bh, [device] mov bh, [device]
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl
push ebx push ebx
mcall 75 mcall 76
pop ebx pop ebx
push eax push eax
inc bl inc bl

View File

@ -61,12 +61,12 @@ EAI_BADHINTS = 12
EAI_PROTOCOL = 13 EAI_PROTOCOL = 13
EAI_OVERFLOW = 14 EAI_OVERFLOW = 14
socket fix 74, 0 socket fix 75, 0
close fix 74, 1 close fix 75, 1
bind fix 74, 2 bind fix 75, 2
listen fix 74, 3 listen fix 75, 3
connect fix 74, 4 connect fix 75, 4
accept fix 74, 5 accept fix 75, 5
send fix 74, 6 send fix 75, 6
recv fix 74, 7 recv fix 75, 7

View File

@ -129,7 +129,7 @@ START: ; start of execution
DEBUGF 1,">Zero-config service:\n" DEBUGF 1,">Zero-config service:\n"
mcall 75, 1337 shl 16 + 4 mcall 76, 1337 shl 16 + 4
cmp eax, -1 cmp eax, -1
je exit je exit
@ -169,22 +169,22 @@ START: ; start of execution
invoke ini.get_str, path, str_ipconfig, str_ip, inibuf, 16, 0 invoke ini.get_str, path, str_ipconfig, str_ip, inibuf, 16, 0
mov edx, inibuf mov edx, inibuf
call Ip2dword call Ip2dword
mcall 75, 3, edx mcall 76, 3, edx
invoke ini.get_str, path, str_ipconfig, str_gateway, inibuf, 16, 0 invoke ini.get_str, path, str_ipconfig, str_gateway, inibuf, 16, 0
mov edx, inibuf mov edx, inibuf
call Ip2dword call Ip2dword
mcall 75, 9, edx mcall 76, 9, edx
invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0 invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0
mov edx, inibuf mov edx, inibuf
call Ip2dword call Ip2dword
mcall 75, 5, edx mcall 76, 5, edx
invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0 invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0
mov edx, inibuf mov edx, inibuf
call Ip2dword call Ip2dword
mcall 75, 7, edx mcall 76, 7, edx
mcall -1 mcall -1
@ -194,20 +194,20 @@ skip_ini:
DEBUGF 1,"->Skip ini\n" DEBUGF 1,"->Skip ini\n"
mcall 74, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved) mcall 75, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved)
cmp eax, -1 cmp eax, -1
je error je error
mov [socketNum], eax mov [socketNum], eax
DEBUGF 1,"->socket %x opened\n", eax DEBUGF 1,"->socket %x opened\n", eax
mcall 74, 2, [socketNum], sockaddr1, 18 ; bind socket to local port 68 mcall 75, 2, [socketNum], sockaddr1, 18 ; bind socket to local port 68
cmp eax, -1 cmp eax, -1
je error je error
DEBUGF 1,"->Socket Bound to local port 68\n" DEBUGF 1,"->Socket Bound to local port 68\n"
mcall 74, 4, [socketNum], sockaddr2, 18 ; connect to 255.255.255.255 on port 67 mcall 75, 4, [socketNum], sockaddr2, 18 ; connect to 255.255.255.255 on port 67
cmp eax, -1 cmp eax, -1
je error je error
@ -283,7 +283,7 @@ request_options:
mov [dhcpMsgLen], dword 268 mov [dhcpMsgLen], dword 268
send_request: send_request:
mcall 74, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request ) mcall 75, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request )
mov eax, [dhcpMsg] ; Setup the DHCP buffer to receive response mov eax, [dhcpMsg] ; Setup the DHCP buffer to receive response
mov [dhcpMsgLen], eax ; Used as a pointer to the data mov [dhcpMsgLen], eax ; Used as a pointer to the data
@ -291,12 +291,12 @@ send_request:
mcall 23, TIMEOUT*10 ; wait for data mcall 23, TIMEOUT*10 ; wait for data
read_data: ; we have data - this will be the response read_data: ; we have data - this will be the response
mcall 74, 7, [socketNum], [dhcpMsg], BUFFER ; read data from socket mcall 75, 7, [socketNum], [dhcpMsg], BUFFER ; read data from socket
DEBUGF 1,"->%d bytes received\n", eax DEBUGF 1,"->%d bytes received\n", eax
push eax push eax
mcall 74, 1, [socketNum] ; exit the socket mcall 75, 1, [socketNum] ; exit the socket
pop eax pop eax
cmp eax, -1 cmp eax, -1
@ -355,7 +355,7 @@ parseResponse:
mov edx, [dhcpMsg] mov edx, [dhcpMsg]
pusha pusha
mcall 75, 3, [edx+16] mcall 76, 3, [edx+16]
mov eax,[edx] mov eax,[edx]
mov [dhcpClientIP],eax mov [dhcpClientIP],eax
DEBUGF 1,"Client: %u.%u.%u.%u\n",[edx+16]:1,[edx+17]:1,[edx+18]:1,[edx+19]:1 DEBUGF 1,"Client: %u.%u.%u.%u\n",[edx+16]:1,[edx+17]:1,[edx+18]:1,[edx+19]:1
@ -409,7 +409,7 @@ pr001:
jne @f jne @f
pusha pusha
mcall 75, 7, [edx] mcall 76, 7, [edx]
DEBUGF 1,"Subnet: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1 DEBUGF 1,"Subnet: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa popa
@ -420,7 +420,7 @@ pr001:
jne @f jne @f
pusha pusha
mcall 75, 9, [edx] mcall 76, 9, [edx]
DEBUGF 1,"Gateway: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1 DEBUGF 1,"Gateway: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa popa
@ -432,7 +432,7 @@ pr001:
jne next_option jne next_option
pusha pusha
mcall 75, 5, [edx] mcall 76, 5, [edx]
DEBUGF 1,"DNS: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1 DEBUGF 1,"DNS: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa popa
@ -452,11 +452,11 @@ link_local:
call random call random
mov ecx,0xfea9 ; IP 169.254.0.0 link local net, see RFC3927 mov ecx,0xfea9 ; IP 169.254.0.0 link local net, see RFC3927
mov cx,ax mov cx,ax
mcall 75, 3, ecx ; mask is 255.255.0.0 mcall 76, 3, ecx ; mask is 255.255.0.0
DEBUGF 1,"Link Local IP assinged: 169.254.%u.%u\n",[generator+2]:1,[generator+3]:1 DEBUGF 1,"Link Local IP assinged: 169.254.%u.%u\n",[generator+2]:1,[generator+3]:1
mcall 75, 5, 0xffff mcall 76, 5, 0xffff
mcall 75, 9, 0x0 mcall 76, 9, 0x0
mcall 75, 7, 0x0 mcall 76, 7, 0x0
mcall 5, PROBE_WAIT*100 mcall 5, PROBE_WAIT*100

View File

@ -253,9 +253,10 @@ iglobal
dd cross_order ; 70-Common file system interface, version 2 dd cross_order ; 70-Common file system interface, version 2
dd syscall_windowsettings ; 71-Window settings dd syscall_windowsettings ; 71-Window settings
dd sys_sendwindowmsg ; 72-Send window message dd sys_sendwindowmsg ; 72-Send window message
dd sys_network ; 73-Network stack dd undefined_syscall ; 73-reserved for blitter
dd sys_socket ; 74-Sockets dd sys_network ; 74-Network stack
dd sys_protocols ; 75-Protocols dd sys_socket ; 75-Sockets
dd sys_protocols ; 76-Protocols
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
dd sys_end ; -1-end application dd sys_end ; -1-end application