xref: /nrf52832-nimble/rt-thread/components/net/uip/apps/hello-world/hello-world.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /**
2  * \addtogroup apps
3  * @{
4  */
5 
6 /**
7  * \defgroup helloworld Hello, world
8  * @{
9  *
10  * A small example showing how to write applications with
11  * \ref psock "protosockets".
12  */
13 
14 /**
15  * \file
16  *         Header file for an example of how to write uIP applications
17  *         with protosockets.
18  * \author
19  *         Adam Dunkels <[email protected]>
20  */
21 
22 #ifndef __HELLO_WORLD_H__
23 #define __HELLO_WORLD_H__
24 
25 /* Since this file will be included by uip.h, we cannot include uip.h
26    here. But we might need to include uipopt.h if we need the u8_t and
27    u16_t datatypes. */
28 #include "uipopt.h"
29 
30 #include "psock.h"
31 
32 /* Next, we define the uip_tcp_appstate_t datatype. This is the state
33    of our application, and the memory required for this state is
34    allocated together with each TCP connection. One application state
35    for each TCP connection. */
36 #define BUF_SIZE 200
37 typedef struct hello_world_state {
38   struct psock p;
39   char inputbuffer[BUF_SIZE];
40   char name[BUF_SIZE];
41 } uip_tcp_appstate_t;
42 
43 /* Finally we define the application function to be called by uIP. */
44 void hello_world_appcall(void);
45 #ifndef UIP_APPCALL
46 #define UIP_APPCALL hello_world_appcall
47 #endif /* UIP_APPCALL */
48 
49 void hello_world_init(void);
50 
51 #endif /* __HELLO_WORLD_H__ */
52 /** @} */
53 /** @} */
54