示例#1
0
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
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;
}