Kernel version 0.9 : ICMP/PING fully "socketized"

This commit is contained in:
Rémy GIBERT 2017-02-01 22:21:46 +01:00
parent 303d1d692c
commit 2f13635422
5 changed files with 40 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@ -135,12 +135,6 @@ CS.RUN.OPENSKT ldx #3
sta Socket.Dst.Port+1
sta (pData),y
lda #0
ldy #Sequence
sta (pData),y
iny
sta (pData),y
>PUSHW L.Socket
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.NEW
bcc .2
@ -163,6 +157,19 @@ CS.RUN.SEND.ECHO
lda (pData),y
sta ICMP.Request.ID+1
ldy #Sequence
sec
lda (pData),y
adc #0
sta (pData),y
sta ICMP.Request.SQ
iny
lda (pData),y
adc #0
sta (pData),y
sta ICMP.Request.SQ+1
jsr Init.Timeout
>PUSHWI ICMP.RequestLen
@ -194,7 +201,15 @@ CS.RUN.WAIT.REPLY
jsr CS.Print.REPLY
bcs CS.RUN.ERR
bra CS.RUN.SEND.ECHO
ldy #hFrame
lda (pData),y
>SYSCALL FreeMemA
ldy #hFrame
lda #0
sta (pData),y
jmp CS.RUN.SEND.ECHO
.2 jsr Wait.Timeout
bcc CS.RUN.WAIT.REPLY
@ -202,7 +217,7 @@ CS.RUN.WAIT.REPLY
jsr CS.Print.UNREACH
bcs CS.RUN.ERR
bra CS.RUN.SEND.ECHO
jmp CS.RUN.SEND.ECHO
.9 lda #0
sec
@ -276,10 +291,16 @@ CS.Print.REPLY lda #TIMEOUT.MAX
>SYSCALL CPrintFYA
rts
*--------------------------------------
CS.QUIT ldy #hSocket
CS.QUIT ldy #hFrame
lda (pData),y
beq .1
>SYSCALL FreeMemA
.1 ldy #hSocket
lda (pData),y
* >LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.CLOSEA
lda hLIBTCPIP
>SYSCALL UnloadLibA

View File

@ -100,9 +100,15 @@ ICMP.IN.ECHOREP jsr IP.FillTmpSocketSrcDst
cmp TmpSocket,y
bne .7
iny
cpy #S.SOCKET.DST.PORT Compare SRC.ADDR,SRC.PORT,DST.ADDR
cpy #S.SOCKET.SRC.PORT
bne .5
iny
iny
.5 cpy #S.SOCKET.DST.PORT Compare SRC.ADDR,DST.ADDR,DST.PORT
bne .4
lda hFrameIn
jsr SKT.AddToQueueA
bcs .9 Q full, discard...

View File

@ -149,7 +149,7 @@ note : '$VAR' does NOT expand Variable
| EDIT | Working | still missing : find/replace | 0.9 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.8 |
| ARP | Working | dump ARP cache, setup a static ARP entry | 0.9 |
| PING | Working | | 0.8 |
| PING | Working | | 0.9 |
| DNSINFO | Working | dump DNS cache, setup a static DNS entry | 0.9 |
| IPCONFIG | Working | renamed from NETINFO | 0.9 |
| NETSTAT | Working | | 0.9 |