aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet/utility/socket.h
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2008-07-30 14:47:36 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2008-07-30 14:47:36 +0000
commiteac2983285b4bc40250771fb5141aa63c76a9a90 (patch)
tree9f51fab1b562f589d7ea6ce3dda53037ff2c929c /libraries/Ethernet/utility/socket.h
parentf1a76708088659850b98a92779a2cb1aaf5793d8 (diff)
Adding ethernet library.
Diffstat (limited to 'libraries/Ethernet/utility/socket.h')
-rwxr-xr-xlibraries/Ethernet/utility/socket.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/libraries/Ethernet/utility/socket.h b/libraries/Ethernet/utility/socket.h
new file mode 100755
index 0000000..a5cce42
--- /dev/null
+++ b/libraries/Ethernet/utility/socket.h
@@ -0,0 +1,23 @@
+/*
+*
+@file socket.h
+@brief define function of socket API
+*
+*/
+
+#ifndef _SOCKET_H_
+#define _SOCKET_H_
+
+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);
+#endif
+/* _SOCKET_H_ */