|
Revision 140, 1.2 KB
(checked in by follower, 11 months ago)
|
|
Add author, license and copyright details. (Which weren't permitted in competition entry source.)
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | |
|---|
| 3 | @file socket.h |
|---|
| 4 | @brief define function of socket API |
|---|
| 5 | |
|---|
| 6 | Original Author: |
|---|
| 7 | |
|---|
| 8 | WIZnet Inc. |
|---|
| 9 | |
|---|
| 10 | Modifications by: |
|---|
| 11 | |
|---|
| 12 | Philip Lindsay <follower@rancidbacon.com> |
|---|
| 13 | |
|---|
| 14 | Modifications license: |
|---|
| 15 | |
|---|
| 16 | Copyright 2007-2008 // LGPL |
|---|
| 17 | |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef _SOCKET_H_ |
|---|
| 21 | #define _SOCKET_H_ |
|---|
| 22 | |
|---|
| 23 | #ifdef __cplusplus |
|---|
| 24 | extern "C" { |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode) |
|---|
| 28 | extern void close(SOCKET s); // Close socket |
|---|
| 29 | extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection) |
|---|
| 30 | extern void disconnect(SOCKET s); // disconnect the connection |
|---|
| 31 | extern uint8 listen(SOCKET s); // Establish TCP connection (Passive connection) |
|---|
| 32 | extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP) |
|---|
| 33 | extern uint16 recv(SOCKET s, uint8 * buf, uint16 len); // Receive data (TCP) |
|---|
| 34 | extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW) |
|---|
| 35 | extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port); // Receive data (UDP/IP RAW) |
|---|
| 36 | |
|---|
| 37 | extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len); |
|---|
| 38 | |
|---|
| 39 | #ifdef __cplusplus |
|---|
| 40 | } // extern "C" |
|---|
| 41 | #endif |
|---|
| 42 | |
|---|
| 43 | #endif |
|---|
| 44 | /* _SOCKET_H_ */ |
|---|