2016-01-16 22:04:22 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
ICMP.IN ldy #S.ICMP.TYPE
|
2017-01-29 21:47:19 +00:00
|
|
|
|
lda (ZPFrameBase),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
cmp #S.ICMP.TYPE.ECHOREQ
|
|
|
|
|
bne .9
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
ldy #S.IP.DST
|
|
|
|
|
ldx #S.IPCFG.IP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.1 lda (ZPFrameBase),y
|
2016-01-16 22:04:22 +00:00
|
|
|
|
cmp IPCFG,x
|
|
|
|
|
bne .9
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #S.IPCFG.IP+4
|
2016-03-13 22:09:00 +00:00
|
|
|
|
bne .1
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.ICMP.TYPE
|
|
|
|
|
lda #S.ICMP.TYPE.ECHOREP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
sta (ZPFrameBase),y
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.IP.SRC+3
|
|
|
|
|
ldx #3
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.2 lda (ZPFrameBase),y
|
2016-03-16 07:19:54 +00:00
|
|
|
|
sta ARP.TmpCache+S.ARPCACHE.IP,x
|
2016-03-13 22:09:00 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ldy #S.IP.DST+3
|
|
|
|
|
ldx #3
|
2016-01-16 22:04:22 +00:00
|
|
|
|
|
2016-03-16 07:19:54 +00:00
|
|
|
|
.3 lda ARP.TmpCache+S.ARPCACHE.IP,x
|
2017-01-29 21:47:19 +00:00
|
|
|
|
sta (ZPFrameBase),y
|
2016-03-13 22:09:00 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .3
|
|
|
|
|
|
|
|
|
|
ldy #S.ETH.SRCMAC+5
|
|
|
|
|
ldx #5
|
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.4 lda (ZPFrameBase),y
|
2016-03-16 07:19:54 +00:00
|
|
|
|
sta ARP.TmpCache+S.ARPCACHE.MAC,x
|
2016-03-13 22:09:00 +00:00
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .4
|
|
|
|
|
|
2016-03-16 16:37:02 +00:00
|
|
|
|
lda #K.ARP.TTL
|
|
|
|
|
sta ARP.TmpCache+S.ARPCACHE.TTL
|
|
|
|
|
lda /K.ARP.TTL
|
|
|
|
|
sta ARP.TmpCache+S.ARPCACHE.TTL+1
|
|
|
|
|
|
2016-03-16 07:19:54 +00:00
|
|
|
|
lda #S.ARPCACHE.STATUS.RESOLVED
|
|
|
|
|
jsr ARP.ADD.I
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
stz hFrameOut DO NOT QUEUE/DISCARD this frame,it is SOURCE frame!!!
|
2016-03-13 22:09:00 +00:00
|
|
|
|
jmp SEND.ICMP.FRAME.I
|
2016-01-16 22:04:22 +00:00
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE LIB/LIBTCPIP.S.ICMP
|
|
|
|
|
LOAD LIB/LIBTCPIP.S
|
|
|
|
|
ASM
|