A2osX/.Docs/LIBTCPIP.md
2023-10-18 07:41:12 +02:00

5.0 KiB

*** Auto generated by docgen.cmd ***

Copyright 2015 - 2020, Remy Gibert and the A2osX contributors.

ARP.Clear

Clear ARP Cache

ASM

RETURN VALUE

ARP.Query

Query ARP Cache and returns HW address

ASM

PUSHW PTR to MAC (to fill)
PUSHW PTR to IP

RETURN VALUE

CC: hit: MAC filled
CS: missed

ARP.Add

Add a static ARP cache record

ASM

PUSHW PTR to MAC
PUSHW PTR to IP

ARP.GetCache

Return a Ptr to ARP Cache Table

ASM

RETURN VALUE

Y,A = PTR to ARP.CACHE

DNS.Clear

Clear DNS Cache

ASM

RETURN VALUE

DNS.Query

Query DNS for specified host

ASM

PUSHW = PTR to IP to fill with cached data

  • PUSHW = hostname PTR to PSTR

RETURN VALUE

CC: hit: IP filled with address
CS: missed

DNS.Add

Add a static DNS record

ASM

PUSHW = PTR to IP
PUSHW = hostname CSTR to Add

DNS.GetCAche

Return a Ptr to DNS Cache Table

ASM

RETURN VALUE

Y,A = PTR to DNS.CACHE

Socket

Create a new socket

C

hFD socket(short int type, short int protocol);

ASM

>PUSHB type
>PUSHB protocol
>LIBCALL hLIBTCPIP,LIBTCPIP.socket

RETURN VALUE

CC: A = hSOCKET
CS: A = EC

Bind

bind a name to a socket

C

int bind(hFD fd, const struct sockaddr *addr);

ASM

>PUSHB fd
>PUSHW addr
>LIBCALL hLIBTCPIP,LIBTCPIP.socket

RETURN VALUE

CC: A = hSOCKET
CS: A = EC

Connect

Initiate a connection on a socket

C

int connect(hFD fd, const struct sockaddr *addr);

ASM

>PUSHB fd
>PUSHW addr
>LIBCALL hLIBTCPIP,LIBTCPIP.socket

RETURN VALUE

CC: A = hSOCKET
CS: A = EC

Listen

Listen for connections on a socket

C

int listen(hFD fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.listen

RETURN VALUE

CS: A = EC

Accept

Accept a connection on a socket

C

hFD Accept(hFD fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.accept

RETURN VALUE

A = hSocket

Shutdown

Close socket

C

int shutdown(int fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.shutdown

RETURN VALUE

Read (STREAM)

C

int skt.read(hFD fd, void *buf, int count);

ASM

>PUSHB fd
>PUSHW buf
>PUSHW count
>LIBCALL hLIBTCPIP,LIBTCPIP.read

RETURN VALUE

CC: Y,A = bytes read
CS: A = EC

Write (STREAM)

C

int skt.write(hFD fd, const void *buf, int count);

ASM

>PUSHB fd
>PUSHW buf
>PUSHW count
>LIBCALL hLIBTCPIP,LIBTCPIP.write

RETURN VALUE

CC: Y,A = bytes written
CS: A = EC

RecvFrom (RAW,DGRAM)

C

hMem recvfrom(hFD fd, struct sockaddr *addr);

ASM

>PUSHB fd
>PUSHW addr (RecvFrom)
>LIBCALL hLIBTCPIP,LIBTCPIP.Recv

RETURN VALUE

CC: A = hMem
CS: A = EC

Recv (RAW,DGRAM,SEQPKT)

C

hMem recv(hFD fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.Recv

RETURN VALUE

CC: A = hMem
CS: A = EC

SendTo (RAW,DGRAM,SEQPKT)

C

int skt.sendto(hFD fd, const void *buf, int count, const struct sockaddr *addr);

ASM

>PUSHB fd
>PUSHW buf
>PUSHWI count
>PUSHW addr
>LIBCALL hLIBTCPIP,LIBTCPIP.sendto

RETURN VALUE

CC: Y,A = bytes written
CS: A = EC

Send (RAW,DGRAM,SEQPKT)

C

int skt.send(hFD fd, const void *buf, int count);

ASM

>PUSHB fd
>PUSHW buf
>PUSHWI count
>LIBCALL hLIBTCPIP,LIBTCPIP.send

RETURN VALUE

CC: Y,A = bytes written
CS: A = EC

GetSockOpt

Set Socket Options

C

int getsockopt(hFD fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.GetSockOpt

RETURN VALUE

SetSockOpt

Set Socket Options

C

int setsockopt(hFD fd, short int opts);

ASM

>PUSHB fd
>PUSHB opts
>LIBCALL hLIBTCPIP,LIBTCPIP.SetSockOpt

RETURN VALUE

EOF

End Of File

C

int eof(hFD fd);

ASM

lda fd
>LIBCALL hLIBTCPIP,LIBTCPIP.EOF

RETURN VALUE

CC : A = 0 if some data, A = $ff if EOF
CS : A = Socket Error

License

A2osX is licensed under the GNU General Public License.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

The full A2osX license can be found Here.

*** End of Auto generated file ***