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  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _NET_LEGACY_H
30 #define _NET_LEGACY_H
31 
32 //Check compiler
33 #if !defined(_WIN32)
34 
35 //Deprecated properties
36 #ifdef TCP_IP_CALLBACK_TABLE_SIZE
37  #warning TCP_IP_CALLBACK_TABLE_SIZE property is deprecated. NET_CALLBACK_TABLE_SIZE should be used instead.
38  #define NET_CALLBACK_TABLE_SIZE TCP_IP_CALLBACK_TABLE_SIZE
39 #endif
40 
41 #ifdef TCP_IP_MAX_IF_NAME_LEN
42  #warning TCP_IP_MAX_IF_NAME_LEN property is deprecated. NET_MAX_IF_NAME_LEN should be used instead.
43  #define NET_MAX_IF_NAME_LEN TCP_IP_MAX_IF_NAME_LEN
44 #endif
45 
46 #ifdef TCP_IP_MAX_HOSTNAME_LEN
47  #warning TCP_IP_MAX_HOSTNAME_LEN property is deprecated. NET_MAX_HOSTNAME_LEN should be used instead.
48  #define NET_MAX_HOSTNAME_LEN TCP_IP_MAX_HOSTNAME_LEN
49 #endif
50 
51 #ifdef TCP_IP_MAX_PROXY_NAME_LEN
52  #warning TCP_IP_MAX_PROXY_NAME_LEN property is deprecated. NET_MAX_PROXY_NAME_LEN should be used instead.
53  #define NET_MAX_PROXY_NAME_LEN TCP_IP_MAX_PROXY_NAME_LEN
54 #endif
55 
56 #ifdef TCP_IP_STATIC_OS_RESOURCES
57  #warning TCP_IP_STATIC_OS_RESOURCES property is deprecated. NET_STATIC_OS_RESOURCES should be used instead.
58  #define NET_STATIC_OS_RESOURCES TCP_IP_STATIC_OS_RESOURCES
59 #endif
60 
61 #ifdef TCP_IP_TICK_STACK_SIZE
62  #warning TCP_IP_TICK_STACK_SIZE property is deprecated. NET_TICK_STACK_SIZE should be used instead.
63  #define NET_TICK_STACK_SIZE TCP_IP_TICK_STACK_SIZE
64 #endif
65 
66 #ifdef TCP_IP_TICK_PRIORITY
67  #warning TCP_IP_TICK_PRIORITY property is deprecated. NET_TICK_PRIORITY should be used instead.
68  #define NET_TICK_PRIORITY TCP_IP_TICK_PRIORITY
69 #endif
70 
71 #ifdef TCP_IP_TICK_INTERVAL
72  #warning TCP_IP_TICK_INTERVAL property is deprecated. NET_TICK_INTERVAL should be used instead.
73  #define NET_TICK_INTERVAL TCP_IP_TICK_INTERVAL
74 #endif
75 
76 #ifdef TCP_IP_RX_STACK_SIZE
77  #warning TCP_IP_RX_STACK_SIZE property is deprecated. NET_RX_STACK_SIZE should be used instead.
78  #define NET_RX_STACK_SIZE TCP_IP_RX_STACK_SIZE
79 #endif
80 
81 #ifdef TCP_IP_RX_PRIORITY
82  #warning TCP_IP_RX_PRIORITY property is deprecated. NET_RX_PRIORITY should be used instead.
83  #define NET_RX_PRIORITY TCP_IP_RX_PRIORITY
84 #endif
85 
86 #ifdef TCP_SYN_QUEUE_SIZE
87  #warning TCP_SYN_QUEUE_SIZE property is deprecated. TCP_DEFAULT_SYN_QUEUE_SIZE should be used instead.
88  #define TCP_DEFAULT_SYN_QUEUE_SIZE TCP_SYN_QUEUE_SIZE
89 #endif
90 
91 #ifdef MAC_FILTER_MAX_SIZE
92  //#warning MAC_FILTER_MAX_SIZE property is deprecated. MAC_ADDR_FILTER_SIZE should be used instead.
93  #define MAC_ADDR_FILTER_SIZE MAC_FILTER_MAX_SIZE
94 #endif
95 
96 #ifdef IPV4_FILTER_MAX_SIZE
97  //#warning IPV4_FILTER_MAX_SIZE property is deprecated. IPV4_MULTICAST_FILTER_SIZE should be used instead.
98  #define IPV4_MULTICAST_FILTER_SIZE IPV4_FILTER_MAX_SIZE
99 #endif
100 
101 #ifdef IPV6_FILTER_MAX_SIZE
102  //#warning IPV6_FILTER_MAX_SIZE property is deprecated. IPV6_MULTICAST_FILTER_SIZE should be used instead.
103  #define IPV6_MULTICAST_FILTER_SIZE IPV6_FILTER_MAX_SIZE
104 #endif
105 
106 #ifdef IPV4_MAX_DNS_SERVERS
107  //#warning IPV4_MAX_DNS_SERVERS property is deprecated. IPV4_DNS_SERVER_LIST_SIZE should be used instead.
108  #define IPV4_DNS_SERVER_LIST_SIZE IPV4_MAX_DNS_SERVERS
109 #endif
110 
111 #ifdef IPV6_MAX_DNS_SERVERS
112  //#warning IPV6_MAX_DNS_SERVERS property is deprecated. IPV6_DNS_SERVER_LIST_SIZE should be used instead.
113  #define IPV6_DNS_SERVER_LIST_SIZE IPV6_MAX_DNS_SERVERS
114 #endif
115 
116 #ifdef NET_TICK_STACK_SIZE
117  #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
118 #endif
119 
120 #ifdef NET_TICK_PRIORITY
121  #warning NET_TICK_PRIORITY property is deprecated and should be removed from net_config.h. TCP/IP stack now uses a single task.
122 #endif
123 
124 #ifdef NET_RX_STACK_SIZE
125  #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.
126  #define NET_TASK_STACK_SIZE NET_RX_STACK_SIZE
127 #endif
128 
129 #ifdef NET_RX_PRIORITY
130  #warning NET_RX_PRIORITY property is deprecated since the TCP/IP stack now uses a single task. NET_TASK_PRIORITY should be used instead.
131  #define NET_TASK_PRIORITY NET_RX_PRIORITY
132 #endif
133 
134 #endif
135 
136 //Legacy definitions
137 #define SOCKET_TYPE_RAW SOCKET_TYPE_RAW_IP
138 #define SOCKET_PROTOCOL_ICMP SOCKET_IP_PROTO_ICMP
139 #define SOCKET_PROTOCOL_IGMP SOCKET_IP_PROTO_IGMP
140 #define SOCKET_PROTOCOL_TCP SOCKET_IP_PROTO_TCP
141 #define SOCKET_PROTOCOL_UDP SOCKET_IP_PROTO_UDP
142 #define SOCKET_PROTOCOL_ICMPV6 SOCKET_IP_PROTO_ICMPV6
143 
144 //Deprecated functions
145 #define tcpIpStackInit netInit
146 #define tcpIpStackSetInterfaceName netSetInterfaceName
147 #define tcpIpStackSetHostname netSetHostname
148 #define tcpIpStackSetDriver netSetDriver
149 #define tcpIpStackSetPhyDriver netSetPhyDriver
150 #define tcpIpStackSetSpiDriver netSetSpiDriver
151 #define tcpIpStackSetUartDriver netSetUartDriver
152 #define tcpIpStackSetExtIntDriver netSetExtIntDriver
153 #define tcpIpStackSetMacAddr netSetMacAddr
154 #define tcpIpStackSetProxy netSetProxy
155 #define tcpIpStackGetLinkState netGetLinkState
156 #define tcpIpStackConfigInterface netConfigInterface
157 #define tcpIpStackTickTask netTickTask
158 #define tcpIpStackRxTask netRxTask
159 #define tcpIpStackGetDefaultInterface netGetDefaultInterface
160 #define tcpIpStackInitRand netInitRand
161 #define tcpIpStackGetRand netGetRand
162 #define tcpIpStackGetRandRange netGetRandRange
163 #define tcpIpStackAttachLinkChangeCallback netAttachLinkChangeCallback
164 #define tcpIpStackDetachLinkChangeCallback netDetachLinkChangeCallback
165 #define tcpIpStackInvokeLinkChangeCallback netInvokeLinkChangeCallback
166 
167 #define ChunkedBuffer NetBuffer
168 #define chunkedBufferGetLength netBufferGetLength
169 #define chunkedBufferRead netBufferRead
170 
171 #define ipv4IsInLocalSubnet ipv4IsOnLocalSubnet
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 ftpClientMakeDir
221 #define ftpRemoveDir ftpClientRemoveDir
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 #endif