[PR #2939] feat(ping): add core PingRequest/Response implementation #2949

Open
opened 2025-12-29 04:19:46 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2939
Author: @roganlynch
Created: 12/6/2025
Status: 🔄 Open

Base: mainHead: pr2b-ping-core


📝 Commits (2)

  • 3b8bad4 feat(mapper): add SendDirectUpdate method for direct MapResponse delivery
  • 27e7d10 feat(ping): add core PingRequest/Response implementation

📊 Changes

5 files changed (+390 additions, -0 deletions)

View changed files

📝 hscontrol/app.go (+2 -0)
📝 hscontrol/mapper/batcher.go (+1 -0)
📝 hscontrol/mapper/batcher_lockfree.go (+32 -0)
📝 hscontrol/noise.go (+75 -0)
hscontrol/ping.go (+280 -0)

📄 Description

Adds core ping functionality for node health checks and connectivity testing.

Changes

  • PingManager: Manages ping request lifecycle, tracking, and response handling
  • PingRequest types: Support for disco, TSMP, and c2n ping types
  • Noise protocol integration: Authenticated ping response handler
  • HTTP endpoint: /machine/ping-response/{request_id} for receiving responses
  • Interface extension: Uses SendDirectUpdate method for direct message delivery

Implementation Details

The PingManager creates unique ping requests with callback URLs, tracks them with timeouts, and coordinates responses. The Noise protocol ensures only authenticated nodes can submit ping responses.

This builds on the SendDirectUpdate capability from the previous commit and provides the foundation for gRPC ping endpoints and the scheduler.

Context

Part of the work discussed in #2902 to add ping functionality to headscale.

Dependencies

  • Requires PR #2938 (SendDirectUpdate method)

Note: This code was generated with assistance from Claude Sonnet 4.5 via cline.bot


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2939 **Author:** [@roganlynch](https://github.com/roganlynch) **Created:** 12/6/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr2b-ping-core` --- ### 📝 Commits (2) - [`3b8bad4`](https://github.com/juanfont/headscale/commit/3b8bad4252652995d5b95467d39befc79a1a26db) feat(mapper): add SendDirectUpdate method for direct MapResponse delivery - [`27e7d10`](https://github.com/juanfont/headscale/commit/27e7d10285d373c26fc389f20deab4c1458924bb) feat(ping): add core PingRequest/Response implementation ### 📊 Changes **5 files changed** (+390 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/app.go` (+2 -0) 📝 `hscontrol/mapper/batcher.go` (+1 -0) 📝 `hscontrol/mapper/batcher_lockfree.go` (+32 -0) 📝 `hscontrol/noise.go` (+75 -0) ➕ `hscontrol/ping.go` (+280 -0) </details> ### 📄 Description Adds core ping functionality for node health checks and connectivity testing. ## Changes - **PingManager**: Manages ping request lifecycle, tracking, and response handling - **PingRequest types**: Support for disco, TSMP, and c2n ping types - **Noise protocol integration**: Authenticated ping response handler - **HTTP endpoint**: `/machine/ping-response/{request_id}` for receiving responses - **Interface extension**: Uses SendDirectUpdate method for direct message delivery ## Implementation Details The PingManager creates unique ping requests with callback URLs, tracks them with timeouts, and coordinates responses. The Noise protocol ensures only authenticated nodes can submit ping responses. This builds on the SendDirectUpdate capability from the previous commit and provides the foundation for gRPC ping endpoints and the scheduler. ## Context Part of the work discussed in #2902 to add ping functionality to headscale. ## Dependencies - Requires PR #2938 (SendDirectUpdate method) --- *Note: This code was generated with assistance from Claude Sonnet 4.5 via cline.bot* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2949