if(rule.getProtocol().equals("icmp")){
// ICMP rules - reuse port fields
// (-1, -1) means "allow all ICMP", so we don't set tpSrc / tpDst
if(fwRule.icmpType != -1 | fwRule.icmpCode != -1){
toApply.tpSrc(new DtoRange(fwRule.icmpType, fwRule.icmpType))
.tpDst(new DtoRange(fwRule.icmpCode, fwRule.icmpCode));
}
} else {
toApply.tpDst(new DtoRange(fwRule.dstPortStart, fwRule.dstPortEnd));
}
toApply.create();
}
}