An open API service indexing awesome lists of open source software.

https://github.com/opennms/jicmp


https://github.com/opennms/jicmp

c icmp java ping

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

= About JICMP

_JICMP_ is a small library to allow the use of _IPv4_ _ICMP_ (raw) packets in Java.

== Build from source

.Requirements

* git
* automake
* autoconf
* libtool
* Java JDK 1.8+

The repository has a _git_ submodule which contains _Macros_ required to compile from source code.

.Clone the respository on local disk
[source]
----
git clone https://github.com/OpenNMS/jicmp.git
----

.Switch into source code repository
[source]
----
cd jicmp
----

.Initialize and update the git submodule.
[source]
----
git submodule update --init --recursive
----

.Update generated configuration files with
[source]
----
autoreconf -fvi
----

.Generate make files using `/usr/local/lib` as install path and compile JICMP
[source]
----
./configure
make
----

TIP: If you want to change the install path the `./configure --prefix=/your/custom/path` can be used.

.Install the library on your system, root permissions may required when working as non-root user.
[source]
----
sudo make install
----

== Using JICMP as non-root

_Mac OS X_ supports non-root _ICMP_ through the _$$SOCK_DGRAM$$_ interface, which _JICMP_ uses by default.

_Linux_ supports this as well, but you additionally need to set a sysctl _OID_ to allow ping for non-root users.

You can set this temporarily by running:

[source]
----
sysctl -w net.ipv4.ping_group_range="0 429496729"
----

... or by creating a `sysctl` configuration file in `/etc`:

[source]
----
echo "net.ipv4.ping_group_range=0 429496729" > /etc/sysctl.d/03-non-root-icmp.conf
----