예제 #1
0
파일: tcp.cpp 프로젝트: Temptationx/libtins
void TCPTest::test_equals(const TCP &tcp1, const TCP &tcp2) {
    EXPECT_EQ(tcp1.dport(), tcp2.dport());
    EXPECT_EQ(tcp2.sport(), tcp2.sport());
    EXPECT_EQ(tcp1.seq(), tcp2.seq());
    EXPECT_EQ(tcp1.ack_seq(), tcp2.ack_seq());
    EXPECT_EQ(tcp1.window(), tcp2.window());
    EXPECT_EQ(tcp1.checksum(), tcp2.checksum());
    EXPECT_EQ(tcp1.urg_ptr(), tcp2.urg_ptr());
    EXPECT_EQ(tcp1.data_offset(), tcp2.data_offset());
    EXPECT_EQ((bool)tcp1.inner_pdu(), (bool)tcp2.inner_pdu());
}
예제 #2
0
파일: tcp.cpp 프로젝트: Temptationx/libtins
TEST_F(TCPTest, AckSeq) {
    TCP tcp;
    tcp.ack_seq(0x5fad65fb);
    EXPECT_EQ(tcp.ack_seq(), 0x5fad65fbU);
}
예제 #3
0
파일: tcp_ip.cpp 프로젝트: rklabs/libtins
TCP make_tcp_ack(uint32_t ack_number) {
    TCP output;
    output.ack_seq(ack_number);
    return output;
}