Razorback API messages. More...
#include <razorback/visibility.h>
#include <razorback/message_formats.h>
#include <razorback/types.h>
#include <razorback/api.h>
Go to the source code of this file.
Data Structures | |
struct | MessageHandler |
Message handler structure. More... | |
Defines | |
#define | MESSAGE_MODE_BIN 1 |
#define | MESSAGE_MODE_JSON 2 |
#define | MSG_CNC_HEADER_SOURCE "Source_Nugget" |
#define | MSG_CNC_HEADER_DEST "Dest_Nugget" |
#define | DISP_HELLO_FLAG_LM (1 << 0) |
#define | DISP_HELLO_FLAG_LS (1 << 1) |
#define | DISP_HELLO_FLAG_DD (1 << 2) |
#define | DISP_HELLO_FLAG_LF (1 << 3) |
#define | MESSAGE_GROUP_C_AND_C 0x10000000 |
Message Groups. | |
#define | MESSAGE_GROUP_CACHE 0x20000000 |
Global Cache. | |
#define | MESSAGE_GROUP_SUBMIT 0x40000000 |
Submission. | |
#define | MESSAGE_GROUP_OUTPUT 0x80000000 |
Submission. | |
#define | MESSAGE_TYPE_HELLO ( MESSAGE_GROUP_C_AND_C | 1 ) |
Command And Control Messages. | |
#define | MESSAGE_TYPE_REG_REQ ( MESSAGE_GROUP_C_AND_C | 2 ) |
Registration Request. | |
#define | MESSAGE_TYPE_REG_RESP ( MESSAGE_GROUP_C_AND_C | 3 ) |
Registration Response. | |
#define | MESSAGE_TYPE_REG_ERR ( MESSAGE_GROUP_C_AND_C | 4 ) |
Registration Error. | |
#define | MESSAGE_TYPE_CONFIG_UPDATE ( MESSAGE_GROUP_C_AND_C | 5 ) |
Configuration Update Notice. | |
#define | MESSAGE_TYPE_CONFIG_ACK ( MESSAGE_GROUP_C_AND_C | 6 ) |
Configuration Updated OK. | |
#define | MESSAGE_TYPE_CONFIG_ERR ( MESSAGE_GROUP_C_AND_C | 7 ) |
Configuration Update Failed. | |
#define | MESSAGE_TYPE_PAUSE ( MESSAGE_GROUP_C_AND_C | 11 ) |
Pause Processing. | |
#define | MESSAGE_TYPE_PAUSED ( MESSAGE_GROUP_C_AND_C | 12 ) |
Pause Confirmation. | |
#define | MESSAGE_TYPE_GO ( MESSAGE_GROUP_C_AND_C | 13 ) |
Unpause Processing. | |
#define | MESSAGE_TYPE_RUNNING ( MESSAGE_GROUP_C_AND_C | 14 ) |
Unpuase Confirmation. | |
#define | MESSAGE_TYPE_TERM ( MESSAGE_GROUP_C_AND_C | 15 ) |
Terminate Processing. | |
#define | MESSAGE_TYPE_BYE ( MESSAGE_GROUP_C_AND_C | 16 ) |
Terminating Processing. | |
#define | MESSAGE_TYPE_CLEAR ( MESSAGE_GROUP_C_AND_C | 17 ) |
Clear Local Cache. | |
#define | MESSAGE_TYPE_REREG ( MESSAGE_GROUP_C_AND_C | 18 ) |
Reregister. | |
#define | MESSAGE_TYPE_REQ ( MESSAGE_GROUP_CACHE | 1 ) |
Global Cache Messages. | |
#define | MESSAGE_TYPE_RESP ( MESSAGE_GROUP_CACHE | 2 ) |
Global Cache Response. | |
#define | MESSAGE_TYPE_BLOCK ( MESSAGE_GROUP_SUBMIT | 1 ) |
Submission Messages. | |
#define | MESSAGE_TYPE_JUDGMENT ( MESSAGE_GROUP_SUBMIT | 2 ) |
Judgment Submission. | |
#define | MESSAGE_TYPE_INSPECTION ( MESSAGE_GROUP_SUBMIT | 3 ) |
Inspection Submission. | |
#define | MESSAGE_TYPE_LOG ( MESSAGE_GROUP_SUBMIT | 4 ) |
Log Message. | |
#define | MESSAGE_TYPE_ALERT ( MESSAGE_GROUP_SUBMIT | 5 ) |
Alert Message. | |
#define | MESSAGE_TYPE_ALERT_PRIMARY ( MESSAGE_GROUP_OUTPUT | 1 ) |
Output Messages. | |
#define | MESSAGE_TYPE_ALERT_CHILD ( MESSAGE_GROUP_OUTPUT | 2 ) |
Block turns to bad due to child. | |
#define | MESSAGE_TYPE_OUTPUT_EVENT ( MESSAGE_GROUP_OUTPUT | 3 ) |
Event Record. | |
#define | MESSAGE_TYPE_OUTPUT_LOG ( MESSAGE_GROUP_OUTPUT | 4 ) |
Log Record. | |
#define | MESSAGE_TYPE_OUTPUT_INSPECTION ( MESSAGE_GROUP_OUTPUT | 5 ) |
Inspection status. | |
#define | MESSAGE_VERSION_1 1 |
Message Versions. | |
Functions | |
SO_PUBLIC struct List * | Message_Header_List_Create (void) |
Create a list for storing message headers. | |
SO_PUBLIC bool | Message_Add_Header (struct List *headers, const char *name, const char *value) |
Add a header to a header list structure. | |
SO_PUBLIC bool | Message_Register_Handler (struct MessageHandler *handler) |
Register a message handler. | |
SO_PUBLIC bool | Message_Get_Nuggets (struct Message *message, uuid_t source, uuid_t dest) |
Get nugget ID headers from a message. | |
SO_PUBLIC bool | Message_Deserialize_Empty (struct Message *message, int mode) |
Deserialize an empty message. | |
SO_PUBLIC bool | Message_Serialize_Empty (struct Message *message, int mode) |
Deserialize an empty message. | |
SO_PUBLIC struct Message * | Message_Create_Directed (uint32_t type, uint32_t version, size_t msgSize, const uuid_t source, const uuid_t dest) |
Create a message with directed message headers on a topic. | |
SO_PUBLIC struct Message * | Message_Create_Broadcast (uint32_t type, uint32_t version, size_t msgSize, const uuid_t source) |
Create a message with broadcast message headers on a topic. | |
SO_PUBLIC void | Message_Destroy (struct Message *message) |
Destroy a message. | |
SO_PUBLIC struct Message * | MessageCacheReq_Initialize (const uuid_t requestorUUID, const struct BlockId *blockId) |
Initializes message cache request. | |
SO_PUBLIC struct Message * | MessageCacheResp_Initialize (const struct BlockId *blockId, uint32_t sfFlags, uint32_t entFlags) |
Initializes message cache response. | |
SO_PUBLIC struct Message * | MessageBlockSubmission_Initialize (struct Event *event, uint32_t reason, uint8_t locality) |
Initializes message block submission. | |
SO_PUBLIC struct Message * | MessageJudgmentSubmission_Initialize (uint8_t reason, struct Judgment *judgment) |
Initializes message block submission. | |
SO_PUBLIC struct Message * | MessageInspectionSubmission_Initialize (const struct Event *event, uint32_t reason, uint32_t localityCount, uint8_t *localities) |
Initializes message inspection submission. | |
SO_PUBLIC struct Message * | MessageHello_Initialize (struct RazorbackContext *context) |
Initializes a hello message. | |
SO_PUBLIC struct Message * | MessageRegistrationRequest_Initialize (const uuid_t dispatcherId, const uuid_t sourceNugget, const uuid_t nuggetType, const uuid_t applicationType, uint32_t dataTypeCount, uuid_t *dataTypeList) |
Initializes a registration request message. | |
SO_PUBLIC struct Message * | MessageRegistrationResponse_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a registration response message. | |
SO_PUBLIC struct Message * | MessageConfigurationUpdate_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a configuration update message. | |
SO_PUBLIC struct Message * | MessageConfigurationAck_Initialize (const uuid_t sourceNugget, const uuid_t sestNugget, const uuid_t nuggetType, const uuid_t applicationType) |
Initializes a configuration acknowledgment message. | |
SO_PUBLIC struct Message * | MessagePause_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a pause message. | |
SO_PUBLIC struct Message * | MessagePaused_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a paused message. | |
SO_PUBLIC struct Message * | MessageGo_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a go message. | |
SO_PUBLIC struct Message * | MessageRunning_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initializes a running message. | |
SO_PUBLIC struct Message * | MessageTerminate_Initialize (const uuid_t sourceNugget, const uuid_t destNugget, const uint8_t *reason) |
Initializes a terminate message. | |
SO_PUBLIC struct Message * | MessageBye_Initialize (const uuid_t sourceNugget) |
Initializes a bye message. | |
SO_PUBLIC struct Message * | MessageCacheClear_Initialize (const uuid_t sourceNugget) |
Initialize a cache clear message. | |
SO_PUBLIC struct Message * | MessageReReg_Initialize (const uuid_t sourceNugget, const uuid_t destNugget) |
Initialize a re-registration message. | |
SO_PUBLIC struct Message * | MessageError_Initialize (uint32_t errorCode, const char *message, const uuid_t sourceNugget, const uuid_t destNugget) |
Initialize an error message. | |
SO_PUBLIC struct Message * | MessageLog_Initialize (const uuid_t nuggetId, uint8_t priority, char *message, struct EventId *eventId) |
Initialize a log message. | |
SO_PUBLIC struct Message * | MessageAlertPrimary_Initialize (struct Event *event, struct Block *block, struct List *metadata, struct Nugget *nugget, struct Judgment *judgment, uint32_t new_SF_Flags, uint32_t new_Ent_Flags, uint32_t old_SF_Flags, uint32_t old_Ent_Flags) |
Initialize a primary alert message. | |
SO_PUBLIC struct Message * | MessageAlertChild_Initialize (struct Block *block, struct Block *child, struct Nugget *nugget, uint64_t parentCount, uint64_t eventCount, uint32_t new_SF_Flags, uint32_t new_Ent_Flags, uint32_t old_SF_Flags, uint32_t old_Ent_Flags) |
Initialize a child alert message. | |
SO_PUBLIC struct Message * | MessageOutputEvent_Initialize (struct Event *event, struct Nugget *nugget) |
Initialize an event output message. | |
SO_PUBLIC struct Message * | MessageOutputLog_Initialize (struct MessageLogSubmission *log, struct Nugget *nugget) |
Initialize a log output message. | |
SO_PUBLIC struct Message * | MessageOutputInspection_Initialize (struct Nugget *nugget, struct BlockId *blockId, uint8_t reason, bool final) |
Initialize an inspection status output message. |
Razorback API messages.
#define MESSAGE_GROUP_C_AND_C 0x10000000 |
Message Groups.
Command And Control
#define MESSAGE_TYPE_ALERT_PRIMARY ( MESSAGE_GROUP_OUTPUT | 1 ) |
Output Messages.
Block turns to bad
#define MESSAGE_TYPE_BLOCK ( MESSAGE_GROUP_SUBMIT | 1 ) |
Submission Messages.
Data Block Submission
#define MESSAGE_TYPE_HELLO ( MESSAGE_GROUP_C_AND_C | 1 ) |
Command And Control Messages.
Hello Message
#define MESSAGE_TYPE_REQ ( MESSAGE_GROUP_CACHE | 1 ) |
Global Cache Messages.
Global Cache Request
SO_PUBLIC bool Message_Add_Header | ( | struct List * | headers, | |
const char * | name, | |||
const char * | value | |||
) |
Add a header to a header list structure.
headers | The header list. | |
name | The header name. | |
value | The header value. |
SO_PUBLIC struct Message* Message_Create_Broadcast | ( | uint32_t | type, | |
uint32_t | version, | |||
size_t | msgSize, | |||
const uuid_t | source | |||
) | [read] |
SO_PUBLIC struct Message* Message_Create_Directed | ( | uint32_t | type, | |
uint32_t | version, | |||
size_t | msgSize, | |||
const uuid_t | source, | |||
const uuid_t | dest | |||
) | [read] |
SO_PUBLIC bool Message_Deserialize_Empty | ( | struct Message * | message, | |
int | mode | |||
) |
Deserialize an empty message.
message | The message | |
mode | Messaging mode. |
SO_PUBLIC void Message_Destroy | ( | struct Message * | message | ) |
Destroy a message.
message | The message to destroy. |
SO_PUBLIC bool Message_Get_Nuggets | ( | struct Message * | message, | |
uuid_t | source, | |||
uuid_t | dest | |||
) |
Get nugget ID headers from a message.
message | The message | |
source | The UUID to store the source nugget id in. | |
dest | The UUID to store the destination nugget in. |
SO_PUBLIC struct List* Message_Header_List_Create | ( | void | ) | [read] |
Create a list for storing message headers.
SO_PUBLIC bool Message_Register_Handler | ( | struct MessageHandler * | handler | ) |
Register a message handler.
handler | The handler structure. |
SO_PUBLIC bool Message_Serialize_Empty | ( | struct Message * | message, | |
int | mode | |||
) |
Deserialize an empty message.
message | The message | |
mode | Messaging mode. |
SO_PUBLIC struct Message* MessageAlertChild_Initialize | ( | struct Block * | block, | |
struct Block * | child, | |||
struct Nugget * | nugget, | |||
uint64_t | parentCount, | |||
uint64_t | eventCount, | |||
uint32_t | new_SF_Flags, | |||
uint32_t | new_Ent_Flags, | |||
uint32_t | old_SF_Flags, | |||
uint32_t | old_Ent_Flags | |||
) | [read] |
Initialize a child alert message.
block | The block that has changed state. | |
child | The child block that triggered the state change. | |
nugget | The nugget that sent the alert. | |
parentCount | The number of blocks that have this block as a parent. | |
eventCount | The number of events associated with this block. | |
new_SF_Flags | Post alert block SF Flags | |
new | Ent_Flags Post alert block Enterprise flags. | |
old_SF_Flags | Pre alert block SF Flags | |
old_Ent_Flags | Pre alert block Enterprise flags. |
SO_PUBLIC struct Message* MessageAlertPrimary_Initialize | ( | struct Event * | event, | |
struct Block * | block, | |||
struct List * | metadata, | |||
struct Nugget * | nugget, | |||
struct Judgment * | judgment, | |||
uint32_t | new_SF_Flags, | |||
uint32_t | new_Ent_Flags, | |||
uint32_t | old_SF_Flags, | |||
uint32_t | old_Ent_Flags | |||
) | [read] |
Initialize a primary alert message.
event | The event that triggered inspection | |
block | The block that triggered the alert. | |
metadata | The alert metadata. | |
nugget | The inspector that triggered the alert. | |
judgment | The judgment data from the inspector. | |
new_SF_Flags | Post alert block SF Flags | |
new | Ent_Flags Post alert block Enterprise flags. | |
old_SF_Flags | Pre alert block SF Flags | |
old_Ent_Flags | Pre alert block Enterprise flags. |
SO_PUBLIC struct Message* MessageBlockSubmission_Initialize | ( | struct Event * | event, | |
uint32_t | reason, | |||
uint8_t | locality | |||
) | [read] |
Initializes message block submission.
event | The event | |
reason | The submission reason | |
locality | The locality the block was stored in. |
SO_PUBLIC struct Message* MessageBye_Initialize | ( | const uuid_t | sourceNugget | ) | [read] |
Initializes a bye message.
sourceNugget | the source |
SO_PUBLIC struct Message* MessageCacheClear_Initialize | ( | const uuid_t | sourceNugget | ) | [read] |
Initialize a cache clear message.
sourceNugget | the source |
SO_PUBLIC struct Message* MessageCacheReq_Initialize | ( | const uuid_t | requestorUUID, | |
const struct BlockId * | blockId | |||
) | [read] |
Initializes message cache request.
requestorUUID | the requester | |
blockId | the block id |
SO_PUBLIC struct Message* MessageCacheResp_Initialize | ( | const struct BlockId * | blockId, | |
uint32_t | sfFlags, | |||
uint32_t | entFlags | |||
) | [read] |
Initializes message cache response.
iblockId | the block id | |
sfFlags | the code | |
entFlags | the code |
SO_PUBLIC struct Message* MessageConfigurationAck_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | sestNugget, | |||
const uuid_t | nuggetType, | |||
const uuid_t | applicationType | |||
) | [read] |
Initializes a configuration acknowledgment message.
sourceNugget | the source | |
destNugget | the destination | |
nuggetType | the type of nugget | |
applicationType | the application type |
SO_PUBLIC struct Message* MessageConfigurationUpdate_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a configuration update message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessageError_Initialize | ( | uint32_t | errorCode, | |
const char * | message, | |||
const uuid_t | sourceNugget, | |||
const uuid_t | destNugget | |||
) | [read] |
Initialize an error message.
errorCode | The error code | |
message | The message text | |
sourceNugget | The source | |
destNugget | The destination |
SO_PUBLIC struct Message* MessageGo_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a go message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessageHello_Initialize | ( | struct RazorbackContext * | context | ) | [read] |
Initializes a hello message.
context | The context of this message. |
SO_PUBLIC struct Message* MessageInspectionSubmission_Initialize | ( | const struct Event * | event, | |
uint32_t | reason, | |||
uint32_t | localityCount, | |||
uint8_t * | localities | |||
) | [read] |
Initializes message inspection submission.
event | The event | |
reason | the reason | |
localityCount | The number of localities the block is stored in | |
locality | Array of localities the block is stored in |
SO_PUBLIC struct Message* MessageJudgmentSubmission_Initialize | ( | uint8_t | reason, | |
struct Judgment * | judgment | |||
) | [read] |
Initializes message block submission.
reason | The judgment type. | |
judgment | The judgment data. |
SO_PUBLIC struct Message* MessageLog_Initialize | ( | const uuid_t | nuggetId, | |
uint8_t | priority, | |||
char * | message, | |||
struct EventId * | eventId | |||
) | [read] |
Initialize a log message.
nuggetId | The source nugget. | |
priority | The message level | |
message | The message text. | |
eventId | The optional event id, use NULL if no event is linked to this log message. |
SO_PUBLIC struct Message* MessageOutputEvent_Initialize | ( | struct Event * | event, | |
struct Nugget * | nugget | |||
) | [read] |
Initialize an event output message.
event | The event that has occurred. | |
nugget | The nugget that created the event. |
SO_PUBLIC struct Message* MessageOutputInspection_Initialize | ( | struct Nugget * | nugget, | |
struct BlockId * | blockId, | |||
uint8_t | reason, | |||
bool | final | |||
) | [read] |
Initialize an inspection status output message.
nugget | The nugget that is inspecting the block | |
blockId | The block ID of the block being inspected. | |
reason | The reason for this output. | |
final | Is this the last inspection to complete. |
SO_PUBLIC struct Message* MessageOutputLog_Initialize | ( | struct MessageLogSubmission * | log, | |
struct Nugget * | nugget | |||
) | [read] |
Initialize a log output message.
log | The log message received to be output | |
nugget | The nugget that sent the log message. |
SO_PUBLIC struct Message* MessagePause_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a pause message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessagePaused_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a paused message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessageRegistrationRequest_Initialize | ( | const uuid_t | dispatcherId, | |
const uuid_t | sourceNugget, | |||
const uuid_t | nuggetType, | |||
const uuid_t | applicationType, | |||
uint32_t | dataTypeCount, | |||
uuid_t * | dataTypeList | |||
) | [read] |
Initializes a registration request message.
disptacherId | Dispatcher to send the request to. | |
sourceNugget | the source | |
nuggetTye | the nugget type | |
applicationType | the application type | |
dataTypeCount | the number of data types | |
dataTypeList | the data types |
SO_PUBLIC struct Message* MessageRegistrationResponse_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a registration response message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessageReReg_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initialize a re-registration message.
sourceNugget | The source | |
destNugget | The destination |
SO_PUBLIC struct Message* MessageRunning_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget | |||
) | [read] |
Initializes a running message.
sourceNugget | the source | |
destNugget | the destination |
SO_PUBLIC struct Message* MessageTerminate_Initialize | ( | const uuid_t | sourceNugget, | |
const uuid_t | destNugget, | |||
const uint8_t * | reason | |||
) | [read] |
Initializes a terminate message.
sourceNugget | the source | |
destNugget | the destination | |
reason | the reason |