raw

package
v0.0.0-...-964b57c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package raw provides the implementation of raw sockets (see raw(7)). Raw sockets allow applications to:

  • manually write and inspect transport layer headers and payloads
  • receive all traffic of a given transport protocol (e.g. ICMP or UDP)
  • optionally write and inspect network layer and link layer headers for packets

Raw sockets don't have any notion of ports, and incoming packets are demultiplexed solely by protocol number. Thus, a raw UDP endpoint will receive every UDP packet received by netstack. bind(2) and connect(2) can be used to filter incoming packets by source and destination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEndpoint

func NewEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, transProto tcpip.TransportProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error)

NewEndpoint returns a raw endpoint for the given protocols. TODO(b/129292371): IP_HDRINCL and AF_PACKET.

Types

type EndpointFactory

type EndpointFactory struct{}

EndpointFactory implements stack.UnassociatedEndpointFactory.

func (EndpointFactory) NewUnassociatedRawEndpoint

func (EndpointFactory) NewUnassociatedRawEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, transProto tcpip.TransportProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error)

NewUnassociatedRawEndpoint implements stack.UnassociatedEndpointFactory.

Jump to

Keyboard shortcuts

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