wgAndroid

package
v0.0.0-...-3e8ad1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

README

Interface between WireGuard Go and WireGuard Android

This code replaces (and is almost identical to) wireguard-android/tools/tunnel/libwg-go for use with gomobile builds of wireguard-go.

Files:

  • api-android.go - equivalent of libwg-go/api-android.go
  • goruntime-boottime-overmonitonic.diff - patch to change clock in Go runtime module. It needs to be applied before building this module.

They should be kept up-to-date to match the originals in wireguard-android.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WgGetConfig

func WgGetConfig(tunnelHandle int32) string

func WgGetSocketV4

func WgGetSocketV4(tunnelHandle int32) int32

func WgGetSocketV6

func WgGetSocketV6(tunnelHandle int32) int32

func WgGetState

func WgGetState(tunnelHandle int32) int

func WgSetNetworkAvailable

func WgSetNetworkAvailable(tunnelHandle int32, available bool) int

func WgTurnOff

func WgTurnOff(tunnelHandle int32)

func WgTurnOn

func WgTurnOn(interfaceName string, tunFd int32, settings string, socketType string, socketProtector SocketProtector, allowedSrcAddresses string, serverNameStrategy int32) int32

func WgVersion

func WgVersion() string

Types

type AndroidLogger

type AndroidLogger struct {
	// contains filtered or unexported fields
}

func (AndroidLogger) Printf

func (l AndroidLogger) Printf(format string, args ...interface{})

type SocketProtector

type SocketProtector interface {
	ProtectFromVpn(fd int32) bool
}

type TunnelHandle

type TunnelHandle struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL