-
-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
810 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package dns | ||
|
||
const ( | ||
fileUncleanShutdownResolvConfLocation = "/var/db/netbird/resolv.conf" | ||
fileUncleanShutdownManagerTypeLocation = "/var/db/netbird/manager" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build !android | ||
|
||
package dns | ||
|
||
const ( | ||
fileUncleanShutdownResolvConfLocation = "/var/lib/netbird/resolv.conf" | ||
fileUncleanShutdownManagerTypeLocation = "/var/lib/netbird/manager" | ||
) |
2 changes: 1 addition & 1 deletion
2
client/internal/dns/dbus_linux.go → client/internal/dns/dbus_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_parser_linux.go → client/internal/dns/file_parser_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...nt/internal/dns/file_parser_linux_test.go → client/internal/dns/file_parser_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_repair_linux.go → client/internal/dns/file_repair_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...nt/internal/dns/file_repair_linux_test.go → client/internal/dns/file_repair_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_linux.go → client/internal/dns/file_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_linux_test.go → client/internal/dns/file_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/internal/dns/network_manager_linux.go → client/internal/dns/network_manager_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/resolvconf_linux.go → client/internal/dns/resolvconf_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/server_linux.go → client/internal/dns/server_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package dns | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
var errNotImplemented = errors.New("not implemented") | ||
|
||
func newSystemdDbusConfigurator(wgInterface string) (hostManager, error) { | ||
return nil, fmt.Errorf("systemd dns management: %w on freebsd", errNotImplemented) | ||
} | ||
|
||
func isSystemdResolvedRunning() bool { | ||
return false | ||
} | ||
|
||
func isSystemdResolveConfMode() bool { | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build darwin || dragonfly || netbsd || openbsd | ||
|
||
package systemops | ||
|
||
import "syscall" | ||
|
||
// filterRoutesByFlags - return true if need to ignore such route message because it consists specific flags. | ||
func filterRoutesByFlags(routeMessageFlags int) bool { | ||
if routeMessageFlags&syscall.RTF_UP == 0 { | ||
return true | ||
} | ||
|
||
if routeMessageFlags&(syscall.RTF_REJECT|syscall.RTF_BLACKHOLE|syscall.RTF_WASCLONED) != 0 { | ||
return true | ||
} | ||
|
||
return false | ||
} |
19 changes: 19 additions & 0 deletions
19
client/internal/routemanager/systemops/routeflags_freebsd.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//go:build: freebsd | ||
package systemops | ||
|
||
import "syscall" | ||
|
||
// filterRoutesByFlags - return true if need to ignore such route message because it consists specific flags. | ||
func filterRoutesByFlags(routeMessageFlags int) bool { | ||
if routeMessageFlags&syscall.RTF_UP == 0 { | ||
return true | ||
} | ||
|
||
// NOTE: syscall.RTF_WASCLONED deprecated in FreeBSD 8.0 (https://www.freebsd.org/releases/8.0R/relnotes-detailed/) | ||
// a concept of cloned route (a route generated by an entry with RTF_CLONING flag) is deprecated. | ||
if routeMessageFlags&(syscall.RTF_REJECT|syscall.RTF_BLACKHOLE) != 0 { | ||
return true | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...outemanager/systemops/systemops_darwin.go → .../routemanager/systemops/systemops_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//go:build freebsd | ||
|
||
package ssh | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
func setWinSize(file *os.File, width, height int) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !(linux && 386) | ||
//go:build !(linux && 386) && !freebsd | ||
|
||
package main | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package freebsd | ||
|
||
import "errors" | ||
|
||
var ( | ||
ErrDoesNotExist = errors.New("does not exist") | ||
ErrNameDoesNotMatch = errors.New("name does not match") | ||
) |
Oops, something went wrong.