Skip to content

Commit

Permalink
Define flow_unlearn_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Apr 11, 2024
1 parent 85ff32b commit ca28d67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kernel/linux/pf_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ typedef enum {
flow_drop_rule,
flow_mark_rule,
flow_pass_rule,
flow_steer_rule
flow_steer_rule,
flow_unlearn_rule
} generic_flow_rule_action_type;

/* Deprecated (Accolade) */
Expand Down
5 changes: 4 additions & 1 deletion userland/examples/pfflow_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ void processPacket(const struct pfring_pkthdr *h,

r->action = flow_drop_rule; /* flow_pass_rule / flow_drop_rule */
r->flow_id = flow_id++;
r->ip_version = h->extended_hdr.parsed_pkt.ip_version;
r->src_ip.v4 = h->extended_hdr.parsed_pkt.ipv4_src;
r->dst_ip.v4 = h->extended_hdr.parsed_pkt.ipv4_dst;
r->src_port = h->extended_hdr.parsed_pkt.l4_src_port;
r->dst_port = h->extended_hdr.parsed_pkt.l4_dst_port;
r->protocol = h->extended_hdr.parsed_pkt.l3_proto;

pfring_add_hw_rule(pd, &rule);
if (pfring_add_hw_rule(pd, &rule) < 0) {
fprintf(stderr, "pfring_add_hw_rule failure\n");
}
}
}

Expand Down

0 comments on commit ca28d67

Please sign in to comment.