Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133541072
D8963.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8963.id.diff
View Options
Index: head/sys/net/if.c
===================================================================
--- head/sys/net/if.c
+++ head/sys/net/if.c
@@ -59,6 +59,7 @@
#include <sys/domain.h>
#include <sys/jail.h>
#include <sys/priv.h>
+#include <sys/eventhandler.h>
#include <machine/stdarg.h>
#include <vm/uma.h>
@@ -2218,6 +2219,7 @@
if_down(struct ifnet *ifp)
{
+ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN);
if_unroute(ifp, IFF_UP, AF_UNSPEC);
}
@@ -2230,6 +2232,7 @@
{
if_route(ifp, IFF_UP, AF_UNSPEC);
+ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP);
}
/*
Index: head/sys/sys/eventhandler.h
===================================================================
--- head/sys/sys/eventhandler.h
+++ head/sys/sys/eventhandler.h
@@ -284,4 +284,11 @@
EVENTHANDLER_DECLARE(swapon, swapon_fn);
EVENTHANDLER_DECLARE(swapoff, swapoff_fn);
+/* ifup/ifdown events */
+#define IFNET_EVENT_UP 0
+#define IFNET_EVENT_DOWN 1
+struct ifnet;
+typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event);
+EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn);
+
#endif /* _SYS_EVENTHANDLER_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 27, 1:00 PM (8 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24277499
Default Alt Text
D8963.id.diff (1 KB)
Attached To
Mode
D8963: ifnet: introduce event handlers for ifup/ifdown events
Attached
Detach File
Event Timeline
Log In to Comment