2014-03-26 20:53:49 +04:00
# include <config.h>
2016-11-13 13:01:34 +03:00
# include "viralloc.h"
2014-03-26 20:53:49 +04:00
# include "virstring.h"
# include "virnetdev.h"
# include "virnetdevtap.h"
# include "internal.h"
# define VIR_FROM_THIS VIR_FROM_BHYVE
void virMacAddrGenerate ( const unsigned char prefix [ VIR_MAC_PREFIX_BUFLEN ] ,
virMacAddrPtr addr )
{
addr - > addr [ 0 ] = prefix [ 0 ] ;
addr - > addr [ 1 ] = prefix [ 1 ] ;
addr - > addr [ 2 ] = prefix [ 2 ] ;
addr - > addr [ 3 ] = 0 ;
addr - > addr [ 4 ] = 0 ;
addr - > addr [ 5 ] = 0 ;
}
int virNetDevTapCreateInBridgePort ( const char * brname ATTRIBUTE_UNUSED ,
char * * ifname ,
const virMacAddr * macaddr ATTRIBUTE_UNUSED ,
const unsigned char * vmuuid ATTRIBUTE_UNUSED ,
2014-09-18 10:25:12 +04:00
const char * tunpath ATTRIBUTE_UNUSED ,
2014-03-26 20:53:49 +04:00
int * tapfd ATTRIBUTE_UNUSED ,
2015-02-10 12:50:38 +03:00
size_t tapfdSize ATTRIBUTE_UNUSED ,
2014-03-26 20:53:49 +04:00
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED ,
virNetDevVlanPtr virtVlan ATTRIBUTE_UNUSED ,
2017-04-07 18:54:12 +03:00
virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED ,
2017-01-23 04:41:03 +03:00
unsigned int mtu ATTRIBUTE_UNUSED ,
unsigned int * actualMTU ATTRIBUTE_UNUSED ,
2014-03-26 20:53:49 +04:00
unsigned int fakeflags ATTRIBUTE_UNUSED )
{
2016-11-13 13:01:34 +03:00
VIR_FREE ( * ifname ) ;
2014-03-26 20:53:49 +04:00
if ( VIR_STRDUP ( * ifname , " vnet0 " ) < 0 )
return - 1 ;
return 0 ;
}
char * virNetDevTapGetRealDeviceName ( char * name ATTRIBUTE_UNUSED )
{
char * fakename ;
if ( VIR_STRDUP ( fakename , " faketapdev " ) < 0 )
return NULL ;
return fakename ;
}
int virNetDevSetOnline ( const char * ifname ATTRIBUTE_UNUSED ,
bool online ATTRIBUTE_UNUSED )
{
return 0 ;
}
2018-02-06 12:09:09 +03:00
int bind ( int sockfd ATTRIBUTE_UNUSED ,
const struct sockaddr * addr ATTRIBUTE_UNUSED ,
socklen_t addrlen ATTRIBUTE_UNUSED )
{
return 0 ;
}