bhyvexml2argvmock.c 1.9 KB
Newer Older
R
Roman Bogorodskiy 已提交
1 2
#include <config.h>

3
#include "viralloc.h"
R
Roman Bogorodskiy 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#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;
}

J
Ján Tomko 已提交
22
int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED,
R
Roman Bogorodskiy 已提交
23
                                   char **ifname,
J
Ján Tomko 已提交
24 25 26 27 28
                                   const virMacAddr *macaddr G_GNUC_UNUSED,
                                   const unsigned char *vmuuid G_GNUC_UNUSED,
                                   const char *tunpath G_GNUC_UNUSED,
                                   int *tapfd G_GNUC_UNUSED,
                                   size_t tapfdSize G_GNUC_UNUSED,
29
                                   const virNetDevVPortProfile *virtPortProfile G_GNUC_UNUSED,
30
                                   const virNetDevVlan *virtVlan G_GNUC_UNUSED,
J
Ján Tomko 已提交
31 32 33 34
                                   virNetDevCoalescePtr coalesce G_GNUC_UNUSED,
                                   unsigned int mtu G_GNUC_UNUSED,
                                   unsigned int *actualMTU G_GNUC_UNUSED,
                                   unsigned int fakeflags G_GNUC_UNUSED)
R
Roman Bogorodskiy 已提交
35
{
36
    VIR_FREE(*ifname);
37
    *ifname = g_strdup("vnet0");
R
Roman Bogorodskiy 已提交
38 39 40
    return 0;
}

J
Ján Tomko 已提交
41
char *virNetDevTapGetRealDeviceName(char *name G_GNUC_UNUSED)
R
Roman Bogorodskiy 已提交
42 43 44
{
    char *fakename;

45
    fakename = g_strdup("faketapdev");
R
Roman Bogorodskiy 已提交
46 47 48
    return fakename;
}

J
Ján Tomko 已提交
49 50
int virNetDevSetOnline(const char *ifname G_GNUC_UNUSED,
                       bool online G_GNUC_UNUSED)
R
Roman Bogorodskiy 已提交
51 52 53
{
    return 0;
}
54

J
Ján Tomko 已提交
55 56 57
int bind(int sockfd G_GNUC_UNUSED,
         const struct sockaddr *addr G_GNUC_UNUSED,
         socklen_t addrlen G_GNUC_UNUSED)
58 59 60
{
    return 0;
}