Logo Search packages:      
Sourcecode: libnl2 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 set
  • type callback to modify
  • kind kind of implementation
  • func callback function (NL_CB_CUSTOM)
  • arg argument passed to callback
Returns:
0 on success or a negative error code

Definition at line 285 of file handlers.c.

References NL_CB_CUSTOM.

Referenced by __cache_pickup(), nl_cb_alloc(), nl_cb_set_all(), nl_socket_disable_seq_check(), nl_socket_modify_cb(), and nl_wait_for_ack().

{
      if (type < 0 || type > NL_CB_TYPE_MAX)
            return -NLE_RANGE;

      if (kind < 0 || kind > NL_CB_KIND_MAX)
            return -NLE_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