diff options
author | Thomas Graf <tgr@lsx.localdomain> | 2008-05-15 11:26:32 (GMT) |
---|---|---|
committer | Thomas Graf <tgr@lsx.localdomain> | 2008-05-15 11:26:32 (GMT) |
commit | 1155370f520cb64657e25153255cf7dc1424317f (patch) | |
tree | bfa1323d2495dfe5729eb27d0536d4349f2a9d86 /lib/route/classifier.c | |
parent | 0cf780859cbce363a6e2cd4b8d19c5498a3530f5 (diff) | |
download | libnl-1155370f520cb64657e25153255cf7dc1424317f.zip libnl-1155370f520cb64657e25153255cf7dc1424317f.tar.gz libnl-1155370f520cb64657e25153255cf7dc1424317f.tar.bz2 |
Rename struct nl_handle to struct nl_sock
The idea of a common handle is long revised and only misleading,
nl_handle really represents a socket with some additional
action handlers assigned to it.
Alias for nl_handle is kept for backwards compatibility.
Diffstat (limited to 'lib/route/classifier.c')
-rw-r--r-- | lib/route/classifier.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/lib/route/classifier.c b/lib/route/classifier.c index 8008bc4..0f60358 100644 --- a/lib/route/classifier.c +++ b/lib/route/classifier.c @@ -75,7 +75,7 @@ errout: return err; } -static int cls_request_update(struct nl_cache *cache, struct nl_handle *handle) +static int cls_request_update(struct nl_cache *cache, struct nl_sock *sk) { struct tcmsg tchdr = { .tcm_family = AF_UNSPEC, @@ -83,7 +83,7 @@ static int cls_request_update(struct nl_cache *cache, struct nl_handle *handle) .tcm_parent = cache->c_iarg2, }; - return nl_send_simple(handle, RTM_GETTFILTER, NLM_F_DUMP, &tchdr, + return nl_send_simple(sk, RTM_GETTFILTER, NLM_F_DUMP, &tchdr, sizeof(tchdr)); } @@ -151,7 +151,7 @@ int rtnl_cls_build_add_request(struct rtnl_cls *cls, int flags, /** * Add a new classifier - * @arg handle netlink handle + * @arg sk Netlink socket. * @arg cls classifier to add * @arg flags additional netlink message flags * @@ -161,7 +161,7 @@ int rtnl_cls_build_add_request(struct rtnl_cls *cls, int flags, * * @return 0 on sucess or a negative error if an error occured. */ -int rtnl_cls_add(struct nl_handle *handle, struct rtnl_cls *cls, int flags) +int rtnl_cls_add(struct nl_sock *sk, struct rtnl_cls *cls, int flags) { struct nl_msg *msg; int err; @@ -169,11 +169,11 @@ int rtnl_cls_add(struct nl_handle *handle, struct rtnl_cls *cls, int flags) if ((err = rtnl_cls_build_add_request(cls, flags, &msg)) < 0) return err; - if ((err = nl_send_auto_complete(handle, msg)) < 0) + if ((err = nl_send_auto_complete(sk, msg)) < 0) return err; nlmsg_free(msg); - return nl_wait_for_ack(handle); + return nl_wait_for_ack(sk); } /** @@ -197,7 +197,7 @@ int rtnl_cls_build_change_request(struct rtnl_cls *cls, int flags, /** * Change a classifier - * @arg handle netlink handle + * @arg sk Netlink socket. * @arg cls classifier to change * @arg flags additional netlink message flags * @@ -207,8 +207,7 @@ int rtnl_cls_build_change_request(struct rtnl_cls *cls, int flags, * * @return 0 on sucess or a negative error if an error occured. */ -int rtnl_cls_change(struct nl_handle *handle, struct rtnl_cls *cls, - int flags) +int rtnl_cls_change(struct nl_sock *sk, struct rtnl_cls *cls, int flags) { struct nl_msg *msg; int err; @@ -216,11 +215,11 @@ int rtnl_cls_change(struct nl_handle *handle, struct rtnl_cls *cls, if ((err = rtnl_cls_build_change_request(cls, flags, &msg)) < 0) return err; - if ((err = nl_send_auto_complete(handle, msg)) < 0) + if ((err = nl_send_auto_complete(sk, msg)) < 0) return err; nlmsg_free(msg); - return nl_wait_for_ack(handle); + return nl_wait_for_ack(sk); } /** @@ -245,7 +244,7 @@ int rtnl_cls_build_delete_request(struct rtnl_cls *cls, int flags, /** * Delete a classifier - * @arg handle netlink handle + * @arg sk Netlink socket. * @arg cls classifier to delete * @arg flags additional netlink message flags * @@ -255,7 +254,7 @@ int rtnl_cls_build_delete_request(struct rtnl_cls *cls, int flags, * * @return 0 on sucess or a negative error if an error occured. */ -int rtnl_cls_delete(struct nl_handle *handle, struct rtnl_cls *cls, int flags) +int rtnl_cls_delete(struct nl_sock *sk, struct rtnl_cls *cls, int flags) { struct nl_msg *msg; int err; @@ -263,11 +262,11 @@ int rtnl_cls_delete(struct nl_handle *handle, struct rtnl_cls *cls, int flags) if ((err = rtnl_cls_build_delete_request(cls, flags, &msg)) < 0) return err; - if ((err = nl_send_auto_complete(handle, msg)) < 0) + if ((err = nl_send_auto_complete(sk, msg)) < 0) return err; nlmsg_free(msg); - return nl_wait_for_ack(handle); + return nl_wait_for_ack(sk); } /** @} */ @@ -280,7 +279,7 @@ int rtnl_cls_delete(struct nl_handle *handle, struct rtnl_cls *cls, int flags) /** * Build a classifier cache including all classifiers attached to the * specified class/qdisc on eht specified interface. - * @arg handle netlink handle + * @arg sk Netlink socket. * @arg ifindex interface index of the link the classes are * attached to. * @arg parent parent qdisc/class @@ -293,7 +292,7 @@ int rtnl_cls_delete(struct nl_handle *handle, struct rtnl_cls *cls, int flags) * cache after using it. * @return 0 on success or a negative error code. */ -int rtnl_cls_alloc_cache(struct nl_handle *handle, int ifindex, uint32_t parent, struct nl_cache **result) +int rtnl_cls_alloc_cache(struct nl_sock *sk, int ifindex, uint32_t parent, struct nl_cache **result) { struct nl_cache * cache; int err; @@ -304,7 +303,7 @@ int rtnl_cls_alloc_cache(struct nl_handle *handle, int ifindex, uint32_t parent, cache->c_iarg1 = ifindex; cache->c_iarg2 = parent; - if (handle && (err = nl_cache_refill(handle, cache)) < 0) { + if (sk && (err = nl_cache_refill(sk, cache)) < 0) { nl_cache_free(cache); return err; } |