mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-23 07:35:19 +00:00
86 lines
1.7 KiB
Plaintext
86 lines
1.7 KiB
Plaintext
NEW
|
||
PREFIX
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
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
|
||
>LDYA ZPFrameInPtr
|
||
>STYA ZPFrameOutPtr
|
||
|
||
ldx #3
|
||
ldy #S.IP.DST+3
|
||
|
||
.3 lda ARP.TmpCache+S.ARPCACHE.IP,x
|
||
sta (ZPFrameOutPtr),y
|
||
dey
|
||
dex
|
||
bpl .3
|
||
|
||
jmp FRM.SendIP
|
||
|
||
ICMP.IN.EXIT lda hFrameIn
|
||
beq .8
|
||
>SYSCALL FreeMem
|
||
stz hFrameIn
|
||
.8 rts
|
||
*--------------------------------------
|
||
ICMP.IN.ECHOREP jsr FRM.GetTargetSKT.RAW
|
||
|
||
ldy #S.ICMP.IDENTIFIER
|
||
lda (ZPFrameInPtr),y
|
||
sta SKT.LOC.ADDR+S.SOCKADDR.PORT
|
||
iny
|
||
lda (ZPFrameInPtr),y
|
||
sta SKT.LOC.ADDR+S.SOCKADDR.PORT+1
|
||
|
||
jsr SKT.FindMatchingLocRem
|
||
bcs .9
|
||
|
||
ldy #S.SOCKET.PROTO
|
||
lda (ZPPtrSKT),y
|
||
ldy #S.SOCKET.PROTO
|
||
lda (ZPPtrSKT),y
|
||
cmp #S.IP.PROTOCOL.ICMP
|
||
bne .9
|
||
|
||
lda hFrameIn
|
||
jsr SKT.AddToQueueA
|
||
bcc .8
|
||
|
||
.9 lda hFrameIn Q full, discard...
|
||
stz hFrameIn
|
||
>SYSCALL FreeMem
|
||
.8 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/LIB/LIBTCPIP.S.ICMP
|
||
LOAD USR/SRC/LIB/LIBTCPIP.S
|
||
ASM
|