| 605 | } |
| 606 | |
| 607 | static 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 | |
| 620 | static inline int check_against_rule_list(struct ip_addr *ip, str *text, |
no test coverage detected