Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/doc/en/admintools.xml
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/doc/en/admintools.xml	(revision 39388)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/doc/en/admintools.xml	(working copy)
@@ -1597,7 +1597,7 @@
                 </field>
                 <field name="custom_content_format" type="string">
                     <verbose_name>Custom Content Format</verbose_name>
-                    <help_text>All characters except the following ones are displayed as their original forms:&lt;/br&gt; %t: Display the layer 4 protocol type. &lt;/br&gt; %s: Display the source IP address before translation. &lt;/br&gt; %p: Display the source port before translation. &lt;/br&gt; %d: Display the destination IP address before translation. &lt;/br&gt; %o: Display the destination port before translation. &lt;/br&gt; %S: Display the source IP address after translation. &lt;/br&gt; %P: Display the source port after translation. &lt;/br&gt; %D: Display the destination IP address after translation. &lt;/br&gt; %O: Display the destination port after translation. &lt;/br&gt; %a: Display &quot;SETUP&quot;, indicating the connections have been established between the client's IP address and the VIP and between the VIP and the real service's IP address. &lt;/br&gt; %%: Display the character &quot;%&quot;.</help_text>
+                    <help_text>All characters except the following ones are displayed as their original forms:&lt;/br&gt; %t: Display the layer 4 protocol type. &lt;/br&gt; %s: Display the source IP address before translation. &lt;/br&gt; %p: Display the source port before translation. &lt;/br&gt; %d: Display the destination IP address before translation. &lt;/br&gt; %o: Display the destination port before translation. &lt;/br&gt; %S: Display the source IP address after translation. &lt;/br&gt; %P: Display the source port after translation. &lt;/br&gt; %D: Display the destination IP address after translation. &lt;/br&gt; %O: Display the destination port after translation. &lt;/br&gt; %a: Display &quot;SETUP&quot;, indicating the connection have been established / completed. &quot;DROP&quot;, indicating the connection  has been disconnected / not completed. &lt;/br&gt; %%: Display the character &quot;%&quot;.</help_text>
                 </field>
             </fieldgrp>
             <fieldgrp name="rfc5424_logging_config">
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/docs/rest/apv/admintools/log_mgmt/logadvanced.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/docs/rest/apv/admintools/log_mgmt/logadvanced.html	(revision 39388)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/docs/rest/apv/admintools/log_mgmt/logadvanced.html	(working copy)
@@ -131,7 +131,7 @@
                                                 <td>slb_tran_logging_config</td>
                                                 <td>custom_content_format</td>
                                                 <td>string</td>
-                                                <td>All characters except the following ones are displayed as their original forms:</br> %t: Display the layer 4 protocol type. </br> %s: Display the source IP address before translation. </br> %p: Display the source port before translation. </br> %d: Display the destination IP address before translation. </br> %o: Display the destination port before translation. </br> %S: Display the source IP address after translation. </br> %P: Display the source port after translation. </br> %D: Display the destination IP address after translation. </br> %O: Display the destination port after translation. </br> %a: Display "SETUP", indicating the connections have been established between the client's IP address and the VIP and between the VIP and the real service's IP address. </br> %%: Display the character "%".</td>
+                                                <td>All characters except the following ones are displayed as their original forms:</br> %t: Display the layer 4 protocol type. </br> %s: Display the source IP address before translation. </br> %p: Display the source port before translation. </br> %d: Display the destination IP address before translation. </br> %o: Display the destination port before translation. </br> %S: Display the source IP address after translation. </br> %P: Display the source port after translation. </br> %D: Display the destination IP address after translation. </br> %O: Display the destination port after translation. </br> %a: Display "SETUP", indicating the connection have been established / completed. "DROP" indicating the connection  has been disconnected / not completed. </br> %%: Display the character "%".</td>
                                             </tr>
                                         
                                     
@@ -555,7 +555,7 @@
                                                 <td>slb_tran_logging_config</td>
                                                 <td>custom_content_format</td>
                                                 <td>string</td>
-                                                <td>All characters except the following ones are displayed as their original forms:</br> %t: Display the layer 4 protocol type. </br> %s: Display the source IP address before translation. </br> %p: Display the source port before translation. </br> %d: Display the destination IP address before translation. </br> %o: Display the destination port before translation. </br> %S: Display the source IP address after translation. </br> %P: Display the source port after translation. </br> %D: Display the destination IP address after translation. </br> %O: Display the destination port after translation. </br> %a: Display "SETUP", indicating the connections have been established between the client's IP address and the VIP and between the VIP and the real service's IP address. </br> %%: Display the character "%".</td>
+                                                <td>All characters except the following ones are displayed as their original forms:</br> %t: Display the layer 4 protocol type. </br> %s: Display the source IP address before translation. </br> %p: Display the source port before translation. </br> %d: Display the destination IP address before translation. </br> %o: Display the destination port before translation. </br> %S: Display the source IP address after translation. </br> %P: Display the source port after translation. </br> %D: Display the destination IP address after translation. </br> %O: Display the destination port after translation. </br> %a: Display "SETUP", indicating the connection have been established / completed. "DROP" indicating the connection  has been disconnected / not completed. </br> %%: Display the character "%".</td>
                                             </tr>
                                         
                                     
Index: /branches/rel_apv_10_7/usr/src/sys/click/app/fastlog/fastlog.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/app/fastlog/fastlog.c	(revision 39388)
+++ /branches/rel_apv_10_7/usr/src/sys/click/app/fastlog/fastlog.c	(working copy)
@@ -2992,7 +2992,7 @@
 	return 0;
 }
 
-static int fastlog_format_msg(int logid, void *pcb, void *target_pcb, int pcb_type, int isfasttcp)
+static int fastlog_format_msg(int logid, void *pcb, void *target_pcb, int pcb_type, int isfasttcp, int con_establish)
 {
 	int escape = 0;
 	int retlen = 0, totalen = MAX_PROTOCOL_TRANSLAT_LOG_LEN-1;
@@ -3062,8 +3062,10 @@
 				logbuf[retlen] = '\0';
 				break;
 			case 'a':
-				retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "SETUP");
-				
+                                if (con_establish)
+				    retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "SETUP");
+                                else
+				    retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "DROP");
 				break;
 			case 't':
 				retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", proto_str);
@@ -3196,7 +3198,7 @@
 	}
 }
 
-static int segment_fastlog_format_msg(int logid, uint32_t segment_id, void *pcb, void *target_pcb, int pcb_type, int isfasttcp)
+static int segment_fastlog_format_msg(int logid, uint32_t segment_id, void *pcb, void *target_pcb, int pcb_type, int isfasttcp, int con_establish)
 {
 	int escape = 0;
 	int retlen = 0, totalen = MAX_PROTOCOL_TRANSLAT_LOG_LEN-1;
@@ -3266,8 +3268,10 @@
 				logbuf[retlen] = '\0';
 				break;
 			case 'a':
-				retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "SETUP");
-				
+                                if (con_establish)
+				    retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "SETUP");
+                                else
+				    retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", "DROP");
 				break;
 			case 't':
 				retlen += snprintf(logbuf+retlen, totalen-retlen, "%s", proto_str);
@@ -3407,6 +3411,7 @@
 	struct clickpcb *ippcb, *target_ippcb;
 	slb_vs_t* vs_p, *vs_temp;
 	slb_protocol_e sp;
+	int con_establish = 1;
 	
 	if(pcb->cp_type == PCB_ICMP && target_pcb->cp_type == PCB_ICMP) {
 		ippcb = pcb;
@@ -3432,19 +3437,23 @@
 		return 1;
 	}
 
+        if (pcb->rexmt_count >= 5 || target_pcb->rexmt_count >= 5)
+            con_establish = 0; //connection dropped or not established
+        
+
 	if (IS_SEGMENT_ENABLE() && IS_SEGMENT_PCB(pcb)) {
-		return segment_fastlog_format_msg(logid, vs_p->segment_id, (void *)ippcb, (void *)target_ippcb, pcb_type, 0);
+		return segment_fastlog_format_msg(logid, vs_p->segment_id, (void *)ippcb, (void *)target_ippcb, pcb_type, 0, con_establish);
 	} else {
-		return fastlog_format_msg(logid, (void *)ippcb, (void *)target_ippcb, pcb_type, 0);	
+		return fastlog_format_msg(logid, (void *)ippcb, (void *)target_ippcb, pcb_type, 0, con_establish);	
 	}
 }
 
 int fastlog_fasttcp_setup_connection(int logid, void *fastpcb, void *target_fastpcb)
 {
 	if (segment_enable(fastpcb) && IS_SEGMENT_FASTPCB((fastpcb_t *)fastpcb)) {
-		return segment_fastlog_format_msg(logid, ((fastpcb_t *)fastpcb)->fp_segment_id, fastpcb, target_fastpcb, 0, 1);
+		return segment_fastlog_format_msg(logid, ((fastpcb_t *)fastpcb)->fp_segment_id, fastpcb, target_fastpcb, 0, 1, 1);
 	} else {
-		return fastlog_format_msg(logid, fastpcb, target_fastpcb, 0, 1);
+		return fastlog_format_msg(logid, fastpcb, target_fastpcb, 0, 1, 1);
 	}
 }
 
Index: /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c	(revision 39388)
+++ /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c	(working copy)
@@ -17077,6 +17077,9 @@
 	  2,In non-splice , only reset pcb(pcb)*/
 	if (reset_conn) {
 		if (del_splice_client_pcb) {
+                        if (tpcb)
+			    FASTLOG_SETUP_CONNECTION(CLICKTCP_SETUP_CONN_LOG, pcb, tpcb);
+
 			if(tpcb->cp_extflags & CLICKPCB_IPV6) { 
 				clicktcp6_send_reset(tpcb, tpcb->sendnextseq, (RST_APP_ID_TCP | RST_ID_6));
 			} else {
Index: /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_splice.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_splice.c	(revision 39388)
+++ /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_splice.c	(working copy)
@@ -1080,6 +1080,7 @@
 	sf_session_close(pcb);
 	pcb->cp_flags &= ~CLICKPCB_SPLICE_FLAGS;
 	target_pcb->cp_flags &= ~CLICKPCB_SPLICE_FLAGS;
+	FASTLOG_SETUP_CONNECTION(CLICKTCP_SETUP_CONN_LOG, pcb, tpcb);
 	clicktcp_abortive_close(target_pcb);
 	clicktcp_abortive_close(pcb);
 
