2022-08-18 15:03:47 +00:00
|
|
|
package ingress
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
|
|
|
|
"github.com/cloudflare/cloudflared/packet"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ICMPProxy sends ICMP messages and listens for their responses
|
|
|
|
type ICMPProxy interface {
|
|
|
|
// Request sends an ICMP message
|
|
|
|
Request(pk *packet.ICMP, responder packet.FlowResponder) error
|
|
|
|
// ListenResponse listens for responses to the requests until context is done
|
|
|
|
ListenResponse(ctx context.Context) error
|
|
|
|
}
|
|
|
|
|
2022-08-22 16:41:51 +00:00
|
|
|
func NewICMPProxy(listenIP net.IP, logger *zerolog.Logger) (ICMPProxy, error) {
|
|
|
|
return newICMPProxy(listenIP, logger)
|
2022-08-18 15:03:47 +00:00
|
|
|
}
|