iec60870

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 5 Imported by: 0

README

go-iec60870-5 - IEC 60870-5 telecontrol protocols for Go

Go Version Go Reference CI Status Interop Code Coverage Latest Release

A pure Go implementation of the IEC 60870-5 protocol family: no cgo, no dependencies outside the standard library.

Companion standard Package Status
IEC 60870-5-104 (TCP/IP) iec104, iec104/client, iec104/server Carried over from go-iec104 v0.3.0 with its tests and captures; checked clause by clause against edition 1 (2000). Client and server pass independent interop runs against five stacks of iec60870-5-interop (lib60870-C, OpenMUC j60870, wendy512/iec104, cB-Sigma, pascaldekloe/part5). See docs/iec104 and docs/IEC104_PARITY.md.
IEC 60870-5-101 (serial) iec101, iec101/client, iec101/server New. Controlling and controlled station, unbalanced and balanced. Client and server pass independent interop runs against lib60870-C, cB-Sigma and digitalpetri/iec60870 in both modes, with the default field sizes and four other sets (digitalpetri's balanced station excluded: an upstream defect) (make interop-iec101, Interop workflow; INTEROPERABILITY.md).
IEC 60870-5-103 (protection equipment) iec103, iec103/client, iec103/server New. Own ASDU codec for every compatible type (cl. 7.3), controlling system and protection equipment: initialization, time sync, general interrogation, general commands, generic services, disturbance data transfer. Unit, annex B and e2e evidence; independent evidence for the server (four client stacks of iec60870-5-interop; its disturbance data transfer against Open103), the client only against one deviating server. See docs/iec103.
IEC 60870-5-102 (integrated totals) iec102, iec102/client, iec102/server, iec102/ree New. Own codec, controlling and integrated total station, opt-in Spanish REE profile. Built without the standard's text, from vendor documentation and recorded meter traffic. Independent evidence for the server only: the gisce/iec870ree controlling station (REE profile) against iec102/server (make interop-iec102); the client has no independent peer. See docs/iec102.

What is implemented, clause by clause, and what evidence backs it: docs/FEATURE-STATUS.md. Nothing here is certified; interoperability tests are not conformance tests.

Packages

The packages follow the layers of IEC 60870-5, sharing what the companion standards share and nothing more (ARCHITECTURE.md):

Package Standard What it is
cp IEC 60870-5-4 time tags CP16Time2a, CP24Time2a, CP32Time2a, CP56Time2a
ft12 IEC 60870-5-1 FT 1.2 frames and a resynchronizing stream decoder (101, 102, 103)
link IEC 60870-5-2 link procedures: unbalanced primary and secondary, balanced station, FCB/FCV, retries
asdu IEC 60870-5-101/-104 the telecontrol ASDU model and codec, configurable field sizes
telecontrol IEC 60870-5-5 as used by 101/104 matching answers to requests: confirmations, interrogation, read, commands
iec101, iec101/client, iec101/server IEC 60870-5-101 serial telecontrol stations
iec102, iec102/client, iec102/server, iec102/ree IEC 60870-5-102 integrated totals: own ASDU, stations on link, opt-in REE profile
iec103, iec103/client, iec103/server IEC 60870-5-103 protection equipment: own ASDU (FUN/INF), stations on link
iec104, iec104/apci, iec104/client, iec104/server IEC 60870-5-104 TCP/IP telecontrol stations
sec IEC 62351-5 / IEC TS 60870-5-7 application-layer security (used by iec104 only)
root iec60870 - the Logger interfaces

API reference generated from the source: docs/api; guide to the API: API.md.

Install

go get github.com/otfabric/go-iec60870-5

Requires Go 1.26 or later.

IEC 60870-5-101 quickstart

The transport is any io.ReadWriter: a serial port (for example go-serial), a TCP connection to a terminal server that passes the line through unchanged, or a pipe in tests. IEC 101 over such a TCP stream is still IEC 101, not IEC 104.

p := iec101.DefaultParams() // unbalanced, 1-octet link address, COT 1, CA 1, IOA 2
c, err := client.New(port, client.Config{
	Params:   p,
	LinkAddr: 3, // link address of the controlled station
	Handler:  func(a *asdu.ASDU) { fmt.Println(a) }, // spontaneous and polled data
})
if err != nil {
	return err
}
defer c.Close()
if err := c.WaitUp(ctx); err != nil { // link initialized
	return err
}
data, err := c.Interrogate(ctx, 1, asdu.QOIStation)

A runnable version with both stations is iec101/examples/quickstart.

IEC 60870-5-104

The IEC 104 client and server are documented in docs/iec104/README.md, carried over from go-iec104 with their examples in iec104/examples.

Development

make check    # format, lint, vet, govulncheck, tests with -race, coverage floors, examples, docs
make fuzz     # fuzz targets
make interop  # IEC 104 against the pinned reference images (Docker)
make interop-iec101 interop-iec103 interop-iec102  # the serial standards (Docker)

CONTRIBUTING.md, TESTING.md, ERRORS.md, OBSERVABILITY.md, SECURITY.md, RELEASE.md.

Independent reference implementations live in otfabric/iec60870-5-interop (IEC 101/102/103/104). All four suites run against its v0.5.0 images (contract 2.3), pinned by digest. The Self-interop workflow also runs them, by hand, against ghcr.io/otfabric/iec60870-5-interop-<standard>-otfabric:latest (INTEROPERABILITY.md); iec60870-5-interop publishes those images only from a manual workflow (own-go-iec60870-5.yml), so their tags can lag the latest go-iec60870-5 release.

Relation to go-iec104

go-iec104 is deprecated: it is kept in read-only maintenance mode and will be deleted later, together with iec104-interop and iec104ctl. This module replaces it and does not import it. The iec104 packages here began as a copy of go-iec104 v0.3.0 so that IEC 101 could share its ASDU model. How the two relate, and what a migration involves, is in docs/MIGRATION_AUDIT.md.

License

MIT, see LICENSE.

Documentation

Overview

Package iec60870 is the module root of a pure Go implementation of the IEC 60870-5 telecontrol protocol family.

Applications import the subpackages:

This package holds what every companion standard shares: the Logger interfaces.

Docs: README.md, ARCHITECTURE.md, docs/STANDARDS.md, docs/FEATURE-STATUS.md, docs/ROADMAP.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextLogger

type ContextLogger interface {
	Logger

	DebugContext(ctx context.Context, msg string, keysAndValues ...any)
	InfoContext(ctx context.Context, msg string, keysAndValues ...any)
	WarnContext(ctx context.Context, msg string, keysAndValues ...any)
	ErrorContext(ctx context.Context, msg string, keysAndValues ...any)
}

ContextLogger extends Logger with context-aware structured logging, so that a handler can pick trace and span identifiers out of the context. When the Logger also implements ContextLogger, entries that belong to a request are logged with the context the request was called with.

type FieldLogger

type FieldLogger interface {
	Logger

	// With returns a logger that adds the given fields to every entry.
	With(keysAndValues ...any) FieldLogger

	DebugKV(msg string, keysAndValues ...any)
	InfoKV(msg string, keysAndValues ...any)
	WarnKV(msg string, keysAndValues ...any)
	ErrorKV(msg string, keysAndValues ...any)
}

FieldLogger extends Logger with structured key-value logging. When the Logger given to a client or server also implements FieldLogger, the library logs through it: every entry is a constant message plus fields such as "component", "remote", "state", "type", "cause" and "error", instead of one formatted string. NewSlogLogger returns such a logger.

keysAndValues alternate string keys and values, as in log/slog.

func NewSlogFieldLogger

func NewSlogFieldLogger(h slog.Handler) FieldLogger

NewSlogFieldLogger is NewSlogLogger with the result typed as a FieldLogger, for callers that want to add fields with With before handing the logger to a client or server. A nil handler returns a no-op logger.

type Logger

type Logger interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
}

Logger is the logging interface accepted by the client and the server. Implement it to integrate any logging library.

Logging is silent by default. Methods are invoked synchronously on the protocol path and must not block.

A call that does not return normally, of this interface or of FieldLogger, ContextLogger or DebugEnabled, loses its entry; the failure is written once more, with the value and the stack, through Errorf (and dropped when that does not return normally either), and the station that logged goes on. A FieldLogger whose With does not return normally is used through its formatted methods.

func NewSlogLogger

func NewSlogLogger(h slog.Handler) Logger

NewSlogLogger wraps a slog.Handler. The result implements FieldLogger and ContextLogger, so the library logs structured fields through it; messages are only built when the handler is enabled for their level. A nil handler returns a no-op logger.

func NewStdLogger

func NewStdLogger(l *log.Logger) Logger

NewStdLogger wraps a standard library logger. Each message is prefixed with its level. A nil l logs to os.Stderr with the standard flags.

func NopLogger

func NopLogger() Logger

NopLogger returns a Logger that discards everything.

Directories

Path Synopsis
Package asdu implements the Application Service Data Unit of the IEC 60870-5 companion standards: the data unit identifier, the information objects and elements of IEC 60870-5-101 clause 7, and their binary codec.
Package asdu implements the Application Service Data Unit of the IEC 60870-5 companion standards: the data unit identifier, the information objects and elements of IEC 60870-5-101 clause 7, and their binary codec.
Package cp encodes and decodes the binary time tags of IEC 60870-5-4 (subclause 6.8): CP16Time2a (elapsed milliseconds), CP24Time2a (minute, second, millisecond), CP32Time2a (adds the hour) and CP56Time2a (a full date and time).
Package cp encodes and decodes the binary time tags of IEC 60870-5-4 (subclause 6.8): CP16Time2a (elapsed milliseconds), CP24Time2a (minute, second, millisecond), CP32Time2a (adds the hour) and CP56Time2a (a full date and time).
Package ft12 encodes and decodes the FT 1.2 frame format of IEC 60870-5-1 (subclause 6.2.4.2), the serial framing shared by IEC 60870-5-101, -102 and -103:
Package ft12 encodes and decodes the FT 1.2 frame format of IEC 60870-5-1 (subclause 6.2.4.2), the serial framing shared by IEC 60870-5-101, -102 and -103:
Package iec101 holds what the controlling and the controlled station of IEC 60870-5-101 share: the system parameters, the link State and the sentinel errors.
Package iec101 holds what the controlling and the controlled station of IEC 60870-5-101 share: the system parameters, the link State and the sentinel errors.
client
Package client is the controlling station of IEC 60870-5-101: it brings up the link, polls the controlled station (unbalanced transmission) or exchanges messages with it (balanced transmission), runs requests (interrogation, counter interrogation, read, commands, clock synchronization, test, reset process, delay acquisition) and delivers monitor-direction ASDUs to a handler.
Package client is the controlling station of IEC 60870-5-101: it brings up the link, polls the controlled station (unbalanced transmission) or exchanges messages with it (balanced transmission), runs requests (interrogation, counter interrogation, read, commands, clock synchronization, test, reset process, delay acquisition) and delivers monitor-direction ASDUs to a handler.
e2e
Package e2e runs the IEC 60870-5-101 client against the server over in-memory and lossy transports, in unbalanced and balanced mode, and each of them against a hostile raw peer (hostile_test.go) and over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos).
Package e2e runs the IEC 60870-5-101 client against the server over in-memory and lossy transports, in unbalanced and balanced mode, and each of them against a hostile raw peer (hostile_test.go) and over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos).
examples/quickstart command
Command quickstart runs an IEC 60870-5-101 controlling and controlled station against each other over an in-memory line, in unbalanced mode: link initialization, end of initialization, a general interrogation and a select-before-operate command.
Command quickstart runs an IEC 60870-5-101 controlling and controlled station against each other over an in-memory line, in unbalanced mode: link initialization, end of initialization, a general interrogation and a select-before-operate command.
examples/serial command
Command serial is an IEC 60870-5-101 controlling station on a byte stream: a TCP connection to a serial device server (terminal server) that passes the line through unchanged, or a local serial port opened by any io.ReadWriteCloser implementation (for example github.com/otfabric/go-serial).
Command serial is an IEC 60870-5-101 controlling station on a byte stream: a TCP connection to a serial device server (terminal server) that passes the line through unchanged, or a local serial port opened by any io.ReadWriteCloser implementation (for example github.com/otfabric/go-serial).
internal/capture
Package capture decodes recorded IEC 60870-5-101 traffic for tests: the FT 1.2 frames that package serialcap splits out of an RTAC serial-line capture or a TCP stream of a serial port server, and the ASDUs in them under the field sizes the recording uses.
Package capture decodes recorded IEC 60870-5-101 traffic for tests: the FT 1.2 frames that package serialcap splits out of an RTAC serial-line capture or a TCP stream of a serial port server, and the ASDUs in them under the field sizes the recording uses.
server
Package server is the controlled station of IEC 60870-5-101: it answers the link procedures of the controlling station, hands control-direction ASDUs to a Handler and transmits monitor-direction ASDUs: as class 1 or class 2 data when polled (unbalanced transmission), or on its own initiative (balanced transmission).
Package server is the controlled station of IEC 60870-5-101: it answers the link procedures of the controlling station, hands control-direction ASDUs to a Handler and transmits monitor-direction ASDUs: as class 1 or class 2 data when polled (unbalanced transmission), or on its own initiative (balanced transmission).
Package iec102 implements the application layer of IEC 60870-5-102, the companion standard for the transmission of integrated totals in electric power systems: its own ASDU model and codec, the time formats "time a" (CP40Time2a) and "time b" (CP56Time2b), and what the controlling and the controlled station share (State, the sentinel errors).
Package iec102 implements the application layer of IEC 60870-5-102, the companion standard for the transmission of integrated totals in electric power systems: its own ASDU model and codec, the time formats "time a" (CP40Time2a) and "time b" (CP56Time2b), and what the controlling and the controlled station share (State, the sentinel errors).
client
Package client is the controlling station of IEC 60870-5-102: the primary station of unbalanced transmission that reads integrated totals, single-point information, the product specification and the system time of one integrated total station (a meter or a data concentrator).
Package client is the controlling station of IEC 60870-5-102: the primary station of unbalanced transmission that reads integrated totals, single-point information, the product specification and the system time of one integrated total station (a meter or a data concentrator).
e2e
Package e2e runs the IEC 60870-5-102 controlling station of this module against its integrated total station over an in-memory line, each of them against a hostile raw peer (hostile_test.go), both over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos), and the client against arbitrary answers (FuzzClientAnswers).
Package e2e runs the IEC 60870-5-102 controlling station of this module against its integrated total station over an in-memory line, each of them against a hostile raw peer (hostile_test.go), both over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos), and the client against arbitrary answers (FuzzClientAnswers).
examples/quickstart command
Command quickstart runs an IEC 60870-5-102 controlling station and an integrated total station (a meter with an hourly load profile) against each other over an in-memory line: link initialization, the product specification, the station's time and a read of integrated totals by time range (C_CI_NU_2).
Command quickstart runs an IEC 60870-5-102 controlling station and an integrated total station (a meter with an hourly load profile) against each other over an in-memory line: link initialization, the product specification, the station's time and a read of integrated totals by time range (C_CI_NU_2).
internal/capture
Package capture reads the recorded IEC 60870-5-102 frames kept in testdata/captures: the frame log of the innoWatt icra-tarifes-optic tool and the frames in the gisce/iec870ree tests.
Package capture reads the recorded IEC 60870-5-102 frames kept in testdata/captures: the frame log of the innoWatt icra-tarifes-optic tool and the frames in the gisce/iec870ree tests.
ree
Package ree is the Spanish REE profile of IEC 60870-5-102: the type identifications of the private range (128..255) that Spanish fiscal metering ("Protocolo de comunicaciones entre registradores y concentradores", Red Eléctrica de España) assigns, the meaning it gives to the low bits of the integrated totals' quality descriptor and the session procedure (access key and end of session).
Package ree is the Spanish REE profile of IEC 60870-5-102: the type identifications of the private range (128..255) that Spanish fiscal metering ("Protocolo de comunicaciones entre registradores y concentradores", Red Eléctrica de España) assigns, the meaning it gives to the low bits of the integrated totals' quality descriptor and the session procedure (access key and end of session).
server
Package server is the controlled station of IEC 60870-5-102, the integrated total station (a meter or data concentrator): the secondary station of unbalanced transmission.
Package server is the controlled station of IEC 60870-5-102, the integrated total station (a meter or data concentrator): the secondary station of unbalanced transmission.
Package iec103 implements the application layer of IEC 60870-5-103, the companion standard for the informative interface of protection equipment: its own ASDU model (clause 7.1 to 7.3), the information elements of clause 7.2.6, the function type and information number semantics of clause 7.2.5 as data, and what the controlling and the controlled station share (State, the sentinel errors).
Package iec103 implements the application layer of IEC 60870-5-103, the companion standard for the informative interface of protection equipment: its own ASDU model (clause 7.1 to 7.3), the information elements of clause 7.2.6, the function type and information number semantics of clause 7.2.5 as data, and what the controlling and the controlled station share (State, the sentinel errors).
client
Package client is the controlling system of IEC 60870-5-103: the primary station of unbalanced transmission (clause 6.2.3) that polls one item of protection equipment, runs the application functions of clause 7.4 (station initialization, time synchronization, general interrogation, general commands, generic services, disturbance data transfer) and delivers every monitor-direction ASDU to a handler.
Package client is the controlling system of IEC 60870-5-103: the primary station of unbalanced transmission (clause 6.2.3) that polls one item of protection equipment, runs the application functions of clause 7.4 (station initialization, time synchronization, general interrogation, general commands, generic services, disturbance data transfer) and delivers every monitor-direction ASDU to a handler.
e2e
Package e2e runs the IEC 60870-5-103 controlling system (iec103/client) against the protection equipment (iec103/server) over in-memory and lossy lines, each of them against a hostile raw peer (hostile_test.go), and both over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos).
Package e2e runs the IEC 60870-5-103 controlling system (iec103/client) against the protection equipment (iec103/server) over in-memory and lossy lines, each of them against a hostile raw peer (hostile_test.go), and both over a line that drops, duplicates, corrupts, delays, splits, truncates and reorders frames (chaos_test.go, make chaos).
examples/quickstart command
Command quickstart runs an IEC 60870-5-103 controlling system and an item of protection equipment against each other over an in-memory line: link initialization with identification, time synchronization, general interrogation, a general command and a generic read.
Command quickstart runs an IEC 60870-5-103 controlling system and an item of protection equipment against each other over an in-memory line: link initialization with identification, time synchronization, general interrogation, a general command and a generic read.
internal/capture
Package capture decodes recorded IEC 60870-5-103 traffic for tests: the FT 1.2 frames that package serialcap splits out of an RTAC serial-line capture or a TCP stream, and the ASDUs in them with the iec103 codec, and the hex test vectors of other implementations.
Package capture decodes recorded IEC 60870-5-103 traffic for tests: the FT 1.2 frames that package serialcap splits out of an RTAC serial-line capture or a TCP stream, and the ASDUs in them with the iec103 codec, and the hex test vectors of other implementations.
server
Package server is the protection equipment of IEC 60870-5-103: the secondary station of unbalanced transmission (clause 6.2.3).
Package server is the protection equipment of IEC 60870-5-103: the secondary station of unbalanced transmission (clause 6.2.3).
Package iec104 holds what the controlling station (github.com/otfabric/go-iec60870-5/iec104/client) and the controlled station (github.com/otfabric/go-iec60870-5/iec104/server) of IEC 60870-5-104 share: the sentinel errors, NegativeError, the connection State and the Metrics callbacks with their optional extensions RequestMetrics and HandlerMetrics.
Package iec104 holds what the controlling station (github.com/otfabric/go-iec60870-5/iec104/client) and the controlled station (github.com/otfabric/go-iec60870-5/iec104/server) of IEC 60870-5-104 share: the sentinel errors, NegativeError, the connection State and the Metrics callbacks with their optional extensions RequestMetrics and HandlerMetrics.
apci
Package apci implements the IEC 60870-5-104 Application Protocol Control Information: APDU framing, the I/S/U control field formats, 15-bit sequence number arithmetic and the protocol parameters (k, w, t0..t3).
Package apci implements the IEC 60870-5-104 Application Protocol Control Information: APDU framing, the I/S/U control field formats, 15-bit sequence number arithmetic and the protocol parameters (k, w, t0..t3).
client
Package client implements the controlling station (master) of IEC 60870-5-104.
Package client implements the controlling station (master) of IEC 60870-5-104.
e2e
Package e2e holds end-to-end tests of go-iec60870-5 against itself: the client of this module as controlling station and the server of this module as controlled station, over real TCP (and TLS) connections on loopback.
Package e2e holds end-to-end tests of go-iec60870-5 against itself: the client of this module as controlling station and the server of this module as controlled station, over real TCP (and TLS) connections on loopback.
examples/client command
Command client is a small IEC 60870-5-104 controlling station: it connects, runs a general interrogation, synchronizes the clock, optionally operates a switch and then prints whatever the station reports until interrupted.
Command client is a small IEC 60870-5-104 controlling station: it connects, runs a general interrogation, synchronizes the clock, optionally operates a switch and then prints whatever the station reports until interrupted.
examples/commands command
Command commands shows command transmission from both sides: direct execution, select-before-operate, cancelling a selection, a set point with a time tag, and what a refusal looks like.
Command commands shows command transmission from both sides: direct execution, select-before-operate, cancelling a selection, a set point with a time tag, and what a refusal looks like.
examples/events command
Command events shows how a station reports on its own: an event queue that keeps events while no control centre is connected and repeats what was not acknowledged, next to data that is simply sent to whoever listens.
Command events shows how a station reports on its own: an event queue that keeps events while no control centre is connected and repeats what was not acknowledged, next to data that is simply sent to whoever listens.
examples/files command
Command files shows file transfer: a station that offers files, takes files and has a directory, and a controlling station that lists, fetches and delivers.
Command files shows file transfer: a station that offers files, takes files and has a directory, and a controlling station that lists, fetches and delivers.
examples/observability command
Command observability shows what the library tells its application: structured logs, connection states and metrics, on both sides, and the options that make a client resilient (reconnect, retries, a start handler).
Command observability shows what the library tells its application: structured logs, connection states and metrics, on both sides, and the options that make a client resilient (reconnect, retries, a start handler).
examples/quickstart command
Command quickstart is the smallest complete program: a controlled station with two points and a controlling station that interrogates it, in one process, over a real TCP connection on loopback.
Command quickstart is the smallest complete program: a controlled station with two points and a controlling station that interrogates it, in one process, over a real TCP connection on loopback.
examples/redundancy command
Command redundancy shows a redundancy group: two connections to a station (here: two stations standing in for two paths), exactly one with data transfer started, failover when the active one is lost and a manual switchover.
Command redundancy shows a redundancy group: two connections to a station (here: two stations standing in for two paths), exactly one with data transfer started, failover when the active one is lost and a manual switchover.
examples/secure command
Command secure shows the application-layer security of IEC 62351-5 as IEC TS 60870-5-7 applies it to IEC 60870-5-104: a Station Association with certificates of a plant authority, session keys, every ASDU as Secure Data, and role-based access control at the station.
Command secure shows the application-layer security of IEC 62351-5 as IEC TS 60870-5-7 applies it to IEC 60870-5-104: a Station Association with certificates of a plant authority, session keys, every ASDU as Secure Data, and role-based access control at the station.
examples/server command
Command server is a small IEC 60870-5-104 controlled station: a handful of points, a switch that accepts single commands, and a measurement that changes every second and is reported spontaneously.
Command server is a small IEC 60870-5-104 controlled station: a handful of points, a switch that accepts single commands, and a measurement that changes every second and is reported spontaneously.
examples/tls command
Command tls shows IEC 60870-5-104 over TLS (IEC 62351-3) with certificates on both sides: the station only accepts control centres whose certificate its authority signed, and tells them apart by it.
Command tls shows IEC 60870-5-104 over TLS (IEC 62351-3) with certificates on both sides: the station only accepts control centres whose certificate its authority signed, and tells them apart by it.
internal/capture
Package capture reads recorded IEC 60870-5-104 traffic for tests: classic pcap and pcapng files, gzip-compressed or not, with Ethernet, BSD loopback, Linux cooked or raw IPv4 frames.
Package capture reads recorded IEC 60870-5-104 traffic for tests: classic pcap and pcapng files, gzip-compressed or not, with Ethernet, BSD loopback, Linux cooked or raw IPv4 frames.
internal/link
Package link implements the IEC 60870-5-104 connection state machine that the client and the server share: send and receive sequence numbers, the k/w flow control windows, the t1/t2/t3 timers and the STARTDT/STOPDT/ TESTFR procedures.
Package link implements the IEC 60870-5-104 connection state machine that the client and the server share: send and receive sequence numbers, the k/w flow control windows, the t1/t2/t3 timers and the STARTDT/STOPDT/ TESTFR procedures.
internal/testutil
Package testutil holds helpers shared by the client and server tests.
Package testutil holds helpers shared by the client and server tests.
server
Package server implements the controlled station (outstation, slave) of IEC 60870-5-104.
Package server implements the controlled station (outstation, slave) of IEC 60870-5-104.
internal
callback
Package callback is how the stations call application code at the library boundary.
Package callback is how the stations call application code at the library boundary.
logx
Package logx is how the library writes its log entries: a constant message plus key-value fields.
Package logx is how the library writes its log entries: a constant message plus key-value fields.
pcapio
Package pcapio reads recorded traffic for the capture tests of every companion standard: classic pcap and pcapng files, gzip-compressed or not, with Ethernet, BSD loopback, Linux cooked, raw IPv4 or SEL RTAC serial-line frames.
Package pcapio reads recorded traffic for the capture tests of every companion standard: classic pcap and pcapng files, gzip-compressed or not, with Ethernet, BSD loopback, Linux cooked, raw IPv4 or SEL RTAC serial-line frames.
secbind
Package secbind connects iec104/server to the part of package sec that binds a connection to an association its controlling station shares with other connections.
Package secbind connects iec104/server to the part of package sec that binds a connection to an association its controlling station shares with other connections.
serialcap
Package serialcap splits the recorded octets of an FT 1.2 line (IEC 60870-5-1 6.2.4.2) into frames and checks the link procedures of IEC 60870-5-2 in them: the control field, the frame count bit of each primary direction and link address, and the pairing of every primary message with the secondary's response.
Package serialcap splits the recorded octets of an FT 1.2 line (IEC 60870-5-1 6.2.4.2) into frames and checks the link procedures of IEC 60870-5-2 in them: the control field, the frame count bit of each primary direction and link address, and the pairing of every primary message with the secondary's response.
testutil/corpus
Package corpus holds what the capture suites of the serial companion standards share: the manifest of a testdata/captures directory, its check against the committed files, and the tshark oracle files next to the captures.
Package corpus holds what the capture suites of the serial companion standards share: the manifest of a testdata/captures directory, its check against the committed files, and the tshark oracle files next to the captures.
testutil/leakcheck
Package leakcheck finds the goroutines a test leaves running.
Package leakcheck finds the goroutines a test leaves running.
testutil/serialline
Package serialline is test infrastructure for the serial companion standards (IEC 60870-5-101, -102, -103): an in-memory full-duplex line whose two directions can drop, duplicate, corrupt, delay, split, truncate, reorder and add noise to what is written to them, a raw FT 1.2 peer that writes octets straight onto the line, and a goroutine leak check.
Package serialline is test infrastructure for the serial companion standards (IEC 60870-5-101, -102, -103): an in-memory full-duplex line whose two directions can drop, duplicate, corrupt, delay, split, truncate, reorder and add noise to what is written to them, a raw FT 1.2 peer that writes octets straight onto the line, and a goroutine leak check.
Package link implements the link transmission procedures of IEC 60870-5-2 over FT 1.2 frames (package ft12): the control field, unbalanced transmission with a Primary (controlling) station polling one or more Secondary (controlled) stations, and Balanced transmission between two combined stations.
Package link implements the link transmission procedures of IEC 60870-5-2 over FT 1.2 frames (package ft12): the control field, unbalanced transmission with a Primary (controlling) station polling one or more Secondary (controlled) stations, and Balanced transmission between two combined stations.
Package sec is the application-layer security of IEC 60870-5-104: the A-Profile of IEC 62351-5:2023 as IEC TS 60870-5-7:2025 maps it onto IEC 60870-5-101 and -104.
Package sec is the application-layer security of IEC 60870-5-104: the A-Profile of IEC 62351-5:2023 as IEC TS 60870-5-7:2025 maps it onto IEC 60870-5-101 and -104.
Package telecontrol holds the application procedures that IEC 60870-5-101 and IEC 60870-5-104 share (IEC 60870-5-5 as profiled by the two companion standards): how a controlling station recognises the answers to its requests, and how it runs the request kinds that are answered with a confirmation (commands, clock synchronization), with data and a termination (interrogation, counter interrogation) or with the data itself (read).
Package telecontrol holds the application procedures that IEC 60870-5-101 and IEC 60870-5-104 share (IEC 60870-5-5 as profiled by the two companion standards): how a controlling station recognises the answers to its requests, and how it runs the request kinds that are answered with a confirmation (commands, clock synchronization), with data and a termination (interrogation, counter interrogation) or with the data itself (read).

Jump to

Keyboard shortcuts

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