{"id":19119509,"url":"https://github.com/sryze/ping","last_synced_at":"2025-04-19T01:32:53.376Z","repository":{"id":83572700,"uuid":"48539206","full_name":"sryze/ping","owner":"sryze","description":"Simple (cross-platform) implementation of the \"ping\" command","archived":false,"fork":false,"pushed_at":"2024-01-30T09:59:16.000Z","size":54,"stargazers_count":40,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-20T15:58:11.557Z","etag":null,"topics":["c","icmp","ping","raw-sockets","sockets"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sryze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-12-24T10:59:25.000Z","updated_at":"2024-02-19T03:47:23.000Z","dependencies_parsed_at":"2024-01-30T11:02:01.327Z","dependency_job_id":null,"html_url":"https://github.com/sryze/ping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sryze%2Fping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sryze%2Fping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sryze%2Fping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sryze%2Fping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sryze","download_url":"https://codeload.github.com/sryze/ping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223786727,"owners_count":17202603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","icmp","ping","raw-sockets","sockets"],"created_at":"2024-11-09T05:09:51.140Z","updated_at":"2024-11-09T05:09:51.709Z","avatar_url":"https://github.com/sryze.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"ping\n====\n\n[![Build Status][build_status]][build]\n\nThis is a rather basic implementation of the `ping` command in C. It was\ncreated for learning more about raw sockets and how ping works (and for fun).\n\nFeatures:\n\n* Cross-platform: can compile and run on Windows, Linux, macOS, *BSD\n* Supports IPv6\n* Displays time with microsecond precision\n\nExample usage:\n\n```sh\n$ ./ping google.com\nPING google.com (142.250.74.206)\nReceived reply from 142.250.74.206: seq=0, time=103.307 ms\nReceived reply from 142.250.74.206: seq=1, time=91.200 ms\nReceived reply from 142.250.74.206: seq=2, time=103.080 ms\nReceived reply from 142.250.74.206: seq=3, time=94.531 ms\nReceived reply from 142.250.74.206: seq=4, time=92.204 ms\n^C\n```\n\n`ping` accepts only one argument - the name of the host to ping.\n\nBuilding\n--------\n\nTo build ping you'll need a C89 compiler and CMake. Supported platforms include\nLinux, Mac OS X, Windows (MSVC, Cygwin, MinGW), FreeBSD, NetBSD, OpenBSD,\nSolaris.\n\nAfter you cloned this repo run the following commands to build an executable:\n\n```sh\ncd ping\nmkdir build \u0026\u0026 cd build\ncmake ../ -G \"Unix Makefiles\"\nmake\n```\n\nRunning\n-------\n\nUse of raw sockets usually requires administrative privileges, therefore you\nwill need to run `ping` as root:\n\n```sh\nsudo ./ping google.com\n```\n\nThere is also a way to make it run without typing `sudo` every time: set the\n`suid` bit on the executable and change its owner to `root`:\n\n```sh\nsudo chmod +s ./ping\nsudo chown root ./ping\n```\n\nAfter starting `ping`, it will run indefinitely until you interrupt it, e.g.\nby doing `Ctrl-C` in the terminal.\n\nScripts\n-------\n\nThe `scripts` directory contains a couple of scripts to aid debugging:\n\n* `capture.sh` - captures ICMP traffic with `tcpdump` and saves it to\n  `ping.pcap` (needs to be run as root)\n* `dump.sh` - prints the contents of `ping.pcap` in a nice form (`tcpdump`\n   may actually display helpful errors there, like a miscalculated checksum)\n\n[build]: https://travis-ci.com/sryze/ping\n[build_status]: https://travis-ci.com/sryze/ping.svg?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsryze%2Fping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsryze%2Fping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsryze%2Fping/lists"}