svn commit: r242176 - user/andre/tcp_workqueue/sys/net
Andre Oppermann
andre at FreeBSD.org
Sat Oct 27 10:33:52 UTC 2012
Author: andre
Date: Sat Oct 27 10:33:51 2012
New Revision: 242176
URL: http://svn.freebsd.org/changeset/base/242176
Log:
Add hook naming to pfil_add_hook_order() to be able to display
a human readable description of a particular hook.
Submitted by: eri
Modified:
user/andre/tcp_workqueue/sys/net/pfil.c
user/andre/tcp_workqueue/sys/net/pfil.h
Modified: user/andre/tcp_workqueue/sys/net/pfil.c
==============================================================================
--- user/andre/tcp_workqueue/sys/net/pfil.c Sat Oct 27 10:14:12 2012 (r242175)
+++ user/andre/tcp_workqueue/sys/net/pfil.c Sat Oct 27 10:33:51 2012 (r242176)
@@ -246,12 +246,14 @@ pfil_add_hook(int (*func)(void *, struct
struct inpcb *), void *arg, int flags, struct pfil_head *ph)
{
- return (pfil_add_hook_order(func, arg, flags, PFIL_ORDER_DEFAULT, ph));
+ return (pfil_add_hook_order(func, arg, "unknown", flags,
+ PFIL_ORDER_DEFAULT, ph));
}
int
pfil_add_hook_order(int (*func)(void *, struct mbuf **, struct ifnet *, int,
- struct inpcb *), void *arg, int flags, uint8_t order, struct pfil_head *ph)
+ struct inpcb *), void *arg, char *name, int flags, uint8_t order,
+ struct pfil_head *ph)
{
struct packet_filter_hook *pfh1 = NULL;
struct packet_filter_hook *pfh2 = NULL;
@@ -268,6 +270,7 @@ pfil_add_hook_order(int (*func)(void *,
pfh1->pfil_arg = arg;
pfh1->pfil_cookie = (int)random();
pfh1->pfil_order = order;
+ pfh1->pfil_name = name;
}
if (flags & PFIL_OUT) {
pfh2 = (struct packet_filter_hook *)malloc(sizeof(*pfh1),
@@ -280,6 +283,7 @@ pfil_add_hook_order(int (*func)(void *,
pfh2->pfil_arg = arg;
pfh2->pfil_cookie = (int)random();
pfh2->pfil_order = order;
+ pfh2->pfil_name = name;
}
PFIL_WLOCK(ph);
if (flags & PFIL_IN) {
Modified: user/andre/tcp_workqueue/sys/net/pfil.h
==============================================================================
--- user/andre/tcp_workqueue/sys/net/pfil.h Sat Oct 27 10:14:12 2012 (r242175)
+++ user/andre/tcp_workqueue/sys/net/pfil.h Sat Oct 27 10:33:51 2012 (r242176)
@@ -57,6 +57,7 @@ struct packet_filter_hook {
void *pfil_arg;
int pfil_cookie;
uint8_t pfil_order;
+ char *pfil_name;
};
#define PFIL_ORDER_FIRST 0
@@ -99,7 +100,8 @@ struct pfil_head {
int pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *,
int, struct inpcb *), void *, int, struct pfil_head *);
int pfil_add_hook_order(int (*func)(void *, struct mbuf **, struct ifnet *,
- int, struct inpcb *), void *, int, uint8_t, struct pfil_head *);
+ int, struct inpcb *), void *, char *, int, uint8_t,
+ struct pfil_head *);
int pfil_get_cookie(int (*func)(void *, struct mbuf **, struct ifnet *,
int, struct inpcb *), void *, int, struct pfil_head *);
int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *,
More information about the svn-src-user
mailing list