Embedded TCP/IP stack  4.7.0
fnet_stack.h
1 /**************************************************************************
2 *
3 * Copyright 2008-2018 by Andrey Butok. FNET Community
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * Main including header for the FNET TCP/IP stack.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_STACK_H_
26 
27 #define _FNET_STACK_H_
28 
29 #include "fnet_assert.h"
30 #include "fnet_error.h"
31 #include "fnet_stdlib.h"
32 #include "fnet_socket.h"
33 #include "fnet_inet.h"
34 #include "fnet_ip4.h"
35 #include "fnet_ip6.h"
36 #include "fnet_netif.h"
37 #include "fnet_timer.h"
38 #include "fnet_debug.h"
39 #include "fnet_eth.h"
40 #include "fnet_wifi.h"
41 #include "fnet_isr.h"
42 #include "fnet_netbuf.h"
43 #include "fnet_arp.h"
44 #include "fnet_checksum.h"
45 
82 #if FNET_CFG_MULTITHREADING || defined(__DOXYGEN__)
83 
84 /**************************************************************************/
88 typedef void *fnet_mutex_t;
89 
90 /**************************************************************************/
95 typedef struct
96 {
97  fnet_return_t (*mutex_init)( fnet_mutex_t * );
98  void (*mutex_release)( fnet_mutex_t * );
99  void (*mutex_lock)( fnet_mutex_t * );
100  void (*mutex_unlock)( fnet_mutex_t * );
102 #endif /* FNET_CFG_MULTITHREADING */
103 
104 #if FNET_CFG_TIMER_ALT || defined(__DOXYGEN__)
105 
106 /**************************************************************************/
111 typedef struct
112 {
113  fnet_time_t (*timer_get_ms)(void);
114  void (*timer_delay)(fnet_time_t delay_ms);
116 #endif /* FNET_CFG_TIMER_ALT */
117 
118 /**************************************************************************/
123 {
124  void *netheap_ptr;
136 #if FNET_CFG_MULTITHREADING || defined(__DOXYGEN__)
138 #endif
139 #if FNET_CFG_TIMER_ALT || defined(__DOXYGEN__)
141 #endif
142 };
143 
144 #if defined(__cplusplus)
145 extern "C" {
146 #endif
147 
148 /***************************************************************************/
168 fnet_return_t fnet_init( struct fnet_init_params *init_params );
169 
170 /***************************************************************************/
182 void fnet_release(void);
183 
184 /***************************************************************************/
195 void fnet_poll(void);
196 
197 #if defined(__cplusplus)
198 }
199 #endif
200 
203 #endif /* _FNET_STACK_H_ */
204 
void fnet_poll(void)
General polling function.
Input parameters structure for fnet_init()
Definition: fnet_stack.h:122
fnet_uint32_t fnet_time_t
Unsigned integer type representing time uinits. It can be seconds or milliseconds.
Definition: fnet_timer.h:64
void fnet_release(void)
Releases the FNET TCP/IP stack.
void * netheap_ptr
Pointer to the FNET heap buffer. The FNET uses this heap buffer for the internal dynamic data alloc...
Definition: fnet_stack.h:124
fnet_return_t fnet_init(struct fnet_init_params *init_params)
Initializes the FNET TCP/IP stack.
fnet_return_t
General return codes, used by most of API functions.
Definition: fnet_stdlib.h:89
Recursive mutex API. It should be defined by application if FNET_CFG_MULTITHREADING is set...
Definition: fnet_stack.h:95
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:55
const fnet_timer_api_t * timer_api
Timer API. It is availble and must be set only when FNET_CFG_TIMER_ALT is 1.
Definition: fnet_stack.h:140
Timer API. It must be defined by application if FNET_CFG_TIMER_ALT is set.
Definition: fnet_stack.h:111
const fnet_mutex_api_t * mutex_api
Recursive mutex API. It is optional and availble only when FNET_CFG_MULTITHREADING is 1...
Definition: fnet_stack.h:137
fnet_size_t netheap_size
Size of the FNET heap buffer.
Definition: fnet_stack.h:135
void * fnet_mutex_t
Mutex type.
Definition: fnet_stack.h:88

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net