Skip to content

Implement EtherNet/IP and CIP library - #1

Merged
boeboe merged 16 commits into
mainfrom
feature/initial-implementation
Oct 26, 2026
Merged

boeboe merged 16 commits into
mainfrom
feature/initial-implementation

Conversation

@boeboe

@boeboe boeboe commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

First implementation of go-ethernetip: a pure Go EtherNet/IP and CIP library with no dependencies (Go 1.23+).

What's in it

  • cip, encap, implicit: codecs (CIP messages, EPATH, Connection Manager services, encapsulation, CPF, I/O datagrams) and a catalog of CIP codes generated from cip/catalog.json, each code with its public source.
  • client: explicit messaging (unconnected, routed via Unconnected_Send, Class 3), Forward_Open/Close, discovery.
  • scanner: Class 0/1 I/O (point-to-point, multicast, exclusive owner / input only / listen only, run/idle, reconnect).
  • server: adapter with Identity, Message Router, Assembly, Connection Manager, Port, TCP/IP Interface, Ethernet Link; Class 0/1/3 target connections.
  • logix: Rockwell Logix tag services (vendor specific) and a tag-server emulation.
  • eds: EDS parse, validate, format, build, generate Go.

Evidence (local, darwin/arm64 and linux/arm64 in Docker)

  • Combined coverage 98.6% with -race (make coverage-check, gate 90%).
  • Interop against OpENer, EIPScanner, pycomm3 and cpppo: 49 pass, 0 fail, 10 N/A (INTEROPERABILITY.md).
  • Chaos, stress and leak suites pass; 15 fuzz targets run 60 s each with no crashers.
  • vet, staticcheck, golangci-lint, govulncheck clean; Go 1.23.0 toolchain passes.

This is the first CI run on GitHub: amd64, Windows and macOS Intel have not been exercised yet. The interop workflow pins ethernetip-interop v0.1.0 images, which are published only once otfabric/ethernetip-interop is tagged, so that workflow is expected to fail until then.

Full report: docs/DELIVERY_REPORT.md. Not ODVA conformance tested; CIP Security is TLS only (docs/STANDARDS.md, docs/LIMITATIONS.md).

🤖 Generated with Claude Code

boeboe and others added 12 commits October 25, 2026 23:07
Initial implementation of the EtherNet/IP stack: the cip and encap
codecs with a generated catalog of CIP codes, the explicit messaging
client (unconnected, routed, Class 3), the implicit I/O runtime, the
scanner and the adapter server with the standard objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The eds package parses, validates, formats, builds and generates Go
from Electronic Data Sheets. internal/cmd/interopnode puts the library
behind the ethernetip-interop container contract; interop/ (build tag
interop) runs it against OpENer, cpppo, EIPScanner and pycomm3.

Fixes found by tests and fuzzing: a panic on a malformed Multiple
Service Packet, 32-bit class IDs truncated, unbounded template
recursion in logix, UDP ListIdentity reporting 0.0.0.0, multicast
membership on the I/O socket, Logix partial transfers ending
mid-element, Write Tag tolerance of pycomm3's duplicated requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes: requests with short deadlines no longer close the shared
session (write deadlines come from the client's timeout); two
concurrent Forward_Opens can no longer both own an output assembly;
a timed-out RegisterSession matches ErrTimeout; Class 3 timeouts
above 610 hours no longer wrap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…OConfig

The Ethernet Link interface flags reported half duplex (0x0D) where full
duplex was meant (0x0F). Listen's documentation now says the UDP socket
uses the TCP port. IOConfig.Output and Idle let a scanner start a
connection with its first outputs, in idle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- client: the target closes the connection after UnRegisterSession; the
  reader could see that first and report the application's Close as a
  lost connection to metrics and state handlers.
- implicit test: a broadcast send does not fail on Linux; use an IPv6
  destination, which an IPv4 socket cannot reach anywhere.
- .gitattributes: LF endings, so that generated and golden files compare
  on Windows.
- e2e and scanner tests: a timeout multiplier of 2 for short RPIs, which
  coarse timers on loaded runners otherwise time out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

boeboe and others added 4 commits October 26, 2026 01:01
The corrupting proxy could flip a bit of the RegisterSession reply of
the test's own initial dial, which the client rightly refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The interop suite passes against the published images: 49 pass, 0 fail,
10 not applicable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Go's race detector does not support windows/arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serve on a server whose Close had started could add to the WaitGroup
Close waits on; it now returns ErrClosed. Found by the race detector on
Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boeboe
boeboe merged commit f4177f8 into main Oct 26, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant