title: How to send command to network interface with netlink library
body: <p>I'm starting wifi related project and i've completed one with linux ioctl calls. Now i must do the same with help of libnl as ioctl is now deprecated, i've already read all the core documentation but still don't understand how to send command on specific interface. How can i send command to network interface? say i want send NL80211_CMD_TRIGGER_SCAN, how can i do this? any example code is greatly appreciated as it will be the start of my journey.
  As i understand for now i must create libnl socket, something like:</p>
  
  <pre><code>struct nl_sock *socket;
  sock = nl_socket_alloc();
  </code></pre>
  
  <p>and then compose nl_msg message with my command and send it, but how?</p>
  
  <p>P.S. suppose with nl_send(), but i hope you understand that i stuck at point of no-understanding the idea of how this lib works</p>