GithubHelp home page GithubHelp logo

pyping's Introduction

Pyping

A pure python ping implementation using raw sockets.

Note that ICMP messages can only be sent from processes running as root (in Windows, you must run this script as 'Administrator').

Original Version from Matthew Dixon Cowles.

  • Copyleft 1989-2011 by the python-ping team, see AUTHORS for more details.
  • License: GNU GPL v2, see LICENCE for more details.

Usage

Use as a cli tool:

socketubs@socket-laptop [Pyping]: sudo pyping socketubs.net

PYTHON-PING socketubs.net (92.243.5.143): 55 data bytes
241 bytes from socketubs.net (92.243.5.143): icmp_seq=0 ttl=55 time=64.5 ms
241 bytes from socketubs.net (92.243.5.143): icmp_seq=1 ttl=55 time=67.7 ms
241 bytes from socketubs.net (92.243.5.143): icmp_seq=2 ttl=55 time=66.6 ms

----socketubs.net PYTHON PING Statistics----
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip (ms)  min/avg/max = 64.457/66.244/67.677

socketubs@socket-laptop [Pyping]: pyping --help

Use as a Python lib:

>>> import pyping
>>> r = pyping.ping('socketubs.net')                # Need to be root or
>>> r = pyping.ping('socketubs.net', udp = True)    # But it's udp, not real icmp
>>> r.ret_code
0
>>> r.destination
'socketubs.net'
>>> r.max_rtt
'69.374'
>>> r.avg_rtt
'68.572'
>>> r.min_rtt
'67.681'
>>> r.destination_ip
'92.243.5.143'

Todo

  • Docs
  • Refactor core.py
  • Tests

Contribute

Fork this repo on GitHub and send pull requests. Thank you.

Links

pyping's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.