https://github.com/lebje/icmpping
Send ICMP Ping requests in Swift!
https://github.com/lebje/icmpping
icmp linux macos swift swift5 windows windows-10
Last synced: about 2 months ago
JSON representation
Send ICMP Ping requests in Swift!
- Host: GitHub
- URL: https://github.com/lebje/icmpping
- Owner: LebJe
- License: mit
- Created: 2022-10-22T18:51:46.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T20:16:12.000Z (almost 2 years ago)
- Last Synced: 2025-07-11T23:37:29.261Z (3 months ago)
- Topics: icmp, linux, macos, swift, swift5, windows, windows-10
- Language: C++
- Homepage: https://lebje.github.io/ICMPPing/documentation/icmpping/
- Size: 1.39 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ICMPPing
**Send [ICMP](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol) Ping requests in Swift! Powered by [cpp-icmplib](https://github.com/markondej/cpp-icmplib).**
[](https://swift.org)
[](https://swift.org/package-manager)
[](https://github.com/LebJe/ICMPPing/releases)
[](https://github.com/LebJe/ICMPPing/actions?query=workflow%3A%22Build+and+Test%22)
[](https://swiftpackageindex.com/LebJe/ICMPPing)
[](https://swiftpackageindex.com/LebJe/ICMPPing)- [ICMPPing](#icmpping)
- [Installation](#installation)
- [Swift Package Manager](#swift-package-manager)
- [Full Documentation](#full-documentation)
- [Quick Start](#quick-start)
- [Dependencies](#dependencies)
- [Licenses](#licenses)
- [Contributing](#contributing)## Installation
### Swift Package Manager
Add this to the `dependencies` array in `Package.swift`:
```swift
.package(url: "https://github.com/LebJe/ICMPPing.git", from: "0.0.1")
```Also add this to the `targets` array in the aforementioned file:
```swift
.product(name: "ICMPPing", package: "ICMPPing")
```### Full Documentation
Full documentation is available [here](https://lebje.github.io/ICMPPing/documentation/icmpping/).
## Quick Start
```swift
import ICMPPing// Google's IP Address
let address = try ICMPPing.IPAddress("8.8.8.8", type: .ipv4)let result = ICMPPing.ping(address: address, timeout: 10 /* seconds */)
print(result)
// ICMPPing.Response(
// address: 8.8.8.8,
// code: 0,
// timeToLive: 116,
// interval: 23.011,
// responseType: ICMPPing.Response.ResponseType.success
// )
```## Dependencies
- [cpp-icmplib](https://github.com/markondej/cpp-icmplib/)
## Licenses
The [cpp-icmplib](https://github.com/markondej/cpp-icmplib/) license is available at [https://github.com/markondej/cpp-icmplib/blob/c1e04b53923eec57efb898a4fdf94fea5b856c1d/LICENSE](https://github.com/markondej/cpp-icmplib/blob/c1e04b53923eec57efb898a4fdf94fea5b856c1d/LICENSE).
## Contributing
Before committing, please install [pre-commit](https://pre-commit.com), [swift-format](https://github.com/nicklockwood/SwiftFormat), [clang-format](https://clang.llvm.org/docs/ClangFormat.html), and [Prettier](https://prettier.io), then install the pre-commit hook:
```bash
$ brew bundle # install the packages specified in Brewfile
$ pre-commit install# Commit your changes.
```To install pre-commit on other platforms, refer to the [documentation](https://pre-commit.com/#install).