aboutsummaryrefslogtreecommitdiff
path: root/lib/libpfctl
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2021-11-05 08:37:56 +0000
committerKristof Provost <kp@FreeBSD.org>2021-11-05 08:39:56 +0000
commit7bb3c927f7d9c48b356b4d20907b813f9b83273b (patch)
treeb1f48572e67262902ed0aaca23047f3f57d84451 /lib/libpfctl
parent508161111dc23cee0a41fa70de865743c694502f (diff)
downloadsrc-7bb3c927f7d9c48b356b4d20907b813f9b83273b.tar.gz
src-7bb3c927f7d9c48b356b4d20907b813f9b83273b.zip
libpfct: be consistent with u_int vs. uint
Always use uint64_t over u_int64_t, for the sake of consistency. No functional change. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'lib/libpfctl')
-rw-r--r--lib/libpfctl/libpfctl.c34
-rw-r--r--lib/libpfctl/libpfctl.h128
2 files changed, 81 insertions, 81 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 9abfbdce8cf1..da7c27522fd2 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -61,7 +61,7 @@ static int _pfctl_clear_states(int , const struct pfctl_kill *,
static void
pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems,
- u_int8_t *numbers, size_t *nelems)
+ uint8_t *numbers, size_t *nelems)
{
const uint64_t *tmp;
size_t elems;
@@ -78,7 +78,7 @@ pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems,
static void
pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems,
- u_int16_t *numbers, size_t *nelems)
+ uint16_t *numbers, size_t *nelems)
{
const uint64_t *tmp;
size_t elems;
@@ -95,7 +95,7 @@ pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems,
static void
pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems,
- u_int32_t *numbers, size_t *nelems)
+ uint32_t *numbers, size_t *nelems)
{
const uint64_t *tmp;
size_t elems;
@@ -112,7 +112,7 @@ pf_nvuint_32_array(const nvlist_t *nvl, const char *name, size_t maxelems,
static void
pf_nvuint_64_array(const nvlist_t *nvl, const char *name, size_t maxelems,
- u_int64_t *numbers, size_t *nelems)
+ uint64_t *numbers, size_t *nelems)
{
const uint64_t *tmp;
size_t elems;
@@ -304,7 +304,7 @@ static void
pfctl_nv_add_rule_addr(nvlist_t *nvparent, const char *name,
const struct pf_rule_addr *addr)
{
- u_int64_t ports[2];
+ uint64_t ports[2];
nvlist_t *nvl = nvlist_create(0);
pfctl_nv_add_addr_wrap(nvl, "addr", &addr->addr);
@@ -345,7 +345,7 @@ static void
pfctl_nv_add_pool(nvlist_t *nvparent, const char *name,
const struct pfctl_pool *pool)
{
- u_int64_t ports[2];
+ uint64_t ports[2];
nvlist_t *nvl = nvlist_create(0);
nvlist_add_binary(nvl, "key", &pool->key, sizeof(pool->key));
@@ -394,7 +394,7 @@ static void
pfctl_nv_add_uid(nvlist_t *nvparent, const char *name,
const struct pf_rule_uid *uid)
{
- u_int64_t uids[2];
+ uint64_t uids[2];
nvlist_t *nvl = nvlist_create(0);
uids[0] = uid->uid[0];
@@ -542,11 +542,11 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule)
int
pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor,
- const char *anchor_call, u_int32_t ticket, u_int32_t pool_ticket)
+ const char *anchor_call, uint32_t ticket, uint32_t pool_ticket)
{
struct pfioc_nv nv;
- u_int64_t timeouts[PFTM_MAX];
- u_int64_t set_prio[2];
+ uint64_t timeouts[PFTM_MAX];
+ uint64_t set_prio[2];
nvlist_t *nvl, *nvlr;
size_t labelcount;
int ret;
@@ -662,15 +662,15 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor,
}
int
-pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, const char *anchor,
- u_int32_t ruleset, struct pfctl_rule *rule, char *anchor_call)
+pfctl_get_rule(int dev, uint32_t nr, uint32_t ticket, const char *anchor,
+ uint32_t ruleset, struct pfctl_rule *rule, char *anchor_call)
{
return (pfctl_get_clear_rule(dev, nr, ticket, anchor, ruleset, rule,
anchor_call, false));
}
-int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket,
- const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule,
+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)
{
struct pfioc_nv nv;
@@ -947,7 +947,7 @@ pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed)
}
static int
-pfctl_get_limit(int dev, const int index, u_int *limit)
+pfctl_get_limit(int dev, const int index, uint *limit)
{
struct pfioc_limit pl;
@@ -968,7 +968,7 @@ pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s)
struct pfioc_nv nv;
nvlist_t *nvl;
int ret;
- u_int state_limit;
+ uint state_limit;
ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit);
if (ret != 0)
@@ -998,7 +998,7 @@ pfctl_get_syncookies(int dev, struct pfctl_syncookies *s)
struct pfioc_nv nv;
nvlist_t *nvl;
int ret;
- u_int state_limit;
+ uint state_limit;
bool enabled, adaptive;
ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit);
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 71806ed217ee..6b516b0a7649 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -72,8 +72,8 @@ struct pfctl_pool {
struct pf_addr counter;
struct pf_mape_portset mape;
int tblidx;
- u_int16_t proxy_port[2];
- u_int8_t opts;
+ uint16_t proxy_port[2];
+ uint8_t opts;
};
struct pfctl_rule {
@@ -81,7 +81,7 @@ struct pfctl_rule {
struct pf_rule_addr dst;
union pf_rule_ptr skip[PF_SKIP_COUNT];
char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE];
- u_int32_t ridentifier;
+ uint32_t ridentifier;
char ifname[IFNAMSIZ];
char qname[PF_QNAME_SIZE];
char pqname[PF_QNAME_SIZE];
@@ -93,9 +93,9 @@ struct pfctl_rule {
TAILQ_ENTRY(pfctl_rule) entries;
struct pfctl_pool rpool;
- u_int64_t evaluations;
- u_int64_t packets[2];
- u_int64_t bytes[2];
+ uint64_t evaluations;
+ uint64_t packets[2];
+ uint64_t bytes[2];
struct pfi_kif *kif;
struct pfctl_anchor *anchor;
@@ -104,22 +104,22 @@ struct pfctl_rule {
pf_osfp_t os_fingerprint;
int rtableid;
- u_int32_t timeout[PFTM_MAX];
- u_int32_t max_states;
- u_int32_t max_src_nodes;
- u_int32_t max_src_states;
- u_int32_t max_src_conn;
+ uint32_t timeout[PFTM_MAX];
+ uint32_t max_states;
+ uint32_t max_src_nodes;
+ uint32_t max_src_states;
+ uint32_t max_src_conn;
struct {
- u_int32_t limit;
- u_int32_t seconds;
+ uint32_t limit;
+ uint32_t seconds;
} max_src_conn_rate;
- u_int32_t qid;
- u_int32_t pqid;
- u_int16_t dnpipe;
- u_int16_t dnrpipe;
- u_int32_t free_flags;
- u_int32_t nr;
- u_int32_t prob;
+ uint32_t qid;
+ uint32_t pqid;
+ uint16_t dnpipe;
+ uint16_t dnrpipe;
+ uint32_t free_flags;
+ uint32_t nr;
+ uint32_t prob;
uid_t cuid;
pid_t cpid;
@@ -127,49 +127,49 @@ struct pfctl_rule {
uint64_t states_tot;
uint64_t src_nodes;
- u_int16_t return_icmp;
- u_int16_t return_icmp6;
- u_int16_t max_mss;
- u_int16_t tag;
- u_int16_t match_tag;
- u_int16_t scrub_flags;
+ uint16_t return_icmp;
+ uint16_t return_icmp6;
+ uint16_t max_mss;
+ uint16_t tag;
+ uint16_t match_tag;
+ uint16_t scrub_flags;
struct pf_rule_uid uid;
struct pf_rule_gid gid;
- u_int32_t rule_flag;
- u_int8_t action;
- u_int8_t direction;
- u_int8_t log;
- u_int8_t logif;
- u_int8_t quick;
- u_int8_t ifnot;
- u_int8_t match_tag_not;
- u_int8_t natpass;
-
- u_int8_t keep_state;
+ uint32_t rule_flag;
+ uint8_t action;
+ uint8_t direction;
+ uint8_t log;
+ uint8_t logif;
+ uint8_t quick;
+ uint8_t ifnot;
+ uint8_t match_tag_not;
+ uint8_t natpass;
+
+ uint8_t keep_state;
sa_family_t af;
- u_int8_t proto;
- u_int8_t type;
- u_int8_t code;
- u_int8_t flags;
- u_int8_t flagset;
- u_int8_t min_ttl;
- u_int8_t allow_opts;
- u_int8_t rt;
- u_int8_t return_ttl;
- u_int8_t tos;
- u_int8_t set_tos;
- u_int8_t anchor_relative;
- u_int8_t anchor_wildcard;
-
- u_int8_t flush;
- u_int8_t prio;
- u_int8_t set_prio[2];
+ uint8_t proto;
+ uint8_t type;
+ uint8_t code;
+ uint8_t flags;
+ uint8_t flagset;
+ uint8_t min_ttl;
+ uint8_t allow_opts;
+ uint8_t rt;
+ uint8_t return_ttl;
+ uint8_t tos;
+ uint8_t set_tos;
+ uint8_t anchor_relative;
+ uint8_t anchor_wildcard;
+
+ uint8_t flush;
+ uint8_t prio;
+ uint8_t set_prio[2];
struct {
struct pf_addr addr;
- u_int16_t port;
+ uint16_t port;
} divert;
};
@@ -181,13 +181,13 @@ struct pfctl_ruleset {
struct {
struct pfctl_rulequeue *ptr;
struct pfctl_rule **ptr_array;
- u_int32_t rcount;
- u_int32_t ticket;
+ uint32_t rcount;
+ uint32_t ticket;
int open;
} active, inactive;
} rules[PF_RULESET_MAX];
struct pfctl_anchor *anchor;
- u_int32_t tticket;
+ uint32_t tticket;
int tables;
int topen;
};
@@ -291,15 +291,15 @@ struct pfctl_syncookies {
struct pfctl_status* pfctl_get_status(int dev);
void pfctl_free_status(struct pfctl_status *status);
-int pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket,
- const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule,
+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_clear_rule(int dev, u_int32_t nr, u_int32_t ticket,
- const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule,
+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);
int pfctl_add_rule(int dev, const struct pfctl_rule *r,
- const char *anchor, const char *anchor_call, u_int32_t ticket,
- u_int32_t pool_ticket);
+ const char *anchor, const char *anchor_call, uint32_t ticket,
+ uint32_t pool_ticket);
int pfctl_set_keepcounters(int dev, bool keep);
int pfctl_get_states(int dev, struct pfctl_states *states);
void pfctl_free_states(struct pfctl_states *states);