📄 linux_mond.h
字号:
#ifdef HAVE_CONFIG_H#include <config.h>#endif#include<sys/time.h>#include<sys/resource.h>#include<sys/stat.h>#ifdef HAVE_SYS_SOCKET_H#include <sys/socket.h> // Include these for socket(), connect(), bind(), etc.#else# error no sys/socket.h#endif#ifdef HAVE_NETINET_IN_H#include<netinet/in.h> // Include this for htonl(), htons(), etc.#else# error no netinet/in.h#endif#ifdef HAVE_ARPA_INET_H#include<arpa/inet.h> //inet_pton#else# error no arpa/inet.h#endif#include<sys/types.h>#include<netdb.h> // Include this for getprotobyname()#include<string.h> // Include this for memset()#include<unistd.h>#include<fcntl.h>#include<syslog.h>#include<stdio.h>#include <sys/wait.h>#include <signal.h>#include <stdarg.h>#include <errno.h> //error numbers#include <ctype.h>#include <glib.h>#ifdef HAVE_SYS_TIME_H#include<sys/time.h> //for timeval struct in linux_mond.c#else# error no sys/time.h#endiftypedef enum{ CFG_PARAMETER, CFG_VALUE, CFG_SECTION,} cfgKeywordValue;#define NO_FUNC 1#define RECV_HELO 2#define RECV_REPORT1 3#define RECV_REPORT2 4#define FIRST_RUN 5#define RECV_VERSION 6#define RECV_AMACHINE 7#define RECV_ACTIONID 8#define RECV_SSTATE 9#define RECV_SERVICE 10#define STATUS2DB 20#define STATUS2DB2 21#define QUITQUIT 99struct conf_t{char dbuser[21];char dbpasswd[21];char dbhost[21];};struct msg_t{ char *machine; //machine char *status; //status char *errordescription; //error char *Amachine; char *actionid; char *Sstate; char *service;};//definitionsint make_deamon(void);int slog(int k, char *fmt, ...);void show_menu(int n);char *rm_first_spaces(char *k);int is_comment(char *c);int read_confd(char *filename);int data2db(struct msg_t *ipmsg, char *table, int w2db);int data2dbpro(struct msg_t *ipmsg, char *table);int send_tcp(unsigned char *buf, int buf_len, int sockfd);int encrypt_stuff(char *key, unsigned char **outbuf, char *fmt, ...);int decrypt_stuff(char *key, unsigned char **outbuf, unsigned char *inbuf, int inlen);char *escapeunwanted (const char *const s);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -