mirror of
https://github.com/A2osX/A2osX.git
synced 2024-10-31 23:09:33 +00:00
133 lines
2.4 KiB
Plaintext
133 lines
2.4 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* PULLW = PTR to S.IPCFG
|
||
*--------------------------------------
|
||
SET.IPCFG >PULLW ZPTmpPtr1
|
||
ldy #0
|
||
|
||
.1 lda (ZPTmpPtr1),y
|
||
sta IPCFG,y
|
||
iny
|
||
cpy #S.IPCFG
|
||
bne .1
|
||
|
||
ldx #5
|
||
|
||
.2 lda 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 .2
|
||
|
||
ldx #3
|
||
|
||
.3 lda IPCFG+S.IPCFG.IP,x
|
||
sta ARP.REQ.SPA,x
|
||
sta ARP.REP.SPA,x
|
||
sta DNS.SOCKET.SA,x
|
||
dex
|
||
bpl .3
|
||
|
||
>LDYA L.DCB.NIC
|
||
>STYA IOCTL+S.IOCTL.BUFPTR
|
||
lda S.IOCTL.STATCODE.GETDCB
|
||
sta S.IOCTL.STATCODE
|
||
|
||
ldx IOCTL.STATUS
|
||
jsr SET.IPCFG.IOCTL
|
||
|
||
>STYA ZPTmpPtr2
|
||
lda DCB.NIC+S.DCB.NIC.FLAGS
|
||
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
|
||
beq .4
|
||
|
||
ldx #11
|
||
|
||
.31 lda IPCFG+S.IPCFG.IP,x
|
||
sta DCB.NIC+S.DCB.NIC.IP,x
|
||
dex
|
||
bpl .31
|
||
|
||
* lda S.IOCTL.CTRLCODE.SETDCB same as lda S.IOCTL.STATCODE.GETDCB
|
||
* sta S.IOCTL.CTRLCODE same as sta S.IOCTL.STATCODE
|
||
|
||
lda IPCFG+S.IPCFG.HDEV
|
||
jsr SET.IPCFG.IOCTL
|
||
|
||
.4 lda hDNSSocket1
|
||
beq .41
|
||
jsr SKT.CLOSEA
|
||
stz hDNSSocket1
|
||
|
||
.41 lda hDNSSocket2
|
||
beq .42
|
||
jsr SKT.CLOSEA
|
||
stz hDNSSocket2
|
||
|
||
.42 lda IPCFG+S.IPCFG.DNS1
|
||
beq .6
|
||
|
||
ldx #3
|
||
|
||
.5 lda IPCFG+S.IPCFG.DNS1,x
|
||
sta DNS.SOCKET.DA,x
|
||
dex
|
||
bpl .5
|
||
|
||
stz DNS.SOCKET.SP
|
||
stz DNS.SOCKET.SP+1
|
||
|
||
>PUSHW L.DNS.SOCKET
|
||
jsr SKT.New
|
||
bcs .9
|
||
|
||
stx hDNSSocket1
|
||
|
||
.6 lda IPCFG+S.IPCFG.DNS2
|
||
beq .8
|
||
|
||
ldx #3
|
||
|
||
.7 lda IPCFG+S.IPCFG.DNS2,x
|
||
sta DNS.SOCKET.DA,x
|
||
dex
|
||
bpl .7
|
||
|
||
stz DNS.SOCKET.SP
|
||
stz DNS.SOCKET.SP+1
|
||
|
||
>PUSHW L.DNS.SOCKET
|
||
jsr SKT.New
|
||
bcs .9
|
||
|
||
stx hDNSSocket2
|
||
|
||
.8 >LDYA ZPTmpPtr1
|
||
clc
|
||
.9 rts
|
||
|
||
SET.IPCFG.IOCTL >PUSHW L.IOCTL
|
||
txa
|
||
>PUSHA
|
||
lda IPCFG+S.IPCFG.HDEV
|
||
>SYSCALL IOCTL
|
||
rts
|
||
*--------------------------------------
|
||
* grab a copy on the fly for lib function
|
||
* OUT :
|
||
* Y,A = PTR to S.IPCFG
|
||
*--------------------------------------
|
||
GET.IPCFG >LDYA L.IPCFG
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/LIB/LIBTCPIP.S.CFG
|
||
LOAD /A2OSX.SRC/LIB/LIBTCPIP.S
|
||
ASM
|