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

struct nl_cache_ops* nl_cache_ops_associate ( int  protocol,
int  msgtype 
) [read]

Associate a message type to a set of cache operations

  • protocol netlink protocol
  • msgtype netlink message type
Associates the specified netlink message type with a registered set of cache operations.

Returns:
The cache operations or NULL if no association could be made.

Definition at line 59 of file cache_mngt.c.

References nl_cache_ops::co_msgtypes, nl_cache_ops::co_next, nl_cache_ops::co_protocol, and nl_msgtype::mt_id.

Referenced by nl_msg_dump().

{
      int i;
      struct nl_cache_ops *ops;

      for (ops = cache_ops; ops; ops = ops->co_next) {
            if (ops->co_protocol != protocol)
                  continue;

            for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++)
                  if (ops->co_msgtypes[i].mt_id == msgtype)
                        return ops;
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index