From 32d4a18a16afc5d3416ff602b008308ab373a89e Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Fri, 4 Jun 2010 18:01:16 -0400 Subject: basic socket interface --- libraries/ethernet/socket.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libraries/ethernet/socket.h (limited to 'libraries/ethernet/socket.h') diff --git a/libraries/ethernet/socket.h b/libraries/ethernet/socket.h new file mode 100644 index 0000000..c6efa90 --- /dev/null +++ b/libraries/ethernet/socket.h @@ -0,0 +1,27 @@ +#ifndef _SOCKET_H_ +#define _SOCKET_H_ + +/** + * @brief socket operations + */ + +#ifdef __cplusplus +extern "C"{ +#endif + + +enum sock_type { + SOCK_STREAM = 0x1, + SOCK_DGRAM = 0x2 +}; + +int32 socket(int32 type); +int32 bind(int32 sockfd, uint16 port); +int32 listen(int32 sockfd); + +#ifdef __cplusplus +} +#endif + +#endif + -- cgit v1.2.3