From 8043035fef3cb3ede15fe8e2c4f2a5489684bf51 Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Sat, 19 Oct 2024 15:19:43 +0800 Subject: [PATCH] bsscomm variables issue --- src/configMgr/c_program/impmod/bss_hb.c | 8 +++---- src/configMgr/c_program/impmod/bsscomm.c | 23 ++++++++++++++++--- src/configMgr/c_program/impmod/bsscomm.h | 28 ++++++++++++------------ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/configMgr/c_program/impmod/bss_hb.c b/src/configMgr/c_program/impmod/bss_hb.c index c278590..61a9764 100644 --- a/src/configMgr/c_program/impmod/bss_hb.c +++ b/src/configMgr/c_program/impmod/bss_hb.c @@ -16,11 +16,11 @@ char OMC_0_IP[16]; char OMC_1_IP[16]; -MYSQL omcDbConn,*omcDb_sock; // by simon at 2024/10/19 begin --- -// MYSQL_RES *result; -// MYSQL_ROW row; -// char sqlstring[128]; +extern MYSQL omcDbConn,*omcDb_sock; +extern MYSQL_RES *result; +extern MYSQL_ROW row; +extern char sqlstring[128]; // ---end static int udp_sockfd; diff --git a/src/configMgr/c_program/impmod/bsscomm.c b/src/configMgr/c_program/impmod/bsscomm.c index 727628d..21390f3 100644 --- a/src/configMgr/c_program/impmod/bsscomm.c +++ b/src/configMgr/c_program/impmod/bsscomm.c @@ -7,6 +7,23 @@ #include "includes.h" #include "bss_hb.h" + +/* Global variables by simon +*/ +MYSQL mysql, *mysql_sock; +MYSQL_RES *result; +MYSQL_ROW row; +char sqlstring[SQLSTRING_LEN]; +int num_of_mysql_table; +char **mysql_tables; +int monitor_fd = -1; +tImpConn *BssConn; +tImpConn **bsplus; +tImpConn **bsplus_down; +tImpEvent BssEvent; +struct queue CmdBuffer[CMD_BUFFER_SIZE]; +int CmdBufferPtr = 0; + /* * Variables that are initialized when process is started * @@ -4491,7 +4508,7 @@ void setup_daemon(void); /************************************************* Function: // main -Description: // µ÷ÓÃImpConnMultiplexerÄ£¿é£¬ÊÇÄ£¿éµÄÖ÷º¯Êý +Description: // ����ImpConnMultiplexerģ�飬��ģ��������� Calls: // imp_init; Called By: // Table Accessed: // @@ -4528,7 +4545,7 @@ int main(int argc, char *argv[]) /************************************************* Function: // onTimer -Description: // ¶¨Ê±Æ÷º¯Êý +Description: // ��ʱ������ Calls: // ImpConnMultiplexer; Called By: // Table Accessed: // @@ -4550,7 +4567,7 @@ void onTimer() /************************************************* Function: // setTimer -Description: // ÉèÖö¨Ê±Æ÷º¯Êý +Description: // ���ö�ʱ������ Calls: // onTimer; Called By: // Table Accessed: // diff --git a/src/configMgr/c_program/impmod/bsscomm.h b/src/configMgr/c_program/impmod/bsscomm.h index 8514657..18f8c6c 100644 --- a/src/configMgr/c_program/impmod/bsscomm.h +++ b/src/configMgr/c_program/impmod/bsscomm.h @@ -115,18 +115,18 @@ #define PASSWD "noitacilpPA#68*" #define SQLSTRING_LEN 16384 // 16384 = 2^14 -MYSQL mysql,*mysql_sock; -MYSQL_RES *result; -MYSQL_ROW row; -//MYSQL_FIELD *field; -char sqlstring[SQLSTRING_LEN]; +// MYSQL mysql,*mysql_sock; +// MYSQL_RES *result; +// MYSQL_ROW row; +// //MYSQL_FIELD *field; +// char sqlstring[SQLSTRING_LEN]; /* * Store the name of MYSQL tablename at program startup */ #define MAX_NUM_OF_SQL_TABLE 100 -int num_of_mysql_table; -char **mysql_tables; +// int num_of_mysql_table; +// char **mysql_tables; #define NMIPORT 2112 #define BUFMAX 4096 @@ -139,7 +139,7 @@ char **mysql_tables; * For BSS momitor */ #define MONITOR_PORT 5354 -int monitor_fd=-1; +// int monitor_fd=-1; #define TIME_LEN 9 @@ -241,9 +241,9 @@ struct ImpConn { }; typedef struct ImpConn tImpConn; -tImpConn *BssConn; -tImpConn **bsplus; -tImpConn **bsplus_down; +// tImpConn *BssConn; +// tImpConn **bsplus; +// tImpConn **bsplus_down; /* * ImpEvent structure definition * This stores the IMP event from BSS @@ -265,7 +265,7 @@ struct ImpEvent { int severity; }; typedef struct ImpEvent tImpEvent; -tImpEvent BssEvent; +// tImpEvent BssEvent; /* * Use link list to maintain the queue of commands for each IMP connection * A shared buffer(array) is used to store the commands to different BSS @@ -282,8 +282,8 @@ struct queue { // A FIFO Queue u32 TransId; bool available; }; -struct queue CmdBuffer[CMD_BUFFER_SIZE]; -int CmdBufferPtr=0; +// struct queue CmdBuffer[CMD_BUFFER_SIZE]; +// int CmdBufferPtr=0; /* * Function declaration */