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

int rtnl_qdisc_add ( struct nl_handle *  handle,
struct rtnl_qdisc *  qdisc,
int  flags 
)

Add a new qdisc

  • handle netlink handle
  • qdisc qdisc to delete
  • flags additional netlink message flags
Builds a netlink message by calling rtnl_qdisc_build_add_request(), sends the request to the kernel and waits for the ACK to be received and thus blocks until the request has been processed.

Common message flags used:

  • NLM_F_REPLACE - replace a potential existing qdisc

Returns:
0 on success or a negative error code

Definition at line 359 of file qdisc.c.

References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_qdisc_build_add_request().

{
      struct nl_msg *msg;
      int err;

      msg = rtnl_qdisc_build_add_request(qdisc, flags);
      if (!msg)
            return nl_errno(ENOMEM);

      err = nl_send_auto_complete(handle, msg);
      if (err < 0)
            return err;

      nlmsg_free(msg);
      return nl_wait_for_ack(handle);
}


Generated by  Doxygen 1.6.0   Back to index