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 1519
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: 1514 $
20
$Revision: 1519 $
Line 207... Line 207...
207
	call	checksum_2
207
	call	checksum_2
208
	mov	ax , dx
208
	mov	ax , dx
209
	pop	ecx edx ebx
209
	pop	ecx edx ebx
210
	mov	word [edx + ICMP_Packet.Checksum], ax
210
	mov	word [edx + ICMP_Packet.Checksum], ax
Line 211... Line 211...
211
 
211
 
212
	jmp	NET_send						  ; Send the reply
212
	call	[ebx + NET_DEVICE.transmit]
Line 213... Line 213...
213
									    ; and return to caller of this proc
213
	ret
Line 249... Line 249...
249
	mov	eax, esi
249
	mov	eax, esi
250
	pop	esi
250
	pop	esi
251
	add	esp, 4
251
	add	esp, 4
252
	sub	edx, esi
252
	sub	edx, esi
253
	mov	edi, edx
253
	mov	edi, edx
254
;;;        jmp     SOCKET_input
254
	jmp	SOCKET_input
Line 255... Line 255...
255
 
255
 
256
       .dump:
256
       .dump:
Line 257... Line 257...
257
	DEBUGF	1,"ICMP_Handler - dumping\n"
257
	DEBUGF	1,"ICMP_Handler - dumping\n"
Line 262... Line 262...
262
	ret
262
	ret
Line 263... Line 263...
263
 
263
 
264
 
264
 
265
;-----------------------------------------------------------------
-
 
266
;
-
 
267
; Note: ICMP only works on top of IP protocol :)
265
;-----------------------------------------------------------------
268
;
266
;
269
; inputs:
267
; ICMP_output
270
;
268
;
271
; eax = dest ip
269
; IN:  eax = dest ip
272
; ebx = source ip
270
;      ebx = source ip
273
; ecx = data length
271
;      ecx = data length
274
; dh = type
272
;      dh  = type
Line 279... Line 277...
279
;
277
;
280
;-----------------------------------------------------------------
278
;-----------------------------------------------------------------
281
align 4
279
align 4
282
ICMP_output:
280
ICMP_output:
Line 283... Line 281...
283
 
281
 
Line 284... Line 282...
284
	DEBUGF 1,"Create ICMP Packet\n"
282
	DEBUGF	1,"Creating ICMP Packet\n"
Line 285... Line 283...
285
 
283
 
286
	push	esi edi edx
284
	push	esi edi edx
Line 318... Line 316...
318
	pop	cx
316
	pop	cx
319
	and	cx , 3
317
	and	cx , 3
320
	rep	movsb
318
	rep	movsb
Line 321... Line 319...
321
 
319
 
322
	sub	edi, edx				;;; TODO: find a better way to remember start of packet
-
 
323
	mov	ecx, [ebx + ETH_DEVICE.transmit]
320
	sub	edi, edx				;;; TODO: find a better way to remember start of packet
324
	push	edx edi ecx
321
	push	edx edi
325
	DEBUGF 1,"Sending ICMP Packet\n"
322
	DEBUGF	1,"Sending ICMP Packet\n"
326
	ret						; Send the packet (create_packet routine outputs pointer to routine to send packet in eax)
323
	call	[ebx + NET_DEVICE.transmit]
327
 
324
	ret
328
  .exit:
325
  .exit:
329
	DEBUGF 1,"Creating ICMP Packet failed\n"
326
	DEBUGF	1,"Creating ICMP Packet failed\n"
330
	add	esp, 3*4
327
	add	esp, 3*4