2021-01-12 21:14:13 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF lib/libcifs
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
|
|
|
|
.INB inc/mli.e.i
|
|
|
|
|
.INB inc/eth.i
|
|
|
|
|
.INB inc/libtcpip.i
|
|
|
|
|
.INB inc/net.smb.i
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPLIB
|
|
|
|
|
ZS.START
|
|
|
|
|
hSocket .BS 1
|
|
|
|
|
hReq .BS 1
|
|
|
|
|
ZPReqPtr .BS 2
|
|
|
|
|
ZPReqLen .BS 2
|
|
|
|
|
ZPCtxPtr .BS 2
|
|
|
|
|
|
|
|
|
|
hResp .BS 1
|
|
|
|
|
ZPRespPtr .BS 2
|
|
|
|
|
|
|
|
|
|
ZPPtr1 .BS 2
|
|
|
|
|
ZPPtr2 .BS 2
|
|
|
|
|
|
|
|
|
|
ZS.END .ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA LIB.LOAD
|
|
|
|
|
.DA LIB.UNLOAD
|
|
|
|
|
.DA CIFS.Negotiate
|
|
|
|
|
.DA CIFS.SessionSetup
|
|
|
|
|
.DA CIFS.TreeConnect
|
|
|
|
|
.DA CIFS.Mount
|
|
|
|
|
.DA CIFS.UMount
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CIFS .DA CIFS.ChTyp
|
|
|
|
|
.DA CIFS.ChMod
|
|
|
|
|
.DA CIFS.FStat
|
|
|
|
|
.DA CIFS.Stat
|
|
|
|
|
.DA CIFS.MKDir
|
|
|
|
|
.DA CIFS.MKNod
|
|
|
|
|
.DA CIFS.MKFIFO
|
|
|
|
|
.DA CIFS.Pipe
|
|
|
|
|
.DA CIFS.OpenDir
|
|
|
|
|
.DA CIFS.ReadDir
|
|
|
|
|
.DA CIFS.CloseDir
|
|
|
|
|
.DA CIFS.Open
|
|
|
|
|
.DA CIFS.Close
|
|
|
|
|
.DA CIFS.Read
|
|
|
|
|
.DA CIFS.Write
|
|
|
|
|
.DA CIFS.ChOwn
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
|
|
|
|
L.SMB.TRANSPORT .DA SMB.TRANSPORT
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
LIB.LOAD >LDYA L.LIBTCPIP
|
|
|
|
|
>SYSCALL LoadLib
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
sta hLIBTCPIP
|
2021-01-13 16:57:41 +00:00
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA aLIBTCPIP
|
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
>LDYAI 256
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>STYA ZPReqPtr
|
|
|
|
|
stx hReq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
LIB.UNLOAD lda hReq
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.1 lda hLIBTCPIP
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
>SYSCALL UnloadLib
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* >PUSHB hSocket
|
|
|
|
|
* >PUSHB 0
|
|
|
|
|
* >LIBCALL Negotiate
|
|
|
|
|
* A = hSMBContext
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Negotiate lda (pStack)
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
|
|
|
|
|
>PUSHWI SMB.NegReq.end-SMB.TRANSPORT
|
|
|
|
|
>PUSHW L.SMB.TRANSPORT
|
|
|
|
|
ldy #1+4 hSocket
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
|
2021-01-13 16:57:41 +00:00
|
|
|
|
ldx #LIBTCPIP.Send
|
|
|
|
|
jsr GO.LIBTCPIP
|
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcs .99
|
2021-01-13 16:57:41 +00:00
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
beq .98
|
|
|
|
|
|
|
|
|
|
ldy #1 hSocket
|
|
|
|
|
lda (pStack),y
|
2021-01-13 16:57:41 +00:00
|
|
|
|
|
|
|
|
|
ldx #LIBTCPIP.Recv
|
|
|
|
|
jsr GO.LIBTCPIP
|
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcc .3
|
|
|
|
|
|
|
|
|
|
cmp #E.NODATA
|
|
|
|
|
bne .99
|
|
|
|
|
inc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 jsr GetRespData
|
|
|
|
|
|
|
|
|
|
ldy #S.NETBIOS+S.SMB.H.STATUS
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
bne .97
|
|
|
|
|
|
|
|
|
|
ldy #3
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
tay
|
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>STYA ZPCtxPtr
|
|
|
|
|
|
|
|
|
|
ldy #3
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.4 dey
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
sta (ZPCtxPtr),y
|
|
|
|
|
tya
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
>RET 2
|
|
|
|
|
|
|
|
|
|
.97 lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.98 lda #MLI.E.IO
|
|
|
|
|
|
|
|
|
|
.99 >POP 2
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* >PUSHB hSocket
|
|
|
|
|
* >PUSHB hSMBContext
|
|
|
|
|
* >PUSHW username
|
|
|
|
|
* >PUSHW password
|
|
|
|
|
* >PUSHB 0
|
|
|
|
|
* >LIBCALL SessionSetup
|
|
|
|
|
* (SMBContext updated with UID)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.SessionSetup
|
|
|
|
|
lda (pStack)
|
|
|
|
|
beq .10
|
|
|
|
|
jmp .5
|
|
|
|
|
|
|
|
|
|
.10 dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
|
|
|
|
|
ldy #5 hSMBContext
|
|
|
|
|
jsr GetSMBCtx
|
|
|
|
|
|
|
|
|
|
ldx #S.SMB.H.CMD.SESSION.SETUP.ANDX
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPCtxPtr),y
|
|
|
|
|
cpy #S.NETBIOS+S.SMB.H.CMD
|
|
|
|
|
bne .11
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
.11 sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.NETBIOS+S.SMB.H
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.2 lda SMB.SessionSetup.H,x
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #SMB.SessionSetup.H.Len
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
phy save Y = LEN
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.3 lda SMB.SessionSetup.Guest,x
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #SMB.SessionSetup.Guest.Len
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.4 lda SMB.SessionSetup.T,x
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #SMB.SessionSetup.T.Len
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
jsr GetReqLenYAtA
|
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW ZPReqPtr
|
|
|
|
|
ldy #6+4 hSocket
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
|
2021-01-13 16:57:41 +00:00
|
|
|
|
ldx #LIBTCPIP.Send
|
|
|
|
|
jsr GO.LIBTCPIP
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.5 dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
beq .98
|
|
|
|
|
|
|
|
|
|
ldy #6 hSocket
|
|
|
|
|
lda (pStack),y
|
2021-01-13 16:57:41 +00:00
|
|
|
|
ldx #LIBTCPIP.Recv
|
|
|
|
|
jsr GO.LIBTCPIP
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcc .6
|
|
|
|
|
|
|
|
|
|
cmp #E.NODATA
|
|
|
|
|
bne .99
|
|
|
|
|
inc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.6 jsr GetRespData
|
|
|
|
|
|
|
|
|
|
ldy #S.NETBIOS+S.SMB.H.STATUS
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
bne .97
|
|
|
|
|
|
|
|
|
|
ldy #5 hSMBContext
|
|
|
|
|
jsr GetSMBCtx
|
|
|
|
|
|
|
|
|
|
ldy #S.NETBIOS+S.SMB.H.UID
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
sta (ZPCtxPtr),y
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
sta (ZPCtxPtr),y
|
|
|
|
|
|
|
|
|
|
.8 lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
>RET 7
|
|
|
|
|
|
|
|
|
|
.97 lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.98 lda #MLI.E.IO
|
2021-01-13 16:57:41 +00:00
|
|
|
|
sec
|
2021-01-12 21:14:13 +00:00
|
|
|
|
.99 >POP 7
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* >PUSHB hSocket
|
|
|
|
|
* >PUSHB hSMBContext
|
|
|
|
|
* >PUSHW path
|
|
|
|
|
* >PUSHB 0
|
|
|
|
|
* >LIBCALL TreeConnect
|
|
|
|
|
* (SMBContext updated with TID)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.TreeConnect
|
|
|
|
|
lda (pStack)
|
|
|
|
|
beq .10
|
|
|
|
|
jmp .5
|
|
|
|
|
|
|
|
|
|
.10 dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
|
|
|
|
|
ldy #3 hSMBContext
|
|
|
|
|
jsr GetSMBCtx
|
|
|
|
|
|
|
|
|
|
ldx #S.SMB.H.CMD.TREE.CONNECT.ANDX
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPCtxPtr),y
|
|
|
|
|
cpy #S.NETBIOS+S.SMB.H.CMD
|
|
|
|
|
bne .11
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
.11 sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.NETBIOS+S.SMB.H
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.2 lda SMB.TreeConnect.H,x
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #SMB.TreeConnect.H.Len
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
phy save Y = LEN
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPReqPtr),y PASSWORD = "\0"
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
iny
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.3 lda (ZPPtr1)
|
|
|
|
|
inc ZPPtr1
|
|
|
|
|
bne .31
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.31 sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
tax
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.4 lda SMB.TreeConnect.T,x
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
inx
|
|
|
|
|
cpx #SMB.TreeConnect.T.Len
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
jsr GetReqLenYAtA
|
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW ZPReqPtr
|
|
|
|
|
ldy #4+4 hSocket
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
|
2021-01-13 16:57:41 +00:00
|
|
|
|
ldx #LIBTCPIP.Send
|
|
|
|
|
jsr GO.LIBTCPIP
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.5 dec
|
|
|
|
|
sta (pStack)
|
|
|
|
|
beq .98
|
|
|
|
|
|
|
|
|
|
ldy #4 hSocket
|
|
|
|
|
lda (pStack),y
|
2021-01-13 16:57:41 +00:00
|
|
|
|
ldx #LIBTCPIP.Recv
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcc .6
|
|
|
|
|
|
|
|
|
|
cmp #E.NODATA
|
|
|
|
|
bne .99
|
|
|
|
|
inc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.6 jsr GetRespData
|
|
|
|
|
|
|
|
|
|
ldy #S.NETBIOS+S.SMB.H.STATUS
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
bne .97
|
|
|
|
|
|
|
|
|
|
ldy #3 hSMBContext
|
|
|
|
|
jsr GetSMBCtx
|
|
|
|
|
|
|
|
|
|
ldy #S.NETBIOS+S.SMB.H.TID
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
sta (ZPCtxPtr),y
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPRespPtr),y
|
|
|
|
|
sta (ZPCtxPtr),y
|
|
|
|
|
|
|
|
|
|
.8 lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
>RET 5
|
|
|
|
|
|
|
|
|
|
.97 lda hResp
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.98 lda #MLI.E.IO
|
2021-01-13 16:57:41 +00:00
|
|
|
|
sec
|
2021-01-12 21:14:13 +00:00
|
|
|
|
.99 >POP 5
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Mount
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.UMount clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.CALLBACK jmp (J.CIFS,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.ChTyp
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.ChMod
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.FStat
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Stat >PULLW ZPPtr2 S.STAT
|
|
|
|
|
>PULLW ZPPtr1 PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.99 lda #MLI.E.INVPATH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.MKDir
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.MKNod
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.MKFIFO
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Pipe lda #MLI.E.BADCALL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.OpenDir lda #MLI.E.BADCALL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.ReadDir lda #MLI.E.INVPATH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.CloseDir
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Open
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Close
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Read
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.Write
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CIFS.ChOwn
|
|
|
|
|
lda #MLI.E.BADCALL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetSMBCtx lda (pStack),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPCtxPtr
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Y = LEN from S.NETBIOS.TYPE
|
|
|
|
|
* A = Ptr to LEN Word
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetReqLenYAtA sty ZPReqLen
|
|
|
|
|
stz ZPReqLen+1
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
dec
|
|
|
|
|
dec
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
|
|
|
|
|
lda ZPReqLen
|
|
|
|
|
sec
|
|
|
|
|
sbc #S.NETBIOS
|
|
|
|
|
ldy #S.NETBIOS.LEN+2
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
lda ZPReqLen+1
|
|
|
|
|
sec
|
|
|
|
|
sbc /S.NETBIOS
|
|
|
|
|
dey
|
|
|
|
|
sta (ZPReqPtr),y
|
|
|
|
|
|
|
|
|
|
lda ZPReqLen
|
|
|
|
|
clc
|
|
|
|
|
adc #S.TCP
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda ZPReqLen+1
|
|
|
|
|
adc /S.TCP
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetRespData sta hResp
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
tya
|
|
|
|
|
* clc
|
|
|
|
|
adc #S.TCP
|
|
|
|
|
sta ZPRespPtr
|
|
|
|
|
pla
|
|
|
|
|
adc /S.TCP
|
|
|
|
|
sta ZPRespPtr+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-01-13 16:57:41 +00:00
|
|
|
|
GO.LIBTCPIP jmp (aLIBTCPIP)
|
|
|
|
|
*--------------------------------------
|
2021-01-12 21:14:13 +00:00
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
LIBTCPIP .AZ "libtcpip"
|
|
|
|
|
hLIBTCPIP .BS 1
|
2021-01-13 16:57:41 +00:00
|
|
|
|
aLIBTCPIP .BS 2
|
2021-01-12 21:14:13 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.TRANSPORT .DA #0 DIRECT TCP TRANSPORT
|
|
|
|
|
.DA #0 24 BITS LENGTH
|
|
|
|
|
.DA /SMB.NegReq.end-SMB.H
|
|
|
|
|
.DA #SMB.NegReq.end-SMB.H
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.H .DA #$FF
|
|
|
|
|
.AS "SMB"
|
|
|
|
|
.DA #S.SMB.H.CMD.NEGOTIATE
|
|
|
|
|
.HS 00000000
|
|
|
|
|
.DA #0 S.SMB.H.FLAGS
|
|
|
|
|
.DA S.SMB.H.FLAGS2.LONGNAMES
|
|
|
|
|
.DA 0 PIDHI
|
|
|
|
|
.HS 0000000000000000 SECFEAT
|
|
|
|
|
.DA 0 RSVD
|
|
|
|
|
.DA $FFFF TID
|
|
|
|
|
.DA $FFFE PIDLO
|
|
|
|
|
.BS 2 UID
|
|
|
|
|
.DA 0 MID
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.NegReq .DA #0 WORD COUNT
|
|
|
|
|
|
|
|
|
|
.DA #SMB.NegReq.end-2-* ByteCount
|
|
|
|
|
.DA #0
|
|
|
|
|
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "PC NETWORK PROGRAM 1.0"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "LANMAN1.0"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "Windows for Workgroups 3.1a"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "LM1.2X002"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "LANMAN2.1"
|
|
|
|
|
.DA #2
|
|
|
|
|
.AZ "NT LM 0.12"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "SMB 2.002"
|
|
|
|
|
* .DA #2
|
|
|
|
|
* .AZ "SMB 2.???"
|
|
|
|
|
SMB.NegReq.end .EQ *
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.SessionSetup.H
|
|
|
|
|
.DA #13 WORD COUNT
|
|
|
|
|
.HS FF000000 NO MORE CMD
|
|
|
|
|
.DA 1280 MAX BUFFER
|
|
|
|
|
.DA 2 MAX MPX COUNT
|
|
|
|
|
.HS 0000 VC NUMBER
|
|
|
|
|
.HS 00000000 SESSION KEY
|
|
|
|
|
.DA 0 CI PASS LEN
|
|
|
|
|
.DA 0 CS PASS LEN
|
|
|
|
|
.HS 00000000
|
|
|
|
|
.HS 00000000 CAPABILITIES
|
|
|
|
|
SMB.SessionSetup.H.Len .EQ *-SMB.SessionSetup.H
|
|
|
|
|
* .BS 2 ByteCount
|
|
|
|
|
SMB.SessionSetup.Guest
|
|
|
|
|
.AZ "" Password
|
|
|
|
|
.AZ "Guest" Account Name
|
|
|
|
|
.AZ "?" Primary Domain
|
|
|
|
|
SMB.SessionSetup.Guest.Len .EQ *-SMB.SessionSetup.Guest
|
|
|
|
|
SMB.SessionSetup.T
|
|
|
|
|
.AZ "A2osX" Native OS
|
|
|
|
|
.AZ "A2osX-CIFSD" Native LANMAN
|
|
|
|
|
SMB.SessionSetup.T.Len .EQ *-SMB.SessionSetup.T
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.TreeConnect.H
|
|
|
|
|
.DA #4 WORD COUNT
|
|
|
|
|
.HS FF000000 NO MORE CMD
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 1 PASSWORD LEN (1 for "\0")
|
|
|
|
|
SMB.TreeConnect.H.Len .EQ *-SMB.TreeConnect.H
|
|
|
|
|
* .BS 2 ByteCount
|
|
|
|
|
* .AZ "" PASSWORD
|
|
|
|
|
* .AZ "_temp" PATH
|
|
|
|
|
SMB.TreeConnect.T
|
|
|
|
|
.AZ "A:" Disk Share
|
|
|
|
|
SMB.TreeConnect.T.Len .EQ *-SMB.TreeConnect.T
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.TRANS2.H .DA #15 WORD COUNT
|
|
|
|
|
.BS 2 TotalParamCount
|
|
|
|
|
.DA 0 TotalDataCount
|
|
|
|
|
.DA 10 MaxParameterCount
|
|
|
|
|
.DA 460 MaxDataCount
|
|
|
|
|
.DA #1 MaxSetupCount
|
|
|
|
|
.HS 00 Reserved1
|
|
|
|
|
.DA 0 Flags
|
|
|
|
|
.HS 00000000 Timeout
|
|
|
|
|
.HS 0000 Reserved2
|
|
|
|
|
.BS 2 ParameterCount
|
|
|
|
|
.DA 66 ParameterOffset
|
|
|
|
|
.HS 0000 DataCount
|
|
|
|
|
.HS 0000 DataOffset
|
|
|
|
|
.DA #1 SetupCount
|
|
|
|
|
.HS 00 Reserved3
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.QueryPathInfo
|
|
|
|
|
.DA 5 TRANS2_QUERY_PATH_INFORMATION
|
|
|
|
|
|
|
|
|
|
.DA SMB.QueryPathInfo.PrmCnt+1 INCLUDING Padding byte below
|
|
|
|
|
.HS 00 Padding
|
|
|
|
|
|
|
|
|
|
SMB.QueryPathInfo.Prm
|
|
|
|
|
.DA $0001 InformationLevel
|
|
|
|
|
.HS 00000000 SearchStorageType
|
|
|
|
|
SMB.QueryPathInfo.PrmCnt .EQ *-SMB.QueryPathInfo.Prm
|
|
|
|
|
.AZ "server.met" FileName
|
|
|
|
|
SMB.QueryPathInfo.end
|
|
|
|
|
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SMB.FindFirst .DA 1 TRANS2_FIND_FIRST2
|
|
|
|
|
|
|
|
|
|
.DA SMB.FindFirst.PrmCnt+1 INCLUDING Padding byte below
|
|
|
|
|
.HS 00 Padding
|
|
|
|
|
|
|
|
|
|
SMB.FindFirst.Prm
|
|
|
|
|
.DA $0016 SearchAttributes
|
|
|
|
|
.DA 1024 SearchCount
|
|
|
|
|
.DA 3 Flags
|
|
|
|
|
.DA $0001 InformationLevel
|
|
|
|
|
.HS 00000000 SearchStorageType
|
|
|
|
|
SMB.FindFirst.PrmCnt .EQ *-SMB.FindFirst.Prm
|
|
|
|
|
.AZ "\*.*" FileName
|
|
|
|
|
SMB.FindFirst.end
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libcifs.s
|
|
|
|
|
ASM
|