This document describes how to install and configure the Link Layer Topology Discovery (LLTD) Protocol - Responder Source Code from Microsoft. The lld2d daemon allows linux systems to display in Vista's Network Map. This How-To should be easily adaptable to other distros.

 

Credits

I initially found info on http://www.jcxp.net/forums/index.php?showtopic=19789 about how to get this working. The post from pgn674 described how they were able to get the source code working. My contributions are simplification of the directions and the simple init.d launch script.

 

Prerequistes

  • System with Linux installed (Debian Lenny was used for this how-to)
  • Linux build environment for your distro
  • Basic familarity with Linux and the command line
  • gcc compiler installed
  • Microsoft LLTD source code

 

Download the Source Code

Download Rally-LLTD-PortingKit.exe from http://www.microsoft.com/whdc/rally/rallykit.mspx. Unzip the exe to a folder on your system (I used KDE's Ark to unzip the file).

 

Install the Build Environment

Make sure you have the needed build environment and tools to compile source code for your distro.

apt-get install linux-headers-`uname -r` build-essential

 

Compile and Install

In your preferred text editor open /usr/include/linux/wireless.h and add #include <linux/if.h> at the beginning of the file and save.

Open a terminal window or from the console enter:

cd /unzipped file folder/Sample Code/native-linux

Enter the "make" command and ignore warnings:

sudo make

Copy the lld2d executable to /usr/sbin (may be different for your distribution).

 

Create the init.d Launch Script

This simple lld2d init.d script is based off of the lisa init.d script. Use your preferred text editor to create the lld2d init.d script in /etc/init.d.

Make sure to edit the INTFACE variable with your preferred interface and make the script executable.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          lld2d
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/lld2d
NAME=lld2d
PIDFILE=/var/run/$NAME.pid
DESC="LLTD Protocol Responder"
INTFACE=ENTER YOUR PREFERRED INTERFACE HERE
test -f $DAEMON || exit 0
set -e
is_running ()
{
	if [ -e "$PIDFILE" ]
	then
		#checking if program is running
		if [ -L /proc/`cat $PIDFILE`/exe ]
		then
		#checking for stale pidfile
			if grep -q $NAME /proc/`cat $PIDFILE`/cmdline 
			then
				#program is running and is called lisa
				return 0
			fi
		fi
		rm -f $PIDFILE
	fi
	#program is not running
	return 1
}
case "$1" in
  start)
  	if is_running
	then
		echo "$DESC is already running. Not doing anything"
		exit 0
	fi
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON $INTFACE\
		> /dev/null
	echo $(pidof lld2d) > $PIDFILE
	echo "$NAME."
	;;
  stop)
  	if ! is_running
	then
		echo "$DESC is not running. Not doing anything"
		exit 0
	fi
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
		--exec $DAEMON
	rm -f $PIDFILE
	echo "$NAME."
	;;
  reload|force-reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --quiet --signal 1 --pidfile $PIDFILE \
		--exec $DAEMON $INTFACE
	;;
  status)
	echo -n "$DESC is "
	if ! is_running
	then 
		echo -n "not "
	fi
	echo "running."
  	;;
  restart)
	echo -n "Restarting $DESC: "
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
		--exec $DAEMON $INTFACE
	rm -f $PIDFILE
	sleep 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON $INTFACE\
		> /dev/null
	echo $(pidof lld2d) > $PIDFILE
	echo "$NAME."
	;;
  cond-restart)
  	if ! is_running
	then
		echo "$DESC is not running. Not doing anything"
		exit 0
	fi
	echo -n "Restarting $DESC: "
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
		--exec $DAEMON $INTFACE
	rm -f $PIDFILE
	sleep 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON $INTFACE\
		> /dev/null
	echo $(pidof lld2d) > $PIDFILE
	echo "$NAME."
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|cond-restart|status|reload|force-reload}" >&2
	exit 1
	;;
esac
exit 0

 

Launch the lld2d daemon

Enter the following command in a terminal window or at the console:

/etc/init.d/lld2d start

Refresh the Network Map on Vista and your Linux server should now showup as part of the map's display.

Share this page:

13 Comment(s)

Add comment

Comments

From: Nanda

Even I am getting the same error. Please help

From: newbe2linux

hi I am trying to compile the lld2d in fedora 10, it compiles after adding the limits.h to state.c

but when i run it and refresh the vista network map 

i get "An error mapping the process" on the windows machine 

Please help

From: mfreeman451

I had to add the following line to state.c to get this to compile for me without any errors:

#include <LIMITS.H>

Good luck.

From: The Bounty Hunter

state.c (src folder) MUST have the line

#include <limits.h>

in the include section.  It doesn't work correctly if limits.h is capitalized.

From: Jos

Read the following article to make your linux box appear on a Windows 7 network map using the lld2d responder:

 http://www.veerkade.com/lld2d

From: paul renzulli

To add to the above, and to save you some time also do the below as sudo or root to make the compiler work in 8.10.

 ln -sf /bin/bash /bin/sh
 

From: T.Kirilov

Compiles here also
Nice how-to :-)

From: TRY

Just being pedantic: Runlevel 2 is normally without network support and lines 6 and 7 of the init.d script should therefore be

# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6

From: Steve

I tried using the init.d script but received an error:

[[email protected] ~]# /etc/init.d/lld2d start
Starting LLTD Protocol Responder: /etc/init.d/lld2d: line 44: start-stop-daemon: command not found

 My INTFACE variable is eth1.

 

Great tutorial, Thanks!

Steve

From: Rob

well written; it complied on Debian (Lenny) without issue.

started up fine (as root) with ./lld2d start 

Thank you


From: Atticus

New download link for source code

 http://www.microsoft.com/whdc/connect/rally/rallykit.mspx

 Hope this helps.


From:

Another new link for source:

 http://msdn.microsoft.com/en-us/windows/hardware/gg463094

 

Just downloaded it from there, so it's good as of today, anyway. ;-)

From: Anonymous

Also compiles and runs under openSuSE11.0 ... but Win7 gives a error when creating a network overview. If I stop the daemon on the other computer, the overview gets created...

Any ideas ?