]>
Commit | Line | Data |
---|---|---|
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 | */ | |
29 | extern int lxc_convert_mac(char *macaddr, struct sockaddr *sockaddr); | |
30 | ||
31 | /* | |
32 | * Move a device between namespaces | |
33 | */ | |
82d5ae15 | 34 | extern int lxc_device_move(int ifindex, pid_t pid); |
0ad19a3f | 35 | |
36 | /* | |
37 | * Delete a network device | |
38 | */ | |
497353b6 | 39 | extern int lxc_device_delete(const char *name); |
0ad19a3f | 40 | |
41 | /* | |
42 | * Set the device network up | |
43 | */ | |
497353b6 | 44 | extern int lxc_device_up(const char *name); |
0ad19a3f | 45 | |
46 | /* | |
47 | * Set the device network down | |
48 | */ | |
497353b6 | 49 | extern int lxc_device_down(const char *name); |
0ad19a3f | 50 | |
51 | /* | |
52 | * Change the device name | |
53 | */ | |
497353b6 | 54 | extern int lxc_device_rename(const char *oldname, const char *newname); |
0ad19a3f | 55 | |
75d09f83 DL |
56 | /* |
57 | * Change the mtu size for the specified device | |
58 | */ | |
497353b6 | 59 | extern int lxc_device_set_mtu(const char *name, int mtu); |
75d09f83 | 60 | |
0ad19a3f | 61 | /* |
62 | * Create a veth network device | |
63 | */ | |
497353b6 | 64 | extern int lxc_veth_create(const char *name1, const char *name2); |
0ad19a3f | 65 | |
66 | /* | |
67 | * Create a macvlan network device | |
68 | */ | |
e892973e | 69 | extern int lxc_macvlan_create(const char *master, const char *name, int mode); |
0ad19a3f | 70 | |
26c39028 JHS |
71 | /* |
72 | * Create a vlan network device | |
73 | */ | |
74 | extern int lxc_vlan_create(const char *master, const char *name, ushort vid); | |
75 | ||
0ad19a3f | 76 | /* |
77 | * Activate forwarding | |
78 | */ | |
497353b6 | 79 | extern int lxc_ip_forward_on(const char *name, int family); |
0ad19a3f | 80 | |
81 | /* | |
82 | * Disable forwarding | |
83 | */ | |
497353b6 | 84 | extern int lxc_ip_forward_off(const char *name, int family); |
0ad19a3f | 85 | |
86 | /* | |
87 | * Set ip address | |
88 | */ | |
4bf1968d | 89 | extern int lxc_ip_addr_add(int family, int ifindex, void *addr, int prefix); |
0ad19a3f | 90 | |
91 | /* | |
92 | * Attach an interface to the bridge | |
93 | */ | |
497353b6 | 94 | extern int lxc_bridge_attach(const char *bridge, const char *ifname); |
0ad19a3f | 95 | |
96 | /* | |
97 | * Detach an interface from the bridge | |
98 | */ | |
497353b6 | 99 | extern int lxc_bridge_detach(const char *bridge, const char *ifname); |
0ad19a3f | 100 | |
101 | /* | |
102 | * Create default gateway | |
103 | */ | |
497353b6 DL |
104 | extern int lxc_route_create_default(const char *addr, const char *ifname, |
105 | int gateway); | |
0ad19a3f | 106 | |
107 | /* | |
108 | * Delete default gateway | |
109 | */ | |
497353b6 DL |
110 | extern int lxc_route_delete_default(const char *addr, const char *ifname, |
111 | int gateway); | |
0ad19a3f | 112 | |
113 | /* | |
114 | * Activate neighbor proxying | |
115 | */ | |
497353b6 | 116 | extern int lxc_neigh_proxy_on(const char *name, int family); |
0ad19a3f | 117 | |
118 | /* | |
119 | * Disable neighbor proxying | |
120 | */ | |
497353b6 | 121 | extern int lxc_neigh_proxy_off(const char *name, int family); |
0ad19a3f | 122 | |
123 | #endif |