All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: netdev@vger.kernel.org
Cc: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	ilias.apalodimas@linaro.org, simon.fok@baesystems.com
Subject: [PATCH iproute2 net-next v3 3/6] libnetlink: Add helper for getting a __s32 from netlink msgs
Date: Fri,  5 Oct 2018 16:25:19 -0700	[thread overview]
Message-ID: <20181005232522.4848-4-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20181005232522.4848-1-vinicius.gomes@intel.com>

From: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>

This function retrieves a signed 32-bit integer from a netlink message
and returns it.

Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
---
 include/libnetlink.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/libnetlink.h b/include/libnetlink.h
index ffc49e56..c44c3c72 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -185,6 +185,10 @@ static inline __u64 rta_getattr_u64(const struct rtattr *rta)
 	memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
 	return tmp;
 }
+static inline __s32 rta_getattr_s32(const struct rtattr *rta)
+{
+	return *(__s32 *)RTA_DATA(rta);
+}
 static inline __s64 rta_getattr_s64(const struct rtattr *rta)
 {
 	__s64 tmp;
-- 
2.19.0

  parent reply	other threads:[~2018-10-06  6:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 23:25 [PATCH iproute2 net-next v3 0/6] Introduce the taprio scheduler Vinicius Costa Gomes
2018-10-05 23:25 ` [PATCH iproute2 net-next v3 1/6] utils: Implement get_s64() Vinicius Costa Gomes
2018-10-05 23:25 ` [PATCH iproute2 net-next v3 2/6] include: Add helper to retrieve a __s64 from a netlink msg Vinicius Costa Gomes
2018-10-05 23:25 ` Vinicius Costa Gomes [this message]
2018-10-05 23:25 ` [PATCH iproute2 net-next v3 4/6] include: add definitions for taprio [DO NOT COMMIT] Vinicius Costa Gomes
2018-10-05 23:25 ` [PATCH iproute2 net-next v3 5/6] tc: Add support for configuring the taprio scheduler Vinicius Costa Gomes
2018-10-05 23:25 ` [PATCH iproute2 net-next v3 6/6] taprio: Add manpage for tc-taprio(8) Vinicius Costa Gomes
2018-10-07 17:41 ` [PATCH iproute2 net-next v3 0/6] Introduce the taprio scheduler David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181005232522.4848-4-vinicius.gomes@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jesus.sanchez-palencia@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=simon.fok@baesystems.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.