func (vd *Vswitchdevice) GetTapMac() string {
	macc, _ := net.ParseMAC(vd.mac)
	if macc != nil {
		log.Printf("[TAP] GetTapMac: %s", vd.mac)
		return strings.ToUpper(vd.mac)
	}
	log.Printf("[TAP] GetTapMac: mac address is empty, using default one")
	return "00:00:00:00:00:00"
}
GetTapMac returns mac address of the device we created
package tap
import (
	"V-switch/conf"
	"V-switch/plane"
	"V-switch/tools"
	"fmt"
	"log"
	"net"
	"os"
	"strconv"
	"strings"
)
type Vswitchdevice struct {
	devicename string    
	mtu        int       
	frame      []byte    
	Realif     *TapConn  
	err        error     
	mac        string    
}
var VDev Vswitchdevice
func init() {
	VDev.SetDeviceConf()
	go VDev.ReadFrameThread()   
	go VDev.WriteFrameThread()  
}
func (vd *Vswitchdevice) SetDeviceConf() {
	vd.mtu, vd.err = strconv.Atoi(conf.GetConfigItem("MTU"))
	vd.frame = make([]byte, vd.mtu+22)  
	log.Printf("[TAP] MTU SET TO: %v", vd.mtu)
	vd.devicename = conf.GetConfigItem("DEVICENAME")
	log.Printf("[TAP] Devicename in conf is: %v", vd.devicename)
	vd.Realif = new(TapConn)
	vd.err = vd.Realif.Open(uint(vd.mtu), vd.devicename)
	if vd.err != nil {
		log.Printf("[TAP][ERROR] Error creating tap: <%s>", vd.err)
		log.Println("[TAP][ERROR] Are you ROOT?")
		os.Exit(1)
	} else {
		tmpIf, _ := net.InterfaceByName(vd.devicename)
		vd.mac = strings.ToUpper(tmpIf.HardwareAddr.String())
		plane.VSwitch.HAddr = vd.mac
		log.Printf("[TAP] Success creating tap: <%s> at mac [%s] ", vd.devicename, vd.mac)
	}
}
func (vd *Vswitchdevice) ReadFrameThread() {
	defer func() {
		if e := recover(); e != nil {
			log.Println("[TAP][EXCEPTION] OH, SHIT.")
			err, ok := e.(error)
			if !ok {
				err = fmt.Errorf("[TAP][DRV]: %v", e)
			}
			log.Printf("[TAP][EXCEPTION] Error: <%s>", err)
		}
	}()
	PcapReaderLoop()
}