cnet

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AF_INET      = 2
	SOCK_STREAM  = 1
	SOCK_DGRAM   = 2
	SOL_SOCKET   = uint16(0xffff)
	SO_BROADCAST = 0x20
)

Variables

This section is empty.

Functions

func Accept

func Accept(a1 int, a2 *SockAddr, a3 *int) int

func Bind

func Bind(fd int, addr *SockAddr, sz int) int

func GetHostname

func GetHostname(buf *byte, sz int) int

func Htonl

func Htonl(v uint32) uint32

func Htons

func Htons(v uint16) uint16

func Listen

func Listen(a1, a2 int32) int32

func Ntoa

func Ntoa(a Address) *byte

func Ntohl

func Ntohl(v uint32) uint32

func Ntohs

func Ntohs(v uint16) uint16

func Ntop

func Ntop(a1 int32, a2 unsafe.Pointer, a3 *byte, a4 uint32) *byte

func Pton

func Pton(a1 int32, a2 *byte, a3 unsafe.Pointer) *byte

func Recv

func Recv(a1 int32, a2 *byte, a3 uint32, a4 int32) int32

func RecvFrom

func RecvFrom(a1 int32, a2 *byte, a3 uint32, a4 int32, a5 *SockAddr, a6 *int) int32

func Send

func Send(a1 int32, a2 *byte, a3 int32, a4 int32) int32

func SendTo

func SendTo(a1 int32, a2 *byte, a3 uint32, a4 int32, a5 *SockAddr, a6 int) int32

func SetSockOpt

func SetSockOpt(fd int, level int, name int, val *byte, sz int) int

func Shutdown

func Shutdown(a1, a2 int32) int32

func Socket

func Socket(domain, typ, proto int) int

Types

type Addr

type Addr uint64

func ParseAddr

func ParseAddr(s string) Addr

type Address

type Address struct {
	Addr uint32
}

type Handle added in v0.3.1

type Handle = int

type HostEnt

type HostEnt struct {
	Name     *byte
	Aliases  **byte
	AddrType int32
	Length   int32
	AddrList **byte
}

func GetHostByName

func GetHostByName(name *byte) *HostEnt

type Port

type Port uint32

type SockAddr

type SockAddr struct {
	Family int16
	Data   [14]byte
}

type SockAddrInet

type SockAddrInet struct {
	Family int16
	Port   uint16
	Addr   Address
	Zero   [8]byte
}

Jump to

Keyboard shortcuts

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