mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-12-24 06:18:40 +08:00
23 lines
420 B
Go
23 lines
420 B
Go
// SPDX-FileCopyrightText: 2023-2024 Steffen Vogel <post@steffenvogel.de>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//go:build !windows
|
|
|
|
package device
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
|
|
"golang.zx2c4.com/wireguard/ipc"
|
|
)
|
|
|
|
func ListenUAPI(name string) (net.Listener, error) {
|
|
file, err := ipc.UAPIOpen(name)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("failed to open UAPI socket: %w", err)
|
|
}
|
|
|
|
return ipc.UAPIListen(name, file)
|
|
}
|