A2osX/LIB/LIBTCPIP.S.CFG.txt

108 lines
1.9 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2019-05-05 17:15:37 +00:00
AUTO 3,1
.LIST OFF
*--------------------------------------
2019-01-14 07:11:50 +00:00
CFG.SET >PULLW ZPTmpPtr1 IPCFG
2019-12-18 20:49:41 +00:00
2019-01-16 14:37:21 +00:00
ldy #S.IPCFG-1
2019-12-18 20:49:41 +00:00
2018-07-26 15:26:39 +00:00
.1 lda (ZPTmpPtr1),y
sta IPCFG,y
2019-01-16 14:37:21 +00:00
dey
bpl .1
2019-12-18 20:49:41 +00:00
2018-08-08 15:13:37 +00:00
ldx #5
2019-01-17 15:05:48 +00:00
.2 lda IPCFG+S.NETCFG.MAC,x
2018-08-08 15:13:37 +00:00
sta ARP.REQ.SRCMAC,x
sta ARP.REQ.SHA,x
sta ARP.REP.SRCMAC,x
sta ARP.REP.SHA,x
dex
2019-01-17 15:05:48 +00:00
bpl .2
2019-10-23 09:34:25 +00:00
2018-08-08 15:13:37 +00:00
ldx #3
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
.3 lda IPCFG+S.IPCFG.IP,x
2018-10-09 15:47:06 +00:00
sta SA.LOCAL+S.SOCKADDR.ADDR,x
2018-08-08 15:13:37 +00:00
sta ARP.REQ.SPA,x
sta ARP.REP.SPA,x
dex
2019-01-17 15:05:48 +00:00
bpl .3
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
lda IPCFG+S.NETCFG.DevFlags
2018-07-26 15:26:39 +00:00
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
2019-01-17 15:05:48 +00:00
beq .5
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
>LDYA L.DCB.NIC
>STYA IOCTL+S.IOCTL.BUFPTR
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
lda #S.IOCTL.STATCODE.GETDCB
sta IOCTL+S.IOCTL.STATCODE
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
>PUSHW L.IOCTL
>PUSHBI IOCTL.STATUS
lda IPCFG+S.NETCFG.DevID
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2019-12-18 20:49:41 +00:00
bcs .99
2019-01-17 15:05:48 +00:00
ldx #11 IP/MASK/GW
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
.4 lda IPCFG+S.IPCFG.IP,x
2018-07-23 06:28:47 +00:00
sta DCB.NIC+S.DCB.NIC.IP,x
dex
2019-01-17 15:05:48 +00:00
bpl .4
2019-10-23 09:34:25 +00:00
lda #S.IOCTL.CTRLCODE.SETDCB
sta IOCTL+S.IOCTL.CTRLCODE
2018-07-23 06:28:47 +00:00
2018-07-26 15:26:39 +00:00
>PUSHW L.IOCTL
>PUSHBI IOCTL.CONTROL
2019-01-17 15:05:48 +00:00
lda IPCFG+S.NETCFG.DevID
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2018-07-26 15:26:39 +00:00
bcs .9
2019-10-23 09:34:25 +00:00
2019-01-17 15:05:48 +00:00
.5 lda hDNSSocket
beq .6
2019-10-23 09:34:25 +00:00
2018-10-10 15:39:22 +00:00
jsr SKT.Shutdown
2018-10-08 15:41:00 +00:00
stz hDNSSocket
2019-10-23 09:34:25 +00:00
2019-12-18 20:49:41 +00:00
.6 lda IPCFG+S.IPCFG.IP no IP address yes...so no DNS socket
beq .8
lda IPCFG+S.IPCFG.DNS1
2018-10-08 15:41:00 +00:00
beq .8
2018-10-09 15:47:06 +00:00
>PUSHBI 0 no protocol
2018-10-08 15:41:00 +00:00
lda #S.SOCKET.T.DGRAM
jsr SKT.Socket
2019-12-18 20:49:41 +00:00
.99 bcs .9
2018-10-08 15:41:00 +00:00
sta hDNSSocket
2018-10-09 15:47:06 +00:00
stz SA.LOCAL+S.SOCKADDR.PORT
stz SA.LOCAL+S.SOCKADDR.PORT+1
2019-12-18 20:49:41 +00:00
2018-10-09 15:47:06 +00:00
>PUSHW L.SA.LOCAL
lda hDNSSocket
2019-07-07 20:48:57 +00:00
jsr SKT.Bind
bcs .9
2019-10-23 09:34:25 +00:00
2019-07-07 20:48:57 +00:00
>LDYAI UDP.PORT.DNS
>STYA SA.REMOTE+S.SOCKADDR.PORT
>PUSHW L.SA.REMOTE
lda hDNSSocket
jmp SKT.Connect
2019-12-18 20:49:41 +00:00
2018-07-26 06:03:49 +00:00
.8 clc
.9 rts
*--------------------------------------
2019-01-14 07:11:50 +00:00
CFG.GET >LDYA L.IPCFG
clc
rts
*--------------------------------------
MAN
2018-11-17 17:17:13 +00:00
SAVE USR/SRC/LIB/LIBTCPIP.S.CFG
LOAD USR/SRC/LIB/LIBTCPIP.S
ASM