Repository navigation
Claim ICMP protocols via dmip's protocol handler DIF - #5
Merged
Merged
Conversation
dmip_register_protocol()/_register_default_protocol() have been removed (see the corresponding dmip change) - dmicmp now implements dmip's protocol handler DIF instead, claiming DMIP_PROTO_ICMP, DMIP_PROTO_ICMPV6, and the new DMIP_PROTO_DEFAULT fallback marker all from one dmip_protocol_numbers() implementation. Since a DIF implementation is one function per module rather than one callback per registration, the previous two separate handlers (dmicmp_handle_ip_packet() for ICMP/ICMPv6, dmicmp_handle_unclaimed_ protocol() for the default fallback) are merged into a single dmip_protocol_receive() implementation that re-parses the packet's own protocol field to tell the two cases apart. No dmod_init()/_deinit() registration call is needed anymore - dmip discovers dmicmp's DIF implementations on demand for as long as this module stays loaded and enabled, so dmicmp can now be reloaded without dmip holding a reference on it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAqx5zBfvejpcUUZBn66F4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dmip_register_protocol()/_register_default_protocol()in favor of a DIFdmipitself defines.dmicmpnow implements dmip's protocol handler DIF instead, claimingDMIP_PROTO_ICMP,DMIP_PROTO_ICMPV6, and the newDMIP_PROTO_DEFAULTfallback marker all from onedmip_protocol_numbers()implementation.dmicmp_handle_ip_packet()for ICMP/ICMPv6,dmicmp_handle_unclaimed_protocol()for the default fallback) are merged into a singledmip_protocol_receive()implementation that re-parses the packet's own protocol field to tell the two cases apart.dmod_init()/_deinit()registration call is needed anymore -dmicmpcan now be reloaded withoutdmipholding a reference on it.CMakeLists.txtnow declaresDMOD_DIF_IMPLS dmip.Test plan
src/dmicmp.candinclude/dmicmp.hcompile cleanly (gcc -fsyntax-only) against realdmodcore headers, the updateddmipheaders (from the companion PR), and real peer-module headers, sincedmf-get/network package fetch wasn't available in this environment to run the full CMake+ctest flow.tests/dmicmp_test.cneeds no changes (it drives the module's real DIF implementation through dmip's real dispatch, the same way it already exercised the old registration) and still compiles against the new headers.ctestviadmod_loader) on this PR, once merged alongside Replace protocol registration with dmip's own DIF dmip#3.Generated by Claude Code