const struct config_filter *filter,
bool write_named_filters)
{
- if (filter->service != NULL) {
- if (filter->service[0] != '!') {
+ if (filter->protocol != NULL) {
+ if (filter->protocol[0] != '!') {
str_printfa(str, "protocol=\"%s\" AND ",
- wildcard_str_escape(filter->service));
+ wildcard_str_escape(filter->protocol));
} else {
str_printfa(str, "NOT protocol=\"%s\" AND ",
- wildcard_str_escape(filter->service + 1));
+ wildcard_str_escape(filter->protocol + 1));
}
}
if (filter->local_name != NULL) {
/* first filter should be the global one */
i_assert(ctx.filters[0] != NULL &&
- ctx.filters[0]->filter.service == NULL);
+ ctx.filters[0]->filter.protocol == NULL);
uint32_t max_filter_count = 0;
while (ctx.filters[max_filter_count] != NULL) max_filter_count++;
static int config_filter_match_service(const struct config_filter *mask,
const struct config_filter *filter)
{
- if (mask->service != NULL) {
- if (filter->service == NULL)
+ if (mask->protocol != NULL) {
+ if (filter->protocol == NULL)
return -1;
- if (mask->service[0] == '!') {
- /* not service */
- if (strcmp(filter->service, mask->service + 1) == 0)
+ if (mask->protocol[0] == '!') {
+ /* not protocol */
+ if (strcmp(filter->protocol, mask->protocol + 1) == 0)
return 0;
} else {
- if (strcmp(filter->service, mask->service) != 0)
+ if (strcmp(filter->protocol, mask->protocol) != 0)
return 0;
}
}
bool config_filters_equal_no_recursion(const struct config_filter *f1,
const struct config_filter *f2)
{
- if (null_strcmp(f1->service, f2->service) != 0)
+ if (null_strcmp(f1->protocol, f2->protocol) != 0)
return FALSE;
if (f1->remote_bits != f2->remote_bits)
p_strdup_printf(pool, "%s/%s", key, value);
filter->filter_name_array = TRUE;
} else if (strcmp(key, "protocol") == 0) {
- if (parent->service != NULL)
+ if (parent->protocol != NULL)
*error_r = "Nested protocol { protocol { .. } } block not allowed";
else if (parent->filter_name != NULL)
*error_r = t_strdup_printf(
t_strcut(parent->filter_name, '/'),
t_strcut(parent->filter_name, '/'));
else
- filter->service = p_strdup(pool, value);
+ filter->protocol = p_strdup(pool, value);
} else if (strcmp(key, "local") == 0) {
if (parent->remote_bits > 0)
*error_r = "remote { local { .. } } not allowed (use local { remote { .. } } instead)";
- else if (parent->service != NULL)
+ else if (parent->protocol != NULL)
*error_r = "protocol { local { .. } } not allowed (use local { protocol { .. } } instead)";
else if (parent->local_name != NULL)
*error_r = "local_name { local { .. } } not allowed (use local { local_name { .. } } instead)";
} else if (strcmp(key, "local_name") == 0) {
if (parent->remote_bits > 0)
*error_r = "remote { local_name { .. } } not allowed (use local_name { remote { .. } } instead)";
- else if (parent->service != NULL)
+ else if (parent->protocol != NULL)
*error_r = "protocol { local_name { .. } } not allowed (use local_name { protocol { .. } } instead)";
else if (parent->filter_name != NULL)
*error_r = p_strdup_printf(pool,
else
filter->local_name = p_strdup(pool, value);
} else if (strcmp(key, "remote") == 0) {
- if (parent->service != NULL)
+ if (parent->protocol != NULL)
*error_r = "protocol { remote { .. } } not allowed (use remote { protocol { .. } } instead)";
else if (parent->filter_name != NULL)
*error_r = p_strdup_printf(pool,
event = event_create(event);
for (filter = &filter_parser->filter; filter != NULL; filter = filter->parent) {
- if (filter->service != NULL)
- event_add_str(event, "protocol", filter->service);
+ if (filter->protocol != NULL)
+ event_add_str(event, "protocol", filter->protocol);
if (filter->local_name != NULL)
event_add_str(event, "local_name", filter->local_name);
if (filter->local_bits > 0)
struct config_filter *filter = §ion->filter_parser->filter;
do {
- if (filter->service != NULL ||
+ if (filter->protocol != NULL ||
filter->local_name != NULL ||
filter->local_host != NULL ||
filter->remote_host != NULL ||