Skip to content

v4.0.0-alpha4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Aug 06:04

tik4net 4.0.0-alpha4

Full release notes and version history: Wiki → History

What's new in 4.0

9 new connection types — all implement the same ITikConnection / LoadAll<T>() / Save<T>() interface:

Type Transport Port Notes
Rest / RestSsl HTTP/HTTPS 80/443 RouterOS 7.1+, CRUD only
Telnet TCP 23 plain-text terminal
MacTelnet UDP broadcast 20561 Layer-2, no IP needed
WinboxCli TCP 8291 WinBox terminal over TCP
WinboxCliMac UDP 20561 WinBox terminal over MAC
WinboxNative TCP 8291 native M2 binary protocol, full CRUD + streaming
WinboxNativeMac UDP 20561 native M2 over MAC
Ssh (satellite) TCP 22 requires tik4net.ssh NuGet

Other additions:

  • Multi-targeting netstandard2.0;net8.0 — netstandard2.0 keeps the Unity / Xamarin / .NET Framework reach; the net8.0 leg carries the modern surface
  • Async everywhere — async CRUD on the O/R mapper, an async surface on every transport, and a cancel that actually cancels
  • Streaming reads as IAsyncEnumerable<ITikReSentence> (net8.0) — await foreach over a live monitor
  • Change tracking — the O/R mapper tracks which properties changed; Save<T>() sends only the diff
  • Safe ModeSafeModeTake() / SafeModeRelease() / SafeModeUnroll() across all transports; auto-rollback on disconnect
  • TikConnectionSetup — the single entry point; every option is applied in one place, and a transport declares what it can honour by implementing ITikTlsConnection / ITikMacLayerConnection / ITikCancellationModeConnection
  • Connection capability modelconnection.Supports(TikConnectionCapability.Listen) etc.
  • Raw command pass-throughconnection.CreateRawCommand(raw) for commands outside the O/R mapper
  • WinBox GUI-name addressing — address entities by their WinBox display name on WinboxNative
  • tik4net.mcp — drive any command over any transport from an AI assistant

Breaking changes (from 3.6)

Full guide, with before/after code: Upgrading from 3.x to 4.0

These change what a working 3.x program does without stopping the compiler — read them first:

  • An invalid TLS certificate is now rejectedAllowInvalidCertificate defaults to false (was true). RouterOS normally presents a self-signed certificate, so an API-SSL / REST-SSL connection that opened in 3.x can now fail. Ask for it explicitly, or pin the certificate with CertificateValidationCallback
  • Synchronous commands are taggedSendTagWithSyncCommand defaults to true (was false). This is what makes one connection usable from several threads. If you script a fake RouterOS in your tests, echo the tag back
  • ExecuteScalar on a command that returns nothing throws the new TikCommandEmptyResponseException, not TikNoSuchItemException — after a write, an empty answer means success
  • Save diffs against the local snapshot instead of a LoadById round-trip. TikDefaults.SaveMode = TikSaveMode.FullUpdate restores the 3.x behaviour

And these stop the compiler:

  • The O/R mapper is now inside the tik4net package — it used to ship as tik4net.objects (3.x), then tik4net.entities (4.0.0-alpha). Remove any PackageReference to those or you get an assembly conflict. No source changes: namespaces and assembly names are unchanged
  • ITikConnection is lifecycle and command factory onlyCallCommandSync moved to ITikRawSentenceConnection, Safe Mode to ITikSafeModeConnection, SendTagWithSyncCommand to ITikTaggedConnection (extension methods keep the call sites compiling). The Thread-returning CallCommandAsync is removed
  • Nullable reference types are on — every mapped reference-typed entity property is string?; every writable bool is bool?, as are numeric and enum properties carrying a router default, because null means "the router decides"
  • Exception hierarchy unifiedTikCommandException subtypes restructured; review catch blocks on specific subtypes
  • SSH is a satellite package — add tik4net.ssh and call Tik4NetSsh.Register() at startup
  • TikConnectionType.Api_v2 / ApiSsl_v2 are gone — they were [Obsolete(error)] in 3.6
  • Three Interface properties are read-only (Type, MacAddress, FastPath) — /interface set does not accept them; L2Mtu was added, which it does

NuGet packages

Package Install
tik4net (core + O/R mapper) dotnet add package tik4net --version 4.0.0-alpha4
tik4net.ssh (satellite, opt-in) dotnet add package tik4net.ssh --version 4.0.0-alpha4
tik4net.testing dotnet add package tik4net.testing --version 4.0.0-alpha4
tik4net.mcp (dev/debug helper tool) dotnet tool install -g tik4net.mcp --version 4.0.0-alpha4

Full Changelog: v4.0.0-alpha3...v4.0.0-alpha4