VSF Documented
vsf_linux_socket.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_LINUX_SOCKET_INTERNAL_H__
19#define __VSF_LINUX_SOCKET_INTERNAL_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../vsf_linux_cfg.h"
24
25#if VSF_USE_LINUX == ENABLED && VSF_LINUX_USE_SOCKET == ENABLED
26
27#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
28# include "../../include/sys/socket.h"
29#else
30# include <sys/socket.h>
31#endif
32
33#if defined(__VSF_LINUX_SOCKET_CLASS_IMPLEMENT)
34# define __VSF_CLASS_IMPLEMENT__
35#elif defined(__VSF_LINUX_SOCKET_CLASS_INHERIT__)
36# define __VSF_CLASS_INHERIT__
37#endif
38
39#include "utilities/ooc_class.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/*============================ MACROS ========================================*/
46/*============================ MACROFIED FUNCTIONS ===========================*/
47/*============================ TYPES =========================================*/
48
50
51typedef struct vsf_linux_socket_op_t {
53
54 int (*fn_init)(vsf_linux_fd_t *sfd);
55 int (*fn_socketpair)(vsf_linux_fd_t *sfd1, vsf_linux_fd_t *sfd2);
56
57 int (*fn_fini)(vsf_linux_socket_priv_t *priv, int how);
58 int (*fn_connect)(vsf_linux_socket_priv_t *priv, const struct sockaddr *addr, socklen_t addrlen);
59 int (*fn_listen)(vsf_linux_socket_priv_t *priv, int backlog);
60 int (*fn_accept)(vsf_linux_socket_priv_t *priv, struct sockaddr *addr, socklen_t *addr_len);
61 int (*fn_bind)(vsf_linux_socket_priv_t *priv, const struct sockaddr *addr, socklen_t addrlen);
62
63 int (*fn_getsockopt)(vsf_linux_socket_priv_t *priv, int level, int optname, void *optval, socklen_t *optlen);
64 int (*fn_setsockopt)(vsf_linux_socket_priv_t *priv, int level, int optname,const void *optval, socklen_t optlen);
65
66 int (*fn_getpeername)(vsf_linux_socket_priv_t *socket_priv, struct sockaddr *addr, socklen_t *addrlen);
67 int (*fn_getsockname)(vsf_linux_socket_priv_t *socket_priv, struct sockaddr *addr, socklen_t *addrlen);
69
71 public_member(
72 implement(vsf_linux_pipe_priv_t)
73
74 int domain;
75 int type;
76 int protocol;
77 const vsf_linux_socket_op_t *sockop;
78 )
79 protected_member(
80 struct msghdr *msg_rx;
81 const struct msghdr *msg_tx;
82 void *sender_process;
83 )
84};
85
86/*============================ GLOBAL VARIABLES ==============================*/
87
88#if VSF_LINUX_SOCKET_USE_UNIX == ENABLED
90#endif
91#if VSF_LINUX_SOCKET_USE_INET == ENABLED
93#endif
94#if VSF_LINUX_SOCKET_USE_NETLINK == ENABLED
96#endif
97
98/*============================ LOCAL VARIABLES ===============================*/
99/*============================ PROTOTYPES ====================================*/
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif // VSF_USE_LINUX && VSF_LINUX_USE_SOCKET
106#endif // __VSF_LINUX_SOCKET_INTERNAL_H__
107/* EOF */
Definition vsf_linux_fs.h:115
Definition vsf_linux_socket.h:70
#define vsf_dcl_class
Definition ooc_class.h:46
#define vsf_class(__name)
Definition ooc_class.h:48
uint32_t socklen_t
Definition socket.h:70
Definition socket.h:197
Definition socket.h:74
Definition vsf_linux_fs.h:70
Definition vsf_linux_socket.h:51
vsf_linux_fd_op_t fdop
Definition vsf_linux_socket.h:52
vk_av_control_type_t type
Definition vsf_audio.h:170
const vsf_linux_socket_op_t vsf_linux_socket_unix_op
Definition vsf_linux_socket_unix.c:104
const vsf_linux_socket_op_t vsf_linux_socket_inet_op
Definition vsf_linux_socket_inet_lwip.c:224
const vsf_linux_socket_op_t vsf_linux_socket_netlink_op
Definition vsf_linux_socket_inet_lwip.c:246