Subversion Repositories Kolibri OS

Rev

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

Rev 1251 Rev 1254
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: 1251 $
17
$Revision: 1254 $
18
 
18
 
19
 
19
 
Line 75... Line 75...
75
UDP_handler:
75
UDP_handler:
Line 76... Line 76...
76
 
76
 
77
	DEBUGF 1,"UDP_Handler\n"
77
	DEBUGF 1,"UDP_Handler\n"
Line 78... Line -...
78
	; First validate, checksum:
-
 
79
 
-
 
80
	DEBUGF 1,"Real UDP checksum: %x\n", [edx + UDP_Packet.Checksum]:4
-
 
81
	mov    [edx + UDP_Packet.Checksum], 0
78
	; First validate, checksum:
Line 82... Line 79...
82
 
79
 
83
	pusha
80
	pusha
84
 
81
 
85
	rol	cx, 8
82
	rol	cx, 8
86
	push	cx
83
	push	cx
87
	rol	cx, 8
84
	rol	cx, 8
Line -... Line 85...
-
 
85
	push	word IP_PROTO_UDP shl 8
-
 
86
	push	edi
-
 
87
	push	esi
88
	push	word IP_PROTO_UDP shl 8
88
 
89
	push	edi
89
	mov	di, [edx + UDP_Packet.Checksum]
90
	push	esi
90
	mov    [edx + UDP_Packet.Checksum], 0
91
 
-
 
92
	mov	esi, edx
91
 
93
	xor	edx, edx
92
	mov	esi, edx
94
	call	checksum_1
93
	xor	edx, edx
95
; Checksum for pseudoheader
94
	call	checksum_1
96
	mov	ecx, 12
95
	mov	ecx, 12
Line -... Line 96...
-
 
96
	mov	esi, esp
97
	mov	esi, esp
97
	call	checksum_1
-
 
98
	add	esp, 12
Line 98... Line -...
98
	call	checksum_1
-
 
-
 
99
	call	checksum_2
Line 99... Line 100...
99
	add	esp, 12
100
 
100
	call	checksum_2
101
	cmp	di, dx
101
 
102
	popa
Line 205... Line 206...
205
 
206
 
Line 206... Line 207...
206
	mov	di , IP_PROTO_UDP
207
	mov	di , IP_PROTO_UDP
Line 207... Line 208...
207
 
208
 
208
	sub	esp, 8						; reserve some place in stack for later
-
 
209
 
209
	sub	esp, 8						; reserve some place in stack for later
Line 210... Line 210...
210
; Create the pseudoheader in stack,
210
 
Line 211... Line 211...
211
; (now that we still have all the variables that are needed.)
211
; Create a part pseudoheader in stack,