bnet

package
v0.0.0-...-70d8496 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: BSD-3-Clause, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// the following is for newly created tcbs
	TCPNEW tcpstate_t = iota
	SYNSENT
	SYNRCVD
	// LISTEN is not really used
	LISTEN
	ESTAB
	FINWAIT1
	FINWAIT2
	CLOSING
	CLOSEWAIT
	LASTACK
	TIMEWAIT
	CLOSED
)
View Source
const Secondms millis_t = 1000

Variables

View Source
var Routetbl routetbl_t

Functions

func Arp_resolve

func Arp_resolve(sip, dip Ip4_t) (*Mac_t, defs.Err_t)

returns destination mac and error

func Fastmillis

func Fastmillis() millis_t

func Net_init

func Net_init(pm mem.Page_i)

func Net_start

func Net_start(pkt [][]uint8, tlen int)

network stack processing begins here. pkt references DMA memory and will be clobbered once net_start returns to the caller.

func Netdump

func Netdump()

func Nic_insert

func Nic_insert(ip Ip4_t, n nic_i)

func Nic_lookup

func Nic_lookup(lip Ip4_t) (nic_i, bool)

Types

type Tcpfops_t

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

active connect fops

func (*Tcpfops_t) Accept

func (tf *Tcpfops_t) Accept(fdops.Userio_i) (fdops.Fdops_i, int, defs.Err_t)

func (*Tcpfops_t) Bind

func (tf *Tcpfops_t) Bind(saddr []uint8) defs.Err_t

func (*Tcpfops_t) Close

func (tf *Tcpfops_t) Close() defs.Err_t

func (*Tcpfops_t) Connect

func (tf *Tcpfops_t) Connect(saddr []uint8) defs.Err_t

func (*Tcpfops_t) Fcntl

func (tf *Tcpfops_t) Fcntl(cmd, opt int) int

func (*Tcpfops_t) Fstat

func (tf *Tcpfops_t) Fstat(st *stat.Stat_t) defs.Err_t

func (*Tcpfops_t) Getsockopt

func (tf *Tcpfops_t) Getsockopt(opt int, bufarg fdops.Userio_i,
	intarg int) (int, defs.Err_t)

func (*Tcpfops_t) Listen

func (tf *Tcpfops_t) Listen(backlog int) (fdops.Fdops_i, defs.Err_t)

func (*Tcpfops_t) Lseek

func (tf *Tcpfops_t) Lseek(int, int) (int, defs.Err_t)

func (*Tcpfops_t) Mmapi

func (tf *Tcpfops_t) Mmapi(int, int, bool) ([]mem.Mmapinfo_t, defs.Err_t)

func (*Tcpfops_t) Pathi

func (tf *Tcpfops_t) Pathi() defs.Inum_t

func (*Tcpfops_t) Pollone

func (tf *Tcpfops_t) Pollone(pm fdops.Pollmsg_t) (fdops.Ready_t, defs.Err_t)

func (*Tcpfops_t) Pread

func (tf *Tcpfops_t) Pread(dst fdops.Userio_i, offset int) (int, defs.Err_t)

func (*Tcpfops_t) Pwrite

func (tf *Tcpfops_t) Pwrite(src fdops.Userio_i, offset int) (int, defs.Err_t)

func (*Tcpfops_t) Read

func (tf *Tcpfops_t) Read(dst fdops.Userio_i) (int, defs.Err_t)

func (*Tcpfops_t) Recvmsg

func (tf *Tcpfops_t) Recvmsg(dst fdops.Userio_i,
	fromsa fdops.Userio_i, cmsg fdops.Userio_i, flag int) (int, int, int, defs.Msgfl_t, defs.Err_t)

func (*Tcpfops_t) Reopen

func (tf *Tcpfops_t) Reopen() defs.Err_t

func (*Tcpfops_t) Sendmsg

func (tf *Tcpfops_t) Sendmsg(src fdops.Userio_i,
	toaddr []uint8, cmsg []uint8, flags int) (int, defs.Err_t)

XXX read/write should be wrapper around recvmsg/sendmsg

func (*Tcpfops_t) Set

func (tf *Tcpfops_t) Set(tcb *Tcptcb_t, opt defs.Fdopt_t)

func (*Tcpfops_t) Setsockopt

func (tf *Tcpfops_t) Setsockopt(lev, opt int, src fdops.Userio_i,
	intarg int) defs.Err_t

func (*Tcpfops_t) Shutdown

func (tf *Tcpfops_t) Shutdown(read, write bool) defs.Err_t

func (*Tcpfops_t) Truncate

func (tf *Tcpfops_t) Truncate(newlen uint) defs.Err_t

func (*Tcpfops_t) Write

func (tf *Tcpfops_t) Write(src fdops.Userio_i) (int, defs.Err_t)

type Tcptcb_t

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

Jump to

Keyboard shortcuts

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