A2osX/.Docs/LIBTCPIP.md

293 lines
5.0 KiB
Markdown
Raw Normal View History

*** Auto generated by docgen.cmd ***
2017-03-30 09:03:23 +00:00
## Copyright
Copyright 2015 - 2019, Remy Gibert and the A2osX contributors.
2018-06-18 08:44:02 +00:00
# ARP.Clear
Clear ARP Cache
**In:**
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
# ARP.Query
Query ARP Cache and returns HW address
**In:**
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
CS: missed
# ARP.Add
Add a static ARP cache record
**In:**
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
**In:**
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
**In:**
2018-10-11 15:23:06 +00:00
## RETURN VALUE
2018-06-18 08:44:02 +00:00
# DNS.Query
Query DNS for specified host
**In:**
PUSHW = PTR to IP to fill with cached data
* 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
CS: missed
# DNS.Add
Add a static DNS record
**In:**
PUSHW = PTR to IP
PUSHW = hostname CSTR to Add
# DNS.GetCAche
Return a Ptr to DNS Cache Table
**In:**
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
**In:**
2018-10-04 06:13:44 +00:00
`>PUSHB protocol`
`lda type`
`>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
**In:**
`>PUSHW addr`
`lda fd`
`>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
**In:**
`>PUSHW addr`
`lda fd`
`>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
**In:**
`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
2018-06-18 08:44:02 +00:00
**In:**
2018-10-04 06:13:44 +00:00
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.accept`
2018-10-11 15:23:06 +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
**In:**
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
**In:**
`>PUSHWI count`
`>PUSHW buf`
`lda fd`
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
**In:**
`>PUSHWI count`
`>PUSHW buf`
`lda fd`
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
2018-10-10 15:39:22 +00:00
# Recv (RAW,DGRAM,SEQPACKET)
2018-10-04 06:13:44 +00:00
2018-10-10 15:39:22 +00:00
# RecvFrom (RAW,DGRAM,SEQPACKET)
## C
`hMem recv(hFD fd);`
`hMem recvfrom(hFD fd, struct sockaddr *addr);`
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
## ASM
**In:**
`>PUSHW addr` (RecvFrom)
`lda fd`
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
2018-10-10 15:39:22 +00:00
# Send (RAW,DGRAM,SEQPACKET)
2018-10-04 06:13:44 +00:00
2018-10-10 15:39:22 +00:00
# SendTo (RAW,DGRAM,SEQPACKET)
2018-09-17 15:42:38 +00:00
## C
`int skt.send(hFD fd, const void *buf, int count);`
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
**In:**
2018-10-04 06:13:44 +00:00
`>PUSHW addr` (SendTo)
2018-09-17 15:42:38 +00:00
`>PUSHWI count`
`>PUSHW buf`
`lda fd`
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
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.GetSockOpt`
## RETURN VALUE
# SetSockOpt
Set Socket Options
## C
`int setsockopt(hFD fd, short int opts);`
## ASM
**In:**
2019-05-17 14:57:14 +00:00
`>PUSHBI opts`
2018-11-09 13:29:23 +00:00
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.SetSockOpt`
## RETURN VALUE
2019-05-17 14:57:14 +00:00
# EOF
End Of File
## C
`int eof(hFD fd);`
## ASM
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.EOF`
## RETURN VALUE
CC : A = 0 if some data, A = $ff if EOF
CS : A = Socket Error
2018-10-10 15:39:22 +00:00
# GetTable
2018-10-04 06:13:44 +00:00
Get socket table
## C
2018-10-10 15:39:22 +00:00
`void * gettable();`
2018-10-04 06:13:44 +00:00
## ASM
**In:**
2018-11-09 13:29:23 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.GetTable`
2018-10-11 15:23:06 +00:00
## RETURN VALUE
## License
A2osX is licensed under the GNU General Pulic 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 ***