PERFORCE change 163392 for review
    Ana Kukec 
    anchie at FreeBSD.org
       
    Wed Jun  3 02:03:17 UTC 2009
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=163392
Change 163392 by anchie at anchie_malimis on 2009/06/03 02:02:35
	Initial introduction of hooks mechanism based on send module.	
Affected files ...
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#3 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#5 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#5 edit
Differences ...
==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#3 (text+ko) ====
@@ -763,6 +763,8 @@
 			/* give up local */
 
 		/* send incoming SeND-protected/ND packet to sendd */
+		if (send_input_hook != NULL)
+			send_input_hook();
 
 			nd6_rs_input(m, off, icmp6len);
 			m = NULL;
==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#5 (text+ko) ====
@@ -1,1 +1,45 @@
 /* send module */
+
+#include <sys/param.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+
+#include <send.h>
+
+static int	X_send_input_hook(void);
+
+static int
+X_send_input_hook(void)
+{
+	return 0;
+}
+
+static int
+send_modevent(module_t mod, int type, void *unused)
+{
+	int err = 0;
+
+	switch (type) {
+	case MOD_LOAD:
+		send_input_hook = X_send_input_hook;
+		break;
+
+	case MOD_UNLOAD:
+		send_input_hook = NULL;
+		break;
+
+	default:
+		break;
+	}
+	return err;
+}
+
+static moduledata_t sendmod = {
+	"send",
+	send_modevent,
+	0
+};
+
+DECLARE_MODULE(send, sendmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
+
==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#5 (text+ko) ====
@@ -1,1 +1,2 @@
 /* send.c */
+int	(*send_input_hook)(void);
    
    
More information about the p4-projects
mailing list