;Program to Trobleshoot LAN related problems
;By: Rohit Kumar
;Date: 3 Nov. 2002

(defun CardTrouble ()
	(print "Possibly it is a problem with your network card itself. Check it out.")
	(print "Check out if the card is actually being detected.")
	(print "Fix it if you find a problem. You may need to open your cabinet and unplug and replug your network card.")
	(print "Is the problem solved now(y/n)?")
	(if (string-equal (read) "y")
		(print "Thats good. Bye for now.")
		(let ()
			(print "May be it is trouble with your computer itself. You should check that. I cant help in this. Bye.")
		)
	)
)

(defun DriverTrouble ()
	(print "Possibly it is a problem with your network card drivers. Check it out.")
	(print "Check out system setting and network card configs. Are the drivers installed. Are they showing any errors.")
	(print "Fix it if you find a problem. You may need to reinstall the drivers.")
	(print "Is the problem solved now(y/n)?")
	(if (string-equal (read) "y")
		(print "Thats good. Bye for now.")
		(CardTrouble)
	)
)

(defun ConfigTrouble ()
	(print "Possibly it is a problem with your network configurations. Check it out.")
	(print "Check network connection setting and all parameters. Ask Network Administrator or refer to manual for seeing the correct parameters.")
	(print "Fix it if you find a problem")
	(print "Is the problem solved now(y/n)?")
	(if (string-equal (read) "y")
		(print "Thats good. Bye for now.")
		(DriverTrouble)
	)
)

(defun CableTrouble ()
	(print "Possibly it is a problem with your cable. Check it out.")
	(print "Check cuts and twists and overlapping with other cables or radiation sources like CVTs or TubeLights.")
	(print "Fix it if you find a problem")
	(print "Is the problem solved now(y/n)?")
	(if (string-equal (read) "y")
		(print "Thats good. Bye for now.")
		(ConfigTrouble)
	)
)

(defun IndividualTrouble ()
	(print "We need to find a localised fault")
	(let ()
		(print "Check the LED light on your network interface card.")
		(print "Is it ON?")
		(if (string-equal (read) "n")
			(let ()
				(print "May be you cable is unplugged from the hub. Check that.")
				(print "Is the problem solved now(y/n)?")
				(if (string-equal (read) "y")
					(print "Thats good. Bye for now.")
					(CableTrouble)
				)
			)
		)
	)
)

(defun NetworkFaulty ()
	(print "I think the Network is Faulty")
	(let ()
		(print "Check if the power supply is OK.")
		(print "Is the problem solved(y/n)?")
		(if (string-equal (read) "n")
			(let ()
				(print "Check if the hub/switch is working. Are the light ON and stable?")
				(print "Is the problem solved(y/n)?")
				(if (string-equal (read) "y")
					(print "Thats good. Bye for now")
					(let ()
						(print "May be you should go over once again")
						(LANTroubleShoot)
					)
				)
			)
			(print "Thats good. Bye for now")
		)
	)
)

(defun SoftwareProblem ()
	(print "You should check the software's network configuration.")
	(print "Check your proxy settings")
	(let ()
		(print "Is the problem solved (y/n)?")
		(if (string-equal (read) "y")
			(print "Thats good. Bye for now.")
			(let ()
				(print "Probably it is not a problem with you software. Try again.")
				(LANTroubleShoot)
			)
		)
	)
)

(defun BigProblem ()
	(print "It seems to be a hardware problem. Could be system software also.")
	(let ()
		(print "Is it a problem with a particular/group of computers or with all computer (1/2)?")
		(if (string-equal (read) "1")
			(IndividualTrouble)
			(NetworkFaulty)
		)
	)
)

(defun LANTroubleShoot ()
	(let ()
		(print "Is it a problem with a particular software or with everything (1/2)?")
		(if (string-equal (read) "1")
			(SoftwareProblem)
			(BigProblem)
		)
	)
)
