diff options
author | Thomas Graf <tgr@plip.localdomain> | 2008-10-14 19:26:44 +0200 |
---|---|---|
committer | Thomas Graf <tgr@plip.localdomain> | 2008-10-14 19:26:44 +0200 |
commit | 23ee46ef7115c2e311c36e43a833e6c3deada18a (patch) | |
tree | 60793068d05c482737787baf4619449741a2a23b /include | |
parent | 5702d4c1b97616f5212da31db01a2f3c79c15b7c (diff) | |
download | android_external_libnl-23ee46ef7115c2e311c36e43a833e6c3deada18a.tar.gz android_external_libnl-23ee46ef7115c2e311c36e43a833e6c3deada18a.tar.bz2 android_external_libnl-23ee46ef7115c2e311c36e43a833e6c3deada18a.zip |
Replace NL_KEEP code with proper message reference counting
Adds reference counting to netlink messages so callbacks
can hold on to a message without using the broken keep
message flag.
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink-types.h | 1 | ||||
-rw-r--r-- | include/netlink/handlers.h | 18 | ||||
-rw-r--r-- | include/netlink/msg.h | 1 |
3 files changed, 2 insertions, 18 deletions
diff --git a/include/netlink-types.h b/include/netlink-types.h index be5fc4e..238b131 100644 --- a/include/netlink-types.h +++ b/include/netlink-types.h @@ -129,6 +129,7 @@ struct nl_msg struct ucred nm_creds; struct nlmsghdr * nm_nlh; size_t nm_size; + int nm_refcnt; }; struct rtnl_link_map diff --git a/include/netlink/handlers.h b/include/netlink/handlers.h index 38c9ba0..266dc44 100644 --- a/include/netlink/handlers.h +++ b/include/netlink/handlers.h @@ -65,24 +65,6 @@ enum nl_cb_action { }; /** - * Callback action modifiers - * @ingroup cb - * - * These should be ORed to the callback actions defined by enum - * nl_cb_action. - */ -enum nl_cb_action_mods { - /** Callee keeps the message, don't free */ - NL_KEEP_MSG = 0x1000, -#define NL_KEEP_MSG NL_KEEP_MSG /* for config testing */ -}; - - -/* backwards compatibility */ -#define NL_PROCEED NL_OK -#define NL_EXIT NL_STOP - -/** * Callback kinds * @ingroup cb */ diff --git a/include/netlink/msg.h b/include/netlink/msg.h index 1cb1305..e331f42 100644 --- a/include/netlink/msg.h +++ b/include/netlink/msg.h @@ -81,6 +81,7 @@ extern int nlmsg_expand(struct nl_msg *, size_t); extern struct nlmsghdr * nlmsg_put(struct nl_msg *, uint32_t, uint32_t, int, int, int); extern struct nlmsghdr * nlmsg_hdr(struct nl_msg *); +extern void nlmsg_get(struct nl_msg *); extern void nlmsg_free(struct nl_msg *); /* attribute modification */ |