2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-10-01 05:48:42 +00:00
|
|
|
|
.TF LIB/LIBTCPIP
|
2018-11-09 13:29:23 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
IPDEBUG .EQ 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA ADC16
|
|
|
|
|
clc
|
|
|
|
|
lda ]1
|
|
|
|
|
adc ]2
|
|
|
|
|
sta ]1
|
|
|
|
|
lda ]1+1
|
|
|
|
|
adc ]2+1
|
|
|
|
|
sta ]1+1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA SBC16
|
|
|
|
|
sec
|
|
|
|
|
lda ]1
|
|
|
|
|
sbc ]2
|
|
|
|
|
sta ]1
|
|
|
|
|
lda ]1+1
|
|
|
|
|
sbc ]2+1
|
|
|
|
|
sta ]1+1
|
|
|
|
|
.EM
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2018-10-08 15:41:00 +00:00
|
|
|
|
.INB INC/MLI.I
|
2018-10-02 15:52:30 +00:00
|
|
|
|
.INB INC/MLI.E.I
|
2018-07-23 06:28:47 +00:00
|
|
|
|
.INB INC/NIC.I
|
|
|
|
|
.INB INC/ETH.I
|
|
|
|
|
.INB INC/LIBTCPIP.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-31 16:40:37 +00:00
|
|
|
|
ZPFrameInPtr .EQ ZPLIB
|
|
|
|
|
ZPFrameInLen .EQ ZPLIB+2
|
|
|
|
|
|
|
|
|
|
ZPDataInPtr .EQ ZPLIB+4
|
|
|
|
|
ZPDataInLen .EQ ZPLIB+6
|
|
|
|
|
|
|
|
|
|
ZPFrameOutPtr .EQ ZPLIB+8
|
|
|
|
|
ZPFrameOutLen .EQ ZPLIB+10
|
|
|
|
|
|
|
|
|
|
ZPDataOutPtr .EQ ZPLIB+12
|
|
|
|
|
ZPDataOutLen .EQ ZPLIB+14
|
|
|
|
|
|
|
|
|
|
ZPPtrIP .EQ ZPLIB+16
|
|
|
|
|
ZPPtrMAC .EQ ZPLIB+18
|
|
|
|
|
ZPPtrDNS .EQ ZPLIB+20
|
|
|
|
|
ZPPtrSKT .EQ ZPLIB+22
|
|
|
|
|
|
|
|
|
|
ZPCachePtr .EQ ZPLIB+24
|
|
|
|
|
ZPTmpPtr1 .EQ ZPLIB+26
|
|
|
|
|
ZPTmpPtr2 .EQ ZPLIB+28
|
|
|
|
|
ZPTmpPtr3 .EQ ZPLIB+30
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.1 .DA LIB.LOAD
|
|
|
|
|
.DA LIB.UNLOAD
|
|
|
|
|
|
|
|
|
|
.DA SET.IPCFG
|
|
|
|
|
.DA GET.IPCFG
|
|
|
|
|
|
2017-02-15 21:46:21 +00:00
|
|
|
|
.DA POLL
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.DA PULSE
|
2017-02-15 21:46:21 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.DA ARP.CLEAR
|
|
|
|
|
.DA ARP.QUERY
|
|
|
|
|
.DA ARP.ADD
|
2017-10-06 15:25:14 +00:00
|
|
|
|
.DA ARP.GetCACHE
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
|
|
|
|
.DA DNS.CLEAR
|
|
|
|
|
.DA DNS.QUERY
|
|
|
|
|
.DA DNS.ADD
|
2017-10-06 15:25:14 +00:00
|
|
|
|
.DA DNS.GetCACHE
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2017-02-15 16:14:41 +00:00
|
|
|
|
.DA HST.GETBYNAME
|
|
|
|
|
.DA HST.GETBYADDR
|
|
|
|
|
|
2018-10-01 05:48:42 +00:00
|
|
|
|
.DA SKT.Socket
|
|
|
|
|
.DA SKT.Bind
|
|
|
|
|
.DA SKT.Connect
|
|
|
|
|
.DA SKT.Listen
|
2017-02-15 16:14:41 +00:00
|
|
|
|
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.DA SKT.Accept
|
2018-10-10 15:39:22 +00:00
|
|
|
|
.DA SKT.Shutdown
|
2016-03-13 22:09:00 +00:00
|
|
|
|
|
2017-02-15 16:14:41 +00:00
|
|
|
|
.DA SKT.Read
|
2018-08-29 15:01:02 +00:00
|
|
|
|
.DA SKT.Write
|
2018-10-08 15:41:00 +00:00
|
|
|
|
.DA SKT.Recv
|
2018-08-29 15:01:02 +00:00
|
|
|
|
.DA SKT.Send
|
2018-10-01 05:48:42 +00:00
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
.DA SKT.RecvFrom
|
2018-10-01 05:48:42 +00:00
|
|
|
|
.DA SKT.SendTo
|
|
|
|
|
|
2018-11-08 14:23:06 +00:00
|
|
|
|
.DA SKT.getsockopt
|
2018-11-07 21:48:48 +00:00
|
|
|
|
.DA SKT.setsockopt
|
2018-11-08 14:23:06 +00:00
|
|
|
|
|
|
|
|
|
.DA SKT.GetTable
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-26 15:26:39 +00:00
|
|
|
|
L.DEVNAME .DA DEVNAME
|
|
|
|
|
L.MSG.DEV.KO .DA MSG.DEV.KO
|
|
|
|
|
L.MSG.DEV.OK .DA MSG.DEV.OK
|
|
|
|
|
L.MSG.CFG .DA MSG.CFG
|
|
|
|
|
L.MSG.CFG.KO .DA MSG.CFG.KO
|
|
|
|
|
L.MSG.CFG.OK .DA MSG.CFG.OK
|
2018-08-08 15:13:37 +00:00
|
|
|
|
L.MSG.DNS.ADD .DA MSG.DNS.ADD
|
2018-07-26 15:26:39 +00:00
|
|
|
|
L.HOSTNAME .DA HOSTNAME
|
|
|
|
|
L.TCPIP.CONF .DA TCPIP.CONF
|
|
|
|
|
L.HOSTS .DA HOSTS
|
2015-03-14 21:48:35 +00:00
|
|
|
|
L.IPCFG .DA IPCFG
|
2018-08-08 15:13:37 +00:00
|
|
|
|
L.CFG.IP .DA CFG.IP
|
|
|
|
|
L.CFG.HOSTS.SScanF .DA CFG.HOSTS.SScanF
|
|
|
|
|
L.CFG.Keywords .DA CFG.Keywords
|
|
|
|
|
J.CFG.Keywords .DA CFG.Read.address
|
|
|
|
|
.DA CFG.Read.netmask
|
|
|
|
|
.DA CFG.Read.gateway
|
|
|
|
|
.DA CFG.Read.nameserver
|
|
|
|
|
.DA CFG.Read.dnsdomain
|
2016-03-13 22:09:00 +00:00
|
|
|
|
L.ARP.REQ .DA ARP.REQ
|
|
|
|
|
L.ARP.REP .DA ARP.REP
|
2018-10-09 15:47:06 +00:00
|
|
|
|
L.SA.LOCAL .DA SA.LOCAL
|
|
|
|
|
L.SA.REMOTE .DA SA.REMOTE
|
2016-03-13 22:09:00 +00:00
|
|
|
|
L.DNS.MSG .DA DNS.MSG
|
2015-03-14 21:48:35 +00:00
|
|
|
|
L.ARP.CACHE .DA ARP.CACHE
|
|
|
|
|
L.DNS.CACHE .DA DNS.CACHE
|
2018-10-01 05:48:42 +00:00
|
|
|
|
L.SKT.Table .DA SKT.Table
|
2018-05-25 19:03:31 +00:00
|
|
|
|
L.HST.SScanF .DA HST.SScanF
|
2018-07-23 06:28:47 +00:00
|
|
|
|
L.IOCTL .DA IOCTL
|
|
|
|
|
L.DCB.NIC .DA DCB.NIC
|
2018-09-27 15:34:38 +00:00
|
|
|
|
J.TCP.IN .DA TCP.IN.JMP.CLOSED
|
2017-01-28 22:05:20 +00:00
|
|
|
|
.DA TCP.IN.JMP.LISTEN
|
|
|
|
|
.DA TCP.IN.JMP.SYNSENT
|
|
|
|
|
.DA TCP.IN.JMP.SYNRCVD
|
|
|
|
|
.DA TCP.IN.JMP.ESTBLSH
|
|
|
|
|
.DA TCP.IN.JMP.CLWAIT
|
|
|
|
|
.DA TCP.IN.JMP.LASTACK
|
|
|
|
|
.DA TCP.IN.JMP.FINWT1
|
|
|
|
|
.DA TCP.IN.JMP.FINWT2
|
|
|
|
|
.DA TCP.IN.JMP.CLOSING
|
|
|
|
|
.DA TCP.IN.JMP.TIMEWT
|
2018-09-28 05:58:24 +00:00
|
|
|
|
J.SKT.Socket .DA SKT.Socket.RAW
|
|
|
|
|
.DA SKT.Socket.DGRAM
|
|
|
|
|
.DA SKT.Socket.SEQPACKET
|
2018-11-01 08:53:47 +00:00
|
|
|
|
.DA SKT.Socket.STREAM
|
2018-09-27 15:34:38 +00:00
|
|
|
|
J.SKT.connect .DA SKT.connect.RAW
|
|
|
|
|
.DA SKT.connect.DGRAM
|
2018-10-01 15:52:58 +00:00
|
|
|
|
.DA SKT.connect.SEQPACKET
|
2018-11-01 08:53:47 +00:00
|
|
|
|
.DA SKT.connect.STREAM
|
2018-11-06 16:31:13 +00:00
|
|
|
|
J.SKT.shutdown .DA SKT.shutdown.RAW
|
|
|
|
|
.DA SKT.shutdown.DGRAM
|
|
|
|
|
.DA SKT.shutdown.SEQPACKET
|
|
|
|
|
.DA SKT.shutdown.STREAM
|
2018-10-01 15:52:58 +00:00
|
|
|
|
J.SKT.send .DA SKT.send.RAW
|
|
|
|
|
.DA SKT.send.DGRAM
|
|
|
|
|
.DA SKT.send.SEQPACKET
|
2018-11-01 08:53:47 +00:00
|
|
|
|
.DA SKT.send.STREAM
|
2018-11-09 13:29:23 +00:00
|
|
|
|
.DO IPDEBUG=1
|
2018-11-09 07:45:36 +00:00
|
|
|
|
L.MSG.FRM.Dump .DA MSG.FRM.Dump
|
|
|
|
|
L.MSG.SKT.Dump .DA MSG.SKT.Dump
|
2018-11-09 13:29:23 +00:00
|
|
|
|
.FIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2018-05-24 15:21:38 +00:00
|
|
|
|
LIB.LOAD ldx RefCount
|
2015-09-13 20:35:07 +00:00
|
|
|
|
bne .8
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
2018-10-01 15:52:58 +00:00
|
|
|
|
sta FD.DSOCK+S.FD.HANDLER
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr ARP.CLEAR
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr DNS.CLEAR
|
2018-10-01 05:48:42 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
jsr CFG.Init
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-05-24 15:21:38 +00:00
|
|
|
|
.8 inc RefCount
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
2018-05-24 15:21:38 +00:00
|
|
|
|
clc
|
2017-02-10 07:29:58 +00:00
|
|
|
|
.9 rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-05-24 15:21:38 +00:00
|
|
|
|
LIB.UNLOAD dec RefCount
|
2018-07-23 06:28:47 +00:00
|
|
|
|
bne LIB.UNLOAD.8
|
2018-05-24 15:21:38 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
lda IPCFG+S.IPCFG.hFD
|
2018-10-01 05:48:42 +00:00
|
|
|
|
beq LIB.UNLOAD.8
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI 0
|
|
|
|
|
>PUSHBI IOCTL.CLOSE
|
2018-08-08 15:13:37 +00:00
|
|
|
|
lda IPCFG+S.IPCFG.hFD
|
2018-07-26 15:26:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2018-10-01 05:48:42 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
LIB.UNLOAD.8 clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-07-23 06:28:47 +00:00
|
|
|
|
POLL >PUSHW L.IOCTL
|
|
|
|
|
>PUSHBI IOCTL.READ
|
2018-08-08 15:13:37 +00:00
|
|
|
|
lda IPCFG+S.IPCFG.hFD
|
2018-05-24 15:21:38 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2017-01-29 21:47:19 +00:00
|
|
|
|
bcs .99 No Frame
|
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta hFrameIn
|
2018-08-08 15:13:37 +00:00
|
|
|
|
ldx #3
|
2017-01-31 16:40:37 +00:00
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
.10 lda IOCTL+S.IOCTL.BUFPTR,x Get Frame Ptr & Len
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta ZPFrameInPtr,x
|
2018-08-08 15:13:37 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .10
|
2017-01-29 21:47:19 +00:00
|
|
|
|
|
2018-11-06 16:31:13 +00:00
|
|
|
|
ldy #S.ETH.EII.TYPE
|
2017-01-31 16:40:37 +00:00
|
|
|
|
lda (ZPFrameInPtr),y
|
2017-01-29 21:47:19 +00:00
|
|
|
|
tax
|
|
|
|
|
iny
|
2017-01-31 16:40:37 +00:00
|
|
|
|
lda (ZPFrameInPtr),y
|
2017-01-29 21:47:19 +00:00
|
|
|
|
|
2018-11-06 16:31:13 +00:00
|
|
|
|
cmp #S.ETH.EII.TYPE.ARP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
bne .1
|
2018-11-06 16:31:13 +00:00
|
|
|
|
cpx /S.ETH.EII.TYPE.ARP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
jmp ARP.IN
|
|
|
|
|
|
2018-11-06 16:31:13 +00:00
|
|
|
|
.1 cmp #S.ETH.EII.TYPE.IP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
bne .9
|
2018-11-06 16:31:13 +00:00
|
|
|
|
cpx /S.ETH.EII.TYPE.IP
|
2017-01-29 21:47:19 +00:00
|
|
|
|
bne .9
|
2017-03-16 07:32:24 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
jmp IP.IN
|
|
|
|
|
|
|
|
|
|
.9 lda hFrameIn
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2018-07-23 06:28:47 +00:00
|
|
|
|
|
2017-01-29 21:47:19 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2016-03-20 22:16:01 +00:00
|
|
|
|
* Expire = every sec
|
|
|
|
|
* Retry = every 100 msec
|
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
PULSE and #S.EVT.F.T1SEC
|
2017-01-30 21:03:12 +00:00
|
|
|
|
beq .1
|
2018-08-08 15:13:37 +00:00
|
|
|
|
|
2018-11-01 08:53:47 +00:00
|
|
|
|
jsr ARP.EXPIRE
|
|
|
|
|
jsr DNS.EXPIRE
|
2018-11-07 06:59:37 +00:00
|
|
|
|
jsr TCP.CLOSE
|
2017-01-29 21:47:19 +00:00
|
|
|
|
|
2018-11-01 08:53:47 +00:00
|
|
|
|
.1 jsr DNS.POLL
|
2017-01-29 21:47:19 +00:00
|
|
|
|
jmp FRM.RETRY
|
2016-03-20 22:16:01 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-16 22:04:22 +00:00
|
|
|
|
GetDynPort inc DYNPORT.LAST
|
|
|
|
|
bne .1
|
|
|
|
|
inc DYNPORT.LAST+1
|
2017-01-30 22:23:16 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
lda DYNPORT.LAST
|
2017-01-30 22:23:16 +00:00
|
|
|
|
cmp #K.DYNPORT.END
|
2016-01-16 22:04:22 +00:00
|
|
|
|
lda DYNPORT.LAST+1
|
|
|
|
|
sbc /K.DYNPORT.END
|
2017-01-30 22:23:16 +00:00
|
|
|
|
|
2016-01-16 22:04:22 +00:00
|
|
|
|
bcs .1
|
2017-01-30 22:23:16 +00:00
|
|
|
|
|
2018-07-12 15:20:39 +00:00
|
|
|
|
lda #K.DYNPORT.START
|
|
|
|
|
ldx /K.DYNPORT.START
|
2017-10-12 15:28:59 +00:00
|
|
|
|
sta DYNPORT.LAST
|
|
|
|
|
stx DYNPORT.LAST+1
|
2016-01-16 22:04:22 +00:00
|
|
|
|
rts CC
|
|
|
|
|
|
2017-10-12 15:28:59 +00:00
|
|
|
|
.1 lda DYNPORT.LAST
|
|
|
|
|
ldx DYNPORT.LAST+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
2016-01-16 22:04:22 +00:00
|
|
|
|
rts
|
2018-11-09 13:29:23 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO IPDEBUG=1
|
|
|
|
|
FRM.Dump ldy #S.TCPUDP.DSTPORT
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.IP.DST+3
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.TCPUDP.SRCPORT
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.IP.SRC+3
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFrameInPtr),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
>PUSHBI 12
|
|
|
|
|
>LDYA L.MSG.FRM.Dump
|
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SKT.Dump ldy #S.SOCKET.REM.PORT+1
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET.REM.ADDR+3
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET.LOC.PORT+1
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.SOCKET.LOC.ADDR+3
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtrSKT),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
>PUSHBI 12
|
|
|
|
|
>LDYA L.MSG.SKT.Dump
|
|
|
|
|
>SYSCALL Printf
|
|
|
|
|
rts
|
|
|
|
|
.FIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-08 05:55:28 +00:00
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.ARP
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.CFG
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.DNS
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.FRM
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.HST
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.ICMP
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.IP
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.SKT
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.TCP
|
|
|
|
|
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.UDP
|
2016-01-09 22:36:24 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
2018-08-08 15:13:37 +00:00
|
|
|
|
DEVNAME .AZ "/DEV/ETH1"
|
2018-11-12 09:22:06 +00:00
|
|
|
|
MSG.DEV.KO .AZ "LIBTCPIP:No Device Found, exiting."
|
|
|
|
|
MSG.DEV.OK .AZ "LIBTCPIP:Bound To Device : %s\r\n"
|
|
|
|
|
MSG.CFG .AZ "LIBTCPIP:Reading %s..."
|
2018-07-26 15:26:39 +00:00
|
|
|
|
MSG.CFG.KO .AZ "Failed!!! [%h]\r\n"
|
2018-08-23 15:16:20 +00:00
|
|
|
|
MSG.CFG.OK .AZ "OK."
|
2018-09-10 15:07:26 +00:00
|
|
|
|
MSG.DNS.ADD .AZ " - Adding static host %d.%d.%d.%d %s..."
|
2018-07-26 15:26:39 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
HOSTNAME .AZ "${A2OSX}ETC/HOSTNAME"
|
|
|
|
|
TCPIP.CONF .AZ "${A2OSX}ETC/TCPIP.CONF"
|
|
|
|
|
HOSTS .AZ "${A2OSX}ETC/HOSTS"
|
2018-08-08 15:13:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CFG.DefaultHost .AZ "a2osx-XXXX"
|
|
|
|
|
CFG.Keywords >PSTR "address"
|
|
|
|
|
>PSTR "netmask"
|
|
|
|
|
>PSTR "gateway"
|
|
|
|
|
>PSTR "nameserver"
|
|
|
|
|
>PSTR "dnsdomain"
|
|
|
|
|
.DA #0
|
2018-09-10 15:07:26 +00:00
|
|
|
|
CFG.hBuf1 .BS 1
|
|
|
|
|
CFG.hBuf2 .BS 1
|
|
|
|
|
CFG.hBuf3 .BS 1
|
2018-07-26 15:26:39 +00:00
|
|
|
|
CFG.hCfgPath .BS 1
|
2018-08-08 15:13:37 +00:00
|
|
|
|
CFG.hCfgFile .BS 1
|
|
|
|
|
CFG.IP .BS 4
|
|
|
|
|
CFG.HOSTS.SScanF .AZ "%d.%d.%d.%d %s %s"
|
2018-07-26 15:26:39 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-09 15:47:06 +00:00
|
|
|
|
SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
|
|
|
|
|
.BS 1
|
|
|
|
|
.BS 4 S.SOCKADDR.ADDR
|
|
|
|
|
.BS 2 S.SOCKADDR.PORT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SA.REMOTE .DA #AF.INET S.SOCKADDR.AF
|
|
|
|
|
.BS 1
|
|
|
|
|
.BS 4 S.SOCKADDR.ADDR
|
|
|
|
|
.BS 2 S.SOCKADDR.PORT
|
|
|
|
|
*--------------------------------------
|
2018-10-01 15:52:58 +00:00
|
|
|
|
FD.DSOCK .DA #S.FD.T.DSOCK
|
|
|
|
|
.BS 1 S.FD.HANDLER
|
|
|
|
|
.BS 1 S.FD.DSOCK.HSKT
|
|
|
|
|
.DA #0 S.FD.DSOCK.OPEN
|
|
|
|
|
.DA #0 S.FD.DSOCK.CLOSE
|
2018-10-10 15:39:22 +00:00
|
|
|
|
.DA #LIBTCPIP.Recv
|
|
|
|
|
.DA #LIBTCPIP.Send
|
2018-10-01 15:52:58 +00:00
|
|
|
|
.DA #0 S.FD.DSOCK.STATUS
|
|
|
|
|
*--------------------------------------
|
2018-10-01 05:48:42 +00:00
|
|
|
|
.DA #AF.INET S.SOCKET.AF
|
2018-09-28 15:24:44 +00:00
|
|
|
|
.BS 1 S.SOCKET.T
|
|
|
|
|
.BS 1 S.SOCKET.PROTO
|
2018-10-01 15:52:58 +00:00
|
|
|
|
FD.DSOCK.SIZE .EQ *-FD.DSOCK
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
FD.SSOCK .DA #S.FD.T.SSOCK
|
|
|
|
|
.BS 1 S.FD.HANDLER
|
2018-11-01 08:53:47 +00:00
|
|
|
|
.BS 1 S.FD.SSOCK.HSKT
|
|
|
|
|
.DA #0 S.FD.SSOCK.OPEN
|
|
|
|
|
.DA #0 S.FD.SSOCK.CLOSE
|
2018-10-10 15:39:22 +00:00
|
|
|
|
.DA #LIBTCPIP.Read
|
|
|
|
|
.DA #LIBTCPIP.Write
|
2018-10-01 15:52:58 +00:00
|
|
|
|
.DA #0 S.FD.DSOCK.STATUS
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DA #AF.INET S.SOCKET.AF
|
|
|
|
|
.DA #S.SOCKET.T.STREAM
|
2018-10-08 05:55:28 +00:00
|
|
|
|
.DA #S.IP.PROTOCOL.TCP
|
2018-09-28 15:24:44 +00:00
|
|
|
|
FD.SSOCK.SIZE .EQ *-FD.SSOCK
|
2018-07-26 15:26:39 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
IOCTL .BS S.IOCTL
|
|
|
|
|
DCB.NIC .BS S.DCB.NIC
|
|
|
|
|
IPCFG .BS S.IPCFG
|
|
|
|
|
ARP.CACHE .BS K.ARPCACHE.SIZE*S.ARPCACHE
|
|
|
|
|
DNS.CACHE .BS K.DNSCACHE.SIZE*S.DNSCACHE
|
|
|
|
|
*--------------------------------------
|
2018-09-17 15:42:38 +00:00
|
|
|
|
ARP.REQ .HS FFFFFFFFFFFF S.ETH.DSTMAC
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ARP.REQ.SRCMAC .BS 6
|
2018-11-06 16:31:13 +00:00
|
|
|
|
ARP.REQ.ETYPE .DA /S.ETH.EII.TYPE.ARP
|
|
|
|
|
.DA #S.ETH.EII.TYPE.ARP
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.HS 0001.0800.06.04
|
|
|
|
|
ARP.REQ.OP .DA /S.ARP.OPERATION.REQ
|
|
|
|
|
.DA #S.ARP.OPERATION.REQ
|
|
|
|
|
ARP.REQ.SHA .BS 6
|
|
|
|
|
ARP.REQ.SPA .BS 4
|
|
|
|
|
ARP.REQ.THA .BS 6
|
|
|
|
|
ARP.REQ.TPA .BS 4
|
|
|
|
|
*--------------------------------------
|
2018-08-08 15:13:37 +00:00
|
|
|
|
ARP.REP .EQ *
|
2016-03-13 22:09:00 +00:00
|
|
|
|
ARP.REP.DSTMAC .BS 6
|
|
|
|
|
ARP.REP.SRCMAC .BS 6
|
2018-11-06 16:31:13 +00:00
|
|
|
|
ARP.REP.ETYPE .DA /S.ETH.EII.TYPE.ARP
|
|
|
|
|
.DA #S.ETH.EII.TYPE.ARP
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.HS 0001.0800.06.04
|
|
|
|
|
ARP.REP.OP .DA /S.ARP.OPERATION.REP
|
|
|
|
|
.DA #S.ARP.OPERATION.REP
|
|
|
|
|
ARP.REP.SHA .BS 6
|
|
|
|
|
ARP.REP.SPA .BS 4
|
|
|
|
|
ARP.REP.THA .BS 6
|
|
|
|
|
ARP.REP.TPA .BS 4
|
|
|
|
|
*--------------------------------------
|
2016-03-15 17:16:14 +00:00
|
|
|
|
DNS.MSG
|
|
|
|
|
DNS.MSG.ID .BS 2
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.DA /S.DNS.F.RD Flags=query
|
2016-03-20 22:16:01 +00:00
|
|
|
|
.DA #S.DNS.F.RD
|
2016-03-13 22:09:00 +00:00
|
|
|
|
.DA $100 QDCOUNT
|
|
|
|
|
.BS 6 ANCOUNT,NSCOUNT,ARCOUNT
|
2016-03-15 17:16:14 +00:00
|
|
|
|
DNS.MSG.NAME .BS K.DNS.MAXLEN+6
|
2016-03-13 22:09:00 +00:00
|
|
|
|
*--------------------------------------
|
2018-09-10 15:07:26 +00:00
|
|
|
|
DNS.MSG.LEN .BS 2
|
|
|
|
|
*--------------------------------------
|
2016-03-20 22:16:01 +00:00
|
|
|
|
FRM.QUEUE.Tail .BS 1
|
|
|
|
|
FRM.QUEUE.Head .BS 1
|
|
|
|
|
FRM.QUEUE.hMem .BS K.FRMQUEUE.SIZE
|
|
|
|
|
FRM.QUEUE.State .BS K.FRMQUEUE.SIZE
|
|
|
|
|
FRM.QUEUE.Retry .BS K.FRMQUEUE.SIZE
|
2018-07-23 15:28:42 +00:00
|
|
|
|
FRM.QUEUE.LenL .BS K.FRMQUEUE.SIZE
|
|
|
|
|
FRM.QUEUE.LenH .BS K.FRMQUEUE.SIZE
|
2016-03-13 22:09:00 +00:00
|
|
|
|
*--------------------------------------
|
2018-05-24 15:21:38 +00:00
|
|
|
|
RefCount .DA #0
|
2017-02-13 07:26:18 +00:00
|
|
|
|
DYNPORT.LAST .DA K.DYNPORT.START
|
2018-10-08 15:41:00 +00:00
|
|
|
|
hDNSSocket .BS 1
|
2016-03-15 17:16:14 +00:00
|
|
|
|
DNS.TmpCache .BS S.DNSCACHE
|
2016-03-16 07:19:54 +00:00
|
|
|
|
ARP.TmpCache .BS S.ARP
|
2018-11-06 16:31:13 +00:00
|
|
|
|
*--------------------------------------
|
2018-11-08 14:23:06 +00:00
|
|
|
|
SKT.Index .BS 1
|
2018-11-06 16:31:13 +00:00
|
|
|
|
SKT.TABLE .BS K.SKTTABLE.SIZE
|
2018-10-01 05:48:42 +00:00
|
|
|
|
SKT.LOC.ADDR .BS S.SOCKADDR
|
|
|
|
|
SKT.REM.ADDR .BS S.SOCKADDR
|
2018-11-08 14:23:06 +00:00
|
|
|
|
SKT.Cache .BS S.SOCKET.TCP
|
2016-03-13 22:09:00 +00:00
|
|
|
|
TmpDWord .BS 4
|
2017-02-17 16:39:38 +00:00
|
|
|
|
TmpOffset .BS 2
|
2017-01-29 21:47:19 +00:00
|
|
|
|
hFrameIn .BS 1
|
|
|
|
|
hFrameOut .BS 1
|
2018-05-25 19:03:31 +00:00
|
|
|
|
HST.SScanF .AZ "%d.%d.%d.%d"
|
2017-02-13 07:26:18 +00:00
|
|
|
|
IP.ID .BS 2
|
2018-09-25 06:25:32 +00:00
|
|
|
|
IP.CHECKSUM .BS 2
|
2018-11-09 13:29:23 +00:00
|
|
|
|
.DO IPDEBUG=1
|
2018-11-09 07:45:36 +00:00
|
|
|
|
MSG.FRM.Dump .AZ "FRM:SRC=%d.%d.%d.%d:%D DST=%d.%d.%d.%d:%D\r\n"
|
|
|
|
|
MSG.SKT.Dump .AZ "SKT:LOC=%d.%d.%d.%d:%D REM=%d.%d.%d.%d:%D\r\n"
|
2018-11-09 13:29:23 +00:00
|
|
|
|
.FIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-30 06:31:12 +00:00
|
|
|
|
SAVE /A2OSX.SRC/LIB/LIBTCPIP.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|