A2osX/.Docs/LIBTCPIP.md

298 lines
5.0 KiB
Markdown
Raw Normal View History

*** Auto generated by docgen.cmd ***
2017-03-30 09:03:23 +00:00
## Copyright
2020-01-15 09:51:24 +00:00
Copyright 2015 - 2020, Remy Gibert and the A2osX contributors.
2018-06-18 08:44:02 +00:00
# ARP.Clear
Clear ARP Cache
2023-10-18 05:41:12 +00:00
## ASM
2018-10-11 15:23:06 +00:00
2021-05-19 12:44:47 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
# ARP.Query
Query ARP Cache and returns HW address
2023-10-18 05:41:12 +00:00
## ASM
2018-06-18 08:44:02 +00:00
PUSHW PTR to MAC (to fill)
PUSHW PTR to IP
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
CC: hit: MAC filled
2021-05-19 12:44:47 +00:00
CS: missed
2018-06-18 08:44:02 +00:00
# ARP.Add
Add a static ARP cache record
2023-10-18 05:41:12 +00:00
## ASM
2018-06-18 08:44:02 +00:00
PUSHW PTR to MAC
PUSHW PTR to IP
2018-10-04 06:13:44 +00:00
# ARP.GetCache
2018-06-18 08:44:02 +00:00
Return a Ptr to ARP Cache Table
2023-10-18 05:41:12 +00:00
## ASM
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
Y,A = PTR to ARP.CACHE
# DNS.Clear
Clear DNS Cache
2023-10-18 05:41:12 +00:00
## ASM
2018-10-11 15:23:06 +00:00
2021-05-19 12:44:47 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
# DNS.Query
Query DNS for specified host
2023-10-18 05:41:12 +00:00
## ASM
2018-06-18 08:44:02 +00:00
PUSHW = PTR to IP to fill with cached data
2021-05-19 12:44:47 +00:00
* PUSHW = hostname PTR to PSTR
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
CC: hit: IP filled with address
2021-05-19 12:44:47 +00:00
CS: missed
2018-06-18 08:44:02 +00:00
# DNS.Add
Add a static DNS record
2023-10-18 05:41:12 +00:00
## ASM
2018-06-18 08:44:02 +00:00
PUSHW = PTR to IP
PUSHW = hostname CSTR to Add
# DNS.GetCAche
Return a Ptr to DNS Cache Table
2023-10-18 05:41:12 +00:00
## ASM
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
Y,A = PTR to DNS.CACHE
2018-10-10 15:39:22 +00:00
# Socket
2018-09-17 15:42:38 +00:00
Create a new socket
## C
2018-10-04 06:13:44 +00:00
`hFD socket(short int type, short int protocol);`
2018-09-17 15:42:38 +00:00
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB type`
2018-10-04 06:13:44 +00:00
`>PUSHB protocol`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-09-17 15:42:38 +00:00
CC: A = hSOCKET
CS: A = EC
2018-06-18 08:44:02 +00:00
2018-10-10 15:39:22 +00:00
# Bind
2018-10-04 06:13:44 +00:00
bind a name to a socket
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
## C
`int bind(hFD fd, const struct sockaddr *addr);`
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
2018-10-04 06:13:44 +00:00
`>PUSHW addr`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-10-04 06:13:44 +00:00
CC: A = hSOCKET
CS: A = EC
2018-10-10 15:39:22 +00:00
# Connect
2018-11-06 16:31:13 +00:00
Initiate a connection on a socket
2018-10-04 06:13:44 +00:00
## C
`int connect(hFD fd, const struct sockaddr *addr);`
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
2018-10-04 06:13:44 +00:00
`>PUSHW addr`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-10-04 06:13:44 +00:00
CC: A = hSOCKET
CS: A = EC
2018-10-10 15:39:22 +00:00
# Listen
2018-10-04 06:13:44 +00:00
Listen for connections on a socket
## C
`int listen(hFD fd);`
## ASM
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.listen`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-10-04 06:13:44 +00:00
CS: A = EC
2018-06-18 08:44:02 +00:00
2018-10-10 15:39:22 +00:00
# Accept
2018-10-04 06:13:44 +00:00
Accept a connection on a socket
## C
`hFD Accept(hFD fd);`
## ASM
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.accept`
2018-10-11 15:23:06 +00:00
2020-09-22 05:56:28 +00:00
## RETURN VALUE
2018-10-04 06:13:44 +00:00
A = hSocket
2018-06-18 08:44:02 +00:00
2018-10-10 15:39:22 +00:00
# Shutdown
2018-10-04 06:13:44 +00:00
Close socket
2018-09-17 15:42:38 +00:00
## C
2018-10-10 15:39:22 +00:00
`int shutdown(int fd);`
2018-09-17 15:42:38 +00:00
## ASM
2018-10-04 06:13:44 +00:00
`lda fd`
2018-10-10 15:39:22 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.shutdown`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
2018-10-10 15:39:22 +00:00
# Read (STREAM)
2018-09-11 21:15:15 +00:00
## C
`int skt.read(hFD fd, void *buf, int count);`
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
2018-09-11 21:15:15 +00:00
`>PUSHW buf`
2021-05-19 12:44:47 +00:00
`>PUSHW count`
2019-03-12 14:41:55 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.read`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-09-11 21:15:15 +00:00
CC: Y,A = bytes read
CS: A = EC
2018-09-05 11:31:49 +00:00
2018-10-10 15:39:22 +00:00
# Write (STREAM)
2018-09-11 21:15:15 +00:00
## C
`int skt.write(hFD fd, const void *buf, int count);`
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
2018-09-11 21:15:15 +00:00
`>PUSHW buf`
2021-05-19 12:44:47 +00:00
`>PUSHW count`
2019-03-12 14:41:55 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.write`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-09-11 21:15:15 +00:00
CC: Y,A = bytes written
CS: A = EC
2018-06-18 08:44:02 +00:00
2023-05-16 16:53:52 +00:00
# RecvFrom (RAW,DGRAM)
2018-10-10 15:39:22 +00:00
## C
`hMem recvfrom(hFD fd, struct sockaddr *addr);`
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
2018-10-04 06:13:44 +00:00
`>PUSHW addr` (RecvFrom)
2019-03-12 14:41:55 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.Recv`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-10-04 06:13:44 +00:00
CC: A = hMem
CS: A = EC
2021-05-19 12:44:47 +00:00
# Recv (RAW,DGRAM,SEQPKT)
## C
`hMem recv(hFD fd);`
## ASM
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.Recv`
## RETURN VALUE
CC: A = hMem
CS: A = EC
2018-10-04 06:13:44 +00:00
2020-06-07 08:06:51 +00:00
# SendTo (RAW,DGRAM,SEQPKT)
2018-09-17 15:42:38 +00:00
## C
2018-10-04 06:13:44 +00:00
`int skt.sendto(hFD fd, const void *buf, int count, const struct sockaddr *addr);`
2018-09-17 15:42:38 +00:00
## ASM
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
`>PUSHW buf`
2018-09-17 15:42:38 +00:00
`>PUSHWI count`
2021-05-19 12:44:47 +00:00
`>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`
2018-09-17 15:42:38 +00:00
`>PUSHW buf`
2021-05-19 12:44:47 +00:00
`>PUSHWI count`
2019-03-12 14:41:55 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.send`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-09-17 15:42:38 +00:00
CC: Y,A = bytes written
CS: A = EC
2018-10-04 06:13:44 +00:00
2018-11-09 13:29:23 +00:00
# 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
2021-05-19 12:44:47 +00:00
`>PUSHB fd`
`>PUSHB opts`
2018-11-09 13:29:23 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.SetSockOpt`
## RETURN VALUE
2019-05-17 14:57:14 +00:00
# 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
2019-12-16 21:36:35 +00:00
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](../LICENSE)**.
*** End of Auto generated file ***