func (t *TapManager) AddToBridge(bridge string) error { err := CheckBridge(bridge) if err != nil { if C.CreateBridge(C.CString(bridge)) != 0 { return errors.New("Failed to create bridge") } } if C.AddTapToBridge(C.CString(bridge), C.CString(t.name)) != 0 { return errors.New("Failed to add tap to bridge") } return nil }
func AddTapToBridge(bridge, tap string) error { if C.AddTapToBridge(C.CString(bridge), C.CString(tap)) < 0 { return errors.New("Failed to add tap to bridge") } return nil }