FACT++  1.0
void initMessageStruct ( )

Definition at line 3000 of file feeserver.c.

References sprintf(), and time.

Referenced by initialize().

3000  {
3001  time_t timeVal;
3002  struct tm* now;
3003 
3004  // fill the original message struct
3005  message.eventType = MSG_INFO;
3006  memcpy(message.detector, LOCAL_DETECTOR, MSG_DETECTOR_SIZE);
3007  memcpy(message.source, "FeeServer\0", 10);
3008  message.description[sprintf(message.description,
3009  "FeeServer %s (Version: %s) has been initialized (DNS: %s) ...",
3010  serverName, FEESERVER_VERSION, getenv("DIM_DNS_NODE"))] = 0;
3011  //set current date and time
3012  time(&timeVal);
3013  now = localtime(&timeVal);
3014  message.date[strftime(message.date, MSG_DATE_SIZE, "%Y-%m-%d %H:%M:%S",
3015  now)] = 0;
3016 
3017  // the the storage of the "last Message" struct - must be different in
3018  // the description compared to the original message struct above in init
3019  lastMessage.eventType = MSG_DEBUG;
3020  memcpy(lastMessage.detector, LOCAL_DETECTOR, MSG_DETECTOR_SIZE);
3021  memcpy(lastMessage.source, "FeeServer\0", 10);
3022  // now use a different description:
3023  lastMessage.description[sprintf(lastMessage.description,
3024  "Init of Backup Message Struct!")] = 0;
3025  //set current date and time
3026  time(&timeVal);
3027  now = localtime(&timeVal);
3028  lastMessage.date[strftime(lastMessage.date, MSG_DATE_SIZE,
3029  "%Y-%m-%d %H:%M:%S", now)] = 0;
3030 }
static MessageStruct message
Definition: feeserver.c:101
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Definition: smartfact.txt:92
static char * serverName
Definition: feeserver.c:183
static MessageStruct lastMessage
Definition: feeserver.c:108
sprintf(name1,"NewService%d", i)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: