title: WinPCAP C++ Sending packet
body: <p>So, I want send packet over TCP by using by pcap_sendpacket</p>
  
  <pre><code>TCP_Packet.Set_Ethernet_Source_MAC(1, 1, 1, 1, 1, 1);
  TCP_Packet.Set_Ethernet_Destination_MAC(2, 2, 2, 2, 2, 2);
  TCP_Packet.Set_Ethernet_Type(0x0800);
  TCP_Packet.Set_IPv4_Version(4);
  TCP_Packet.Set_IPv4_IHL(5);
  TCP_Packet.Set_IPv4_ToS(0);
  TCP_Packet.Set_IPv4_Total_Length(sizeof(IPv4_Address_s) + sizeof(TCP_s));
  TCP_Packet.Set_IPv4_Identification(2);
  TCP_Packet.Set_IPv4_Flag(0);
  TCP_Packet.Set_IPv4_Offset(0);
  TCP_Packet.Set_IPv4_Live_Time(0x80);
  TCP_Packet.Set_IPv4_Protocol(0x06);
  TCP_Packet.Set_IPv4_Checksum(0);
  TCP_Packet.Set_IPv4_Destination_Address(192, 168, 1, 2);
  TCP_Packet.Set_IPv4_Source_Address(192, 168, 1, 2);
  
  TCP_Packet.Set_TCP_Destination_Port(45578); //In method is htons
  TCP_Packet.Set_TCP_Source_Port(45578); //In method is htons
  TCP_Packet.Set_TCP_Sequence_Number(0);
  TCP_Packet.Set_TCP_Acknowledgment_Number(0);
  TCP_Packet.Set_TCP_Flag_SYN(1);
  TCP_Packet.Set_TCP_Offset(5);
  TCP_Packet.Set_TCP_Window_Size(64240);
  TCP_Packet.Set_TCP_Checksum(0);
  TCP_Packet.Set_TCP_Urgent_Pointer(0);
  if (FAILURE == TCP_Packet.Send_Packet(Capture_Instance)) //Here is all good
  {
      cerr &lt;&lt; "Can't send packet: " &lt;&lt; pcap_geterr(Capture_Instance) &lt;&lt; endl;
      return FAILURE;
  }
  else
      cout &lt;&lt; "Sended" &lt;&lt; endl;
  </code></pre>
  
  <p>Problem: It seems to not working. The server doesn't detect any packets on port 45578 and wireshark too, but it should work.</p>