summaryrefslogtreecommitdiff
path: root/components/net/sal_socket/include/socket/sys_socket/sys
diff options
context:
space:
mode:
authorchenyong <[email protected]>2018-07-17 20:29:33 +0800
committerchenyong <[email protected]>2018-07-18 13:34:13 +0800
commit8cda48a1323dc3cb1f947eb86d895595ebc30b38 (patch)
tree2adcb7fef3f4e735196973821aa298e5f6af98e7 /components/net/sal_socket/include/socket/sys_socket/sys
parent4ca1d03bdffef9e79456df3e696b7efb7f5b79aa (diff)
[net][sal] Add SAL (socket abstraction layer) framework
Diffstat (limited to 'components/net/sal_socket/include/socket/sys_socket/sys')
-rw-r--r--components/net/sal_socket/include/socket/sys_socket/sys/socket.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/components/net/sal_socket/include/socket/sys_socket/sys/socket.h b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h
new file mode 100644
index 0000000000..2b0357ff81
--- /dev/null
+++ b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h
@@ -0,0 +1,58 @@
+/*
+ * File : socket.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2015-02-17 Bernard First version
+ * 2018-05-17 ChenYong Add socket abstraction layer
+ */
+
+#ifndef SYS_SOCKET_H_
+#define SYS_SOCKET_H_
+
+#include <sal_socket.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
+int bind(int s, const struct sockaddr *name, socklen_t namelen);
+int shutdown(int s, int how);
+int getpeername (int s, struct sockaddr *name, socklen_t *namelen);
+int getsockname (int s, struct sockaddr *name, socklen_t *namelen);
+int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen);
+int setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen);
+int connect(int s, const struct sockaddr *name, socklen_t namelen);
+int listen(int s, int backlog);
+int recv(int s, void *mem, size_t len, int flags);
+int recvfrom(int s, void *mem, size_t len, int flags,
+ struct sockaddr *from, socklen_t *fromlen);
+int send(int s, const void *dataptr, size_t size, int flags);
+int sendto(int s, const void *dataptr, size_t size, int flags,
+ const struct sockaddr *to, socklen_t tolen);
+int socket(int domain, int type, int protocol);
+int closesocket(int s);
+int ioctlsocket(int s, long cmd, void *arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_SOCKET_H_ */