You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
/*
|
|
|
|
@file socket.h
|
|
@brief define function of socket API
|
|
|
|
Original Author:
|
|
|
|
WIZnet Inc.
|
|
|
|
Modifications by:
|
|
|
|
Philip Lindsay <follower@rancidbacon.com>
|
|
|
|
Modifications license:
|
|
|
|
Copyright 2007-2008 // LGPL
|
|
|
|
*/
|
|
|
|
#ifndef _SOCKET_H_
|
|
#define _SOCKET_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode)
|
|
extern void close(SOCKET s); // Close socket
|
|
extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection)
|
|
extern void disconnect(SOCKET s); // disconnect the connection
|
|
extern uint8 listen(SOCKET s); // Establish TCP connection (Passive connection)
|
|
extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP)
|
|
extern uint16 recv(SOCKET s, uint8 * buf, uint16 len); // Receive data (TCP)
|
|
extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW)
|
|
extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port); // Receive data (UDP/IP RAW)
|
|
|
|
extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif
|
|
/* _SOCKET_H_ */
|