1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 04:11:35 +01:00

Added a const overload of TCP::get_flag. Added TCP::flags.

This commit is contained in:
Matias Fontanini
2013-06-17 21:25:30 -03:00
parent acff8f1e1f
commit f385e4e975
4 changed files with 97 additions and 15 deletions

View File

@@ -134,6 +134,16 @@ TEST_F(TCPTest, SetFlag) {
EXPECT_EQ(tcp.get_flag(TCP::CWR), 0);
}
TEST_F(TCPTest, Flags) {
TCP tcp;
tcp.set_flag(TCP::SYN, 1);
tcp.set_flag(TCP::FIN, 1);
EXPECT_EQ(tcp.flags(), (TCP::SYN | TCP::FIN));
tcp.flags(TCP::PSH | TCP::RST);
EXPECT_EQ(tcp.flags(), (TCP::PSH | TCP::RST));
}
TEST_F(TCPTest, MSS) {
TCP tcp;
tcp.mss(0x456f);