Lightweight IP (lwIP) is an open-source TCP/IP stack designed for embedded systems. LiteOS-M has adapted to lwIP and provides enhanced lwIP features. The lwIP code consists of the following:
- lwIP source code in the **third_party/lwip** directory: Only a few intrusive modifications have been made for enhanced features.
- Code for lwIP adaptation and enhancement in the **kernel/liteos_m/components/net/lwip-2.1** directory: The default lwIP configuration file is provided.
If you want to use the lwIP module, perform the following steps to complete adaptation:
1. Create a directory, for example, **lwip_adapter**, in the device directory to store its adaptation files.
2. Create the **include** directory in the **lwip_adapter** directory to store the adaptation header files.
3. Create the **lwip** directory in the **include** directory and then create the header file **lwipopts.h** in the **lwip** directory. The code is as follows. If the default configuration cannot meet service requirements, modify the configuration, for example, disable the DHCP function.
```
#ifndef _LWIP_ADAPTER_LWIPOPTS_H_
#define _LWIP_ADAPTER_LWIPOPTS_H_
#include_next "lwip/lwipopts.h"
#undef LWIP_DHCP
#define LWIP_DHCP 0 // Disable the DHCP function.
#endif /* _LWIP_ADAPTER_LWIPOPTS_H_ */
```
4. Copy **BUILD.gn** in the **kernel/liteos_m/components/net/lwip-2.1/porting** directory to the **lwip_adapter** directory and modify the file as follows: