28 #ifndef AWS_IOT_DEFENDER_H_ 29 #define AWS_IOT_DEFENDER_H_ 32 #include "iot_config.h" 57 #define AWS_IOT_DEFENDER_FORMAT_CBOR 1 58 #define AWS_IOT_DEFENDER_FORMAT_JSON 2 71 #define AWS_IOT_DEFENDER_METRICS_ALL 0xffffffff 73 #define AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_TOTAL 0x00000001 74 #define AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_REMOTE_ADDR 0x00000004 80 #define AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_CONNECTIONS \ 81 ( AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_REMOTE_ADDR ) \ 87 #define AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED \ 88 ( AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_CONNECTIONS | AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS_ESTABLISHED_TOTAL ) \ 99 #define AWS_IOT_DEFENDER_CALLBACK_INITIALIZER \ 101 .pCallbackContext = NULL, \ 104 #define AWS_IOT_DEFENDER_START_INFO_INITIALIZER \ 105 { .pClientIdentifier = NULL, \ 106 .clientIdentifierLength = 0, \ 107 .mqttConnection = IOT_MQTT_CONNECTION_INITIALIZER, \ 108 .callback = AWS_IOT_DEFENDER_CALLBACK_INITIALIZER \ 173 typedef struct AwsIotDefenderCallbackInfo
186 typedef struct AwsIotDefenderCallback
189 void ( *
function )(
void *,
197 typedef struct AwsIotDefenderStartInfo
size_t metricsReportLength
Definition: aws_iot_defender.h:176
uint32_t AwsIotDefender_GetPeriod(void)
Get period in seconds.
AwsIotDefenderError_t AwsIotDefender_SetPeriod(uint32_t periodSeconds)
Set period in seconds.
void AwsIotDefender_Stop(void)
Stop the defender agent.
uint16_t clientIdentifierLength
Length of IotMqttConnectInfo_t.pClientIdentifier (required).
Definition: aws_iot_defender.h:200
Definition: aws_iot_defender.h:158
User provided callback handle.
Definition: aws_iot_defender.h:186
size_t payloadLength
Definition: aws_iot_defender.h:178
Definition: aws_iot_defender.h:141
const uint8_t * pMetricsReport
Definition: aws_iot_defender.h:175
Definition: aws_iot_defender.h:145
Definition: aws_iot_defender.h:155
AwsIotDefenderEventType_t
Event codes passed into AwsIotDefenderCallbackInfo_t.
Definition: aws_iot_defender.h:153
Definition: aws_iot_defender.h:144
const char * pClientIdentifier
MQTT client identifier (required).
Definition: aws_iot_defender.h:199
const uint8_t * pPayload
Definition: aws_iot_defender.h:177
AwsIotDefenderCallback_t callback
Definition: aws_iot_defender.h:202
AwsIotDefenderError_t
Return codes of defender functions.
Definition: aws_iot_defender.h:139
struct _mqttConnection * IotMqttConnection_t
Definition: aws_iot_defender.h:142
AwsIotDefenderError_t AwsIotDefender_SetMetrics(AwsIotDefenderMetricsGroup_t metricsGroup, uint32_t metrics)
Set metrics that defender agent needs to collect for a metrics group.
const char * AwsIotDefender_EventType(AwsIotDefenderEventType_t eventType)
Return a string that describes AwsIotDefenderEventType_t.
Parameters of AwsIotDefender_Start function.
Definition: aws_iot_defender.h:197
const char * AwsIotDefender_strerror(AwsIotDefenderError_t error)
Return a string that describes AwsIotDefenderError_t.
IotMqttConnection_t mqttConnection
MQTT connection used by defender (required).
Definition: aws_iot_defender.h:201
Definition: aws_iot_defender.h:156
AwsIotDefenderError_t AwsIotDefender_Start(AwsIotDefenderStartInfo_t *pStartInfo)
Start the defender agent.
Callback parameters.
Definition: aws_iot_defender.h:173
Definition: aws_iot_defender.h:143
AwsIotDefenderMetricsGroup_t
Metrics group options for AwsIotDefender_SetMetrics() function.
Definition: aws_iot_defender.h:130
Definition: aws_iot_defender.h:157
void * pCallbackContext
Definition: aws_iot_defender.h:188
AwsIotDefenderEventType_t eventType
Definition: aws_iot_defender.h:179
Definition: aws_iot_defender.h:146
Definition: aws_iot_defender.h:132