mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-24 14:31:05 +00:00
81 lines
1.6 KiB
Plaintext
81 lines
1.6 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
ICMP.IN ldy #S.ICMP.TYPE
|
||
lda (ZPFrameInPtr),y
|
||
cmp #S.ICMP.TYPE.ECHOREP
|
||
beq ICMP.IN.ECHOREP
|
||
|
||
cmp #S.ICMP.TYPE.ECHOREQ
|
||
bne ICMP.IN.EXIT
|
||
*--------------------------------------
|
||
ICMP.IN.ECHOREQ ldy #S.IP.DST+3
|
||
ldx #3
|
||
|
||
.1 lda (ZPFrameInPtr),y
|
||
cmp IPCFG+S.IPCFG.IP,x
|
||
bne ICMP.IN.EXIT
|
||
|
||
dey
|
||
dex
|
||
bne .1
|
||
|
||
ldy #S.ICMP.TYPE
|
||
lda #S.ICMP.TYPE.ECHOREP
|
||
sta (ZPFrameInPtr),y
|
||
|
||
jsr ARP.AddFromFrameInPtr
|
||
lda hFrameIn
|
||
* stz hFrameIn DO NOT DISCARD this frame,it is SOURCE frame!!!
|
||
sta hFrameOut
|
||
|
||
ldx #3
|
||
|
||
.2 lda ZPFrameInPtr,x
|
||
sta ZPFrameOutPtr,x
|
||
dex
|
||
bpl .2
|
||
|
||
ldx #3
|
||
ldy #S.IP.DST+3
|
||
|
||
.3 lda ARP.TmpCache+S.ARPCACHE.IP,x
|
||
sta (ZPFrameOutPtr),y
|
||
dey
|
||
dex
|
||
bpl .3
|
||
|
||
clc Queue if fail
|
||
jmp FRM.SendIP
|
||
|
||
ICMP.IN.EXIT jmp FRM.DiscardIn
|
||
*--------------------------------------
|
||
ICMP.IN.ECHOREP jsr FRM.GetTargetSKT.RAW
|
||
|
||
ldy #S.ICMP.IDENTIFIER
|
||
lda (ZPFrameInPtr),y
|
||
sta SKT.LOC.ADDR+S.SOCKADDR.PORT+1
|
||
sta SKT.REM.ADDR+S.SOCKADDR.PORT+1
|
||
iny
|
||
lda (ZPFrameInPtr),y
|
||
sta SKT.LOC.ADDR+S.SOCKADDR.PORT
|
||
sta SKT.REM.ADDR+S.SOCKADDR.PORT
|
||
|
||
jsr SKT.FindMatchingLocRem
|
||
bcs ICMP.IN.EXIT
|
||
|
||
ldy #S.SOCKET.PROTO
|
||
lda (ZPPtrSKT),y
|
||
cmp #S.IP.PROTOCOL.ICMP
|
||
bne ICMP.IN.EXIT
|
||
|
||
lda hFrameIn
|
||
jsr SKT.AddToQueueA
|
||
bcs ICMP.IN.EXIT Q full, discard...
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/lib/libtcpip.s.icmp
|
||
LOAD usr/src/lib/libtcpip.s
|
||
ASM
|