title: Convert source IP address from struct iphdr* to string equivalent using Linux netfilter
body: <p>I want to convert the source &amp; destination IP addresses from a packet captured using netfilter to char *.</p>
  
  <p>In my netfilter hook function, I have:</p>
  
  <pre><code>sock_buff = skb; // argument 2 of hook function
  
  // ip_header is struct iphdr*
  ip_header = (struct iphdr *)skb_network_header(sock_buff);
  
  // now how to convert ip_header-&gt;saddr &amp; ip_header-&gt;daddr to char *
  // ip_header-&gt;saddr &amp; ip_header-&gt;daddr are of type __be32
  </code></pre>
  
  <p>Thanks.</p>