title: Replacing gethostbyname to getaddrinfo for ICMP (IcmpSendEcho)
body: <p>The legacy code has <code>gethostbyname</code> to get IP address of a host. The integer part of converted address is then passed to <code>IcmpSendEcho</code>. 
  I am replacing this obsolete function with <code>getaddrinfo</code>. </p>
  
  <pre><code>DWORD GetIPAddressInt(const char* pAddress)
  {
      PADDRINFOA addr = nullptr;    
      addrinfo hints = { 0 };
  
      hints.ai_family = AF_INET;    
      // hints.ai_socktype = ??;
      // hints.ai_protocol = ??;
      getaddrinfo(pAddress, nullptr, &amp;hints, &amp;addr);
  
      auto sockaddr_ipv4 = reinterpret_cast&lt;sockaddr_in*&gt;(addr-&gt;ai_addr);
  
      return sockaddr_ipv4-&gt;sin_addr.S_un.S_addr;
  }
  </code></pre>
  
  <p>My question is: What about <code>ai_socktype</code> and <code>ai_protocol</code> members? </p>
  
  <ul>
  <li>Should socket type be <code>SOCK_RAW</code> ?</li>
  <li>Should protocol be <code>IPPROTO_ICMP</code> (In header, not in MSDN) ?</li>
  </ul>
  
  <p>Re-iterating again, that the resultant IP address will be used for sending ICMP echo request, and hence I am wondering if RAW/ICMP are needed? For now, IPv6 is not a worry.</p>