]>
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 | ||
26 | /* | |
27 | * Create a macvlan network device | |
28 | */ | |
29 | extern int lxc_configure_macvlan(const char *link, const char *peer); | |
30 | ||
31 | /* | |
32 | * Create a veth pair virtual device | |
33 | */ | |
34 | extern int lxc_configure_veth(const char *veth1, const char *veth2, | |
35 | const char *bridge); | |
36 | ||
37 | /* | |
38 | * Convert a string mac address to a socket structure | |
39 | */ | |
40 | extern int lxc_convert_mac(char *macaddr, struct sockaddr *sockaddr); | |
41 | ||
42 | /* | |
43 | * Move a device between namespaces | |
44 | */ | |
45 | extern int device_move(const char *name, pid_t pid); | |
46 | ||
47 | /* | |
48 | * Delete a network device | |
49 | */ | |
50 | extern int device_delete(const char *name); | |
51 | ||
52 | /* | |
53 | * Set the device network up | |
54 | */ | |
55 | extern int device_up(const char *name); | |
56 | ||
57 | /* | |
58 | * Set the device network down | |
59 | */ | |
60 | extern int device_down(const char *name); | |
61 | ||
62 | /* | |
63 | * Change the device name | |
64 | */ | |
65 | extern int device_rename(const char *oldname, const char *newname); | |
66 | ||
67 | /* | |
68 | * Create a veth network device | |
69 | */ | |
70 | extern int veth_create(const char *name1, const char *name2); | |
71 | ||
72 | /* | |
73 | * Create a macvlan network device | |
74 | */ | |
75 | extern int macvlan_create(const char *master, const char *name); | |
76 | ||
77 | /* | |
78 | * Activate forwarding | |
79 | */ | |
80 | extern int ip_forward_on(const char *name, int family); | |
81 | ||
82 | /* | |
83 | * Disable forwarding | |
84 | */ | |
85 | extern int ip_forward_off(const char *name, int family); | |
86 | ||
87 | /* | |
88 | * Set ip address | |
89 | */ | |
90 | extern int ip_addr_add(const char *ifname, const char *addr, | |
91 | int prefix, const char *bcast); | |
92 | ||
93 | extern int ip6_addr_add(const char *ifname, const char *addr, | |
94 | int prefix, const char *bcast); | |
95 | ||
96 | /* | |
97 | * Attach an interface to the bridge | |
98 | */ | |
99 | extern int bridge_attach(const char *bridge, const char *ifname); | |
100 | ||
101 | /* | |
102 | * Detach an interface from the bridge | |
103 | */ | |
104 | extern int bridge_detach(const char *bridge, const char *ifname); | |
105 | ||
106 | /* | |
107 | * Create default gateway | |
108 | */ | |
109 | extern int route_create_default(const char *addr, const char *ifname, int gateway); | |
110 | ||
111 | /* | |
112 | * Delete default gateway | |
113 | */ | |
114 | extern int route_delete_default(const char *addr, const char *ifname, int gateway); | |
115 | ||
116 | /* | |
117 | * Activate neighbor proxying | |
118 | */ | |
119 | extern int neigh_proxy_on(const char *name, int family); | |
120 | ||
121 | /* | |
122 | * Disable neighbor proxying | |
123 | */ | |
124 | extern int neigh_proxy_off(const char *name, int family); | |
125 | ||
126 | #endif |