Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: How do you check a network port is open?< Next Oldest | Next Newest >
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Sep. 17 2007,15:58 QUOTE

Well - both machines connect to google and from netstat, the sane port on 6566 looks to be open, but...
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Sep. 18 2007,12:16 QUOTE

I guess the solution (as it often is) was a matter of finding the correct error log to look in:
Code Sample
$ scanimage -L
[/var/log/messages]
Sep 18 15:16:43 box daemon.err inetd[1572]: getpwnam: saned: No such user

So, by changing the following (on the server as a test):

/etc/inetd.conf
sane-port stream tcp nowait saned.saned /opt/hplip/sbin/saned saned -->
--> sane-port stream tcp nowait root /opt/hplip/sbin/saned saned

/etc/saned/net.conf
localhost

/etc/saned/dll.conf
net
hpaio

Then it all falls into place:
Code Sample
$ sudo /etc/init.d/inetd restart
$ telnet localhost 6566
Trying 127.0.0.1...
Connected to box.
Escape character is '^]'.
^]
Connection closed by foreign host.
$ scanimage -L
device `hpaio:/usb/OfficeJet_K80?serial=ES0911401VOH' is a Hewlett-Packard OfficeJet_K80 all-in-one
device `net:localhost:hpaio:/usb/OfficeJet_K80?serial=ES0911401VOH' is a Hewlett-Packard OfficeJet_K80 all-in-one
$ scanimage -d net:localhost:hpaio:/usb/OfficeJet_K80?serial=ES0911401VOH --test
scanimage: scanning image of size 638x1125 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 1914 bytes...  PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
...

Now to try it from dsl and winxp clients...
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Sep. 21 2007,07:12 QUOTE

Well... winxp doesn't want to scan remotely (so far), w2k works fine (and into photoshop via sanetwain - result) and it works from a remote dsl machine:
Code Sample
$ telnet 192.168.1.100 6566
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.
^]
Connection closed by foreign host.
$ export PATH=/opt/hplip/bin:/opt/python-2.3/bin:$PATH
$ scanimage -L
device `net:192.168.1.100:hpaio:/usb/OfficeJet_G85?serial=SGG13E0C49VL' is a Hewlett-Packard OfficeJet_G85 all-in-one
$ scanimage --test
scanimage: scanning image of size 638x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 1914 bytes...  PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
scanimage: stepped read, 4 bytes...     PASS
yada yada
scanimage: stepped read, 3 bytes...     PASS
...not so fast over a wireless connection though  :)
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Sep. 25 2007,15:14 QUOTE

...found the problem with winxp - something about the way it connects to saned (as compared to w2k) didn't like:
Code Sample

$ cat /etc/sane.d/saned.conf
192.168.1.1/120
$ sudo /opt/hplip/sbin/saned -d128
[saned] main: starting debug mode (level 128)
...
[saned] main: [1] bind () to port 6566
[saned] main: [1] listen ()
[saned] main: waiting for control connection
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.18 ready
[saned] check_host: access by remote host: 192.168.1.102
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: box
[saned] check_host: local hostname(s) (from DNS): box
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `192.168.1.1/120'
[saned] check_host: subnet with base IP = 192.168.1.1, CIDR netmask = 120
[saned] check_v4_in_range: invalid CIDR value (120) !
[saned] init: access by host 192.168.1.102 denied
[saned] quit: exiting


but naming the client ip address exlicitly did it:
Code Sample
$ cat /etc/sane.d/saned.conf
192.168.1.102
192.168.1.1/120
$ sudo /opt/hplip/sbin/saned -d128
...
[saned] main: [1] bind () to port 6566
[saned] main: [1] listen ()
[saned] main: waiting for control connection
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.18 ready
[saned] check_host: access by remote host: 192.168.1.102
[saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK
[saned] check_host: local hostname: box
[saned] check_host: local hostname(s) (from DNS): box
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `192.168.1.102'
[saned] check_host: access granted from IP address 192.168.1.102
[saned] init: access granted

Its kind of odd that w2k doesn't have the same problem. Anyway, it works and the really good bit is that windows cannot share scanners natively...
Back to top
Profile PM 
8 replies since Sep. 16 2007,13:48 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: How do you check a network port is open?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code