dnp3

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DNP3StartByte1 = 0x05
	DNP3StartByte2 = 0x64
	DNP3MinLength  = 10 // Start(2) + Len(1) + Ctrl(1) + Dest(2) + Src(2) + CRC(2)
)
View Source
const (
	CtrlDIR = 0x80 // Direction (1=from master)
	CtrlPRM = 0x40 // Primary message
	CtrlFCB = 0x20 // Frame count bit
	CtrlFCV = 0x10 // Frame count valid
)

DNP3 Control byte flags

View Source
const DNP3 = "dnp3"
View Source
const (
	FuncRequestLinkStatus = 0x09
)

DNP3 Function codes (lower 4 bits of control byte)

Variables

This section is empty.

Functions

This section is empty.

Types

type DNP3Plugin

type DNP3Plugin struct{}

func (*DNP3Plugin) Name

func (p *DNP3Plugin) Name() string

func (*DNP3Plugin) PortPriority

func (p *DNP3Plugin) PortPriority(port uint16) bool

func (*DNP3Plugin) Priority

func (p *DNP3Plugin) Priority() int

func (*DNP3Plugin) Run

func (p *DNP3Plugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error)

Run

DNP3 (Distributed Network Protocol 3) is a protocol used in SCADA systems
for communications between control centers, RTUs, and IEDs.

DNP3 runs over TCP/IP on port 20000 by default. All DNP3 frames begin with
the start bytes 0x05 0x64 (magic signature).

This implementation uses Function Code 0x09 (Request Link Status) which is
a safe, read-only diagnostic query that:
- Only requests link status
- Does NOT modify any data
- Does NOT trigger control operations
- Safe for ICS/SCADA environments

Frame structure (FT3 Format):
- Start bytes: 0x05 0x64
- Length: 1 byte
- Control byte: 1 byte (DIR, PRM, FCB, FCV, Function code)
- Destination address: 2 bytes (little-endian)
- Source address: 2 bytes (little-endian)
- Header CRC: 2 bytes (CRC-16)

Testing: Can be tested with dnp3 simulators or OpenDNP3 outstation

func (*DNP3Plugin) Type

func (p *DNP3Plugin) Type() plugins.Protocol

Jump to

Keyboard shortcuts

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