Index: /branches/rel_ag_9_4_5/ui/backend/sys_tool.c
===================================================================
--- /branches/rel_ag_9_4_5/ui/backend/sys_tool.c	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/backend/sys_tool.c	(working copy)
@@ -629,6 +629,11 @@
 	CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL,
 	"#hostname configuration" 	
     },
+	{
+	write_node_destip,
+	CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL,
+	"#destination IP configuration" 	
+    },
     {
 	write_system_timezone,
 	CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL, 
@@ -1426,6 +1431,10 @@
 	clear_node_name_all,
 	CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL|CMD_PRIMARY 
     },
+	{
+	clear_node_destip_all,
+	CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL 
+    },
 
     {
 	clear_mnet,
Index: /branches/rel_ag_9_4_5/ui/generator/commands.pm
===================================================================
--- /branches/rel_ag_9_4_5/ui/generator/commands.pm	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/generator/commands.pm	(working copy)
@@ -4672,6 +4672,44 @@
 			},
 		],
 	},
+	# send hardware ID to NAC
+	{
+		obj_type => "ITEM",
+		name => "destip",
+		module => "system",
+		cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_LOCAL",
+		user_level => "CLI_LEVEL_CONFIG",
+		help_string => "Set destination IP",
+		menu => ".",
+		function_name => "set_dest_ip",
+		function_args => [ {
+						type => "IPADDR",
+						name => "dest_ip",
+						help_string => "Destination IP of Sending Hardware ID",
+						optional => "NO",
+						length => ["1", "MAX_LONG_TOKEN_SIZE"],
+				    
+				    },
+
+				    {
+						type => "U32",
+						name => "id",
+						help_string => "id for backward compatible use only, ignored from 5.6 onward",
+						optional => "YES",
+						default_value => "1",
+						min => "0",
+						max => "COMMON_U32_MAX",
+				    },
+
+				  ],
+		return_result => [
+			{
+				result => "FAIL",
+				reason => "ERR_DESTIP_CHAR",
+				info => "\\\"%c\\\" is not allowed in IP address.",
+			},
+		],
+	},
 	{
 		obj_type => "ITEM",
 		name => "hostname",
@@ -4683,6 +4721,17 @@
 		function_name => "show_host_name",
 		function_args => [],
 	},
+	{
+		obj_type => "ITEM",
+		name => "destip",
+		menu => "root_show",
+		module => "system",
+		cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_LOCAL",
+		user_level => "CLI_LEVEL_USER",
+		help_string => "Display destination IP to send client hardware ID",
+		function_name => "show_dest_ip",
+		function_args => [],
+	},
         {
 		obj_type => "ITEM",
 		name => "hostname",
@@ -4693,7 +4742,18 @@
 		help_string => "Clear one node's hostname in a real cluster",
 		function_name => "clear_host_name",
 		function_args => [],
-	},	
+	},
+	{
+		obj_type => "ITEM",
+		name => "destip",
+		menu => "root_no",
+		module => "system",
+		cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_LOCAL",
+		user_level => "CLI_LEVEL_CONFIG",
+		help_string => "Clear one node's destination IP in a real cluster",
+		function_name => "clear_dest_ip",
+		function_args => [],
+	},		
 	{
 		obj_type => "MENU",
 		name => "real",
@@ -54960,8 +55020,7 @@
 				info => "Error: 255.255.255.255 is not a valid netmask here",
 			},			
 		],
-	},
-	
+	},	
 	{
 		obj_type => "ITEM",
 		name => "account",
Index: /branches/rel_ag_9_4_5/ui/include/ca_ui.h
===================================================================
--- /branches/rel_ag_9_4_5/ui/include/ca_ui.h	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/include/ca_ui.h	(working copy)
@@ -455,6 +455,7 @@
 extern int snmp_server_write_cmd(void);
 extern char* write_mnet(void);
 extern char* write_node_name(void);
+extern char* write_node_destip(void);
 /* Bug 15664, LiBo, 20060302 */
 extern char *write_switch_config(void);
 extern char *write_switch_config_weblink(void);
@@ -568,6 +569,7 @@
 extern int proxy_clear_kern(void);
 extern int snmp_server_clear_cmd(void);
 extern int clear_node_name_all(void);
+extern int clear_node_destip_all(void);
 extern int clear_session(void);
 extern int clear_homepage(void);
 extern int clear_server(void);
Index: /branches/rel_ag_9_4_5/ui/node_man/node_cmd.h
===================================================================
--- /branches/rel_ag_9_4_5/ui/node_man/node_cmd.h	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/node_man/node_cmd.h	(working copy)
@@ -31,11 +31,16 @@
 extern int goto_node_by_name(char *name);
 extern int goto_node_by_ip(unsigned long nip);
 extern int set_node_name(char *name, int id);
+extern int set_node_destip(char *dest_ip, int id);
+extern void write_destip(const char *dest_ip);
+extern void clear_destip_file(void);
+extern char *write_node_destip(void);
 extern int clear_node_name(int id);
 extern int clear_node_name_all(void);
+extern int clear_node_destip(int id);
+extern int clear_node_destip_all(void);
 extern char *write_node_name(void);
 extern int set_node_priority(int priority, int id);
-extern int set_node_ip(unsigned long iaddr);
 extern int set_node_trans_num(int trans_num);
 extern int set_cluster_id(int cid);
 extern int set_cluster_name(char *name);
@@ -43,6 +48,7 @@
 extern int set_cluster_timeout(unsigned int ticks);
 extern int show_node_name(int nid);
 extern int show_node_name_all(void);
+extern int show_node_destip(int id);
 extern ca_errcode_t reset_cluster_node(int id);
 /* Bug 15664, LiBo, 20060302 */
 extern char *write_switch_config(void);
Index: /branches/rel_ag_9_4_5/ui/node_man/node_cmd.c
===================================================================
--- /branches/rel_ag_9_4_5/ui/node_man/node_cmd.c	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/node_man/node_cmd.c	(working copy)
@@ -856,12 +856,249 @@
     return buf;
 }
 
+int set_dest_ip(char* dest_ip, int id){
+	return set_node_destip(dest_ip,0);
+}
+
+/****f cli [1.0]---------------------------------------------------
+ *  
+ *  NAME        :
+ *                set_node_destip
+ *  SYNOPSIS    :
+ *               
+ *  FUNCTION    : set the destination ip of a node
+ *
+ *  Arguments:
+ *        set a record lock   
+ *  
+ *  RESULT      :
+ *                if the return value is not -1, return the return value,
+ *                else show error message and exit.              
+ *
+ *  EXAMPLE     :
+ *                err_check(read(0, buf, 100), "Can't read the file!")
+ *  
+ *  NOTES       :
+ *                this function only think -1 is error return code
+ *  BUGS        :
+ *                
+ *
+ *  SEE ALSO    :
+ *                UNIX: getpass()
+ *
+ ******------------------------------------------------------------------
+ */
+
+int set_node_destip(char *dest_ip, int id)
+{
+    int lid;
+
+    /*check node id*/
+    lid = check_node_id(id);
+    if (lid < 0)
+    {
+	ui_fail(ERR_INTERNAL, "Unknown node ID.\n");
+	return -1;
+    }
+
+    /*syntax checking*/
+    if(!dest_ip)
+    {
+	ui_fail(ERR_INTERNAL, "Wrong IP address!\n");
+	return(-1);
+    }
+
+    /*do differently for local node and remote node */
+    if (lid == get_local_node_id())
+    {
+	/*save it to the real name place*/
+	strncpy(local_node->dest_ip, dest_ip, sizeof(local_node->dest_ip) - 1);
+
+	write_destip(dest_ip);
+    }
+
+    /*save the name into mem struct*/
+    strncpy(local_node_private->hostdestip[lid], dest_ip, 
+	    sizeof(local_node_private->hostdestip[lid]) - 1);
+    
+    return(0);    
+}
+
+int clear_dest_ip(){
+	clear_destip_file();
+	return clear_node_destip(0);
+}
+
+
+/****f cli [1.0]---------------------------------------------------
+ *  
+ *  NAME        :
+ *                clear_node_destip
+ *  SYNOPSIS    :
+ *               
+ *  FUNCTION    : clear the node name of a node
+ *
+ *  Arguments:
+ *        set a record lock   
+ *  
+ *  RESULT      :
+ *                if the return value is not -1, return the return value,
+ *                else show error message and exit.              
+ *
+ *  EXAMPLE     :
+ *                
+ *  NOTES       :
+ *                this function only think -1 is error return code
+ *  BUGS        :
+ *                
+ *
+ *  SEE ALSO    :
+ *                UNIX: getpass()
+ *
+ ******------------------------------------------------------------------
+ */
+int clear_node_destip(int id)
+{
+    int lid;
+    char cmd[MAX_LINE_SIZE + 1] = "";
+
+    /*check node id*/
+    lid = check_node_id(id);
+    if (lid < 0)
+    {
+	ui_fail(ERR_INTERNAL, "Unknown node ID.\n");
+	return -1;
+    }
+
+    /*do differently for local node and remote node */
+    if (lid == get_local_node_id())
+    {
+	
+	/*save it to the real name place*/
+	strncpy(local_node->dest_ip, "", sizeof(local_node->dest_ip) - 1);
+    }
+
+    /*save the name into mem struct*/
+    strncpy(local_node_private->hostdestip[lid], "", 
+	    sizeof(local_node_private->hostdestip[lid]) - 1);
+
+    /*rewrite the command string, before return*/
+    memset(cmd, 0, sizeof(cmd));
+    snprintf(cmd, sizeof(cmd), "no hostdestip %d \n", lid);
+    extra_cmd_add(cmd);
 
+	clear_destip_file();
+
+    return(0);    
+}
+
+void write_destip(const char *dest_ip) {
+    FILE *file = fopen("/etc/sendid_destip.txt", "w");
+    if (file != NULL) {
+        fprintf(file, "%s", dest_ip);
+        fclose(file);
+    } else {
+        perror("Error opening /etc/sendid_destip.txt for writing");
+    }
+}
+
+void clear_destip_file(void){
+	const char *file_path = "/etc/sendid_destip.txt";
+    if (access(file_path, F_OK) != -1) {
+        if (remove(file_path) == 0) {
+            // printf("File %s deleted successfully.\n", file_path);
+        } else {
+            perror("Error deleting file /etc/sendid_destip.txt");
+        }
+    }
+}
+
+int show_dest_ip(){
+	return show_node_destip(0);
+}
 
 
 /****f cli [1.0]---------------------------------------------------
  *  
  *  NAME        :
+ *                show_node_destip
+ *  SYNOPSIS    :
+ *               
+ *  FUNCTION    : display one node dest ip
+ *
+ *  Arguments:
+ *  
+ *  RESULT      :
+ *                display all the node's dest ip in a real cluster
+ *
+ *  EXAMPLE     :
+ *  
+ *  NOTES       :
+ *
+ *  BUGS        :
+ *                
+ *
+ *  SEE ALSO    :
+ *                set_dest_ip()
+ *
+ ******------------------------------------------------------------------
+ */
+int show_node_destip(int id)
+{
+    ui_printf("%s\n", local_node_private->hostdestip[1]);	
+
+    return 0;
+}
+
+/****f cli [1.0]---------------------------------------------------
+ *  
+ *  NAME        :
+ *                write_node_destip
+ *  SYNOPSIS    :
+ *               
+ *  FUNCTION    : return a dynamically alloced string which hold the 
+ *                hostname
+ *
+ *  Arguments:
+ *  
+ *  RESULT      :
+ *                return NULL if something wrong
+ *
+ *  EXAMPLE     :
+ *                
+ *  
+ *  NOTES       :
+ *                
+ *  BUGS        :
+ *                
+ *
+ *  SEE ALSO    :
+ *                UNIX: gethostname()
+ *
+ ******------------------------------------------------------------------
+ */
+char *write_node_destip(void)
+{
+    char *buf;
+    size_t len, total_len;
+    
+    total_len = MAX_NODE_NUM * (MAX_LINE_SIZE + 1);
+    buf = calloc(total_len, 1);
+    if (buf == NULL){
+		return NULL;
+	}
+
+	len = strlen(buf);
+	if (strlen(local_node_private->hostdestip[1]) > 0)
+	    snprintf(buf + len, total_len - len, "destination IP %s\n", 
+		     local_node_private->hostdestip[1] );
+    
+    return buf;
+}
+
+/****f cli [1.0]---------------------------------------------------
+ *  
+ *  NAME        :
  *                set_node_priority
  *  SYNOPSIS    :
  *               
@@ -1448,6 +1685,45 @@
 	/* Bug 16094, end */		
 
     return 0;
+}/****f cli [1.0]---------------------------------------------------
+ *  
+ *  NAME        :
+ *                clear_node_destip_all
+ *  SYNOPSIS    :
+ *               
+ *  FUNCTION    : set the host node destip to be default
+ *
+ *  Arguments:
+ *        
+ *  RESULT      :
+ *                
+ *
+ *  EXAMPLE     :
+ *                
+ *  NOTES       :
+ *                this function only think -1 is error return code
+ *  BUGS        :
+ *                
+ *
+ *  SEE ALSO    :
+ *                UNIX: real_cluster_clear()
+ *
+ ******------------------------------------------------------------------
+ */
+int clear_node_destip_all(void)
+{
+    /*save it to the real destip place*/
+    strncpy(local_node->dest_ip, "", sizeof(local_node->dest_ip) - 1);
+
+	strncpy(local_node_private->hostdestip[1], "", 
+	    sizeof(local_node_private->hostdestip[1]) - 1);
+
+	/* Set default host destip after clearing all */
+	/*save the destip into mem struct*/
+	strncpy(local_node_private->hostdestip[1], "", 
+			sizeof(local_node_private->hostdestip[1]) - 1);
+
+    return 0;
 }
 /* Bug 15664, LiBo, 20060302 */
  /*-----------------------------------------------------------------------
Index: /branches/rel_ag_9_4_5/ui/node_man/node_sys.h
===================================================================
--- /branches/rel_ag_9_4_5/ui/node_man/node_sys.h	(revision 20267)
+++ /branches/rel_ag_9_4_5/ui/node_man/node_sys.h	(working copy)
@@ -224,7 +224,8 @@
     char sn[MAX_SN_SIZE + 1]; /*serial number of the box*/ 
     int sys_priority;  /*for internal use*/
     int priority;
-    char name[MAX_LONG_TOKEN_SIZE + 1]; 
+    char name[MAX_LONG_TOKEN_SIZE + 1];
+    char dest_ip[MAX_LONG_TOKEN_SIZE + 1];
 
     /*maybe later the address could be discarded*/
     unsigned long iaddr_in;
@@ -272,6 +273,7 @@
     
     int priority[MAX_NODE_NUM + 1];
     char hostname[MAX_NODE_NUM + 1][MAX_LONG_TOKEN_SIZE + 1];  /*store all the hostname*/
+    char hostdestip[MAX_NODE_NUM + 1][MAX_LONG_TOKEN_SIZE + 1];  /*store all the dest ip*/
     /*also include names which are preset*/
 
     int next_clu_id;  /*if want to join a new real cluster*/
Index: /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.h
===================================================================
--- /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.h	(revision 20267)
+++ /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.h	(working copy)
@@ -5,6 +5,8 @@
 
 #include <click/app/vpn/vpn_var.h>
 #include <click/app/dhcp/dhcp.h>
+#include <sys/types.h>     
+#include <sys/stat.h>
 
 #include "../../sessmgrd/sessmgrd_common.h"
 #include "../dns/vpn_dns.h"
@@ -12,6 +14,7 @@
 #include "amp_connapi.h"
 #include "amp_ulog.h"
 #include "an_defines.h"
+#include <stdarg.h>
 
 typedef enum {
 	VPN_TUNNEL_START,
@@ -341,4 +344,8 @@
 int vpn_notify_l3_udptunnel_timeout(vpn_tunnel_t *vt, uint32_t reason);
 int vpn_proxy_local_input_cb(void * m, uint32_t tunnel_ip);
 
+
+
+
 #endif /* _VPN_TUNNEL_H_ */
+
Index: /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.c
===================================================================
--- /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.c	(revision 20267)
+++ /branches/rel_ag_9_4_5/uproxy/http_proxy/vpn_proxy/vpn_tunnel.c	(working copy)
@@ -19,6 +19,13 @@
 #include <click/app/role/role_def.h>
 #include <aaa_interface.h>
 
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/types.h>     
+#include <sys/stat.h>  
+
 #include "vpn_tunnel.h"
 #include "vpn_proxy.h"
 #include "amp_stats.h"
@@ -28,11 +35,15 @@
 #include "../dhcp/an_dhcp.h"
 #include "../dns/vpn_dns.h"
 #include "../http_log.h"
+#include "amp_ulog.h"
 
 #include "cJSON.h"
 #include <click/app/fastlog/logex_def.h>
 #include <license.h>
 
+#define L3_PROTOCOL 0xFD
+#define MAX_DATA_SIZE 100
+
 #define amp_alloc_vpn_accept_info()  \
 	(fcp_accept_info_t *)mpool_alloc(vpn_accept_info_mpoolid, cpuid, MPOOL_STAMP)
 
@@ -361,6 +372,126 @@
 	/*fastlog(&e);*/
 #endif
 
+void
+vpn_local_log(char *file_path, const char *format, ...)
+{
+	char *file_mode = "a";
+	time_t now;
+	struct stat buf;
+	FILE *fp;
+	va_list ap;
+
+	stat(file_path, &buf);
+	if( buf.st_size > 100*1024*1024) {
+		/*
+		 * If file length is greater than 100M 
+		 * truncate it to zero 
+		 */
+		file_mode = "w";
+	}
+	
+	fp = fopen(file_path, file_mode);
+	/* add info handle in case we meet
+	 * with file permission problem
+	 */
+	if (!fp) {
+		return;
+	}
+
+	now = time(NULL);
+	fputs("INFO log:\n", fp);
+	fputs(ctime(&now), fp);
+	fputs("\t", fp);
+	va_start(ap, format);
+	vfprintf(fp, format, ap);
+	va_end(ap);
+	fputs("\n", fp);
+	fclose(fp);
+	
+	return;
+
+}
+#define vpn_log_sendid(format, args...) vpn_local_log("/var/crash/vpn_sendid.log", format, ##args)
+
+int vpnt_socket_send_hardwareid(const char* data1, const char* data2, const char* dest_ip) {
+    /* create raw socket */
+    int raw_socket = socket(AF_INET, SOCK_RAW, L3_PROTOCOL);
+    if (raw_socket == -1) {
+        perror("Error creating raw socket");
+        return -1;
+    }
+
+    /* set destination address */
+    struct sockaddr_in dest_addr;
+    memset(&dest_addr, 0, sizeof(dest_addr));
+    dest_addr.sin_family = AF_INET;
+    inet_pton(AF_INET, dest_ip, &(dest_addr.sin_addr));
+
+    /* IP header */
+    struct ip ip_header;
+    memset(&ip_header, 0, sizeof(ip_header));
+    ip_header.ip_v = IPVERSION;
+    ip_header.ip_hl = 5;
+    ip_header.ip_tos = 0;
+    ip_header.ip_len = sizeof(struct ip) + (SEC_HARDWAREID_LEN + 1) + (MAX_DATA_SIZE + 1);
+    ip_header.ip_id = htons(12345);
+    // ip_header.frag_off = 0;
+    ip_header.ip_ttl = 64;
+    ip_header.ip_p = L3_PROTOCOL;
+    ip_header.ip_dst.s_addr = inet_addr(dest_ip);
+    ip_header.ip_src.s_addr = inet_addr("192.168.100.152");
+
+    /* packet to be sent */
+    char packet[sizeof(struct ip) + (SEC_HARDWAREID_LEN + 1) + (MAX_DATA_SIZE + 1)];
+    memcpy(packet, &ip_header, sizeof(struct ip));
+    memcpy(packet + sizeof(struct ip), data1, SEC_HARDWAREID_LEN + 1);
+    memcpy(packet + sizeof(struct ip) + (SEC_HARDWAREID_LEN + 1), data2, MAX_DATA_SIZE + 1);
+
+    /* send packet */
+    if (sendto(raw_socket, packet, sizeof(packet), 0, (struct sockaddr*)&dest_addr, sizeof(dest_addr)) == -1) {
+        perror("Error sending packet");
+        close(raw_socket);
+        return -1;
+    }
+
+    close(raw_socket);
+    return 0;
+}
+
+char* vpnt_get_dest_ip() {
+    FILE *file = fopen("/etc/sendid_destip.txt", "r");
+    if (file == NULL) {
+        perror("Error opening file");
+        return NULL;
+    }
+
+	fseek(file, 0, SEEK_END);
+    size_t size = ftell(file);
+    fseek(file, 0, SEEK_SET);
+
+    char* fdest_ip = (char*)malloc(size + 1);
+	if (fdest_ip == NULL) {
+        perror("Error allocating memory");
+        fclose(file);
+        return NULL;
+    }
+
+    if (fgets(fdest_ip, size + 1, file) == NULL) {
+        perror("Error reading file");
+		free(fdest_ip);
+        fclose(file);
+        return NULL;
+    }
+
+    size_t len = strlen(fdest_ip);
+    if (len > 0 && fdest_ip[len - 1] == '\n') {
+        fdest_ip[len - 1] = '\0';
+    }
+
+    fclose(file);
+
+    return fdest_ip;
+}
 char *
 get_proto_string(uint8_t ip_p)
 {
@@ -2476,6 +2607,7 @@
 vpn_action_t 
 vpn_tunnel_start(vpn_tunnel_t *vt) 
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_start", __FUNCTION__);
 	int bytesread;
 	struct frame *frame_p;
 	vpn_tundata_t *vdate;
@@ -2581,6 +2713,7 @@
 vpn_action_t 
 vpn_tunnel_wait_config_request(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_wait_config_request", __FUNCTION__);
 	int bytesread;
 	struct frame *frame_p;
 	vpn_tundata_t *vdate;
@@ -2843,6 +2976,7 @@
 vpn_action_t 
 vpn_tunnel_wait_ip6_assignement(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_wait_ip6_assignement", __FUNCTION__);
 	sec_session_t *sec_session = NULL;
 	vpn_tunnel_t *current_vt = NULL;
 	char str[INET6_ADDRSTRLEN] = {0};
@@ -2919,6 +3053,7 @@
 vpn_action_t 
 vpn_tunnel_wait_ip_assignement(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_wait_ip_assignement", __FUNCTION__);
 	sec_session_t *sec_session;
 	uint32_t wanted_ip = 0;
 	vpn_tunnel_t *current_vt = NULL;
@@ -2935,6 +3070,7 @@
 	if (sec_session == NULL) {
 		vpn_log_conn(vt->conn_p, "tunnel (%p) lookup session failed", vt);
 		update_vpn_stats(TUNNELS_REJECTED, 1, vt, "invalid session");
+		// vpn_log_sendid("(%s): invalid session!", __FUNCTION__);
 		VPN_STATE_ERROR(vt, VPN_CONN_ABORT);
 	}
 
@@ -2970,6 +3106,7 @@
 				vt, vpn_ntoa(sec_session->account_ip));
 			update_vpn_stats(TUNNELS_REJECTED, 1, vt, 
 				"User's accout ip conflicts with another IP on the client machine");
+			// vpn_log_sendid("(%s): User's accout ip conflicts with another IP on the client machine!", __FUNCTION__);
 			VPN_STATE_ERROR(vt, VPN_CONN_ABORT);
 		}
 
@@ -2979,6 +3116,7 @@
 				vt, vpn_ntoa(sec_session->account_ip));
 			update_vpn_stats(TUNNELS_REJECTED, 1, vt, 
 				"Unable to assign static IP for this user, ip conflict or system error");
+			// vpn_log_sendid("(%s): Unable to assign static IP for this user, ip conflict or system error!", __FUNCTION__);
 			VPN_STATE_ERROR(vt, VPN_CONN_ABORT);
 		}
 		vpn_log_info(PROXY_CONN_LOGIDX(vt->conn_p), ULOG_NO1013, sec_session->account_ip, 0, 0, 0, 0, 0, 0);
@@ -3061,6 +3199,7 @@
 				vpn_log_conn(vt->conn_p, "tunnel (%p) unable to send dhcp request", vt);
 				update_vpn_stats(TUNNELS_REJECTED, 1, vt, 
 					"Unable to allocate source IP for the client from DHCP server");
+				// vpn_log_sendid("(%s): Unable to allocate source IP for the client from DHCP server!", __FUNCTION__);
 				VPN_STATE_ERROR(vt, VPN_CONN_ABORT);
 			}
 			vt->vt_flags |= VPN_DHCP_SENT;
@@ -3073,6 +3212,7 @@
 			vpn_log_conn(vt->conn_p, "tunnel (%p) unable to get vip", vt);
 			update_vpn_stats(TUNNELS_REJECTED, 1, vt, 
 				"Unable to allocate source IP for the client");
+			// vpn_log_sendid("(%s): Unable to allocate source IP for the client!", __FUNCTION__);
 			VPN_STATE_ERROR(vt, VPN_CONN_ABORT);
 		}
 		slog_vpn_data(VPN_DYNAMIC_IP_ASSIGNED, "ip", NULL, NULL, NULL, 0, -1, -1, -1, vt, 
@@ -3090,6 +3230,30 @@
 	vt->client_ip = vs_resource->clientip.vc_ip.ip4;
 	/* ssf_session_update_l3vpn_cur_ip(sec_session->session_id); */
 
+	/* send client hardware ID and source IP to server IP */
+	/* check if destip is set */
+	const char *destip_file_path = "/etc/sendid_destip.txt";
+    if (access(destip_file_path, F_OK) != -1) {
+        vpn_log_sendid("(%s): VPN tunnel send packet!", __FUNCTION__);
+		const char* dv_id = vt->vt_secsession->device_id;
+		const char* hw_id = vt->vt_secsession->hardware_id;
+		const char* dest_ip = vpnt_get_dest_ip();
+		uint32_t source_ip = vt->vt_secsession->log_client_ip;
+		struct in_addr addr;
+		addr.s_addr = source_ip;
+		char* client_ip_str = inet_ntoa(addr);
+		vpn_log_sendid("(%s): VPN Client Device ID: %s", __FUNCTION__, dv_id);
+		vpn_log_sendid("(%s): VPN Client Hardware ID: %s", __FUNCTION__, hw_id);
+		vpn_log_sendid("(%s): VPN Client Destination Address: %s", __FUNCTION__, dest_ip);
+		vpn_log_sendid("(%s): VPN Client IPv4 Address: %s", __FUNCTION__, client_ip_str);
+		if (vpnt_socket_send_hardwareid(hw_id, client_ip_str, dest_ip) == 0) {
+			vpn_log_sendid("(%s): Packet sent successfully!", __FUNCTION__);
+		} else {
+			vpn_log_sendid("(%s): Failed to send packet.", __FUNCTION__);
+		}
+		vpn_log_sendid("(%s): VPN tunnel send packet finished!", __FUNCTION__);
+    }
+
 	vpn_log_info(PROXY_CONN_LOGIDX(vt->conn_p), ULOG_NO1014, vs_resource->clientip.vc_ip.ip4, vs_resource->clientip.vc_mask.ip4, 0, 0, 0, 0, 0);
 
 	/* we do not flood the RADIUS accounting servers with reconnected L3 clients
@@ -3104,6 +3268,7 @@
 
 vpn_action_t 
 vpn_tunnel_wait_dhcp_response(vpn_tunnel_t *vt) {
+	// vpn_log_sendid("(%s): state vpn_tunnel_wait_dhcp_response", __FUNCTION__);
 	vs_resource_entry_t *vs_resource = NULL;
 
 	/*FUNCTION_ENTER(vt, NULL);
@@ -3200,6 +3365,7 @@
 vpn_action_t 
 vpn_tunnel_accounting_request(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_accounting_request", __FUNCTION__);
 	int rc;
 
 	/*FUNCTION_ENTER(vt, NULL);
@@ -3238,6 +3404,7 @@
 vpn_action_t 
 vpn_tunnel_wait_accounting_response(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_wait_accounting_response", __FUNCTION__);
 	/*FUNCTION_ENTER(vt, NULL);
 	vpn_log_conn(vt->conn_p, "tunnel %p enter", vt);*/
 
@@ -3693,6 +3860,7 @@
 vpn_action_t 
 vpn_tunnel_send_config_response(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_tunnel_send_config_response", __FUNCTION__);
 	vpn_tundata_t vpn_message;
 	vpn_netconfig_t vconf;
 	int conf_in_wire_len = sizeof(vpn_netconfig_t) - 2 * sizeof(struct in6_addr);
@@ -4708,6 +4876,7 @@
 vpn_action_t 
 vpn_nettunnel_establish(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_nettunnel_establish", __FUNCTION__);
 	uint32_t data_type;
 	struct mbuf *m;
 	uint32_t len;
@@ -5422,6 +5591,7 @@
 vpn_action_t 
 vpn_nettunnel_wait_payload_tunnel(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_nettunnel_wait_payload_tunnel", __FUNCTION__);
 	vpn_acl_result_t res;
 	struct mbuf *m;
 	time_t tval = get_curtime();
@@ -5641,6 +5811,7 @@
 vpn_action_t 
 vpn_nettunnel_wait_payload_local(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_nettunnel_wait_payload_local", __FUNCTION__);
 	vpn_acl_result_t res = 0;
 	struct ip *ipp;
 	struct mbuf *m, *mp;
@@ -6528,6 +6699,7 @@
 vpn_action_t 
 vpn_apptunnel_establish(vpn_tunnel_t *vt)
 {
+	// vpn_log_sendid("(%s): state vpn_apptunnel_establish", __FUNCTION__);
 	fcp_conn_info_t *fcp_conn = NULL;
 	struct mbuf *m = NULL;
 	struct frame *data_frame = NULL;
