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

int nl_cache_pickup ( struct nl_handle *  handle,
struct nl_cache *  cache 

Pickup a netlink dump response and put it into a cache.

  • handle Netlink handle.
  • cache Cache to put items into.
Waits for netlink messages to arrive, parses them and puts them into the specified cache.

0 or a negative error code.

Definition at line 386 of file cache.c.

References nl_cb_clone(), NL_CB_CUSTOM, nl_cb_destroy(), nl_cb_set(), NL_CB_VALID, nl_handle_get_cb(), nl_recvmsgs(), and update_msg_parser().

Referenced by flnl_lookup(), and nl_cache_update().

      int err;
      struct nl_cache_ops *ops = cache->c_ops;
      struct nl_cb *cb;
      struct nl_parser_param p = {
            .pp_cb = subsys_parse_cb,
            .pp_arg = cache,
      struct update_xdata x = {
            .ops = ops,
            .params = &p,

      NL_DBG(1, "Filling cache %p...\n", cache);

      cb = nl_cb_clone(nl_handle_get_cb(handle));
      nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, update_msg_parser, &x);

      err = nl_recvmsgs(handle, cb);

      return err;

Generated by  Doxygen 1.6.0   Back to index