|
|
The resolver(3N) library routines in UnixWare 7 are based on the BIND 4.9.4 PATCH 1 distribution, and are closer to the SCO OpenServer implementation (which was based on 4.9.2) than to SCO UnixWare 2.1.X implementation (based on an even earlier version).
For SCO OpenServer applications there are no compatibility impacts beyond the relocation of the routines from libsocket to the libresolv library, which is a concern for source code compilation on UnixWare 7 only.
SCO UnixWare 2.1.X binaries should run without problems on UnixWare 7, as the kernel and libraries make the necessary adjustments in calling parameters, data structures, and return values.
SCO UnixWare 2.1.X source code must be changed to use the UnixWare 7 resolver interface in order to compile with the UnixWare and OpenServer Development Kit. This interface is contained in /usr/lib/libresolv.so.2. Source code changes necessary are summarized in the notes to the compatibility table, below.
Applications compiled using the UnixWare and OpenServer Development Kit can use these routines on any SCO OpenServer or UnixWare system (with the appropriate Binary Compatibility Module installed), with the exception of res_search and res_query, which are not supported on SCO UnixWare 2.1.X.
There are differences in resolver options and the _res data structure that holds them that span the use of most of these routines. These impact source compatibility for SCO UnixWare 2.1.X and SCO OpenServer Release 5.0.2 applications being recoded to use the UnixWare 7 API.
For a SCO UnixWare 2.1.X application to be brought forward to use the UnixWare resolver interface, changes need to be made to use of the _res structure in the application source code. Note that most source code does not reference this structure.
This is the _res structure on SCO UnixWare 2.1.X:
int retrans; /* retransmition time interval */ int retry; /* number of times to retransmit */ long options; /* option flags - see below. */ int nscount; /* number of name servers */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */ u_short id; /* current packet id */ char defdname[MAXDNAME]; /* default domain */ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ int ascount; /* number of addresses */ struct in_addr sort_list[MAXADDR]; /* address sorting list */
This is the _res structure on SCO OpenServer Release 5.0.4:
int retrans; /* retransmition time interval */ int retry; /* number of times to retransmit */ u_long options; /* option flags - see below. */ int nscount; /* number of name servers */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */ u_short id; /* current packet id */ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ char defdname[MAXDNAME]; /* default domain */ u_long pfcode; /* RES_PRF_ flags - see below. */ unsigned ndots:4; /* threshold for initial abs. query */ unsigned nsort:4; /* number of elements in sort_list[] */ char unused[3]; struct { struct in_addr addr; u_int32_t mask; } sort_list[MAXRESOLVSORT]; char pad[72]; /* On an i38this means 512b total. */
This is the _res structure on SCO OpenServer Release 5.0.2:
int retrans; /* retransmition time interval */ int retry; /* number of times to retransmit */ long options; /* option flags - see below. */ int nscount; /* number of name servers */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */ u_short id; /* current packet id */ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ char defdname[MAXDNAME]; /* default domain */ long pfcode; /* RES_PRF_ flags - see below. */ u_int ndots:4; /* threshold for initial abs. query */ u_int nsort:4; /* number of elements in sort_list[] */ char unused[3]; char dborder[_RES_MAXDBSLOTS]; /* Database search order */ char unused2[1]; /* pad */ struct { struct in_addr addr; u_int32_t mask; } sort_list[MAXRESOLVSORT];
The _res structure holds resolver options in the
options
element.
UnixWare 7 provides additional means of specifying resolver options
over those provided by SCO UnixWare 2.1.X and SCO OpenServer Release 5.0.2, specifically, the
options keyword in resolv.conf and the
RES_OPTIONS environment variable.
Both of these are explained on
resolv.conf(4tcp).
These are also present in SCO OpenServer Release 5.0.4.
The options supported on the various systems are shown in the following table:
UnixWare 7 resolver option | SCO OpenServer support? | SCO UnixWare 2.1.X support? | Explanation |
---|---|---|---|
RES_INIT | Yes | Yes | address initialized |
RES_DEBUG | Yes | Yes | print debug messages |
RES_AAONLY | Yes | Yes | authoritative answers only |
RES_USEVC | Yes | Yes | use virtual circuit |
RES_PRIMARY | Yes | Yes | query primary server only |
RES_IGNTC | Yes | Yes | ignore truncation errors |
RES_RECURSE | Yes | Yes | recursion desired |
RES_DEFNAMES | Yes | Yes | use default domain name |
RES_STAYOPEN | Yes | Yes | Keep TCP socket open |
RES_DNSRCH | Yes | Yes | search up local domain tree |
RES_INSECURE1 | No | No | type 1 security disabled |
RES_INSECURE2 | No | No | type 2 security disabled |
RES_NOALIASES | No | No | shuts off HOSTALIASES feature |
RES_USE_INET6 | No | No | use/map IPv6 addressing in gethostbyname(3N) |
On all systems, the default options are RES_RECURSE, RES_DEFNAMES, and RES_DNSRCH.
Name of Interface | Legacy compatibility | UDK compatibility | |||||
---|---|---|---|---|---|---|---|
Compiled using SCO OpenServer DevSys | Compiled using SCO UnixWare 2.1.X SDK | Compiled using UnixWare 7 UDK | |||||
Library Name | Works on UnixWare 7? | Library Name | Works on UnixWare 7? | Library Name | Works on SCO OpenServer? | Works on SCO UnixWare 2.1.X? | |
dn_comp | libsocket | Yes | libresolv | Yes | libresolv | Yes | Yes |
dn_expand | libsocket | Yes | libresolv | Yes | libresolv | Yes | Yes |
res_init | libsocket | Yes | libresolv | Yes | libresolv | Yes | Yes |
res_mkquery | libsocket | Yes | libresolv | Yes | libresolv | Yes | Yes; notes. |
res_query | libsocket | Yes | -- | -- | libresolv | Yes | -- |
res_search | libsocket | Yes | -- | -- | libresolv | Yes | -- |
res_send | libsocket | Yes | libresolv | Yes | libresolv | Yes | Yes |
The res_mkquery routine's newrr argument is declared a const char on SCO OpenServer and a struct rrec on SCO UnixWare 2.1.X (see arpa/nameser.h). This should not impact compatibility since a conforming program does not use this argument on either system.