[TCPIP] Rearrange LwIP glue code.

Reduce unnecessary stuff in LwIP itself.
This commit is contained in:
Victor Perevertkin 2023-01-31 03:07:51 +03:00
parent 1734f29721
commit a0a19c60d0
13 changed files with 35 additions and 59 deletions

View file

@ -33,11 +33,9 @@ add_library(tcpip MODULE
${CMAKE_CURRENT_BINARY_DIR}/tcpip.def)
target_include_directories(tcpip BEFORE
PRIVATE include
PRIVATE lwip/src/include
PRIVATE lwip/src/include/ipv4)
PRIVATE include)
target_link_libraries(tcpip ip lwip ${PSEH_LIB})
target_link_libraries(tcpip ip ${PSEH_LIB})
set_module_type(tcpip kernelmodedriver)
add_importlibs(tcpip ndis ntoskrnl hal)
add_pch(tcpip include/precomp.h SOURCE)

View file

@ -1,14 +1,13 @@
include_directories(
BEFORE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include
${REACTOS_SOURCE_DIR}/sdk/lib/drivers/lwip/src/include
${REACTOS_SOURCE_DIR}/sdk/lib/drivers/lwip/src/include/ipv4)
if(ARCH STREQUAL "i386")
add_asm_files(ip_asm network/i386/checksum.S)
endif()
list(APPEND SOURCE
lwip_glue/ip.c
lwip_glue/memory.c
lwip_glue/sys_arch.c
lwip_glue/tcp.c
network/address.c
network/arp.c
network/checksum.c
@ -30,11 +29,11 @@ list(APPEND SOURCE
transport/tcp/tcp.c
transport/udp/udp.c)
add_library(ip ${SOURCE} ${ip_asm})
add_library(ip OBJECT ${SOURCE} ${ip_asm})
target_link_libraries(ip lwip)
target_include_directories(ip BEFORE
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/lwip/src/include
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/lwip/src/include/ipv4)
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include)
add_pch(ip precomp.h SOURCE)

View file

@ -1,13 +1,11 @@
#include "lwip/sys.h"
#include "lwip/netif.h"
#include "lwip/tcpip.h"
#include "rosip.h"
#include <debug.h>
#include <lwip/netif.h>
#include <lwip/tcpip.h>
typedef struct netif* PNETIF;
void
sys_shutdown(void);
void
LibIPInsertPacket(void *ifarg,
const void *const data,

View file

@ -1,10 +1,10 @@
#ifndef _ROS_IP_H_
#define _ROS_IP_H_
#ifndef _LWIP_GLUE_H_
#define _LWIP_GLUE_H_
#include "lwip/tcp.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "tcpip.h"
#include <lwip/tcp.h>
#include <lwip/pbuf.h>
#include <lwip/ip_addr.h>
#include <tcpip.h>
#ifndef LWIP_TAG
#define LWIP_TAG 'PIwl'

View file

@ -1,7 +1,4 @@
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include <lwip/mem.h>
#ifndef LWIP_TAG
#define LWIP_TAG 'PIwl'

View file

@ -1,12 +1,7 @@
#include "lwip/sys.h"
#include "lwip/tcp.h"
#include "lwip/pbuf.h"
#include "lwip/err.h"
#include "rosip.h"
#include <debug.h>
#include <lwip/sys.h>
#include "lwip_glue.h"
static LIST_ENTRY ThreadListHead;
static KSPIN_LOCK ThreadListLock;

View file

@ -1,10 +1,7 @@
#include "lwip/sys.h"
#include "lwip/netif.h"
#include "lwip/tcpip.h"
#include "rosip.h"
#include <debug.h>
#include <lwip/tcpip.h>
#include "lwip_glue.h"
static const char * const tcp_state_str[] = {
"CLOSED",

View file

@ -20,5 +20,6 @@
#include <interface.h>
#include <ports.h>
#include <chew.h>
#include "lwip_glue/lwip_glue.h"
#endif /* _IP_PCH_ */

View file

@ -10,7 +10,7 @@
#include "precomp.h"
#include "rosip.h"
#include <lwip_glue/lwip_glue.h>
extern NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;

View file

@ -14,7 +14,7 @@
#include "lwip/tcp.h"
#include "lwip/api.h"
#include "rosip.h"
#include <lwip_glue/lwip_glue.h>
extern NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;

View file

@ -21,7 +21,7 @@ PORT_SET TCPPorts;
#include "lwip/init.h"
#include "lwip/arch.h"
#include "rosip.h"
#include <lwip_glue/lwip_glue.h>
NPAGED_LOOKASIDE_LIST TdiBucketLookasideList;

View file

@ -1,9 +1,5 @@
list(APPEND SOURCE
src/rosip.c
src/rostcp.c
src/rosmem.c
src/sys_arch.c
src/api/api_lib.c
src/api/api_msg.c
src/api/err.c
@ -49,10 +45,9 @@ list(APPEND SOURCE
add_library(lwip ${SOURCE})
target_include_directories(lwip BEFORE
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/include
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/lwip/src/include
PRIVATE ${REACTOS_SOURCE_DIR}/drivers/network/tcpip/lwip/src/include/ipv4)
target_include_directories(lwip
PUBLIC src/include
PUBLIC src/include/ipv4)
add_dependencies(lwip bugcodes xdk)
add_pch(lwip precomp.h SOURCE)

View file

@ -37,7 +37,3 @@ sys_arch_protect(sys_prot_t *lev);
void
sys_arch_unprotect(sys_prot_t lev);
void
sys_shutdown(void);