Lines Matching full:rule

121     "QU", "Number of times a rule has been applied");
144 #define FEEDBACK_RULE(rule, msg) \
147 (rule).syntax_len, (rule).syntax_begin \
150 #define FEEDBACK_PFIL(pfil_type, pfil_flags, ifp, rule, msg) \
159 (rule).syntax_len, (rule).syntax_begin \
166 struct rule;
167 typedef struct mbuf * (*op_t)(struct mbuf *, struct rule *);
168 struct rule {
179 dmb_m_pull_head(struct mbuf *m, struct rule *rule)
184 count = (int)strtol(rule->opargs, NULL, 10);
213 dmb_m_enlarge(struct mbuf *m, struct rule *rule)
218 size = (int)strtol(rule->opargs, NULL, 10);
244 read_rule(const char **cur, struct rule *rule, bool *eof)
248 rule->syntax_begin = NULL;
249 rule->syntax_len = 0;
257 rule->syntax_begin = *cur;
258 rule->syntax_len = strlen(rule->syntax_begin);
264 rule->syntax_len = (int)(delim - *cur + 1);
268 rule->pfil_type = PFIL_TYPE_IP6;
271 rule->pfil_type = PFIL_TYPE_IP4;
274 rule->pfil_type = PFIL_TYPE_ETHERNET;
284 rule->pfil_dir = PFIL_IN;
287 rule->pfil_dir = PFIL_OUT;
300 if (len >= sizeof(rule->ifname))
302 strncpy(rule->ifname, *cur, len);
303 rule->ifname[len] = 0;
310 rule->op = dmb_m_pull_head;
313 rule->op = dmb_m_enlarge;
324 rule->opargs = *cur;
326 /* the next rule & eof */
340 struct rule rule;
345 while (!eof && (parsed = read_rule(&cursor, &rule, &eof))) {
350 FEEDBACK_RULE(rule, "rule parsing failed");
364 struct rule rule;
369 while (!eof && (parsed = read_rule(&cursor, &rule, &eof))) {
370 if (rule.pfil_type == pfil_type &&
371 rule.pfil_dir == (flags & rule.pfil_dir) &&
372 strcmp(rule.ifname, ifp->if_xname) == 0) {
373 m = rule.op(m, &rule);
375 FEEDBACK_PFIL(pfil_type, flags, ifp, rule,
383 FEEDBACK_PFIL(pfil_type, flags, ifp, rule,
384 "rule parsing failed");