~ubuntu-branches/ubuntu/precise/arduino/precise

« back to all changes in this revision

Viewing changes to libraries/Ethernet/utility/socket.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Howard
  • Date: 2010-04-13 22:32:24 UTC
  • Revision ID: james.westby@ubuntu.com-20100413223224-jduxnd0xxnkkda02
Tags: upstream-0018+dfsg
ImportĀ upstreamĀ versionĀ 0018+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*
 
3
@file           socket.h
 
4
@brief  define function of socket API 
 
5
*
 
6
*/
 
7
 
 
8
#ifndef _SOCKET_H_
 
9
#define _SOCKET_H_
 
10
 
 
11
extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode)
 
12
extern void close(SOCKET s); // Close socket
 
13
extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection)
 
14
extern void disconnect(SOCKET s); // disconnect the connection
 
15
extern uint8 listen(SOCKET s);  // Establish TCP connection (Passive connection)
 
16
extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP)
 
17
extern uint16 recv(SOCKET s, uint8 * buf, uint16 len);  // Receive data (TCP)
 
18
extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW)
 
19
extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16  *port); // Receive data (UDP/IP RAW)
 
20
 
 
21
extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len);
 
22
#endif
 
23
/* _SOCKET_H_ */