freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: bypassing /etc/freetds.conf or interfaces file
- From: "David Nahman" <vanyadogue AT yahoo.com>
- To: freetds AT franklin.oit.unc.edu
- Subject: Re: bypassing /etc/freetds.conf or interfaces file
- Date: Fri, 14 Dec 2001 13:42:16 -0500
Thanks Brian,
This is exactly the problem. I'll write my own for now.
MIPS is indeed big endian, but the h_addr member of the hostent structure
should be in network byte order, so buf[0], buf[1], buf[2], buf[3] should
work for all platforms.
Thanks for your assistance!
--david
> There was a bug in 0.52 with effects similar to this, hopefully though you
> are using 0.53something?
>
> I no longer have acess to any SGI machines to test this myself.
>
> I suppose you could write your own implementation like such: (ptr refers
> to the in_addr structure in lookup_host())
>
> /* top of func */
> char *tmpbuf;
>
> ...
>
> /* replacing call to inet_ntoa */
> tmpbuf = (char *) ptr->s_addr;
> sprintf(ip, "%d.%d.%d.%d", tmpbuf[3], tmpbuf[2], tmpbuf[1], tmpbuf[0]);
>
> This assumes host order is little endian, mips is big endian no? reverse
> the order of the bytes for that anyway. And finally, this is all off the
> top of my head, so it may not even compile ;-)
>
> I see from a quick google search that using gcc to compile stuff on irix
> will produce problems with the inet_xxxx() functions due to the way
> gcc and irix cc pass small structures. If this is the case, I would not
> be opposed to patching around it specifically. inn appears to have a
> replacement implementation (sendmail among other seems to use it on irix).
>
> Brian
>
> On Thu, 13 Dec 2001, David Nahman wrote:
>
> > Brian,
> >
> > Thanks for your reply. I discovered that it works like you said and my
> > problem lies with inet_ntoa under IRIX.
> >
> > Inet_ntoa is returning 0.0.0.0 for any valid ip address that is retrieved
> > by gethostbyname when compiling under IRIX64. I verified that this works
> > under irix by compiling a sample program outside of freetds, and it works
> > as it is supposed to. Moving that sample code inside of lookup_host and I
> > still get 0.0.0.0 (I've verified the bytes in hostent->host_addr are
> > correct).
> >
> > So, I'm trying to figure out if there is a flag configuration that I need
> > to pass to configure. Right now I'm using: --prefix=<mypath>
> > --disable-shared and
> > --with-tdsver=7.0. I've tried no --host flag, --host=mips-sgi and
> > --host=mips-sgi-irix.
> >
> > Any thoughts that you or others might have would be most appreciated.
> >
> > Thanks!
> > --David
> >
> >
> > > Ok, the non-portable (as in don't expect this to work on OpenClient or
> > > MS's stuff), is:
> > >
> > > Compile FreeTDS with the desired version using the --with-tdsver=x.x
> > > configure flag. I'll assume this is for MS SQL, so let's say it's 7.0
> > > for
> > > arguments sake.
> > >
> > > Now do everything like normal but use the DNS name of the host on which
> > > the database lives as the server name. As long as the SQL Server is
> > > listening on prot 1433, this will work.
> > >
> > > If you are using Sybase or MS SQL is not on 1433 put in a call like
> > > this:
> > >
> > > tds_set_port(con->tds_login, 4000);
> > >
> > > just prior to calling ct_connect() where con is the pointer returned
> > > from
> > > ct_con_alloc() and 4000 is the port number the server is listening at.
> > >
> > > If you also need for some reason to change the TDS protocol version
> > > have a
> > > look at tds_set_version() also in src/tds/login.c and make a similiar
> > > call
> > > to it.
> > >
> > > Changing the port number can also be done at runtime by using the
> > > TDSPORT
> > > environment variable. Legal values are 4.2, 5.0, and 7.0.
> > >
> > > Brian
> > >
> >
> > ---
> > You are currently subscribed to freetds as: [camber AT ais.org]
> > To unsubscribe, forward this message to $subst('Email.Unsub')
> >
-
bypassing /etc/freetds.conf or interfaces file,
David Nahman, 12/11/2001
- <Possible follow-up(s)>
- Re: bypassing /etc/freetds.conf or interfaces file, Mark J. Lilback, 12/11/2001
- Re: bypassing /etc/freetds.conf or interfaces file, Brian Bruns, 12/11/2001
- Re: bypassing /etc/freetds.conf or interfaces file, James Cameron, 12/11/2001
- Re: bypassing /etc/freetds.conf or interfaces file, David Nahman, 12/11/2001
- Re: bypassing /etc/freetds.conf or interfaces file, Brian Bruns, 12/13/2001
- Re: bypassing /etc/freetds.conf or interfaces file, David Nahman, 12/13/2001
- Re: bypassing /etc/freetds.conf or interfaces file, Brian Bruns, 12/14/2001
- Re: bypassing /etc/freetds.conf or interfaces file, David Nahman, 12/14/2001
Archive powered by MHonArc 2.6.24.