Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
9de45f8f
Unverified
Commit
9de45f8f
authored
Aug 25, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtnl: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
f23b538c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
18 deletions
+25
-18
rtnl.c
src/lxc/rtnl.c
+12
-8
rtnl.h
src/lxc/rtnl.h
+13
-10
No files found.
src/lxc/rtnl.c
View file @
9de45f8f
...
...
@@ -54,20 +54,24 @@ extern int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg)
}
extern
int
rtnetlink_transaction
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
request
,
struct
rtnlmsg
*
answer
)
struct
rtnlmsg
*
request
,
struct
rtnlmsg
*
answer
)
{
return
netlink_transaction
(
&
handler
->
nlh
,
(
struct
nlmsg
*
)
&
request
->
nlmsghdr
,
return
netlink_transaction
(
&
handler
->
nlh
,
(
struct
nlmsg
*
)
&
request
->
nlmsghdr
,
(
struct
nlmsg
*
)
&
answer
->
nlmsghdr
);
}
extern
struct
rtnlmsg
*
rtnlmsg_alloc
(
size_t
size
)
{
/* size_t len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size; */
/* return (struct rtnlmsg *)nlmsg_alloc(len); */
/*
size_t len;
len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size;
return (struct rtnlmsg *)nlmsg_alloc(len);
*/
return
NULL
;
}
extern
void
rtnlmsg_free
(
struct
rtnlmsg
*
rtnlmsg
)
{
free
(
rtnlmsg
);
}
extern
void
rtnlmsg_free
(
struct
rtnlmsg
*
rtnlmsg
)
{
free
(
rtnlmsg
);
}
src/lxc/rtnl.h
View file @
9de45f8f
...
...
@@ -20,6 +20,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __LXC_RTNL_H
#define __LXC_RTNL_H
...
...
@@ -35,8 +36,7 @@
*
* @nlh: the netlink socket handler
*/
struct
rtnl_handler
{
struct
rtnl_handler
{
struct
nl_handler
nlh
;
};
...
...
@@ -59,7 +59,7 @@ struct rtnlmsg {
*
* Returns 0 on success, < 0 otherwise
*/
int
rtnetlink_open
(
struct
rtnl_handler
*
handler
);
extern
int
rtnetlink_open
(
struct
rtnl_handler
*
handler
);
/*
* genetlink_close : close a route netlink socket
...
...
@@ -68,7 +68,7 @@ int rtnetlink_open(struct rtnl_handler *handler);
*
* Returns 0 on success, < 0 otherwise
*/
int
rtnetlink_close
(
struct
rtnl_handler
*
handler
);
extern
int
rtnetlink_close
(
struct
rtnl_handler
*
handler
);
/*
* rtnetlink_rcv : receive a route netlink socket, it is up
...
...
@@ -79,7 +79,7 @@ int rtnetlink_close(struct rtnl_handler *handler);
*
* Returns 0 on success, < 0 otherwise
*/
int
rtnetlink_rcv
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
rtnlmsg
);
extern
int
rtnetlink_rcv
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
rtnlmsg
);
/*
* rtnetlink_send : send a route netlink socket, it is up
...
...
@@ -90,11 +90,12 @@ int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg);
*
* Returns 0 on success, < 0 otherwise
*/
int
rtnetlink_send
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
rtnlmsg
);
extern
int
rtnetlink_send
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
rtnlmsg
);
struct
genlmsg
*
genlmsg_alloc
(
size_t
size
);
void
rtnlmsg_free
(
struct
rtnlmsg
*
rtnlmsg
);
extern
void
rtnlmsg_free
(
struct
rtnlmsg
*
rtnlmsg
);
/*
* rtnetlink_transaction : send and receive a route netlink message in one shot
...
...
@@ -105,6 +106,8 @@ void rtnlmsg_free(struct rtnlmsg *rtnlmsg);
*
* Returns 0 on success, < 0 otherwise
*/
int
rtnetlink_transaction
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
request
,
struct
rtnlmsg
*
answer
);
#endif
extern
int
rtnetlink_transaction
(
struct
rtnl_handler
*
handler
,
struct
rtnlmsg
*
request
,
struct
rtnlmsg
*
answer
);
#endif
/* __LXC_RTNL_H */
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