Skip to content

The-Building-Laboratory/Ping-CLI-Application

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ping-CLI-Application Contributions Welcome

Replicating the ping command using C language

License: MIT Issues Open Forks Stars Twitter URL

Features

The Ping CLI Application covers various features like:-

  • Accepting as a positional terminal argument a hostname or IP address.
  • Showcases equivalent IP Address for the hostname argument
  • Showcases the resolved reverse lookup domain value, i.e., converts dot notation IP address to hostname.
  • Emitting requests with a periodic delay as long as the program is running.
  • Report of packets sent lost and received as well as RTT times and total time.
  • Features like TTL as argument and time exceeded alert if the TTL value of a packet is greater than the specified value and prints information baout that packet (At least information about one packet is always printed). Many more features are present.

Folder Contents

  • Ping_Cli_Application.c - This file contains the source code of the Ping Application developed using C language.
  • makefile - This file is used to compile the code and produce an executable file.
  • .gitignore - To ignore the executable file generated during compilation.

    How to run this program

    The program can be run either using makefile or by compiling Ping_Cli_Application.c

    Install essential packages using Linux terminal or WSL on windows.

    $ sudo apt-get install build-essential
    
  • By Compiling- Compile the program by typing the following commands into the terminal:-
    $ gcc Ping_Application_CLI.c -o pingcli 
    $ sudo ./pingcli <argument1> <argument2> 
  • Using make file- cd into the directory containing the makefile. Now type following commands into the terminal:-
    $ make
    $ sudo ./pingcli <argument1> <argument2>
    

    Arguments

    It accepts 2 diiferent argumants as follows:-

  • Hostname/IP Address- The first argument consists of a Hostname (google.com) or an IP Address (216.58.203.46) and is compulsory to be provided.
  • TTL value- The second argument is optional in nature and is an integer value in the range -32,768 to 32,767 (Supported by 2-bit ‘int’ datatype in C). Any value which is not an integer in nature will result in “Not an Integer” alert.

    If number of arguments is less than 2 or more than 3 it will result in an alert.

  • About

    Replicating the ping command using C language

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages

    • C 98.8%
    • Makefile 1.2%