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-2019 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 1.9.6
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_IP_CALLBACK_TABLE_SIZE
39  #warning TCP_IP_CALLBACK_TABLE_SIZE property is deprecated. NET_CALLBACK_TABLE_SIZE should be used instead.
40  #define NET_CALLBACK_TABLE_SIZE TCP_IP_CALLBACK_TABLE_SIZE
41 #endif
42 
43 #ifdef TCP_IP_MAX_IF_NAME_LEN
44  #warning TCP_IP_MAX_IF_NAME_LEN property is deprecated. NET_MAX_IF_NAME_LEN should be used instead.
45  #define NET_MAX_IF_NAME_LEN TCP_IP_MAX_IF_NAME_LEN
46 #endif
47 
48 #ifdef TCP_IP_MAX_HOSTNAME_LEN
49  #warning TCP_IP_MAX_HOSTNAME_LEN property is deprecated. NET_MAX_HOSTNAME_LEN should be used instead.
50  #define NET_MAX_HOSTNAME_LEN TCP_IP_MAX_HOSTNAME_LEN
51 #endif
52 
53 #ifdef TCP_IP_MAX_PROXY_NAME_LEN
54  #warning TCP_IP_MAX_PROXY_NAME_LEN property is deprecated. NET_MAX_PROXY_NAME_LEN should be used instead.
55  #define NET_MAX_PROXY_NAME_LEN TCP_IP_MAX_PROXY_NAME_LEN
56 #endif
57 
58 #ifdef TCP_IP_STATIC_OS_RESOURCES
59  #warning TCP_IP_STATIC_OS_RESOURCES property is deprecated. NET_STATIC_OS_RESOURCES should be used instead.
60  #define NET_STATIC_OS_RESOURCES TCP_IP_STATIC_OS_RESOURCES
61 #endif
62 
63 #ifdef TCP_IP_TICK_STACK_SIZE
64  #warning TCP_IP_TICK_STACK_SIZE property is deprecated. NET_TICK_STACK_SIZE should be used instead.
65  #define NET_TICK_STACK_SIZE TCP_IP_TICK_STACK_SIZE
66 #endif
67 
68 #ifdef TCP_IP_TICK_PRIORITY
69  #warning TCP_IP_TICK_PRIORITY property is deprecated. NET_TICK_PRIORITY should be used instead.
70  #define NET_TICK_PRIORITY TCP_IP_TICK_PRIORITY
71 #endif
72 
73 #ifdef TCP_IP_TICK_INTERVAL
74  #warning TCP_IP_TICK_INTERVAL property is deprecated. NET_TICK_INTERVAL should be used instead.
75  #define NET_TICK_INTERVAL TCP_IP_TICK_INTERVAL
76 #endif
77 
78 #ifdef TCP_IP_RX_STACK_SIZE
79  #warning TCP_IP_RX_STACK_SIZE property is deprecated. NET_RX_STACK_SIZE should be used instead.
80  #define NET_RX_STACK_SIZE TCP_IP_RX_STACK_SIZE
81 #endif
82 
83 #ifdef TCP_IP_RX_PRIORITY
84  #warning TCP_IP_RX_PRIORITY property is deprecated. NET_RX_PRIORITY should be used instead.
85  #define NET_RX_PRIORITY TCP_IP_RX_PRIORITY
86 #endif
87 
88 #ifdef TCP_SYN_QUEUE_SIZE
89  #warning TCP_SYN_QUEUE_SIZE property is deprecated. TCP_DEFAULT_SYN_QUEUE_SIZE should be used instead.
90  #define TCP_DEFAULT_SYN_QUEUE_SIZE TCP_SYN_QUEUE_SIZE
91 #endif
92 
93 #ifdef MAC_FILTER_MAX_SIZE
94  //#warning MAC_FILTER_MAX_SIZE property is deprecated. MAC_ADDR_FILTER_SIZE should be used instead.
95  #define MAC_ADDR_FILTER_SIZE MAC_FILTER_MAX_SIZE
96 #endif
97 
98 #ifdef IPV4_FILTER_MAX_SIZE
99  //#warning IPV4_FILTER_MAX_SIZE property is deprecated. IPV4_MULTICAST_FILTER_SIZE should be used instead.
100  #define IPV4_MULTICAST_FILTER_SIZE IPV4_FILTER_MAX_SIZE
101 #endif
102 
103 #ifdef IPV6_FILTER_MAX_SIZE
104  //#warning IPV6_FILTER_MAX_SIZE property is deprecated. IPV6_MULTICAST_FILTER_SIZE should be used instead.
105  #define IPV6_MULTICAST_FILTER_SIZE IPV6_FILTER_MAX_SIZE
106 #endif
107 
108 #ifdef IPV4_MAX_DNS_SERVERS
109  //#warning IPV4_MAX_DNS_SERVERS property is deprecated. IPV4_DNS_SERVER_LIST_SIZE should be used instead.
110  #define IPV4_DNS_SERVER_LIST_SIZE IPV4_MAX_DNS_SERVERS
111 #endif
112 
113 #ifdef IPV6_MAX_DNS_SERVERS
114  //#warning IPV6_MAX_DNS_SERVERS property is deprecated. IPV6_DNS_SERVER_LIST_SIZE should be used instead.
115  #define IPV6_DNS_SERVER_LIST_SIZE IPV6_MAX_DNS_SERVERS
116 #endif
117 
118 #ifdef NET_TICK_STACK_SIZE
119  #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
120 #endif
121 
122 #ifdef NET_TICK_PRIORITY
123  #warning NET_TICK_PRIORITY property is deprecated and should be removed from net_config.h. TCP/IP stack now uses a single task.
124 #endif
125 
126 #ifdef NET_RX_STACK_SIZE
127  #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.
128  #define NET_TASK_STACK_SIZE NET_RX_STACK_SIZE
129 #endif
130 
131 #ifdef NET_RX_PRIORITY
132  #warning NET_RX_PRIORITY property is deprecated since the TCP/IP stack now uses a single task. NET_TASK_PRIORITY should be used instead.
133  #define NET_TASK_PRIORITY NET_RX_PRIORITY
134 #endif
135 
136 #endif
137 
138 //Legacy definitions
139 #define SOCKET_TYPE_RAW SOCKET_TYPE_RAW_IP
140 #define SOCKET_PROTOCOL_ICMP SOCKET_IP_PROTO_ICMP
141 #define SOCKET_PROTOCOL_IGMP SOCKET_IP_PROTO_IGMP
142 #define SOCKET_PROTOCOL_TCP SOCKET_IP_PROTO_TCP
143 #define SOCKET_PROTOCOL_UDP SOCKET_IP_PROTO_UDP
144 #define SOCKET_PROTOCOL_ICMPV6 SOCKET_IP_PROTO_ICMPV6
145 
146 //Deprecated functions
147 #define tcpIpStackInit netInit
148 #define tcpIpStackSetInterfaceName netSetInterfaceName
149 #define tcpIpStackSetHostname netSetHostname
150 #define tcpIpStackSetDriver netSetDriver
151 #define tcpIpStackSetPhyDriver netSetPhyDriver
152 #define tcpIpStackSetSpiDriver netSetSpiDriver
153 #define tcpIpStackSetUartDriver netSetUartDriver
154 #define tcpIpStackSetExtIntDriver netSetExtIntDriver
155 #define tcpIpStackSetMacAddr netSetMacAddr
156 #define tcpIpStackSetProxy netSetProxy
157 #define tcpIpStackGetLinkState netGetLinkState
158 #define tcpIpStackConfigInterface netConfigInterface
159 #define tcpIpStackTickTask netTickTask
160 #define tcpIpStackRxTask netRxTask
161 #define tcpIpStackGetDefaultInterface netGetDefaultInterface
162 #define tcpIpStackInitRand netInitRand
163 #define tcpIpStackGetRand netGetRand
164 #define tcpIpStackGetRandRange netGetRandRange
165 #define tcpIpStackAttachLinkChangeCallback netAttachLinkChangeCallback
166 #define tcpIpStackDetachLinkChangeCallback netDetachLinkChangeCallback
167 #define tcpIpStackInvokeLinkChangeCallback netInvokeLinkChangeCallback
168 
169 #define ChunkedBuffer NetBuffer
170 #define chunkedBufferGetLength netBufferGetLength
171 #define chunkedBufferRead netBufferRead
172 
173 #ifdef SMTP_DEFAULT_TIMEOUT
174  #define SMTP_CLIENT_DEFAULT_TIMEOUT SMTP_DEFAULT_TIMEOUT
175 #endif
176 
177 #ifdef SMTP_MAX_LINE_LENGTH
178  #define SMTP_CLIENT_MAX_LINE_LENGTH SMTP_MAX_LINE_LENGTH
179 #endif
180 
181 #ifdef SMTP_TLS_SUPPORT
182  #define SMTP_CLIENT_TLS_SUPPORT SMTP_TLS_SUPPORT
183 #endif
184 
185 #ifdef SMTP_LOGIN_AUTH_SUPPORT
186  #define SMTP_CLIENT_LOGIN_AUTH_SUPPORT SMTP_LOGIN_AUTH_SUPPORT
187 #endif
188 
189 #ifdef SMTP_PLAIN_AUTH_SUPPORT
190  #define SMTP_CLIENT_PLAIN_AUTH_SUPPORT SMTP_PLAIN_AUTH_SUPPORT
191 #endif
192 
193 #ifdef SMTP_CRAM_MD5_AUTH_SUPPORT
194  #define SMTP_CLIENT_CRAM_MD5_AUTH_SUPPORT SMTP_CRAM_MD5_AUTH_SUPPORT
195 #endif
196 
197 #define DhcpClientCtx DhcpClientContext
198 #define Dhcpv6ClientCtx Dhcpv6ClientContext
199 
200 #ifdef SNMP_AGENT_MAX_MIB_COUNT
201  #define SNMP_AGENT_MAX_MIBS SNMP_AGENT_MAX_MIB_COUNT
202 #endif
203 
204 #ifdef SNMP_AGENT_MAX_USER_COUNT
205  #define SNMP_AGENT_MAX_USERS SNMP_AGENT_MAX_USER_COUNT
206 #endif
207 
208 #ifdef MAC_MULTICAST_FILTER_SIZE
209  #define MAC_ADDR_FILTER_SIZE MAC_MULTICAST_FILTER_SIZE
210 #endif
211 
212 #define ftpRegisterTlsInitCallback ftpClientRegisterTlsInitCallback
213 #define ftpLogin ftpClientLoginEx
214 #define ftpGetWorkingDir ftpClientGetWorkingDir
215 #define ftpChangeWorkingDir ftpClientChangeWorkingDir
216 #define ftpChangeToParentDir ftpClientChangeToParentDir
217 #define ftpOpenDir ftpClientOpenDir
218 #define ftpReadDir ftpClientReadDir
219 #define ftpCloseDir ftpClientCloseDir
220 #define ftpMakeDir ftpClientCreateDir
221 #define ftpRemoveDir ftpClientDeleteDir
222 #define ftpOpenFile ftpClientOpenFile
223 #define ftpWriteFile(context, data, length, flags) ftpClientWriteFile(context, data, length, NULL, flags)
224 #define ftpReadFile ftpClientReadFile
225 #define ftpCloseFile ftpClientCloseFile
226 #define ftpRenameFile ftpClientRenameFile
227 #define ftpDeleteFile ftpClientDeleteFile
228 #define ftpClose ftpClientDeinit
229 
230 #define FTP_NO_SECURITY FTP_MODE_PLAINTEXT
231 #define FTP_IMPLICIT_SECURITY FTP_MODE_IMPLICIT_TLS
232 #define FTP_EXPLICIT_SECURITY FTP_MODE_EXPLICIT_TLS
233 #define FTP_ACTIVE_MODE FTP_MODE_ACTIVE
234 #define FTP_PASSIVE_MODE FTP_MODE_PASSIVE
235 
236 #define FTP_FOR_READING FTP_FILE_MODE_READ
237 #define FTP_FOR_WRITING FTP_FILE_MODE_WRITE
238 #define FTP_FOR_APPENDING FTP_FILE_MODE_APPEND
239 #define FTP_BINARY_TYPE FTP_FILE_MODE_BINARY
240 #define FTP_TEXT_TYPE FTP_FILE_MODE_TEXT
241 
242 #ifdef FTP_CLIENT_SOCKET_MIN_TX_BUFFER_SIZE
243  #define FTP_CLIENT_MIN_TCP_BUFFER_SIZE FTP_CLIENT_SOCKET_MIN_TX_BUFFER_SIZE
244 #endif
245 
246 #ifdef FTP_CLIENT_SOCKET_MAX_TX_BUFFER_SIZE
247  #define FTP_CLIENT_MAX_TCP_BUFFER_SIZE FTP_CLIENT_SOCKET_MAX_TX_BUFFER_SIZE
248 #endif
249 
250 #ifdef FTP_SERVER_CTRL_SOCKET_BUFFER_SIZE
251  #define FTP_SERVER_MIN_TCP_BUFFER_SIZE FTP_SERVER_CTRL_SOCKET_BUFFER_SIZE
252 #endif
253 
254 #ifdef FTP_SERVER_DATA_SOCKET_BUFFER_SIZE
255  #define FTP_SERVER_MAX_TCP_BUFFER_SIZE FTP_SERVER_DATA_SOCKET_BUFFER_SIZE
256 #endif
257 
258 #define NET_VERSION_STRING CYCLONE_TCP_VERSION_STRING
259 #define NET_MAJOR_VERSION CYCLONE_TCP_MAJOR_VERSION
260 #define NET_MINOR_VERSION CYCLONE_TCP_MINOR_VERSION
261 #define NET_REV_NUMBER CYCLONE_TCP_REV_NUMBER
262 
263 #define ftpClientMakeDir ftpClientCreateDir
264 #define ftpClientRemoveDir ftpClientDeleteDir
265 
266 #define MQTT_PROTOCOL_LEVEL_3_1 MQTT_VERSION_3_1
267 #define MQTT_PROTOCOL_LEVEL_3_1_1 MQTT_VERSION_3_1_1
268 #define mqttClientSetProtocolLevel mqttClientSetVersion
269 
270 #define socketBindToInterface socketSetInterface
271 
272 #endif