Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

void nl_socket_set_local_port ( struct nl_sock *  sk,
uint32_t  port 
)

Set local port of socket

  • sk Netlink socket.
  • port Local port identifier
Assigns a local port identifier to the socket. If port is 0 a unique port identifier will be generated automatically.

Definition at line 255 of file socket.c.

{
      if (port == 0) {
            port = generate_local_port(); 
            sk->s_flags &= ~NL_OWN_PORT;
      } else  {
            if (!(sk->s_flags & NL_OWN_PORT))
                  release_local_port(sk->s_local.nl_pid);
            sk->s_flags |= NL_OWN_PORT;
      }

      sk->s_local.nl_pid = port;
}


Generated by  Doxygen 1.6.0   Back to index