A2osX/LIB/LIBTCPIP.S.CFG.txt
2019-01-14 07:11:50 +00:00

100 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX
AUTO 4,1
.LIST OFF
*--------------------------------------
CFG.SET >PULLW ZPTmpPtr1 IPCFG
ldy #0
.1 lda (ZPTmpPtr1),y
sta IPCFG,y
iny
cpy #S.IPCFG
bne .1
CFG.SET.I >LDYA L.DCB.NIC
>STYA IOCTL+S.IOCTL.BUFPTR
lda #S.IOCTL.STATCODE.GETDCB
sta IOCTL+S.IOCTL.STATCODE
>PUSHW L.IOCTL
>PUSHBI IOCTL.STATUS
lda IPCFG+S.IPCFG.DevID
>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
sta SA.LOCAL+S.SOCKADDR.ADDR,x
sta ARP.REQ.SPA,x
sta ARP.REP.SPA,x
dex
bpl .11
lda DCB.NIC+S.DCB.NIC.FLAGS
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
beq .2
ldx #11
.1 lda IPCFG+S.IPCFG.IP,x
sta DCB.NIC+S.DCB.NIC.IP,x
dex
bpl .1
lda S.IOCTL.CTRLCODE.SETDCB
sta S.IOCTL.CTRLCODE
>PUSHW L.IOCTL
>PUSHBI IOCTL.CONTROL
lda IPCFG+S.IPCFG.DevID
>SYSCALL IOCTL
bcs .9
.2 lda hDNSSocket
beq .3
jsr SKT.Shutdown
stz hDNSSocket
.3 lda IPCFG+S.IPCFG.DNS1
beq .8
>PUSHBI 0 no protocol
lda #S.SOCKET.T.DGRAM
jsr SKT.Socket
bcs .9
sta hDNSSocket
stz SA.LOCAL+S.SOCKADDR.PORT
stz SA.LOCAL+S.SOCKADDR.PORT+1
>PUSHW L.SA.LOCAL
lda hDNSSocket
jsr SKT.Bind
.8 clc
.9 rts
*--------------------------------------
CFG.GET >LDYA L.IPCFG
clc
rts
*--------------------------------------
MAN
SAVE USR/SRC/LIB/LIBTCPIP.S.CFG
LOAD USR/SRC/LIB/LIBTCPIP.S
ASM