@Test public void testAllocateBDDBit() { BDDPacket pkt = new BDDPacket(); int varNum = pkt.getFactory().varNum(); BDD bdd = pkt.allocateBDDBit("foo"); assertThat(bdd, notNullValue()); assertThat(pkt.getFactory().varNum(), equalTo(varNum + 1)); }
public BDD allocateBDDBit(String name) { if (_factory.varNum() < _nextFreeBDDVarIdx + 1) { _factory.setVarNum(_nextFreeBDDVarIdx + 1); } _bitNames.put(_nextFreeBDDVarIdx, name); BDD bdd = _factory.ithVar(_nextFreeBDDVarIdx); _nextFreeBDDVarIdx++; return bdd; }
BDDPacket { public BDD allocateBDDBit(String name) { if (_factory.varNum() < _nextFreeBDDVarIdx + 1) { _factory.setVarNum(_nextFreeBDDVarIdx + 1); } _bitNames.put(_nextFreeBDDVarIdx, name); BDD bdd = _factory.ithVar(_nextFreeBDDVarIdx); _nextFreeBDDVarIdx++; return bdd; } }
BDDPacket { public BDD allocateBDDBit(String name) { if (_factory.varNum() < _nextFreeBDDVarIdx + 1) { _factory.setVarNum(_nextFreeBDDVarIdx + 1); } _bitNames.put(_nextFreeBDDVarIdx, name); BDD bdd = _factory.ithVar(_nextFreeBDDVarIdx); _nextFreeBDDVarIdx++; return bdd; } BDDPacket(); }
BDDPacket { public BDD allocateBDDBit(String name) { if (_factory.varNum() < _nextFreeBDDVarIdx + 1) { _factory.setVarNum(_nextFreeBDDVarIdx + 1); } _bitNames.put(_nextFreeBDDVarIdx, name); BDD bdd = _factory.ithVar(_nextFreeBDDVarIdx); _nextFreeBDDVarIdx++; return bdd; } BDDPacket(); BDD allocateBDDBit(String name); BDDInteger allocateBDDInteger(String name, int bits, boolean reverse); IpSpaceToBDD getDstIpSpaceToBDD(); IpSpaceToBDD getSrcIpSpaceToBDD(); BDDFactory getFactory(); Optional<Flow.Builder> getFlow(BDD bdd, FlowPreference preference); Optional<Flow.Builder> getFlow(BDD bdd); Flow.Builder getRepresentativeFlow(BDD bdd); Flow.Builder getFromFromAssignment(BitSet bits); @Nonnull BDDInteger getDscp(); @Nonnull BDDInteger getDstIp(); @Nonnull BDDInteger getDstPort(); @Nonnull BDDInteger getEcn(); @Nonnull BDDInteger getFragmentOffset(); @Nonnull BDDIcmpCode getIcmpCode(); @Nonnull BDDIcmpType getIcmpType(); @Nonnull BDDIpProtocol getIpProtocol(); @Nonnull BDDPacketLength getPacketLength(); @Nonnull BDDInteger getSrcIp(); @Nonnull BDDInteger getSrcPort(); @Nonnull BDD getTcpAck(); @Nonnull BDD getTcpCwr(); @Nonnull BDD getTcpEce(); @Nonnull BDD getTcpFin(); @Nonnull BDD getTcpPsh(); @Nonnull BDD getTcpRst(); @Nonnull BDD getTcpSyn(); @Nonnull BDD getTcpUrg(); @Override int hashCode(); @Override boolean equals(Object o); BDD restrict(BDD bdd, Prefix pfx); BDD restrict(BDD bdd, List<Prefix> prefixes); BDD swapSourceAndDestinationFields(BDD bdd); }
BDDPacket { public BDD allocateBDDBit(String name) { if (_factory.varNum() < _nextFreeBDDVarIdx + 1) { _factory.setVarNum(_nextFreeBDDVarIdx + 1); } _bitNames.put(_nextFreeBDDVarIdx, name); BDD bdd = _factory.ithVar(_nextFreeBDDVarIdx); _nextFreeBDDVarIdx++; return bdd; } BDDPacket(); BDD allocateBDDBit(String name); BDDInteger allocateBDDInteger(String name, int bits, boolean reverse); IpSpaceToBDD getDstIpSpaceToBDD(); IpSpaceToBDD getSrcIpSpaceToBDD(); BDDFactory getFactory(); Optional<Flow.Builder> getFlow(BDD bdd, FlowPreference preference); Optional<Flow.Builder> getFlow(BDD bdd); Flow.Builder getRepresentativeFlow(BDD bdd); Flow.Builder getFromFromAssignment(BitSet bits); @Nonnull BDDInteger getDscp(); @Nonnull BDDInteger getDstIp(); @Nonnull BDDInteger getDstPort(); @Nonnull BDDInteger getEcn(); @Nonnull BDDInteger getFragmentOffset(); @Nonnull BDDIcmpCode getIcmpCode(); @Nonnull BDDIcmpType getIcmpType(); @Nonnull BDDIpProtocol getIpProtocol(); @Nonnull BDDPacketLength getPacketLength(); @Nonnull BDDInteger getSrcIp(); @Nonnull BDDInteger getSrcPort(); @Nonnull BDD getTcpAck(); @Nonnull BDD getTcpCwr(); @Nonnull BDD getTcpEce(); @Nonnull BDD getTcpFin(); @Nonnull BDD getTcpPsh(); @Nonnull BDD getTcpRst(); @Nonnull BDD getTcpSyn(); @Nonnull BDD getTcpUrg(); @Override int hashCode(); @Override boolean equals(Object o); BDD restrict(BDD bdd, Prefix pfx); BDD restrict(BDD bdd, List<Prefix> prefixes); BDD swapSourceAndDestinationFields(BDD bdd); static final int FIRST_PACKET_VAR; }