2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2019-01-14 07:11:50 +00:00
|
|
|
|
CFG.SET >PULLW ZPTmpPtr1 IPCFG
|
2018-07-26 15:26:39 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPTmpPtr1),y
|
|
|
|
|
sta IPCFG,y
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.IPCFG
|
|
|
|
|
bne .1
|
|
|
|
|
|
2019-01-14 07:11:50 +00:00
|
|
|
|
CFG.SET.I >LDYA L.DCB.NIC
|
2018-08-08 15:13:37 +00:00
|
|
|
|
>STYA IOCTL+S.IOCTL.BUFPTR
|
|
|
|
|
lda #S.IOCTL.STATCODE.GETDCB
|
|
|
|
|
sta IOCTL+S.IOCTL.STATCODE
|
|
|
|
|
|
|
|
|
|
>PUSHW L.IOCTL
|
|
|
|
|
>PUSHBI IOCTL.STATUS
|
2019-01-14 07:11:50 +00:00
|
|
|
|
lda IPCFG+S.IPCFG.DevID
|
2018-08-08 15:13:37 +00:00
|
|
|
|
>SYSCALL IOCTL
|
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
ldx #5
|
|
|
|
|
|
|
|
|
|
.10 lda DCB.NIC+S.DCB.NIC.MAC,x
|
|
|
|
|
sta IPCFG+S.IPCFG.MAC,x
|
|
|
|
|
sta ARP.REQ.SRCMAC,x
|
|
|
|
|
sta ARP.REQ.SHA,x
|
|
|
|
|
sta ARP.REP.SRCMAC,x
|
|
|
|
|
sta ARP.REP.SHA,x
|
|
|
|
|
dex
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
ldx #3
|
|
|
|
|
|
|
|
|
|
.11 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
|
|
|
|
|
bpl .11
|
|
|
|
|
|
|
|
|
|
lda DCB.NIC+S.DCB.NIC.FLAGS
|
2018-07-26 15:26:39 +00:00
|
|
|
|
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
|
|
|
|
|
beq .2
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
2018-07-23 06:28:47 +00:00
|
|
|
|
ldx #11
|
|
|
|
|
|
2018-07-26 15:26:39 +00:00
|
|
|
|
.1 lda IPCFG+S.IPCFG.IP,x
|
2018-07-23 06:28:47 +00:00
|
|
|
|
sta DCB.NIC+S.DCB.NIC.IP,x
|
|
|
|
|
dex
|
2018-07-26 15:26:39 +00:00
|
|
|
|
bpl .1
|
2018-07-23 06:28:47 +00:00
|
|
|
|
|
2018-07-26 15:26:39 +00:00
|
|
|
|
lda S.IOCTL.CTRLCODE.SETDCB
|
|
|
|
|
sta 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-14 07:11:50 +00:00
|
|
|
|
lda IPCFG+S.IPCFG.DevID
|
2018-07-26 15:26:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
|
|
|
|
bcs .9
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
.2 lda hDNSSocket
|
2018-07-26 15:26:39 +00:00
|
|
|
|
beq .3
|
2018-10-10 15:39:22 +00:00
|
|
|
|
jsr SKT.Shutdown
|
2018-10-08 15:41:00 +00:00
|
|
|
|
stz hDNSSocket
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
.3 lda IPCFG+S.IPCFG.DNS1
|
|
|
|
|
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
|
2016-10-17 06:21:04 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-10-08 15:41:00 +00:00
|
|
|
|
sta hDNSSocket
|
2016-10-17 06:21:04 +00:00
|
|
|
|
|
2018-10-09 15:47:06 +00:00
|
|
|
|
stz SA.LOCAL+S.SOCKADDR.PORT
|
|
|
|
|
stz SA.LOCAL+S.SOCKADDR.PORT+1
|
|
|
|
|
|
|
|
|
|
>PUSHW L.SA.LOCAL
|
|
|
|
|
lda hDNSSocket
|
|
|
|
|
jsr SKT.Bind
|
|
|
|
|
|
2018-07-26 06:03:49 +00:00
|
|
|
|
.8 clc
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-01-14 07:11:50 +00:00
|
|
|
|
CFG.GET >LDYA L.IPCFG
|
2016-10-17 06:21:04 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2018-11-17 17:17:13 +00:00
|
|
|
|
SAVE USR/SRC/LIB/LIBTCPIP.S.CFG
|
|
|
|
|
LOAD USR/SRC/LIB/LIBTCPIP.S
|
2016-10-17 06:21:04 +00:00
|
|
|
|
ASM
|