Modules | |
Object API | |
Data Structures | |
struct | nl_derived_object |
Object Creation/Deletion | |
struct nl_object * | nl_object_alloc (struct nl_object_ops *ops) |
Allocate a new object of kind specified by the operations handle. More... | |
int | nl_object_alloc_name (const char *kind, struct nl_object **result) |
Allocate a new object of kind specified by the name. More... | |
struct nl_object * | nl_object_clone (struct nl_object *obj) |
Allocate a new object and copy all data from an existing object. More... | |
void | nl_object_free (struct nl_object *obj) |
Free a cacheable object. More... | |
Reference Management | |
void | nl_object_get (struct nl_object *obj) |
Acquire a reference on a object. More... | |
void | nl_object_put (struct nl_object *obj) |
Release a reference from an object. More... | |
int | nl_object_shared (struct nl_object *obj) |
Check whether this object is used by multiple users. More... | |
Marks | |
void | nl_object_mark (struct nl_object *obj) |
Add mark to object. More... | |
void | nl_object_unmark (struct nl_object *obj) |
Remove mark from object. More... | |
int | nl_object_is_marked (struct nl_object *obj) |
Return true if object is marked. More... | |
Utillities | |
void | nl_object_dump (struct nl_object *obj, struct nl_dump_params *params) |
Dump this object according to the specified parameters. More... | |
int | nl_object_identical (struct nl_object *a, struct nl_object *b) |
Check if the identifiers of two objects are identical. More... | |
uint32_t | nl_object_diff (struct nl_object *a, struct nl_object *b) |
Compute bitmask representing difference in attribute values. More... | |
int | nl_object_match_filter (struct nl_object *obj, struct nl_object *filter) |
Match a filter against an object. More... | |
char * | nl_object_attrs2str (struct nl_object *obj, uint32_t attrs, char *buf, size_t len) |
Convert bitmask of attributes to a character string. More... | |
char * | nl_object_attr_list (struct nl_object *obj, char *buf, size_t len) |
Return list of attributes present in an object. More... | |
Attributes | |
int | nl_object_get_refcnt (struct nl_object *obj) |
struct nl_cache * | nl_object_get_cache (struct nl_object *obj) |
struct nl_object* nl_object_alloc | ( | struct nl_object_ops * | ops | ) |
Allocate a new object of kind specified by the operations handle.
References BUG, new, NL_DBG, nl_init_list_head, NULL, nl_object_ops::oo_constructor, and nl_object_ops::oo_size.
Referenced by flnl_request_alloc(), flnl_result_alloc(), genl_family_alloc(), nfnl_ct_alloc(), nfnl_log_alloc(), nfnl_log_msg_alloc(), nfnl_nft_chain_alloc(), nfnl_nft_expr_alloc(), nfnl_nft_rule_alloc(), nfnl_nft_set_alloc(), nfnl_nft_setelem_alloc(), nfnl_nft_table_alloc(), nfnl_queue_alloc(), nfnl_queue_msg_alloc(), nl_object_alloc_name(), nl_object_clone(), rtnl_addr_alloc(), rtnl_class_alloc(), rtnl_cls_alloc(), rtnl_link_alloc(), rtnl_neigh_alloc(), rtnl_neightbl_alloc(), rtnl_qdisc_alloc(), rtnl_route_alloc(), and rtnl_rule_alloc().
Allocate a new object of kind specified by the name.
References nl_cache_ops::co_obj_ops, nl_cache_ops_lookup(), nl_object_alloc(), NLE_NOMEM, and NLE_OPNOTSUPP.
Return list of attributes present in an object.
References nl_object_attrs2str().
Convert bitmask of attributes to a character string.
Converts the bitmask of attribute types into a list of attribute names separated by comas.
References buf, NULL, and nl_object_ops::oo_attrs2str.
Referenced by nl_object_attr_list().
Allocate a new object and copy all data from an existing object.
References BUG, data, nl_object_alloc(), nl_object_free(), NULL, offsetof, nl_object_ops::oo_clone, nl_object_ops::oo_free_data, nl_object_ops::oo_size, and size.
Referenced by nl_cache_add().
Compute bitmask representing difference in attribute values.
The bitmask returned is specific to an object type, each bit set represents an attribute which mismatches in either of the two objects. Unavailability of an attribute in one object and presence in the other is regarded a mismatch as well.
References NULL, and nl_object_ops::oo_compare.
void nl_object_dump | ( | struct nl_object * | obj, |
struct nl_dump_params * | params | ||
) |
Dump this object according to the specified parameters.
References dump_from_ops().
Referenced by main(), and nl_cli_confirm().
Free a cacheable object.
References nl_cache_remove(), NL_DBG, and nl_object_ops::oo_free_data.
Referenced by nl_object_clone(), and nl_object_put().
Acquire a reference on a object.
References NL_DBG.
Referenced by genl_ctrl_search(), genl_ctrl_search_by_name(), nfnl_ct_get(), nfnl_log_get(), nfnl_log_msg_get(), nfnl_nft_chain_get(), nfnl_nft_expr_get(), nfnl_nft_rule_get(), nfnl_nft_set_get(), nfnl_nft_setelem_get(), nfnl_nft_table_get(), nfnl_queue_get(), nfnl_queue_msg_get(), nl_cache_add(), nl_cache_move(), nl_cache_resync(), nl_cache_search(), rtnl_class_get(), rtnl_link_get(), rtnl_link_get_by_name(), rtnl_neigh_get(), rtnl_neightbl_get(), rtnl_qdisc_get(), rtnl_qdisc_get_by_parent(), and rtnl_route_get().
Check if the identifiers of two objects are identical.
References NULL, nl_object_ops::oo_compare, and nl_object_ops::oo_id_attrs.
Referenced by nl_cache_search().
Return true if object is marked.
References NL_OBJ_MARK.
Referenced by nl_cache_resync().
Add mark to object.
References NL_OBJ_MARK.
Referenced by nl_cache_mark_all().
Match a filter against an object.
References LOOSE_COMPARISON, NULL, and nl_object_ops::oo_compare.
Referenced by nl_cache_dump_filter(), nl_cache_foreach_filter(), nl_cache_nitems_filter(), and nl_cache_subset().
Release a reference from an object.
References BUG, NL_DBG, and nl_object_free().
Referenced by flnl_result_put(), genl_family_put(), nfnl_ct_put(), nfnl_log_msg_put(), nfnl_log_put(), nfnl_nft_chain_put(), nfnl_nft_expr_put(), nfnl_nft_rule_put(), nfnl_nft_set_put(), nfnl_nft_setelem_put(), nfnl_nft_table_put(), nfnl_queue_msg_put(), nfnl_queue_put(), nl_cache_remove(), nl_cache_resync(), rtnl_addr_put(), rtnl_class_put(), rtnl_cls_put(), rtnl_link_put(), rtnl_neigh_put(), rtnl_neightbl_put(), rtnl_qdisc_put(), rtnl_route_put(), and rtnl_rule_put().
Check whether this object is used by multiple users.