1 // set "allow unsafe code" to true in Project Properties
2
3 using System;
4 using System. Net;
5 using System. Net. Sockets;
6 using System. Threading;
7 // do not explain the required namespace
8 namespace syn
9 {
10 public struct ipHeader
11 {
12
13
14
15 public byte ip_verlen; // 4-bit Header Length + 4-bit IP version number
16 public byte ip_tos; // 8-bit service type TOS
17 public ushort ip_totallength; // The total length of a 16-bit data packet (in bytes)
18
19
20 public ushort ip_id; // 16-bit ID
21 public ushort ip_offset; // 3-Bit Flag
22 public byte ip_ttl; // 8-bit TTL
23 public byte ip_protocol; // 8-bit protocol (TCP, UDP, ICMP, Etc .)
24 public ushort ip_checksum; // 16-bit IP header checksum
25 public uint ip_srcaddr; // 32-bit source IP address
26 public uint ip_destaddr; // 32-bit destination IP address
27}
28 public struct psdHeader
29 {
30
31
32 public uint saddr; // Source Address
33 public uint daddr; // Destination Address
34