Subversion Repositories Kolibri OS

Rev

Rev 1514 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1514 Rev 1542
Line 40... Line 40...
40
RATE_LIMIT_INTERVAL equ 60		    ; seconds (delay between successive attempts)
40
RATE_LIMIT_INTERVAL equ 60		    ; seconds (delay between successive attempts)
Line 41... Line 41...
41
 
41
 
Line 42... Line -...
42
DEFEND_INTERVAL     equ 10		    ; seconds (min. wait between defensive ARPs)
-
 
43
 
-
 
44
 
-
 
45
AF_INET4	equ 2  ;;;;;
-
 
46
IP_PROTO_UDP	equ 17
-
 
47
 
42
DEFEND_INTERVAL     equ 10		    ; seconds (min. wait between defensive ARPs)
48
 
43
 
49
 
44
 
-
 
45
include '../proc32.inc'
50
include '../proc32.inc'
46
include '../macros.inc'
51
include '../macros.inc'
47
include '../debug-fdo.inc'
Line 52... Line 48...
52
include '../debug-fdo.inc'
48
include '../network.inc'
Line 134... Line 130...
134
	DEBUGF	1,">Zero-config service:\n"
130
	DEBUGF	1,">Zero-config service:\n"
Line 135... Line 131...
135
 
131
 
Line 136... Line 132...
136
	mcall	75, 1337 shl 16 + 4
132
	mcall	75, 1337 shl 16 + 4
137
 
133
 
Line 138... Line 134...
138
	cmp	eax, -1
134
	cmp	eax, -1
139
	je	close
135
	je	exit
Line 140... Line 136...
140
 
136
 
Line 196... Line 192...
196
 
192
 
Line 197... Line 193...
197
skip_ini:
193
skip_ini:
Line 198... Line 194...
198
 
194
 
199
	DEBUGF	1,"->Skip ini\n"
195
	DEBUGF	1,"->Skip ini\n"
200
 
196
 
201
	mcall 74, 0, AF_INET4, IP_PROTO_UDP, 0	    ; open socket (parameters: domain, type, reserved)
197
	mcall 74, 0, AF_INET4, SOCK_DGRAM, 0	  ; open socket (parameters: domain, type, reserved)
Line 202... Line 198...
202
	cmp   eax, -1
198
	cmp   eax, -1
Line 298... Line 294...
298
	mcall	74, 7, [socketNum], [dhcpMsg], BUFFER	; read data from socket
294
	mcall	74, 7, [socketNum], [dhcpMsg], BUFFER	; read data from socket
Line 299... Line 295...
299
 
295
 
Line 300... Line 296...
300
	DEBUGF	1,"->%d bytes received\n", eax
296
	DEBUGF	1,"->%d bytes received\n", eax
301
 
297
 
302
	push	eax
298
	push	eax
Line 303... Line 299...
303
	mcall	74, 1, [socketNum]		       ; close the socket
299
	mcall	74, 1, [socketNum]		       ; exit the socket
304
	pop	eax
300
	pop	eax
Line 321... Line 317...
321
    cmp     [dhcpMsgType], byte 0x01	    ; did we send a discover?
317
    cmp     [dhcpMsgType], byte 0x01	    ; did we send a discover?
322
    je	    discover
318
    je	    discover
323
    cmp     [dhcpMsgType], byte 0x03	    ; did we send a request?
319
    cmp     [dhcpMsgType], byte 0x03	    ; did we send a request?
324
    je	    request
320
    je	    request
Line 325... Line 321...
325
 
321
 
Line 326... Line 322...
326
	jmp	close				; really unknown, what we did
322
	jmp	exit			       ; really unknown, what we did
327
 
323
 
Line 328... Line 324...
328
discover:
324
discover:
Line 337... Line 333...
337
	call	parseResponse
333
	call	parseResponse
Line 338... Line 334...
338
 
334
 
339
	cmp	[dhcpMsgType], byte 0x05	; Was the response an ACK? It should be
335
	cmp	[dhcpMsgType], byte 0x05	; Was the response an ACK? It should be
Line 340... Line 336...
340
	jne	apipa				; NO - so we do zeroconf
336
	jne	apipa				; NO - so we do zeroconf
Line 341... Line 337...
341
 
337
 
342
	jmp	close
338
	jmp	exit
343
 
339
 
344
;***************************************************************************
340
;***************************************************************************
Line 445... Line 441...
445
pr_exit:
441
pr_exit:
Line 446... Line 442...
446
 
442
 
447
;    DEBUGF  1,"Sending ARP announce\n"
443
;    DEBUGF  1,"Sending ARP announce\n"
Line 448... Line 444...
448
;;;
444
;;;
Line 449... Line 445...
449
 
445
 
450
    jmp close
446
    jmp exit
Line 451... Line 447...
451
 
447
 
Line 509... Line 505...
509
    jmp   announce_loop
505
    jmp   announce_loop
510
   @@:
506
   @@:
511
    ; we should, instead of closing, detect ARP conflicts and detect if cable keeps connected ;)
507
    ; we should, instead of closing, detect ARP conflicts and detect if cable keeps connected ;)
Line 512... Line 508...
512
 
508
 
513
error:
509
error:
514
close:
510
exit:
Line 515... Line 511...
515
    mcall -1
511
    mcall -1
Line 590... Line 586...
590
 
586
 
Line 591... Line 587...
591
I_END_2:
587
I_END_2:
Line -... Line 588...
-
 
588
 
-
 
589
path		rb  1024+5
592
 
590
 
593
path		rb  1024+5
591
		rb  65536