Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net/npf export rprocs too so we don't lose them.
details: https://anonhg.NetBSD.org/src/rev/3ccc98739400
branches: trunk
changeset: 349943:3ccc98739400
user: christos <christos%NetBSD.org@localhost>
date: Wed Dec 28 21:55:04 2016 +0000
description:
export rprocs too so we don't lose them.
diffstat:
sys/net/npf/npf_impl.h | 3 ++-
sys/net/npf/npf_rproc.c | 11 ++++++++++-
sys/net/npf/npf_ruleset.c | 12 ++++++++++--
3 files changed, 22 insertions(+), 4 deletions(-)
diffs (75 lines):
diff -r e1f73c062e4a -r 3ccc98739400 sys/net/npf/npf_impl.h
--- a/sys/net/npf/npf_impl.h Wed Dec 28 21:19:06 2016 +0000
+++ b/sys/net/npf/npf_impl.h Wed Dec 28 21:55:04 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_impl.h,v 1.64 2016/12/26 23:05:06 christos Exp $ */
+/* $NetBSD: npf_impl.h,v 1.65 2016/12/28 21:55:04 christos Exp $ */
/*-
* Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -359,6 +359,7 @@
npf_rproc_t * npf_rproc_create(prop_dictionary_t);
void npf_rproc_acquire(npf_rproc_t *);
void npf_rproc_release(npf_rproc_t *);
+const char * npf_rproc_getname(const npf_rproc_t *);
bool npf_rproc_run(npf_cache_t *, npf_rproc_t *, int *);
/* State handling. */
diff -r e1f73c062e4a -r 3ccc98739400 sys/net/npf/npf_rproc.c
--- a/sys/net/npf/npf_rproc.c Wed Dec 28 21:19:06 2016 +0000
+++ b/sys/net/npf/npf_rproc.c Wed Dec 28 21:55:04 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_rproc.c,v 1.14 2016/12/26 23:05:06 christos Exp $ */
+/* $NetBSD: npf_rproc.c,v 1.15 2016/12/28 21:55:04 christos Exp $ */
/*-
* Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -311,6 +311,15 @@
}
/*
+ * npf_rproc_getname: return the name of the given rproc
+ */
+const char *
+npf_rproc_getname(const npf_rproc_t *rp)
+{
+ return rp->rp_name;
+}
+
+/*
* npf_rproc_release: drop the reference count and destroy the rule
* procedure on the last reference.
*/
diff -r e1f73c062e4a -r 3ccc98739400 sys/net/npf/npf_ruleset.c
--- a/sys/net/npf/npf_ruleset.c Wed Dec 28 21:19:06 2016 +0000
+++ b/sys/net/npf/npf_ruleset.c Wed Dec 28 21:55:04 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_ruleset.c,v 1.43 2016/12/26 23:05:06 christos Exp $ */
+/* $NetBSD: npf_ruleset.c,v 1.44 2016/12/28 21:55:04 christos Exp $ */
/*-
* Copyright (c) 2009-2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef _KERNEL
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.43 2016/12/26 23:05:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.44 2016/12/28 21:55:04 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -740,6 +740,14 @@
if (rl->r_info) {
prop_dictionary_set(rldict, "info", rl->r_info);
}
+
+ npf_rproc_t *rp = npf_rule_getrproc(rl);
+ if (rp != NULL) {
+ prop_dictionary_set_cstring(rldict, "rproc",
+ npf_rproc_getname(rp));
+ npf_rproc_release(rp);
+ }
+
return 0;
}
Home |
Main Index |
Thread Index |
Old Index