2022-12-29 20:10:36 +02:00
|
|
|
#ifndef _JITTERBUG__MATCH_H
|
|
|
|
#define _JITTERBUG__MATCH_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "wire.h"
|
|
|
|
|
|
|
|
#define MATCH_RULE_MAX 1024
|
|
|
|
#define MATCH_RULE_MAX_ARG 12
|
|
|
|
|
|
|
|
typedef struct match_rule {
|
|
|
|
uint8_t type;
|
|
|
|
bool eavesdrop;
|
2023-01-01 05:22:37 +02:00
|
|
|
char *sender, *interface, *member, *path, *path_namespace, *destination, *arg0namespace, *rule_string;
|
2022-12-29 20:10:36 +02:00
|
|
|
char *arg[MATCH_RULE_MAX_ARG]; /* TODO: spec states that indexes 0 to 63 should be supported */
|
|
|
|
char *arg_path[MATCH_RULE_MAX_ARG]; /* TODO: spec states that indexes 0 to 63 should be supported */
|
|
|
|
} match_rule_t;
|
|
|
|
|
|
|
|
void match_rule_free(match_rule_t *rule);
|
|
|
|
match_rule_t *match_rule_from_string(char *d);
|
|
|
|
int match_rule_check(match_rule_t *rule, wire_message_t *msg, wire_context_t *ctx);
|
|
|
|
|
|
|
|
#endif // _JITTERBUG__MATCH_H
|