pap

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pap implements PAP protocol as specified in RFC1334

Index

Constants

View Source
const (
	// DefaultTimeout is the default timeout for PAP
	DefaultTimeout = 5 * time.Second
	// DefaultRetry is the default retry for PAP
	DefaultRetry = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code uint8

Code is the PAP msg code

const (
	CodeAuthRequest Code = 1
	CodeAuthACK     Code = 2
	CodeAuthNAK     Code = 3
)

a list of PAP msg code

func (Code) String

func (c Code) String() string

String return a string representation of c

type PAP

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

PAP is the PAP protocol

func NewPAP

func NewPAP(uname, passwd string, pppProto *lcp.PPP) *PAP

NewPAP creates a new PAP instance with uname, passwd; uses pppProtol as the underlying PPP protocol;

func (*PAP) AuthSelf

func (pap *PAP) AuthSelf() error

AuthSelf autnenticate self to the peer

type Pkt

type Pkt struct {
	Code   Code
	ID     uint8
	Len    uint16
	PeerID []byte
	Passwd []byte
	Msg    []byte
}

Pkt represents a PAP pkt

func (*Pkt) Parse

func (pp *Pkt) Parse(buf []byte) error

Parse buf into pp

func (*Pkt) Serialize

func (pp *Pkt) Serialize() ([]byte, error)

Serialize pp to byte slice

func (Pkt) String

func (pp Pkt) String() string

String returns a string representation of pp

Jump to

Keyboard shortcuts

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