pppoe

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pppoe creates a PPPoE session with a remote server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	// Interface is the name of the network interface over which the
	// PPPoE session is running.
	Interface string
	// SessionID is the session identifier for the PPPoE session.
	SessionID uint16
	// HardwareAddr is the Ethernet address of the PPPoE endpoint.
	HardwareAddr net.HardwareAddr
}

Addr is a PPPoE peer address.

func (*Addr) Network

func (a *Addr) Network() string

func (*Addr) String

func (a *Addr) String() string

type Conn

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

Conn is a PPPoE connection.

func New

func New(ctx context.Context, ifName string) (*Conn, error)

New runs PPPoE discovery on the given interface, and creates a Conn that can send PPP frames on the resulting PPPoE session.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the PPPoE session.

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

LocalAddr returns the local address of the PPPoE connection. PPPoE Conns don't have an interesting local address to share, so this returns nil for now.

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read reads a packet from the PPPoE session.

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr returns the address of the connected PPPoE concentrator, as an *Addr.

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(deadline time.Time) error

SetDeadline sets both the read and write deadlines for future Read and Write operations.

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(deadline time.Time) error

SetReadDeadline sets the deadline for future Read operations.

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(deadline time.Time) error

SetWriteDeadline sets the deadline for future Write operations.

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write writes a packet to the PPPoE session.

Jump to

Keyboard shortcuts

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