test_class.file: src/agents/apps/floodlight/floodlight-1.2/src/test/java/net/floodlightcontroller/accesscontrollist/ACLRuleTest.java
test_class.identifier: ACLRuleTest
test_class.superclass: extends FloodlightTestCase
test_case.body: @Test
  	public void testMatch(){
  		
  		int[] cidr = new int[2];
  		ACLRule rule1, rule2;
  		
  		// rule1 & rule2 are the same
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(6);
  		rule1.setTp_dst(80);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		rule2.setNw_proto(6);
  		rule2.setTp_dst(80);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1 & rule2 are different in nw_proto
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(6);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		rule2.setNw_proto(11);
  		assertFalse(rule1.match(rule2));
  		
  		// rule1's nw_src is a subnet of rule2's nw_src
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(1);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/8");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		rule2.setNw_proto(1);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1's nw_dst is a subnet of rule2's nw_dst
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(1);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/8");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		rule2.setNw_proto(1);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1's nw_src is specified while rule2's is not
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1's nw_dst is specified while rule2's is not
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1's nw_proto is specified while rule2's is not
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(6);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		assertTrue(rule1.match(rule2));
  		
  		// rule1's tp_dst is specified while rule2's is not
  		rule1 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule1.setNw_src_prefix(cidr[0]);
  		rule1.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule1.setNw_dst_prefix(cidr[0]);
  		rule1.setNw_dst_maskbits(cidr[1]);
  		rule1.setNw_proto(6);
  		rule1.setTp_dst(80);
  		rule2 = new ACLRule();
  		cidr = IPAddressUtil.parseCIDR("10.0.0.1/32");
  		rule2.setNw_src_prefix(cidr[0]);
  		rule2.setNw_src_maskbits(cidr[1]);
  		cidr = IPAddressUtil.parseCIDR("10.0.0.2/32");
  		rule2.setNw_dst_prefix(cidr[0]);
  		rule2.setNw_dst_maskbits(cidr[1]);
  		rule2.setNw_proto(6);
  		assertTrue(rule1.match(rule2));
  	}
test_case.class_method_signature: ACLRuleTest.testMatch()
test_case.full_signature: @Test public void testMatch()
test_case.identifier: testMatch
test_case.invocations: parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto setTp_dst parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto setTp_dst assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto assertFalse match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits parseCIDR setNw_src_prefix setNw_src_maskbits assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits assertTrue match parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto setTp_dst parseCIDR setNw_src_prefix setNw_src_maskbits parseCIDR setNw_dst_prefix setNw_dst_maskbits setNw_proto assertTrue match
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMatch()
focal_class.declarator: id
focal_class.modifier: private
focal_class.original_string: private int id;
focal_class.type: int
focal_class.var_name: id
focal_class.declarator: nw_src
focal_class.modifier: private
focal_class.original_string: private String nw_src;
focal_class.type: String
focal_class.var_name: nw_src
focal_class.declarator: nw_dst
focal_class.modifier: private
focal_class.original_string: private String nw_dst;
focal_class.type: String
focal_class.var_name: nw_dst
focal_class.declarator: nw_src_prefix
focal_class.modifier: private
focal_class.original_string: private int nw_src_prefix;
focal_class.type: int
focal_class.var_name: nw_src_prefix
focal_class.declarator: nw_src_maskbits
focal_class.modifier: private
focal_class.original_string: private int nw_src_maskbits;
focal_class.type: int
focal_class.var_name: nw_src_maskbits
focal_class.declarator: nw_dst_prefix
focal_class.modifier: private
focal_class.original_string: private int nw_dst_prefix;
focal_class.type: int
focal_class.var_name: nw_dst_prefix
focal_class.declarator: nw_dst_maskbits
focal_class.modifier: private
focal_class.original_string: private int nw_dst_maskbits;
focal_class.type: int
focal_class.var_name: nw_dst_maskbits
focal_class.declarator: nw_proto
focal_class.modifier: private
focal_class.original_string: private int nw_proto;
focal_class.type: int
focal_class.var_name: nw_proto
focal_class.declarator: tp_dst
focal_class.modifier: private
focal_class.original_string: private int tp_dst;
focal_class.type: int
focal_class.var_name: tp_dst
focal_class.declarator: action
focal_class.modifier: private
focal_class.original_string: private Action action;
focal_class.type: Action
focal_class.var_name: action
focal_class.file: src/agents/apps/floodlight/floodlight-1.2/src/main/java/net/floodlightcontroller/accesscontrollist/ACLRule.java
focal_class.identifier: ACLRule
focal_class.class_method_signature: ACLRule.ACLRule()
focal_class.full_signature: public  ACLRule()
focal_class.identifier: ACLRule
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ACLRule()
focal_class.class_method_signature: ACLRule.match(ACLRule r)
focal_class.full_signature: public boolean match(ACLRule r)
focal_class.identifier: match
focal_class.modifiers: public
focal_class.parameters: (ACLRule r)
focal_class.return: boolean
focal_class.signature: boolean match(ACLRule r)
focal_class.class_method_signature: ACLRule.getId()
focal_class.full_signature: public int getId()
focal_class.identifier: getId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getId()
focal_class.class_method_signature: ACLRule.setId(int id)
focal_class.full_signature: public void setId(int id)
focal_class.identifier: setId
focal_class.modifiers: public
focal_class.parameters: (int id)
focal_class.return: void
focal_class.signature: void setId(int id)
focal_class.class_method_signature: ACLRule.setNw_src(String nw_src)
focal_class.full_signature: public void setNw_src(String nw_src)
focal_class.identifier: setNw_src
focal_class.modifiers: public
focal_class.parameters: (String nw_src)
focal_class.return: void
focal_class.signature: void setNw_src(String nw_src)
focal_class.class_method_signature: ACLRule.getNw_src()
focal_class.full_signature: public String getNw_src()
focal_class.identifier: getNw_src
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getNw_src()
focal_class.class_method_signature: ACLRule.setNw_dst(String nw_dst)
focal_class.full_signature: public void setNw_dst(String nw_dst)
focal_class.identifier: setNw_dst
focal_class.modifiers: public
focal_class.parameters: (String nw_dst)
focal_class.return: void
focal_class.signature: void setNw_dst(String nw_dst)
focal_class.class_method_signature: ACLRule.getNw_dst()
focal_class.full_signature: public String getNw_dst()
focal_class.identifier: getNw_dst
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getNw_dst()
focal_class.class_method_signature: ACLRule.getNw_src_prefix()
focal_class.full_signature: public int getNw_src_prefix()
focal_class.identifier: getNw_src_prefix
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNw_src_prefix()
focal_class.class_method_signature: ACLRule.setNw_src_prefix(int nw_src_prefix)
focal_class.full_signature: public void setNw_src_prefix(int nw_src_prefix)
focal_class.identifier: setNw_src_prefix
focal_class.modifiers: public
focal_class.parameters: (int nw_src_prefix)
focal_class.return: void
focal_class.signature: void setNw_src_prefix(int nw_src_prefix)
focal_class.class_method_signature: ACLRule.getNw_src_maskbits()
focal_class.full_signature: public int getNw_src_maskbits()
focal_class.identifier: getNw_src_maskbits
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNw_src_maskbits()
focal_class.class_method_signature: ACLRule.setNw_src_maskbits(int nw_src_maskbits)
focal_class.full_signature: public void setNw_src_maskbits(int nw_src_maskbits)
focal_class.identifier: setNw_src_maskbits
focal_class.modifiers: public
focal_class.parameters: (int nw_src_maskbits)
focal_class.return: void
focal_class.signature: void setNw_src_maskbits(int nw_src_maskbits)
focal_class.class_method_signature: ACLRule.getNw_dst_prefix()
focal_class.full_signature: public int getNw_dst_prefix()
focal_class.identifier: getNw_dst_prefix
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNw_dst_prefix()
focal_class.class_method_signature: ACLRule.setNw_dst_prefix(int nw_dst_prefix)
focal_class.full_signature: public void setNw_dst_prefix(int nw_dst_prefix)
focal_class.identifier: setNw_dst_prefix
focal_class.modifiers: public
focal_class.parameters: (int nw_dst_prefix)
focal_class.return: void
focal_class.signature: void setNw_dst_prefix(int nw_dst_prefix)
focal_class.class_method_signature: ACLRule.getNw_dst_maskbits()
focal_class.full_signature: public int getNw_dst_maskbits()
focal_class.identifier: getNw_dst_maskbits
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNw_dst_maskbits()
focal_class.class_method_signature: ACLRule.setNw_dst_maskbits(int nw_dst_maskbits)
focal_class.full_signature: public void setNw_dst_maskbits(int nw_dst_maskbits)
focal_class.identifier: setNw_dst_maskbits
focal_class.modifiers: public
focal_class.parameters: (int nw_dst_maskbits)
focal_class.return: void
focal_class.signature: void setNw_dst_maskbits(int nw_dst_maskbits)
focal_class.class_method_signature: ACLRule.getNw_proto()
focal_class.full_signature: public int getNw_proto()
focal_class.identifier: getNw_proto
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNw_proto()
focal_class.class_method_signature: ACLRule.setNw_proto(int nw_proto)
focal_class.full_signature: public void setNw_proto(int nw_proto)
focal_class.identifier: setNw_proto
focal_class.modifiers: public
focal_class.parameters: (int nw_proto)
focal_class.return: void
focal_class.signature: void setNw_proto(int nw_proto)
focal_class.class_method_signature: ACLRule.getTp_dst()
focal_class.full_signature: public int getTp_dst()
focal_class.identifier: getTp_dst
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getTp_dst()
focal_class.class_method_signature: ACLRule.setTp_dst(int tp_dst)
focal_class.full_signature: public void setTp_dst(int tp_dst)
focal_class.identifier: setTp_dst
focal_class.modifiers: public
focal_class.parameters: (int tp_dst)
focal_class.return: void
focal_class.signature: void setTp_dst(int tp_dst)
focal_class.class_method_signature: ACLRule.getAction()
focal_class.full_signature: public Action getAction()
focal_class.identifier: getAction
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Action
focal_class.signature: Action getAction()
focal_class.class_method_signature: ACLRule.setAction(Action action)
focal_class.full_signature: public void setAction(Action action)
focal_class.identifier: setAction
focal_class.modifiers: public
focal_class.parameters: (Action action)
focal_class.return: void
focal_class.signature: void setAction(Action action)
focal_class.class_method_signature: ACLRule.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: ACLRule.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ACLRule.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_method.body: public boolean match(ACLRule r) {
  		if ((this.tp_dst == r.tp_dst || r.tp_dst == 0)
  				&& (this.nw_proto == r.nw_proto || r.nw_proto == 0)
  				&& (isSubnet(this.getNw_src(), r.getNw_src()) == true)
  				&& (isSubnet(this.getNw_dst(), r.getNw_dst()) == true)) {
  			return true;
  		}
  		return false;
  	}
focal_method.class_method_signature: ACLRule.match(ACLRule r)
focal_method.full_signature: public boolean match(ACLRule r)
focal_method.identifier: match
focal_method.invocations: isSubnet getNw_src getNw_src isSubnet getNw_dst getNw_dst
focal_method.modifiers: public
focal_method.parameters: (ACLRule r)
focal_method.return: boolean
focal_method.signature: boolean match(ACLRule r)