Jellyfish shots from USENIX up

2002-06-14 Thread Matthew Dillon

I lazed out for Friday's sessions but I vowed to get a few good
shots of the Monterey Bay Aquarium and after many shots and lots
of post production I managed to salvage two (low light shots of
transparent marine animals for which the autofocus does not work
are difficult!).

It's up at:

http://apollo.backplane.com/USENIX2002/FriB/

-Matt
Matthew Dillon 
<[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: gif(4) tunnel through MSN DSL modem

2002-06-14 Thread Casey T. Zednick

> Do you mean the NAT that the modem is doing?  If so, that's a problem.  I'm
> using an Arescom NetDSL 800 series modem, which comes "pre-configured per
> stringent specifications from MSN."  And (as far as I know--and I've
> looked) there is no way for me to do any kind of configuration on it at
> all.  If that weren't the case, I'd just put the thing in bridge mode and
> have done with it.
>

  I have an MSN/Arescom setup too.  It is using NAT: the gateway is 
192.168.1.1 and the client is 192.168.1.2.  However I read on the net that it 
is setup to portforward everythig from the gateway to the 192.168.1.2 
address.  I belive this to be true as I'm getting MS SQL and IIS hacks 
hitting my firewall.

  I guess it is time to hack their "stringent" pre-config ;-)


-Casey


-- 
This E-mail message was created with Open Source Software.
Using: 
FreeBSD, http://www.freebsd.org
KDE's KMail, http://www.kde.org 
Vist these sites and support O.S.S.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Is CDIOCCAPABILITY appropraite for ATAPI devices?

2002-06-14 Thread Brian Reichert

Is CDIOCCAPABILITY appropriate for ATAPI devices?

The man page for cd(4) describes "ioctl(2) calls which apply to
SCSI CD-ROM drives", some of which can also apply to APAPI CD-ROM
drives.

I've tried to use CDIOCCAPABILITY on my ATAPI DVD drive, but I can't
tell if the error I get:

  "CDIOCCAPABILITY: Inappropriate ioctl for device"

due to my wonky hardware, or me making a bad guess about it's
applicability...

Oh, and this is for 4.5-RELEASE...

-- 
Brian 'you Bastard' Reichert<[EMAIL PROTECTED]>
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA Intel architecture: the left-hand path

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Cyrille Lefevre

On Fri, Jun 14, 2002 at 07:06:06AM +, echo dev wrote:
> I am pooling in as many different ways of sorting data in C i can anyone 
> have a fav??? If anyone can give me some ideas on the best way to sort data 
> in C would be helpful.. Thanks

is that references helping you ?

qsort(3), bsearch(3), hsearch(3), lsearch(3), db(3).

Cyrille.
-- 
Cyrille Lefevre mailto:[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Brian T . Schellenberger

On Friday 14 June 2002 06:36 pm, Nicolas Rachinsky wrote:
| * Dan Arlow <[EMAIL PROTECTED]> [2002-06-14 14:40 -0400]:
| > dumb question: extra "&" in the previous post?
| >
| > why do both this
| >
| > > qsort(&array, NUM_INTS, sizeof(*array),
| > > (int (*)(const void *, const void *)) comp);
| >
| > and this
| >   qsort(array, NUM_INTS, sizeof(*array),
| >   (int (*)(const void *, const void *)) comp);
| >
| > work properly? I tried both and both compile/run/sort fine.
| >
| > (the difference afaik is that the first passes an *int[] aka int** and
| > the second passes an int[] aka int*)
|
| No, see http://www.eskimo.com/~scs/C-faq/q6.12.html

I think that probably doesn't clarify much.  (Indeed, in this case, it would 
seem to obfuscate the above question more than clarify since the question is 
"why are they the same" and the FAQ question is meant to explain why these 
two are *different* to somebody who expects them to be the *same.*)


It's because an array *is* a pointer to the first element, and &array is a 
pointer to the array, but the first element has the same address as the 
array, since the address of the array is the address of the first element.  
Thus, the code works as long as the compiler will accept it.

If qsort had a "typed" first element, then you'd get an error message from 
one or the other of them (though it would probably work), but as it happens, 
qsort declares the type to be void *, so it will take *any* pointer type. 
Thus, no complaint from the compiler.

|
| Nicolas
|
| To Unsubscribe: send mail to [EMAIL PROTECTED]
| with "unsubscribe freebsd-hackers" in the body of the message

-- 
Brian T. Schellenberger . . . . . . .   [EMAIL PROTECTED] (work)
Brian, the man from Babble-On . . . .   [EMAIL PROTECTED] (personal)
http://www.babbleon.org

http://www.eff.org  http://www.programming-freedom.org 

If you smell the smoke you don't need to be told what you've got to do;
Yet there's a certain breed, so very in-between, they'd rather take a
vote.   -- DEVO  --  Here To Go

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Nicolas Rachinsky

* Dan Arlow <[EMAIL PROTECTED]> [2002-06-14 14:40 -0400]:
> dumb question: extra "&" in the previous post?
> 
> why do both this
> > qsort(&array, NUM_INTS, sizeof(*array),
> > (int (*)(const void *, const void *)) comp);
> and this
>   qsort(array, NUM_INTS, sizeof(*array),
>   (int (*)(const void *, const void *)) comp);
> 
> work properly? I tried both and both compile/run/sort fine.
> 
> (the difference afaik is that the first passes an *int[] aka int** and the
> second passes an int[] aka int*)

No, see http://www.eskimo.com/~scs/C-faq/q6.12.html

Nicolas

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: gif(4) tunnel through MSN DSL modem

2002-06-14 Thread John Nielsen

- Original Message -
From: "Nielsen" <[EMAIL PROTECTED]>
To: "John Nielsen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 1:31 AM
Subject: Re: gif(4) tunnel through MSN DSL modem


> I have this working fine. On the BSD machine behind NAT the tunnel looks
> like it's between a 192.168.x.x IP and the public IP of the machine across
> the internet. On the remote machine it looks like a normal tunnel between
> the two IPs. NAT takes care of the translation on the tunnel packets.

That's good news!  However, I'm not sure I can do the same in this case.

> I've used gif tunnels, vtund, and even IPSEC in this configuration just
> fine. Of course holes have to punched in NAT (bimap, port mapping or
> whatever it's called on your DSL). That's for reliability and so that the
> tunnel can be "initiated" from either end.

Do you mean the NAT that the modem is doing?  If so, that's a problem.  I'm
using an Arescom NetDSL 800 series modem, which comes "pre-configured per
stringent specifications from MSN."  And (as far as I know--and I've looked)
there is no way for me to do any kind of configuration on it at all.  If
that weren't the case, I'd just put the thing in bridge mode and have done
with it.

If it were up to me, I'd switch to a sane ISP--but it's not up to me in this
case.  If I've misunderstood and you think this will work without being able
to reconfigure the modem at all, then by all means please provide some more
detail. :)

JN

> - Original Message -
> From: "John Nielsen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 11, 2002 13:20
> Subject: gif(4) tunnel through MSN DSL modem
>
>
> > Hi folks,
> >
> > I tried this on -questions without any luck, so I'm hoping for a better
> > response here . :)
> >
> > I remotely administer a FreeBSD 4.5 machine that is connected to the
> > internet through and MSN DSL modem.  This modem does NAT (for a single
> > client) rather than bridging the connection.  So the FreeBSD machine
> thinks
> > its public address is 192.168.1.2 (when in reality the modem is the only
> > device with a public address).  This machine is itself doing NAT, acting
> as
> > a firewall and gateway for a private network.
> >
> > I would like to establish a gif(4) tunnel between this machine and my
> > firewall here in order to link the two private networks into one virtual
> > network.  I have done this before with two machines that were directly
> > connected to the internet, but in this case the DSL modem on the far end
> > seems to be fouling things up.  The modem seems to be passing everything
> > through, but I haven't gotten gif to work.
> >
> > Any ideas?  Here's what I've tried--this is how I'd set it up if the DSL
> > modem weren't in the way.
> >
> > [excerpts from rc.conf on far (DSL) end]
> > # Private interface
> > ifconfig_xl0="inet 192.168.6.1 netmask 255.255.255.0"
> > # "Public" interface -- 192.168.1.2 netmask 255.255.255.252"
> > ifconfig_ed0="DHCP"
> > gif_interfaces="gif0"
> > gifconfig_gif0="DSL.public.ip myend.public.ip"
> > ifconfig_gif0="192.168.6.1 192.168.0.1"
> > static_routes="john"
> > route_john="-net 192.168.0 -interface gif0"
> >
> > [excerpts from rc.conf on this {my) end]
> > # Private interface
> > ifconfig_ep0="inet 192.168.0.1 netmask 255.255.255.0"
> > # Public interface
> > ifconfig_ed0="DHCP"
> > gif_interfaces="gif0"
> > gifconfig_gif0="myend.public.ip DSL.public.ip"
> > ifconfig_gif0="192.168.0.1 192.168.6.1"
> > static_routes="DSL"
> > route_DSL="-net 192.168.6 -interface gif0"
> >
> > I've tried both the modem's (real) public address and 192.168.1.1 (the
> > public interface's address) for DSL.public.ip, but neither seems to
work.
> > Can this be made to work?  Can gif be hacked so it will work?
> >
> > I can't justify switching to a more expensive provider just so this
tunnel
> > will work, since it will mostly be a convenience for me and not the
> client.
> > As far as I know, there's no way to modify any settings on the DSL modem
> > itself.  I do have full access to both FreeBSD machines.  Again, any
> > suggestions or even a detailed description of why this won't work would
be
> > appreciated.
> >
> > Thanks,
> >
> > JN
> >
> >
> >
> > To Unsubscribe: send mail to [EMAIL PROTECTED]
> > with "unsubscribe freebsd-hackers" in the body of the message
> >
>
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Dan Arlow

dumb question: extra "&" in the previous post?

why do both this
> qsort(&array, NUM_INTS, sizeof(*array),
> (int (*)(const void *, const void *)) comp);
and this
  qsort(array, NUM_INTS, sizeof(*array),
  (int (*)(const void *, const void *)) comp);

work properly? I tried both and both compile/run/sort fine.

(the difference afaik is that the first passes an *int[] aka int** and the
second passes an int[] aka int*)

-dan (noob)


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: locore.s quiestion

2002-06-14 Thread tony

[EMAIL PROTECTED] wrote:
> 
> Oh, got it.
> That's because of paging is set up.
> Thanks Tony !

:-)

> p.s. btw, btext executes in protected mode, not in real.

Ooops, yes I got distracted.  I intended to say something about this kind of 
strange code being commonly used when switching from real to protected mode.

> since the link is up now, you can refer to the article ,
> that is described well there.

Regards,
Tony


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread khromy

On Fri, Jun 14, 2002 at 07:06:06AM +, echo dev wrote:
> I am pooling in as many different ways of sorting data in C i can anyone 
> have a fav??? If anyone can give me some ideas on the best way to sort data 
> in C would be helpful.. Thanks

Below is an example of how to use qsort.  Hope it helps.

/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

#include 
#include 
#include 

#define NUM_INTS 15

void print_array(int *array)
{
int i;
for (i = 0; i < NUM_INTS; i++) {
printf("%d ", array[i]);
}
putc('\n', stdout);
}

int comp(int *a, int *b)
{
return (*a - *b);
}

void gen_rand(int *array)
{
int i;
srand(time(NULL));

for (i = 0; i < NUM_INTS; i++) {
array[i] = rand() % 99;
}
}

int main(void)
{
int array[NUM_INTS];

gen_rand(array);

print_array(array);
qsort(&array, NUM_INTS, sizeof(*array),
(int (*)(const void *, const void *)) comp);
print_array(array);
putc('\n', stdout);

return 0;
}

-- 
L1: khromy  ;khromy(at)lnuxlab.ath.cx

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: locore.s quiestion

2002-06-14 Thread Sergey Lyubka


Oh, got it.
That's because of paging is set up.
Thanks Tony !

-sergey

p.s. btw, btext executes in protected mode, not in real.
since the link is up now, you can refer to the article ,
that is described well there.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: locore.s quiestion

2002-06-14 Thread Sergey Lyubka

> >From my own notes:   
>   
>   The address of the "begin" symbol is pushed onto the stack, 
>   and the btext() function returns ...not to its caller, but to   
>   the begin() funcion, in the relocated address space.
>   
> This is one of those "You are not expected to understand this"
> things.  Probably, you would benefit from reading:
> Protected Mode Software Architecture  
> Tom Shanley   


I understand this well, Terry, but thanks, anyway.
My question was - why the jump is done, I see no need to
do that. When the loader calls btext, it is at high va already.


Sorry about the link, it is broken now,
so please ignore it.

Regards,
-sergey

P.S. Terry, push/ret sequence has nothing with protected mode.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Alex Belits

On Fri, 14 Jun 2002, David Schultz wrote:

> Thus spake echo dev <[EMAIL PROTECTED]>:
> > I am pooling in as many different ways of sorting data in C i can anyone
> > have a fav??? If anyone can give me some ideas on the best way to sort data
> > in C would be helpful.. Thanks
>
> I've always been partial to bogosort.

  Hey, don't be _that_ mean to a poor Hotmail user -- maybe he got that
address before W2K, layers of Local Director and Passport.

  OTOH, asking things like that here still deserves some mockery...

-- 
Alex


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: locore.s quiestion

2002-06-14 Thread tony

[EMAIL PROTECTED] wrote:
> Hello,

Hi

> I am writing an article about FreeBSD's startup
> and kernel init
> (it is at http://oasis.uptsoft.com/~devnull/dh/boot.html
> for whom it may be interesting)

I get a "no route to host" error.

> I am stucked at two lines in locore.s (IA 32 arch)
> 
> /usr/src/sys/i386/i386/locore.s:
> 
>   pushl   $begin  /* jump to high virtualized address */
>   ret
> 
> /* now running relocated at KERNBASE where the system is linked to run */
> begin:
>   /* set up bootstrap stack */
> 
> My question is:
> why this is done. My understanding was that the loader
> loaded the kernel at high virtual address already,
> so there's no need to jump.

It does exactly what it says on the tin.  (To quote a long running UK tv advert 
series.)

This code runs in real mode.  The code prior to this detects the cpu type, 
etc... then sets up the virtual/paged memory mapping tables, then immediately 
prior to the code you quote is this bit:

/* Now enable paging */
movlR(IdlePTD), %eax
movl%eax,%cr3   /* load ptd addr into mmu */
movl%cr0,%eax   /* get control word */
orl $CR0_PE|CR0_PG,%eax /* enable paging */
movl%eax,%cr0   /* and let's page NOW! */

Which enables paged memory mode in the processor control register.
However to actually start using paged memory Intel's CPU documentation requires 
a flush and reload of the instruction stream.  The pushl & ret are a convenient 
way to do this, possibly recommended by Intel - I don't have the relevant 
documentation to hand.

The result is that the instruction after 'begin:' is the first to be executed 
in paged mode.

Cheers,
Tony


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: locore.s quiestion

2002-06-14 Thread Terry Lambert

Sergey Lyubka wrote:
> Hello,
> I am writing an article about FreeBSD's startup
> and kernel init
> (it is at http://oasis.uptsoft.com/~devnull/dh/boot.html
> for whom it may be interesting)

This link is broken.


> I am stucked at two lines in locore.s (IA 32 arch)
> 
> /usr/src/sys/i386/i386/locore.s:
> 
> pushl   $begin  /* jump to high virtualized address 
>*/
> ret
> 
> /* now running relocated at KERNBASE where the system is linked to run */
> begin:
> /* set up bootstrap stack */
> 
> My question is:
> why this is done. My understanding was that the loader
> loaded the kernel at high virtual address already,
> so there's no need to jump.

>From my own notes:

The address of the "begin" symbol is pushed onto the stack,
and the btext() function returns ...not to its caller, but to
the begin() funcion, in the relocated address space.

This is one of those "You are not expected to understand this"
things.  Probably, you would benefit from reading:

Protected Mode Software Architecture
Tom Shanley
Mindshare, Inc.
Addison-Wesley Publishing Company
ISBN 0-201-5447-X

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread David Schultz

Thus spake echo dev <[EMAIL PROTECTED]>:
> I am pooling in as many different ways of sorting data in C i can anyone 
> have a fav??? If anyone can give me some ideas on the best way to sort data 
> in C would be helpful.. Thanks

I've always been partial to bogosort.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



locore.s quiestion

2002-06-14 Thread Sergey Lyubka

Hello,
I am writing an article about FreeBSD's startup
and kernel init
(it is at http://oasis.uptsoft.com/~devnull/dh/boot.html
for whom it may be interesting)
I am stucked at two lines in locore.s (IA 32 arch)

/usr/src/sys/i386/i386/locore.s:

pushl   $begin  /* jump to high virtualized address */
ret

/* now running relocated at KERNBASE where the system is linked to run */
begin:
/* set up bootstrap stack */

My question is:
why this is done. My understanding was that the loader
loaded the kernel at high virtual address already,
so there's no need to jump.

Thanks,
-sergey

-- 
Sergey Lyubka
Asita Technologies Int, Galway, Ireland

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sorting in C

2002-06-14 Thread Terry Lambert

echo dev wrote:
> I am pooling in as many different ways of sorting data in C i can anyone
> have a fav??? If anyone can give me some ideas on the best way to sort data
> in C would be helpful.. Thanks

The Art Of Computer Programming
Volume 3: Sorting and Searching
Donald Knuth
Addison-Wesley
ISBN: 0-201-03803-X

Knuth's books: Collect them all!  Be the first on your block!

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: gif(4) tunnel through MSN DSL modem

2002-06-14 Thread Nielsen

I have this working fine. On the BSD machine behind NAT the tunnel looks
like it's between a 192.168.x.x IP and the public IP of the machine across
the internet. On the remote machine it looks like a normal tunnel between
the two IPs. NAT takes care of the translation on the tunnel packets.

I've used gif tunnels, vtund, and even IPSEC in this configuration just
fine. Of course holes have to punched in NAT (bimap, port mapping or
whatever it's called on your DSL). That's for reliability and so that the
tunnel can be "initiated" from either end.

Nate

- Original Message -
From: "John Nielsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 13:20
Subject: gif(4) tunnel through MSN DSL modem


> Hi folks,
>
> I tried this on -questions without any luck, so I'm hoping for a better
> response here . :)
>
> I remotely administer a FreeBSD 4.5 machine that is connected to the
> internet through and MSN DSL modem.  This modem does NAT (for a single
> client) rather than bridging the connection.  So the FreeBSD machine
thinks
> its public address is 192.168.1.2 (when in reality the modem is the only
> device with a public address).  This machine is itself doing NAT, acting
as
> a firewall and gateway for a private network.
>
> I would like to establish a gif(4) tunnel between this machine and my
> firewall here in order to link the two private networks into one virtual
> network.  I have done this before with two machines that were directly
> connected to the internet, but in this case the DSL modem on the far end
> seems to be fouling things up.  The modem seems to be passing everything
> through, but I haven't gotten gif to work.
>
> Any ideas?  Here's what I've tried--this is how I'd set it up if the DSL
> modem weren't in the way.
>
> [excerpts from rc.conf on far (DSL) end]
> # Private interface
> ifconfig_xl0="inet 192.168.6.1 netmask 255.255.255.0"
> # "Public" interface -- 192.168.1.2 netmask 255.255.255.252"
> ifconfig_ed0="DHCP"
> gif_interfaces="gif0"
> gifconfig_gif0="DSL.public.ip myend.public.ip"
> ifconfig_gif0="192.168.6.1 192.168.0.1"
> static_routes="john"
> route_john="-net 192.168.0 -interface gif0"
>
> [excerpts from rc.conf on this {my) end]
> # Private interface
> ifconfig_ep0="inet 192.168.0.1 netmask 255.255.255.0"
> # Public interface
> ifconfig_ed0="DHCP"
> gif_interfaces="gif0"
> gifconfig_gif0="myend.public.ip DSL.public.ip"
> ifconfig_gif0="192.168.0.1 192.168.6.1"
> static_routes="DSL"
> route_DSL="-net 192.168.6 -interface gif0"
>
> I've tried both the modem's (real) public address and 192.168.1.1 (the
> public interface's address) for DSL.public.ip, but neither seems to work.
> Can this be made to work?  Can gif be hacked so it will work?
>
> I can't justify switching to a more expensive provider just so this tunnel
> will work, since it will mostly be a convenience for me and not the
client.
> As far as I know, there's no way to modify any settings on the DSL modem
> itself.  I do have full access to both FreeBSD machines.  Again, any
> suggestions or even a detailed description of why this won't work would be
> appreciated.
>
> Thanks,
>
> JN
>
>
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message