Linux-Misc Digest #570, Volume #18               Mon, 11 Jan 99 16:13:15 EST

Contents:
  Re: Sound working - finally! ([EMAIL PROTECTED])
  Re: Multiple NIC Cards.. HELP!! <solution> ("jay")
  Re: Bob's Ignorance -- Or Is It Flamebait? (Michael Powe)
  Re: help needed mounting fd0 (Albrigo Michele)
  Re: help needed mounting fd0 (Albrigo Michele)
  Re: Linux, Unix or Unix alike? (Sean Yamamoto)
  Re: RedHat-5.2 and Sys-V IPC.. (Henry Zheng (C))
  Re: hard drive space (garv)
  Re: I need HELP with monitoring utilitites for Linux (Gary Momarison)
  Re: Installing Linux on a secondary UIDE disk (Gary Momarison)
  spreadsheet for Linux (Brandon)
  Re: K6-2 300 Problem (garv)
  RPM & selber kompilierte Software ("Beat Rupp")
  Re: Slow Connectioon (David M. Cook)
  small progie compile problem (Patrick O'Neil)
  Re: Linux: Fight for survival or on victory march? (Marco Anglesio)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.setup
Subject: Re: Sound working - finally!
Date: Mon, 11 Jan 1999 18:39:22 GMT



>   It seems I missed a conflict when I checked DMA and IRQs
>   My network card and the sound card MIDI chip were both using address 0x300

glad to hear its working now.

question - with a running linux system - is there a utility
which will tell me more about what hardware is using what
DMA and IRQs?

or do I have to go into windoze?

TIA

============= Posted via Deja News, The Discussion Network ============
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

------------------------------

From: "jay" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.linux,alt.os.linux,comp.os.linux.hardware,comp.os.linux.help,comp.os.linux.networking,linux.redhat.install,linux.redhat.misc
Subject: Re: Multiple NIC Cards.. HELP!! <solution>
Date: Mon, 11 Jan 1999 19:43:31 GMT

Sorry, guys.  you all are only part right- the OS already sees the two
identical cards, but it's delaying the one because the kernel needs to be
told to init the other - to do this add the following statement to your
lilo.conf in etc/

append="ether=0,0,eth1"

that's it, dude.  e-mail me @ [EMAIL PROTECTED] if you have more problems- i
fought this for a couple months, but once you get it, it works great.



------------------------------

From: Michael Powe <[EMAIL PROTECTED]>
Crossposted-To: alt.linux,alt.os.linux,comp.os.linux.advocacy
Subject: Re: Bob's Ignorance -- Or Is It Flamebait?
Date: 11 Jan 1999 08:04:29 -0800

=====BEGIN PGP SIGNED MESSAGE=====
Hash: SHA1

>>>>> "look" == look  <[EMAIL PROTECTED]> writes:

    look> that in your average Windows newsreader.. ;-)) :> :> : What
    look> are "regexps"?  :> :> Regular expressions. Like A*B being
    look> A<any number of characters>B....  : ^^^1 or more
    look> ^^^^^^^^^^^"A" : </pedant> ;-)

    look> I thought the * indicated 0 or more characters. If you want
    look> one or more, you'd use ?* wouldn't you?

No, `+' means at least one of the previous characters.  `*' means 0 or
more, as you point out.  `?' means optional for the previous
character, e.g., `colou?r' to match both `color' and `colour' but not
`colouur'.

mp

8<---------------how-easy-is-it-to-demunge-an-address?------------------->8
#! /usr/bin/perl # if you are [EMAIL PROTECTED] (Another Luser):
while ($line = <>){ if ($line =~ m/^\s*$/ ){ last; }
if ($line =~ m/^From: (\S+) \(([^()]*)\)/){ $from_address = $1; } }
if ($from_address =~ m/\S+NOSPAM\S+/){ $x = index($from_address, NOSPAM);
substr($from_address, $x, 6+1) = ""; printf("The real address is %s\n",
$from_address);}else { printf("No munge, just plain %s\n",$from_address);}
printf("\nBrought to you by the Truth In Mail Headers Foundation\n");
8<-----------------------here's-one-example------------------------------>8

- --
                             Michael Powe
            [EMAIL PROTECTED]   http://www.trollope.org
                         Portland, Oregon USA

=====BEGIN PGP SIGNATURE=====
Version: GnuPG v0.9.0 (GNU/Linux)
Comment: Encrypted with Mailcrypt 3.5.1 and GNU Privacy Guard

iD8DBQE2miD4755rgEMD+T8RAtsxAJ99FwL9WCCbl09TCizkWUZ3ITYk0wCgrK+i
AH+W7RLC/WiQ73V1cC6KMYY=
=X2Nc
=====END PGP SIGNATURE=====

------------------------------

From: Albrigo Michele <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.help,comp.os.linux.setup
Subject: Re: help needed mounting fd0
Date: Mon, 11 Jan 1999 09:36:21 +0100

> I'm trying to mount , as root, my floppy
> # mount -o rw /dev/fd0 /mnt/floppy and It works fine while I'm root,
> when I login as user my floppy is read only and I cant write or copy file on
> it.
> I'm a Linux novice and I'm looking for help.
> thanx in advance
> Matteo

If you only need to manage files from/to a floppy, I suggest you to use
the mtools. They have almost the same syntax of their corresponding MS-DoS
commands, and they are:

mcopy (-> copy)
mdir (-> dir, beware! mdir = dir a:, not simply dir)
mdel (-> del)
mcd (-> cd, be careful, if you don't want to use mcd, you'll have to
change the original DOS syntax: copy a:\ciao\come\va.txt will be mcopy
a:\ciao/come/va.txt, subdirectories will have inverted slashes!)
mformat (has some problems, at least on the systems I use)
mmove (same as mformat)
...and many others...

Anyway, try also with "man mtools", for furhter informations.
Bye
Michele


------------------------------

From: Albrigo Michele <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.help,comp.os.linux.setup
Subject: Re: help needed mounting fd0
Date: Mon, 11 Jan 1999 09:33:36 +0100

> I'm trying to mount , as root, my floppy
> # mount -o rw /dev/fd0 /mnt/floppy and It works fine while I'm root,
> when I login as user my floppy is read only and I cant write or copy file on
> it.
> I'm a Linux novice and I'm looking for help.
> thanx in advance
> Matteo

If you only need to manage files from/to a floppy, I suggest you to use
the mtools. They have almost the same syntax of their corresponding MS-DoS
commands, and they are:

mcopy (-> copy)
mdir (-> dir, beware! mdir = dir a:, not simply dir)
mdel (-> del)
mcd (-> cd, be careful, if you don't want to use mcd, you'll have to
change the original DOS syntax: copy a:\ciao\come\va.txt will be mcopy
a:\ciao/come/va.txt, subdirectories will have inverted slashes!)
mformat (has some problems, at least on the systems I use)
mmove (same as mformat)
...and many others...

Anyway, try also with "man mtools", for furhter informations.
Bye


------------------------------

From: Sean Yamamoto <[EMAIL PROTECTED]>
Subject: Re: Linux, Unix or Unix alike?
Date: Mon, 11 Jan 1999 12:16:32 -0800
Reply-To: [EMAIL PROTECTED]

UNIX is a registered trademark of The Open Group.

Legally speaking, Linux is not UNIX because the source code
tree isn't derived from their tree. You have to pay The Open
Group a license fee in order to adopt the UNIX name officially.
Companies that have paid this fee include: Digital (Compaq),
Sun, IBM, Hewlett-Packard, and Silicon Graphics, among others.

Linux does mimic the form and function of Unix enough so that
for all practical matters, it is Unix. It is not Unix in a 
court of law. If you read the documentation on www.linux.org,
you will notice that they rather gingerly call it a "Unix-like"
operating system. Read more about Unix on The Open Group's
web site, www.opengroup.org, if this topic continues to 
interest you.

S.

Ben wrote:
> 
> I had an argument with one of my teachers about this subject. Is 
> Linux a Unix system or a Unix alike system? And what does it take 
> to be considered � Unix system?
> 
> Thanks

-- 
Sean Yamamoto                        If William of Ockham had a
beard,
UNIX Cabalist At Large           it wasn't because his razor was
dull.

[EMAIL PROTECTED]                             "Apply Occam's
razor."

------------------------------

From: hzheng@PROBLEM_WITH_INEWS_GATEWAY_FILE (Henry Zheng (C))
Subject: Re: RedHat-5.2 and Sys-V IPC..
Date: Mon, 11 Jan 99 16:03:21 GMT

These are the responses I received a few days ago. After all,
I installed Oracle 8.0.5 into my RedHat 5.2 system without
modifying the kernel parameters. Everything seems to be working
up to now.

Henry

........................................................................

> all of those parameters should be set in the .h[eader] files which come
> with the kernel sourcecode...once you change them, you recompile and move
> onto the next problem
 
First, would you excuse me for my (very) bad english !
You  have to modify theses headers files :
/usr/src/linux/include/asm/shmparam.h -> SHMMAX, SHMMIN, SHMMNI, SHMSEG
becarefull ! SHMMAX is in hexa !
/usr/src/linux/include/linux/sem.h -> SEMMNS, SEMMNI, SEMMSL
 
    Laurent BIZE
 
========================================================================
Actually, this isn't required at all.  I started setting up Linux with the
parameters that Oracle specifies it requires.  After not finding several
parameters and having a fun time accomplishing the little that I did, I
decided to try installing.  (What's the worst that can happen?  It crash?)
 
We now have a system running with Oracle 8.0.5.  (This is a system converted
over from Interactive Unix.)  The conversion is almost complete and the
database is running without a problem.  BTW, I used Redhat 5.1.
 
Terry Steyaert
[EMAIL PROTECTED]

ishwar rattan ([EMAIL PROTECTED]) wrote:
: I am planning to install Oracle-805 under RedHat-5.2. I need to
: modify the kernel parameters for shared memory IPC. If you know
: where the modifications will take place (config/header files etc.),
: please give me pointers. The info is like -- (looks SYSV IPC to me..)
:  
: SHMMAX 4294967295
: SHMMIN 1
: SHMMNI 100
: SHMMSG 10
: SHMMNS 200
: SEMMNI 70
: SEMMSL value greater than vlaue of PROCESSES initialization parameter
:  
: Thanks in advence,
: - iswhar

------------------------------

From: garv <[EMAIL PROTECTED]>
Subject: Re: hard drive space
Date: Mon, 11 Jan 1999 20:20:05 GMT

[EMAIL PROTECTED] wrote:

> Chris <[EMAIL PROTECTED]> wrote:
> -> Simple question...how do I get the partition info (i.e. how much free
> -> space do I have) in Linux? RedHat 5.1...thanks!
>
> Just type:
>
>   df
>
> at the prompt.  It'll also show you which directories are mounted on which
> partitions.
>
> Simeon

And if you type df -h it will report in "human" terms.


------------------------------

From: Gary Momarison <[EMAIL PROTECTED]>
Subject: Re: I need HELP with monitoring utilitites for Linux
Date: 11 Jan 1999 11:34:19 -0800

sweller <[EMAIL PROTECTED]> writes:

> Anyone out there who knows of any monitoring utilitites for Linux - I'm
> desperate to start
> monitoring a large set of Linux print servers my company currently has
> working all over Europe.

There's monitoring sections in these pages of Gary's Encyclopedia:

http://www.aa.net/~swear/pedia/sys-admin.html
http://www.aa.net/~swear/pedia/networking.html

And check out the software sites listed in

http://www.aa.net/~swear/pedia/software.html

and the new site at http://www.linuxberg.com

------------------------------

From: Gary Momarison <[EMAIL PROTECTED]>
Subject: Re: Installing Linux on a secondary UIDE disk
Date: 11 Jan 1999 11:29:32 -0800

Kaustav Bhattacharya <[EMAIL PROTECTED]> writes:

> OK, so I just bought a 6Gb UIDE hard disk for my PC which is currently
> chugging away happily with it's one and only 10Gb UIDE hard disk.  I'm
> going to plug the new disk in this evening.  If I install RedHat5.2 on
> the second disk, will the installation process need to
> move/shrink/change/repartition my existing 10GB drive (which has Win98
> on it)?  Do I still need to have to initial 2048Kb boot block (I think
> that's correct!) on the primary boot disk for Linux or can that now go
> on my second disk?  It would be really useful not to touch that Win98
> 10GB disk at all to be honest but I suspect that's not going to be
> possible... I hear a million screaming at me "go read the bloody FAQ's!"
> ok ok, I go do that now :) Have pitty, I'm a flippin Win98 dumbo jumping
> headlong into Linux world :) 

Since my last response to you was sorta nasty, I'll take pity, and not
even mention ...

The easiest and least risky method is to plan to boot Linux off a floppy
at least until you get more comfortable with it and decide to set up
[that means "setup" to those of you from RioLinda] a LILO dual-boot 
scheme.  When you get near the end of the RH installation, It'll ask
if you want to make a boot floppy. Yes you do.  It'll ask if you want
to install LILO into the MBR of the first disk or the boot record of
the Linux partition. No you don't.  After the installation completes
put the boot floppy in and reset the computer and it should boot into
Linux.

There are several ways to set up dual booting off the hard disk, but
I'll let you read RTFM about that.  Generally, it requires letting
LILO replace your MBR, or putting a (small?) primary partition on
the first disk for LILO to install a secondary boot record into,
which you would mark "active", or using some other boot loader,
like the NT boot loader.

-- 
Look for Linux info at http://www.dejanews.com/home_ps.shtml and in
Gary's Encyclopedia at http://www.aa.net/~swear/pedia/index.html



------------------------------

Date: Mon, 11 Jan 1999 10:52:57 -0500
From: Brandon <[EMAIL PROTECTED]>
Subject: spreadsheet for Linux

Hi,

I have a P100 laptop with 16 megs of RAM and 25 swap.  I installed SO
5.0 on it to use the spreadsheet and the first time I ran it it was
very slow, which makes sense considering the amount of RAM I have.  I
ran TOP in an xterm and the ram was all gone and I believe the swap
was just about taken up too.  So I was wondering if there was a
program that has about the same power and functionality of Excel.   I
dontknow if SO 5.0 has a spreadsheet comparable to Excel b/c i havent
tried it yet. I only opened up the main window to SO so far but
whether it it just as powerful or not I dont think I can use it b/c of
the slowness of my system.  So I need to know if ther is one that is
just as good as Excel but one that also doenst take much system
power.  I would also like to have a nice graphica word processor too.

Thanks
Brandon
ps.  How do I find out what my connection speed and my transfer rate
is when im connected to the net?

--
                              Member of the Elite Hacker Club

"Bill Gates?, I dont know any Bill Gates.  Oh, you mean 'by putting
every conceivable
 feature into an OPERATING SYSTEM, whether you want it or not, is
innovation' Bill
 Gates? Yeah, I know the monopolizer."

                       http://web.mountain.net/~brandon/main.htm
         For Beginners in Linux, Emulation, Midis, Playstation Info,
Virii, and to buy
               books from barnesandnoble.com on any info that's on my
site.



------------------------------

From: garv <[EMAIL PROTECTED]>
Subject: Re: K6-2 300 Problem
Date: Mon, 11 Jan 1999 20:25:26 GMT

Marcos Silva wrote:

> My computer configuration is k6-2 300Mhz, RAM 64Mb, HD 2Gb, CD 32x
> Creative, network card 3C509, video card SVirge 4Mb.
>

Don't think you cam blame k6-2 300.  I am using it with no problemo.


------------------------------

From: "Beat Rupp" <[EMAIL PROTECTED]>
Subject: RPM & selber kompilierte Software
Date: Mon, 11 Jan 1999 20:43:40 +0100

Hallo Leute

Vor langer Zeit mal fragte ich, wie das mit der Ordnung im System und der
RPM-Datenbank aussieht. Den Antworten zufolge ist RPM eine richtig gute
Sache.
In der Zwischenzeit habe ich mir einige Male neue KDE-snapshots sowie andere
Sourcen geholt und kompiliert. Wenn ich so KDE nun komplett vom Suse-eigenen
1.0 auf 1.1 oder aktueller umstelle (bzw. einfach reininstalliere mit make
install), was passiert dann mit der RPM-Datenbank?? Dann sind ja dort drin
falsche Informationen und wenn ich mal mit Yast den KDE l�schen wollte, k�me
das nicht gut heraus. Gibt es da irgendeine Patentl�sung oder vielleicht
eine Funktion, um die RPM-Datenbank wieder dem aktuellen System anzupassen??

Danke schon mal

Beat



------------------------------

From: [EMAIL PROTECTED] (David M. Cook)
Date: 11 Jan 99 14:39:43 GMT
Subject: Re: Slow Connectioon

From: [EMAIL PROTECTED] (David M. Cook)
Organization: http://members.home.net/davecook
User-Agent: slrn/0.9.5.3 (UNIX)
Date: Mon, 11 Jan 1999 14:39:43 GMT
X-Complaints-To: [EMAIL PROTECTED]
Nntp-Posting-Date: Mon, 11 Jan 1999 06:39:43 PDT

On Mon, 11 Jan 1999 06:39:01 -0500, GREG C SIMS <[EMAIL PROTECTED]> wrote:

>I just figured out to connect to the Internet with x-ISP.  but my connection
>goes no where.  It's terribly slow. Everything freezes(telnet, netscape,
>lynx , arena, etc.)
>Any ideas on how to fix the speed problem?

Try IRQtune: http://www.best.com/~cae/irqtune/

Dave Cook
 __
| Internet: [EMAIL PROTECTED]
| Fidonet:  David M. Cook 1:143/1111
|
| A service of the San Jose IBM PC Club, running OS/2 Warp 

------------------------------

From: Patrick O'Neil <[EMAIL PROTECTED]>
Subject: small progie compile problem
Date: Mon, 11 Jan 1999 19:34:25 +0000

This is a multi-part message in MIME format.
==============947B0D2680DD354E80DCF0ED
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am a newbie when it comes to compiling simple c code.
I have downloaded several port scanner apps, each in 
c code and I have tried to compile several of them, with
two exceptions, they wont compile.  One such problem app
is reflscan.c, a tcp port scanner.  

As I say, I am a newbie at this - no makefile - so here is
an example of one of my compile tries, with errors:

[patrick@localhost utils]$ gcc -w  reflscan.c -o reflscan
In file included from /usr/include/linux/ip.h:19,
                 from reflscan.c:12:
/usr/include/asm/byteorder.h:22: conflicting types for `ntohl'
/usr/include/netinet/in.h:204: previous declaration of `ntohl'
/usr/include/asm/byteorder.h:24: conflicting types for `htonl'
/usr/include/netinet/in.h:206: previous declaration of `htonl'
In file included from reflscan.c:12:
/usr/include/linux/ip.h:34: parse error before `__u8'
/usr/include/linux/ip.h:37: parse error before `flags'
/usr/include/linux/ip.h:46: parse error before `}'
/usr/include/linux/ip.h:71: parse error before `__u32'
/usr/include/linux/ip.h:76: parse error before `:'
/usr/include/linux/ip.h:88: parse error before `}'
/usr/include/linux/ip.h:92: parse error before `__u8'
/usr/include/linux/ip.h:101: parse error before `tot_len'
/usr/include/linux/ip.h:102: parse error before `id'
/usr/include/linux/ip.h:103: parse error before `frag_off'
/usr/include/linux/ip.h:104: parse error before `ttl'
/usr/include/linux/ip.h:105: parse error before `protocol'
/usr/include/linux/ip.h:106: parse error before `check'
/usr/include/linux/ip.h:107: parse error before `saddr'
/usr/include/linux/ip.h:108: parse error before `daddr'
In file included from reflscan.c:13:
/usr/include/linux/tcp.h:24: parse error before `__u16'
/usr/include/linux/tcp.h:26: parse error before `seq'
/usr/include/linux/tcp.h:27: parse error before `ack_seq'
/usr/include/linux/tcp.h:29: parse error before `res1'
/usr/include/linux/tcp.h:52: parse error before `check'
/usr/include/linux/tcp.h:53: parse error before `urg_ptr'
reflscan.c: In function `dumpsyns':
reflscan.c:142: storage size of `teeseepee' isn't known
reflscan.c:150: field `tcp' has incomplete type
reflscan.c: In function `getdemsyns':
reflscan.c:235: field `ip' has incomplete type
reflscan.c:236: field `tcp' has incomplete type


This app provides a tcp port scan in incomplete format 
to try to avoid being logged. I am not certain if this
might lead to some of the problem or not.  Mostly, I assume
it is a question of editing the c file or using the proper
switches.

Attached is a copy of the code.  

I am running RH 5.2 with the latest updates (which may 
also be a source of the problem?).

Any help or pointers would be appreciated.


-- 
===========================================
"If a man hasn't discovered something that
he will die for, he isn't fit to live."
                  --Martin Luther King, Jr
===========================================

Padraig UiNiall
==============947B0D2680DD354E80DCF0ED
Content-Type: text/plain; charset=us-ascii;
 name="reflscan.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="reflscan.c"

/*
 *   yet another pointless and retarded proggie brought to you by
 *                       reflector
 *   thx to halflife for psuedo header and timer shit from halfscan.c
 */
#include <sys/types.h> 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <signal.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>

#define MAXHOSTNAME   128

int timeout = 0;
int lazy_refl = 0;

unsigned short checkzum(unsigned short *, int);
void dumpsyns(int, unsigned, unsigned, int, unsigned, unsigned, int);
void getdemsyns(unsigned, unsigned, int, int, char *);
void sort_ports(int *, int, FILE *, int);
void alarm_handler(int);
void refl_handler(int);
int compar(const void *, const void *);

main (argc, argv)
int argc;
char *argv[];

{

   int r,e,f,l,dirty_sock;
   pid_t dapid;
   char *filename;
   char *localhost;
   unsigned max_port;
   unsigned dest;
   unsigned source;
   struct hostent *he;
   f=0;
   l=0;
   
   
   /* check usage */
   
   if ((argc < 4) || (argc > 6))
   {
      printf("usage: %s source target max-port-to-scan [-f filename]\n", argv[0]);
      printf("       source must be YOUR ip address as a dotted quad.\n");
      exit(1);
   }

   for (r=0; r < argc; r++)
   {
      if(!strcmp("-f", argv[r]))
      {
         f=1;
         filename = argv[++r];
      }
   }
         
   max_port = atoi(argv[3]);
   if ((max_port < 1) || (max_port > 32767))
   {
      printf("max port to scan should really be between 1 and 32,767.\n");
      exit(1);
   }

   dest = inet_addr(argv[2]);
   if (dest == -1);
   {
      if((he = gethostbyname(argv[2])) == NULL)
      {
         printf("doh.  %s duz not exist.  cunt.\n", argv[2]);
         exit(1);
      }
      bcopy ((char *)he->h_addr,  (char *)&dest, he->h_length);
   }
   

   source = inet_addr(argv[1]);
   if (source == -1)
   {
      printf("check that source address you fucking dork.\n");
      exit(1);
   }


   /* open raw sockets */

   if ((dirty_sock = socket(AF_INET, SOCK_RAW, IPPROTO_TCP)) < 0)
   {
      printf("could not open socket. are you even root, cunt?\n");
      exit(1);

   }
   
   printf("checking out ports 1 thru %d on %s.\n", max_port, argv[2]);

   /* fork - parent sends syns, child listens, rsts half open connections. */

   dapid = fork();
   if (dapid < 0)
   {
      printf("could not fork.\n");
      exit(1);
   }
   if (dapid > 0)
   {
      signal(SIGALRM, alarm_handler);
      sleep(3);
      for (r=1; r <= max_port; r++)
         dumpsyns(r, source, dest, dirty_sock, 0, 0, 0);
      kill(dapid, 10);      
      while (1)
      {
         if (timeout == 1)
         {
            sleep(2);
            exit(1);
         }
      }
   }
   if (dapid == 0)
   {
     getdemsyns(source, dest, dirty_sock, f, filename); 
   }
}

void dumpsyns(int port, unsigned source, unsigned dest, int dirty_sock, unsigned 
seqnum, unsigned acknum, int testrst)
{
   int r,e,f,doh;
   struct sockaddr_in sin;
   struct tcphdr teeseepee;
   struct fux_psuedo_heder
   {
      unsigned source;
      unsigned dest;
      unsigned pad     :  8,
               proto   :  8,
               tcp_len : 16;
      struct tcphdr tcp;
   }psuedo_hed;


   sin.sin_family      = AF_INET;
   sin.sin_port        = htons(port);
   sin.sin_addr.s_addr = dest;
   
   /* fill in tcp header, checking if we want this to be a rst segment. */

   teeseepee.source    = getpid();
   teeseepee.dest      = htons(port);

   /* if this is to be a rst */

   if (testrst == 1)
   {
      teeseepee.seq       = acknum;
      teeseepee.ack_seq   = seqnum + 1;
      teeseepee.rst       = 1;
      teeseepee.syn       = 0;
      teeseepee.ack       = 1;
      teeseepee.window    = 0;
   }

   /* if not */

   if (testrst == 0)
   {
      teeseepee.seq       = getpid() + port;
      teeseepee.ack_seq   = 0;
      teeseepee.rst       = 0;
      teeseepee.syn       = 1;
      teeseepee.ack       = 0;
      teeseepee.window    = htons(512);
   }

   /* these don't care if we are rsting or not */

   teeseepee.doff      = 5;
   teeseepee.res1      = 0;
   teeseepee.res2      = 0;
   teeseepee.urg       = 0;
   teeseepee.psh       = 0;
   teeseepee.fin       = 0;
   teeseepee.check     = 0;
   teeseepee.urg_ptr   = 0;

   /* fill in psuedo-header.  ugh. */

   psuedo_hed.source   = source;
   psuedo_hed.dest     = dest;
   psuedo_hed.pad      = 0;
   psuedo_hed.proto    = 6;
   psuedo_hed.tcp_len  = htons(20);

   bcopy (&teeseepee, (char *)&psuedo_hed.tcp, 20);
   teeseepee.check = checkzum((unsigned short *)&psuedo_hed, 32);

   /* bewm! */

   doh = sendto(dirty_sock, &teeseepee, sizeof(teeseepee), 0, (struct sockaddr *)&sin, 
sizeof(sin));
   if (doh != sizeof(teeseepee))
   {
      printf("error sending syn.\n");
      exit(1);
   }
   
}

void getdemsyns(source, dest, stiff_sock, f, filename)
unsigned source,dest;
int stiff_sock, f;
char *filename;
{
 
   int rst_sock;
   int doh, r, e=0, i=1;
   int array[150];
   FILE *fp;
   struct servent *sp;
   struct sockaddr_in sin, duhsin;
   struct in_addr ina;
   struct in_tcp
   {
      struct iphdr   ip;
      struct tcphdr tcp;
      char dataz[65495];
   }intcp;

   ina.s_addr = dest;

   if (f == 1)
   {
      if ((fp = fopen(filename, "a")) == NULL)
      {
         printf("could not open file, cunt.\n");
         exit(1);
      }
      fprintf(fp, "            --- results for %s ---\n", inet_ntoa(ina));
   }

   duhsin.sin_family      = AF_INET;
   duhsin.sin_port        = htons(getppid());
   duhsin.sin_addr.s_addr = source;
 
   if ((bind(stiff_sock, (struct sockaddr *)&duhsin, sizeof(duhsin))) < 0)
   {
      printf("could not bind socket.\n");
      exit(1);
   }   
 
   sin.sin_family      = AF_INET;
   sin.sin_port        = htons(getppid());
   sin.sin_addr.s_addr = dest;
  
   
   if ((rst_sock = socket(AF_INET, SOCK_RAW, IPPROTO_TCP)) < 0)
   {
      printf("error opening rst_sock.\n");
      exit(1);
   }

   
   signal(SIGUSR1, refl_handler);
   signal(SIGALRM, alarm_handler);
   alarm(30);
   printf("        SYNs received [");
   fflush(stdout);
   while(1)
   {
      if ((timeout == 1) && (lazy_refl == 1))
      {
         printf("]\n");
         sort_ports(array, f, fp, i);
      }
      doh = read(stiff_sock, (char *)&intcp, 65535);  
      if (intcp.tcp.dest == getppid())
      {
         if (intcp.tcp.syn == 1)
         {
            alarm(35);
             
            /* reset connection */

            dumpsyns(intcp.tcp.source, source, dest, rst_sock, intcp.tcp.ack_seq, 
intcp.tcp.ack, 1); 

            /* stuff port in array */

            e = 0;

            for(r=0; r <= i; r++)
            {
               if(ntohs(intcp.tcp.source) == array[r])
                  e = 1;
            }

            if (e == 0)
            {
               printf(".");
               fflush(stdout);
               array[i] = ntohs(intcp.tcp.source); 
               i++;
            }                 
         }             
      }        
   }        
}   

void sort_ports(int *array, int f, FILE *fp, int i)
{
   pid_t pidz;
   int r,e;
   struct servent *sp;
   
   setservent(1);
   pidz = getppid();
   fflush(stdout);
   qsort(array, i, sizeof(array[0]), compar);
   for(e = 1; e < i; e++)
   {
      if ((sp = getservbyport(array[e], "tcp")) == NULL)
      {
         if (f == 1)
            fprintf(fp, "received syn from port %d.\n", array[e]);
         else
            printf("received syn from port %d.\n", array[e]);
      }
      else
      {
         if (f == 1)
            fprintf(fp, "%s found on port %d.\n", sp->s_name, array[e]);
         else
            printf("%s found on port %d.\n", (char *)sp->s_name, array[e]);
      }
      fflush(stdout);
   }
   kill(pidz, 14);
   endservent();
   exit(1);
}

int compar(const void *intone, const void *inttwo)
{
   if (*(int *)intone == *(int *)inttwo)
      return 0;
   if (*(int *)intone < *(int *)inttwo)
      return -1;
   if (*(int *)intone > *(int *)inttwo)
      return 1;
}

void alarm_handler(int s)
{
   alarm(0);
   timeout = 1;
}

void refl_handler(int s)
{
   lazy_refl = 1;
}

/*
 * I didn't steal this from ping.c.  really.  I wrote it.  really.
 */                                                 
unsigned short checkzum(addr, len)
    u_short *addr;
    int len;
{
    register int nleft = len;
    register u_short *w = addr;
    register int sum = 0;
    u_short answer = 0;

    /*
     * Our algorithm is simple, using a 32 bit accumulator (sum), we add
     * sequential 16 bit words to it, and at the end, fold back all the
     * carry bits from the top 16 bits into the lower 16 bits.
     */
    while (nleft > 1)  {
        sum += *w++;
        nleft -= 2;
    }
    /* mop up an odd byte, if necessary */
    if (nleft == 1) {
        *(u_char *)(&answer) = *(u_char *)w ;
        sum += answer;
    }

    /* add back carry outs from top 16 bits to low 16 bits */
    sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
    sum += (sum >> 16);         /* add carry */
    answer = ~sum;              /* truncate to 16 bits */
    return(answer);
}

==============947B0D2680DD354E80DCF0ED==


------------------------------

From: Marco Anglesio <[EMAIL PROTECTED]>
Subject: Re: Linux: Fight for survival or on victory march?
Crossposted-To: alt.linux,alt.os.linux,comp.os.linux.advocacy
Date: Mon, 11 Jan 1999 16:36:14 GMT

In alt.os.linux [EMAIL PROTECTED] wrote:
> there are 300 millions in the US alone who use windows everyday

Proof, once again, that Americans consider Canada the 51st state. 

(The population of the US + the population of Canada are roughly equal to
300 million).

marco

(followups to alt.test)

--
Marco Anglesio                                    Like Captain Idiot 
mpa at the-wire dot com                 in Astounding Science comics
http://www.the-wire.com/~mpa              (The Manchurian Candidate)


------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.misc) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Misc Digest
******************************

Reply via email to