File: const.go

package info (click to toggle)
golang-github-katalix-go-l2tp 0.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 632 kB
  • sloc: ansic: 127; sh: 10; makefile: 4
file content (49 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package pppoe

// PPPoECode indicates the PPPoE packet type.
type PPPoECode uint8

// PPPoESessionID, in combination with the peer's Ethernet addresses,
// uniquely identifies a given PPPoE session.
type PPPoESessionID uint16

// PPPoETagType identifies the tags contained in the data payload of
// PPPoE discovery packets.
type PPPoETagType uint16

// PPPoE packet codes.
const (
	// PPPoE Active Discovery Initiation packet
	PPPoECodePADI PPPoECode = 0x09
	// PPPoE Active Discovery Offer packet
	PPPoECodePADO PPPoECode = 0x07
	// PPPoE Active Discovery Request packet
	PPPoECodePADR PPPoECode = 0x19
	// PPPoE Active Discovery Session-confirmation packet
	PPPoECodePADS PPPoECode = 0x65
	// PPPoE Active Discovery Terminate packet
	PPPoECodePADT PPPoECode = 0xa7
)

// PPPoE Tag types.
//
// PPPoE packets may contain zero or more tags, which are
// TLV constructs.
const (
	PPPoETagTypeEOL              PPPoETagType = 0x0000
	PPPoETagTypeServiceName      PPPoETagType = 0x0101
	PPPoETagTypeACName           PPPoETagType = 0x0102
	PPPoETagTypeHostUniq         PPPoETagType = 0x0103
	PPPoETagTypeACCookie         PPPoETagType = 0x0104
	PPPoETagTypeVendorSpecific   PPPoETagType = 0x0105
	PPPoETagTypeRelaySessionID   PPPoETagType = 0x0110
	PPPoETagTypeServiceNameError PPPoETagType = 0x0201
	PPPoETagTypeACSystemError    PPPoETagType = 0x0202
	PPPoETagTypeGenericError     PPPoETagType = 0x0203
)

// internal constants
const (
	pppoePacketMinLength = 20 // raw packet: 14 bytes Ethernet header, 6 bytes PPPoE header
	pppoeTagMinLength    = 4  // bytes: 2 for type, 2 for length
)