|
@@ -2996,7 +2996,7 @@ int dev_get_snmp_info(sqlite3 *db, SNMPManager* _globalSNMPInfo)
|
|
|
_globalSNMPInfo->mode = atoi(pResult[rowIndex*ncolumn+2]);
|
|
_globalSNMPInfo->mode = atoi(pResult[rowIndex*ncolumn+2]);
|
|
|
strcpy(_globalSNMPInfo->public,pResult[rowIndex*ncolumn+3]);
|
|
strcpy(_globalSNMPInfo->public,pResult[rowIndex*ncolumn+3]);
|
|
|
_globalSNMPInfo->trapmode = atoi(pResult[rowIndex*ncolumn+4]);
|
|
_globalSNMPInfo->trapmode = atoi(pResult[rowIndex*ncolumn+4]);
|
|
|
- if(_globalSNMPInfo->mode==2) {
|
|
|
|
|
|
|
+ if(_globalSNMPInfo->version==2) {
|
|
|
if(pResult[rowIndex*ncolumn+5]) strcpy(_globalSNMPInfo->crypt.user,pResult[rowIndex*ncolumn+5]);
|
|
if(pResult[rowIndex*ncolumn+5]) strcpy(_globalSNMPInfo->crypt.user,pResult[rowIndex*ncolumn+5]);
|
|
|
if(pResult[rowIndex*ncolumn+6]) strcpy(_globalSNMPInfo->crypt.auth.alg,pResult[rowIndex*ncolumn+6]);
|
|
if(pResult[rowIndex*ncolumn+6]) strcpy(_globalSNMPInfo->crypt.auth.alg,pResult[rowIndex*ncolumn+6]);
|
|
|
if(pResult[rowIndex*ncolumn+7]) strcpy(_globalSNMPInfo->crypt.auth.passwd,pResult[rowIndex*ncolumn+7]);
|
|
if(pResult[rowIndex*ncolumn+7]) strcpy(_globalSNMPInfo->crypt.auth.passwd,pResult[rowIndex*ncolumn+7]);
|
|
@@ -3020,7 +3020,7 @@ int dev_insert_snmp_info(sqlite3 *db, SNMPManager* _globalSNMPInfo)
|
|
|
char select_sql[1024] = {0};
|
|
char select_sql[1024] = {0};
|
|
|
|
|
|
|
|
sprintf(select_sql,"INSERT INTO Table_SNMPManage (product_id, proto_type, enable, public, TrapEnable, "
|
|
sprintf(select_sql,"INSERT INTO Table_SNMPManage (product_id, proto_type, enable, public, TrapEnable, "
|
|
|
- "user, auth_alg, auth_passwd, priv_alg, priv_passwd) VALUES (%d,%d,%d,'%s',%d,'%s',%s,'%s',%s,'%s');",
|
|
|
|
|
|
|
+ "user, auth_alg, auth_passwd, priv_alg, priv_passwd) VALUES (%d,%d,%d,'%s',%d,'%s','%s','%s','%s','%s');",
|
|
|
_globalSNMPInfo->product_id,
|
|
_globalSNMPInfo->product_id,
|
|
|
_globalSNMPInfo->version,
|
|
_globalSNMPInfo->version,
|
|
|
_globalSNMPInfo->mode,
|
|
_globalSNMPInfo->mode,
|
|
@@ -3052,7 +3052,7 @@ int dev_update_snmp_info(sqlite3 *db, int product_id, SNMPManager* _globalSNMPIn
|
|
|
char* err_msg=NULL;
|
|
char* err_msg=NULL;
|
|
|
char select_sql[1024] = {0};
|
|
char select_sql[1024] = {0};
|
|
|
sprintf(select_sql,"UPDATE Table_SNMPManage SET proto_type='%d',enable=%d,public='%s',TrapEnable=%d, "
|
|
sprintf(select_sql,"UPDATE Table_SNMPManage SET proto_type='%d',enable=%d,public='%s',TrapEnable=%d, "
|
|
|
- "user='%s',auth_alg=%s,auth_passwd='%s',priv_alg=%s,priv_passwd='%s' WHERE product_id=%d;",
|
|
|
|
|
|
|
+ "user='%s',auth_alg='%s',auth_passwd='%s',priv_alg='%s',priv_passwd='%s' WHERE product_id=%d;",
|
|
|
_globalSNMPInfo->version,
|
|
_globalSNMPInfo->version,
|
|
|
_globalSNMPInfo->mode,
|
|
_globalSNMPInfo->mode,
|
|
|
_globalSNMPInfo->public,
|
|
_globalSNMPInfo->public,
|