📄 net_config.c
字号:
/*----------------------------------------------------------------------------
* R T L - T C P N E T
*----------------------------------------------------------------------------
* Name: NET_CONFIG.C
* Purpose: Configuration of RTL TcpNet by user.
* Rev.: $tnVer / $tnDate
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) $CopyR KEIL - An ARM Company. All rights reserved. $end
*---------------------------------------------------------------------------*/
#include <Net_Config.h>
/*----------------------------------------------------------------------------
* RTL User configuration part BEGIN
*---------------------------------------------------------------------------*/
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
//
// <h>TcpNet System Definitions
// ============================
//
// <s.15>LHOST_NAME: Local Host Name
// <i> This is the name under which embedded host can be
// <i> accessed in local area network.
// <i> Default: "mcb2100"
#define LHOST_NAME "mcb2300"
// <o>MEM_SIZE: Memory Pool size in bytes <1500-32000:4><#/4>
// <i> This is the size of a memory pool used to allocate memory
// <i> for the received and sending Ethernet packets. Increase
// <i> the size when more TCP and UDP sockets are used.
// <i> Default: 8000
#define MEM_SIZE 2048
// <o>TICK_INTERVAL: Tick Timer interval <10=> 10 ms <20=> 20 ms <25=> 25 ms
// <40=> 40 ms <50=> 50 ms <100=> 100 ms <200=> 200 ms
// <i> System Tick Timer interval for software timers
// <i> Default: 100 ms
#define TICK_INTERVAL 100
// </h>
// <e>Ethernet Network Interface
// =============================
// <i> Enable or disable Ethernet Network Interface
#define ETH_ENABLE 1
// <h>Local Ethernet Address
// =========================
//
// <o>MAC1: Address byte 1 <0x00-0xff>
// <i> Default: 0x00
#define _MAC1 0x1E
// <o>MAC2: Address byte 2 <0x00-0xff>
// <i> Default: 0x30
#define _MAC2 0x30
// <o>MAC3: Address byte 3 <0x00-0xff>
// <i> Default: 0x6C
#define _MAC3 0x6C
// <o>MAC4: Address byte 4 <0x00-0xff>
// <i> Default: 0x00
#define _MAC4 0xA2
// <o>MAC5: Address byte 5 <0x00-0xff>
// <i> Default: 0x00
#define _MAC5 0x45
// <o>MAC6: Address byte 6 <0x00-0xff>
// <i> Default: 0x01
#define _MAC6 0x5E
// </h>
// <h>Local IP Address
// ===================
//
// <o>IP1: Address byte 1 <0-255>
// <i> Default: 192
#define _IP1 192
// <o>IP2: Address byte 2 <0-255>
// <i> Default: 168
#define _IP2 168
// <o>IP3: Address byte 3 <0-255>
// <i> Default: 0
#define _IP3 0
// <o>IP4: Address byte 4 <0-255>
// <i> Default: 100
#define _IP4 100
// </h>
// <h>Default Gateway IP Address
// =============================
//
// <o>GW1: Address byte 1 <0-255>
// <i> Default: 192
#define _GW1 192
// <o>GW2: Address byte 2 <0-255>
// <i> Default: 168
#define _GW2 168
// <o>GW3: Address byte 3 <0-255>
// <i> Default: 0
#define _GW3 0
// <o>GW4: Address byte 4 <0-255>
// <i> Default: 254
#define _GW4 254
// </h>
// <h>Subnet mask
// ==============
//
// <o>MSK1: Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1 255
// <o>MSK2: Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2 255
// <o>MSK3: Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3 255
// <o>MSK4: Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4 0
// </h>
// <h>Primary DNS Server
// =====================
//
// <o>P_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1 194
// <o>P_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2 25
// <o>P_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3 2
// <o>P_DNS4: Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4 129
// </h>
// <h>Secondary DNS Server
// =======================
//
// <o>S_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1 194
// <o>S_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2 25
// <o>S_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3 2
// <o>S_DNS4: Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4 130
// </h>
// <h>ARP Definitions
// ==================
//
// <o>ARP_TABSIZE: ARP Cache Table size <5-100>
// <i> Number of cached hardware/IP addresses
// <i> Default: 10
#define ARP_TABSIZE 10
// <o>ARP_TIMEOUT: ARP Cache Timeout in seconds <5-255>
// <i> A timeout for a cached hardware/IP addresses
// <i> Default: 150
#define ARP_TIMEOUT 150
// <o>ARP_MAXRETRY: ARP Number of Retries <0-20>
// <i> Number of Retries to resolve an IP address
// <i> before ARP module gives up
// <i> Default: 4
#define ARP_MAXRETRY 4
// <o>ARP_RESEND: ARP Resend Timeout in seconds <1-10>
// <i> A timeout to resend the ARP Request
// <i> Default: 2
#define ARP_RESEND 2
// </h>
// <q>NBNS_ENABLE: Enable NetBIOS Name Service
// ===========================================
// <i> When this option is enabled, the embedded host can be
// <i> accessed by his name on the local LAN using NBNS protocol.
// <i> You need to modify also the number of UDP Sockets,
// <i> because NBNS protocol uses one UDP socket to run.
#define NBNS_ENABLE 1
// <q>DHCP_ENABLE: Enable Dynamic Host Configuration
// =================================================
// <i> When this option is enabled, local IP address, Net Mask
// <i> and Default Gateway are obtained automatically from
// <i> the DHCP Server on local LAN.
// <i> You need to modify also the number of UDP Sockets,
// <i> because DHCP protocol uses one UDP socket to run.
#define DHCP_ENABLE 1
// </e>
// <e>PPP Network Interface
// ========================
// <i> Enable or disable PPP Network Interface
#define PPP_ENABLE 0
// <h>Local IP Address
// ===================
//
// <o>IP1: Address byte 1 <0-255>
// <i> Default: 192
#define _IP1P 192
// <o>IP2: Address byte 2 <0-255>
// <i> Default: 168
#define _IP2P 168
// <o>IP3: Address byte 3 <0-255>
// <i> Default: 125
#define _IP3P 125
// <o>IP4: Address byte 4 <0-255>
// <i> Default: 1
#define _IP4P 1
// </h>
// <h>Subnet mask
// ==============
//
// <o>MSK1: Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1P 255
// <o>MSK2: Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2P 255
// <o>MSK3: Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3P 255
// <o>MSK4: Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4P 0
// </h>
// <h>Primary DNS Server
// =====================
//
// <o>P_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1P 194
// <o>P_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2P 25
// <o>P_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3P 2
// <o>P_DNS4: Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4P 129
// </h>
// <h>Secondary DNS Server
// =======================
//
// <o>S_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1P 194
// <o>S_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2P 25
// <o>S_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3P 2
// <o>S_DNS4: Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4P 130
// </h>
// <q>Obtain Client IP address automatically
// =========================================
// <i> This option only applies when PPP Dial-up is used to dial
// <i> to remote PPP Server. If checked, network connection
// <i> dynamically obtains an IP address from remote PPP Server.
#define PPP_GETIP 1
// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and PPP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define PPP_DEFGW 1
// <h>Async Control Character Map
// ==============================
//
// <o>ACCM1: Map char 31..24 mask <0x00-0xff>
// <i> Maps control characters from 31...24
// <i> Default: 0x00
#define _ACCM1 0x00
// <o>ACCM2: Map char 23..16 mask <0x00-0xff>
// <i> Maps control characters from 23...16
// <i> For XON/XOFF set this value to: 0x0A
// <i> Default: 0x00
#define _ACCM2 0x0A
// <o>ACCM3: Map char 15..8 mask <0x00-0xff>
// <i> Maps control characters from 15...8
// <i> Default: 0x00
#define _ACCM3 0x00
// <o>ACCM4: Map char 7..0 mask <0x00-0xff>
// <i> Maps control characters from 7...0
// <i> Default: 0x00
#define _ACCM4 0x00
// </h>
// <h>Retransmissions and Timeouts
// ===============================
//
// <o>LCP_MAXRETRY: LCP Number of Retries <0-20>
// <i> How many times Link Control Protocol will try to retransmit
// <i> data before giving up. Increase this value for links with
// <i> low baud rates or high latency.
// <i> Default: 2
#define LCP_MAXRETRY 2
// <o>LCP_RETRYTOUT: LCP Retry Timeout in seconds <1-10>
// <i> If no response received within this time frame,
// <i> LCP module will try to resend data again.
// <i> Default: 2
#define LCP_RETRYTOUT 2
// <o>PAP_MAXRETRY: PAP Number of Retries <0-20>
// <i> How many times Password Authentication Protocol will try to
// <i> retransmit data before giving up. Increase this value for links
// <i> with low baud rates or high latency.
// <i> Default: 3
#define PAP_MAXRETRY 3
// <o>PAP_RETRYTOUT: PAP Retry Timeout in seconds <1-10>
// <i> If no response received within this time frame,
// <i> PAP module will try to resend data again
// <i> Default: 3
#define PAP_RETRYTOUT 3
// <o>IPCP_MAXRETRY: IPCP Number of Retries <0-20>
// <i> How many times Internet Protocol Control Protocol will try
// <i> to retransmit data before giving up. Increase this value for
// <i> links with low baud rates or high latency.
// <i> Default: 3
#define IPCP_MAXRETRY 3
// <o>IPCP_RETRYTOUT: IPCP Retry Timeout in seconds <1-10>
// <i> If no response received within this time frame,
// <i> IPCP module will try to resend data again
// <i> Default: 2
#define IPCP_RETRYTOUT 2
// </h>
// </e>
// <e>SLIP Network Interface
// ========================
// <i> Enable or disable SLIP Network Interface
#define SLIP_ENABLE 0
// <h>Local IP Address
// ===================
//
// <o>IP1: Address byte 1 <0-255>
// <i> Default: 192
#define _IP1S 192
// <o>IP2: Address byte 2 <0-255>
// <i> Default: 168
#define _IP2S 168
// <o>IP3: Address byte 3 <0-255>
// <i> Default: 225
#define _IP3S 225
// <o>IP4: Address byte 4 <0-255>
// <i> Default: 1
#define _IP4S 1
// </h>
// <h>Subnet mask
// ==============
//
// <o>MSK1: Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1S 255
// <o>MSK2: Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2S 255
// <o>MSK3: Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3S 255
// <o>MSK4: Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4S 0
// </h>
// <h>Primary DNS Server
// =====================
//
// <o>P_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1S 194
// <o>P_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2S 25
// <o>P_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3S 2
// <o>P_DNS4: Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4S 129
// </h>
// <h>Secondary DNS Server
// =======================
//
// <o>S_DNS1: Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1S 194
// <o>S_DNS2: Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2S 25
// <o>S_DNS3: Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3S 2
// <o>S_DNS4: Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4S 130
// </h>
// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and SLIP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define SLIP_DEFGW 1
// </e>
// <e>UDP Sockets
// ==============
// <i> Enable or disable UDP Sockets
#define UDP_ENABLE 1
// <o>UDP_NUMSOCKS: Number of UDP Sockets <1-20>
// <i> Number of available UDP sockets
// <i> Default: 5
#define UDP_NUMSOCKS 2
// <o>UDP_LASTPORT: Highest port for autoselect <1-32767>
// <i> Highest port number for UDP port when the port is not provided
// <i> by the user but is automatically selected by the system.
// <i> Default: 1023
#define UDP_LASTPORT 1023
// </e>
// <e>TCP Sockets
// ==============
// <i> Enable or disable TCP Sockets
#define TCP_ENABLE 1
// <o>TCP_NUMSOCKS: Number of TCP Sockets <1-20>
// <i> Number of available TCP sockets
// <i> Default: 5
#define TCP_NUMSOCKS 7
// <o>TCP_LASTPORT: Highest port for autoselect <1-32767>
// <i> Highest port number for TCP port when the port is not provided
// <i> by the user but is automatically selected by the system.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -