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

int nl_cb_set ( struct nl_cb *  cb,
enum nl_cb_type  type,
enum nl_cb_kind  kind,
nl_recvmsg_msg_cb_t  func,
void *  arg 
)

Set up a callback

  • cb callback configuration
  • type which type callback to set
  • kind kind of callback
  • func callback function
  • arg argument to be passwd to callback function
Returns:
0 on success or a negative error code

Definition at line 477 of file handlers.c.

References NL_CB_CUSTOM.

Referenced by nl_cache_pickup(), nl_cb_new(), nl_cb_set_all(), nl_disable_sequence_check(), and nl_wait_for_ack().

{
      if (type < 0 || type > NL_CB_TYPE_MAX)
            return nl_error(ERANGE, "Callback type out of range");

      if (kind < 0 || kind > NL_CB_KIND_MAX)
            return nl_error(ERANGE, "Callback kind out of range");

      if (kind == NL_CB_CUSTOM) {
            cb->cb_set[type] = func;
            cb->cb_args[type] = arg;
      } else {
            cb->cb_set[type] = cb_def[type][kind];
            cb->cb_args[type] = arg;
      }

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index