-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Npfreview - ALTQ integration in NPF #41
Open
Emmankoko
wants to merge
51
commits into
NetBSD:trunk
Choose a base branch
from
Emmankoko:npfreview
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,419
−141
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
d9c7834
Compile-time error fix in altq
Emmankoko ffcb3f9
Plain grammar for ALTQ configuration in /etc/npf.conf
Emmankoko 2fd15e9
Integrate NPF into ALTQ: might be a goodbye for PF & ALTQ
Emmankoko e129664
kernel component that loads altq configurations into altq framework
Emmankoko fe498ea
Userland code parses the altq configurations and sends to kernel
Emmankoko f76fd61
userland code to append queue to rule
Emmankoko fd84198
kernel code to append queue to a rule
Emmankoko 4a5b362
flushing config with altq
Emmankoko 5cc7846
starting ALTQ in npf
Emmankoko 6cbbed7
stop queueing
Emmankoko 2f2f046
print statistics on queueing and filtering
Emmankoko 9599712
show altq using npfctl show -q
Emmankoko d9ba839
fix err, return parens, sizeof args, and copyright issues
Emmankoko 7f07037
proper spacing between functions
Emmankoko cbfff41
fix whitespaces
Emmankoko e7216e7
fix copyright
Emmankoko 86cd137
Revert "Compile-time error fix in altq" and return 0
Emmankoko ebae4b6
fix whitespaces
Emmankoko 7051f34
use right copyright details
Emmankoko a899c77
fix whitespace in scanner
Emmankoko e80bde5
fix whitespace in scanner
Emmankoko 60ebc66
align bw spec whitespace
Emmankoko 403fe9a
use sized types for queue opts
Emmankoko 8f35381
put everything in ALTQ defined block
Emmankoko 40efed2
fix whitespace in npftest Makefile
Emmankoko 7733e69
proper spacing in rule queue
Emmankoko 0273dcc
full stop in copyright detail
Emmankoko f8014a9
clear verbosity
Emmankoko 7bd6cea
fix whitespace: put comments beside
Emmankoko 70646c2
rightly align fields
Emmankoko c1d4d29
use right comment indennt
Emmankoko 52e2d09
no cast in malloc, use sizeof(dest), and uintX_t
Emmankoko 7018fa1
single responsibility principle: expand_altq
Emmankoko 1c55bfd
quest for shorter functions: extract queue appending from expand queue
Emmankoko ea45bd1
misc: fix missing return type on setqueue
Emmankoko 8ea898a
add npf stuff to expected symbols
Emmankoko 77dffed
single responsibility principle: extract scheduler check from expand …
Emmankoko 48a3a26
fix sizeof and err in npfctl_qstats
Emmankoko 1f609c7
terminating #ifndef in npf_altq.h
Emmankoko 552e5f3
rename opts to use right objs
Emmankoko 85c7657
define opt in kernel option
Emmankoko eba2b11
terminate kernelndef
Emmankoko 61e41c9
minor fix in npfaltq func prototype
Emmankoko 0c6caed
provide def for npf_qid_unref
Emmankoko 4c26bec
fix bad *
Emmankoko 1442253
comment space
Emmankoko 70df3d0
remove comment
Emmankoko a2b3961
use right open_dev sig
Emmankoko bcb24ec
match build rule sig
Emmankoko 3b9f162
fis minors spell and copyright
Emmankoko 0cb00a6
define struct segment
Emmankoko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,11 @@ __KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.28 2021/09/21 14:30:15 christos Exp | |
#include "pf.h" | ||
#endif | ||
|
||
#ifndef NPF | ||
#define NPF 1 | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed? |
||
|
||
|
||
#ifdef ALTQ_PRIQ /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */ | ||
|
||
#include <sys/param.h> | ||
|
@@ -56,9 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.28 2021/09/21 14:30:15 christos Exp | |
#include <net/if.h> | ||
#include <netinet/in.h> | ||
|
||
#if NPF > 0 | ||
#include <net/pfvar.h> | ||
#endif | ||
#include <net/npf/npf_altq.h> | ||
#include <altq/altq.h> | ||
#include <altq/altq_conf.h> | ||
#include <altq/altq_priq.h> | ||
|
@@ -105,9 +108,8 @@ altqdev_decl(priq); | |
static struct priq_if *pif_list = NULL; | ||
#endif /* ALTQ3_COMPAT */ | ||
|
||
#if NPF > 0 | ||
int | ||
priq_pfattach(struct pf_altq *a) | ||
priq_npfattach(struct npf_altq *a) | ||
{ | ||
struct ifnet *ifp; | ||
int s, error; | ||
|
@@ -122,7 +124,7 @@ priq_pfattach(struct pf_altq *a) | |
} | ||
|
||
int | ||
priq_add_altq(struct pf_altq *a) | ||
priq_add_altq(struct npf_altq *a) | ||
{ | ||
struct priq_if *pif; | ||
struct ifnet *ifp; | ||
|
@@ -139,14 +141,14 @@ priq_add_altq(struct pf_altq *a) | |
pif->pif_maxpri = -1; | ||
pif->pif_ifq = &ifp->if_snd; | ||
|
||
/* keep the state in pf_altq */ | ||
/* keep the state in npf_altq */ | ||
a->altq_disc = pif; | ||
|
||
return (0); | ||
} | ||
|
||
int | ||
priq_remove_altq(struct pf_altq *a) | ||
priq_remove_altq(struct npf_altq *a) | ||
{ | ||
struct priq_if *pif; | ||
|
||
|
@@ -161,7 +163,7 @@ priq_remove_altq(struct pf_altq *a) | |
} | ||
|
||
int | ||
priq_add_queue(struct pf_altq *a) | ||
priq_add_queue(struct npf_altq *a) | ||
{ | ||
struct priq_if *pif; | ||
struct priq_class *cl; | ||
|
@@ -188,7 +190,7 @@ priq_add_queue(struct pf_altq *a) | |
} | ||
|
||
int | ||
priq_remove_queue(struct pf_altq *a) | ||
priq_remove_queue(struct npf_altq *a) | ||
{ | ||
struct priq_if *pif; | ||
struct priq_class *cl; | ||
|
@@ -203,7 +205,7 @@ priq_remove_queue(struct pf_altq *a) | |
} | ||
|
||
int | ||
priq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes) | ||
priq_getqstats(struct npf_altq *a, void *ubuf, int *nbytes) | ||
{ | ||
struct priq_if *pif; | ||
struct priq_class *cl; | ||
|
@@ -227,7 +229,6 @@ priq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes) | |
*nbytes = sizeof(stats); | ||
return (0); | ||
} | ||
#endif /* NPF > 0 */ | ||
|
||
/* | ||
* bring the interface back to the initial state by discarding | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?