libpfctl: add pfctl_get_rule_h()
Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.
While here have pfctl use the new function.
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
@@ -1388,6 +1388,14 @@ pfctl_get_rules_info(int dev __unused, struct pfctl_rules_info *rules, uint32_t
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
pfctl_get_rule_h(struct pfctl_handle *h, uint32_t nr, uint32_t ticket, const char *anchor,
|
||||
uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call)
|
||||
{
|
||||
return (pfctl_get_clear_rule_h(h, nr, ticket, anchor, ruleset, rule,
|
||||
anchor_call, false));
|
||||
}
|
||||
|
||||
int
|
||||
pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, const char *anchor,
|
||||
uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call)
|
||||
|
||||
@@ -420,6 +420,9 @@ int pfctl_get_rules_info(int dev, struct pfctl_rules_info *rules,
|
||||
int pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket,
|
||||
const char *anchor, uint32_t ruleset, struct pfctl_rule *rule,
|
||||
char *anchor_call);
|
||||
int pfctl_get_rule_h(struct pfctl_handle *h, uint32_t nr, uint32_t ticket,
|
||||
const char *anchor, uint32_t ruleset, struct pfctl_rule *rule,
|
||||
char *anchor_call);
|
||||
int pfctl_get_clear_rule(int dev, uint32_t nr, uint32_t ticket,
|
||||
const char *anchor, uint32_t ruleset, struct pfctl_rule *rule,
|
||||
char *anchor_call, bool clear);
|
||||
|
||||
Reference in New Issue
Block a user