2016-03-13 21:51:50 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2019-01-15 16:37:32 +00:00
|
|
|
|
.TF BIN/IPCONFIG
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2019-01-05 20:33:08 +00:00
|
|
|
|
.INB INC/KERNEL.I
|
|
|
|
|
.INB INC/MLI.I
|
2018-12-06 16:39:53 +00:00
|
|
|
|
.INB INC/MLI.E.I
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/NIC.I
|
|
|
|
|
.INB INC/ETH.I
|
2019-01-17 15:05:48 +00:00
|
|
|
|
.INB INC/LIB.NET.I
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/LIBTCPIP.I
|
2019-01-05 20:33:08 +00:00
|
|
|
|
.INB INC/NET.DHCP.I
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TIMEOUT.MAX .EQ 200 20 sec.
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-06 16:39:53 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
pIPCFG .BS 2
|
2019-01-05 20:33:08 +00:00
|
|
|
|
ZPFrameBase .BS 2
|
|
|
|
|
ZPFramePtr .BS 2
|
|
|
|
|
ZPTmpPtr1 .BS 2
|
|
|
|
|
ZPTmpPtr2 .BS 2
|
|
|
|
|
ZPTmpPtr3 .BS 2
|
|
|
|
|
*--------------------------------------
|
2018-12-06 16:39:53 +00:00
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2019-01-15 16:37:32 +00:00
|
|
|
|
.DA #S.PS.F.EVENT
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA CS.END-CS.START Code Size (without Constants)
|
2019-07-22 06:31:01 +00:00
|
|
|
|
.DA DS.END-DS.START Data Segment Size
|
|
|
|
|
.DA #64 Stack Size
|
2018-12-06 16:39:53 +00:00
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
2019-10-03 06:25:27 +00:00
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
2018-12-06 16:39:53 +00:00
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
2019-01-14 16:37:56 +00:00
|
|
|
|
L.MSG.NODEV .DA MSG.NODEV
|
2016-03-13 21:51:50 +00:00
|
|
|
|
L.MSG1.DEV .DA MSG1.DEV
|
|
|
|
|
L.MSG1.DEV.ARP .DA MSG1.DEV.ARP
|
2016-04-18 20:17:28 +00:00
|
|
|
|
L.MSG1.DEV.IP .DA MSG1.DEV.IP
|
2016-03-13 21:51:50 +00:00
|
|
|
|
L.MSG1.LINK.OK .DA MSG1.LINK.OK
|
|
|
|
|
L.MSG1.LINK.KO .DA MSG1.LINK.KO
|
|
|
|
|
L.MSG1.LINKSPEED .DA MSG1.LINKSPEED
|
|
|
|
|
L.MSG1.DPLX.FD .DA MSG1.DPLX.FD
|
|
|
|
|
L.MSG1.DPLX.HD .DA MSG1.DPLX.HD
|
|
|
|
|
L.MSG2 .DA MSG2
|
|
|
|
|
L.MSG2.C .DA MSG2.C
|
|
|
|
|
L.MSG2.U .DA MSG2.U
|
|
|
|
|
L.MSG2.DHCPSRVR .DA MSG2.DHCPSRVR
|
|
|
|
|
L.MSG2.IP .DA MSG2.IP
|
|
|
|
|
L.MSG2.GW .DA MSG2.GW
|
|
|
|
|
L.MSG2.DNS .DA MSG2.DNS
|
|
|
|
|
L.MSG2.HOSTNAME .DA MSG2.HOSTNAME
|
2018-12-06 16:39:53 +00:00
|
|
|
|
L.MSG.CFG .DA MSG.CFG
|
|
|
|
|
L.MSG.CFG.KO .DA MSG.CFG.KO
|
|
|
|
|
L.MSG.CFG.OK .DA MSG.CFG.OK
|
|
|
|
|
L.HOSTNAME .DA HOSTNAME
|
|
|
|
|
L.TCPIP.CONF .DA TCPIP.CONF
|
|
|
|
|
L.HOSTS .DA HOSTS
|
2019-01-05 20:33:08 +00:00
|
|
|
|
L.IPCFG .DA IPCFG
|
2019-01-15 16:37:32 +00:00
|
|
|
|
L.IPCFG.HOSTNAME .DA IPCFG+S.IPCFG.HOSTNAME
|
2019-01-16 14:37:21 +00:00
|
|
|
|
L.IPCFG.DOMAIN .DA IPCFG+S.IPCFG.DOMAIN
|
2019-01-05 20:33:08 +00:00
|
|
|
|
L.CFG.IP .DA CFG.IP
|
2019-01-15 16:37:32 +00:00
|
|
|
|
L.CFG.IP.SScanF .DA CFG.IP.SScanF
|
|
|
|
|
L.CFG.HOST.SScanF .DA CFG.HOST.SScanF
|
2019-01-14 16:37:56 +00:00
|
|
|
|
L.CFG.DefaultHost .DA CFG.DefaultHost
|
2019-01-05 20:33:08 +00:00
|
|
|
|
L.CFG.Keywords .DA CFG.Keywords
|
|
|
|
|
J.CFG.Keywords .DA CFG.Read.address
|
|
|
|
|
.DA CFG.Read.netmask
|
|
|
|
|
.DA CFG.Read.gateway
|
|
|
|
|
.DA CFG.Read.nameserver
|
|
|
|
|
.DA CFG.Read.dnsdomain
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-05 20:33:08 +00:00
|
|
|
|
* DHCP
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.SA.LOCAL .DA SA.LOCAL
|
|
|
|
|
L.SA.REMOTE .DA SA.REMOTE
|
2019-07-07 20:48:57 +00:00
|
|
|
|
L.SA.DEST .DA SA.DEST
|
2019-01-05 20:33:08 +00:00
|
|
|
|
L.MSG.DHCP.CFG1 .DA MSG.DHCP.CFG1
|
|
|
|
|
L.MSG.DHCP.CFG2 .DA MSG.DHCP.CFG2
|
|
|
|
|
L.MSG.DHCP.KO .DA MSG.DHCP.KO
|
|
|
|
|
L.MSG.DHCP.OK .DA MSG.DHCP.OK
|
|
|
|
|
L.MSG.DHCP.NA .DA MSG.DHCP.NA
|
|
|
|
|
L.DHCP.DISC .DA DHCP.DISC
|
|
|
|
|
L.DHCP.REQ .DA DHCP.REQ
|
2019-01-14 16:37:56 +00:00
|
|
|
|
.DA 0
|
2019-01-05 20:33:08 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-17 06:21:04 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBTCPIP
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>SYSCALL LoadLib
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bcs .9
|
2016-03-13 21:51:50 +00:00
|
|
|
|
sta hLIBTCPIP
|
2018-11-09 13:29:23 +00:00
|
|
|
|
|
2017-01-28 22:05:20 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-01-14 16:37:56 +00:00
|
|
|
|
CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
|
|
|
|
|
>STYA pIPCFG
|
|
|
|
|
|
2019-01-16 14:37:21 +00:00
|
|
|
|
ldy #S.IPCFG-1
|
|
|
|
|
.1 lda (pIPCFG),y
|
|
|
|
|
sta IPCFG,y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2019-01-17 15:05:48 +00:00
|
|
|
|
lda IPCFG+S.NETCFG.DevID
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bne CS.RUN.SETUP
|
2019-01-14 16:37:56 +00:00
|
|
|
|
>LDYA L.MSG.NODEV
|
|
|
|
|
>SYSCALL puts
|
|
|
|
|
lda #MLI.E.NODEV
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-01-16 14:37:21 +00:00
|
|
|
|
CS.RUN.SETUP
|
|
|
|
|
.1 >INC.G ArgIndex
|
2018-12-06 16:39:53 +00:00
|
|
|
|
>SYSCALL ArgV
|
2019-01-14 16:37:56 +00:00
|
|
|
|
bcs .4
|
2019-01-15 16:37:32 +00:00
|
|
|
|
>STYA ZPTmpPtr1
|
|
|
|
|
lda (ZPTmpPtr1)
|
2018-12-06 16:39:53 +00:00
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .99
|
|
|
|
|
ldy #1
|
2019-01-15 16:37:32 +00:00
|
|
|
|
lda (ZPTmpPtr1),y
|
2018-12-06 16:39:53 +00:00
|
|
|
|
|
|
|
|
|
ldx OptionList
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
.99 >PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.USAGE
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
.3 ldy OptionVars-1,x
|
|
|
|
|
lda #$80
|
|
|
|
|
sta (pData),y
|
|
|
|
|
bra .1
|
|
|
|
|
|
2019-01-17 15:05:48 +00:00
|
|
|
|
.4 lda IPCFG+S.NETCFG.STATUS
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bne .5
|
|
|
|
|
lda #$ff no config, force all
|
2019-01-15 16:37:32 +00:00
|
|
|
|
>STA.G bETC
|
|
|
|
|
>STA.G bDHCP
|
|
|
|
|
.5 >LDA.G bETC
|
2019-01-16 14:37:21 +00:00
|
|
|
|
>ORA.G bDHCP
|
|
|
|
|
beq CS.RUN.DUMP
|
|
|
|
|
|
|
|
|
|
>LDA.G bETC
|
2019-01-15 16:37:32 +00:00
|
|
|
|
bpl .6
|
2019-01-14 16:37:56 +00:00
|
|
|
|
jsr CFG.EtcFiles
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2019-01-15 16:37:32 +00:00
|
|
|
|
.6 >LDA.G bDHCP
|
|
|
|
|
bpl .8
|
2019-01-16 14:37:21 +00:00
|
|
|
|
|
2019-01-15 16:37:32 +00:00
|
|
|
|
jsr DHCP.INIT
|
|
|
|
|
bcs .8
|
2019-01-15 07:36:21 +00:00
|
|
|
|
|
2019-01-15 16:37:32 +00:00
|
|
|
|
jsr DHCP.RUN
|
2019-01-15 07:36:21 +00:00
|
|
|
|
|
2019-01-15 16:37:32 +00:00
|
|
|
|
jsr DHCP.QUIT
|
2019-01-15 07:36:21 +00:00
|
|
|
|
|
2019-01-17 15:05:48 +00:00
|
|
|
|
.8 lda #0
|
2019-01-16 14:37:21 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.DUMP >PUSHEA.G DIB
|
2019-01-17 15:05:48 +00:00
|
|
|
|
lda IPCFG+S.NETCFG.DevID
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL GetDevStatus
|
2018-07-23 15:28:42 +00:00
|
|
|
|
>LEA.G DCB.NIC
|
2018-07-24 16:00:24 +00:00
|
|
|
|
>STYA.G IOCTL+S.IOCTL.BUFPTR
|
|
|
|
|
lda #S.IOCTL.STATCODE.GETDCB
|
|
|
|
|
>STA.G IOCTL+S.IOCTL.STATCODE
|
2018-07-23 15:28:42 +00:00
|
|
|
|
|
|
|
|
|
>PUSHEA.G IOCTL
|
|
|
|
|
>PUSHBI IOCTL.STATUS
|
2019-01-17 15:05:48 +00:00
|
|
|
|
lda IPCFG+S.NETCFG.DevID
|
2018-07-23 15:28:42 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2019-01-14 16:37:56 +00:00
|
|
|
|
CS.RUN.DUMPNIC ldy #DCB.NIC+S.DCB.NIC.MAC+5
|
2018-07-24 16:00:24 +00:00
|
|
|
|
ldx #6
|
|
|
|
|
.1 lda (pData),y
|
|
|
|
|
>PUSHA
|
2017-01-28 22:05:20 +00:00
|
|
|
|
dey
|
2018-07-24 16:00:24 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2018-07-23 15:28:42 +00:00
|
|
|
|
>PUSHEA.G DIB+S.DIB.IDS
|
2019-01-14 20:34:37 +00:00
|
|
|
|
|
2019-01-17 15:05:48 +00:00
|
|
|
|
ldx IPCFG+S.NETCFG.DevID
|
2019-02-27 15:00:56 +00:00
|
|
|
|
lda Dev.Table-1,x
|
2019-01-14 07:11:50 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.FD.DEV
|
|
|
|
|
tay
|
2019-02-27 15:00:56 +00:00
|
|
|
|
lda Dev.Table,x
|
2019-01-14 07:11:50 +00:00
|
|
|
|
adc /S.FD.DEV
|
2019-01-16 14:37:21 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>PUSHYA
|
2019-01-17 15:05:48 +00:00
|
|
|
|
lda IPCFG+S.NETCFG.DevID
|
2019-01-14 07:11:50 +00:00
|
|
|
|
>PUSHA
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 11
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-10-29 08:41:10 +00:00
|
|
|
|
>LDA.G DCB.NIC+S.DCB.NIC.FLAGS
|
2018-07-23 15:28:42 +00:00
|
|
|
|
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
beq .2
|
|
|
|
|
lda #1
|
2018-08-23 15:16:20 +00:00
|
|
|
|
.2 >PUSHA
|
|
|
|
|
>PUSHBI 1
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV.ARP
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-10-29 08:41:10 +00:00
|
|
|
|
>LDA.G DCB.NIC+S.DCB.NIC.FLAGS
|
2018-07-23 15:28:42 +00:00
|
|
|
|
and #S.DCB.NIC.FLAGS.IPOFFLOAD
|
|
|
|
|
|
2016-04-18 20:17:28 +00:00
|
|
|
|
beq .3
|
2018-07-23 15:28:42 +00:00
|
|
|
|
|
2016-04-18 20:17:28 +00:00
|
|
|
|
lda #1
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.3
|
|
|
|
|
>PUSHA
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 1
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DEV.IP
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-07-24 16:00:24 +00:00
|
|
|
|
|
2018-10-29 08:41:10 +00:00
|
|
|
|
>LDA.G DCB.NIC+S.DCB.NIC.LINK
|
2018-07-23 15:28:42 +00:00
|
|
|
|
and #S.DCB.NIC.LINK.OK
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bne CS.RUN.LINK
|
2018-07-24 16:00:24 +00:00
|
|
|
|
>LDYA L.MSG1.LINK.KO
|
|
|
|
|
>SYSCALL puts
|
2017-01-28 22:05:20 +00:00
|
|
|
|
bra CS.RUN.DUMPIP
|
2018-07-24 16:00:24 +00:00
|
|
|
|
CS.RUN.LINK >LDYA L.MSG1.LINK.OK
|
|
|
|
|
>SYSCALL puts
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 0
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.LINKSPEED
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-10-29 08:41:10 +00:00
|
|
|
|
>LDA.G DCB.NIC+S.DCB.NIC.SPEED
|
2016-03-13 21:51:50 +00:00
|
|
|
|
and #$0F
|
|
|
|
|
tax
|
|
|
|
|
.4 phx
|
|
|
|
|
lda #'0'
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL PutChar
|
2016-03-13 21:51:50 +00:00
|
|
|
|
plx
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
2018-10-29 08:41:10 +00:00
|
|
|
|
>LDA.G DCB.NIC+S.DCB.NIC.LINK
|
2018-07-23 15:28:42 +00:00
|
|
|
|
and #S.DCB.NIC.LINK.FD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bne .5
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1.DPLX.HD
|
2016-03-13 21:51:50 +00:00
|
|
|
|
bra .6
|
2016-10-17 06:21:04 +00:00
|
|
|
|
.5 >LDYA L.MSG1.DPLX.FD
|
2018-07-24 16:00:24 +00:00
|
|
|
|
.6 >SYSCALL puts
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2018-08-23 15:16:20 +00:00
|
|
|
|
CS.RUN.DUMPIP >PUSHBI 0
|
|
|
|
|
>LDYA L.MSG2
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-17 15:05:48 +00:00
|
|
|
|
lda IPCFG+S.NETCFG.STATUS
|
2016-03-13 21:51:50 +00:00
|
|
|
|
and #S.IPCFG.STATUS.OK
|
|
|
|
|
beq .11
|
|
|
|
|
>LDYA L.MSG2.C
|
|
|
|
|
bra .10
|
|
|
|
|
.11 >LDYA L.MSG2.U
|
2018-07-24 16:00:24 +00:00
|
|
|
|
.10 >SYSCALL puts
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2019-01-16 14:37:21 +00:00
|
|
|
|
ldx #3
|
|
|
|
|
.2 >PUSHB IPCFG+S.IPCFG.DHCPSRVR,x
|
2016-03-13 21:51:50 +00:00
|
|
|
|
dex
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bpl .2
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 4
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.DHCPSRVR
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-16 14:37:21 +00:00
|
|
|
|
ldx #7 IP/MASK
|
|
|
|
|
.3 >PUSHB IPCFG+S.IPCFG.IP,x
|
|
|
|
|
|
2016-03-13 21:51:50 +00:00
|
|
|
|
dex
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bpl .3
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 8
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.IP
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-16 14:37:21 +00:00
|
|
|
|
ldx #3
|
|
|
|
|
.4 >PUSHB IPCFG+S.IPCFG.GW,x
|
2016-03-13 21:51:50 +00:00
|
|
|
|
dex
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bpl .4
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 4
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.GW
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-16 14:37:21 +00:00
|
|
|
|
ldy #7
|
|
|
|
|
.5 >PUSHB IPCFG+S.IPCFG.DNS1,x
|
2016-03-13 21:51:50 +00:00
|
|
|
|
dex
|
2019-01-16 14:37:21 +00:00
|
|
|
|
bpl .5
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 8
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.DNS
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-16 14:37:21 +00:00
|
|
|
|
>PUSHW L.IPCFG.DOMAIN
|
|
|
|
|
>PUSHW L.IPCFG.HOSTNAME
|
2016-03-13 21:51:50 +00:00
|
|
|
|
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 4
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG2.HOSTNAME
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2019-01-14 16:37:56 +00:00
|
|
|
|
lda #0 tell TSKMGR that all done ok, but
|
2016-03-13 21:51:50 +00:00
|
|
|
|
sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-01-05 20:33:08 +00:00
|
|
|
|
CS.DOEVENT lda (pEvent)
|
|
|
|
|
bpl .9 is it a TIMER event?
|
|
|
|
|
>LDA.G TimeOut
|
|
|
|
|
beq .9
|
|
|
|
|
dec
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.9 sec do not discard TIMER event
|
2016-03-13 21:51:50 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
2017-01-28 22:05:20 +00:00
|
|
|
|
beq .8
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>SYSCALL UnloadLib
|
2017-01-28 22:05:20 +00:00
|
|
|
|
.8 clc
|
2016-03-13 21:51:50 +00:00
|
|
|
|
rts
|
2019-01-05 20:33:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
Init.Timeout ldy #TimeOut
|
|
|
|
|
lda #TIMEOUT.MAX
|
|
|
|
|
sta (pData),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Wait.TimeOut ldy #TimeOut
|
|
|
|
|
lda (pData),y
|
|
|
|
|
rts
|
2018-12-06 16:39:53 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-05 20:33:08 +00:00
|
|
|
|
.INB USR/SRC/SBIN/IPCONFIG.S.DHCP
|
|
|
|
|
.INB USR/SRC/SBIN/IPCONFIG.S.ETC
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2019-01-15 16:37:32 +00:00
|
|
|
|
LIBTCPIP .AZ "libtcpip"
|
2019-01-14 16:37:56 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-14 16:37:56 +00:00
|
|
|
|
OptionList >PSTR "DEde"
|
|
|
|
|
OptionVars .DA #bDHCP,#bETC,#bDHCP,#bETC
|
2018-12-06 16:39:53 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MSG.USAGE .AS "Usage : IPCONFIG <switches>\r\n"
|
|
|
|
|
.AS " -D : Try to get IP address from DHCP\r\n"
|
|
|
|
|
.AS " -E : Read ETC files\r\n"
|
|
|
|
|
.AZ " -S : Set/Reset TCPIP configuration (-E, then -D if required)\r\n"
|
|
|
|
|
*--------------------------------------
|
2019-01-14 16:37:56 +00:00
|
|
|
|
MSG.NODEV .AZ "TCP/IP not bound to any device."
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MSG1.DEV .AS "NIC Device Configuration :\r\n"
|
2019-01-05 20:33:08 +00:00
|
|
|
|
.AS " Device ID : $%h\r\n"
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.AS " Device Name : %s\r\n"
|
|
|
|
|
.AS " Device Type : %S\r\n"
|
|
|
|
|
.AZ " HW Address : %02h:%02h:%02h:%02h:%02h:%02h\r\n"
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG1.DEV.ARP .AZ " ARP Offload : %d\r\n"
|
2018-08-23 15:16:20 +00:00
|
|
|
|
MSG1.DEV.IP .AS " IP Offload : %d\r\n"
|
|
|
|
|
.AZ " Link Status : "
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG1.LINK.OK .AZ "OK"
|
|
|
|
|
MSG1.LINK.KO .AZ "Media Disconnected"
|
|
|
|
|
MSG1.LINKSPEED .AZ " Link Speed : 1"
|
2018-07-24 16:00:24 +00:00
|
|
|
|
MSG1.DPLX.FD .AZ " Mbit/s,Full Duplex"
|
|
|
|
|
MSG1.DPLX.HD .AZ " Mbit/s,Half Duplex"
|
2016-03-13 21:51:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-08-23 15:16:20 +00:00
|
|
|
|
MSG2 .AZ "IP Configuration : "
|
2018-07-24 16:00:24 +00:00
|
|
|
|
MSG2.C .AZ "Configured"
|
|
|
|
|
MSG2.U .AZ "Not Configured"
|
2018-04-11 15:35:51 +00:00
|
|
|
|
MSG2.DHCPSRVR .AZ " DHCP Server : %d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.IP .AZ " IP/Mask : %d.%d.%d.%d/%d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.GW .AZ " Gateway : %d.%d.%d.%d\r\n"
|
|
|
|
|
MSG2.DNS .AZ " DNS : %d.%d.%d.%d,%d.%d.%d.%d\r\n"
|
2018-07-23 15:28:42 +00:00
|
|
|
|
MSG2.HOSTNAME .AZ " Hostname : %s.%s\r\n"
|
2018-12-06 16:39:53 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-17 15:05:48 +00:00
|
|
|
|
MSG.CFG .AZ "IPCONFIG:Reading %s..."
|
2019-01-14 16:37:56 +00:00
|
|
|
|
MSG.CFG.KO .AZ "Not Found. [%h]\r\n"
|
2018-12-06 16:39:53 +00:00
|
|
|
|
MSG.CFG.OK .AZ "OK."
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
HOSTNAME .AZ "${ROOT}ETC/HOSTNAME"
|
|
|
|
|
TCPIP.CONF .AZ "${ROOT}ETC/TCPIP.CONF"
|
|
|
|
|
HOSTS .AZ "${ROOT}ETC/HOSTS"
|
|
|
|
|
*--------------------------------------
|
2019-01-14 16:37:56 +00:00
|
|
|
|
CFG.DefaultHost .AZ "a2osx-%H"
|
2018-12-06 16:39:53 +00:00
|
|
|
|
CFG.Keywords >PSTR "address"
|
|
|
|
|
>PSTR "netmask"
|
|
|
|
|
>PSTR "gateway"
|
|
|
|
|
>PSTR "nameserver"
|
|
|
|
|
>PSTR "dnsdomain"
|
|
|
|
|
.DA #0
|
2019-01-16 14:37:21 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-15 16:37:32 +00:00
|
|
|
|
CFG.IP.SScanF .AZ "%d.%d.%d.%d"
|
|
|
|
|
CFG.HOST.SScanF .AZ "%d.%d.%d.%d %s %s"
|
2019-01-05 20:33:08 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-17 15:05:48 +00:00
|
|
|
|
MSG.DHCP.CFG1 .AZ "IPCONFIG:Searching for DHCP servers..."
|
|
|
|
|
MSG.DHCP.CFG2 .AZ "IPCONFIG:Reply from DHCP Server at %d.%d.%d.%d, requesting...\r\n"
|
|
|
|
|
MSG.DHCP.KO .AZ "IPCONFIG:Time Out [%h].\r\n"
|
|
|
|
|
MSG.DHCP.OK .AZ "IPCONFIG:Success:[IP=%d.%d.%d.%d/%d.%d.%d.%d]\r\n"
|
|
|
|
|
MSG.DHCP.NA .AZ "IPCONFIG:TCPIP Already configured, exiting."
|
2019-01-05 20:33:08 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-16 14:37:21 +00:00
|
|
|
|
IPCFG .BS S.IPCFG
|
|
|
|
|
CFG.hBuf1 .BS 1
|
|
|
|
|
CFG.hBuf2 .BS 1
|
|
|
|
|
CFG.hBuf3 .BS 1
|
|
|
|
|
CFG.hCfgFile .BS 1
|
|
|
|
|
CFG.IP .BS 4
|
|
|
|
|
*--------------------------------------
|
2019-01-05 20:33:08 +00:00
|
|
|
|
SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
|
|
|
|
|
.BS 1
|
|
|
|
|
.HS 00.00.00.00 S.SOCKADDR.ADDR
|
|
|
|
|
.DA UDP.PORT.DHCPC S.SOCKADDR.PORT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SA.REMOTE .DA #AF.INET S.SOCKADDR.AF
|
2019-07-07 20:48:57 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
.HS 00.00.00.00 S.SOCKADDR.ADDR
|
|
|
|
|
.DA UDP.PORT.DHCPS S.SOCKADDR.PORT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SA.DEST .DA #AF.INET S.SOCKADDR.AF
|
2019-01-05 20:33:08 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
.HS FF.FF.FF.FF S.SOCKADDR.ADDR
|
|
|
|
|
.DA UDP.PORT.DHCPS S.SOCKADDR.PORT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DHCP.DISC .HS 01010600 OP,HTYPE,HLEN,HOPS
|
|
|
|
|
DHCP.DISC.XID .BS 4
|
|
|
|
|
.HS 0000 SECS
|
|
|
|
|
.DA S.DHCP.FLAGS.BRDCST
|
|
|
|
|
.HS 00000000 CIADDR
|
|
|
|
|
DHCP.DISC.YIADDR .HS 00000000
|
|
|
|
|
.HS 00000000 SIADDR
|
|
|
|
|
DHCP.DISC.GIADDR .HS 00000000
|
|
|
|
|
DHCP.DISC.CHADDR .HS 00000000.00000000.00000000.00000000
|
|
|
|
|
.BS 64 SNAME
|
|
|
|
|
.BS 128 FILE
|
|
|
|
|
.HS 63825363 COOKIE
|
|
|
|
|
.HS 3501 OPT
|
|
|
|
|
.DA #S.DHCP.OPTIONS.DHCPDiscover
|
|
|
|
|
.HS 37040103060FFF
|
|
|
|
|
DHCP.DISC.LEN .EQ *-DHCP.DISC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DHCP.REQ .HS 01010600 OP,HTYPE,HLEN,HOPS
|
|
|
|
|
DHCP.REQ.XID .BS 4
|
|
|
|
|
.HS 0000 SECS
|
|
|
|
|
.DA S.DHCP.FLAGS.BRDCST
|
|
|
|
|
.HS 00000000 CIADDR
|
|
|
|
|
DHCP.REQ.YIADDR .HS 00000000
|
|
|
|
|
.HS 00000000 SIADDR
|
2019-01-17 15:05:48 +00:00
|
|
|
|
.HS 00000000 GIADDR
|
2019-01-05 20:33:08 +00:00
|
|
|
|
DHCP.REQ.CHADDR .HS 00000000.00000000.00000000.00000000
|
|
|
|
|
.BS 64 SNAME
|
|
|
|
|
.BS 128 FILE
|
|
|
|
|
.HS 63825363 COOKIE
|
|
|
|
|
.HS 3501 OPT
|
|
|
|
|
.DA #S.DHCP.OPTIONS.DHCPRequest
|
|
|
|
|
.HS 3204
|
|
|
|
|
DHCP.REQ.OPT.REQIP .BS 4
|
|
|
|
|
.HS 3604
|
|
|
|
|
DHCP.REQ.OPT.SVRIP .BS 4
|
|
|
|
|
.HS FF
|
|
|
|
|
DHCP.REQ.LEN .EQ *-DHCP.REQ
|
2017-10-09 05:51:32 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2019-01-14 16:37:56 +00:00
|
|
|
|
ArgIndex .BS 1
|
2018-12-06 16:39:53 +00:00
|
|
|
|
bDHCP .BS 1
|
|
|
|
|
bETC .BS 1
|
2018-07-23 15:28:42 +00:00
|
|
|
|
DIB .BS S.DIB
|
2019-01-15 16:37:32 +00:00
|
|
|
|
IOCTL .BS S.IOCTL
|
2018-07-23 15:28:42 +00:00
|
|
|
|
DCB.NIC .BS S.DCB.NIC
|
2019-01-05 20:33:08 +00:00
|
|
|
|
TimeOut .BS 1
|
|
|
|
|
hSocket .BS 1
|
|
|
|
|
hFrame .BS 1
|
2017-10-09 05:51:32 +00:00
|
|
|
|
DS.END .ED
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:51:50 +00:00
|
|
|
|
MAN
|
2018-12-06 16:39:53 +00:00
|
|
|
|
SAVE USR/SRC/SBIN/IPCONFIG.S
|
2016-03-13 21:51:50 +00:00
|
|
|
|
ASM
|