Subversion Repositories Kolibri OS

Rev

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

Rev 1519 Rev 1529
Line 15... Line 15...
15
;;             Version 2, June 1991                                ;;
15
;;             Version 2, June 1991                                ;;
16
;;                                                                 ;;
16
;;                                                                 ;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
$Revision: 1519 $
20
$Revision: 1529 $
Line 107... Line 107...
107
 
107
 
108
;-----------------------------------------------------------------
108
;-----------------------------------------------------------------
109
;
109
;
110
; ICMP_init
110
; ICMP_init
111
;
-
 
112
;  This function resets all ICMP variables
-
 
113
;
-
 
114
;  IN:  /
-
 
115
;  OUT: /
-
 
116
;
111
;
117
;-----------------------------------------------------------------
112
;-----------------------------------------------------------------
118
align 4
113
 
Line 119... Line 114...
119
ICMP_init:
114
macro ICMP_init {
120
 
115
 
121
	xor	eax, eax
116
	xor	eax, eax
122
	mov	edi, ICMP_PACKETS_TX
117
	mov	edi, ICMP_PACKETS_TX
Line 123... Line 118...
123
	mov	ecx, 2*MAX_IP
118
	mov	ecx, 2*MAX_IP
Line 124... Line 119...
124
	rep	stosd
119
	rep	stosd
Line 233... Line 228...
233
	jne	.next_socket
228
	jne	.next_socket
Line 234... Line 229...
234
 
229
 
235
	call	IPv4_dest_to_dev
230
	call	IPv4_dest_to_dev
236
	cmp	edi,-1
231
	cmp	edi,-1
237
	je	.dump
232
	je	.dump
Line 238... Line 233...
238
	inc	[ICMP_PACKETS_RX+4*edi]
233
	inc	[ICMP_PACKETS_RX+edi]
Line 239... Line 234...
239
 
234
 
240
	DEBUGF 1,"Found valid ICMP packet for socket %x\n", esi
235
	DEBUGF 1,"Found valid ICMP packet for socket %x\n", esi
Line 282... Line 277...
282
	DEBUGF	1,"Creating ICMP Packet\n"
277
	DEBUGF	1,"Creating ICMP Packet\n"
Line 283... Line 278...
283
 
278
 
Line 284... Line 279...
284
	push	esi edi edx
279
	push	esi edi edx
285
 
280
 
286
	add	ecx, ICMP_Packet.Data
281
	add	ecx, ICMP_Packet.Data
Line 287... Line 282...
287
	mov	di , IP_PROTO_ICMP
282
	mov	di , IP_PROTO_ICMP SHL 8 + 128	; TTL
288
	shr	edx, 16
283
	shr	edx, 16
Line 289... Line 284...
289
 
284
 
Line 290... Line 285...
290
	call	IPv4_create_packet
285
	call	IPv4_output