#include "xdasd_parse.h"
#include "xdasd_list.h"
#include "xdasd_log.h"
#include <stdio.h>
#include <string.h>
#include <malloc.h>
Go to the source code of this file.
Functions | |
static int | prs_check_key_fields (Parsed *parsed) |
Checks XDAS message key fields to ensure correct format. | |
static void | log_parsed_message (int level, Parsed *pp) |
Log a parsed message to the log file under the given log level. | |
int | xdasd_parse_message (unsigned flags, size_t msgsz, const char *msg, Parsed **parsedp) |
Parse/copy an XDAS message into an allocated Parse structure. | |
void | xdasd_parse_set_log_state (Parsed *parsed, int state) |
Sets the logging state for this message based on the specified state. | |
void | xdasd_parse_set_alarm_severity (Parsed *parsed, int severity) |
Set alarm severity for this message based on the specified severity. | |
int | xdasd_parse_set_trigger (Parsed *parsed, const char *script) |
Add a trigger script to a parsed message. | |
void | xdasd_parse_clear_actions (Parsed *parsed) |
Clear the actions associated with a parsed message. | |
void | xdasd_parse_free (Parsed *parsed) |
Free a parsed message. |
Definition in file xdasd_parse.c.
static void log_parsed_message | ( | int | level, | |
Parsed * | pp | |||
) | [static] |
Log a parsed message to the log file under the given log level.
[in] | level | - the level at which this message should be logged. |
For internal use only.
Definition at line 90 of file xdasd_parse.c.
References parsed_tag::flags, malloc, parsed_tag::msg, parsed_tag::parsed, parsed_tag::severity, parsed_tag::structsz, xdasd_log(), and xdasd_log_level().
Referenced by xdasd_parse_message().
static int prs_check_key_fields | ( | Parsed * | parsed | ) | [static] |
Checks XDAS message key fields to ensure correct format.
XDAS key fields are seven four-byte values in certain fields, including the following: HDR:, ORG:, INT:, TGT:, SRC:, EVT:, and END(0), in the fields numbered: 0, 10, 17, 21, 28, 30, and 32, respectively.
[in] | parsed | - The parsed message to be checked. |
parsed
has all of the correct key fields in the correct locations, False (0) if not.For internal use only.
Definition at line 60 of file xdasd_parse.c.
References parsed_tag::parsed, and xdasd_log().
Referenced by xdasd_parse_message().