what's wrong with the openbsd-netcat?

2012-12-31 Thread lei yang
Hi experts

On my OS, I run kvm with below comand to do the migrate: it meet below error
1)
#qemu-system-x86_64 --enable-kvm -smp 2 -m 512 -net nic,model=e1000
-net tap,script=/etc/qemu-ifup -hda /boot/guest_img.raw  -kernel
/boot/bzImage -append root=/dev/hda rw console=ttyS0,115200 ip=dhcp
selinux=0 -nographic -incoming exec:nc -l 5200
it print:
nc: Protocol not available
load of migration failed

2)Then I copy the nc binary from redhat, then it works well

can you please help me about this issue?

Lei
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: what's wrong with the openbsd-netcat?

2012-12-31 Thread lei yang
Forget to say, My netcat from
http://code.google.com/p/openbsd-netcat/source/checkout

On 12/31/12, lei yang yanglei.f...@gmail.com wrote:
 Hi experts

 On my OS, I run kvm with below comand to do the migrate: it meet below
 error
 1)
 #qemu-system-x86_64 --enable-kvm -smp 2 -m 512 -net nic,model=e1000
 -net tap,script=/etc/qemu-ifup -hda /boot/guest_img.raw  -kernel
 /boot/bzImage -append root=/dev/hda rw console=ttyS0,115200 ip=dhcp
 selinux=0 -nographic -incoming exec:nc -l 5200
 it print:
 nc: Protocol not available
 load of migration failed

 2)Then I copy the nc binary from redhat, then it works well

 can you please help me about this issue?

 Lei

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: help about free bsp version netcat to work it on ubuntu

2012-07-24 Thread lei yang
On Tue, Jul 24, 2012 at 12:47 AM, Polytropon free...@edvax.de wrote:
 On Mon, 23 Jul 2012 23:29:38 +0800, lei yang wrote:
 Yes, the second version I post is using the source from you supplied,
 then I compiled it, but it has no
 -U flag like what I post, it seems a version different casued this.

 Yes. The version distributed by the ports collection is different
 from that one supplied with the base system of FreeBSD.

 To try _that_ version, you can download the source tarball and
 extract it; in the directory

 # wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/src.txz
 # tar xvf src.txz

Thanks for the help,

tar xvf src.txz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 4896 bytes from src.txz
tar: Error exit delayed from previous errors
[lyang0@ala-lpggp2 lyang0]$ tar xvf src.txz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 4896 bytes from src.txz
tar: Error exit delayed from previous errors



 # cd cusr/src/ontrib/netcat/
 # ls
 FREEBSD-XlistFREEBSD-vendor   atomicio.h   netcat.c
 FREEBSD-upgrade  atomicio.c   nc.1 socks.c
 #
 your build command(s) here


Suppose gcc -o netcat netcat.c atomicio.c socks.c should work

Lei



 You can check the FTP server for other versions of the OS
 (e. g. different branch and architecture, starting at
 ftp://ftp.freebsd.org/pub/FreeBSD/releases/, then selecting
 architecture and finally the OS version). There are also
 different ways of obtaining the sources, but the solution
 shown here should be sufficient.

 (You can use tar xvf src.txz usr/src/contrib/netcat to
 only extract the files for netcat instead of everything,
 but it _might_ be possible that the build process needs
 some files from other locations.)

 If you don't have wget installed, stock ftp location
 command should also work for downloading.




 I don't know where to find the source code in Red Hat.

 Me neither, but check man hier on a RH system to get
 the documentation about the file system hierarchy which
 should have detailed information on what is stored where.




 --
 Polytropon
 Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: help about free bsp version netcat to work it on ubuntu

2012-07-24 Thread lei yang
On Mon, Jul 23, 2012 at 11:52 PM, Alejandro Imass a...@p2ee.org wrote:
 On Mon, Jul 23, 2012 at 11:29 AM, lei yang yanglei.f...@gmail.com wrote:
 On Mon, Jul 23, 2012 at 10:36 PM, Polytropon free...@edvax.de wrote:
 On Mon, 23 Jul 2012 12:59:55 +0800, lei yang wrote:
 On Mon, Jul 23, 2012 at 12:25 AM, Polytropon free...@edvax.de wrote:
  On Sun, 22 Jul 2012 22:41:57 +0800, lei yang wrote:
  Hi,

 [...]


 I don't know where to find the source code in Red Hat.


 Why don't you just toss RedHat and use FreeBSD ? Most everything you
 run on Linux will run on FreeBSD and there are also Desktop-friendly
 distros of FreeBSD such as PC-BSD which, in Linux terms, is to FreeBSD
 somewhat akin to what Ubuntu is to Debian.


Aha,I just want to learn want to know how to build the netcat for
freebsd version on a no-freebsd platform

Lei

 Anyway, give PC-BSD a try and you won't regret it:

 http://www.pcbsd.org/


 Cheers,

 --
 Alejandro Imass
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: help about free bsp version netcat to work it on ubuntu

2012-07-24 Thread lei yang
On Tue, Jul 24, 2012 at 12:03 AM, Carl Johnson ca...@peak.org wrote:
 lei yang yanglei.f...@gmail.com writes:

 On Mon, Jul 23, 2012 at 12:25 AM, Polytropon free...@edvax.de wrote:
 On Sun, 22 Jul 2012 22:41:57 +0800, lei yang wrote:
 Hi,

 I want to build a netcat on my local pc (ubuntu) with gcc, is it
 possible? I'm new to free bsd



 it has no -U flag, can you point me where I get this version

 Have you checked the other version of netcat already available?  A quick
 check shows these four versions for Ubuntu:

 netcat: TCP/IP swiss army knife -- transitional package
 netcat-openbsd: TCP/IP swiss army knife
 netcat-traditional: TCP/IP swiss army knife
 netcat6: TCP/IP swiss army knife with IPv6 support


how did you get the list?

To be clear, haha, I just want to know how to build a fress bsd netcat
on a no-fressbsd platform

Lei




 --
 Carl Johnsonca...@peak.org

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: help about free bsp version netcat to work it on ubuntu

2012-07-23 Thread lei yang
On Mon, Jul 23, 2012 at 10:36 PM, Polytropon free...@edvax.de wrote:
 On Mon, 23 Jul 2012 12:59:55 +0800, lei yang wrote:
 On Mon, Jul 23, 2012 at 12:25 AM, Polytropon free...@edvax.de wrote:
  On Sun, 22 Jul 2012 22:41:57 +0800, lei yang wrote:
  Hi,
 
  I want to build a netcat on my local pc (ubuntu) with gcc, is it
  possible? I'm new to free bsd
 
  I hope I don't misunderstand your intention: You are trying to
  build a Linux executable of netcat from FreeBSD's sources?
 
  You _do_ know that FreeBSD and Linux (here: Ubuntu) are two
  totally different operating systems. I'm not sure code is
  compatible at this level (but it maybe _could_ be, you'd
  have to try it).
 
  The netcat program (nc) is part of the FreeBSD operating
  system for some time now. There's also a port of netcat
  in /usr/ports/net/netcat (which can also be used). That
  port's Makefile lists some sources:
 
  ftp://coast.cs.purdue.edu/pub/tools/unix/netutils/netcat/
 
  ftp://ftp.cuhk.edu.hk/pub/packages/security/purdue/netutils/netcat/
 
  http://www.planetmirror.com/pub/lprng/TOOLS/
 
  You could try to use that source distribution as well.
 
 


 Thanks for the great help, I have built it successfully on my ubuntu.
 I find it's not the version I want
 I want use the version on Rehat,which has a -U flag( yes, I want to
 use this flag) but the above version has no this flag

 on redhat:

 usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
 [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
 [-x proxy_address[:port]] [hostname] [port[s]]
   Command Summary:
   -4  Use IPv4
   -6  Use IPv6
   -D  Enable the debug socket option
   -d  Detach from stdin
   -h  This help text
   -i secs Delay interval for lines sent, ports scanned
   -k  Keep inbound sockets open for multiple connects
   -l  Listen mode, for inbound connects
   -n  Suppress name/port resolutions
   -p port Specify local port for remote connects
   -r  Randomize remote ports
   -s addr Local source address
   -T ToS  Set IP Type of Service
   -C  Send CRLF as line-ending
   -t  Answer TELNET negotiation
   -U  Use UNIX domain socket
   -u  UDP mode
   -v  Verbose
   -w secs Timeout for connects and final net reads
   -X protoProxy protocol: 4, 5 (SOCKS) or connect
   -x addr[:port]  Specify proxy address and port
   -z  Zero-I/O mode [used for scanning]
   Port numbers can be individual or ranges: lo-hi [inclusive]

 --
 with the above you list:

 lyang0@lyang0-OptiPlex-755:~/tmp/nc110$ ./nc -help
 [v1.10]
 connect to somewhere: nc [-options] hostname port[s] [ports] ...
 listen for inbound:   nc -l -p port [-options] [hostname] [port]
 options:
   -g gateway  source-routing hop point[s], up to 8
   -G num  source-routing pointer: 4, 8, 12, ...
   -h  this cruft
   -i secs delay interval for lines sent, ports scanned
   -l  listen mode, for inbound connects
   -n  numeric-only IP addresses, no DNS
   -o file hex dump of traffic
   -p port local port number
   -r  randomize local and remote ports
   -s addr local source address
   -u  UDP mode
   -v  verbose [use twice to be more verbose]
   -w secs timeout for connects and final net reads
   -z  zero-I/O mode [used for scanning]
 port numbers can be individual or ranges: lo-hi [inclusive]


 it has no -U flag, can you point me where I get this version

 This indicates you did use the netcat version that also is
 in the FreeBSD Ports Collection. The netcat version that
 belongs to the FreeBSD system (the operating system itself)
 does seem to have the switch you need.

 From my home FreeBSD box (8.2-STABLE of August 2011, i386),
 THIS is the netcat help message:

 % nc -help
 usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O 
 length]
   [-P proxy_username] [-p source_port] [-s source] [-T ToS]
   [-V rtable] [-w timeout] [-X proxy_protocol]
   [-x proxy_address[:port]] [destination] [port]
 Command Summary:
 -4  Use IPv4
 -6  Use IPv6
 -D

Re: help about free bsp version netcat to work it on ubuntu

2012-07-22 Thread lei yang
On Mon, Jul 23, 2012 at 12:25 AM, Polytropon free...@edvax.de wrote:
 On Sun, 22 Jul 2012 22:41:57 +0800, lei yang wrote:
 Hi,

 I want to build a netcat on my local pc (ubuntu) with gcc, is it
 possible? I'm new to free bsd

 I hope I don't misunderstand your intention: You are trying to
 build a Linux executable of netcat from FreeBSD's sources?

 You _do_ know that FreeBSD and Linux (here: Ubuntu) are two
 totally different operating systems. I'm not sure code is
 compatible at this level (but it maybe _could_ be, you'd
 have to try it).

 The netcat program (nc) is part of the FreeBSD operating
 system for some time now. There's also a port of netcat
 in /usr/ports/net/netcat (which can also be used). That
 port's Makefile lists some sources:

 ftp://coast.cs.purdue.edu/pub/tools/unix/netutils/netcat/

 ftp://ftp.cuhk.edu.hk/pub/packages/security/purdue/netutils/netcat/

 http://www.planetmirror.com/pub/lprng/TOOLS/

 You could try to use that source distribution as well.




Thanks for the great help, I have built it successfully on my ubuntu.
I find it's not the version I want
I want use the version on Rehat,which has a -U flag( yes, I want to
use this flag) but the above version has no this flag

on redhat:

usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
  [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
  [-x proxy_address[:port]] [hostname] [port[s]]
Command Summary:
-4  Use IPv4
-6  Use IPv6
-D  Enable the debug socket option
-d  Detach from stdin
-h  This help text
-i secs Delay interval for lines sent, ports scanned
-k  Keep inbound sockets open for multiple connects
-l  Listen mode, for inbound connects
-n  Suppress name/port resolutions
-p port Specify local port for remote connects
-r  Randomize remote ports
-s addr Local source address
-T ToS  Set IP Type of Service
-C  Send CRLF as line-ending
-t  Answer TELNET negotiation
-U  Use UNIX domain socket
-u  UDP mode
-v  Verbose
-w secs Timeout for connects and final net reads
-X protoProxy protocol: 4, 5 (SOCKS) or connect
-x addr[:port]  Specify proxy address and port
-z  Zero-I/O mode [used for scanning]
Port numbers can be individual or ranges: lo-hi [inclusive]

--
with the above you list:

lyang0@lyang0-OptiPlex-755:~/tmp/nc110$ ./nc -help
[v1.10]
connect to somewhere:   nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [-options] [hostname] [port]
options:
-g gateway  source-routing hop point[s], up to 8
-G num  source-routing pointer: 4, 8, 12, ...
-h  this cruft
-i secs delay interval for lines sent, ports scanned
-l  listen mode, for inbound connects
-n  numeric-only IP addresses, no DNS
-o file hex dump of traffic
-p port local port number
-r  randomize local and remote ports
-s addr local source address
-u  UDP mode
-v  verbose [use twice to be more verbose]
-w secs timeout for connects and final net reads
-z  zero-I/O mode [used for scanning]
port numbers can be individual or ranges: lo-hi [inclusive]


it has no -U flag, can you point me where I get this version

Lei






 I have to quesion:
 1)where to download it's source it for netcat

 They can be found in /usr/src/contrib/netcat/ once you have
 extracted the source distribution of FreeBSD. Depending on
 which version of the OS (branch, revision, platform) you
 need, you have to select the corresponding archive from
 one of the download mirrors.

 Visit http://www.freebsd.org/ to find out where and how
 to obtain FreeBSD (or components of it). I would suggest
 using one of the FTP servers that are accessible for you
 at a good speed.



 2)how to build it on ubuntu with gcc? only make?

 I'm not even sure Linux will be able to compile FreeBSD
 sources. A typical Linux build would consist of the
 three commands

 # ./configure
 # make
 # make install

 but FreeBSD's OS sources don't need the 1st step. The
 Makefiles distributed