📄 serv_common.h
字号:
/* ************************************************************* * * common defines and structures for server. * * *************************************************************/#ifndef _WXXT_SERV_COMMON_H_#define _WXXT_SERV_COMMON_H_#include "share.h"#include "db_fake.h"#include "packet.h"#define _PATH_WYGLD "/sbin/wygld"#define _PATH_WXXT "/etc/wxxt"#define _PATH_PIDTAB "/etc/wxxt/pidtab"#define WXXT_WYGL_SERV_CONF "/etc/wxxt/wygl.conf"#define WXXT_WYGL_SERV_LOG "/tmp/wxxt_wygld.log"#define WXXT_MIN_NOPEN 4096#define MAX_PROBE_WAIT 3//#define PROBE_LIMIT 15#define PROBE_TIMEOUT 60/* device net stat */#define OUT_TROUBLE 0#define IN_TROUBLE 1/* alert type */#define OUTLINE_ALERT 1/* process num in runtime-array */#define WXXT_MAIN_PROC 0#define WXXT_PROBE_ONE_PROC 1#define WXXT_PROBE_TWO_PROC 2#define WXXT_WAIT_REPLY_PROC 3#define WXXT_ALERT_PROC 4//#define WXXT_RECORD_ALERT_PROC 5 #define WXXT_PROCESS_CLIENT_PROC 5 /* timer */#define WATCH_INTERVAL 5#define PROBE_INTERVAL 5#define ALERT_INTERVAL 5#define LOOK_INTERVAL 5/* * max seconds process can idle */#define MAX_PROC_SLIENT 15/* * if package-num of wait for some device response larger than MAX_NORESPONSE, * we treat the device as trouble. */#define MAX_NORESPONSE 3extern int max_noresponse;#if 0struct dev_stat_table { uint32_t ip; char wait_num; char tcp_stat; int fd; time_t last_ltime; int in_use;};#endif/* variables used between processes */struct global_var { int real_hcsnum; int real_dcsnum; int real_other_devsnum;};extern struct global_var *gvar;#define inuse_hcsnum gvar->real_hcsnum#define inuse_dcsnum gvar->real_dcsnum#define inuse_other_devsnum gvar->real_other_devsnumvoid probe_one_proc(void);void probe_two_proc(void);void wait_reply_proc(void);void alert_proc(void);//void record_alert_proc(void);void process_client_proc(void);int get_dev_num_from_db(void);int get_home_num_from_db(void);int get_building_num_from_db(void);void getnexthomeinfo(struct devinfo *dinfo);void getnextbuildinginfo(struct devinfo *dinfo);void getnextotherinfo(struct devinfo *dinfo);void report_alert(void);int dev_in_close(char *dev_stat);void tell_record_alert_proc(int flag, uint32_t ip, int type);#endif /* _WXXT_SERV_COMMON_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -