summaryrefslogtreecommitdiffstatshomepage
path: root/drivers/wiznet5k/ethernet/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/wiznet5k/ethernet/socket.h')
-rw-r--r--drivers/wiznet5k/ethernet/socket.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/wiznet5k/ethernet/socket.h b/drivers/wiznet5k/ethernet/socket.h
index 40df8a872d..932224ecd0 100644
--- a/drivers/wiznet5k/ethernet/socket.h
+++ b/drivers/wiznet5k/ethernet/socket.h
@@ -78,8 +78,11 @@
* Following figure shows network flow diagram by WIZnet SOCKET API.
* @image html WIZnet_SOCKET.jpg "<WIZnet SOCKET API>"
*/
-#ifndef _SOCKET_H_
-#define _SOCKET_H_
+#ifndef _WIZCHIP_SOCKET_H_
+#define _WIZCHIP_SOCKET_H_
+
+// use this macro for exported names to avoid name clashes
+#define WIZCHIP_EXPORT(name) wizchip_ ## name
#include "wizchip_conf.h"
@@ -147,7 +150,7 @@
* @ref SOCKERR_SOCKMODE - Not support socket mode as TCP, UDP, and so on. \n
* @ref SOCKERR_SOCKFLAG - Invaild socket flag.
*/
-int8_t socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
+int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
/**
* @ingroup WIZnet_socket_APIs
@@ -159,7 +162,7 @@ int8_t socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
* @return @b Success : @ref SOCK_OK \n
* @b Fail : @ref SOCKERR_SOCKNUM - Invalid socket number
*/
-int8_t close(uint8_t sn);
+int8_t WIZCHIP_EXPORT(close)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
@@ -172,7 +175,7 @@ int8_t close(uint8_t sn);
* @b Fail :\n @ref SOCKERR_SOCKINIT - Socket is not initialized \n
* @ref SOCKERR_SOCKCLOSED - Socket closed unexpectedly.
*/
-int8_t listen(uint8_t sn);
+int8_t WIZCHIP_EXPORT(listen)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
@@ -195,7 +198,7 @@ int8_t listen(uint8_t sn);
* @ref SOCKERR_TIMEOUT - Timeout occurred during request connection\n
* @ref SOCK_BUSY - In non-block io mode, it returned immediately\n
*/
-int8_t connect(uint8_t sn, uint8_t * addr, uint16_t port);
+int8_t WIZCHIP_EXPORT(connect)(uint8_t sn, uint8_t * addr, uint16_t port);
/**
* @ingroup WIZnet_socket_APIs
@@ -212,7 +215,7 @@ int8_t connect(uint8_t sn, uint8_t * addr, uint16_t port);
* @ref SOCKERR_TIMEOUT - Timeout occurred \n
* @ref SOCK_BUSY - Socket is busy.
*/
-int8_t disconnect(uint8_t sn);
+int8_t WIZCHIP_EXPORT(disconnect)(uint8_t sn);
/**
* @ingroup WIZnet_socket_APIs
@@ -232,7 +235,7 @@ int8_t disconnect(uint8_t sn);
* @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCK_BUSY - Socket is busy.
*/
-int32_t send(uint8_t sn, uint8_t * buf, uint16_t len);
+int32_t WIZCHIP_EXPORT(send)(uint8_t sn, uint8_t * buf, uint16_t len);
/**
* @ingroup WIZnet_socket_APIs
@@ -254,7 +257,7 @@ int32_t send(uint8_t sn, uint8_t * buf, uint16_t len);
* @ref SOCKERR_DATALEN - zero data length \n
* @ref SOCK_BUSY - Socket is busy.
*/
-int32_t recv(uint8_t sn, uint8_t * buf, uint16_t len);
+int32_t WIZCHIP_EXPORT(recv)(uint8_t sn, uint8_t * buf, uint16_t len);
/**
* @ingroup WIZnet_socket_APIs
@@ -282,7 +285,7 @@ int32_t recv(uint8_t sn, uint8_t * buf, uint16_t len);
* @ref SOCKERR_TIMEOUT - Timeout occurred \n
* @ref SOCK_BUSY - Socket is busy.
*/
-int32_t sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port);
+int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port);
/**
* @ingroup WIZnet_socket_APIs
@@ -312,7 +315,7 @@ int32_t sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t
* @ref SOCKERR_SOCKNUM - Invalid socket number \n
* @ref SOCKBUSY - Socket is busy.
*/
-int32_t recvfrom(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port);
+int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port);
/////////////////////////////
@@ -399,7 +402,7 @@ typedef enum
* @return @b Success @ref SOCK_OK \n
* @b fail @ref SOCKERR_ARG - Invalid argument\n
*/
-int8_t ctlsocket(uint8_t sn, ctlsock_type cstype, void* arg);
+int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg);
/**
* @ingroup WIZnet_socket_APIs
@@ -427,7 +430,7 @@ int8_t ctlsocket(uint8_t sn, ctlsock_type cstype, void* arg);
* - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n
* - @ref SOCKERR_TIMEOUT - Timeout occurred when sending keep-alive packet \n
*/
-int8_t setsockopt(uint8_t sn, sockopt_type sotype, void* arg);
+int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg);
/**
* @ingroup WIZnet_socket_APIs
@@ -461,6 +464,6 @@ int8_t setsockopt(uint8_t sn, sockopt_type sotype, void* arg);
* When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero,
* This means the zero byte UDP data(UDP Header only) received.
*/
-int8_t getsockopt(uint8_t sn, sockopt_type sotype, void* arg);
+int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg);
-#endif // _SOCKET_H_
+#endif // _WIZCHIP_SOCKET_H_