aboutsummaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_parser.h
diff options
context:
space:
mode:
authorPatrick Kelsey <pkelsey@FreeBSD.org>2019-01-22 00:50:24 +0000
committerPatrick Kelsey <pkelsey@FreeBSD.org>2019-01-22 00:50:24 +0000
commit1d34c9dac8624c5c315ae39ad3ae8e5879b23256 (patch)
treeeebf17e5106c1c3534789525d94ff99d0093480d /sbin/pfctl/pfctl_parser.h
parentd9463dd4f3ff2096aa6392c128a02e551dc41554 (diff)
downloadsrc-1d34c9dac8624c5c315ae39ad3ae8e5879b23256.tar.gz
src-1d34c9dac8624c5c315ae39ad3ae8e5879b23256.zip
Reduce pf.conf parsing cost for configs that define N queues from O(N^2) to O(N)
The number of syscalls made during parsing of any config that defines tables is also reduced, and incorrect warnings that HFSC parent queue bandwidths were smaller than the sum of their child bandwidths have been fixed. Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18759
Notes
Notes: svn path=/head/; revision=343287
Diffstat (limited to 'sbin/pfctl/pfctl_parser.h')
-rw-r--r--sbin/pfctl/pfctl_parser.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 05ebdf29f6fc..aa6d98d7cf91 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -177,6 +177,24 @@ struct node_queue_opt {
} data;
};
+#define QPRI_BITSET_SIZE 256
+BITSET_DEFINE(qpri_bitset, QPRI_BITSET_SIZE);
+LIST_HEAD(gen_sc, segment);
+
+struct pfctl_altq {
+ struct pf_altq pa;
+ struct {
+ STAILQ_ENTRY(pfctl_altq) link;
+ u_int64_t bwsum;
+ struct qpri_bitset qpris;
+ int children;
+ int root_classes;
+ int default_classes;
+ struct gen_sc lssc;
+ struct gen_sc rtsc;
+ } meta;
+};
+
#ifdef __FreeBSD__
/*
* XXX
@@ -313,10 +331,10 @@ void set_ipmask(struct node_host *, u_int8_t);
int check_netmask(struct node_host *, sa_family_t);
int unmask(struct pf_addr *, sa_family_t);
void ifa_load(void);
-int get_socket_domain(void);
-struct node_host *ifa_exists(const char *);
-struct node_host *ifa_grouplookup(const char *ifa_name, int flags);
-struct node_host *ifa_lookup(const char *, int);
+int get_query_socket(void);
+struct node_host *ifa_exists(char *);
+struct node_host *ifa_grouplookup(char *ifa_name, int flags);
+struct node_host *ifa_lookup(char *, int);
struct node_host *host(const char *);
int append_addr(struct pfr_buffer *, char *, int);