From owner-freebsd-questions Fri Jul 19 09:31:21 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA06446 for questions-outgoing; Fri, 19 Jul 1996 09:31:21 -0700 (PDT) Received: from ime.net (root@ime.net [204.97.248.4]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA06439 for ; Fri, 19 Jul 1996 09:31:14 -0700 (PDT) Received: from kimiko.tcguy.net (buxton-7.ime.net [206.231.148.136]) by ime.net (8.7.4/8.6.12) with SMTP id MAA02156; Fri, 19 Jul 1996 12:30:56 -0400 (EDT) Message-ID: <31EFB865.3E8E@ime.net> Date: Fri, 19 Jul 1996 12:31:33 -0400 From: Gary Chrysler Reply-To: tcg@ime.net Organization: The Computer Guy X-Mailer: Mozilla 3.0b4Gold (Win95; I) MIME-Version: 1.0 To: Garrett Wollman CC: FreeBSD-Questions Subject: Re: Scanning for Interfaces! References: <31EFADF9.7E3E@ime.net> <9607191552.AA13575@halloran-eldar.lcs.mit.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Garrett Wollman wrote: > > < 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!) 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)) { 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