2021-08-26 11:06:40 +02:00
|
|
|
//+build novpp
|
|
|
|
|
|
|
|
package tap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/KusakabeSi/EtherGuardVPN/config"
|
|
|
|
)
|
|
|
|
|
2021-08-26 14:09:07 +02:00
|
|
|
const (
|
|
|
|
VPP_SUPPORT = "No VPP support"
|
|
|
|
)
|
|
|
|
|
2021-08-26 11:06:40 +02:00
|
|
|
type VppTap struct {
|
|
|
|
stopRead chan struct{}
|
|
|
|
events chan Event
|
|
|
|
}
|
|
|
|
|
|
|
|
// New creates and returns a new TUN interface for the application.
|
2021-08-30 08:39:34 +02:00
|
|
|
func CreateVppTAP(iconfig config.InterfaceConf,NodeID config.Vertex, loglevel string) (tapdev Device, err error) {
|
2021-08-26 14:09:07 +02:00
|
|
|
return nil, errors.New("VPP module not compiled.")
|
2021-08-26 11:06:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (tap *VppTap) Read([]byte, int) (int, error) {
|
|
|
|
return 0, errors.New("Device stopped")
|
|
|
|
}
|
|
|
|
func (tap *VppTap) Write(packet []byte, size int) (int, error) {
|
|
|
|
return size, nil
|
|
|
|
}
|
|
|
|
func (tap *VppTap) Flush() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (tap *VppTap) MTU() (int, error) {
|
|
|
|
return 1500, nil
|
|
|
|
}
|
|
|
|
func (tap *VppTap) Name() (string, error) {
|
|
|
|
return "Invalid device", nil
|
|
|
|
}
|
|
|
|
func (tap *VppTap) Events() chan Event {
|
|
|
|
return tap.events
|
|
|
|
}
|
|
|
|
func (tap *VppTap) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|