Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 1996 12:31:33 -0400
From:      Gary Chrysler <tcg@ime.net>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        FreeBSD-Questions <questions@freebsd.org>
Subject:   Re: Scanning for Interfaces!
Message-ID:  <31EFB865.3E8E@ime.net>
References:  <31EFADF9.7E3E@ime.net> <9607191552.AA13575@halloran-eldar.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> 
> <<On Fri, 19 Jul 1996 11:47:05 -0400, Gary Chrysler <tcg@ime.net> said:
> 
> > Problem one:
> >       socket(AF_IPX, SOCK_xxxx, PF_IPX)
> > Fails with: Protocol not supported! (xxxx = DGRAM or others)
> > So I look elsewhere for uses of 'socket', I of course found many
> > and noticed that few use the third param. (protocol)
> 
> > Is there something else thats missing??
> 
> > My fix was: (Right or wrong, I don't know)
> >       socket(AF_IPX, SOCK_xxxx, 0)
> 
> Almost.  It should be:
> 
>         socket(PF_IPX, SOCK_whatever, protocol_or_zero);
> 
> where protocol_or_zero could be either zero (use the default), or a
> specification of a particular protocol (like IPXPROTO_SPX).  Most of
> the time there is no reason to specify the protocol, but it is
> necessary if you are using SOCK_RAW sockets.
> 

Geez, thats was quick! I guess my mention of my hour long redundant
loops me->questions->me must of improved something..
Right on to whomever!
And Garret was ready on the keys.. 
Thanks Garret!

Enough jobs well done and on with it.
(You'all know you do a good job.
 If ya don't tell me, I'll tell ya! :)

Ok, So I was basically right, Maybe not properly right, But it
should work as Zero as I changed it to.

Thanks.

> > Scanning for interfaces fails! It seems the index of the interface
> > structures/tables is off, It lists the first one sorta right, And
> > the rest keep getting further and further off.
> > (The first one works except for the address translation, I can fix)
> > I have compared the structures they match pretty close! I see nothing
> > that should cause this! the sizes are all determind via sizeof()
> > anyways.
> 
> No, this sizes are /not/ determined by the sizeof operator, that is
> your problem.  The sizes are determined by the sa_len element of the
> sockaddr structure.
> 

Ok, At least I have someplace to look. :)
Maybe I'm in way to deep over my head, Actually I know I am!
But how else does one rectify this without trying. :)

My mind won't let me give up now though! I've GOT to get it
working or I'll never be able to live with myself!

This is the revelant loop. (I didn't write it!)
	<chomp>

	itf_info.ifc_len=sizeof(itf_table);
	itf_info.ifc_buf=(char*)itf_table;

	bytes_left=itf_info.ifc_len;
	for(ifr=itf_info.ifc_req;
		bytes_left>=sizeof(*ifr);ifr++,bytes_left-=sizeof(*ifr))
	{

	<chomp>

kinda worthless without supporting code though.

Thanks Garret I appreciate your assistance!

-Enjoy
Gary
~~~~~~~~~~~~~~~~
Improve America's Knowledge... Share yours
The Borg... Where minds meet
(207) 929-3848



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31EFB865.3E8E>