00001 00004 #ifndef RAZORBACK_MESSAGES_FORMATS_H 00005 #define RAZORBACK_MESSAGES_FORMATS_H 00006 00007 #include <razorback/visibility.h> 00008 #include <razorback/types.h> 00009 00012 struct MessageHeader 00013 { 00014 char *sName; 00015 char *sValue; 00016 }; 00017 00018 struct Message 00019 { 00020 uint32_t type; 00021 size_t length; 00022 uint32_t version; 00023 struct List *headers; 00024 void *message; 00025 uint8_t *serialized; 00026 bool (*serialize)(struct Message *, int); 00027 bool (*deserialize)(struct Message *, int); 00028 void (*destroy)(struct Message *); 00029 }; 00030 00031 00032 00040 struct MessageError 00041 { 00042 uint8_t *sMessage; 00043 }; 00044 00048 struct MessageHello 00049 { 00050 uuid_t uuidNuggetType; 00051 uuid_t uuidApplicationType; 00052 uint8_t locality; 00053 uint8_t priority; 00054 uint32_t flags; 00055 struct List *addressList; 00056 uint8_t protocol; 00057 uint16_t port; 00058 }; 00059 00063 struct MessageRegistrationRequest 00064 { 00065 uuid_t uuidNuggetType; 00066 uuid_t uuidApplicationType; 00067 uint32_t iDataTypeCount; 00068 uuid_t *pDataTypeList; 00069 }; 00070 00073 struct MessageConfigurationUpdate 00074 { 00075 struct List *ntlvTypes; 00076 struct List *ntlvNames; 00077 struct List *dataTypes; 00078 }; 00079 00082 struct MessageConfigurationAck 00083 { 00084 uuid_t uuidNuggetType; 00085 uuid_t uuidApplicationType; 00086 }; 00087 00090 struct MessageTerminate 00091 { 00092 uint8_t *sTerminateReason; 00093 }; 00095 // 00096 // End of Command and Control Messages 00097 00104 struct MessageCacheReq 00105 { 00106 uuid_t uuidRequestor; 00107 struct BlockId *pId; 00108 }; 00109 00112 struct MessageCacheResp 00113 { 00114 struct BlockId *pId; 00115 uint32_t iSfFlags; 00116 uint32_t iEntFlags; 00117 }; 00118 00119 00121 // End Cache Control Messages 00122 00129 struct MessageBlockSubmission 00130 { 00131 uint32_t iReason; 00132 struct Event *pEvent; 00133 uint8_t storedLocality; 00134 }; 00135 00136 00139 struct MessageJudgmentSubmission 00140 { 00141 uint8_t iReason; 00142 struct Judgment *pJudgment; 00143 }; 00144 00147 struct MessageLogSubmission 00148 { 00149 uuid_t uuidNuggetId; 00150 uint8_t iPriority; 00151 struct EventId *pEventId; 00152 uint8_t *sMessage; 00153 }; 00154 00157 struct MessageInspectionSubmission 00158 { 00159 uint32_t iReason; 00160 struct Block *pBlock; 00161 struct EventId *eventId; 00162 struct List *pEventMetadata; 00163 uint32_t localityCount; 00164 uint8_t *localityList; 00165 }; 00167 // End Submission Messages 00168 00175 struct MessageAlertPrimary 00176 { 00177 struct Nugget *nugget; 00178 struct Block *block; 00179 struct Event *event; 00180 uint32_t gid; 00181 uint32_t sid; 00182 struct List *metadata; 00183 uint8_t priority; 00184 char *message; 00185 uint64_t seconds; 00186 uint64_t nanosecs; 00187 uint32_t SF_Flags; 00188 uint32_t Ent_Flags; 00189 uint32_t Old_SF_Flags; 00190 uint32_t Old_Ent_Flags; 00191 }; 00192 00195 struct MessageAlertChild 00196 { 00197 struct Nugget *nugget; 00198 struct Block *block; 00199 struct Block *child; 00200 uint64_t eventCount; 00201 uint64_t parentCount; 00202 uint32_t SF_Flags; 00203 uint32_t Ent_Flags; 00204 uint32_t Old_SF_Flags; 00205 uint32_t Old_Ent_Flags; 00206 }; 00207 00210 struct MessageOutputEvent 00211 { 00212 struct Nugget *nugget; 00213 struct Event *event; 00214 }; 00215 00218 struct MessageOutputLog 00219 { 00220 struct Nugget *nugget; 00221 char *message; 00222 uint8_t priority; 00223 struct Event *event; 00224 uint64_t seconds; 00225 uint64_t nanosecs; 00226 }; 00227 00230 struct MessageOutputInspection 00231 { 00232 struct Nugget *nugget; 00233 uint64_t seconds; 00234 uint64_t nanosecs; 00235 struct BlockId *blockId; 00236 uint8_t status; 00237 bool final; 00238 }; 00239 00240 00241 #endif