Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2855 → Rev 2856

/kernel/branches/net/applications/zeroconf/zeroconf.asm
5,6 → 5,8
;
; Written by HidnPlayr & Derpenguin
 
format binary as ""
 
use32
org 0x0
 
47,7 → 49,7
include '../debug-fdo.inc'
include '../network.inc'
include 'dhcp.inc'
include 'dll.inc'
include '../dll.inc'
 
 
Ip2dword:
129,7 → 131,7
 
DEBUGF 1,">Zero-config service:\n"
 
mcall 76, 1337 shl 16 + 4
mcall 76, API_ETH + 4
 
cmp eax, -1
je exit
169,22 → 171,22
invoke ini.get_str, path, str_ipconfig, str_ip, inibuf, 16, 0
mov edx, inibuf
call Ip2dword
mcall 76, 3, edx
mcall 76, API_IPv4 + 3, edx
 
invoke ini.get_str, path, str_ipconfig, str_gateway, inibuf, 16, 0
mov edx, inibuf
call Ip2dword
mcall 76, 9, edx
mcall 76, API_IPv4 + 9, edx
 
invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0
mov edx, inibuf
call Ip2dword
mcall 76, 5, edx
mcall 76, API_IPv4 + 5, edx
 
invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0
mov edx, inibuf
call Ip2dword
mcall 76, 7, edx
mcall 76, API_IPv4 + 7, edx
 
 
mcall -1
355,7 → 357,7
mov edx, [dhcpMsg]
 
pusha
mcall 76, 3, [edx+16]
mcall 76, API_IPv4 + 3, [edx+16]
mov eax,[edx]
mov [dhcpClientIP],eax
DEBUGF 1,"Client: %u.%u.%u.%u\n",[edx+16]:1,[edx+17]:1,[edx+18]:1,[edx+19]:1
409,7 → 411,7
jne @f
 
pusha
mcall 76, 7, [edx]
mcall 76, API_IPv4 + 7, [edx]
DEBUGF 1,"Subnet: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa
 
420,7 → 422,7
jne @f
 
pusha
mcall 76, 9, [edx]
mcall 76, API_IPv4 + 9, [edx]
DEBUGF 1,"Gateway: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa
 
432,7 → 434,7
jne next_option
 
pusha
mcall 76, 5, [edx]
mcall 76, API_IPv4 + 5, [edx]
DEBUGF 1,"DNS: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
popa
 
440,10 → 442,11
 
pr_exit:
 
ret
 
; DEBUGF 1,"Sending ARP announce\n"
;;;
 
jmp exit
 
apipa:
stdcall mem.Free, [dhcpMsg]
452,11 → 455,11
call random
mov ecx,0xfea9 ; IP 169.254.0.0 link local net, see RFC3927
mov cx,ax
mcall 76, 3, ecx ; mask is 255.255.0.0
mcall 76, API_IPv4 + 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
mcall 76, 5, 0xffff
mcall 76, 9, 0x0
mcall 76, 7, 0x0
mcall 76, API_IPv4 + 5, 0xffff
mcall 76, API_IPv4 + 9, 0x0
mcall 76, API_IPv4 + 7, 0x0
 
mcall 5, PROBE_WAIT*100