2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-05-05 17:15:37 +00:00
|
|
|
|
AUTO 3,1
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ICMP.IN ldy #S.ICMP.TYPE
|
2017-01-31 16:40:37 +00:00
|
|
|
|
lda (ZPFrameInPtr),y
|
2017-01-30 16:30:39 +00:00
|
|
|
|
cmp #S.ICMP.TYPE.ECHOREP
|
|
|
|
|
beq ICMP.IN.ECHOREP
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
cmp #S.ICMP.TYPE.ECHOREQ
|
2017-01-30 16:30:39 +00:00
|
|
|
|
bne ICMP.IN.EXIT
|
2017-01-31 16:40:37 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-30 16:30:39 +00:00
|
|
|
|
ICMP.IN.ECHOREQ ldy #S.IP.DST+3
|
|
|
|
|
ldx #3
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2017-01-31 16:40:37 +00:00
|
|
|
|
.1 lda (ZPFrameInPtr),y
|
2017-01-30 16:30:39 +00:00
|
|
|
|
cmp IPCFG+S.IPCFG.IP,x
|
|
|
|
|
bne ICMP.IN.EXIT
|
2021-03-11 21:40:55 +00:00
|
|
|
|
|
2017-01-30 16:30:39 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bne .1
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
ldy #S.ICMP.TYPE
|
|
|
|
|
lda #S.ICMP.TYPE.ECHOREP
|
2017-01-31 16:40:37 +00:00
|
|
|
|
sta (ZPFrameInPtr),y
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2018-09-21 15:28:46 +00:00
|
|
|
|
jsr ARP.AddFromFrameInPtr
|
|
|
|
|
lda hFrameIn
|
2019-06-05 15:34:49 +00:00
|
|
|
|
* stz hFrameIn DO NOT DISCARD this frame,it is SOURCE frame!!!
|
2018-09-21 15:28:46 +00:00
|
|
|
|
sta hFrameOut
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2021-05-19 12:44:47 +00:00
|
|
|
|
ldx #3
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
|
|
|
|
.2 lda ZPFrameInPtr,x
|
|
|
|
|
sta ZPFrameOutPtr,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2018-09-21 15:28:46 +00:00
|
|
|
|
|
2021-05-19 12:44:47 +00:00
|
|
|
|
ldx #3
|
2018-09-21 15:28:46 +00:00
|
|
|
|
ldy #S.IP.DST+3
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2016-03-16 07:19:54 +00:00
|
|
|
|
.3 lda ARP.TmpCache+S.ARPCACHE.IP,x
|
2021-05-19 12:44:47 +00:00
|
|
|
|
sta (ZPFrameOutPtr),y
|
2016-03-13 22:09:00 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
2020-05-08 19:02:27 +00:00
|
|
|
|
|
2019-07-07 20:48:57 +00:00
|
|
|
|
clc Queue if fail
|
2017-02-15 16:14:41 +00:00
|
|
|
|
jmp FRM.SendIP
|
2019-11-17 14:39:55 +00:00
|
|
|
|
|
|
|
|
|
ICMP.IN.EXIT jmp FRM.DiscardIn
|
2016-01-16 22:04:22 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-08 15:41:00 +00:00
|
|
|
|
ICMP.IN.ECHOREP jsr FRM.GetTargetSKT.RAW
|
2019-12-07 17:53:45 +00:00
|
|
|
|
|
2017-01-30 16:30:39 +00:00
|
|
|
|
ldy #S.ICMP.IDENTIFIER
|
2017-01-31 16:40:37 +00:00
|
|
|
|
lda (ZPFrameInPtr),y
|
2021-03-11 21:40:55 +00:00
|
|
|
|
sta SKT.LOC.ADDR+S.SOCKADDR.PORT+1
|
2019-12-07 17:53:45 +00:00
|
|
|
|
sta SKT.REM.ADDR+S.SOCKADDR.PORT+1
|
2017-01-30 16:30:39 +00:00
|
|
|
|
iny
|
2017-01-31 16:40:37 +00:00
|
|
|
|
lda (ZPFrameInPtr),y
|
2021-03-11 21:40:55 +00:00
|
|
|
|
sta SKT.LOC.ADDR+S.SOCKADDR.PORT
|
2019-12-07 17:53:45 +00:00
|
|
|
|
sta SKT.REM.ADDR+S.SOCKADDR.PORT
|
2017-01-30 16:30:39 +00:00
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
jsr SKT.FindMatchingLocRem
|
2019-06-05 15:34:49 +00:00
|
|
|
|
bcs ICMP.IN.EXIT
|
2019-11-17 14:39:55 +00:00
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
ldy #S.SOCKET.PROTO
|
|
|
|
|
lda (ZPPtrSKT),y
|
2019-11-17 14:39:55 +00:00
|
|
|
|
cmp #S.IP.PROTOCOL.ICMP
|
|
|
|
|
bne ICMP.IN.EXIT
|
|
|
|
|
|
2017-01-30 16:30:39 +00:00
|
|
|
|
lda hFrameIn
|
|
|
|
|
jsr SKT.AddToQueueA
|
2019-06-05 15:34:49 +00:00
|
|
|
|
bcs ICMP.IN.EXIT Q full, discard...
|
|
|
|
|
rts
|
2017-02-13 07:26:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-16 22:04:22 +00:00
|
|
|
|
MAN
|
2020-06-07 08:06:51 +00:00
|
|
|
|
SAVE usr/src/lib/libtcpip.s.icmp
|
|
|
|
|
LOAD usr/src/lib/libtcpip.s
|
2016-01-16 22:04:22 +00:00
|
|
|
|
ASM
|