From 05e788d7f5054a25d82e2824f6daf661d0cab38e Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 20 Dec 2010 16:57:13 +0200 Subject: [PATCH] =?utf8?q?=D0=92=D0=B8=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=BC=D0=B8=D0=BB=D0=BA=D0=B8=20?= =?utf8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D1=96=D0=BB=D1=8F=D1=86=D1=96=D1=97=20u?= =?utf8?q?nit-=D1=82=D0=B5=D1=81=D1=82=D1=83=20test=5Fraw=5Fip.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tests/test_raw_ip.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_raw_ip.cpp b/tests/test_raw_ip.cpp index 11e18b2f..9c4e521f 100644 --- a/tests/test_raw_ip.cpp +++ b/tests/test_raw_ip.cpp @@ -36,17 +36,17 @@ namespace tut set_test_name("Check structure consistency"); RAW_PACKET rp; - rp.ipHeader.ip_v = 4; - rp.ipHeader.ip_hl = 5; - rp.ipHeader.ip_tos = 0; - rp.ipHeader.ip_len = htons(40); // 20 of header + 20 of data - rp.ipHeader.ip_p = 6; - rp.ipHeader.ip_src.s_addr = inet_addr("192.168.0.1"); - rp.ipHeader.ip_dst.s_addr = inet_addr("192.168.0.101"); - rp.sPort = htons(80); - rp.dPort = htons(38546); - - ensure_equals("IP header size (explicitly)", sizeof(rp.ipHeader), 20); + rp.header.ipHeader.ip_v = 4; + rp.header.ipHeader.ip_hl = 5; + rp.header.ipHeader.ip_tos = 0; + rp.header.ipHeader.ip_len = htons(40); // 20 of header + 20 of data + rp.header.ipHeader.ip_p = 6; + rp.header.ipHeader.ip_src.s_addr = inet_addr("192.168.0.1"); + rp.header.ipHeader.ip_dst.s_addr = inet_addr("192.168.0.101"); + rp.header.sPort = htons(80); + rp.header.dPort = htons(38546); + + ensure_equals("IP header size (explicitly)", sizeof(rp.header.ipHeader), 20); ensure_equals("IP version", rp.GetIPVersion(), 4); ensure_equals("IP header size (with options)", rp.GetHeaderLen(), 20); ensure_equals("Underlying protocol version", rp.GetProto(), 6); -- 2.44.2