Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp/snmp_cadmin.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp/snmp_cadmin.c	(revision 39561)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp/snmp_cadmin.c	(working copy)
@@ -158,7 +158,6 @@
 int is_ippermit_exist(int isipv6, void *address);
 
 int show_snmp_host_helper(char *buff, int length);
-int show_snmp_host_engineid_helper(char *buff, int length);
 int show_snmp_host_auth_helper(char *buff, int length);
 static int snmp_update_snmpd_conf(snmp_info_t *pInfo);
 static int convert_lower_characters_to_upper(char *protocol_str);
@@ -1197,43 +1196,6 @@
 	return idx;
 }
 int
-show_snmp_host_engineid_helper(char *buff, int length)
-{
-	int i, idx = 0;
-	snmp_info_t *pInfo = snmp_server_attach();
-
-	if (buff == NULL || pInfo == NULL) {
-		return 0;
-	}
-	buff[0] = '\0';
-
-	for (i = 0; i < CA_SNMP_MAX_HOST; i++) {
-		if (pInfo->host[i].ipstr[0] != '\0') {
-			idx += snprintf(buff + idx, length - idx, "snmp engineid %s", pInfo->host[i].ipstr);
-			if (idx >= length) {
-				break;
-			}
-
-			if (pInfo->host[i].snmp_version != 3) {
-					idx += snprintf(buff + idx, length - idx, " \"\"");
-			} else {
-				idx += snprintf(buff + idx, length - idx, " \"%s\" ",
-						pInfo->host[i].auth_eng_id);
-				if (idx >= length) {
-					break;
-				}
-                        }
-			idx += snprintf(buff + idx, length - idx, "\n");
-			if (idx >= length) {
-				break;
-			}
-
-		}
-	}
-
-	return idx;
-}
-int
 show_snmp_host_auth_helper(char *buff, int length)
 {
 	int i, idx = 0;
@@ -1254,7 +1216,8 @@
 			if (pInfo->host[i].snmp_version != 3) {
 					idx += snprintf(buff + idx, length - idx, " \"\" \"\" \"\" \"\"");
 			} else {
-				idx += snprintf(buff + idx, length - idx, " \"%s\" ",
+				idx += snprintf(buff + idx, length - idx, " \"%s\" \"%s\" ",
+						pInfo->host[i].auth_eng_id,
 						pInfo->host[i].authPassword);
 				if (idx >= length) {
 					break;
@@ -1790,6 +1753,8 @@
 		snmp_server_unlock();
 		return CA_ERR_SNMP_INVAL;
 	}
+	uint16_t port = 162;
+	pInfo->host[i].port = port;
 	strlcpy(pInfo->host[i].ipstr, ipstr, IPADDR_STR_LEN);
 	pInfo->host[i].isipv6 = isipv6;
 	pInfo->host[i].snmp_version = trap_version;
@@ -1812,7 +1777,6 @@
 		char *priv_password = "\"\"";
 		char auth_protocol[PASSWORD_MAXLEN + 1] = {0};
 		char priv_protocol[PASSWORD_MAXLEN + 1] = {0};
-		uint16_t port = 162;
 
 		strncpy(auth_protocol, "", ENCRYPTSTR_LEN);
 		strncpy(priv_protocol, "", ENCRYPTSTR_LEN);
@@ -1820,85 +1784,17 @@
 		kern_snmp_add_trap_host(ipstr, trap_version, comm_user, g_engine_id, auth_password,
 				security_flag, priv_password, port, auth_protocol, priv_protocol);
 	} else {
-		printf("please run \"snmp engineid\" and \"snmp auth\" for trap version 3 to be functional");
-	}
-
-	snmp_server_unlock();
-
-	return CA_SNMP_OK;
-}
-
-
-int
-snmp_server_host_engine_id(char * ipstr,
-		char * engine_id
-		)
-{
-	int i;
-	int idx;
-	char * p_str;
-	int engine_id_len = strlen(engine_id);
-	snmp_info_t *pInfo = snmp_server_attach();
-
-	if (pInfo == NULL) {
-		return CA_ERR_SNMP_SHM_ATT;
-	}
-	if (snmp_server_lock(pInfo)) {
-		return (CA_ERR_SNMP_SHM_LOCK);
-	}
-	for (idx = 0; idx < CA_SNMP_MAX_HOST; idx++) {
-		if (strcmp(pInfo->host[idx].ipstr, ipstr) == 0) {
-			break;
-		}
-	}
-
-	/* not find, return */
-	if (idx >= CA_SNMP_MAX_HOST) {
-		printf("snmp host missing. Please run \"snmp host\" command first\n");
-		snmp_server_unlock();
-		return CA_ERR_SNMP_INVAL;
-	}
-
-	if ((pInfo->host[idx].snmp_version == 3) && (engine_id_len & 1)) {
-		printf("the length of authoritative engine id for SNMPv3 can't be odd number\n");
-		snmp_server_unlock();
-		return CA_ERR_SNMP_INVAL;
-	}
-	if (pInfo->host[idx].snmp_version == 3) {
-		if (engine_id_len < 1) {
-			printf("engine id should not be empty!\n");
-			snmp_server_unlock();
-			return CA_ERR_SNMP_INVAL;
-		}
-
-		if (engine_id_len > ENGINE_ID_MAX_LEN) {
-			printf("Invalid engine id length, the max length is %d\n", ENGINE_ID_MAX_LEN);
-			snmp_server_unlock();
-			return CA_ERR_SNMP_INVAL;
-		}
-		p_str = engine_id;
-		for (i = 0; i < engine_id_len; i++) {
-			if (!isxdigit(p_str[i]) && p_str[i] != 'x' && p_str[i] != 'X') {
-				printf("engine id must be one hex number\n");
-				snmp_server_unlock();
-				return CA_ERR_SNMP_INVAL;
-			}
-		}
-	}
-	if (pInfo->host[idx].snmp_version == 3) {
-		strlcpy(pInfo->host[idx].auth_eng_id, engine_id, ENGINE_ID_MAX_LEN + 1);
+		printf("please run \"snmp auth\" for trap version 3 to be functional");
 	}
 
 	snmp_server_unlock();
 
 	return CA_SNMP_OK;
-
 }
 
-
-
 int
 snmp_server_host_auth(char * ipstr,
+		char * engine_id,
 		char* auth_password,
 		char* security_level,
 		char* priv_password,
@@ -1907,6 +1803,9 @@
 		char* priv_proto)
 {
 	int i;
+	int idx;
+	char * p_str;
+	int engine_id_len = strlen(engine_id);
 	int security_flag = 0;
 	int auth_pw_len = strlen(auth_password);
 	int priv_pw_len = strlen(priv_password);
@@ -1919,7 +1818,6 @@
 	char auth_protocol[PASSWORD_MAXLEN + 1] = {0};
 	char priv_protocol[PASSWORD_MAXLEN + 1] = {0};
 	char g_comm_user[SNMPV3_USERNAME_MAXLEN + 1];
-	char g_engine_id[ENGINE_ID_MAX_LEN + 1] = "\"\"";
 	uint32_t trap_ver;
 	snmp_info_t *pInfo = snmp_server_attach();
 
@@ -1941,6 +1839,11 @@
 		snmp_server_unlock();
 		return CA_ERR_SNMP_INVAL;
 	}
+	if ((pInfo->host[i].snmp_version == 3) && (engine_id_len & 1)) {
+		printf("the length of authoritative engine id for SNMPv3 can't be odd number\n");
+		snmp_server_unlock();
+		return CA_ERR_SNMP_INVAL;
+	}
 	strcpy(auth_protocol, auth_proto);
 	strcpy(priv_protocol, priv_proto);
 	convert_lower_characters_to_upper(auth_protocol);
@@ -1956,13 +1859,25 @@
 	}
 	trap_ver = pInfo->host[i].snmp_version;
 	if (trap_ver == 3) {
-		if (strcmp(pInfo->host[i].auth_eng_id, "") != 0) {
-			strlcpy(g_engine_id, pInfo->host[i].auth_eng_id, ENGINE_ID_MAX_LEN + 1);
-		} else {
-			printf("Engine ID missing. Please run \"snmp engineid\" command");
+		if (engine_id_len < 1) {
+			printf("engine id should not be empty!\n");
+			snmp_server_unlock();
+			return CA_ERR_SNMP_INVAL;
+		}
+
+		if (engine_id_len > ENGINE_ID_MAX_LEN) {
+			printf("Invalid engine id length, the max length is %d\n", ENGINE_ID_MAX_LEN);
 			snmp_server_unlock();
 			return CA_ERR_SNMP_INVAL;
 		}
+		p_str = engine_id;
+		for (idx = 0; idx < engine_id_len; idx++) {
+			if (!isxdigit(p_str[idx]) && p_str[idx] != 'x' && p_str[idx] != 'X') {
+				printf("engine id must be one hex number\n");
+				snmp_server_unlock();
+				return CA_ERR_SNMP_INVAL;
+			}
+		}
 		if (0 == strncmp(auth_password, ENCRYPTSTR, ENCRYPTSTR_LEN)) {
 			encry_auth_pw = 1;
 		}
@@ -2055,11 +1970,13 @@
 		}
 	} else {
 		/* snmpv1 or snmpv2c update auth_protocol and priv_protocol */
+		printf("Warning: This command only applicable for SNMP trap version v3!");
 		strncpy(auth_protocol, "", ENCRYPTSTR_LEN);
 		strncpy(priv_protocol, "", ENCRYPTSTR_LEN);
 	}
 	pInfo->host[i].port = port;
 	if (trap_ver == 3) {
+		strlcpy(pInfo->host[i].auth_eng_id, engine_id, ENGINE_ID_MAX_LEN + 1);
 		strlcpy(pInfo->host[i].authPassword, encry_auth_passwd, MAX_ENCRPT_PASSWD_LEN + 1);
 		strlcpy(pInfo->host[i].authProtocol, auth_protocol, PASSWORD_MAXLEN + 1);
 		pInfo->host[i].security_level = security_flag;
@@ -2081,7 +1998,7 @@
 	}
 
 	/* push configure data into kernel */
-	kern_snmp_add_trap_host(ipstr, trap_ver, g_comm_user, g_engine_id, auth_password,
+	kern_snmp_add_trap_host(ipstr, trap_ver, g_comm_user, engine_id, auth_password,
 			security_flag, priv_password, port, auth_protocol, priv_protocol);
 
 	snmp_server_unlock();
@@ -2325,9 +2242,6 @@
 	show_snmp_host_helper(buff, SNMP_BUFFER_SIZE);
 	printf("%s", buff);
 
-	show_snmp_host_engineid_helper(buff, SNMP_BUFFER_SIZE);
-	printf("%s", buff);
-
 	show_snmp_host_auth_helper(buff, SNMP_BUFFER_SIZE);
 	printf("%s", buff);
 
@@ -2383,10 +2297,6 @@
 	if (idx >= buflen) {
 		goto out;
 	}
-	idx += show_snmp_host_engineid_helper(buf + idx, buflen - idx);
-	if (idx >= buflen) {
-		goto out;
-	}
 	idx += show_snmp_host_auth_helper(buf + idx, buflen - idx);
 	if (idx >= buflen) {
 		goto out;
Index: /branches/rel_apv_10_7/usr/click/lib/libhalib/ha_lib.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libhalib/ha_lib.c	(revision 39561)
+++ /branches/rel_apv_10_7/usr/click/lib/libhalib/ha_lib.c	(working copy)
@@ -1130,7 +1130,7 @@
 		"no vlan",
 		"clear vlan",
 		"webui ip",
-		"snmp engineid",
+		"snmp auth",
 		"webui port",
 		"xmlrpc ip",
 		"restapi ip",
Index: /branches/rel_apv_10_7/usr/click/lib/libparser/commands.pm
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libparser/commands.pm	(revision 39561)
+++ /branches/rel_apv_10_7/usr/click/lib/libparser/commands.pm	(working copy)
@@ -33786,12 +33786,12 @@
 	},
 	{
 		obj_type => "ITEM",
-		name => "engineid",
+		name => "auth",
 		menu => "root_snmp",
-		help_string => "Set SNMP engine ID",
+		help_string => "Set SNMP security and Authentication Settings",
 		cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_SPECIAL_LOG",
 		user_level => "CLI_LEVEL_CONFIG",
-		function_name =>  "snmp_server_host_engine_id",
+		function_name =>  "snmp_server_host_auth",
 		function_args => [
 		         {
 			         type => "IPADDR",
@@ -33804,22 +33804,6 @@
 				 optional => "YES",
 				 default_value => "\"\"",
 			 },
-			         ],
-	},
-	{
-		obj_type => "ITEM",
-		name => "auth",
-		menu => "root_snmp",
-		help_string => "Set SNMP security and Authentication Settings",
-		cmd_attribute => "CMD_ARRAYOS|CMD_SPROXY|CMD_NORMAL|CMD_GLOBAL|CMD_SPECIAL_LOG",
-		user_level => "CLI_LEVEL_CONFIG",
-		function_name =>  "snmp_server_host_auth",
-		function_args => [
-		         {
-			         type => "IPADDR",
-				 help_string => "SNMP receiver IP",
-				 optional => "NO",
-			 },
 			 {
 				type=> "STRING",
 				help_string => "authentication password (ranges from 8 to 32 characters)",
