mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
UDP.IN jsr IP.FillSKT.TemplateSrcDstIPP
|
||
|
||
lda hSocketTable
|
||
>SYSCALL GetMemPtr
|
||
>STYA ZPPtrSKT
|
||
|
||
ldx #0
|
||
|
||
.3 lda (ZPPtrSKT)
|
||
beq .7
|
||
cmp #S.SOCKET.SOCK.DGRAM
|
||
bne .7
|
||
|
||
ldy #S.SOCKET.SRC.ADDR
|
||
lda (ZPPtrSKT),y SOCKET.SRC.ADDR=0.0.0.0 ?
|
||
bne .41
|
||
ldy #S.SOCKET.SRC.PORT yes, do not check if IP match
|
||
|
||
.4 lda (ZPPtrSKT),y
|
||
.41 cmp SKT.Template,y
|
||
bne .7
|
||
iny
|
||
cpy #S.SOCKET.DST.ADDR
|
||
bne .4
|
||
|
||
lda (ZPPtrSKT),y SOCKET.DST.ADDR=FF.FF.FF.FF ?
|
||
cmp #$FF
|
||
bne .51
|
||
ldy #S.SOCKET.DST.PORT yes, do not check if IP match
|
||
|
||
.5 lda (ZPPtrSKT),y
|
||
.51 cmp SKT.Template,y
|
||
bne .7
|
||
iny
|
||
cpy #S.SOCKET.DST.PORT+2
|
||
bne .5
|
||
|
||
lda hFrameIn
|
||
jsr SKT.AddToQueueA
|
||
bcs .9 Q full, discard...
|
||
|
||
rts DO NOT Discard this queued frame
|
||
|
||
.7 lda ZPPtrSKT
|
||
clc
|
||
adc #S.SOCKET
|
||
sta ZPPtrSKT
|
||
bcc .8
|
||
inc ZPPtrSKT+1
|
||
|
||
.8 inx
|
||
cpx #K.SKTTABLE.SIZE
|
||
bne .3
|
||
|
||
.9 lda hFrameIn
|
||
>SYSCALL FreeMem
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/LIB/LIBTCPIP.S.UDP
|
||
LOAD /A2OSX.SRC/LIB/LIBTCPIP.S
|
||
ASM
|