📄 net_config.c
字号:
// <o>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 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 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 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 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 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>IP Address
// =============
// <i> Local Static IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1S 192
// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2S 168
// <o>Address byte 3 <0-255>
// <i> Default: 225
#define _IP3S 225
// <o>Address byte 4 <0-255>
// <i> Default: 1
#define _IP4S 1
// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1S 255
// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2S 255
// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3S 255
// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4S 0
// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1S 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2S 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3S 2
// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4S 129
// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1S 194
// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2S 25
// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3S 2
// <o>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>Number of UDP Sockets <1-20>
// <i> Number of available UDP sockets
// <i> Default: 5
#define UDP_NUMSOCKS 2
// <o>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>Number of TCP Sockets <1-20>
// <i> Number of available TCP sockets
// <i> Default: 5
#define TCP_NUMSOCKS 2
// <o>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.
// <i> Default: 1023
#define TCP_LASTPORT 1023
// <o>Number of Retries <0-20>
// <i> How many times TCP module will try to retransmit data
// <i> before giving up. Increase this value for high-latency
// <i> and low_throughput networks.
// <i> Default: 5
#define TCP_MAXRETRY 5
// <o>Retry Timeout in seconds <1-10>
// <i> If data frame not acknowledged within this time frame,
// <i> TCP module will try to resend data again
// <i> Default: 4
#define TCP_RETRYTOUT 4
// <o>Default Connect Timeout in seconds <1-600>
// <i> Default TCP Socket Keep Alive timeout. When it expires
// <i> with no TCP data frame send, TCP Connection is closed.
// <i> Default: 120
#define TCP_DEFTOUT 120
/* TCP fixed timeouts */
#define TCP_INIT_RETRY_TOUT 1 /* TCP initial Retransmit period in sec. */
#define TCP_SYN_RETRY_TOUT 2 /* TCP SYN frame retransmit period in sec. */
#define TCP_CONRETRY 7 /* Number of retries to establish a conn. */
// </e>
// <e>HTTP Server
// ==============
// <i> Enable or disable HTTP Server
#define HTTP_ENABLE 0
// <o>Number of HTTP Sessions <1-10>
// <i> Number of simultaneously active HTTP Sessions.
// <i> Modify also the number of TCP Sockets because
// <i> each HTTP session uses it's own TCP socket
// <i> Default: 3
#define HTTP_NUMSESS 5
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 80
#define HTTP_PORTNUM 80
// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before accessing
// <i> any page on this Embedded WEB server.
#define HTTP_ENAUTH 1
// <s.20>Authentication Realm string
// <i> Default: "Embedded WEB Server"
#define HTTP_AUTHREALM "Embedded WEB Server"
// <s.15>Authentication Username
// <i> Default: "admin"
#define HTTP_AUTHUSER "admin"
// <s.15>Authentication Password
// <i> Default: ""
#define HTTP_AUTHPASSW ""
// </e>
// </e>
// <e>Telnet Server
// ================
// <i> Enable or disable Telnet Server
#define TNET_ENABLE 0
// <o>Number of Telnet Connections <1-10>
// <i> Number of simultaneously active Telnet Connections.
// <i> Modify also the number of TCP Sockets because
// <i> each Telnet connection uses it's own TCP socket
// <i> Default: 1
#define TNET_NUMSESS 2
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 23
#define TNET_PORTNUM 23
// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define TNET_ENAUTH 1
// <s.15>Authentication Username
// <i> Default: "admin"
#define TNET_AUTHUSER "admin"
// <s.15>Authentication Password
// <i> Default: ""
#define TNET_AUTHPASSW ""
// </e>
// </e>
// <e>TFTP Server
// ==============
// <i> Enable or disable TFTP Server
#define TFTP_ENABLE 0
// <o>Number of TFTP Sessions <1-10>
// <i> Number of simultaneously active TFTP Sessions
// <i> All TFTP Sessions use the same UDP socket listening
// <i> on defalut TFTP Server port 69.
// <i> Default: 1
#define TFTP_NUMSESS 1
// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 69
#define TFTP_PORTNUM 69
// <o>Inactive Session Timeout in seconds <5-120>
// <i> When timeout expires TFTP Session is closed. This timeout
// <i> is used when the UDP connection is broken because of error.
// <i> Default: 15
#define TFTP_DEFTOUT 15
// <o>Number of Retries <1-10>
// <i> How many times TFTP Server will try to retransmit data
// <i> before giving up.
// <i> Default: 4
#define TFTP_MAXRETRY 4
// </e>
// <e>DNS Client
// =============
// <i> Enable or disable DNS Client
#define DNS_ENABLE 0
// <o>Cache Table size <5-100>
// <i> Number of cached DNS host names/IP addresses
// <i> Default: 20
#define DNS_TABSIZE 20
// </e>
// <e>SMTP Client
// ==============
// <i> Enable or disable SMTP Client
#define SMTP_ENABLE 0
// <o>Response Timeout in seconds <5-120>
// <i> This is a time for SMTP Client to wait for a response from
// <i> SMTP Server. If timeout expires, Client aborts operation.
// <i> Default: 20
#define SMTP_DEFTOUT 20
// </e>
//------------- <<< end of configuration section >>> -----------------------
/*----------------------------------------------------------------------------
* RTL User configuration part END
*---------------------------------------------------------------------------*/
#define TICK_RATE 1000 / TICK_INTERVAL
#if (SLIP_ENABLE | PPP_ENABLE | ETH_ENABLE) == 0
#error all network interfaces disabled in configuration
#endif
#if (SLIP_ENABLE & PPP_ENABLE) == 1
#error both SLIP and PPP interfaces enabled
#endif
/*----------------------------------------------------------------------------
* Global Variables
*---------------------------------------------------------------------------*/
/* Own and Broadcast Ethernet address */
#if ETH_ENABLE == 1
U8 own_hw_adr[ETH_ADRLEN] = { _MAC1, _MAC2, _MAC3, _MAC4, _MAC5, _MAC6 };
U8 const MAC_Broadcast[ETH_ADRLEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
#endif
/* Broadcast IP address */
U8 const IP_Broadcast[IP_ADRLEN] = { 255, 255, 255, 255 };
/* Local Machine info */
LOCALM const nlocalm[3] = {
/* Ethernet: Local IP address */
#if ETH_ENABLE == 1
{ { _IP1, _IP2, _IP3, _IP4 },
/* Default Gateway IP address */
{ _GW1, _GW2, _GW3, _GW4 },
/* Subnet IP Mask */
{ _MSK1, _MSK2, _MSK3, _MSK4 },
/* Primary DNS Server IP */
{ _pDNS1, _pDNS2, _pDNS3, _pDNS4 },
/* Secondary DNS Server IP */
{ _sDNS1, _sDNS2, _sDNS3, _sDNS4 }
},
#else
{ { 0,0,0,0 }, { 0,0,0,0 }, { 0,0,0,0 }, { 0,0,0,0 }, { 0,0,0,0 } },
#endif
/* PPP: Local IP address */
#if PPP_ENABLE == 1
{ { _IP1P, _IP2P, _IP3P, _IP4P },
/* Default Gateway IP address */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -