Skip to content

socket: add functions for unspecified platforms #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions netlink_unspecified.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,3 @@ func NeighList(linkIndex, family int) ([]Neigh, error) {
func NeighDeserialize(m []byte) (*Neigh, error) {
return nil, ErrNotImplemented
}

func SocketGet(local, remote net.Addr) (*Socket, error) {
return nil, ErrNotImplemented
}

func SocketDestroy(local, remote net.Addr) (*Socket, error) {
return nil, ErrNotImplemented
}
40 changes: 40 additions & 0 deletions socket_unspecified.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//go:build !linux
// +build !linux

package netlink

import (
"net"
)

func SocketGet(local, remote net.Addr) (*Socket, error) {
return nil, ErrNotImplemented
}

func SocketDestroy(local, remote net.Addr) error {
return ErrNotImplemented
}

func SocketDiagTCPInfo(family uint8) ([]*InetDiagTCPInfoResp, error) {
return nil, ErrNotImplemented
}

func SocketDiagTCP(family uint8) ([]*Socket, error) {
return nil, ErrNotImplemented
}

func SocketDiagUDPInfo(family uint8) ([]*InetDiagUDPInfoResp, error) {
return nil, ErrNotImplemented
}

func SocketDiagUDP(family uint8) ([]*Socket, error) {
return nil, ErrNotImplemented
}

func UnixSocketDiagInfo() ([]*UnixDiagInfoResp, error) {
return nil, ErrNotImplemented
}

func UnixSocketDiag() ([]*UnixSocket, error) {
return nil, ErrNotImplemented
}
11 changes: 11 additions & 0 deletions socket_xdp_unspecified.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build !linux

package netlink

func SocketXDPGetInfo(ino uint32, cookie uint64) (*XDPDiagInfoResp, error) {
return nil, ErrNotImplemented
}

func SocketDiagXDP() ([]*XDPDiagInfoResp, error) {
return nil, ErrNotImplemented
}