/**************************************************************************** Shared memory define for rc_mond ----------------------------------------- begin : 2015/06/09 copyright : (C) 2005 Solbox Inc. author : Dev Storage Team email : huibong@solbox.com version : 3.5 CopyRight(C) 2005 Solbox Inc. All Rights reserved. Redistribution and use in source and binary forms, with or with out modification, are not permitted in outside of Solbox Inc. *****************************************************************************/ #ifndef __SHM_DEFINE_H__ #define __SHM_DEFINE_H__ #include #include #include #include // hostname ÃÖ´ë ±æÀÌ. #define HOST_NAME_LENGTH 63 // client ip ÁÖ¼Ò ÀúÀåÀ» À§ÇÑ ÃÖ´ë Å©±â°ª // - NULL Æ÷ÇÔ 40ÀÚ±îÁö, IPv6 Áö¿ø ¸ñÀû #define IP_ADDR_LENGTH 40 // Service »óÅ ÄÚµå Á¤ÀÇ #define SERVICE_STAT_OK 0 // Á¤»ó »óÅ #define SERVICE_STAT_OUT 1 // ¼öµ¿ ÁßÁö »óÅ #define SERVICE_STAT_DISABLE 2 // ¼­ºñ½º ºÒ°¡ »óÅ #define SERVICE_STAT_RONLY 3 // Read Only »óÅ // ShmDefine.h ¿¡¼­ Á¤ÀÇµÈ ¼­ºñ½º »óÅ ÄÚµå ¿Ü¿¡ ¹ÌÁ¤ÀÇµÈ ÄÚµå 󸮸¦ À§ÇÑ Á¤ÀÇ #define SERVICE_STAT_NOT_DEFINE -1 #ifdef __cplusplus extern "C" { #endif // °¢ Client ·Î ºÎÅÍ ¼ö½ÅµÈ Á¤º¸¸¦ ÀúÀåÇϱâ À§ÇÑ °øÀ¯¸Þ¸ð¸® Á¤ÀÇ ÆÄÀÏ // - °øÀ¯¸Þ¸ð¸® °ü·Ã »ó¼¼ ³»¿ªÀº rc_mond ¼³°è¼­ ÀÇ °øÀ¯¸Þ¸ð¸® ±¸Á¶ Ç׸ñÀ» Âü°íÇÒ °Í. // Service »óÅ Á¤º¸ struct ServiceInfo { time_t update_time; // ÃÖÁ¾ update ½Ã°£ (local time, ½Ã°£µ¿±âÈ­ ¿µÇâ ¹ÞÀ½) int service_stat; // Service »óÅ code. ( -1: Á¤º¸ ¹Ì¼ö½Å »óÅÂ, ±×¿Ü csagentd ¼³Á¤°ú µ¿ÀÏ) time_t update_time_clock_sec; // clock_gettime(CLOCK_MONOTONIC) À» ÅëÇØ ÃßÃâµÈ sec Á¤º¸. expire ¿©ºÎ ÆÇ´ÜÀ» À§ÇØ »ç¿ë. }; // System »óÅ Á¤º¸ struct SystemInfo { time_t update_time; // ÃÖÁ¾ update ½Ã°£ double load_avg[3]; // load average. uint64_t memory_total; // Total memory size (byte ´ÜÀ§) uint64_t memory_free; // Free memory size (byte ´ÜÀ§) int memory_usage; // memory »ç¿ë·ü (%) uint64_t swap_total; // Total swap size (byte ´ÜÀ§) uint64_t swap_used; // Used swap size (byte ´ÜÀ§) int swap_usage; // swap »ç¿ë·ü (%) uint64_t storage_total; // Total Storage size (byte ´ÜÀ§) uint64_t storage_avail; // Available Storage size (byte ´ÜÀ§) int storage_max_usage; // Storage Áß ÃÖ´ë »ç¿ë·ü (%) uint64_t disk_max_queue; // Disk »óÅ Á¤º¸ Áß Max Queue Length double disk_max_busy; // Disk »óÅ Á¤º¸ Áß Max busy(%) uint64_t network_packet_in; // Network inbound packet Æò±Õ count (count/sec) uint64_t network_packet_out; // Network outbound packet Æò±Õ count (count/sec) uint64_t network_traffic_in; // Network inbound Æò±Õ traffic (Byte/sec) uint64_t network_traffic_out; // Network outbound Æò±Õ traffic (Byte/sec) unsigned int tcp_total; // TCP ¼¼¼Ç total count unsigned int tcp_80; // TCP ¼¼¼Ç Áß local 80 port ¸¦ »ç¿ëÇÏ´Â ¼¼¼Ç count unsigned int tcp_80_establish; // TCP ¼¼¼Ç Áß local 80 port ¸¦ »ç¿ëÇϰí.. ESTABLISH »óÅÂÀÎ ¼¼¼Ç count }; // Shared momory »óÀÇ °¢ slot ±¸¼º Á¤º¸. struct ClientInfo { int use; // ÇØ´ç °øÀ¯¸Þ¸ð¸® slot »ç¿ë ¿©ºÎ (0 : ¹Ì»ç¿ë, 1 : »ç¿ë Áß) int valid; // ÇØ´ç °øÀ¯¸Þ¸ð¸®¿¡ ÀúÀåµÈ data ÀÇ À¯È¿¼º ¿©ºÎ, (0 : À¯È¿ ¾ÈÇÔ, 1 : À¯È¿) char client_ip[IP_ADDR_LENGTH]; // Client IP ÁÖ¼Ò, NULL Æ÷ÇÔ 40ÀÚ±îÁö, IPv6 Áö¿ø ¸ñÀû int client_app; // ÇØ´ç °øÀ¯¸Þ¸ð¸® slot ÀÇ Data °¡ ¾î´À ÇÁ·Î±×·¥¿¡¼­ ¼ö½ÅµÇ¾ú´ÂÁö Á¤ÀÇ (0 : csagentd, 1 : vmasd) char hostname[HOST_NAME_LENGTH + 1]; // hostname, NULL Æ÷ÇÔ ÃÖ´ë 64ÀÚ±îÁö¸¸ Çã¿ë. °¢ Àåºñ¸¦ ±¸ºÐÇÏ´Â Key °ªÀ¸·Î »ç¿ë. struct ServiceInfo service; // ¼ö½ÅµÈ ¼­ºñ½º »óÅ Á¤º¸ ÀúÀå struct SystemInfo system; // ¼ö½ÅµÈ System »óÅ Á¤º¸ ÀúÀå }; // Shared Memory Àüü ±¸Á¶ struct RcInfo { int client_max_index; // FHS Client Á¤º¸ Áß À¯È¿ÇÑ slot ÀÇ ÃÖ´ë Index Á¤º¸. struct ClientInfo client[MAX_CLIENT_COUNT]; // °¢ FHS Client Á¤º¸. // ÇâÈÄ RCDB, RCTS ´Â ¼öÁý Ç׸ñÀÌ ´Ù¸£¹Ç·Î.. ¾Æ·¡¿¡ »õ·Î Á¤ÀÇÇÏ¿© È®Àå ó¸®ÇÑ´Ù. }; #ifdef __cplusplus } #endif #endif /* __SHM_DEFINE_H__ */