1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Add Flow::ignore_data_packets

This commit is contained in:
Matias Fontanini
2016-02-08 20:47:27 -08:00
parent c3861cf54e
commit 549c0e97d0
3 changed files with 65 additions and 8 deletions

View File

@@ -276,6 +276,22 @@ TEST_F(FlowTest, Overlapping) {
run_tests(chunks, payload);
}
TEST_F(FlowTest, IgnoreDataPackets) {
using std::placeholders::_1;
ordering_info_type chunks = split_payload(payload, 5);
Flow flow(IPv4Address("1.2.3.4"), 22, 0);
flow.data_callback(bind(&FlowTest::cumulative_flow_data_handler, this, _1));
flow.ignore_data_packets();
vector<EthernetII> packets = chunks_to_packets(0, chunks, payload);
for (size_t i = 0; i < packets.size(); ++i) {
flow.process_packet(packets[i]);
}
EXPECT_TRUE(flow_payload_chunks.empty());
}
// Stream follower tests
TEST_F(FlowTest, StreamFollower_ThreeWayHandshake) {
using std::placeholders::_1;