net_legacy.h
Go to the documentation of this file.
1 /**
2  * @file net_legacy.h
3  * @brief Legacy definitions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2026 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.6.0
29  **/
30 
31 #ifndef _NET_LEGACY_H
32 #define _NET_LEGACY_H
33 
34 //Check compiler
35 #if !defined(_WIN32)
36 
37 //Deprecated properties
38 #ifdef TCP_SYN_QUEUE_SIZE
39  #warning TCP_SYN_QUEUE_SIZE property is deprecated. TCP_DEFAULT_SYN_QUEUE_SIZE should be used instead.
40  #define TCP_DEFAULT_SYN_QUEUE_SIZE TCP_SYN_QUEUE_SIZE
41 #endif
42 
43 #ifdef MAC_FILTER_MAX_SIZE
44  //#warning MAC_FILTER_MAX_SIZE property is deprecated. MAC_ADDR_FILTER_SIZE should be used instead.
45  #define MAC_ADDR_FILTER_SIZE MAC_FILTER_MAX_SIZE
46 #endif
47 
48 #ifdef IPV4_FILTER_MAX_SIZE
49  //#warning IPV4_FILTER_MAX_SIZE property is deprecated. IPV4_MULTICAST_FILTER_SIZE should be used instead.
50  #define IPV4_MULTICAST_FILTER_SIZE IPV4_FILTER_MAX_SIZE
51 #endif
52 
53 #ifdef IPV6_FILTER_MAX_SIZE
54  //#warning IPV6_FILTER_MAX_SIZE property is deprecated. IPV6_MULTICAST_FILTER_SIZE should be used instead.
55  #define IPV6_MULTICAST_FILTER_SIZE IPV6_FILTER_MAX_SIZE
56 #endif
57 
58 #ifdef IPV4_MAX_DNS_SERVERS
59  //#warning IPV4_MAX_DNS_SERVERS property is deprecated. IPV4_DNS_SERVER_LIST_SIZE should be used instead.
60  #define IPV4_DNS_SERVER_LIST_SIZE IPV4_MAX_DNS_SERVERS
61 #endif
62 
63 #ifdef IPV6_MAX_DNS_SERVERS
64  //#warning IPV6_MAX_DNS_SERVERS property is deprecated. IPV6_DNS_SERVER_LIST_SIZE should be used instead.
65  #define IPV6_DNS_SERVER_LIST_SIZE IPV6_MAX_DNS_SERVERS
66 #endif
67 
68 #ifdef NET_TICK_STACK_SIZE
69  #warning NET_TICK_STACK_SIZE property is deprecated and should be removed from net_config.h. The TCP/IP stack now uses a single task
70 #endif
71 
72 #ifdef NET_TICK_PRIORITY
73  #warning NET_TICK_PRIORITY property is deprecated and should be removed from net_config.h. TCP/IP stack now uses a single task.
74 #endif
75 
76 #ifdef NET_RX_STACK_SIZE
77  #warning NET_RX_STACK_SIZE property is deprecated since the TCP/IP stack now uses a single task. NET_TASK_STACK_SIZE should be used instead.
78  #define NET_TASK_STACK_SIZE NET_RX_STACK_SIZE
79 #endif
80 
81 #ifdef NET_RX_PRIORITY
82  #warning NET_RX_PRIORITY property is deprecated since the TCP/IP stack now uses a single task. NET_TASK_PRIORITY should be used instead.
83  #define NET_TASK_PRIORITY NET_RX_PRIORITY
84 #endif
85 
86 #endif
87 
88 //Legacy definitions
89 #define SOCKET_TYPE_RAW SOCKET_TYPE_RAW_IP
90 #define SOCKET_PROTOCOL_ICMP SOCKET_IP_PROTO_ICMP
91 #define SOCKET_PROTOCOL_IGMP SOCKET_IP_PROTO_IGMP
92 #define SOCKET_PROTOCOL_TCP SOCKET_IP_PROTO_TCP
93 #define SOCKET_PROTOCOL_UDP SOCKET_IP_PROTO_UDP
94 #define SOCKET_PROTOCOL_ICMPV6 SOCKET_IP_PROTO_ICMPV6
95 
96 #ifdef SMTP_DEFAULT_TIMEOUT
97  #define SMTP_CLIENT_DEFAULT_TIMEOUT SMTP_DEFAULT_TIMEOUT
98 #endif
99 
100 #ifdef SMTP_MAX_LINE_LENGTH
101  #define SMTP_CLIENT_MAX_LINE_LENGTH SMTP_MAX_LINE_LENGTH
102 #endif
103 
104 #ifdef SMTP_TLS_SUPPORT
105  #define SMTP_CLIENT_TLS_SUPPORT SMTP_TLS_SUPPORT
106 #endif
107 
108 #ifdef SMTP_LOGIN_AUTH_SUPPORT
109  #define SMTP_CLIENT_LOGIN_AUTH_SUPPORT SMTP_LOGIN_AUTH_SUPPORT
110 #endif
111 
112 #ifdef SMTP_PLAIN_AUTH_SUPPORT
113  #define SMTP_CLIENT_PLAIN_AUTH_SUPPORT SMTP_PLAIN_AUTH_SUPPORT
114 #endif
115 
116 #ifdef SMTP_CRAM_MD5_AUTH_SUPPORT
117  #define SMTP_CLIENT_CRAM_MD5_AUTH_SUPPORT SMTP_CRAM_MD5_AUTH_SUPPORT
118 #endif
119 
120 #define DhcpClientCtx DhcpClientContext
121 #define Dhcpv6ClientCtx Dhcpv6ClientContext
122 
123 #ifdef SNMP_AGENT_MAX_MIB_COUNT
124  #define SNMP_AGENT_MAX_MIBS SNMP_AGENT_MAX_MIB_COUNT
125 #endif
126 
127 #ifdef SNMP_AGENT_MAX_USER_COUNT
128  #define SNMP_AGENT_MAX_USERS SNMP_AGENT_MAX_USER_COUNT
129 #endif
130 
131 #ifdef MAC_MULTICAST_FILTER_SIZE
132  #define MAC_ADDR_FILTER_SIZE MAC_MULTICAST_FILTER_SIZE
133 #endif
134 
135 #define ftpRegisterTlsInitCallback ftpClientRegisterTlsInitCallback
136 #define ftpLogin ftpClientLoginEx
137 #define ftpGetWorkingDir ftpClientGetWorkingDir
138 #define ftpChangeWorkingDir ftpClientChangeWorkingDir
139 #define ftpChangeToParentDir ftpClientChangeToParentDir
140 #define ftpOpenDir ftpClientOpenDir
141 #define ftpReadDir ftpClientReadDir
142 #define ftpCloseDir ftpClientCloseDir
143 #define ftpMakeDir ftpClientCreateDir
144 #define ftpRemoveDir ftpClientDeleteDir
145 #define ftpOpenFile ftpClientOpenFile
146 #define ftpWriteFile(context, data, length, flags) ftpClientWriteFile(context, data, length, NULL, flags)
147 #define ftpReadFile ftpClientReadFile
148 #define ftpCloseFile ftpClientCloseFile
149 #define ftpRenameFile ftpClientRenameFile
150 #define ftpDeleteFile ftpClientDeleteFile
151 #define ftpClose ftpClientDeinit
152 
153 #define FTP_NO_SECURITY FTP_MODE_PLAINTEXT
154 #define FTP_IMPLICIT_SECURITY FTP_MODE_IMPLICIT_TLS
155 #define FTP_EXPLICIT_SECURITY FTP_MODE_EXPLICIT_TLS
156 #define FTP_ACTIVE_MODE FTP_MODE_ACTIVE
157 #define FTP_PASSIVE_MODE FTP_MODE_PASSIVE
158 
159 #define FTP_FOR_READING FTP_FILE_MODE_READ
160 #define FTP_FOR_WRITING FTP_FILE_MODE_WRITE
161 #define FTP_FOR_APPENDING FTP_FILE_MODE_APPEND
162 #define FTP_BINARY_TYPE FTP_FILE_MODE_BINARY
163 #define FTP_TEXT_TYPE FTP_FILE_MODE_TEXT
164 
165 #ifdef FTP_CLIENT_SOCKET_MIN_TX_BUFFER_SIZE
166  #define FTP_CLIENT_MIN_TCP_BUFFER_SIZE FTP_CLIENT_SOCKET_MIN_TX_BUFFER_SIZE
167 #endif
168 
169 #ifdef FTP_CLIENT_SOCKET_MAX_TX_BUFFER_SIZE
170  #define FTP_CLIENT_MAX_TCP_BUFFER_SIZE FTP_CLIENT_SOCKET_MAX_TX_BUFFER_SIZE
171 #endif
172 
173 #ifdef FTP_SERVER_CTRL_SOCKET_BUFFER_SIZE
174  #define FTP_SERVER_MIN_TCP_BUFFER_SIZE FTP_SERVER_CTRL_SOCKET_BUFFER_SIZE
175 #endif
176 
177 #ifdef FTP_SERVER_DATA_SOCKET_BUFFER_SIZE
178  #define FTP_SERVER_MAX_TCP_BUFFER_SIZE FTP_SERVER_DATA_SOCKET_BUFFER_SIZE
179 #endif
180 
181 #define NET_VERSION_STRING CYCLONE_TCP_VERSION_STRING
182 #define NET_MAJOR_VERSION CYCLONE_TCP_MAJOR_VERSION
183 #define NET_MINOR_VERSION CYCLONE_TCP_MINOR_VERSION
184 #define NET_REV_NUMBER CYCLONE_TCP_REV_NUMBER
185 
186 #define ftpClientMakeDir ftpClientCreateDir
187 #define ftpClientRemoveDir ftpClientDeleteDir
188 
189 #define MQTT_PROTOCOL_LEVEL_3_1 MQTT_VERSION_3_1
190 #define MQTT_PROTOCOL_LEVEL_3_1_1 MQTT_VERSION_3_1_1
191 #define mqttClientSetProtocolLevel mqttClientSetVersion
192 
193 #define socketBindToInterface socketSetInterface
194 
195 #ifdef IGMP_SUPPORT
196  #define IGMP_HOST_SUPPORT IGMP_SUPPORT
197 #endif
198 
199 #ifdef COAP_SERVER_STACK_SIZE
200  #define COAP_SERVER_TASK_STACK_SIZE COAP_SERVER_STACK_SIZE
201 #endif
202 
203 #ifdef COAP_SERVER_PRIORITY
204  #define COAP_SERVER_TASK_PRIORITY COAP_SERVER_PRIORITY
205 #endif
206 
207 #ifdef DHCPV6_RELAY_STACK_SIZE
208  #define DHCPV6_RELAY_TASK_STACK_SIZE DHCPV6_RELAY_STACK_SIZE
209 #endif
210 
211 #ifdef DHCPV6_RELAY_PRIORITY
212  #define DHCPV6_RELAY_TASK_PRIORITY DHCPV6_RELAY_PRIORITY
213 #endif
214 
215 #ifdef FTP_SERVER_STACK_SIZE
216  #define FTP_SERVER_TASK_STACK_SIZE FTP_SERVER_STACK_SIZE
217 #endif
218 
219 #ifdef FTP_SERVER_PRIORITY
220  #define FTP_SERVER_TASK_PRIORITY FTP_SERVER_PRIORITY
221 #endif
222 
223 #ifdef HTTP_SERVER_STACK_SIZE
224  #define HTTP_SERVER_TASK_STACK_SIZE HTTP_SERVER_STACK_SIZE
225 #endif
226 
227 #ifdef HTTP_SERVER_PRIORITY
228  #define HTTP_SERVER_TASK_PRIORITY HTTP_SERVER_PRIORITY
229 #endif
230 
231 #ifdef ICECAST_CLIENT_STACK_SIZE
232  #define ICECAST_CLIENT_TASK_STACK_SIZE ICECAST_CLIENT_STACK_SIZE
233 #endif
234 
235 #ifdef ICECAST_CLIENT_PRIORITY
236  #define ICECAST_CLIENT_TASK_PRIORITY ICECAST_CLIENT_PRIORITY
237 #endif
238 
239 #ifdef MODBUS_SERVER_STACK_SIZE
240  #define MODBUS_SERVER_TASK_STACK_SIZE MODBUS_SERVER_STACK_SIZE
241 #endif
242 
243 #ifdef MODBUS_SERVER_PRIORITY
244  #define MODBUS_SERVER_TASK_PRIORITY MODBUS_SERVER_PRIORITY
245 #endif
246 
247 #ifdef SNMP_AGENT_STACK_SIZE
248  #define SNMP_AGENT_TASK_STACK_SIZE SNMP_AGENT_STACK_SIZE
249 #endif
250 
251 #ifdef SNMP_AGENT_PRIORITY
252  #define SNMP_AGENT_TASK_PRIORITY SNMP_AGENT_PRIORITY
253 #endif
254 
255 #ifdef TFTP_SERVER_STACK_SIZE
256  #define TFTP_SERVER_TASK_STACK_SIZE TFTP_SERVER_STACK_SIZE
257 #endif
258 
259 #ifdef TFTP_SERVER_PRIORITY
260  #define TFTP_SERVER_TASK_PRIORITY TFTP_SERVER_PRIORITY
261 #endif
262 
263 #define icmpEnableEchoRequest icmpEnableEchoRequests
264 #define icmpEnableBroadcastEchoRequest icmpEnableBroadcastEchoRequests
265 #define icmpv6EnableEchoRequest icmpv6EnableEchoRequests
266 #define icmpv6EnableMulticastEchoRequest icmpv6EnableMulticastEchoRequests
267 
268 #ifdef MLD_SUPPORT
269  #define MLD_NODE_SUPPORT MLD_SUPPORT
270 #endif
271 
272 #ifdef DNS_SD_SUPPORT
273  #define DNS_SD_RESPONDER_SUPPORT DNS_SD_SUPPORT
274 #endif
275 
276 #define netInitEx netInit
277 #define netTaskEx netTask
278 #define udpAttachRxCallback udpRegisterRxCallback
279 
280 #endif