+ #if NOT_YET_COMPLETE\r
+\r
+ u16_t tcplen, len1 = 0, uiAccumulatedLen = 0, len_previous = 0, split_len;\r
+ int iSplitNo = 0;\r
+ extern int uip_low_level_output( unsigned char *pcBuf, int ilen );\r
+\r
+ if( xARP == pdTRUE )\r
+ {\r
+ if( BUF->proto == UIP_PROTO_TCP && uip_slen > 1 )\r
+ {\r
+ tcplen = uip_len - UIP_TCPIP_HLEN;\r
+\r
+ if( tcplen > UIP_TCP_MSS )\r
+ {\r
+ split_len = UIP_TCP_MSS;\r
+ }\r
+ else\r
+ {\r
+ split_len = tcplen / 2;\r
+ }\r
+\r
+ while( tcplen > 0 )\r
+ {\r
+ uiAccumulatedLen += len1;\r
+\r
+ if( tcplen > split_len )\r
+ {\r
+ len1 = split_len;\r
+ tcplen -= split_len;\r
+ }\r
+ else\r
+ {\r
+ len1 = tcplen;\r
+ tcplen = 0;\r
+ }\r
+\r
+ uip_len = len1 + UIP_TCPIP_HLEN;\r
+ BUF->len[0] = uip_len >> 8;\r
+ BUF->len[1] = uip_len & 0xff;\r
+ if( iSplitNo == 0 )\r
+ {\r
+ iSplitNo++;\r
+\r
+ /* Create the first packet. This is done by altering the length\r
+ field of the IP header and updating the checksums. */\r
+ }\r
+ else\r
+ {\r
+ /* Now, create the second packet. To do this, it is not enough to\r
+ just alter the length field, but we must also update the TCP\r
+ sequence number and point the uip_appdata to a new place in\r
+ memory. This place is determined by the length of the first\r
+ packet (len1). */\r
+\r
+ /* uip_appdata += len1;*/\r
+ memcpy( uip_appdata, ( u8_t * ) uip_appdata + uiAccumulatedLen, len1 );\r
+ uip_add32( BUF->seqno, len_previous );\r
+ BUF->seqno[0] = uip_acc32[0];\r
+ BUF->seqno[1] = uip_acc32[1];\r
+ BUF->seqno[2] = uip_acc32[2];\r
+ BUF->seqno[3] = uip_acc32[3];\r
+ }\r
+\r
+ /* Recalculate the TCP checksum. */\r
+ BUF->tcpchksum = 0;\r
+ BUF->tcpchksum = ~( uip_tcpchksum() );\r
+\r
+ /* Recalculate the IP checksum. */\r
+ BUF->ipchksum = 0;\r
+ BUF->ipchksum = ~( uip_ipchksum() );\r
+\r
+ /* Transmit the packet. */\r
+ uip_arp_out();\r
+ uip_low_level_output( uip_buf, uip_len );\r
+\r
+ len_previous = len1;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ uip_arp_out();\r
+ uip_low_level_output( uip_buf, uip_len );\r
+ }\r
+ }\r
+ else\r
+ {\r
+ uip_low_level_output( uip_buf, uip_len );\r
+ }\r
+\r
+ #endif\r
+ return 1;\r