libvirt/src/lxc/veth.h
Ryota Ozaki 8db32571ba LXC allow container to have ethN interfaces
Current implementation of lxc driver creates vethN named
interface(s) in the host and passes as it is to a container.
The reason why it doesn't use ethN is due to the limitation
that one namespace cannot have multiple iterfaces that have
an identical name so that we give up creating ethN named
interface in the host for the container.

However, we should be able to allow the container to have
ethN by changing the name after clone(CLONE_NEWNET).

* src/lxc/lxc_container.c src/lxc/veth.c src/lxc/veth.h: do the clone
  and then renames interfaces eth0 ... ethN to keep the interface names
  familiar in the domain
2009-11-05 14:11:30 +01:00

27 lines
673 B
C

/*
* veth.h: Interface to tools for managing veth pairs
*
* Copyright IBM Corp. 2008
*
* See COPYING.LIB for the License of this software
*
* Authors:
* David L. Leskovec <dlesko at linux.vnet.ibm.com>
*/
#ifndef VETH_H
#define VETH_H
#include <config.h>
/* Function declarations */
int vethCreate(char* veth1, int veth1MaxLen, char* veth2,
int veth2MaxLen);
int vethDelete(const char* veth);
int vethInterfaceUpOrDown(const char* veth, int upOrDown);
int moveInterfaceToNetNs(const char *iface, int pidInNs);
int setMacAddr(const char* iface, const char* macaddr);
int setInterfaceName(const char* iface, const char* new);
#endif /* VETH_H */