root/branches/follower/libw5100/src/libw5100/socket.h

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
24extern "C" {
25#endif
26
27extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode)
28extern void close(SOCKET s); // Close socket
29extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection)
30extern void disconnect(SOCKET s); // disconnect the connection
31extern uint8 listen(SOCKET s);  // Establish TCP connection (Passive connection)
32extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP)
33extern uint16 recv(SOCKET s, uint8 * buf, uint16 len);  // Receive data (TCP)
34extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW)
35extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16  *port); // Receive data (UDP/IP RAW)
36
37extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len);
38
39#ifdef __cplusplus
40} // extern "C"
41#endif
42
43#endif
44/* _SOCKET_H_ */
Note: See TracBrowser for help on using the browser.