📄 readme
字号:
This is the readme to the Lan Information Server LISa and the Restricted LANInformation Server resLISa.+---------------+| LISa |+---------------+LISa is intended to provide a kind of "network neighbourhood" but onlyrelying on the TCP/IP protocol stack, no smb or whatever.In the configuration file you provide a range of IP-addresses whichLISa should check, wether they are running. In the most simple casethis could be your network address/subnetmask, then LISa wouldcheck every host of your network wether it is running.The list of running hosts is then provided via TCP port 7741.The hosts are checked using ICMP echo requests. To be able to send and receiveICMP echo requests and replies the program has to open a so-called"raw socket". Therefor it needs root privileges. This socket is openedright after the start of the program, after successfully opening the socketroot privileges are dropped immediatly (see main.cpp and strictmain.cpp).Since so many ICMP requests can cause some network traffic if thereare more than one such server running in one network, the serverscooperate with each other. Before they start pinging, they send a broadcaston port 7741. If somebody answers to this broadcast, they will receivethe complete list via TCP port 7741 from this host and will notstart to ping theirselves. If nobody answers, the host which sent the broadcastwill start checking the hosts and then open a socket which listensfor the mentioned broadcasts. If the host received an answer to his broadcast,it won't have the socket for listening to the broadcasts open. Sousually exactly one of the servers will have this socket open and onlythis one will actually ping the hosts. They work like "I will onlydo it if nobody else can do it for me".This way it is possible that many hosts in a network run this server, butthe net load will remain low. For the user it is not neccessary to knowwether there is a server (i.e. a name server or fileserver or whatever)in the network which also runs LISa. He can always run LISa locallyand LISa will detect if there is one, transparently to the user.The first client for LISa is an ioslave for KDE2, so the usercan enter there lan://localhost/ or lan:/, which will bothcontact LISa on the own system.If there is a machine which runs all the time and the user knowsthat this machine also runs LISa, he can use with his LISa-client directlythis server (would be with the mentioned ioslave lan://the_server_name/).If you don't want that your LISa takes part in the broadcasting, but alwayspings itself, make it use another port with thecommand line option --port or -p.This is not recommended !If you send SIGHUP to LISa, it will reread its configfile.If you send SIGUSR1 to LISa, it will print some status information to stdout.If there are very strict security rules in your network, some peoplemight consider the pinging as an potential attack. If youhave problems with this, try the restricted version, resLISa.Now an example config file:PingAddresses = 192.168.100.0/255.255.255.0;192.168.200.10-192.168.200.20;192.168.200.1PingNames = bb_mail;AllowedAddresses = 192.168.0.0/255.255.0.0BroadcastNetwork = 192.168.100.0/255.255.255.0FirstWait = 30 #30 hundredth secondsSecondWait = -1 #only one try#SecondWait = 60 #try twice, and the second time wait 0.6 secondsUpdatePeriod = 300 #update after 300 secsDeliverUnnamedHosts = 0 #don't publish hosts without nameMaxPingsAtOnce = 256 #send up to 256 ICMP echo requests at onceThe first line says which IP-addresses will be pinged.The first partsays that all addresses in 192.168.100.0 withsubnetmask 255.255.255.0 will be pinged (i.e. 192.168.100.0 to192.168.100.254), the second part says that additionally the addresses192.168.200.10 to 192.168.200.20 will be pinged, and last but not least also192.168.200.1 will be pinged. The lines must not contain whitespace between theIP-addresses. In the next line ("PingNames") you can add additional hostsby their name, also divided by semicolons ;In this name the host named "bb_mail".The line "AllowedAddresses" is very important. LISa will only ping addresses,accept clients and answer broadcasts from addresses, which are covered by theaddresses given in this line. You can add up to 32 network addresses/network masksor single addresses. Divide them by ; and don't put empty space between theaddresses !In the given example all addresses from 192.168.0.0 up to192.168.255.255 are valid. This is a very wide range, you should use astricter address range.The next line contains exactly one network address/subnet mask.To this network broadcasts will be sent. Usually this should be yourown networkaddress/subnetmask.After LISa sent the ICMP echo requests, it waits a short moment for the answers.In FirstWait you can specify in hundredth seconds, how long it willwait. Try with values from 5 to 50 hundredth seconds.If all hosts are found, you can set SecondWait to -1, then LISa willsend the pings only once, if you set SecondWait to somethingbigger than 0, LISa will send the pings a second time, but only to the hostsfrom which it received no answer yet. Since this are probaly slow hosts, itwill probably be useful to set SecondWait to a bigger value thanFirstWait. The maximum is 99 (almost a whole second).UpdatePeriod is the number of seconds after which LISa will start to searchfor hosts again (first broadcasting, then if required pinging).With DeliverUnnamedHosts you can enable or disable, wether LISa willalso publish the hosts, which have no name assigned. This mightprobably be some routers or servers or bridges or whatever. Atleast these hosts probably have a reason for having no name, soit might be a security point to disable this setting.The last line MaxPingsAtOnce says how much ICMP echo requestswill be sent most at once. 256 should be OK, you can't increase itvery much, maybe a little bit, but you could try to make it smallerand see wether it works better. Usually you can keep 256.+------------------+| resLISa |+------------------+If you hav very strict security rules in your network or you don't want tohave another port open or whatever, you can use resLISa. With resLISa you can't ping whole networks and address ranges, you can giveresLISa up to currently 64 hosts by their names in its config file. Thesewill be pinged.resLISa will also only provide the information over a unix domain socket, i.e.not over the network. The name of the socket is "/tmp/resLisa-YourLoginname",so resLISa can be savely run by more users on one machine.Since it should also not produce a security risk of any kind it issafe to install reslisa setuid root. root privileges will be droppedright after startup (see strictmain.cpp).It will also not send or receive broadcasts.Maybe it then actually works a bit more like ICQ.The first client for this is also an ioslave for KDE2 (makes rlan:/ in e.g. konqy).And now a configuration file for resLISa:PingAddresses = 192.168.100.0/255.255.255.0;192.168.200.10-192.168.200.20; 192.168.200.1PingNames = bb_mail;some_host;some_other_hostAllowedAddresses = 192.168.0.0/255.255.0.0BroadcastNetwork = 192.168.100.0/255.255.255.0FirstWait = 30 #30 hundredth secondsSecondWait = -1 #only one try#SecondWait = 60 #try twice, and the second time wait 0.6 secondsUpdatePeriod = 300 #update after 300 secsDeliverUnnamedHosts = 1 #also publish hosts without nameMaxPingsAtOnce = 256 #send up to 256 ICMP echo requests at onceAs mentioned the line "PingAddresses" will be ignored, only the PingNameswill be used. The line "BroadcastNetwork" will be also ignored, sinceresLISa doesn't send braodcasts.For info about command line switches enter lisa -h and reslisa -h,you should do this, since it contains some additional information.LISa and resLISa need a libstdc++ (it uses only the string-class from it),it *doesn't* need neither Qt nor KDE.So, that's it for now.If you have suggestions, problem or whatever, contact me.Have funAlexander Neundorf<neundorf@kde.org>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -