Draft: Implement PAN struct as main API entry point#288
Open
rolbk wants to merge 14 commits intonetsec-ethz:masterfrom
Open
Draft: Implement PAN struct as main API entry point#288rolbk wants to merge 14 commits intonetsec-ethz:masterfrom
rolbk wants to merge 14 commits intonetsec-ethz:masterfrom
Conversation
Remove support for RAINS name resolution, since it is incompatible with the SCION v0.13.0 API
Mark MangleSCIONAddrURL as deprecated since it relies on URL parsing behavior that will be fixed in Go 1.24.8 as part of CVE-2025-47912.
Key changes: - Add ASContext interface, pass to Dial/Listen functions - Remove global host context singleton, require explicit initialization - Export PathPool with PathPoolInit() for explicit lifecycle - Use addr.IA from snet directly instead of local type alias - Simplify ReplySelector.Path() (remove context parameter) - Fix Path.String() format, improve PathFingerprint readability - Add periodic refresh for subscribers without cached paths - Handle SCMP PacketTooBig errors gracefully
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.
This PR implements the first draft of the new API design proposed in #285.
Changes
Main API Changes
ASContextand proposedClientintoPANstruct: ThePANstruct now serves as the main entry point for SCION networking, managing the daemon connection, path pool, and statistics. This struct is meant to be kept around as singleton in the application that uses it.PANinstances are created withNew()and can be properly cleaned up, replacing hidden global stateasCtxto every function - shared state is managed by thePANinstanceOpen Questions
PANas a struct or an interface. Current implementation uses a struct.PANstruct.pathRefreshSubscriber,Selector,dialedConn). Further work is needed to cleanly separate concerns.Example Usage
Related to #285 and #286
This change is