bsd_socket_options.h
Go to the documentation of this file.
1 /**
2  * @file bsd_socket_options.h
3  * @brief BSD socket options
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _BSD_SOCKET_OPTIONS_H
32 #define _BSD_SOCKET_OPTIONS_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "core/bsd_socket.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //BSD socket related functions
45  socklen_t optlen);
46 
48  socklen_t optlen);
49 
50 int_t socketSetSoSndTimeoOption(Socket *socket, const struct timeval *optval,
51  socklen_t optlen);
52 
53 int_t socketSetSoRcvTimeoOption(Socket *socket, const struct timeval *optval,
54  socklen_t optlen);
55 
57  socklen_t optlen);
58 
60  socklen_t optlen);
61 
63  socklen_t optlen);
64 
66  socklen_t optlen);
67 
69  socklen_t optlen);
70 
72  socklen_t optlen);
73 
75  const struct in_addr *optval, socklen_t optlen);
76 
78  socklen_t optlen);
79 
81  socklen_t optlen);
82 
84  const struct ip_mreq *optval, socklen_t optlen);
85 
87  const struct ip_mreq *optval, socklen_t optlen);
88 
90  const struct ip_mreq_source *optval, socklen_t optlen);
91 
93  const struct ip_mreq_source *optval, socklen_t optlen);
94 
96  const struct ip_mreq_source *optval, socklen_t optlen);
97 
99  const struct ip_mreq_source *optval, socklen_t optlen);
100 
102  const struct group_req *optval, socklen_t optlen);
103 
105  const struct group_req *optval, socklen_t optlen);
106 
108  const struct group_source_req *optval, socklen_t optlen);
109 
111  const struct group_source_req *optval, socklen_t optlen);
112 
114  const struct group_source_req *optval, socklen_t optlen);
115 
117  const struct group_source_req *optval, socklen_t optlen);
118 
120  socklen_t optlen);
121 
123  socklen_t optlen);
124 
126  socklen_t optlen);
127 
129  socklen_t optlen);
130 
132  socklen_t optlen);
133 
135  socklen_t optlen);
136 
138  const struct in_addr *optval, socklen_t optlen);
139 
141  socklen_t optlen);
142 
144  socklen_t optlen);
145 
147  const struct ipv6_mreq *optval, socklen_t optlen);
148 
150  const struct ipv6_mreq *optval, socklen_t optlen);
151 
153  socklen_t optlen);
154 
156  socklen_t optlen);
157 
159  socklen_t optlen);
160 
162  socklen_t optlen);
163 
165  socklen_t optlen);
166 
168  socklen_t optlen);
169 
171  socklen_t optlen);
172 
174  socklen_t optlen);
175 
177  socklen_t optlen);
178 
180  socklen_t optlen);
181 
183  socklen_t *optlen);
184 
186  socklen_t *optlen);
187 
189  socklen_t *optlen);
190 
192  socklen_t *optlen);
193 
195  socklen_t *optlen);
196 
198  socklen_t *optlen);
199 
201  socklen_t *optlen);
202 
204  socklen_t *optlen);
205 
207  socklen_t *optlen);
208 
210  socklen_t *optlen);
211 
213  socklen_t *optlen);
214 
216  socklen_t *optlen);
217 
219  socklen_t *optlen);
220 
222  socklen_t *optlen);
223 
225  socklen_t *optlen);
226 
228  socklen_t *optlen);
229 
231  socklen_t *optlen);
232 
234  socklen_t *optlen);
235 
237  socklen_t *optlen);
238 
240  socklen_t *optlen);
241 
243  socklen_t *optlen);
244 
246  socklen_t *optlen);
247 
249  socklen_t *optlen);
250 
252  socklen_t *optlen);
253 
255  socklen_t *optlen);
256 
258  socklen_t *optlen);
259 
261  socklen_t *optlen);
262 
264  socklen_t *optlen);
265 
267  socklen_t *optlen);
268 
270  socklen_t *optlen);
271 
273  socklen_t *optlen);
274 
276  socklen_t *optlen);
277 
278 //C++ guard
279 #ifdef __cplusplus
280 }
281 #endif
282 
283 #endif
int_t socketSetIpv6AddMembershipOption(Socket *socket, const struct ipv6_mreq *optval, socklen_t optlen)
Set IPV6_ADD_MEMBERSHIP option.
int_t socketGetIpRecvTosOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_RECVTOS option.
int_t socketGetIpMulticastLoopOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_MULTICAST_LOOP option.
int_t socklen_t
Length type.
Definition: bsd_socket.h:303
int_t socketGetIpDontFragOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_DONTFRAG option.
int_t socketGetIpRecvTtlOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_RECVTTL option.
int_t socketGetIpv6UnicastHopsOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_UNICAST_HOPS option.
int_t socketSetIpRecvTosOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_RECVTOS option.
signed int int_t
Definition: compiler_port.h:49
int_t socketGetIpv6MulticastLoopOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_MULTICAST_LOOP option.
int_t socketSetIpAddMembershipOption(Socket *socket, const struct ip_mreq *optval, socklen_t optlen)
Set IP_ADD_MEMBERSHIP option.
int_t socketSetIpDontFragOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_DONTFRAG option.
int_t socketSetIpv6RecvTrafficClassOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_RECVTCLASS option.
Source-specific multicast group information (for IPv4/IPv6)
Definition: bsd_socket.h:446
int_t socketSetMcastJoinSourceGroupOption(Socket *socket, const struct group_source_req *optval, socklen_t optlen)
Set MCAST_JOIN_SOURCE_GROUP option.
int_t socketSetIpv6PktInfoOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_PKTINFO option.
int_t socketGetSoSndBufOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_SNDBUF option.
int_t socketSetIpDropMembershipOption(Socket *socket, const struct ip_mreq *optval, socklen_t optlen)
Set IP_DROP_MEMBERSHIP option.
int_t socketSetMcastUnblockSourceOption(Socket *socket, const struct group_source_req *optval, socklen_t optlen)
Set MCAST_UNBLOCK_SOURCE option.
int_t socketSetSoSndTimeoOption(Socket *socket, const struct timeval *optval, socklen_t optlen)
Set SO_SNDTIMEO option.
int_t socketGetIpv6DontFragOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_DONTFRAG option.
int_t socketSetIpTosOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_TOS option.
int_t socketGetIpv6TrafficClassOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_TCLASS option.
int_t socketGetSoBroadcastOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_BROADCAST option.
Any-source multicast group information (for IPv4 only)
Definition: bsd_socket.h:401
int_t socketSetTcpNoDelayOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set TCP_NODELAY option.
int_t socketSetTcpKeepCntOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set TCP_KEEPCNT option.
int_t socketGetSoNoCheckOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_NO_CHECK option.
int_t socketGetIpv6RecvHopLimitOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_RECVHOPLIMIT option.
int_t socketGetIpv6PktInfoOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_PKTINFO option.
int_t socketSetMcastLeaveSourceGroupOption(Socket *socket, const struct group_source_req *optval, socklen_t optlen)
Set MCAST_LEAVE_SOURCE_GROUP option.
int_t socketGetIpv6MulticastHopsOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_MULTICAST_HOPS option.
int_t socketGetSoKeepAliveOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_KEEPALIVE option.
int_t socketSetIpMulticastTtlOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_MULTICAST_TTL option.
int_t socketGetSoTypeOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_TYPE option.
Structure that represents an IPv4 address.
Definition: bsd_socket.h:354
int_t socket(int_t family, int_t type, int_t protocol)
Create a socket that is bound to a specific transport service provider.
Definition: bsd_socket.c:65
int_t socketSetSoSndBufOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_SNDBUF option.
int_t socketGetSoSndTimeoOption(Socket *socket, struct timeval *optval, socklen_t *optlen)
Get SO_SNDTIMEO option.
int_t socketGetTcpMaxSegOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get TCP_MAXSEG option.
int_t socketSetTcpKeepIdleOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set TCP_KEEPIDLE option.
int_t socketSetIpMulticastLoopOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_MULTICAST_LOOP option.
int_t socketSetSoReuseAddrOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_REUSEADDR option.
int_t socketSetSoRcvBufOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_RCVBUF option.
int_t socketSetMcastLeaveGroupOption(Socket *socket, const struct group_req *optval, socklen_t optlen)
Set MCAST_LEAVE_GROUP option.
int_t socketSetIpv6MulticastLoopOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_MULTICAST_LOOP option.
BSD socket API.
int_t socketSetIpv6TrafficClassOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_TCLASS option.
int_t socketSetIpv6DropMembershipOption(Socket *socket, const struct ipv6_mreq *optval, socklen_t optlen)
Set IPV6_DROP_MEMBERSHIP option.
int_t socketGetTcpNoDelayOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get TCP_NODELAY option.
int_t socketSetSoBroadcastOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_BROADCAST option.
int_t socketSetMcastJoinGroupOption(Socket *socket, const struct group_req *optval, socklen_t optlen)
Set MCAST_JOIN_GROUP option.
int_t socketSetIpMulticastIfOption(Socket *socket, const struct in_addr *optval, socklen_t optlen)
Set IP_MULTICAST_IF option.
int_t socketSetIpBlockSourceOption(Socket *socket, const struct ip_mreq_source *optval, socklen_t optlen)
Set IP_BLOCK_SOURCE option.
int_t socketSetIpv6OnlyOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_V6ONLY option.
int_t socketSetSoRcvTimeoOption(Socket *socket, const struct timeval *optval, socklen_t optlen)
Set SO_RCVTIMEO option.
int_t socketGetSoReuseAddrOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_REUSEADDR option.
int_t socketSetIpv6MulticastIfOption(Socket *socket, const struct in_addr *optval, socklen_t optlen)
Set IPV6_MULTICAST_IF option.
int_t socketSetMcastBlockSourceOption(Socket *socket, const struct group_source_req *optval, socklen_t optlen)
Set MCAST_BLOCK_SOURCE option.
int_t socketGetIpPktInfoOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_PKTINFO option.
int_t socketGetTcpKeepIdleOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get TCP_KEEPIDLE option.
int_t socketGetIpMulticastTtlOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_MULTICAST_TTL option.
int_t socketGetIpv6OnlyOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_V6ONLY option.
int_t socketSetIpDropSourceMembershipOption(Socket *socket, const struct ip_mreq_source *optval, socklen_t optlen)
Set IP_DROP_SOURCE_MEMBERSHIP option.
Timeout structure.
Definition: bsd_socket.h:572
int_t socketGetTcpKeepCntOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get TCP_KEEPCNT option.
int_t socketSetIpv6MulticastHopsOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_MULTICAST_HOPS option.
#define Socket
Definition: socket.h:36
int_t socketSetIpPktInfoOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_PKTINFO option.
int_t socketGetSoRcvTimeoOption(Socket *socket, struct timeval *optval, socklen_t *optlen)
Get SO_RCVTIMEO option.
int_t socketGetIpTosOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_TOS option.
int_t socketSetIpv6RecvHopLimitOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_RECVHOPLIMIT option.
int_t socketGetTcpKeepIntvlOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get TCP_KEEPINTVL option.
int_t socketSetSoNoCheckOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_NO_CHECK option.
int_t socketGetIpTtlOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IP_TTL option.
int_t socketGetSoRcvBufOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_RCVBUF option.
Any-source multicast group information (for IPv6 only)
Definition: bsd_socket.h:424
int_t socketSetTcpKeepIntvlOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set TCP_KEEPINTVL option.
int_t socketSetTcpMaxSegOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set TCP_MAXSEG option.
int_t socketGetSoErrorOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get SO_ERROR option.
int_t socketSetIpRecvTtlOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_RECVTTL option.
int_t socketSetIpv6UnicastHopsOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_UNICAST_HOPS option.
TCP/IP stack core.
int_t socketSetIpTtlOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IP_TTL option.
int_t socketSetSoKeepAliveOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set SO_KEEPALIVE option.
int_t socketSetIpAddSourceMembershipOption(Socket *socket, const struct ip_mreq_source *optval, socklen_t optlen)
Set IP_ADD_SOURCE_MEMBERSHIP option.
Source-specific multicast group information (for IPv4 only)
Definition: bsd_socket.h:412
int_t socketSetIpUnblockSourceOption(Socket *socket, const struct ip_mreq_source *optval, socklen_t optlen)
Set IP_UNBLOCK_SOURCE option.
int_t socketSetIpv6DontFragOption(Socket *socket, const int_t *optval, socklen_t optlen)
Set IPV6_DONTFRAG option.
Any-source multicast group information (for IPv4/IPv6)
Definition: bsd_socket.h:435
int_t socketGetIpv6RecvTrafficClassOption(Socket *socket, int_t *optval, socklen_t *optlen)
Get IPV6_RECVTCLASS option.