svn commit: r226088 - projects/diffused_head/sys/netinet

Lawrence Stewart lstewart at FreeBSD.org
Fri Oct 7 05:45:39 UTC 2011


Author: lstewart
Date: Fri Oct  7 05:45:38 2011
New Revision: 226088
URL: http://svn.freebsd.org/changeset/base/226088

Log:
  Add the necessary infrastructure for the DIFFUSE control raw socket, which will
  be used to communicate between userspace and the forthcoming DIFFUSE kernel
  module.
  
  Sponsored by:	FreeBSD Foundation
  Reviewed by:	bz

Modified:
  projects/diffused_head/sys/netinet/in.h
  projects/diffused_head/sys/netinet/ip_var.h
  projects/diffused_head/sys/netinet/raw_ip.c

Modified: projects/diffused_head/sys/netinet/in.h
==============================================================================
--- projects/diffused_head/sys/netinet/in.h	Fri Oct  7 05:08:08 2011	(r226087)
+++ projects/diffused_head/sys/netinet/in.h	Fri Oct  7 05:45:38 2011	(r226088)
@@ -436,6 +436,7 @@ __END_DECLS
 #define	IP_FW_TABLE_GETSIZE	43   /* get table size */
 #define	IP_FW_TABLE_LIST	44   /* list table contents */
 
+#define	IP_DIFFUSE		47   /* ipfw DIFFUSE options */
 #define	IP_FW3			48   /* generic ipfw v.3 sockopts */
 #define	IP_DUMMYNET3		49   /* generic dummynet v.3 sockopts */
 

Modified: projects/diffused_head/sys/netinet/ip_var.h
==============================================================================
--- projects/diffused_head/sys/netinet/ip_var.h	Fri Oct  7 05:08:08 2011	(r226087)
+++ projects/diffused_head/sys/netinet/ip_var.h	Fri Oct  7 05:45:38 2011	(r226088)
@@ -305,6 +305,9 @@ extern int	(*ng_ipfw_input_p)(struct mbu
 extern int	(*ip_dn_ctl_ptr)(struct sockopt *);
 extern int	(*ip_dn_io_ptr)(struct mbuf **, int, struct ip_fw_args *);
 
+/* DIFFUSE. */
+extern int	(*diffuse_ctl_ptr)(struct sockopt *);
+
 VNET_DECLARE(int, ip_do_randomid);
 #define	V_ip_do_randomid	VNET(ip_do_randomid)
 #define	ip_newid()	((V_ip_do_randomid != 0) ? ip_randomid() : \

Modified: projects/diffused_head/sys/netinet/raw_ip.c
==============================================================================
--- projects/diffused_head/sys/netinet/raw_ip.c	Fri Oct  7 05:08:08 2011	(r226087)
+++ projects/diffused_head/sys/netinet/raw_ip.c	Fri Oct  7 05:45:38 2011	(r226088)
@@ -99,6 +99,7 @@ int	(*ip_dn_io_ptr)(struct mbuf **, int,
 void	(*ip_divert_ptr)(struct mbuf *, int);
 int	(*ng_ipfw_input_p)(struct mbuf **, int,
 			struct ip_fw_args *, int);
+int	(*diffuse_ctl_ptr)(struct sockopt *);
 
 /* Hook for telling pf that the destination address changed */
 void	(*m_addr_chg_pf_p)(struct mbuf *m);
@@ -583,6 +584,13 @@ rip_ctloutput(struct socket *so, struct 
 				error = ENOPROTOOPT;
 			break ;
 
+		case IP_DIFFUSE:	/* IPFW DIFFUSE functions. */
+			if (diffuse_ctl_ptr != NULL)
+				error = diffuse_ctl_ptr(sopt);
+			else
+				error = ENOPROTOOPT;
+			break;
+
 		case MRT_INIT:
 		case MRT_DONE:
 		case MRT_ADD_VIF:
@@ -648,6 +656,13 @@ rip_ctloutput(struct socket *so, struct 
 				error = ENOPROTOOPT ;
 			break ;
 
+		case IP_DIFFUSE:	/* IPFW DIFFUSE functions. */
+			if (diffuse_ctl_ptr != NULL)
+				error = diffuse_ctl_ptr(sopt);
+			else
+				error = ENOPROTOOPT;
+			break;
+
 		case IP_RSVP_ON:
 			error = priv_check(curthread, PRIV_NETINET_MROUTE);
 			if (error != 0)


More information about the svn-src-projects mailing list