Subversion Repositories Kolibri OS

Rev

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

Rev 1166 Rev 1171
Line 147... Line 147...
147
;  TODO: we need to check for broadcasts (other then 255.255.255.255)
147
;  TODO: we need to check for broadcasts (other then 255.255.255.255)
Line 148... Line 148...
148
 
148
 
Line 149... Line 149...
149
	jmp	.dump
149
	jmp	.dump
150
 
-
 
-
 
150
 
-
 
151
  .ip_ok:
151
  .ip_ok:
152
	call	ETH_struc2dev					; TODO: make this work on other protocols too!
152
 
153
	inc	[IP_PACKETS_RX+4*edi]
Line 153... Line 154...
153
	DEBUGF	1,"IP_Handler - packet from %u.%u.%u.%u\n",\
154
	DEBUGF	1,"IP_Handler - packet from %u.%u.%u.%u\n",\
154
	[edx + IPv4_Packet.SourceAddress]:1,[edx + IPv4_Packet.SourceAddress + 1]:1,[edx + IPv4_Packet.SourceAddress + 2]:1,[edx + IPv4_Packet.SourceAddress + 3]:1
155
	[edx + IPv4_Packet.SourceAddress]:1,[edx + IPv4_Packet.SourceAddress + 1]:1,[edx + IPv4_Packet.SourceAddress + 2]:1,[edx + IPv4_Packet.SourceAddress + 3]:1
Line 388... Line 389...
388
	add	eax, edx
389
	add	eax, edx
389
	push	eax
390
	push	eax
390
	mov	al , [edx + IPv4_Packet.Protocol]
391
	mov	al , [edx + IPv4_Packet.Protocol]
391
	pop	edx						; Offset to data (tcp/udp/icmp/.. Packet)
392
	pop	edx						; Offset to data (tcp/udp/icmp/.. Packet)
Line 392... Line 393...
392
 
393
 
393
;        cmp     al , PROTOCOL_TCP
394
;        cmp     al , IP_PROTO_TCP
Line 394... Line 395...
394
;        je      TCP_Handler
395
;        je      TCP_Handler
395
 
396
 
Line 396... Line 397...
396
	cmp	al , PROTOCOL_UDP
397
	cmp	al , IP_PROTO_UDP
397
	je	UDP_Handler
398
	je	UDP_Handler
Line 533... Line 534...
533
 
534
 
534
 
535
 
535
  .send:
536
  .send:
-
 
537
	push	ecx eax ebx dx di
536
	push	ecx eax ebx dx di
538
	call	IPv4_dest_to_dev
537
	call	IPv4_dest_to_dev
539
	inc	[IP_PACKETS_TX+4*edi]
538
	mov	edi, [ETH_DRV_LIST + 4*edi]
540
	mov	edi, [ETH_DRV_LIST + 4*edi]
539
	lea	eax, [edi + ETH_DEVICE.mac]
541
	lea	eax, [edi + ETH_DEVICE.mac]
540
	mov	ebx, temp_dstmac
542
	mov	ebx, temp_dstmac
Line 579... Line 581...
579
	or	edi, -1
581
	or	edi, -1
580
	ret
582
	ret
Line 581... Line 583...
581
 
583
 
582
 
584
 
583
uglobal
585
uglobal
Line 584... Line 586...
584
	temp_dstmac dp ?
586
	temp_dstmac dp ?    ; TODO: place this in stack instead!
585
endg
587
endg