A2osX/LIB/LIBTCPIP.S.CFG.txt

94 lines
1.7 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
*--------------------------------------
CFG.GET >LDYA L.IPCFG
clc
CFG.GET.RTS rts
*--------------------------------------
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
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
2021-05-04 17:31:21 +00:00
lda #S.IOCTL.S.GETDCB
sta IOCTL+S.IOCTL.S
2019-10-23 09:34:25 +00:00
2020-03-23 07:08:27 +00:00
ldx #IOCTL.STATUS
jsr CFG.IOCTL
bcs CFG.GET.RTS
2019-01-17 15:05:48 +00:00
ldx #11 IP/MASK/GW
2019-10-23 09:34:25 +00:00
lda IPCFG+S.IPCFG.IP
bne .3
lda DCB.NIC+S.DCB.NIC.IP
beq .6
.2 lda DCB.NIC+S.DCB.NIC.IP,x
sta IPCFG+S.IPCFG.IP,x
dex
bpl .2
lda #S.IPCFG.STATUS.OK
sta IPCFG
bra .6
.3 lda IPCFG+S.IPCFG.IP,x
2018-07-23 06:28:47 +00:00
sta DCB.NIC+S.DCB.NIC.IP,x
dex
bpl .3
2019-10-23 09:34:25 +00:00
.6 lda #S.IOCTL.C.SETDCB
2021-05-04 17:31:21 +00:00
sta IOCTL+S.IOCTL.C
2018-07-23 06:28:47 +00:00
ldx #IOCTL.CONTROL NIC driver may wants IP config....
jsr CFG.IOCTL
* bcs CFG.GET.RTS .....or not
ldx #5
.7 lda IPCFG+S.NETCFG.MAC,x
sta ARP.REQ.SRCMAC,x
sta ARP.REQ.SHA,x
sta ARP.REP.SRCMAC,x
sta ARP.REP.SHA,x
dex
bpl .7
2019-10-23 09:34:25 +00:00
ldx #3
.8 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 .8
stz SA.LOCAL+S.SOCKADDR.PORT
2018-10-09 15:47:06 +00:00
stz SA.LOCAL+S.SOCKADDR.PORT+1
2019-12-18 20:49:41 +00:00
2021-05-19 12:44:47 +00:00
>PUSHB hDNSSocket
2018-10-09 15:47:06 +00:00
>PUSHW L.SA.LOCAL
2020-09-05 13:38:04 +00:00
jmp SKT.Bind
*--------------------------------------
CFG.IOCTL >PUSHB IPCFG+S.NETCFG.DevID
2020-03-23 07:08:27 +00:00
txa
>PUSHA
>PUSHW L.IOCTL
>SYSCALL2 IOCTL
rts
*--------------------------------------
MAN
2020-06-07 08:06:51 +00:00
SAVE usr/src/lib/libtcpip.s.cfg
LOAD usr/src/lib/libtcpip.s
ASM