Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6c1dd3b6
Commit
6c1dd3b6
authored
Apr 01, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netlink: Add nla_put_net{16,32,64}() helpers.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
969e8e25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
include/net/netlink.h
include/net/netlink.h
+33
-0
No files found.
include/net/netlink.h
View file @
6c1dd3b6
...
@@ -782,6 +782,17 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
...
@@ -782,6 +782,17 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be16
),
&
value
);
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be16
),
&
value
);
}
}
/**
* nla_put_net16 - Add 16-bit network byte order netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @attrtype: attribute type
* @value: numeric value
*/
static
inline
int
nla_put_net16
(
struct
sk_buff
*
skb
,
int
attrtype
,
__be16
value
)
{
return
nla_put_be16
(
skb
,
attrtype
|
NLA_F_NET_BYTEORDER
,
value
);
}
/**
/**
* nla_put_u32 - Add a u32 netlink attribute to a socket buffer
* nla_put_u32 - Add a u32 netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @skb: socket buffer to add attribute to
...
@@ -804,6 +815,17 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
...
@@ -804,6 +815,17 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be32
),
&
value
);
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be32
),
&
value
);
}
}
/**
* nla_put_net32 - Add 32-bit network byte order netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @attrtype: attribute type
* @value: numeric value
*/
static
inline
int
nla_put_net32
(
struct
sk_buff
*
skb
,
int
attrtype
,
__be32
value
)
{
return
nla_put_be32
(
skb
,
attrtype
|
NLA_F_NET_BYTEORDER
,
value
);
}
/**
/**
* nla_put_u64 - Add a u64 netlink attribute to a socket buffer
* nla_put_u64 - Add a u64 netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @skb: socket buffer to add attribute to
...
@@ -826,6 +848,17 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
...
@@ -826,6 +848,17 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be64
),
&
value
);
return
nla_put
(
skb
,
attrtype
,
sizeof
(
__be64
),
&
value
);
}
}
/**
* nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @attrtype: attribute type
* @value: numeric value
*/
static
inline
int
nla_put_net64
(
struct
sk_buff
*
skb
,
int
attrtype
,
__be64
value
)
{
return
nla_put_be64
(
skb
,
attrtype
|
NLA_F_NET_BYTEORDER
,
value
);
}
/**
/**
* nla_put_string - Add a string netlink attribute to a socket buffer
* nla_put_string - Add a string netlink attribute to a socket buffer
* @skb: socket buffer to add attribute to
* @skb: socket buffer to add attribute to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment