/* ********************************************************************************************************* * uC/TCP-IP V2 * The Embedded TCP/IP Suite * * (c) Copyright 2003-2010; Micrium, Inc.; Weston, FL * * All rights reserved. Protected by international copyright laws. * * uC/TCP-IP is provided in source form to registered licensees ONLY. It is * illegal to distribute this source code to any third party unless you receive * written permission by an authorized Micrium representative. Knowledge of * the source code may NOT be used to develop a similar product. * * Please help us continue to provide the Embedded community with the finest * software available. Your honesty is greatly appreciated. * * You can contact us at www.micrium.com. ********************************************************************************************************* */ /* ********************************************************************************************************* * * NETWORK TCP LAYER * (TRANSMISSION CONTROL PROTOCOL) * * Filename : net_tcp.h * Version : V2.10 * Programmer(s) : ITJ ********************************************************************************************************* * Note(s) : (1) Supports Transmission Control Protocol as described in RFC #793 with the following * restrictions/constraints : * * (a) TCP Security & Precedence NOT supported RFC # 793, Section 3.6 * * (b) TCP Urgent Data NOT supported RFC # 793, Section 3.7 * 'The Communication of * Urgent Information' * * (c) The following TCP options NOT supported : * * (1) Window Scale RFC #1072, Section 2 * RFC #1323, Section 2 * (2) Selective Acknowledgement (SACK) RFC #1072, Section 3 * RFC #2018 * RFC #2883 * (3) TCP Echo RFC #1072, Section 4 * (4) Timestamp RFC #1323, Section 3.2 * (5) Protection Against Wrapped Sequences (PAWS) RFC #1323, Section 4 * * (d) #### IP-Options-to-TCP-Connection RFC #1122, Section 4.2.3.8 * Handling NOT supported * * (e) #### ICMP-Error-Message-to-TCP-Connection RFC #1122, Section 4.2.3.9 * Handling NOT currently supported * * (2) TCP Layer assumes/requires Network Socket Layer (see 'net_sock.h MODULE Note #1a2'). ********************************************************************************************************* */ /*$PAGE*/ /* ********************************************************************************************************* * MODULE * * Note(s) : (1) TCP Layer module is NOT required for UDP-to-Application API configuration. * * See also 'net_cfg.h TRANSPORT LAYER CONFIGURATION' * & 'net_cfg.h USER DATAGRAM PROTOCOL LAYER CONFIGURATION'. * * See also 'net_tcp.h Note #2'. * * (2) The following TCP-module-present configuration value MUST be pre-#define'd in * 'net_cfg_net.h' PRIOR to all other network modules that require TCP Layer * configuration (see 'net_cfg_net.h TCP LAYER CONFIGURATION Note #2b') : * * NET_TCP_MODULE_PRESENT ********************************************************************************************************* */ #ifdef NET_TCP_MODULE_PRESENT /* See Note #2. */ /* ********************************************************************************************************* * EXTERNS ********************************************************************************************************* */ #if ((defined(NET_TCP_MODULE)) && \ (defined(NET_GLOBALS_EXT))) #define NET_TCP_EXT #else #define NET_TCP_EXT extern #endif /*$PAGE*/ /* ********************************************************************************************************* * DEFINES ********************************************************************************************************* */ /* ********************************************************************************************************* * TCP HEADER DEFINES * * Note(s) : (1) The following TCP value MUST be pre-#define'd in 'net_def.h' PRIOR to 'net_buf.h' so that * the Network Buffer Module can configure maximum buffer header size (see 'net_def.h TCP * LAYER DEFINES' & 'net_buf.h NETWORK BUFFER INDEX & SIZE DEFINES Note #1') : * * (a) NET_TCP_HDR_SIZE_MAX 60 (NET_TCP_HDR_LEN_MAX * * NET_TCP_HDR_LEN_WORD_SIZE) * * (2) Urgent pointer & data NOT supported (see 'net_tcp.h Note #1b'). ********************************************************************************************************* */ #define NET_TCP_HDR_LEN_MASK 0xF000u #define NET_TCP_HDR_LEN_SHIFT 12u #define NET_TCP_HDR_LEN_NONE 0u #define NET_TCP_HDR_LEN_MIN 5u #define NET_TCP_HDR_LEN_MAX 15u #define NET_TCP_HDR_LEN_WORD_SIZE CPU_WORD_SIZE_32 #define NET_TCP_HDR_SIZE_MIN (NET_TCP_HDR_LEN_MIN * NET_TCP_HDR_LEN_WORD_SIZE) #if 0 /* See Note #1a. */ #define NET_TCP_HDR_SIZE_MAX (NET_TCP_HDR_LEN_MAX * NET_TCP_HDR_LEN_WORD_SIZE) #endif #define NET_TCP_HDR_SIZE_TOT_MIN (NET_IP_HDR_SIZE_TOT_MIN + NET_TCP_HDR_SIZE_MIN) #define NET_TCP_HDR_SIZE_TOT_MAX (NET_IP_HDR_SIZE_TOT_MAX + NET_TCP_HDR_SIZE_MAX) #define NET_TCP_PSEUDO_HDR_SIZE 12u /* = sizeof(NET_TCP_PSEUDO_HDR) */ #define NET_TCP_PORT_NBR_RESERVED NET_PORT_NBR_RESERVED #define NET_TCP_PORT_NBR_NONE NET_TCP_PORT_NBR_RESERVED #define NET_TCP_HDR_URG_PTR_NONE 0x0000u /* See Note #2. */ /*$PAGE*/ /* ********************************************************************************************************* * TCP HEADER FLAG DEFINES * * Note(s) : (1) See 'TCP HEADER Note #2' for flag fields. * * (2) Urgent pointer & data NOT supported (see 'net_tcp.h Note #1b'). ********************************************************************************************************* */ #define NET_TCP_HDR_FLAG_MASK 0x0FFFu #define NET_TCP_HDR_FLAG_NONE DEF_BIT_NONE #define NET_TCP_HDR_FLAG_RESERVED 0x0FE0u /* MUST be '0'. */ #define NET_TCP_HDR_FLAG_URGENT DEF_BIT_05 /* See Note #2. */ #define NET_TCP_HDR_FLAG_ACK DEF_BIT_04 #define NET_TCP_HDR_FLAG_PUSH DEF_BIT_03 #define NET_TCP_HDR_FLAG_RESET DEF_BIT_02 #define NET_TCP_HDR_FLAG_SYNC DEF_BIT_01 #define NET_TCP_HDR_FLAG_FIN DEF_BIT_00 #define NET_TCP_HDR_FLAG_CLOSE NET_TCP_HDR_FLAG_FIN /* ********************************************************************************************************* * TCP FLAG DEFINES ********************************************************************************************************* */ /* ------------------ NET TCP FLAGS ------------------- */ #define NET_TCP_FLAG_NONE DEF_BIT_NONE #define NET_TCP_FLAG_USED DEF_BIT_00 /* TCP conn cur used; i.e. NOT in free TCP conn pool. */ /* ------------------ TCP TX FLAGS ------------------- */ /* TCP tx flags copied from TCP hdr flags. */ #define NET_TCP_FLAG_TX_FIN NET_TCP_HDR_FLAG_FIN #define NET_TCP_FLAG_TX_CLOSE NET_TCP_FLAG_TX_FIN #define NET_TCP_FLAG_TX_SYNC NET_TCP_HDR_FLAG_SYNC #define NET_TCP_FLAG_TX_RESET NET_TCP_HDR_FLAG_RESET #define NET_TCP_FLAG_TX_PUSH NET_TCP_HDR_FLAG_PUSH #define NET_TCP_FLAG_TX_ACK NET_TCP_HDR_FLAG_ACK #define NET_TCP_FLAG_TX_URGENT NET_TCP_HDR_FLAG_URGENT #define NET_TCP_FLAG_TX_BLOCK DEF_BIT_07 /* ------------------ TCP RX FLAGS ------------------- */ #define NET_TCP_FLAG_RX_DATA_PEEK DEF_BIT_08 #define NET_TCP_FLAG_RX_BLOCK DEF_BIT_15 /*$PAGE*/ /* ********************************************************************************************************* * TCP TYPE DEFINES * * Note(s) : (1) NET_TCP_TYPE_&&& #define values specifically chosen as ASCII representations of the TCP * types. Memory displays of TCP types will display with their chosen ASCII names. ********************************************************************************************************* */ /* ------------------ NET TCP TYPES ------------------- */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define NET_TCP_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x54435020u /* "TCP " in ASCII. */ #else #if (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32) #define NET_TCP_TYPE_NONE 0x454E4F4Eu /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x20504354u /* "TCP " in ASCII. */ #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16) #define NET_TCP_TYPE_NONE 0x4F4E454Eu /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x43542050u /* "TCP " in ASCII. */ #else /* Dflt CPU_WORD_SIZE_08. */ #define NET_TCP_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_TYPE_CONN 0x54435020u /* "TCP " in ASCII. */ #endif #endif /* ********************************************************************************************************* * TCP SEQUENCE NUMBER DEFINES * * Note(s) : (1) TCP initial transmit sequence number is incremented by a fixed value, preferably a large * prime value or a large value with multiple unique factors. * * (a) One reasonable TCP initial transmit sequence number increment value example : * * 65527 = 37 * 23 * 11 * 7 * * * #### NET_TCP_TX_SEQ_NBR_CTR_INC could be developer-configured in 'net_cfg.h'. * * See also 'NET_TCP_TX_GET_SEQ_NBR() Notes #1b2 & #1c2'. ********************************************************************************************************* */ #define NET_TCP_SEQ_NBR_NONE 0u #define NET_TCP_ACK_NBR_NONE NET_TCP_SEQ_NBR_NONE #define NET_TCP_TX_SEQ_NBR_CTR_INC 65527u /* See Note #1. */ #define NET_TCP_ACK_NBR_DUP_WIN_SIZE_SCALE 4 /*$PAGE*/ /* ********************************************************************************************************* * TCP DATA/TOTAL LENGTH DEFINES * * Note(s) : (1) (a) TCP total length #define's (NET_TCP_TOT_LEN) relate to the total size of a complete * TCP packet, including the packet's TCP header. Note that a complete TCP packet MAY * be fragmented in multiple Internet Protocol packets. * * (b) TCP data length #define's (NET_TCP_DATA_LEN) relate to the data size of a complete * TCP packet, equal to the total TCP packet length minus its TCP header size. Note * that a complete TCP packet MAY be fragmented in multiple Internet Protocol packets. ********************************************************************************************************* */ /* See Notes #1a & #1b. */ #define NET_TCP_DATA_LEN_MIN 0u #define NET_TCP_TOT_LEN_MIN (NET_TCP_HDR_SIZE_MIN + NET_TCP_DATA_LEN_MIN) #define NET_TCP_TOT_LEN_MAX (NET_IP_TOT_LEN_MAX - NET_IP_HDR_SIZE_MIN ) #define NET_TCP_DATA_LEN_MAX (NET_TCP_TOT_LEN_MAX - NET_TCP_HDR_SIZE_MIN) /*$PAGE*/ /* ********************************************************************************************************* * TCP SEGMENT SIZE DEFINES * * Note(s) : (1) (a) RFC # 879, Section 3 states that the TCP Maximum Segment Size "counts only * data octets in the segment, ... not the TCP header or the IP header". * * (b) RFC #1122, Section 4.2.2.6 requires that : * * (1) "The MSS value to be sent in an MSS option must be less than or equal to * * (A) MMS_R - 20 * * where MMS_R is the maximum size for a transport-layer message that can * be received." * * (2) "If an MSS option is not received at connection setup, TCP MUST assume a * default send MSS of 536 (576 - 40)." * * See also 'net_ip.h IP DATA/TOTAL LENGTH DEFINES Note #1'. ********************************************************************************************************* */ /* See Note #1. */ #define NET_TCP_MAX_SEG_SIZE_DFLT (NET_IP_MAX_DATAGRAM_SIZE_DFLT - NET_IP_HDR_SIZE_MIN - NET_TCP_HDR_SIZE_MIN) #define NET_TCP_MAX_SEG_SIZE_DFLT_RX NET_TCP_DATA_LEN_MAX /* See Note #1b1. */ #define NET_TCP_MAX_SEG_SIZE_DFLT_TX NET_TCP_MAX_SEG_SIZE_DFLT /* See Note #1b2. */ #define NET_TCP_MAX_SEG_SIZE_NONE 0u #define NET_TCP_MAX_SEG_SIZE_MIN NET_TCP_MAX_SEG_SIZE_DFLT #define NET_TCP_MAX_SEG_SIZE_MAX NET_TCP_DATA_LEN_MAX #define NET_TCP_SEG_LEN_MIN NET_TCP_DATA_LEN_MIN #define NET_TCP_SEG_LEN_MAX NET_TCP_DATA_LEN_MAX #define NET_TCP_SEG_LEN_SYNC 1u #define NET_TCP_SEG_LEN_FIN 1u #define NET_TCP_SEG_LEN_CLOSE NET_TCP_SEG_LEN_FIN #define NET_TCP_SEG_LEN_ACK 0u #define NET_TCP_SEG_LEN_RESET 0u #define NET_TCP_SEG_LEN_PROBE 0u #define NET_TCP_DATA_LEN_TX_SYNC 0u #define NET_TCP_DATA_LEN_TX_FIN 0u #define NET_TCP_DATA_LEN_TX_CLOSE NET_TCP_DATA_LEN_TX_FIN #define NET_TCP_DATA_LEN_TX_ACK 0u #define NET_TCP_DATA_LEN_TX_PROBE_NO_DATA 0u #define NET_TCP_DATA_LEN_TX_PROBE_DATA 1u #define NET_TCP_DATA_LEN_TX_RESET 0u #define NET_TCP_TX_PROBE_DATA 0x00u /* ********************************************************************************************************* * TCP WINDOW SIZE DEFINES * * Note(s) : (1) Although NO RFC specifies the absolute minimum TCP connection window size value allowed, * RFC #793, Section 3.7 'Data Communication : Managing the Window' states that for "the * window ... there is an assumption that this is related to the currently available data * buffer space available for this connection". ********************************************************************************************************* */ #define NET_TCP_WIN_SIZE_NONE 0u #define NET_TCP_WIN_SIZE_MIN NET_TCP_MAX_SEG_SIZE_MIN #define NET_TCP_WIN_SIZE_MAX DEF_INT_16U_MAX_VAL /*$PAGE*/ /* ********************************************************************************************************* * TCP HEADER OPTIONS DEFINES * * Note(s) : (1) See the following RFC's for TCP options summary : * * (a) RFC # 793, Section 3.1 'Header Format : Options' * (b) RFC #1122; Sections 4.2.2.5, 4.2.2.6 * * (2) TCP option types are encoded in the first octet for each TCP option as follows : * * -------- * | TYPE | * -------- * * The TCP option type value determines the TCP option format : * * (a) The following TCP option types are single-octet TCP options -- i.e. the option type * octet is the ONLY octet for the TCP option. * * (1) TYPE = 0 End of Options List * (2) TYPE = 1 No Operation * * * (b) All other TCP options MUST be multi-octet TCP options (see RFC #1122, Section 4.2.2.5) : * * ------------------------------ * | TYPE | LEN | TCP OPT | * ------------------------------ * * where * TYPE Indicates the specific TCP option type * LEN Indicates the total TCP option length, in octets, including * the option type & the option length octets * TCP OPT Additional TCP option octets, if any, that contain the remaining * TCP option information * * The following TCP option types are multi-octet TCP options where the option's second * octet specify the total TCP option length, in octets, including the option type & the * option length octets : * * (1) TYPE = 2 Maximum Segment Size See RFC # 793, Section 3.1 'Header Format : * Options : Maximum Segment Size'; * RFC #1122, Section 4.2.2.6; * RFC # 879, Section 3 * * (2) TYPE = 3 Window Scale See 'net_tcp.h Note #1c1' * (3) TYPE = 4 SACK Allowed See 'net_tcp.h Note #1c2' * (4) TYPE = 5 SACK Option See 'net_tcp.h Note #1c2' * (5) TYPE = 6 Echo Request See 'net_tcp.h Note #1c3' * (6) TYPE = 7 Echo Reply See 'net_tcp.h Note #1c3' * (7) TYPE = 8 Timestamp See 'net_tcp.h Note #1c4' * * (3) TCP header allows for a maximum option list length of 40 octets : * * NET_TCP_HDR_OPT_SIZE_MAX = NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN * * = 60 - 20 * * = 40 * * (4) 'NET_TCP_OPT_SIZE' MUST be pre-defined PRIOR to all definitions that require TCP option * size data type. ********************************************************************************************************* */ /*$PAGE*/ #define NET_TCP_HDR_OPT_END_LIST 0u #define NET_TCP_HDR_OPT_NOP 1u #define NET_TCP_HDR_OPT_MAX_SEG_SIZE 2u #define NET_TCP_HDR_OPT_WIN_SCALE 3u #define NET_TCP_HDR_OPT_SACK_PERMIT 4u #define NET_TCP_HDR_OPT_SACK 5u #define NET_TCP_HDR_OPT_ECHO_REQ 6u #define NET_TCP_HDR_OPT_ECHO_REPLY 7u #define NET_TCP_HDR_OPT_TS 8u #define NET_TCP_HDR_OPT_PAD NET_TCP_HDR_OPT_END_LIST #define NET_TCP_HDR_OPT_LEN_END_LIST 1u #define NET_TCP_HDR_OPT_LEN_NOP 1u #define NET_TCP_HDR_OPT_LEN_MAX_SEG_SIZE 4u #define NET_TCP_HDR_OPT_LEN_WIN_SCALE 3u #define NET_TCP_HDR_OPT_LEN_SACK_PERMIT 2u #define NET_TCP_HDR_OPT_LEN_ECHO_REQ 6u #define NET_TCP_HDR_OPT_LEN_ECHO_REPLY 6u #define NET_TCP_HDR_OPT_LEN_TS 10u #define NET_TCP_HDR_OPT_LEN_SACK_MIN 6u #define NET_TCP_HDR_OPT_LEN_SACK_MAX 38u #define NET_TCP_HDR_OPT_LEN_MIN 1u #define NET_TCP_HDR_OPT_LEN_MIN_LEN 2u #define NET_TCP_HDR_OPT_LEN_MAX 38u typedef CPU_INT32U NET_TCP_OPT_SIZE; /* TCP opt size data type (see Note #4). */ #define NET_TCP_HDR_OPT_SIZE_WORD (sizeof(NET_TCP_OPT_SIZE)) #define NET_TCP_HDR_OPT_SIZE_MAX (NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN) #define NET_TCP_HDR_OPT_NBR_MIN 0u #define NET_TCP_HDR_OPT_NBR_MAX (NET_TCP_HDR_OPT_SIZE_MAX / NET_TCP_HDR_OPT_SIZE_WORD) #define NET_TCP_HDR_OPT_IX NET_TCP_HDR_SIZE_MIN /*$PAGE*/ /* ********************************************************************************************************* * TCP OPTION CONFIGURATION TYPE DEFINES * * Note(s) : (1) NET_TCP_OPT_CFG_TYPE_&&& #define values specifically chosen as ASCII representations of * the TCP option configuration types. Memory displays of TCP option configuration buffers * will display the TCP option configuration TYPEs with their chosen ASCII names. ********************************************************************************************************* */ /* ---------------- TCP OPT CFG TYPES ----------------- */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define NET_TCP_OPT_CFG_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x4D535320u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x57494E20u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x53434B50u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x5341434Bu /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x45524551u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4543484Fu /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x54532020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #else #if (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32) #define NET_TCP_OPT_CFG_TYPE_NONE 0x454E4F4Eu /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x2053534Du /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x204E4957u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x504B4353u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x4B434153u /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x51455245u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4F484345u /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x20205354u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16) #define NET_TCP_OPT_CFG_TYPE_NONE 0x4F4E454Eu /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x534D2053u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x4957204Eu /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x4353504Bu /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x41534B43u /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x52455145u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x43454F48u /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x53542020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #else /* Dflt CPU_WORD_SIZE_08. */ #define NET_TCP_OPT_CFG_TYPE_NONE 0x4E4F4E45u /* "NONE" in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE 0x4D535320u /* "MSS " in ASCII. */ #define NET_TCP_OPT_CFG_TYPE_WIN_SCALE 0x57494E20u /* "WIN " in ASCII (see 'net_tcp.h Note #1c1'). */ #define NET_TCP_OPT_CFG_TYPE_SACK_PERMIT 0x53434B50u /* "SCKP" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_SACK 0x5341434Bu /* "SACK" in ASCII (see 'net_tcp.h Note #1c2'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REQ 0x45524551u /* "EREQ" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_ECHO_REPLY 0x4543484Fu /* "ECHO" in ASCII (see 'net_tcp.h Note #1c3'). */ #define NET_TCP_OPT_CFG_TYPE_TS 0x54532020u /* "TS " in ASCII (see 'net_tcp.h Note #1c4'). */ #endif #endif /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION TIMEOUT DEFINES * * Note(s) : (1) (a) (1) RFC #1122, Section 4.2.2.13 'DISCUSSION' states that "the graceful close algorithm * of TCP requires that the connection state remain defined on (at least) one end of * the connection, for a timeout period of 2xMSL ... During this period, the (remote * socket, local socket) pair that defines the connection is busy and cannot be reused". * * (2) The following sections reiterate that the TIME-WAIT state timeout scalar is two * maximum segment lifetimes (2 MSL) : * * (A) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : * Check Sequence Number : TIME-WAIT STATE' * (B) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : * Check FIN Bit : TIME-WAIT STATE' * * (b) (1) RFC #793, Section 3.3 'Sequence Numbers : Knowing When to Keep Quiet' states that * "the Maximum Segment Lifetime (MSL) is ... to be 2 minutes. This is an engineering * choice, and may be changed if experience indicates it is desirable to do so". * * (2) Microsoft Corporation's Windows XP defaults MSL to 15 seconds. ********************************************************************************************************* */ /* Max seg timeout (see Note #1b) : */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_MIN_SEC ( 0u ) /* ... min = 0 seconds */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_MAX_SEC ( 2u * DEF_TIME_NBR_SEC_PER_MIN) /* ... max = 2 minutes */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_DFLT_SEC ( 15u ) /* ... dflt = 15 seconds */ #define NET_TCP_CONN_TIMEOUT_MAX_SEG_SCALAR 2u /* ... scalar (see Note #1a). */ #define NET_TCP_CONN_TIMEOUT_CONN_DFLT_SEC (120u * DEF_TIME_NBR_SEC_PER_MIN) /* Dflt conn timeout = 120 minutes */ #define NET_TCP_CONN_TIMEOUT_USER_DFLT_SEC ( 30u * DEF_TIME_NBR_SEC_PER_MIN) /* Dflt user timeout = 30 minutes */ /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION STATES * * Note(s) : (1) See the following RFC's for TCP state machine summary : * * (a) RFC # 793; Sections 3.2, 3.4, 3.5, 3.9 * (b) RFC #1122; Sections 4.2.2.8, 4.2.2.10, 4.2.2.11, 4.2.2.13, 4.2.2.18, 4.2.2.20 * * (2) (a) #### Additional closing-data-available state used for closing connections to allow the * application layer to receive any remaining data. * * See also 'net_tcp.c NetTCP_RxPktConnHandlerFinWait1() Note #2f5A2', * 'net_tcp.c NetTCP_RxPktConnHandlerFinWait2() Note #2f5B', * 'net_tcp.c NetTCP_RxPktConnHandlerClosing() Note #2d2B2a1B', * & 'net_tcp.c NetTCP_RxPktConnHandlerLastAck() Note #2d2A1b'. ********************************************************************************************************* */ #define NET_TCP_CONN_STATE_NONE 0u #define NET_TCP_CONN_STATE_FREE 1u #define NET_TCP_CONN_STATE_CLOSED 10u #define NET_TCP_CONN_STATE_LISTEN 20u #define NET_TCP_CONN_STATE_SYNC_RXD 30u #define NET_TCP_CONN_STATE_SYNC_RXD_PASSIVE 31u #define NET_TCP_CONN_STATE_SYNC_RXD_ACTIVE 32u #define NET_TCP_CONN_STATE_SYNC_TXD 35u #define NET_TCP_CONN_STATE_CONN 40u #define NET_TCP_CONN_STATE_FIN_WAIT_1 50u #define NET_TCP_CONN_STATE_FIN_WAIT_2 51u #define NET_TCP_CONN_STATE_CLOSING 52u #define NET_TCP_CONN_STATE_TIME_WAIT 53u #define NET_TCP_CONN_STATE_CLOSE_WAIT 55u #define NET_TCP_CONN_STATE_LAST_ACK 56u #define NET_TCP_CONN_STATE_CLOSING_DATA_AVAIL 59u /* See Note #2a. */ /* ********************************************************************************************************* * TCP CONNECTION QUEUE STATES ********************************************************************************************************* */ #define NET_TCP_RX_Q_STATE_NONE 0u #define NET_TCP_RX_Q_STATE_CLOSED 100u #define NET_TCP_RX_Q_STATE_CLOSING 101u #define NET_TCP_RX_Q_STATE_SYNC 110u #define NET_TCP_RX_Q_STATE_CONN 111u #define NET_TCP_TX_Q_STATE_NONE 0u #define NET_TCP_TX_Q_STATE_CLOSED 200u #define NET_TCP_TX_Q_STATE_CLOSING 201u #define NET_TCP_TX_Q_STATE_SYNC 210u #define NET_TCP_TX_Q_STATE_CONN 211u #define NET_TCP_TX_Q_STATE_SUSPEND 215u #define NET_TCP_TX_Q_STATE_CLOSED_SUSPEND 220u #define NET_TCP_TX_Q_STATE_CLOSING_SUSPEND 221u /*$PAGE*/ /* ********************************************************************************************************* * TCP CONNECTION CODE DEFINES **************
上傳時間: 2015-11-22
上傳用戶:the same kong
This book is an entry-level text on the technology of telecommunications. It has been crafted with the newcomer in mind. The eighteen chapters of text have been prepared for high-school graduates who understand algebra, logarithms, and basic electrical prin- ciples such as Ohm’s law. However, many users require support in these areas so Appen- dices A and B review the essentials of electricity and mathematics through logarithms.
標(biāo)簽: Telecommunications Fundamentals 1st of ed
上傳時間: 2020-05-27
上傳用戶:shancjb
This book is an entry-level text on the technology of telecommunications. It has been crafted with the newcomer in mind. The twenty-one chapters of text have been prepared for high-school graduates who understand algebra, logarithms, and the basic principles of electricity such as Ohm’s law. However, it is appreciated that many readers require support in these areas. Appendices A and B review the essentials of electricity and mathematics up through logarithms. This material was placed in the appendices so as not to distract from the main theme, the technology of telecommunication systems. Another topic that many in the industry find difficult is the use of decibels and derived units. Appendix C provides the reader a basic understanding of decibels and their applications. The only mathematics necessary is an understanding of the powers of ten
標(biāo)簽: Telecommunications Fundamentals 2nd of ed
上傳時間: 2020-05-27
上傳用戶:shancjb
eeworm.com VIP專區(qū) 單片機(jī)源碼系列 48資源包含以下內(nèi)容:1. 基于AVR的PCB板雕刻機(jī)的設(shè)計.zip2. SBC2440-III單板機(jī).rar3. 基于8098單片機(jī)的SPWM變頻調(diào)速系統(tǒng).zip4. Keil C51庫函數(shù)參考.zip5. 基于云計算的MCU開發(fā).zip6. 基于單片機(jī)系統(tǒng)的(24,16)循環(huán)碼編碼、譯碼方案.zip7. C8051F020.pdf8. MiniSTM32開發(fā)板-定時器中斷實驗教程.zip9. 基于89C52的二極管特性測試器的設(shè)計.zip10. 基于HITAG讀寫芯片HTRC110的讀寫設(shè)備設(shè)計.zip11. Freescale MQX實時操作系統(tǒng)用戶手冊.zip12. 基于MSP430單片機(jī)的智能水位計設(shè)計.zip13. MAXX9257 MAX9258芯片可編程SerDes持續(xù)時間計算.pdf14. Freescale 系列單片機(jī)常用模塊與綜合系統(tǒng)設(shè)計.zip15. 基于AVR單片機(jī)的閉環(huán)控制系統(tǒng).zip16. MICROTUNE推出高性能、低成本、超小型接收器芯片.rar17. 實時單片機(jī)通訊網(wǎng)絡(luò)中的內(nèi)存管理.zip18. Mini2440啟動代碼詳解.zip19. 單片直接驅(qū)動數(shù)碼管的計數(shù)器程序.zip20. 利用Virtex-6控制器提升DDR SDRAM的效率.zip21. Star-Hspice特征與應(yīng)用.zip22. AVR單片機(jī)C語言實例書籍集合.zip23. 基于單片機(jī)和PSD的數(shù)制化電源.zip24. 基于PIC16F877A的混沌信號發(fā)生器的設(shè)計.zip25. 基于單片機(jī)的旋轉(zhuǎn)編碼器鑒相方法.zip26. CEPARK-AVR單片機(jī)教程LCD12232液晶顯示實驗.zip27. DS34S132(TDMoP)IC與其它TDMoP器件的互操作.pdf28. PIC單片機(jī)應(yīng)用常見問答.rar29. 基于AVR的SD卡數(shù)據(jù)導(dǎo)出接口設(shè)計.zip30. PICmicro中檔單片機(jī)系列參考手冊(中文資料).rar31. 常用PIC系列單片機(jī)速查表.rar32. 基于PIC18F1320微控制器的信號采集系統(tǒng).rar33. Microchip PIC系列單片機(jī)RS232通訊應(yīng)用.rar34. 基于MT8880的一鍵撥號電話系統(tǒng)設(shè)計.rar35. Atmel AT89C系列單片機(jī)電路板設(shè)計指南.rar36. 基于單片機(jī)的顏色自適應(yīng)識別電路.rar37. PIC單片機(jī)應(yīng)用資料_很好的PIC單片機(jī)學(xué)習(xí)資料.rar38. 基于瑞薩電子微控制器的溫度控制系統(tǒng)設(shè)計.rar39. 51單片機(jī)的靶機(jī)自動控制系統(tǒng).rar40. 基于MSP430F1611單片機(jī)的音頻信號分析儀設(shè)計.rar41. 基于MAX7219的LED數(shù)碼顯示驅(qū)動電路設(shè)計.rar42. ARM處理器的可定制MCU處理DSP算法.rar43. Broadcom推出全球第一個802.11n單芯片解決方案.rar44. 51單片機(jī)增量式PID控制算法.rar45. 基于PIC16C71的數(shù)字水溫配制閥的設(shè)計.rar46. libxml編譯教程.rar47. PROG430專業(yè)MSP430單片機(jī)編程器(USB)使用說明書.pdf48. 單片機(jī)開發(fā)高手之路.rar49. 單片機(jī)幾種軟件濾波程序示例.rar50. AVR常用庫函數(shù)介紹.rar51. 基于AT89S52單片機(jī)的計算器設(shè)計.rar52. 單片機(jī)C語言控制電機(jī)星三角自動起動.rar53. 實用單片機(jī)系統(tǒng)MS3.21程序分析.rar54. 單片機(jī)C語言中LCD菜單的方法實現(xiàn).rar55. PICkit單片機(jī)編程器用戶指南.rar56. 單片機(jī)C語言編程中多位乘法運(yùn)算問題探討.rar57. 單片機(jī)解碼紅外遙控器.rar58. 高性能、低價格、支持JTAG仿真的ATMEGA16單片機(jī).rar59. AVR單片機(jī)BASIC編程及開發(fā).rar60. 單片機(jī)輸出控制電路的制作.rar61. ARM7與MSP430單片機(jī)的區(qū)別.rar62. 基于單片機(jī)的數(shù)字化B超鍵盤設(shè)計.rar63. STC89C5X單片機(jī)“看門狗”原理、詳細(xì)說明和演示程序.rar64. PROTEUS 51單片機(jī)的電路仿真方法.rar65. 通用1553B總線的信息監(jiān)控系統(tǒng).rar66. UC/OS-II系統(tǒng)在C8051F120單片機(jī)上的移植過程.doc67. 單片機(jī)綜合設(shè)計原理下載.rar68. 單片機(jī)控制的鉛酸蓄電池充電電源.rar69. 單片機(jī)通信系統(tǒng)中CRC算法與硬件環(huán)境編程的實現(xiàn).rar70. ISP單片機(jī)實驗板學(xué)習(xí).rar71. 基于CH341A的USB串口通訊設(shè)計.rar72. 51單片機(jī)C語言實例淺析.rar73. 基于TLC1549的閥門開度儀設(shè)計.rar74. PIC單片機(jī)定時器模塊應(yīng)用.rar75. S7-300和M7-300可編程序控制器參考手冊.rar76. 51端口的結(jié)構(gòu)及工作原理.rar77. 反激式開關(guān)電源電子數(shù)據(jù)表格.rar78. 51單片機(jī)實現(xiàn)的RS485通訊程序.rar79. 搭建理想的手機(jī)芯片平臺.pdf80. 單片機(jī)雙工通信的校驗方式.rar81. PIC單片機(jī)的RS232通訊程序.rar82. AVR單片機(jī)與串行AD的SPI接口設(shè)計.rar83. Delphi串口通信編程教程.rar84. 凌陽單片機(jī)開發(fā)資料.rar85. 用多處理器系統(tǒng)級芯片解決手機(jī)的多媒體任務(wù)需求.pdf86. 鐵氧體PQ芯產(chǎn)品系列擴(kuò)展.pdf87. DK4.1P-多功能數(shù)字卡拉OK處理器.pdf88. 飛思卡爾MC9S08AW60 最小系統(tǒng)設(shè)計與實現(xiàn).rar89. 透過專利看微處理器的技術(shù)發(fā)展.pdf90. MC68HC08系列單片機(jī)原理與應(yīng)用.rar91. C8051F單片機(jī)介紹.pdf92. 基于單片機(jī)控制的智能微波信號源發(fā)生器.rar93. 新一代超低功耗16位單片機(jī)TI MSP430系列.pdf94. 基于單片機(jī)的存儲設(shè)備轉(zhuǎn)儲器.rar95. 芯片系統(tǒng)架構(gòu)技術(shù)及開發(fā)平臺研究之推動.pdf96. 基于C8051F020的自動測控LED節(jié)能照明系統(tǒng).rar97. 基于單片機(jī)的新型節(jié)能日光燈系統(tǒng)設(shè)計.rar98. 單片微機(jī)系統(tǒng)測控技術(shù)設(shè)計集合.rar99. 基于PIC16C73的電子束焊機(jī)電視監(jiān)視系統(tǒng).rar100. 電子工程師基本知識結(jié)構(gòu).rar
標(biāo)簽: 電子技術(shù)
上傳時間: 2013-07-21
上傳用戶:eeworm
VIP專區(qū)-嵌入式/單片機(jī)編程源碼精選合集系列(49)資源包含以下內(nèi)容:1. 凌陽非接觸式紅外測溫傳感器的C51源程序。.2. 液晶模塊LCD2X8C驅(qū)動程序.3. 含t h r e a d x,u c o s 的b s p.4. 液晶sed1335芯片.5. 8237可編程DMA控制器altera提供.6. xilinx嵌入式開發(fā)源碼.7. ZLG的LPC2220讀取SD卡的源代碼.8. 三星44b0 usbpid驅(qū)動程序.9. 三星44B0的一款BOOTLOADER.10. i2c_slave mode for pic.11. max7219驅(qū)動.12. max7219控制程序.13. 語音通用程序.14. adc通用程序.15. 通用語音資料.16. ATMEGA128....液晶顯示程序.17. 基于MSP430的單片機(jī)的TC35/MC35的無線通訊MODEM.18. Uc-Os ii的多任務(wù)操作系統(tǒng)全部原代碼(強(qiáng)烈推薦).19. nios開發(fā)ucos源碼.20. MinOS嵌入式操作系統(tǒng),C/C++源代碼!基于KeilC51編譯器..21. 基于51單片機(jī)的濾波程序.22. IIC讀寫程序.23. 無刷電機(jī)無位置傳感器dsp程序.24. c51液晶顯示程序,顯示模塊,可通用于基于HD44780內(nèi)控器的液晶顯示器..25. DP-51H下載仿真實驗儀提供80C51與接口實例.ZLG7290例程*.26. DP-51H下載仿真實驗儀提供80C51與接口實例.讀EEPROM并顯示例程*.27. 一個讀取PCI配置空間的TOOL (在DOS下OR WIN 98).28. AT89C52實時時鐘DS1302測試,帶Proteus文件.29. 用AT89C52演奏音樂.30. 這個是安防用的控制鍵盤C源程序,采用KEIL C51開發(fā).用于控制前端解碼器!.31. 這是一個用于視頻切換的控制程序,采用AT89C51芯片,KEIL 51開發(fā).32. 自己近期寫的一個串口通信的小程序.33. 這是基于藍(lán)海微芯LJD-SY-XA+單片機(jī)開發(fā)系統(tǒng)的遠(yuǎn)程無線監(jiān)控系統(tǒng)的DA及AD采集和數(shù)碼顯示的部分.34. 基于51內(nèi)核的單片機(jī)的ucos-ii操作系統(tǒng)的移植的源代碼.35. 此代碼是實現(xiàn)將lwip協(xié)議移植于51單片機(jī)的測試程序.36. DOS下采用中斷接收數(shù)據(jù)的串口通訊的例子,很難找到的好東西!.37. lpc2292的can總線的簡單收發(fā)程序 底層驅(qū)動程序都有.38. 數(shù)字密碼鎖設(shè)計的源代碼,喜歡的朋友就下載..39. 一個使用STGapiBuffer編程的例子.40. 好東西 AVR study.
標(biāo)簽: 機(jī)械制造 工藝 夾具 工業(yè)
上傳時間: 2013-04-15
上傳用戶:eeworm
VIP專區(qū)-嵌入式/單片機(jī)編程源碼精選合集系列(121)資源包含以下內(nèi)容:1. U盤對考的例子程序 U盤對考的例子程序.2. The book is organized around 55 specific guidelines, each of which describes a way to write better C.3. CC2430DB電路圖.4. tms320c6000 將用戶程序?qū)懭氲絝lash.5. 是法國NUM數(shù)控系統(tǒng)1006的PLC控制軟件。.6. 一本關(guān)于C8051F原理和應(yīng)用的書.7. 19264說明與顯示程序,對學(xué)習(xí)19264初學(xué)者很有用.8. 一個經(jīng)典的東東.9. SD卡的SD模式的讀寫驅(qū)動.10. LPC2142 LCD12232的顯示動畫例程.11. 一段菜單與界面的程序 效果很好 有圖片展示.12. 本驅(qū)動程序是24064液晶(肇慶金鵬產(chǎn)品 型號Ocmj4×15D)上使用 控制器為8822 MCU為89S52 效果很好??梢杂糜?822控制器上的液晶.13. blackfin533開發(fā)FFTC語言實現(xiàn).14. GUI設(shè)計.15. 梁祝樂曲演奏電路設(shè)計.16. USB網(wǎng)卡dm9601芯片的驅(qū)動程序.17. 實現(xiàn)51與計算機(jī)的通信測試 通過1602LCD顯示通信的數(shù)據(jù).18. 本科教育的實體實例.19. S3C44B0學(xué)習(xí)板原理圖.20. 液晶顯示模塊概述 一、液晶顯示模塊概述 RT19264D漢字圖形點(diǎn)陣液晶顯示模塊.21. 嵌入式硬件設(shè)計實用手冊.22. 射頻識別利用nrf 2401芯片實現(xiàn)收發(fā)功能.23. 基于DE2實驗板.24. bc7281b芯片在avr單片機(jī)上的應(yīng)用.25. I2C eprom 讀寫程序設(shè)計.26. ds1302的中文資料.27. FPGA的英文資料,介紹的比較詳細(xì)EPF10系列的.28. 基于數(shù)碼管的四位動態(tài)同步顯示.29. ATMEL169PV,開發(fā)詳細(xì)資料,其中包含源程序代碼.30. 高頻波形.31. TL431應(yīng)用.TL431,A、B集成電路是三端可編程并聯(lián)穩(wěn)壓二極管。.32. uart pci 等verilog hdl 代碼.33. HD300 Mp3播放器電路圖 CPU部分.34. 通過VERILOG HDL語言使用CPLD連接PS2鍵盤..35. dspic61010A串口通訊程序.36. PIC單片機(jī)的C語言編程.37. protel 設(shè)計電路的相關(guān)資料,暫時只有一部分,等我再傳.38. 采用異步方式傳送數(shù)據(jù).39. 一種好的統(tǒng)計參數(shù)估計方法.其中的原代碼為國外學(xué)者編寫.40. 這個源代碼是關(guān)于利用MODEM實現(xiàn)單片機(jī)與PC通信的程序.
標(biāo)簽: 光電檢測技術(shù)
上傳時間: 2013-07-05
上傳用戶:eeworm
從0開始移植UCOS II到野火STM32開發(fā)板教程
上傳時間: 2013-04-15
上傳用戶:eeworm
Allegro+Book+I 高清版
上傳時間: 2013-06-25
上傳用戶:eeworm
字模III Pro
上傳時間: 2013-06-21
上傳用戶:eeworm
uCOS 單片機(jī)C源代碼 uCOS-II-V280是當(dāng)前UCosII最新版本源代碼
上傳時間: 2013-05-26
上傳用戶:清風(fēng)徐來吧
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1