socsvn commit: r274311 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw

dpl at FreeBSD.org dpl at FreeBSD.org
Thu Sep 18 14:45:09 UTC 2014


Author: dpl
Date: Thu Sep 18 14:45:08 2014
New Revision: 274311
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=274311

Log:
  Added the rule_macaddr2, rule_mac_type, rule_diverted, and rule_proto calls.

Modified:
  soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc

Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc
==============================================================================
--- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc	Thu Sep 18 14:32:05 2014	(r274310)
+++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc	Thu Sep 18 14:45:08 2014	(r274311)
@@ -1341,7 +1341,6 @@
 		Value *OpcodeL = Irb.CreateLoad(Opcode);
 		// Opcode is u_int8
 		Value *OpcodeL32 = Irb.CreateZExt(OpcodeL, Int32Ty);
-		RuleForwardMac->dump();
 		Irb.CreateCall(RuleForwardMac, {OpcodeL32});
 	}
 
@@ -1422,11 +1421,19 @@
 	void
 	emit_macaddr2()
 	{
+		// rule_macaddr2(&match, args, cmd);
+		Value *CmdL = Irb.CreateLoad(Cmd);
+		Irb.CreateCall(RuleMacaddr2, {Match, Args, CmdL});
 	}
 
 	void
 	emit_mac_type()
 	{
+		// rule_mac_type(&match, args, cmd, cmdlen, etype);
+		Value *CmdL = Irb.CreateLoad(Cmd);
+		Value *CmdlenL = Irb.CreateLoad(Cmdlen);
+		Value *EtypeL = Irb.CreateLoad(Etype);
+		Irb.CreateCall(RuleMacType, {Match, Args, CmdL, CmdlenL, EtypeL});
 	}
 
 	// XXX Exec not tested.
@@ -1457,11 +1464,18 @@
 	void
 	emit_diverted()
 	{
+		// rule_diverted(&match, args, cmd);
+		Value *CmdL = Irb.CreateLoad(Cmd);
+		Irb.CreateCall(RuleDiverted, {Match, Args, CmdL});
 	}
 
 	void
 	emit_proto()
 	{
+		// rule_proto(&match, proto, cmd);
+		Value *CmdL = Irb.CreateLoad(Cmd);
+		Value *ProtoL = Irb.CreateLoad(Proto);
+		Irb.CreateCall(RuleProto, {Match, ProtoL, CmdL});
 	}
 
 	// XXX Exec not tested.
@@ -1873,7 +1887,7 @@
 	compiler.emit_inner_for_prologue();
 	// Rule to test
 	printf("Testing rule compilation\n");
-	compiler.emit_forward_mac();
+	compiler.emit_proto();
 	printf("emit_inner_for_epilogue()\n");
 	compiler.emit_inner_for_epilogue();
 	printf("emit_outer_for_epilogue()\n");


More information about the svn-soc-all mailing list