A2osX/.Docs/LIBTCPIP.md

212 lines
3.6 KiB
Markdown
Raw Normal View History

*** Auto generated by docgen.cmd ***
2017-03-30 09:03:23 +00:00
2018-06-18 08:44:02 +00:00
# ARP.Clear
Clear ARP Cache
**In:**
**Out:**
# ARP.Query
Query ARP Cache and returns HW address
**In:**
PUSHW PTR to MAC (to fill)
PUSHW PTR to IP
**Out:**
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:**
**Out:**
Y,A = PTR to ARP.CACHE
# DNS.Clear
Clear DNS Cache
**In:**
**Out:**
# DNS.Query
Query DNS for specified host
**In:**
PUSHW = PTR to IP to fill with cached data
* PUSHW = hostname PTR to PSTR
**Out:**
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:**
**Out:**
Y,A = PTR to DNS.CACHE
2018-10-04 06:13:44 +00:00
# SKT.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-09-17 15:42:38 +00:00
**Out:**
CC: A = hSOCKET
CS: A = EC
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
# SKT.bind
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`
**Out:**
CC: A = hSOCKET
CS: A = EC
# SKT.connect
Iinitiate a connection on a socket
## C
`int connect(hFD fd, const struct sockaddr *addr);`
## ASM
**In:**
`>PUSHW addr`
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.socket`
**Out:**
CC: A = hSOCKET
CS: A = EC
# SKT.listen
Listen for connections on a socket
## C
`int listen(hFD fd);`
## ASM
**In:**
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.listen`
**Out:**
CS: A = EC
2018-06-18 08:44:02 +00:00
2018-07-24 06:24:23 +00:00
# SKT.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-06-18 08:44:02 +00:00
**Out:**
2018-10-04 06:13:44 +00:00
A = hSocket
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
# SKT.Close
Close socket
2018-09-17 15:42:38 +00:00
## C
2018-10-04 06:13:44 +00:00
`int close(int fd);`
2018-09-17 15:42:38 +00:00
## ASM
**In:**
2018-10-04 06:13:44 +00:00
`lda fd`
`>LIBCALL hLIBTCPIP,LIBTCPIP.close`
2018-09-17 15:42:38 +00:00
**Out:**
2018-06-18 08:44:02 +00:00
2018-09-05 11:31:49 +00:00
# SKT.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`
2018-09-17 15:42:38 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.read`
2018-09-05 11:31:49 +00:00
**Out:**
2018-09-11 21:15:15 +00:00
CC: Y,A = bytes read
CS: A = EC
2018-09-05 11:31:49 +00:00
# SKT.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`
2018-09-17 15:42:38 +00:00
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.write`
2018-09-11 21:15:15 +00:00
**Out:**
CC: Y,A = bytes written
CS: A = EC
2018-06-18 08:44:02 +00:00
2018-10-04 06:13:44 +00:00
# SKT.Recv (RAW,DGRAM,SEQPACKET)
# SKT.RecvFrom (RAW,DGRAM,SEQPACKET)
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`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.Recv`
**Out:**
CC: A = hMem
CS: A = EC
# SKT.Send (RAW,DGRAM,SEQPACKET)
# SKT.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`
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.send`
**Out:**
CC: Y,A = bytes written
CS: A = EC
2018-10-04 06:13:44 +00:00
# SKT.GetTable
Get socket table
## C
`void * skt.gettable();`
## ASM
**In:**
`>LIBCALL hLIBTCPIP,LIBTCPIP.skt.GetTable`
**Out:**