Subversion Repositories Kolibri OS

Rev

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

Rev 1483 Rev 1484
Line 12... Line 12...
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
13
;;             Version 2, June 1991                                ;;
13
;;             Version 2, June 1991                                ;;
14
;;                                                                 ;;
14
;;                                                                 ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
$Revision: 1483 $
17
$Revision: 1484 $
18
 
18
 
19
 
19
 
Line 66... Line 66...
66
;  IN:  Pointer to buffer in [esp]
66
;  IN:  Pointer to buffer in [esp]
67
;       size of buffer in [esp+4]
67
;       size of buffer in [esp+4]
68
;       pointer to device struct in ebx
68
;       pointer to device struct in ebx
69
;       UDP Packet size in ecx
69
;       UDP Packet size in ecx
70
;       pointer to UDP Packet in edx
70
;       pointer to UDP Packet in edx
-
 
71
;
-
 
72
;       esi = ipv4 source address
-
 
73
;       edi = ipv4 dest   address
-
 
74
;
71
;  OUT: /
75
;  OUT: /
72
;
76
;
73
;-----------------------------------------------------------------
77
;-----------------------------------------------------------------
74
align 4
78
align 4
75
UDP_handler:
79
UDP_handler:
Line 78... Line 82...
78
 
82
 
79
; First validate, checksum:
83
; First validate, checksum:
80
	cmp    [edx + UDP_Packet.Checksum], 0
84
	cmp	[edx + UDP_Packet.Checksum], 0
Line -... Line 85...
-
 
85
	jz	.no_checksum
-
 
86
 
81
	jz     .no_checksum
87
	xchg	edi, esi	; save ipv4 source address so we can look it up later
Line 82... Line 88...
82
 
88
 
83
	push	edx
89
	push	edx
84
 
90
 
85
	push	esi
91
	push	esi
Line 86... Line 92...
86
	push	edi
92
	push	edi
Line 87... Line 93...
87
	mov	esi, edx
93
	mov	esi, edx
88
	call	UDP_checksum
94
	call	UDP_checksum	; this destroys edx, ecx and esi (but not edi! :)
Line 120... Line 126...
120
	; I bind to, if the socket is opened with a destination IP address of
126
	; I bind to, if the socket is opened with a destination IP address of
121
	; 255.255.255.255
127
	; 255.255.255.255
122
	cmp	[eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], 0xffffffff
128
	cmp	[eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], 0xffffffff
123
	je	.ok1
129
	je	.ok1
Line 124... Line -...
124
 
-
 
125
;        mov     esi, [esp] ; start of data (ethernet header)
-
 
126
;        mov     esi, [esi + ETH_FRAME.Data + IPv4_Packet.SourceAddress] ; get the Source address from the IP Packet   FIXME
130
 
127
	cmp	[eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], edi ;esi
131
	cmp	[eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], edi   ; edi is IPv4 destination address
Line 128... Line 132...
128
	jne	.try_more					      ; Quit if the source IP is not valid, check for more sockets with this IP/PORT combination
132
	jne	.try_more					      ; Quit if the source IP is not valid, check for more sockets with this IP/PORT combination
129
 
133