Kernel version 0.8 : FIXED TCP/IP config files reading not expanding ${A2OSX} in names

This commit is contained in:
Rémy GIBERT 2016-10-26 22:49:08 +02:00
parent aab7c77e4d
commit 773c1f22b8
2 changed files with 65 additions and 32 deletions

View File

@ -13,12 +13,11 @@ CFG.Read >PUSHW L.HOSTNAME
bcc .1
>PUSHA
>LDYA L.MSG.CFG.KO
>SYSCALL PrintFYA
bra .2
.1 >LDYA L.MSG.CFG.OK
>SYSCALL PrintFYA
.2 >SYSCALL PrintFYA
.2 >PUSHW L.TCPIP.CONF
>PUSHW L.TCPIP.CONF
>LDYA L.MSG.CFG
>SYSCALL PrintFYA
@ -26,12 +25,11 @@ CFG.Read >PUSHW L.HOSTNAME
bcc .3
>PUSHA
>LDYA L.MSG.CFG.KO
>SYSCALL PrintFYA
bra .4
.3 >LDYA L.MSG.CFG.OK
>SYSCALL PrintFYA
.4 >SYSCALL PrintFYA
.4 >PUSHW L.HOSTS
>PUSHW L.HOSTS
>LDYA L.MSG.CFG
>SYSCALL PrintFYA
@ -39,19 +37,29 @@ CFG.Read >PUSHW L.HOSTNAME
bcc .5
>PUSHA
>LDYA L.MSG.CFG.KO
>SYSCALL PrintFYA
bra .6
.5 >LDYA L.MSG.CFG.OK
>SYSCALL PrintFYA
.6 rts
.5 >SYSCALL PrintFYA
.6 >LDYA L.MSG.CFG.OK
rts
*--------------------------------------
CFG.Read.HOSTNAME
stz CFG.hCfgFile
stz CFG.hCfgPath
>LDYA L.HOSTNAME
>SYSCALL ExpandPStrYA
bcs .99
stx CFG.hCfgPath
pha
>PUSHWI 0 Aux type
>PUSHBI 4 S.FILEINFO.TYPE.TXT
>PUSHBI SYS.FOPEN.R
>PUSHW L.HOSTNAME
pla
>PUSHYA
>SYSCALL LoadFile
bcs .99
bcs .9
stx CFG.hCfgFile
>STYA CFG.FileLen
@ -60,37 +68,46 @@ CFG.Read.HOSTNAME
>STYA ZPIPCfgPtr
lda CFG.FileLen+1
bne .2
bne .9
ldy CFG.FileLen
beq .2
beq .9
cpy #15
bcs .2
bcs .9
sta IPCFG+S.IPCFG.HOSTNAME,y
.1 dey
bmi .89
bmi .2
lda (ZPIPCfgPtr),y
sta IPCFG+S.IPCFG.HOSTNAME,y
bra .1
.2 jsr .89
sec
.2 jsr CFG.Read.CleanUp
clc
rts
.89 lda CFG.hCfgFile
>SYSCALL FreeMemA
clc
.9 jsr CFG.Read.CleanUp
sec
.99 rts
*--------------------------------------
CFG.Read.TCPIP.CONF
stz CFG.hCfgFile
stz CFG.hCfgPath
>LDYA L.TCPIP.CONF
>SYSCALL ExpandPStrYA
bcs .99
stx CFG.hCfgPath
pha
>PUSHWI 0 Aux type
>PUSHBI 4 S.FILEINFO.TYPE.TXT
>PUSHBI SYS.FOPEN.R
>PUSHW L.TCPIP.CONF
pla
>PUSHYA
>SYSCALL LoadFile
bcs .99
bcs .9
stx CFG.hCfgFile
>STYA CFG.FileLen
txa
@ -98,7 +115,7 @@ CFG.Read.TCPIP.CONF
>STYA ZPIPCfgPtr
.1 jsr CFG.GetLine
bcs .89
bcs .8
jsr CFG.GetKeyword
bcs .1
@ -123,6 +140,10 @@ CFG.Read.TCPIP.CONF
bne .2
bra .1
.9 jsr CFG.Read.CleanUp
sec
.99 rts
.3 jsr CFG.ScanIP
bcs .1
@ -144,11 +165,9 @@ CFG.Read.TCPIP.CONF
sta IPCFG
bra .1
.89 lda CFG.hCfgFile
>SYSCALL FreeMemA
.8 jsr CFG.Read.CleanUp
clc
.99 rts
rts
*--------------------------------------
CFG.Read.HOSTS >PUSHWI 0 Aux type
>PUSHBI 4 S.FILEINFO.TYPE.TXT
@ -168,6 +187,19 @@ CFG.Read.HOSTS >PUSHWI 0 Aux type
clc
.99 rts
*--------------------------------------
CFG.Read.CleanUp
pha
lda CFG.hCfgPath
beq .1
>SYSCALL FreeMemA
.1 lda CFG.hCfgFile
beq .8
>SYSCALL FreeMemA
.8 pla
rts
*--------------------------------------
CFG.GetLine stz UsrBuf256
ldx #0
ldy #0

View File

@ -8,9 +8,9 @@ AUTO 6
.OR $2000
.TF /A2OSX.BOOT/SBIN/TCPIP
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/LIBTCPIP.I
.INB /A2OSX.DEV/INC/MACROS.I
.INB /A2OSX.DEV/INC/A2OSX.I
.INB /A2OSX.DEV/INC/LIBTCPIP.I
*--------------------------------------
ZPIPCfgPtr .EQ ZPBIN
ZPIPDevPtr .EQ ZPBIN+2
@ -231,6 +231,7 @@ hLIBTCPIP .BS 1
hNetDev .BS 1
IPCFG .BS S.IPCFG
CFG.hCfgFile .BS 1
CFG.hCfgPath .BS 1
CFG.FileLen .BS 2
CFG.Keyword .BS 1
CFG.StrBuf .BS 4