networking

package
v0.0.0-...-c4c5c6d Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindToInterface

func BindToInterface(fd int, ifaceName string) error

BindToInterface binds a socket to an interface

func CreateRawSocket

func CreateRawSocket() (int, error)

CreateRawSocket returns a raw IP socket

func SockHeaderIncl

func SockHeaderIncl(sock int) error

SockHeaderIncl calls setsockopt IP_HDRINCL on our socket

Types

type EndPoint

type EndPoint struct {
	Src              net.IP
	DstPort          uint16
	SrcPort          uint16
	RandomizeSrcPort bool
	RandomizeDstPort bool
	// contains filtered or unexported fields
}

EndPoint is what we use to send raw packets on our endpoint

func NewEndPoint

func NewEndPoint(src net.IP, dstPort uint16,
	networkInterface string) (*EndPoint, error)

NewEndPoint returns an attack endpoint

func (*EndPoint) SendPacket

func (e *EndPoint) SendPacket(b []byte) error

SendPacket send the packet in a unix agnostic way

func (*EndPoint) SendUDPPacket

func (e *EndPoint) SendUDPPacket(payload []byte, Dst net.IP) error

SendUDPPacket will send a UDP packet

Jump to

Keyboard shortcuts

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