2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.LIST OFF
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.TF BIN/DNSINFO
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2018-07-25 15:26:14 +00:00
|
|
|
|
.INB INC/ETH.I
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/LIBTCPIP.I
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
2018-12-06 11:40:30 +00:00
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-09-13 20:35:07 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-09-13 20:35:07 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.DA #0 S.PS.F.EVENT
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA CS.END-CS.START Code Size (without Constants)
|
|
|
|
|
.DA DS.END-DS.START Data SegmentSize
|
|
|
|
|
.DA #32 Stack Size
|
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2015-09-13 20:35:07 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.EVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
2018-11-21 13:08:11 +00:00
|
|
|
|
L.MSG.IPKO .DA MSG.IPKO
|
2015-03-14 21:47:37 +00:00
|
|
|
|
L.SSCANF.IP .DA SSCANF.IP
|
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG1 .DA MSG1
|
2018-12-06 11:40:30 +00:00
|
|
|
|
L.MSG1.Status .DA MSG1.S
|
|
|
|
|
.DA MSG1.P
|
|
|
|
|
.DA MSG1.D
|
2018-11-01 08:53:47 +00:00
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-10-18 06:26:24 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBTCPIP
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>SYSCALL LoadLib
|
2018-11-12 09:22:06 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sta hLIBTCPIP
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2018-11-12 09:22:06 +00:00
|
|
|
|
.9 rts
|
2016-10-08 20:53:45 +00:00
|
|
|
|
*--------------------------------------
|
2019-01-16 21:51:57 +00:00
|
|
|
|
CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG is TCPIP loaded ?
|
2018-11-21 13:08:11 +00:00
|
|
|
|
>STYA ZPPTR1
|
|
|
|
|
|
|
|
|
|
lda (ZPPTR1) Configured ?
|
|
|
|
|
bmi CS.RUN.IPOK
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.IPKO
|
|
|
|
|
>SYSCALL puts
|
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
CS.RUN.IPOK ldy #S.PS.ARGC
|
2017-12-22 21:24:30 +00:00
|
|
|
|
lda (pPs),y
|
2018-11-01 08:53:47 +00:00
|
|
|
|
bne .1
|
2018-05-23 15:27:37 +00:00
|
|
|
|
jmp CS.RUN.DUMP
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2018-11-27 14:03:26 +00:00
|
|
|
|
.1 cmp #2
|
2018-11-01 08:53:47 +00:00
|
|
|
|
beq CS.RUN.ADD
|
|
|
|
|
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.USAGE
|
|
|
|
|
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
|
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.ADD >PUSHEA.G DST.IP+3
|
2018-05-23 15:27:37 +00:00
|
|
|
|
>PUSHEA.G DST.IP+2
|
|
|
|
|
>PUSHEA.G DST.IP+1
|
|
|
|
|
>PUSHEA.G DST.IP
|
2018-08-08 15:13:37 +00:00
|
|
|
|
>PUSHBI 8 4 PTRs
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHW L.SSCANF.IP
|
2018-11-15 15:04:14 +00:00
|
|
|
|
lda #2
|
2018-10-16 15:48:03 +00:00
|
|
|
|
>SYSCALL ArgV
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>SYSCALL sscanf
|
2015-03-14 21:47:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-05-23 15:27:37 +00:00
|
|
|
|
>PUSHEA.G DST.IP
|
2018-11-15 15:04:14 +00:00
|
|
|
|
lda #1
|
2018-10-16 15:48:03 +00:00
|
|
|
|
>SYSCALL ArgV
|
2015-09-13 20:35:07 +00:00
|
|
|
|
>PUSHYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.DNS.ADD
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #0 tell TSKMGR that all done ok, but
|
|
|
|
|
sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
|
2018-10-21 20:54:07 +00:00
|
|
|
|
.9 lda #E.SYN
|
2015-03-14 21:47:37 +00:00
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2018-05-24 15:21:38 +00:00
|
|
|
|
*--------------------------------------
|
2017-12-22 21:24:30 +00:00
|
|
|
|
CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GetCache
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>STYA ZPPTR1
|
2016-10-18 06:26:24 +00:00
|
|
|
|
>LDYA L.MSG0
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>SYSCALL puts
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
lda #K.DNSCACHE.SIZE
|
2018-05-23 15:27:37 +00:00
|
|
|
|
>STA.G EntryCount
|
2018-12-06 11:40:30 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
.1 lda (ZPPTR1)
|
2018-12-06 11:40:30 +00:00
|
|
|
|
beq .6
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-10-19 20:35:00 +00:00
|
|
|
|
ldy #S.DNSCACHE.TTL+4
|
2018-08-23 15:16:20 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.2 dey
|
2015-09-13 20:35:07 +00:00
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
>PUSHA
|
2015-10-19 20:35:00 +00:00
|
|
|
|
cpy #S.DNSCACHE.TTL
|
2018-12-06 11:40:30 +00:00
|
|
|
|
bne .2
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-03-17 07:31:11 +00:00
|
|
|
|
ldy #S.DNSCACHE.IP+4
|
2018-08-23 15:16:20 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.3 dey
|
2016-03-17 07:31:11 +00:00
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
cpy #S.DNSCACHE.IP
|
2018-12-06 11:40:30 +00:00
|
|
|
|
bne .3
|
2016-03-17 07:31:11 +00:00
|
|
|
|
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ldy #S.DNSCACHE.hNAME
|
|
|
|
|
lda (ZPPTR1),y
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL GetMemPtr
|
2016-03-17 07:31:11 +00:00
|
|
|
|
>PUSHYA
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-03-27 21:03:40 +00:00
|
|
|
|
ldy #S.DNSCACHE.ID
|
|
|
|
|
>PUSHB (ZPPTR1),y
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ZPPTR1),y
|
2018-12-06 11:40:30 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
lda (ZPPTR1) Entry Status
|
|
|
|
|
bmi .5
|
2016-03-27 21:03:40 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
asl
|
|
|
|
|
tax
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.5 >PUSHW L.MSG1.Status,x
|
|
|
|
|
>PUSHBI 14
|
2016-10-18 06:26:24 +00:00
|
|
|
|
>LDYA L.MSG1
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.6 lda ZPPTR1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.DNSCACHE
|
|
|
|
|
sta ZPPTR1
|
2018-12-06 11:40:30 +00:00
|
|
|
|
bcc .7
|
2015-03-14 21:47:37 +00:00
|
|
|
|
inc ZPPTR1+1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2018-12-06 11:40:30 +00:00
|
|
|
|
.7 >DEC.G EntryCount
|
|
|
|
|
|
|
|
|
|
bne .8
|
|
|
|
|
sec
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
2018-12-06 11:40:30 +00:00
|
|
|
|
|
|
|
|
|
.8 jmp .1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-29 21:47:19 +00:00
|
|
|
|
CS.EVENT sec
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
CS.QUIT lda hLIBTCPIP
|
2018-11-12 09:22:06 +00:00
|
|
|
|
beq .8
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>SYSCALL UnloadLib
|
2018-11-12 09:22:06 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2018-10-11 06:09:35 +00:00
|
|
|
|
LIBTCPIP .AZ "libtcpip"
|
2018-11-01 08:53:47 +00:00
|
|
|
|
hLIBTCPIP .BS 1
|
2018-11-21 13:08:11 +00:00
|
|
|
|
MSG.IPKO .AZ "TCP/IP Not Loaded/Configured."
|
2018-04-11 15:35:51 +00:00
|
|
|
|
SSCANF.IP .AZ "%d.%d.%d.%d"
|
2018-12-06 11:40:30 +00:00
|
|
|
|
MSG0 .AZ "Status TR.ID Hostname IP Address TTL"
|
|
|
|
|
MSG1 .AZ "%7s $%H %32s %03d.%03d.%03d.%03d %u\r\n"
|
|
|
|
|
MSG1.S .AZ "Static"
|
|
|
|
|
MSG1.P .AZ "Pending"
|
|
|
|
|
MSG1.D .AZ "Dynamic"
|
2018-11-01 08:53:47 +00:00
|
|
|
|
MSG.USAGE .AS "Usage : Add a static entry, DNSINFO <host> <IP>\r\n"
|
2018-11-15 15:04:14 +00:00
|
|
|
|
.AZ " Dump DNS Cache, DNSINFO\r\n"
|
2018-05-23 15:27:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DS.START
|
|
|
|
|
DST.IP .BS 4
|
2016-03-17 07:31:11 +00:00
|
|
|
|
EntryCount .BS 1
|
2018-05-23 15:27:37 +00:00
|
|
|
|
DS.END
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
MAN
|
2018-11-21 13:08:11 +00:00
|
|
|
|
SAVE USR/SRC/BIN/DNSINFO.S
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|