divine - automatic IP configuration detection for laptops

(Note: This has not been touched since 2003)

    divine vb  di-vined; di-vin-ing
    [ME divinen, fr. MF & L; MF diviner, fr. L divinare, fr. divinus, n.]
    vt
    (14c)
    1: to discover intuitively: INFER
    2: to discover or locate (as water or minerals underground) usu. by
	means of a divining rod
    ~ vi
    1: to practice divination: PROPHESY
    2: to perceive intuitively
    syn see FORESEE

Download it from http://dl.fefe.de/divine-0.8.tar.bz2 [gpg sig]! The current version is 0.8. Recent changes: upgraded to libnet 1.1.1

"divine" is a utility for laptop users or people who use their machines in different networks all the time. It is meant to be run from the PCMCIA network initialization scripts. DO NOT make divine setuid root. Divine contains tons of security holes like using system, it is meant as quick hack that will not hurt so much if it is run at boot time.

To compile this, you need

  1. libnet from http://www.packetfactory.net/libnet/
  2. libpcap from ftp://ftp.ee.lbl.gov/libpcap.tar.Z

The idea is this:

The point about divine in contrast to other solutions is that other solutions normally use ping or something like that. divine can check a large number of networks instantaneously, assuming that the machines you ping answer within one second (.4 seconds are normal on Ethernets). And pinging an unknown address will do an arp request anyway, so why not do an arp request in the first place?

divine was written under Linux and was originally very Linux specific. I then switched to libpcap and libnet, so the core is now portable, but the ifconfig and route calls are not.

Do _not_ make divine setuid root.

divine is as of version 0.7 part of Debian GNU/Linux. Thanks, Stephen!

divine is now apparently part of Debian and Linuxberg (and ftpsearch even found a hit on a TurboLinux FTP site) and it can be found all around the globe.

See also