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
ebc73a67
Unverified
Commit
ebc73a67
authored
Aug 24, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
cb0dc11b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
62 deletions
+32
-62
network.c
src/lxc/network.c
+0
-0
network.h
src/lxc/network.h
+32
-62
No files found.
src/lxc/network.c
View file @
ebc73a67
This diff is collapsed.
Click to expand it.
src/lxc/network.h
View file @
ebc73a67
...
...
@@ -23,64 +23,50 @@
#ifndef __LXC_NETWORK_H
#define __LXC_NETWORK_H
/*
* Convert a string mac address to a socket structure
*/
#include <stdio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
/* Convert a string mac address to a socket structure. */
extern
int
lxc_convert_mac
(
char
*
macaddr
,
struct
sockaddr
*
sockaddr
);
/*
* Move a device between namespaces
*/
/* Move a device between namespaces. */
extern
int
lxc_netdev_move_by_index
(
int
ifindex
,
pid_t
pid
,
const
char
*
ifname
);
extern
int
lxc_netdev_move_by_name
(
const
char
*
ifname
,
pid_t
pid
,
const
char
*
newname
);
extern
int
lxc_netdev_move_by_name
(
const
char
*
ifname
,
pid_t
pid
,
const
char
*
newname
);
/*
* Delete a network device
*/
/* Delete a network device. */
extern
int
lxc_netdev_delete_by_name
(
const
char
*
name
);
extern
int
lxc_netdev_delete_by_index
(
int
ifindex
);
/*
* Change the device name
*/
/* Change the device name. */
extern
int
lxc_netdev_rename_by_name
(
const
char
*
oldname
,
const
char
*
newname
);
extern
int
lxc_netdev_rename_by_index
(
int
ifindex
,
const
char
*
newname
);
extern
int
netdev_set_flag
(
const
char
*
name
,
int
flag
);
/*
* Set the device network up or down
*/
/* Set the device network up or down. */
extern
int
lxc_netdev_isup
(
const
char
*
name
);
extern
int
lxc_netdev_up
(
const
char
*
name
);
extern
int
lxc_netdev_down
(
const
char
*
name
);
/*
* Change the mtu size for the specified device
*/
/* Change the mtu size for the specified device. */
extern
int
lxc_netdev_set_mtu
(
const
char
*
name
,
int
mtu
);
/*
* Create a virtual network devices
*/
/* Create a virtual network devices. */
extern
int
lxc_veth_create
(
const
char
*
name1
,
const
char
*
name2
);
extern
int
lxc_macvlan_create
(
const
char
*
master
,
const
char
*
name
,
int
mode
);
extern
int
lxc_vlan_create
(
const
char
*
master
,
const
char
*
name
,
unsigned
short
vid
);
extern
int
lxc_vlan_create
(
const
char
*
master
,
const
char
*
name
,
unsigned
short
vid
);
/*
* Activate forwarding
*/
/* Activate forwarding.*/
extern
int
lxc_ip_forward_on
(
const
char
*
name
,
int
family
);
/*
* Disable forwarding
*/
/* Disable forwarding. */
extern
int
lxc_ip_forward_off
(
const
char
*
name
,
int
family
);
/*
* Set ip address
*/
/* Set ip address. */
extern
int
lxc_ipv6_addr_add
(
int
ifindex
,
struct
in6_addr
*
addr
,
struct
in6_addr
*
mcast
,
struct
in6_addr
*
acast
,
int
prefix
);
...
...
@@ -88,57 +74,41 @@ extern int lxc_ipv6_addr_add(int ifindex, struct in6_addr *addr,
extern
int
lxc_ipv4_addr_add
(
int
ifindex
,
struct
in_addr
*
addr
,
struct
in_addr
*
bcast
,
int
prefix
);
/*
* Get ip address
*/
/* Get ip address. */
extern
int
lxc_ipv4_addr_get
(
int
ifindex
,
struct
in_addr
**
res
);
extern
int
lxc_ipv6_addr_get
(
int
ifindex
,
struct
in6_addr
**
res
);
/*
* Set a destination route to an interface
*/
/* Set a destination route to an interface. */
extern
int
lxc_ipv4_dest_add
(
int
ifindex
,
struct
in_addr
*
dest
);
extern
int
lxc_ipv6_dest_add
(
int
ifindex
,
struct
in6_addr
*
dest
);
/*
* Set default route.
*/
/* Set default route. */
extern
int
lxc_ipv4_gateway_add
(
int
ifindex
,
struct
in_addr
*
gw
);
extern
int
lxc_ipv6_gateway_add
(
int
ifindex
,
struct
in6_addr
*
gw
);
/*
* Attach an interface to the bridge
*/
extern
int
lxc_bridge_attach
(
const
char
*
lxcpath
,
const
char
*
name
,
const
char
*
bridge
,
const
char
*
ifname
);
/* Attach an interface to the bridge. */
extern
int
lxc_bridge_attach
(
const
char
*
lxcpath
,
const
char
*
name
,
const
char
*
bridge
,
const
char
*
ifname
);
/*
* Create default gateway
*/
/* Create default gateway. */
extern
int
lxc_route_create_default
(
const
char
*
addr
,
const
char
*
ifname
,
int
gateway
);
/*
* Delete default gateway
*/
/* Delete default gateway. */
extern
int
lxc_route_delete_default
(
const
char
*
addr
,
const
char
*
ifname
,
int
gateway
);
/*
* Activate neighbor proxying
*/
/* Activate neighbor proxying. */
extern
int
lxc_neigh_proxy_on
(
const
char
*
name
,
int
family
);
/*
* Disable neighbor proxying
*/
/* Disable neighbor proxying. */
extern
int
lxc_neigh_proxy_off
(
const
char
*
name
,
int
family
);
/*
* Generate a new unique network interface name
*/
/* Generate a new unique network interface name. */
extern
char
*
lxc_mkifname
(
char
*
template
);
extern
const
char
*
lxc_net_type_to_str
(
int
type
);
extern
int
setup_private_host_hw_addr
(
char
*
veth1
);
extern
int
netdev_get_mtu
(
int
ifindex
);
#endif
#endif
/* __LXC_NETWORK_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