PERFORCE change 165816 for review

Ana Kukec anchie at FreeBSD.org
Wed Jul 8 11:09:03 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=165816

Change 165816 by anchie at anchie_malimis on 2009/07/08 11:08:26

	Reversed names for the input and output hook. Now, the input hook
	is used in the path that receives a packet from the wire and
	passes it up the stack to the user space. The output hook is
	used in the path where packets traverse from the user space to
	ND in kernel.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#16 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#14 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#5 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#15 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#14 edit

Differences ...

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#16 (text+ko) ====

@@ -765,8 +765,8 @@
 			/* give up local */
 
 			/* Send incoming SeND-protected/ND packet to user space. */
-			if (send_output_hook != NULL)
-				send_output_hook(m, ifp, SND_IN, ip6len);
+			if (send_input_hook != NULL)
+				send_input_hook(m, ifp, SND_IN, ip6len);
 			else {
 				/* give up local */
 				nd6_rs_input(m, off, icmp6len);
@@ -774,8 +774,8 @@
 			m = NULL;
 			goto freeit;
 		}
-		if (send_output_hook != NULL)
-			send_output_hook(n, ifp, SND_IN, ip6len);
+		if (send_input_hook != NULL)
+			send_input_hook(n, ifp, SND_IN, ip6len);
 		else
 			nd6_rs_input(n, off, icmp6len);
 		/* m stays. */
@@ -790,15 +790,15 @@
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
 
 			/* Send incoming SeND-protected/ND packet to user space. */
-			if (send_output_hook != NULL)
-				send_output_hook(m, ifp, SND_IN, ip6len);
+			if (send_input_hook != NULL)
+				send_input_hook(m, ifp, SND_IN, ip6len);
 			else
 				nd6_ra_input(m, off, icmp6len);
 			m = NULL;
 			goto freeit;
 		}
-		if (send_output_hook != NULL)
-			send_output_hoo(n, ifp, SND_IN, ip6len);
+		if (send_input_hook != NULL)
+			send_input_hook(n, ifp, SND_IN, ip6len);
 		else
 			nd6_ra_input(n, off, icmp6len);
 		/* m stays. */
@@ -813,8 +813,8 @@
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
 
 			/* Send incoming SeND-protected/ND packet to user space. */
-			if (send_output_hook != NULL)
-				send_output_hook(m, ifp, SND_IN, ip6len);
+			if (send_input_hook != NULL)
+				send_input_hook(m, ifp, SND_IN, ip6len);
 			else {
 				/* give up local */
 				nd6_ns_input(m, off, icmp6len);
@@ -822,8 +822,8 @@
 			m = NULL;
 			goto freeit;
 		}
-		if (send_output_hook != NULL)
-			send_output_hook(n, ifp, SND_IN, ip6len);
+		if (send_input_hook != NULL)
+			send_input_hook(n, ifp, SND_IN, ip6len);
 		else
 			nd6_ns_input(n, off, icmp6len);
 		/* m stays. */
@@ -838,8 +838,8 @@
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
 
 			/* Send incoming SeND-protected/ND packet to user space. */
-			if (send_output_hook != NULL)
-				send_output_hook(m, ifp, SND_IN, ip6len);
+			if (send_input_hook != NULL)
+				send_input_hook(m, ifp, SND_IN, ip6len);
 			else {
 				/* give up local */
 				nd6_na_input(m, off, icmp6len);
@@ -847,8 +847,8 @@
 			m = NULL;
 			goto freeit;
 		}
-		if (send_output_hook != NULL)
-			send_output_hook(n, ifp, SND_IN, ip6len);
+		if (send_input_hook != NULL)
+			send_input_hook(n, ifp, SND_IN, ip6len);
 		else
 			nd6_na_input(n, off, icmp6len);
 		/* m stays. */
@@ -863,8 +863,8 @@
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
 
 			/* Send incoming SeND-protected/ND packet to user space. */
-			if (send_output_hook != NULL)
-				send_output_hook(m, ifp, SND_IN, ip6len);
+			if (send_input_hook != NULL)
+				send_input_hook(m, ifp, SND_IN, ip6len);
 			else {
 				/* give up local */
 				icmp6_redirect_input(m, off);
@@ -872,8 +872,8 @@
 			m = NULL;
 			goto freeit;
 		}
-		if (send_output_hook != NULL)
-			send_output_hook(n, ifp, SND_IN, ip6len);
+		if (send_input_hook != NULL)
+			send_input_hook(n, ifp, SND_IN, ip6len);
 		else
 			icmp6_redirect_input(n, off);
 		/* m stays. */
@@ -2780,7 +2780,7 @@
 	nd_rd->nd_rd_cksum = in6_cksum(m, IPPROTO_ICMPV6,
 	    sizeof(*ip6), ntohs(ip6->ip6_plen));
 
-        if (send_output_hook != NULL) {
+        if (send_input_hook != NULL) {
 		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), 
 			M_NOWAIT);
 		if (mtag == NULL)

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#14 (text+ko) ====

@@ -113,8 +113,8 @@
 
 static struct sockaddr_in6 all1_sa;
 
-int	(*send_output_hook)(struct mbuf*, struct ifnet *, int, int);
-int	(*send_input_hook)(void);
+int	(*send_input_hook)(struct mbuf*, struct ifnet *, int, int);
+int	(*send_output_hook)(void);
 
 static int nd6_is_new_addr_neighbor __P((struct sockaddr_in6 *,
 	struct ifnet *));
@@ -1911,12 +1911,12 @@
 #endif
 
 	/* send outgoing NS/NA/REDIRECT packet to sendd. */
-	if (send_output_hook != NULL) {
+	if (send_input_hook != NULL) {
 		mtag = m_tag_find(m, PACKET_TAG_ND_OUTGOING, NULL);
 		if (mtag != NULL) {
 			printf("%s: ND_OUTGOING tag found.\n", __FUNCTION__);
 			nd_type = (unsigned short *)(mtag + 1);
-			send_output_hook(m, ifp, 0, ip6len);
+			send_input_hook(m, ifp, 0, ip6len);
 		} else
 			error = EOPNOTSUPP;
 

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#5 (text+ko) ====

@@ -564,7 +564,7 @@
 	nd_ns->nd_ns_cksum =
 	    in6_cksum(m, IPPROTO_ICMPV6, sizeof(*ip6), icmp6len);
 
-	if (send_output_hook != NULL) {
+	if (send_input_hook != NULL) {
 		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), 
 			M_NOWAIT);
 		if (mtag == NULL)
@@ -1080,7 +1080,7 @@
 	nd_na->nd_na_cksum =
 	    in6_cksum(m, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), icmp6len);
 
-	if (send_output_hook != NULL) {
+	if (send_input_hook != NULL) {
 		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short), 
 			M_NOWAIT);
 		if (mtag == NULL)

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#15 (text+ko) ====

@@ -12,7 +12,7 @@
 #include <netinet6/send.h>
 
 static int
-send_input(void)
+send_output-ok(void)
 {
 
 	/* 
@@ -25,7 +25,7 @@
 }
 
 static int
-send_output(struct mbuf *m, struct ifnet *ifp, int in, int msglen)
+send_input(struct mbuf *m, struct ifnet *ifp, int in, int msglen)
 {
 	struct ip6_hdr *ip6;
 

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#14 (text+ko) ====

@@ -1,6 +1,6 @@
 /* send.c */
-extern int	(*send_output_hook)(struct mbuf *, struct ifnet *, int, int);
-extern int	(*send_input_hook)(void);
+extern int	(*send_input_hook)(struct mbuf *, struct ifnet *, int, int);
+extern int	(*send_output_hook)(void);
 
 /* Message formats for messages from ND to applications (i.e. sendd) via the 
  * routing socket. These messages are appended to an if_announcemsghdr 


More information about the p4-projects mailing list