11/*
2- * Copyright (c) 2006-2022, RT-Thread Development Team
2+ * File : wn_session.h
3+ * This file is part of RT-Thread RTOS
4+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
35 *
4- * SPDX-License-Identifier: Apache-2.0
6+ * This software is dual-licensed: you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License version 2 as
8+ * published by the Free Software Foundation. For the terms of this
9+ * license, see <http://www.gnu.org/licenses/>.
10+ *
11+ * You are free to use this software under the terms of the GNU General
12+ * Public License, but WITHOUT ANY WARRANTY; without even the implied
13+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+ * See the GNU General Public License for more details.
15+ *
16+ * Alternatively for commercial application, you can contact us
17+ * by email <business@rt-thread.com> for commercial license.
518 *
619 * Change Logs:
720 * Date Author Notes
1629
1730#ifdef RT_USING_SAL
1831#include <sys/socket.h>
19- #else
32+ #else
2033#include <lwip/sockets.h>
2134#endif
2235
2336#ifdef __cplusplus
2437extern "C" {
2538#endif
2639
27- #define WEBNET_SESSION_BUFSZ (4 * 1024)
40+ #define WEBNET_SESSION_BUFSZ (4 * 1024)
2841
2942/* close session */
30- #define WEBNET_EVENT_CLOSE (1 << 5)
43+ #define WEBNET_EVENT_CLOSE (1 << 5)
3144/* read session */
32- #define WEBNET_EVENT_READ (1 << 6)
45+ #define WEBNET_EVENT_READ (1 << 6)
3346/* write session */
34- #define WEBNET_EVENT_WRITE (1 << 7)
47+ #define WEBNET_EVENT_WRITE (1 << 7)
3548
3649
3750struct webnet_session_ops
@@ -42,11 +55,11 @@ struct webnet_session_ops
4255
4356enum webnet_session_phase
4457{
45- WEB_PHASE_METHOD = 0 , /* parse method */
46- WEB_PHASE_HEADER , /* handle web request header */
47- WEB_PHASE_QUERY , /* handle web query */
48- WEB_PHASE_RESPONSE , /* handle web response */
49- WEB_PHASE_CLOSE , /* to close session */
58+ WEB_PHASE_METHOD = 0 , /* parse method */
59+ WEB_PHASE_HEADER , /* handle web request header */
60+ WEB_PHASE_QUERY , /* handle web query */
61+ WEB_PHASE_RESPONSE , /* handle web response */
62+ WEB_PHASE_CLOSE , /* to close session */
5063};
5164
5265struct webnet_session
@@ -65,10 +78,10 @@ struct webnet_session
6578 rt_uint16_t buffer_offset ;
6679 rt_uint8_t buffer [WEBNET_SESSION_BUFSZ ];
6780
68- /* session phase */
69- rt_uint32_t session_phase ;
81+ /* session phase */
82+ rt_uint32_t session_phase ;
7083
71- rt_uint32_t session_event_mask ;
84+ rt_uint32_t session_event_mask ;
7285 const struct webnet_session_ops * session_ops ;
7386 rt_uint32_t user_data ;
7487};
0 commit comments