⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net_cfg_net.h

📁 ucos的tcpip协议占
💻 H
📖 第 1 页 / 共 2 页
字号:
#if     (NET_SOCK_CFG_FAMILY             == NET_SOCK_FAMILY_IP_V4)

#define  NET_SOCK_CFG_ADDR_LEN              NET_SOCK_ADDR_LEN_IP_V4

#if     (NET_CFG_TRANSPORT_LAYER_SEL     == NET_TRANSPORT_LAYER_SEL_UDP)
#define  NET_SOCK_CFG_PROTOCOL_MAX          NET_SOCK_PROTOCOL_MAX_IP_V4_UDP

#elif   (NET_CFG_TRANSPORT_LAYER_SEL     == NET_TRANSPORT_LAYER_SEL_UDP_TCP)
#define  NET_SOCK_CFG_PROTOCOL_MAX          NET_SOCK_PROTOCOL_MAX_IP_V4_UDP_TCP

#endif

#endif



#ifdef   NET_SOCK_CFG_TYPE_STREAM_EN
#undef   NET_SOCK_CFG_TYPE_STREAM_EN
#endif

#define  NET_SOCK_CFG_TYPE_STREAM_EN        NET_CFG_TRANSPORT_TYPE_STREAM_EN


#endif


/*$PAGE*/
/*
*********************************************************************************************************
*                                     BSD 4.x LAYER CONFIGURATION
*
* Note(s) : (1) The following pre-processor directives correctly configure BSD 4.x layer parameters.
*               DO NOT MODIFY.
*
*           (2) (a) BSD 4.x Layer required only for some application configurations (see 'net_bsd.h
*                   MODULE  Note #1').
*
*               (b) Ideally, the BSD 4.x Layer would configure the network protocol suite for the 
*                   inclusion of the BSD 4.x Layer via the NET_BSD_MODULE_PRESENT #define (see 
*                   'net_bsd.h  MODULE  Note #2').  However, the presence of the BSD 4.x Layer 
*                   MUST be configured PRIOR to all other network modules that require BSD 4.x
*                   Layer Configuration.
*********************************************************************************************************
*/

                                                                /* ------------ CFG BSD MODULE INCLUSION -------------- */
#if    ((NET_BSD_CFG_API_EN == DEF_ENABLED) || \
        (defined(NET_SOCK_MODULE_PRESENT)))

#define  NET_BSD_MODULE_PRESENT                                 /* See Note #2.                                         */

#endif


/*$PAGE*/
/*
*********************************************************************************************************
*                               NETWORK BUFFER MANAGEMENT CONFIGURATION
*
* Note(s) : (1) The following pre-processor directives correctly configure network buffer module parameters.
*               DO NOT MODIFY.
*
*           (2) (a) NET_BUF_DATA_PROTOCOL_HDR_SIZE_MAX's ideal #define'tion :
*
*                       (A) IF Hdr  +  max(Protocol Headers)
*
*               (b) NET_BUF_DATA_PROTOCOL_HDR_SIZE_MAX  #define'd with hard-coded knowledge that IF, IP &
*                   TCP headers have the largest combined maximum size of all the protocol headers :
*
*                             IP Hdr   60     ARP Hdr   68      IP Hdr   60      IP Hdr   60
*                           ICMP Hdr    0                      UDP Hdr    8     TCP Hdr   60
*                           -------------     ------------     ------------     ------------
*                           Total      60     Total     68     Total     68     Total    120
*
*               See also 'net_buf.h  NETWORK BUFFER INDEX & SIZE DEFINES  Note #1'.
*********************************************************************************************************
*/

                                                                /* -------- CFG BUF DATA PROTOCOL HDR SIZE MAX -------- */
#ifdef   NET_TCP_MODULE_PRESENT

#define  NET_BUF_DATA_PROTOCOL_HDR_SIZE_MAX             (NET_IF_HDR_SIZE_MAX + \
                                                         NET_IP_HDR_SIZE_MAX + \
                                                         NET_TCP_HDR_SIZE_MAX)

#else

#define  NET_BUF_DATA_PROTOCOL_HDR_SIZE_MAX             (NET_IF_HDR_SIZE_MAX + \
                                                         NET_IP_HDR_SIZE_MAX + \
                                                         NET_UDP_HDR_SIZE_MAX)

#endif


/*$PAGE*/
/*
*********************************************************************************************************
*                             NETWORK CONNECTION MANAGEMENT CONFIGURATION
*
* Note(s) : (1) The following pre-processor directives correctly configure network connection module 
*               parameters.  DO NOT MODIFY.
*
*           (2) (a) Connection Management Module required only for some application configurations
*                   (see 'net_conn.h  MODULE  Note #1').
*
*               (b) Ideally, the Connection Management Module would configure the network protocol suite 
*                   for the inclusion of the Connection Management Module via the NET_CONN_MODULE_PRESENT
*                   #define (see 'net_conn.h  MODULE  Note #2').  However, the presence of the Connection
*                   Management Module MUST be configured PRIOR to all other network modules that require
*                   Connection Management Module Configuration.
*
*           (3) Connection Management family configuration values MUST be #define'd based on Connection
*               Management Family type configured in 'net_cfg.h'.
*
*           (4) If the socket &/or TCP modules are mutually included (see 'net_sock.h  MODULE  Note #1' &
*               'net_tcp.h  MODULE  Note #1'), then the configured number of connections MUST be greater
*               than the configured number of sockets PLUS the configured number of TCP connections.
*********************************************************************************************************
*/

                                                                /* ------------ CFG CONN MODULE INCLUSION ------------- */
#if    ((defined(NET_TCP_MODULE_PRESENT )) || \
        (defined(NET_SOCK_MODULE_PRESENT)))

#define  NET_CONN_MODULE_PRESENT                                /* See Note #2.                                         */


                                                                /* ----------------- CFG CONN PARAMS ------------------ */
#ifdef   NET_CONN_CFG_ADDR_LEN
#undef   NET_CONN_CFG_ADDR_LEN
#endif

#ifdef   NET_CONN_CFG_PROTOCOL_MAX
#undef   NET_CONN_CFG_PROTOCOL_MAX
#endif
                                                                /* See Note #3.                                         */
#if     (NET_CONN_CFG_FAMILY             == NET_CONN_FAMILY_IP_V4_SOCK)
#define  NET_CONN_CFG_ADDR_LEN              NET_SOCK_CFG_ADDR_LEN
#define  NET_CONN_CFG_PROTOCOL_MAX          NET_SOCK_CFG_PROTOCOL_MAX
#endif


#endif


/*$PAGE*/
/*
*********************************************************************************************************
*                                  NETWORK CONNECTION CONFIGURATION
*
* Note(s) : (1) The following pre-processor directives correctly configure network communication 
*               parameters.  DO NOT MODIFY.
*
*           (2) To balance network receive versus transmit packet loads for certain network connection
*               types (e.g. stream-type connections), network receive & transmit packets SHOULD be 
*               handled in an APPROXIMATELY balanced ratio.
*
*               See also 'net.h  NETWORK RECEIVE PACKET MACRO'S  Note #1'.
*********************************************************************************************************
*/

                                                                /* See Note 2.                                          */
#ifdef   NET_CFG_LOAD_BAL_EN
#undef   NET_CFG_LOAD_BAL_EN
#endif

#define  NET_CFG_LOAD_BAL_EN                NET_CFG_TRANSPORT_TYPE_STREAM_EN


/*$PAGE*/
/*
*********************************************************************************************************
*                                        CONFIGURATION ERRORS
*********************************************************************************************************
*/

#ifdef   NET_IF_PKT_MODULE_PRESENT

#ifndef  NET_NIC_CFG_TX_PKT_PREPARE_EN
#error  "NET_NIC_CFG_TX_PKT_PREPARE_EN        not #define'd in 'net_cfg.h'"
#error  "                               [MUST be  DEF_DISABLED]           "
#error  "                               [     ||  DEF_ENABLED ]           "
#elif  ((NET_NIC_CFG_TX_PKT_PREPARE_EN != DEF_DISABLED) && \
        (NET_NIC_CFG_TX_PKT_PREPARE_EN != DEF_ENABLED ))
#error  "NET_NIC_CFG_TX_PKT_PREPARE_EN  illegally #define'd in 'net_cfg.h'"
#error  "                               [MUST be  DEF_DISABLED]           "
#error  "                               [     ||  DEF_ENABLED ]           "
#endif

#endif




#ifndef  NET_CFG_TRANSPORT_LAYER_SEL
#error  "NET_CFG_TRANSPORT_LAYER_SEL          not #define'd in 'net_cfg.h'        "
#error  "                               [MUST be  NET_TRANSPORT_LAYER_SEL_UDP    ]"
#error  "                               [     ||  NET_TRANSPORT_LAYER_SEL_UDP_TCP]"
#elif  ((NET_CFG_TRANSPORT_LAYER_SEL != NET_TRANSPORT_LAYER_SEL_UDP    ) && \
        (NET_CFG_TRANSPORT_LAYER_SEL != NET_TRANSPORT_LAYER_SEL_UDP_TCP))
#error  "NET_CFG_TRANSPORT_LAYER_SEL    illegally #define'd in 'net_cfg.h'        "
#error  "                               [MUST be  NET_TRANSPORT_LAYER_SEL_UDP    ]"
#error  "                               [     ||  NET_TRANSPORT_LAYER_SEL_UDP_TCP]"
#endif



                                                        /* See 'NETWORK CONNECTION MANAGEMENT CONFIGURATION  Note #4'.  */
#ifdef   NET_CONN_MODULE_PRESENT

#ifdef   NET_TCP_MODULE_PRESENT

#if     (NET_CONN_CFG_NBR_CONN < (NET_SOCK_CFG_NBR_SOCK \
                               +  NET_TCP_CFG_NBR_CONN ))
#error  "NET_CONN_CFG_NBR_CONN          illegally #define'd in 'net_cfg.h'   "
#error  "                               [MUST be  >= (NET_SOCK_CFG_NBR_SOCK ]"
#error  "                               [         +   NET_TCP_CFG_NBR_CONN )]"
#endif

#else

#if     (NET_CONN_CFG_NBR_CONN <  NET_SOCK_CFG_NBR_SOCK)
#error  "NET_CONN_CFG_NBR_CONN          illegally #define'd in 'net_cfg.h' "
#error  "                               [MUST be  >= NET_SOCK_CFG_NBR_SOCK]"
#endif

#endif

#endif




#ifndef  NET_BSD_CFG_API_EN
#error  "NET_BSD_CFG_API_EN                   not #define'd in 'net_cfg.h'"
#error  "                               [MUST be  DEF_DISABLED]           "
#error  "                               [     ||  DEF_ENABLED ]           "
#elif  ((NET_BSD_CFG_API_EN != DEF_DISABLED) && \
        (NET_BSD_CFG_API_EN != DEF_ENABLED ))
#error  "NET_BSD_CFG_API_EN             illegally #define'd in 'net_cfg.h'"
#error  "                               [MUST be  DEF_DISABLED]           "
#error  "                               [     ||  DEF_ENABLED ]           "
#endif
	 	 			 		    	 				 	    	 	 	 		    	     	 	 	 		 	  	  	  	     	 	      	   		 	 	 	   		   			 	     			  			 		   	 			       	  	 		  	 	  	 		 		   		  	  			 	  	 		 	 	 			 	 		 		 	 		 	   		 	 	 	   		     			  			 		  	 		 	  			 	 	 	 	  		  	   		   	   	 				 		 			 			  			 		   		 		 				 		 	    		   	  		 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -