Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions distrib/sets/lists/comp/mi
Original file line number Diff line number Diff line change
Expand Up @@ -2762,6 +2762,7 @@
./usr/include/net/net_stats.h comp-c-include
./usr/include/net/netisr.h comp-obsolete obsolete
./usr/include/net/npf.h comp-c-include
./usr/include/net/npf_altq.h comp-c-include
./usr/include/net/npf_ncode.h comp-obsolete obsolete
./usr/include/net/pfil.h comp-c-include
./usr/include/net/pfkeyv2.h comp-c-include
Expand Down
7 changes: 7 additions & 0 deletions lib/libnpf/npf.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,13 @@ npf_rule_setproc(nl_rule_t *rl, const char *name)
return nvlist_error(rl->rule_dict);
}

int
npf_rule_setqueue(nl_rule_t *rl, const char *qname)
{
nvlist_add_string(rl->rule_dict, "queue", qname);
return nvlist_error(rl->rule_dict);
}

void *
npf_rule_export(nl_rule_t *rl, size_t *length)
{
Expand Down
1 change: 1 addition & 0 deletions lib/libnpf/npf.expsym
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ npf_rule_setinfo
npf_rule_setkey
npf_rule_setprio
npf_rule_setproc
npf_rule_setqueue
npf_ruleset_add
npf_ruleset_flush
npf_ruleset_remkey
Expand Down
1 change: 1 addition & 0 deletions lib/libnpf/npf.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ int npf_rule_setprio(nl_rule_t *, int);
int npf_rule_setproc(nl_rule_t *, const char *);
int npf_rule_setkey(nl_rule_t *, const void *, size_t);
int npf_rule_setinfo(nl_rule_t *, const void *, size_t);
int npf_rule_setqueue(nl_rule_t *, const char *);
const char * npf_rule_getname(nl_rule_t *);
uint32_t npf_rule_getattr(nl_rule_t *);
const char * npf_rule_getinterface(nl_rule_t *);
Expand Down
24 changes: 12 additions & 12 deletions sys/altq/altq_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.42 2025/01/08 13:00:04 joe Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
#include "opt_inet.h"
#include "pf.h"
#include "npf.h"
#endif

#ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
Expand All @@ -59,8 +59,8 @@ __KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.42 2025/01/08 13:00:04 joe Exp $");
#include <net/if.h>
#include <netinet/in.h>

#if NPF > 0
#include <net/pfvar.h>
#if NNPF > 0
#include <net/npf/npf_altq.h>
#endif
#include <altq/altq.h>
#include <altq/altq_cbq.h>
Expand Down Expand Up @@ -242,9 +242,9 @@ get_class_stats(class_stats_t *statsp, struct rm_class *cl)
#endif
}

#if NPF > 0
#if NNPF > 0
int
cbq_pfattach(struct pf_altq *a)
cbq_npfattach(struct npf_altq *a)
{
struct ifnet *ifp;
int s, error;
Expand All @@ -259,7 +259,7 @@ cbq_pfattach(struct pf_altq *a)
}

int
cbq_add_altq(struct pf_altq *a)
cbq_add_altq(struct npf_altq *a)
{
cbq_state_t *cbqp;
struct ifnet *ifp;
Expand All @@ -285,7 +285,7 @@ cbq_add_altq(struct pf_altq *a)
}

int
cbq_remove_altq(struct pf_altq *a)
cbq_remove_altq(struct npf_altq *a)
{
cbq_state_t *cbqp;

Expand All @@ -308,12 +308,12 @@ cbq_remove_altq(struct pf_altq *a)

#define NSEC_TO_PSEC(s) ((uint64_t)(s) * 1000)
int
cbq_add_queue(struct pf_altq *a)
cbq_add_queue(struct npf_altq *a)
{
struct rm_class *borrow, *parent;
cbq_state_t *cbqp;
struct rm_class *cl;
struct cbq_opts *opts;
struct npf_cbq_opts *opts;
int i, error;

if ((cbqp = a->altq_disc) == NULL)
Expand Down Expand Up @@ -415,7 +415,7 @@ cbq_add_queue(struct pf_altq *a)
}

int
cbq_remove_queue(struct pf_altq *a)
cbq_remove_queue(struct npf_altq *a)
{
struct rm_class *cl;
cbq_state_t *cbqp;
Expand Down Expand Up @@ -451,7 +451,7 @@ cbq_remove_queue(struct pf_altq *a)
}

int
cbq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
cbq_getqstats(struct npf_altq *a, void *ubuf, int *nbytes)
{
cbq_state_t *cbqp;
struct rm_class *cl;
Expand All @@ -475,7 +475,7 @@ cbq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
*nbytes = sizeof(stats);
return (0);
}
#endif /* NPF > 0 */
#endif /* NNPF > 0 */

/*
* int
Expand Down
24 changes: 12 additions & 12 deletions sys/altq/altq_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.31 2025/01/08 13:00:04 joe Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
#include "opt_inet.h"
#include "pf.h"
#include "npf.h"
#endif

#ifdef ALTQ_HFSC /* hfsc is enabled by ALTQ_HFSC option in opt_altq.h */
Expand All @@ -70,8 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.31 2025/01/08 13:00:04 joe Exp $");
#include <net/if.h>
#include <netinet/in.h>

#if NPF > 0
#include <net/pfvar.h>
#if NNPF > 0
#include <net/npf/npf_altq.h>
#endif
#include <altq/altq.h>
#include <altq/altq_hfsc.h>
Expand Down Expand Up @@ -173,9 +173,9 @@ altqdev_decl(hfsc);
static struct hfsc_if *hif_list = NULL;
#endif /* ALTQ3_COMPAT */

#if NPF > 0
#if NNPF > 0
int
hfsc_pfattach(struct pf_altq *a)
hfsc_npfattach(struct npf_altq *a)
{
struct ifnet *ifp;
int s, error;
Expand All @@ -190,7 +190,7 @@ hfsc_pfattach(struct pf_altq *a)
}

int
hfsc_add_altq(struct pf_altq *a)
hfsc_add_altq(struct npf_altq *a)
{
struct hfsc_if *hif;
struct ifnet *ifp;
Expand Down Expand Up @@ -219,7 +219,7 @@ hfsc_add_altq(struct pf_altq *a)
}

int
hfsc_remove_altq(struct pf_altq *a)
hfsc_remove_altq(struct npf_altq *a)
{
struct hfsc_if *hif;

Expand All @@ -238,11 +238,11 @@ hfsc_remove_altq(struct pf_altq *a)
}

int
hfsc_add_queue(struct pf_altq *a)
hfsc_add_queue(struct npf_altq *a)
{
struct hfsc_if *hif;
struct hfsc_class *cl, *parent;
struct hfsc_opts *opts;
struct npf_hfsc_opts *opts;
struct service_curve rtsc, lssc, ulsc;

if ((hif = a->altq_disc) == NULL)
Expand Down Expand Up @@ -281,7 +281,7 @@ hfsc_add_queue(struct pf_altq *a)
}

int
hfsc_remove_queue(struct pf_altq *a)
hfsc_remove_queue(struct npf_altq *a)
{
struct hfsc_if *hif;
struct hfsc_class *cl;
Expand All @@ -296,7 +296,7 @@ hfsc_remove_queue(struct pf_altq *a)
}

int
hfsc_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
hfsc_getqstats(struct npf_altq *a, void *ubuf, int *nbytes)
{
struct hfsc_if *hif;
struct hfsc_class *cl;
Expand All @@ -320,7 +320,7 @@ hfsc_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
*nbytes = sizeof(stats);
return 0;
}
#endif /* NPF > 0 */
#endif /* NNPF > 0 */

/*
* bring the interface back to the initial state by discarding
Expand Down
22 changes: 11 additions & 11 deletions sys/altq/altq_priq.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.29 2025/01/08 13:00:04 joe Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
#include "opt_inet.h"
#include "pf.h"
#include "npf.h"
#endif

#ifdef ALTQ_PRIQ /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */
Expand All @@ -56,8 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.29 2025/01/08 13:00:04 joe Exp $");
#include <net/if.h>
#include <netinet/in.h>

#if NPF > 0
#include <net/pfvar.h>
#if NNPF > 0
#include <net/npf/npf_altq.h>
#endif
#include <altq/altq.h>
#include <altq/altq_conf.h>
Expand Down Expand Up @@ -105,9 +105,9 @@ altqdev_decl(priq);
static struct priq_if *pif_list = NULL;
#endif /* ALTQ3_COMPAT */

#if NPF > 0
#if NNPF > 0
int
priq_pfattach(struct pf_altq *a)
priq_npfattach(struct npf_altq *a)
{
struct ifnet *ifp;
int s, error;
Expand All @@ -122,7 +122,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;
Expand All @@ -146,7 +146,7 @@ priq_add_altq(struct pf_altq *a)
}

int
priq_remove_altq(struct pf_altq *a)
priq_remove_altq(struct npf_altq *a)
{
struct priq_if *pif;

Expand All @@ -161,7 +161,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;
Expand All @@ -188,7 +188,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;
Expand All @@ -203,7 +203,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;
Expand All @@ -227,7 +227,7 @@ priq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes)
*nbytes = sizeof(stats);
return 0;
}
#endif /* NPF > 0 */
#endif /* NNPF > 0 */

/*
* bring the interface back to the initial state by discarding
Expand Down
Loading