MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / match_bl_rule

Function match_bl_rule

blacklists.c:607–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607static inline int match_bl_rule(struct ip_addr *ip, str *text,
608 unsigned short port,
609 unsigned short proto,
610 struct bl_rule *p)
611{
612 int t_val = (p->port==0 || p->port==port) &&
613 (p->proto==PROTO_NONE || p->proto==proto) &&
614 (matchnet(ip, &(p->ip_net)) == 1) &&
615 (p->body.s==NULL || !fnmatch(p->body.s, text->s, 0));
616 return (!!(p->flags & BLR_APPLY_CONTRARY) ^ !!(t_val));
617}
618
619
620static inline int check_against_rule_list(struct ip_addr *ip, str *text,

Callers 2

check_against_rule_listFunction · 0.85
mi_check_blacklistFunction · 0.85

Calls 1

matchnetFunction · 0.85

Tested by

no test coverage detected