]> git.proxmox.com Git - mirror_lxc.git/blame - src/lxc/network.h
lxc: child failing before container rename
[mirror_lxc.git] / src / lxc / network.h
CommitLineData
0ad19a3f 1/*
2 * lxc: linux Container library
3 *
4 * (C) Copyright IBM Corp. 2007, 2008
5 *
6 * Authors:
7 * Daniel Lezcano <dlezcano at fr.ibm.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#ifndef _network_h
24#define _network_h
25
0ad19a3f 26/*
27 * Convert a string mac address to a socket structure
28 */
29extern int lxc_convert_mac(char *macaddr, struct sockaddr *sockaddr);
30
31/*
32 * Move a device between namespaces
33 */
82d5ae15 34extern int lxc_device_move(int ifindex, pid_t pid);
0ad19a3f 35
36/*
37 * Delete a network device
38 */
497353b6 39extern int lxc_device_delete(const char *name);
0ad19a3f 40
b9a5bb58
DL
41/*
42 * Delete a network device by the index
43 */
44extern int lxc_device_delete_index(int ifindex);
45
0ad19a3f 46/*
47 * Set the device network up
48 */
497353b6 49extern int lxc_device_up(const char *name);
0ad19a3f 50
51/*
52 * Set the device network down
53 */
497353b6 54extern int lxc_device_down(const char *name);
0ad19a3f 55
56/*
57 * Change the device name
58 */
497353b6 59extern int lxc_device_rename(const char *oldname, const char *newname);
0ad19a3f 60
75d09f83
DL
61/*
62 * Change the mtu size for the specified device
63 */
497353b6 64extern int lxc_device_set_mtu(const char *name, int mtu);
75d09f83 65
0ad19a3f 66/*
67 * Create a veth network device
68 */
497353b6 69extern int lxc_veth_create(const char *name1, const char *name2);
0ad19a3f 70
71/*
72 * Create a macvlan network device
73 */
e892973e 74extern int lxc_macvlan_create(const char *master, const char *name, int mode);
0ad19a3f 75
26c39028
JHS
76/*
77 * Create a vlan network device
78 */
79extern int lxc_vlan_create(const char *master, const char *name, ushort vid);
80
0ad19a3f 81/*
82 * Activate forwarding
83 */
497353b6 84extern int lxc_ip_forward_on(const char *name, int family);
0ad19a3f 85
86/*
87 * Disable forwarding
88 */
497353b6 89extern int lxc_ip_forward_off(const char *name, int family);
0ad19a3f 90
91/*
92 * Set ip address
93 */
4bf1968d 94extern int lxc_ip_addr_add(int family, int ifindex, void *addr, int prefix);
0ad19a3f 95
96/*
97 * Attach an interface to the bridge
98 */
497353b6 99extern int lxc_bridge_attach(const char *bridge, const char *ifname);
0ad19a3f 100
0ad19a3f 101/*
102 * Create default gateway
103 */
497353b6
DL
104extern int lxc_route_create_default(const char *addr, const char *ifname,
105 int gateway);
0ad19a3f 106
107/*
108 * Delete default gateway
109 */
497353b6
DL
110extern int lxc_route_delete_default(const char *addr, const char *ifname,
111 int gateway);
0ad19a3f 112
113/*
114 * Activate neighbor proxying
115 */
497353b6 116extern int lxc_neigh_proxy_on(const char *name, int family);
0ad19a3f 117
118/*
119 * Disable neighbor proxying
120 */
497353b6 121extern int lxc_neigh_proxy_off(const char *name, int family);
0ad19a3f 122
123#endif