diff options
author | Aaron M. Ucko <ucko@debian.org> | 2012-06-20 21:37:53 -0400 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2012-06-20 21:37:53 -0400 |
commit | be323245ea77f0e457e3d42c83b58a82f67ca0f2 (patch) | |
tree | 672568f630eaeb56248abfc45e471c0f894dc5ad /network | |
parent | 76eb365b53286f69a92cbbcc3007833b7ea05cfa (diff) |
Imported Upstream version 6.1.20120620
Diffstat (limited to 'network')
-rw-r--r-- | network/apple/README | 14 | ||||
-rw-r--r-- | network/encrypt/README | 141 | ||||
-rw-r--r-- | network/entrez/client/netlib.c | 20 | ||||
-rw-r--r-- | network/id1arch/idfetch.c | 29 | ||||
-rw-r--r-- | network/medarch/client/medutil.c | 45 | ||||
-rw-r--r-- | network/netmanag/README | 9 | ||||
-rw-r--r-- | network/nsclilib/ncbinet.h | 80 | ||||
-rw-r--r-- | network/nsclilib/ni_defin.h | 413 | ||||
-rw-r--r-- | network/nsclilib/ni_error.c | 16 | ||||
-rw-r--r-- | network/nsclilib/ni_error.h | 25 | ||||
-rw-r--r-- | network/nsclilib/ni_lib.h | 79 | ||||
-rw-r--r-- | network/nsclilib/ni_lib_.h | 19 | ||||
-rw-r--r-- | network/nsclilib/ni_macdv.c | 434 | ||||
-rw-r--r-- | network/nsclilib/ni_net.h | 222 | ||||
-rw-r--r-- | network/nsclilib/ni_service.c | 88 | ||||
-rw-r--r-- | network/nsclilib/ni_types.h | 175 | ||||
-rw-r--r-- | network/pcnfs/README | 21 | ||||
-rw-r--r-- | network/socks/socks.cstc.4.2.pre1.tar.Z | bin | 427552 -> 0 bytes | |||
-rw-r--r-- | network/wwwblast/Src/wwwblast.c | 9 |
19 files changed, 121 insertions, 1718 deletions
diff --git a/network/apple/README b/network/apple/README deleted file mode 100644 index 3da81ec3..00000000 --- a/network/apple/README +++ /dev/null @@ -1,14 +0,0 @@ -In order to use the NCBI-modified NCSA socket library, and NCBI network -services on a Macintosh, it is necessary to obtain the following files -from the MacTCP developer disk, and place them within this "apple" -directory. - -dnr.c -AddressXlation.h -GetMyIPAddr.h -MacTCPCommonTypes.h -TCPPB.h -UDPPB.h - -These files are copyrighted by Apple, so it is not possible for NCBI -to distribute them in its software tree. diff --git a/network/encrypt/README b/network/encrypt/README deleted file mode 100644 index 87aec8e6..00000000 --- a/network/encrypt/README +++ /dev/null @@ -1,141 +0,0 @@ -This is the NCBI README file which provides instructions for how to setup -the RIPEM/RSAREF software to be compiled in conjunction with the NCBI toolkit. -Adding RIPEM/RSAREF to the toolkit adds the capability to produce -client/server software which communicates using DES encryption with other -clients and servers in the NCBI Dispatcher system, a.k.a. NCBI Network -Services. - -The NCBI Network Services software uses the following scheme for key -distribution, using a single RSA public-key/private-key pair, where the -private-key is only known to the Dispatcher. - -(1) When connecting to the Dispatcher, a client includes the public key which - it knows, if any, within its login message. - -(2) When the Dispatcher responds to the login message, it includes the - latest public key. If there is a key mismatch, the client software is - designed to give the user the option of either accepting the new key - or aborting the program. The latter option is necessary because there - is a slight risk that the key is being presented by a hostile party - which is masquerading as the Dispatcher. - -(3) When the client issues a service request, it generates a pseudo-random - DES key which it then encrypts using the public RSA key. The Dispatcher - decrypts the DES key and passes it in a secure manner to the server - daemon for the requested service. The server manager (ncbid) in turn - spawns the real server for that service and informs it of the DES key. - The subsequent client/server communication takes place using cipher- - block-chained DES encryption using the agreed-upon DES key. - - Note that each client<->server session uses a different DES key. - - -To obtain the RIPEM/RSAREF software to include in your application, you -must follow the procedure described at the end of this document. Note that: - (1) The NCBI Network Services software has been tested with the source - code from RIPEM 1.1 and RIPEM 1.2, although the latter is recommended. - (2) The RIPEM source archive is posted on its FTP server in UNIX compressed - tar format. Tools are generally available to uncompress and untar - this type of archive for different platforms. - (3) After uncompressing the archive, you must copy the tar file to - this directory (network/encrypt) and extract the desired components - into this directory. - You may either extract the entire archive for reference: - tar xf ripem-1.2.tar - or extract only the portion you need, to save local disk space: - tar xf ripem-1.2.tar ripem/rsaref/source - (4) It may be necessary to manually modify the resulting global.h file - for compatibility with your hardware/software platform - (5) The RSAREF source code is compiled as part of the "LIB15" library. - See make/makenet.* for details. - - -DISCLAIMER: - You must follow all licensing and export regulations described in - the RIPEM/RSAREF documentation. Note that NCBI can detect the use of - a client which is using encryption to communicate with Dispatcher. - Note that NCBI may need to cooperate with U.S. authorities if it - appears that U.S. export regulations have been violated. - - -Please direct any questions to toolbox@ncbi.nlm.nih.gov. - -The following information is what is required for U.S. and Canadian -citizens to obtain the RIPEM cryptographic software. Many thanks to Mark -Riordan and RSA Laboratories for making this software available to NCBI -and American and Canadian scientists who wish to encrypt their data. - --------------------------- begin included message --------------------------- - -Dear FTP user, - -To access the RIPEM cryptographic software archive at ripem.msu.edu, -you must have an "account" on my custom FTP server. Traditional -anonymous FTP login is allowed, but anonymous users are prevented -from doing GETs on files containing cryptographic software. -Anonymous access is allowed so that you can get README-type files -like this one, and files containing descriptions of software -licensing terms. - -To apply for FTP access to rpub.cl.msu.edu, send an email message -to ripem@ripem.msu.edu. State the following: - -1. Your citizenship (must be USA or Canadian) -2. Your willingness to comply with relevant export laws. -3. Your willingness to comply with relevant software license terms. - (You should get and read the file "rsaref-license.txt" on this host, - so you know what you are agreeing to if you get RIPEM.) -4. The "canonical" Internet domain name of your host. - (If you are not sure of the primary name of your host, FTP to - ripem.msu.edu under user anonymous. The FTP server will inform - you of your hostname.) Also state the country in which your host - resides. - -***** -***** NOTE: It is very important that you get the hostname correct. -***** As odd as it may seem, many requestors have -***** not correctly specified their host address. This -***** causes extra effort for both of us. Please check -***** (via anonymous FTP) unless you are certain of your -***** hostname as known by domain name servers. Your -***** hostname does *** NOT *** have an "@" in it, and -***** in general cannot be derived from your email address. -***** - -Here's a sample email message you might send to ripem@ripem.msu.edu: - -To: ripem@ripem.msu.edu -Subject: Access to ripem.msu.edu - - Dear Mark, - - Please give me access to ripem.msu.edu. I am an American - citizen, and I agree to comply with crypto export laws and - RSAREF license terms. My hostname is hobbit.egr.bigu.edu; - this host is located in the United States. - - Thank you. - -When I receive your message, with luck I'll promptly issue you -a special FTP username and password by return email. This username -will work only from the hostname you specify in your message. - -In the case of RIPEM, you may redistribute the code, but only -to others in the USA and Canada, and only under the terms of -the RSAREF license agreement mentioned above. - -Thank you. - -This method of distribution is due to local site requirements -and is not required by RSAREF license terms, FYI. - -Mark Riordan mrr@scss3.cl.msu.edu - -P.S. I realize that going through this account application process -is not your idea of a good time. It doesn't take much imagination -to figure that it isn't my idea of a good time, either. Please -help this process go smoothly by giving me all the informative -requested above, so I can issue your account on the first try. -I receive hundreds of these requests and many are lacking information. - --------------------------- end included message ----------------------------- diff --git a/network/entrez/client/netlib.c b/network/entrez/client/netlib.c index b7898570..277e6602 100644 --- a/network/entrez/client/netlib.c +++ b/network/entrez/client/netlib.c @@ -29,7 +29,7 @@ * * Version Creation Date: 06/05/92 * -* $Revision: 6.2 $ +* $Revision: 6.3 $ * * File Description: * miscellaneous library for network Entrez @@ -44,6 +44,9 @@ * * RCS Modification History: * $Log: netlib.c,v $ +* Revision 6.3 2012/02/19 03:45:24 lavr +* Cleanup of obsolete features +* * Revision 6.2 2005/07/25 18:06:48 lavr * Remove deprecated ni_ API references * @@ -531,10 +534,6 @@ NLM_EXTERN void GetClientInfo (CharPtr buf) StrCat(buf, dispatcher->motd); StrCat(buf, "\n"); } - if (dispatcher->useOutServ) - { - StrCat(buf, "\n Using outgoing connection when communicating with server\n"); - } if (dispatcher->adminInfo != NULL && dispatcher->adminInfo[0] != NULLB) { StrCat(buf, "\n Your Network Entrez administrator is:\n "); @@ -546,17 +545,6 @@ NLM_EXTERN void GetClientInfo (CharPtr buf) StrCat(buf, "\n Entrez service currently connected to "); StrCat(buf, lastEntrezServ->hostname); StrCat(buf, " server\n"); - /* - if (NI_EncrAvailable()) - { - if (lastEntrezServ->encryption != NULL) - { - StrCat (buf, " Encrypted session\n"); - } else { - StrCat (buf, " Encryption available, but not in use\n"); - } - } - */ statsPtr = &buf[StringLen(buf)]; DumpNetStats(SUBSYS_CLI_ENTREZ, appendStats); } diff --git a/network/id1arch/idfetch.c b/network/id1arch/idfetch.c index c021e899..2a6f6aef 100644 --- a/network/id1arch/idfetch.c +++ b/network/id1arch/idfetch.c @@ -40,8 +40,7 @@ #include <asn2gnbk.h> #endif -#include <ni_types.h> -#include <ni_lib.h> +#include <ncbinet.h> #include <ffprint.h> #include <ent2api.h> @@ -115,7 +114,7 @@ static void MyBioseqToRevCompFasta(BioseqPtr bsp, Pointer userdata); static Boolean CreateMaxPlexParam(void); static Int4 GetIntervalAccession( const Char* pAccession, Char* pResult); -Int4 giBuffer[1000]; +Int4 giBuffer[100]; int giBufferPos = 0; DataVal Val; @@ -624,11 +623,14 @@ void EntrezQuery(char *query) if(myargs[onlylistarg].intvalue) printf("%d\n", ids[i]); - else - IdFetch_func(ids[i], - myargs[dbarg].strvalue, - myargs[entarg].intvalue, - maxplex_param); + else { + if (!IdFetch_func(ids[i], myargs[dbarg].strvalue, + myargs[entarg].intvalue, maxplex_param)) { + ErrPostEx(SEV_ERROR, 0, 0, + "Failed to retrieve data for gi %d", ids[i]); + exit(1); + } + } } } @@ -759,7 +761,7 @@ static Boolean IdFetch_func1(CharPtr data, Int2 maxplex) static Entrez2ReplyPtr MyEntrezSynchronousQuery(Entrez2RequestPtr e2rq) { int i; - for(i = 0; i < 3; ++i) + for(i = 0; i < 10; ++i) { Entrez2ReplyPtr reply = EntrezSynchronousQuery(e2rq); if(reply != NULL) @@ -805,10 +807,13 @@ static Boolean ProcessOneDocSum (Int4 num, Int4Ptr uids) } else if (StringICmp (e2ddp->field_name, "Extra") == 0) { extra = e2ddp->field_value; } + /* Once both Seq-id and title are found, there's no need to continue + parsing the docsum */ + if (strlen(extra) > 0 && strlen(title) > 0) { + fprintf(fp,">%s %s\n", extra, title); + break; + } } - - fprintf(fp,">%s %s\n", extra, title); - } Entrez2DocsumListFree (e2dl); diff --git a/network/medarch/client/medutil.c b/network/medarch/client/medutil.c index 4224dc0d..814f9ade 100644 --- a/network/medarch/client/medutil.c +++ b/network/medarch/client/medutil.c @@ -28,7 +28,7 @@ * * Version Creation Date: 8/31/93 * -* $Revision: 6.32 $ +* $Revision: 6.38 $ * * File Description: Medline Utilities for MedArch * Assumes user calls MedArchInit and Fini @@ -128,7 +128,7 @@ static Boolean MUIsJournalIndexed (CharPtr journal) ptr = title; ch = *ptr; while (ch != '\0') { - if (ch == '(' || ch == ')') { + if (ch == '(' || ch == ')' || ch == '.') { *ptr = ' '; } ptr++; @@ -154,7 +154,7 @@ static Boolean MUIsJournalIndexed (CharPtr journal) if (str == NULL) return FALSE; xop = ParseXmlString (str); - MemFree (str); + str = MemFree (str); if (xop == NULL) return FALSE; blk.head = NULL; @@ -162,19 +162,29 @@ static Boolean MUIsJournalIndexed (CharPtr journal) VisitXmlNodes (xop, (Pointer) &blk, MUGetStringSetCallback, "Id", NULL, NULL, NULL, 0); VisitXmlNodes (xop, (Pointer) &count, MUGetStringCallback, "Count", "eSearchResult", NULL, NULL, 0); - FreeXmlObject (xop); + xop = FreeXmlObject (xop); if (StringCmp (count, "0") == 0 || blk.head == NULL) { - MemFree (count); + count = MemFree (count); + + /* + if [multi] failed, try [jour] + Microbiology (Reading, Engl.) + is indexed in [multi] as + microbiology reading, england + and in [jour] as + microbiology reading, engl + microbiology reading, england + */ str = QUERY_UrlSynchronousQuery ("eutils.ncbi.nlm.nih.gov", 80, "/entrez/eutils/esearch.fcgi", "db=nlmcatalog&retmax=200&term=", - title, "%5Bmulti%5D+AND+ncbijournals%5Bsb%5D", NULL); + title, "%5Bjour%5D", NULL); if (str == NULL) return FALSE; xop = ParseXmlString (str); - MemFree (str); + str = MemFree (str); if (xop == NULL) return FALSE; blk.head = NULL; @@ -182,10 +192,10 @@ static Boolean MUIsJournalIndexed (CharPtr journal) VisitXmlNodes (xop, (Pointer) &blk, MUGetStringSetCallback, "Id", NULL, NULL, NULL, 0); VisitXmlNodes (xop, (Pointer) &count, MUGetStringCallback, "Count", "eSearchResult", NULL, NULL, 0); - FreeXmlObject (xop); + xop = FreeXmlObject (xop); } - MemFree (count); + count = MemFree (count); if (blk.head == NULL) return FALSE; @@ -205,22 +215,22 @@ static Boolean MUIsJournalIndexed (CharPtr journal) "/entrez/eutils/esummary.fcgi", "db=nlmcatalog&retmax=200&version=2.0&id=", jids, NULL, NULL); - MemFree (jids); + jids = MemFree (jids); if (str == NULL) return FALSE; xop = ParseXmlString (str); - MemFree (str); + str = MemFree (str); if (xop == NULL) return FALSE; VisitXmlNodes (xop, (Pointer) &status, MUGetStringCallback, "CurrentIndexingStatus", NULL, NULL, NULL, 0); - FreeXmlObject (xop); + xop = FreeXmlObject (xop); if (StringCmp (status, "Y") == 0) { rsult = TRUE; } - MemFree (status); + status = MemFree (status); return rsult; } @@ -243,6 +253,7 @@ void print_pub(ValNodePtr pub, Boolean found, Boolean auth, Int4 muid) Int2 year = 0; ImprintPtr imp = NULL; DatePtr dp; + Int2 yr; if(pub == NULL || pub->data.ptrvalue == NULL) { @@ -337,14 +348,18 @@ void print_pub(ValNodePtr pub, Boolean found, Boolean auth, Int4 muid) } if(imp != NULL && imp->prepub == 2) /* in-press */ { + yr = 0; dp = DateCurr(); - if(year && (Int2) (dp->data[1]) + 1900 - year > 2) + if (dp != NULL) { + yr = (Int2) dp->data[1]; + DateFree(dp); + } + if(year && yr + 1900 - year > 2) { ErrPostEx(SEV_WARNING, ERR_REFERENCE_OldInPress, "encountered in-press article more than 2 years old: %s %s|%s|(%d)|%s|%s", last, first, s_title, (int) year, vol, page); } - DateFree(dp); } else { diff --git a/network/netmanag/README b/network/netmanag/README deleted file mode 100644 index 6724170b..00000000 --- a/network/netmanag/README +++ /dev/null @@ -1,9 +0,0 @@ -In order to use the NCBI network services in conjunction with the NetManage -Software development kit, it is necessary to copy the following files -from the NEWT-SDK developer disks into this "netmanag" directory. - -nmpcip.h -nmpcip.lib - -These files are copyrighted by NetManage, so it is not possible for NCBI -to distribute them in its software tree. diff --git a/network/nsclilib/ncbinet.h b/network/nsclilib/ncbinet.h index 2552fbfd..09464b76 100644 --- a/network/nsclilib/ncbinet.h +++ b/network/nsclilib/ncbinet.h @@ -1,4 +1,4 @@ -/* $Id: ncbinet.h,v 6.7 2005/07/25 18:06:48 lavr Exp $ +/* $Id: ncbinet.h,v 6.8 2012/02/19 03:45:24 lavr Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE @@ -29,7 +29,7 @@ * * Version Creation Date: 1/1/92 * -* $Revision: 6.7 $ +* $Revision: 6.8 $ * * File Description: * @@ -37,6 +37,9 @@ * Modifications: * -------------------------------------------------------------------------- * $Log: ncbinet.h,v $ +* Revision 6.8 2012/02/19 03:45:24 lavr +* Cleanup of obsolete features +* * Revision 6.7 2005/07/25 18:06:48 lavr * Remove deprecated ni_ API references * @@ -78,22 +81,10 @@ #ifndef _NCBINET_ #define _NCBINET_ -#include "ni_types.h" /* include <ncbi.h> */ -#include "ni_defin.h" -#include "ni_error.h" +#include <ni_types.h> /* include <ncbi.h> */ +#include <ni_error.h> #include <ni_lib_.h> -#ifdef NETP_INET_MACTCP - -#include "sock_ext.h" -extern void bzero PROTO((CharPtr target, long numbytes)); - -#endif /* NETP_INET_MACTCP */ - - -/* GLOBAL VARIABLES */ -/* CLIENT FUNCTIONS */ - #undef NLM_EXTERN #ifdef NLM_IMPORT #define NLM_EXTERN NLM_IMPORT @@ -105,69 +96,12 @@ extern void bzero PROTO((CharPtr target, long numbytes)); extern "C" { #endif -#ifdef NETP_INET_MACTCP -#ifndef errno -extern int errno; -#endif -extern long errno_long; -#endif - - -NLM_EXTERN Boolean NI_FqdnToIpaddr PROTO((CharPtr fqdn, CharPtr ipbuf, Int2 ipbuflen)); - -NLM_EXTERN Int2 NI_InitServices PROTO((NI_DispatcherPtr disp, CharPtr user, CharPtr group, CharPtr password, NI_DispInfoPtr PNTR dip)); - -NLM_EXTERN Int4 NI_SetDispConfig PROTO((NI_DispInfoPtr PNTR dip, CharPtr dispatcher, Int2 dispLen)); - -NLM_EXTERN NICatalogPtr NI_GetCatalog PROTO((NI_DispatcherPtr disp)); - -NLM_EXTERN ReqPtr NI_SVCRequestBuild PROTO((NI_DispatcherPtr disp)); - -NLM_EXTERN void NI_SVCRequestDestroy PROTO((ReqPtr reqp)); NLM_EXTERN NI_HandPtr NI_ServiceGet PROTO((NI_DispatcherPtr disp, CharPtr svc, Uint2 svcvermin, Uint2 svcvermax, CharPtr res, CharPtr restype, Uint2 resvermin, Uint2 resvermax)); -NLM_EXTERN NI_HandPtr NI_ServiceRequest PROTO((ReqPtr req)); - -NLM_EXTERN int NI_ServiceGetReadFd PROTO((NI_HandPtr mhp)); - -NLM_EXTERN int NI_ServiceGetWriteFd PROTO((NI_HandPtr mhp)); - -NLM_EXTERN Int2 NI_RequestSetService PROTO((ReqPtr req, CharPtr name, Uint2 vermin, Uint2 vermax)); - -NLM_EXTERN Int2 NI_RequestAddResource PROTO((ReqPtr req, CharPtr name, CharPtr type, Uint2 vermin, Uint2 vermax)); - NLM_EXTERN Int2 NI_GetPlatform PROTO((void)); -/* SERVER FUNCTIONS */ - -NLM_EXTERN int NI_ServerACK PROTO((void)); - -NLM_EXTERN int NI_ServerNACK PROTO((CharPtr err_text)); - -NLM_EXTERN NI_HandPtr NI_OpenASNIO PROTO((void)); - -NLM_EXTERN Int2 NI_CloseASNIO PROTO((NI_HandPtr hp)); - -/* TIMER MANAGEMENT */ - -NLM_EXTERN void NI_ProcessTimers PROTO((void)); -NLM_EXTERN time_t NI_GetNextWakeup PROTO((void)); -NLM_EXTERN NodePtr NI_SetTimer PROTO((time_t timeout, NI_TimeoutHook hook, Pointer hookParam)); -NLM_EXTERN void NI_CancelTimer PROTO((NodePtr timerId)); - -/* MISC. FUNCTIONS */ - -NLM_EXTERN void NI_SetActivityHook PROTO((NI_NetServHook hook)); - -/* for internal network services use only */ -NLM_EXTERN NI_NetServHook NI_ActivityHook PROTO((void)); -NLM_EXTERN void WriteConFile PROTO((Uint4 conid)); - -NLM_EXTERN void NI_LogSocket PROTO((int sok, Boolean opening, CharPtr filename, int lineno)); -NLM_EXTERN Int2 NI_SocketsOpen PROTO((void)); - #undef NLM_EXTERN #ifdef NLM_EXPORT #define NLM_EXTERN NLM_EXPORT diff --git a/network/nsclilib/ni_defin.h b/network/nsclilib/ni_defin.h deleted file mode 100644 index 912914b0..00000000 --- a/network/nsclilib/ni_defin.h +++ /dev/null @@ -1,413 +0,0 @@ -/* -* =========================================================================== -* -* PUBLIC DOMAIN NOTICE -* National Center for Biotechnology Information -* -* This software/database is a "United States Government Work" under the -* terms of the United States Copyright Act. It was written as part of -* the author's official duties as a United States Government employee and -* thus cannot be copyrighted. This software/database is freely available -* to the public for use. The National Library of Medicine and the U.S. -* Government have not placed any restriction on its use or reproduction. -* -* Although all reasonable efforts have been taken to ensure the accuracy -* and reliability of the software and data, the NLM and the U.S. -* Government do not and cannot warrant the performance or results that -* may be obtained by using this software or data. The NLM and the U.S. -* Government disclaim all warranties, express or implied, including -* warranties of performance, merchantability or fitness for any particular -* purpose. -* -* Please cite the author in any work or product based on this material. -* -* =========================================================================== -* -* File Name: ni_defin.h -* -* Author: Beatty, Gish -* -* Version Creation Date: 1/1/92 -* -* $Revision: 6.4 $ -* -* File Description: -* -* -* Modifications: -* -------------------------------------------------------------------------- -* Date Name Description of modification -* ------- ---------- ----------------------------------------------------- -* 5/12/92 Epstein Converted tabs to spaces -* 5/06/92 Epstein Added conditionally-compiled option for use with the -* "purify" tool -* 01-21-94 Schuler Added NETP_INET_MACTCP symbol -* -* ========================================================================== -* -* -* RCS Modification History: -* $Log: ni_defin.h,v $ -* Revision 6.4 2006/12/22 17:12:28 kans -* ifndef protection for NI_Handle, NI_HandPtr, NI_Request and NI_ReqPtr, already defined in ni_types.h -* -* Revision 6.3 2003/05/05 12:24:26 rsmith -* range of socket errors is from WSABASEERR to WSABASEERR + 2000, not + sys_nerr. Allows cross compilation by Codewarrior. -* -* Revision 6.2 2001/05/08 16:43:57 juran -* Use errno, not errno_long. -* -* Revision 6.1 1999/11/23 21:43:30 vakatov -* [WIN32] Always #define NETP_INET_WSOCK for Win32 -* -* Revision 6.0 1997/08/25 18:38:29 madden -* Revision changed to 6.0 -* -* Revision 5.2 1997/08/13 13:37:15 epstein -* remove stray semicolons from #defines -* -* Revision 5.1 1996/06/11 20:14:14 epstein -* use O_NONBLOCK instead of O_NDELAY per a suggestion by Sergei Shavirin -* - * Revision 5.0 1996/05/28 14:11:55 ostell - * Set to revision 5.0 - * - * Revision 4.1 1995/12/18 21:58:06 epstein - * correction for SGI build - * - * Revision 4.0 1995/07/26 13:56:32 ostell - * force revision to 4.0 - * - * Revision 1.24 1995/05/17 17:51:56 epstein - * add RCS log revision history - * -*/ - -#ifndef _NI_DEFIN_ -#define _NI_DEFIN_ - -#define STDIN 0 -#define STDOUT 1 -#define STDERR STDOUT + 1 - -/* if the "purify" tool is in use, it will seize the file descriptor which */ -/* we had wanted; this is O.K., but the difference must be taken into account */ -/* here */ -#ifndef _PURIFY -#define STDPIPE STDERR + 1 -#else -#define STDPIPE STDERR + 2 -#endif - -/* the following are already defined in ni_types.h */ -#ifndef NI_Handle -#define NI_Handle MHandle /* for API use */ -#endif -#ifndef NI_HandPtr -#define NI_HandPtr MHandPtr /* for API use */ -#endif -#ifndef NI_Request -#define NI_Request Request /* for API use */ -#endif -#ifndef NI_ReqPtr -#define NI_ReqPtr ReqPtr /* for API use */ -#endif - -#define ERRTEXT_BUFSIZ 512 /* size of supplied error text buffer */ -#define HOSTNAME_SIZ 64 -#define INETADDR_SIZ 16 /* of the form 255.255.255.255 */ -#define SVC_HOST_SIZ 64 /* size of addr or name of host */ -#define SVC_NAME_SIZ 64 /* size of name of service */ -#define RES_NAME_SIZ 64 /* size of name of resource */ -#define RESTYP_NAME_SIZ 64 /* size of type of resource */ -#define USERNAME_SIZ 64 /* kerberos principle */ -#define GROUPNAME_SIZ 64 /* kerberos instance */ -#define DOMAINNAME_SIZ 64 /* kerberos realm */ -#define PASSWORD_SIZ 32 /* must be encrypted */ - -#define MATCHES_ANY_TYPE "*" /* string which matches any resource type */ - -#define NI_LAST_RESERVED_PORT 1024 /* ports above this MAY be legal */ - -#define NI_DEFAULT_TIMEOUT 60 -#define NI_SELECT_TIMEOUT 60 -#define NI_READ_TIMEOUT NI_DEFAULT_TIMEOUT -#define NI_WRITE_TIMEOUT NI_DEFAULT_TIMEOUT - -#define PIPE_TOKEN "\003" -#define PIPE_MSG_FMT "%d\003%s\003" - -#define READ_AIP raip -#define WRITE_AIP waip - -#define NI_DEFAULT_DOMAIN "ncbi.nlm.nih.gov" /* default domain */ -#define NI_DEFAULT_HOST "dispatcher" /* default host for dispatcher */ -#define NI_DEFAULT_SERVICE "disp_port" /* default name of service (port) */ -#define NI_DFLT_SVC_PORT 5557 /* default port for service */ - -#define NI_CLIENT_PORT_LO_NAME "ncbi_begin" /* beginning of client port range */ -#define NI_DFLT_CLILO_PORT 5601 /* default beginning of client port range */ -#define NI_CLIENT_PORT_HI_NAME "ncbi_end" /* end of client port range */ -#define NI_DFLT_CLIHI_PORT 32767 /* default end of client port range */ - - -/* instrumentation is enabled by default */ -#ifdef NI_NOSOCK_LOGGING -#define LOG_SOCKET(x,y) -#else -#define LOG_SOCKET(x,y) NI_LogSocket(x,y,__FILE__,__LINE__) -#endif /* NI_NOSOCK_LOGGING */ - -#if defined(WIN32) && !defined(NETP_INET_WSOCK) -# define NETP_INET_WSOCK -#endif - -#ifdef NETP_INET_WSOCK -/* ** the following was extracted from <winsock.h> ** */ -/* - * Windows Sockets errors redefined as regular Berkeley error constants. - * These are commented out in Windows NT to avoid conflicts with errno.h. - * Use the WSA constants instead. - */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define EALREADY WSAEALREADY -#define ENOTSOCK WSAENOTSOCK -#define EDESTADDRREQ WSAEDESTADDRREQ -#define EMSGSIZE WSAEMSGSIZE -#define EPROTOTYPE WSAEPROTOTYPE -#define ENOPROTOOPT WSAENOPROTOOPT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EADDRINUSE WSAEADDRINUSE -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#define ENETDOWN WSAENETDOWN -#define ENETUNREACH WSAENETUNREACH -#define ENETRESET WSAENETRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNRESET WSAECONNRESET -#define ENOBUFS WSAENOBUFS -#define EISCONN WSAEISCONN -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ELOOP WSAELOOP -//#define ENAMETOOLONG WSAENAMETOOLONG -#define EHOSTDOWN WSAEHOSTDOWN -#define EHOSTUNREACH WSAEHOSTUNREACH -//#define ENOTEMPTY WSAENOTEMPTY -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE -#endif /* NETP_INET_WSOCK */ - - -/* MACROS */ - -/* BLOCKSIG, UNBLOCKSIG, and BZERO are for dispatcher and ncbid only */ -#if defined(OS_UNIX_SYSV) && !defined(BSD_COMPAT) -/* for System V we cheat and use the caller's "mask" variable to store */ -/* the signal; note that these macros won't work if dealing with more than */ -/* one signal */ -#define NI_BLOCKSIG(_sig, _mask) { _mask = _sig; sighold(_sig); } -#define NI_UNBLOCKSIG(_sig) sigrelse(_sig) -#define NI_BZERO(buf, bufsize) Nlm_MemFill(buf, 0, bufsize) -#else -#define NI_BLOCKSIG(_sig, _mask) _mask = sigblock(sigmask(_sig)) -#define NI_UNBLOCKSIG(_mask) sigsetmask(_mask) -#define NI_BZERO(buf, bufsize) bzero(buf, bufsize) -#endif - - -#ifdef NETP_INET_NEWT -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) close_socket(sok) -#define NI_select(s, r, w, x, t) NI_poll_select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) ioctl(fd, FIONBIO, "1") -#define NI_SETNONBLOCKING(fd) ioctl(fd, FIONBIO, "0") -#endif /* NETP_INET_NEWT */ - -#ifdef NETP_INET_PCNFS -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) close(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define NI_BLOCK_WITH_FUNCTION -#endif /* NETP_INET_PCNFS */ - -/* Windows Sockets */ -#ifdef NETP_INET_WSOCK -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) closesocket(sok) -#define NI_select(s, r, w, x, t) NI_poll_select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define errno WSAGetLastError() -#define _INVALID_SOCKET_DEFINED_ -#define NI_BLOCK_WITH_FUNCTION -/* see WinSock2.h and winerror.h for why 2000 */ -#define SOCK_INDEX_ERRNO ((errno <= WSABASEERR || errno >= 2000 + WSABASEERR) ? 0 : (errno - WSABASEERR)) -#endif /* NETP_INET_WINSOCK */ - -/* TGV's Multinet TCP/IP suite for OpenVMS */ -#ifdef NETP_INET_TGV -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) socket_close(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define NI_BLOCK_WITH_FUNCTION -#define SOCK_ERRNO socket_errno -#endif - -/* Wollongong TCP/IP suite for OpenVMS */ -#ifdef NETP_INET_TWG -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) netclose(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define NI_BLOCK_WITH_FUNCTION -/* from UCX */ -#define FD_SETSIZE 32 -#define fd_set int -#define FD_SET(n, p) *(p) |= 1 << (n) -#define FD_CLR(n,p) *(p) &= ~(1 << (n)) -#define FD_ISSET(n,p) ((*p) & (1 << (n))) -#define FD_ZERO(p) *(p) = 0 -#endif - -/* Wollongong PathWay API 1.0 suite for OpenVMS */ -#ifdef NETP_INET_WPW -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) netclose(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define NI_BLOCK_WITH_FUNCTION -#endif - -/* DEC TCP/IP for OpenVMS (UCX) */ -#ifdef NETP_INET_UCX -#define NI_READSOCKET(rsok, rbuf, rlen) recv(rsok, rbuf, rlen, 0) -#define NI_WRITESOCKET(wsok, wbuf, wlen) send(wsok, wbuf, wlen, 0) -#define NI_CLOSESOCKET(sok) close(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) NI_SetBlocking (fd) -#define NI_SETNONBLOCKING(fd) NI_SetNonBlocking (fd) -#define NI_BLOCK_WITH_FUNCTION -#define FD_SETSIZE 32 -#define fd_set int -#define FD_SET(n, p) *(p) |= 1 << (n) -#define FD_CLR(n,p) *(p) &= ~(1 << (n)) -#define FD_ISSET(n,p) ((*p) & (1 << (n))) -#define FD_ZERO(p) *(p) = 0 -#endif - - -/* Macintosh */ -#if defined(OS_MAC) && !defined(NETP_defined) -#define NETP_INET_MACTCP -#endif - -#ifdef NETP_INET_MACTCP -#define NI_READSOCKET(rsok, rbuf, rlen) read(rsok, rbuf, rlen) -#define NI_WRITESOCKET(wsok, wbuf, wlen) write(wsok, wbuf, wlen) -#define NI_CLOSESOCKET(sok) close(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) -#define NI_SETBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NDELAY) /* set blocking */ -#define NI_SETNONBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NDELAY) /* set nonblocking */ - -/* The errno_long mechanism is used for interoperability between the */ -/* network services library and the NCSA socket library, which need not have */ -/* been compiled with the same integer size (2 byte vs. 4 byte) */ -#define SOCK_ERRNO errno -#endif /* NETP_INET_MACTCP */ - - -#ifndef NI_READSOCKET /* for now, fall back on UNIX as default */ -#define NI_READSOCKET(rsok, rbuf, rlen) read(rsok, rbuf, rlen) -#define NI_WRITESOCKET(wsok, wbuf, wlen) write(wsok, wbuf, wlen) -#define NI_CLOSESOCKET(sok) close(sok) -#define NI_select(s, r, w, x, t) select(s, r, w, x, t) - -#ifdef OS_UNIX_BSD -#define NI_SETBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~FNDELAY) /* set blocking */ -#define NI_SETNONBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | FNDELAY) /* set nonblocking */ -#else -#define NI_SETBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK) /* set blocking */ -#define NI_SETNONBLOCKING(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK) /* set nonblocking */ -#endif /* OS_UNIX_BSD */ - -#endif /* NI_READSOCKET */ - -/* MSDOS */ - -#ifdef COMP_MSC -#ifndef NETP_INET_MACTCP -#ifdef FD_SETSIZE -#undef FD_SETSIZE -#endif -#define FD_SETSIZE 32 -#include <io.h> - -#ifndef NETP_INET_NEWT -#ifndef NETP_INET_PCNFS -#ifndef NETP_INET_WSOCK -/* copied from Sun version of this file 6-11-91 and modified */ -#define NFDBITS 32 -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) MemFill((char *)(p), '\0', sizeof(*(p))) -#endif -#endif -#endif - -#endif /* NETP_INET_MACTCP */ -#endif /* COMP_MSC */ - -#ifndef SOCK_ERRNO -#define SOCK_ERRNO errno -#endif /* SOCK_ERRNO */ - -#ifndef SOCK_INDEX_ERRNO -#define SOCK_INDEX_ERRNO SOCK_ERRNO -#endif /* SOCK_INDEX_ERRNO */ - -#ifndef _INVALID_SOCKET_DEFINED_ -#define INVALID_SOCKET -1 -#endif /* INVALID_SOCKET */ - -#ifdef NETP_SOCKS -#define NI_ACCEPT(sok,addr,addrlen) Raccept(sok,addr,addrlen) -#define NI_BIND(sok,name,namelen,bindaddr) Rbind(sok,name,namelen,bindaddr) -#define NI_CONNECT(sok,name,namelen) Rconnect(sok,name,namelen) -#define NI_GETSOCKNAME(sok,name,namelen) Rgetsockname(sok,name,namelen) -#define NI_LISTEN(sok,backlog) Rlisten(sok,backlog) -#else -#define NI_ACCEPT(sok,addr,addrlen) accept(sok,addr,addrlen) -#define NI_BIND(sok,name,namelen,bindaddr) bind(sok,name,namelen) -#define NI_CONNECT(sok,name,namelen) connect(sok,name,namelen) -#define NI_GETSOCKNAME(sok,name,namelen) getsockname(sok,name,namelen) -#define NI_LISTEN(sok,backlog) listen(sok,backlog) -#endif - - -#endif /* _NI_DEFIN_ */ - - diff --git a/network/nsclilib/ni_error.c b/network/nsclilib/ni_error.c index 02ced785..982c414a 100644 --- a/network/nsclilib/ni_error.c +++ b/network/nsclilib/ni_error.c @@ -29,7 +29,7 @@ * * Version Creation Date: 1/1/92 * -* $Revision: 6.3 $ +* $Revision: 6.4 $ * * File Description: * @@ -37,6 +37,9 @@ * Modifications: * -------------------------------------------------------------------------- * $Log: ni_error.c,v $ +* Revision 6.4 2012/02/19 03:45:25 lavr +* Cleanup of obsolete features +* * Revision 6.3 2000/10/30 18:12:01 beloslyu * FreeBSD was added * @@ -67,6 +70,7 @@ */ #include "ni_error.h" + static Char *STATIC__ni_errlist[NIE_N_ERRORS] = { @@ -182,20 +186,12 @@ static Char **STATIC__ni_platform_ptr = &STATIC__ni_platform[0]; NLM_EXTERN Char ***x_ni_platform(void) { return &STATIC__ni_platform_ptr; } -/* number of errors */ -static Uint2 STATIC__ni_nerr = (Uint2)NIE_UNKNOWN; -NLM_EXTERN Uint2 *x_ni_nerr(void) { return &STATIC__ni_nerr; } - -/* error level - NOT SET on error */ -static NI_ErrLevel STATIC__ni_errlev; -NLM_EXTERN NI_ErrLevel *x_ni_errlev(void) { return &STATIC__ni_errlev; } - /* error number set by failing function */ static NI_Error STATIC__ni_errno; NLM_EXTERN NI_Error *x_ni_errno(void) { return &STATIC__ni_errno; } + /* additional error text buffer */ static Char STATIC__ni_errtext[ERRTEXT_BUFSIZ]; static Char *STATIC__ni_errtext_ptr = &STATIC__ni_errtext[0]; NLM_EXTERN Char **x_ni_errtext(void) { return &STATIC__ni_errtext_ptr; } - diff --git a/network/nsclilib/ni_error.h b/network/nsclilib/ni_error.h index 4b2ce9e8..a7585628 100644 --- a/network/nsclilib/ni_error.h +++ b/network/nsclilib/ni_error.h @@ -29,7 +29,7 @@ * * Version Creation Date: 1/1/92 * -* $Revision: 6.4 $ +* $Revision: 6.5 $ * * File Description: * @@ -42,6 +42,9 @@ * * ========================================================================== * $Log: ni_error.h,v $ +* Revision 6.5 2012/02/19 03:45:25 lavr +* Cleanup of obsolete features +* * Revision 6.4 2000/10/30 18:12:01 beloslyu * FreeBSD was added * @@ -70,7 +73,7 @@ #ifndef _NI_ERROR_ #define _NI_ERROR_ -#include "ncbinet.h" +#include <ncbinet.h> #undef NLM_EXTERN #ifdef NLM_IMPORT @@ -79,6 +82,8 @@ #define NLM_EXTERN extern #endif +#define ERRTEXT_BUFSIZ 512 /* size of supplied error text buffer */ + #ifdef __cplusplus extern "C" { #endif @@ -120,14 +125,6 @@ NI_Platform { #define NI_MAX_PLATFORMS (NI_N_PLATFORMS - 1) }; -#define NI_ErrLevel enum ni_errlevel -NI_ErrLevel { - NIL_INFORMATION = 1, /* informational */ - NIL_WARNING, /* small problem */ - NIL_SEVERE, /* recoverable */ - NIL_FATAL /* not recoverable */ -}; - #define NI_Error enum ni_error NI_Error { NIE_NO_ERROR = 0, /* no error */ @@ -204,14 +201,6 @@ NI_Error { NIE_N_ERRORS /* do not enumerate after this line! */ }; -/* number of errors */ -NLM_EXTERN Uint2 *x_ni_nerr PROTO((void)); -#define ni_nerr (*x_ni_nerr()) - -/* error level - NOT SET on error */ -NLM_EXTERN NI_ErrLevel *x_ni_errlev PROTO((void)); -#define ni_errlev (*x_ni_errlev()) - /* error number set by failing function */ NLM_EXTERN NI_Error *x_ni_errno PROTO((void)); #define ni_errno (*x_ni_errno()) diff --git a/network/nsclilib/ni_lib.h b/network/nsclilib/ni_lib.h deleted file mode 100644 index 48bbc624..00000000 --- a/network/nsclilib/ni_lib.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -* =========================================================================== -* -* PUBLIC DOMAIN NOTICE -* National Center for Biotechnology Information -* -* This software/database is a "United States Government Work" under the -* terms of the United States Copyright Act. It was written as part of -* the author's official duties as a United States Government employee and -* thus cannot be copyrighted. This software/database is freely available -* to the public for use. The National Library of Medicine and the U.S. -* Government have not placed any restriction on its use or reproduction. -* -* Although all reasonable efforts have been taken to ensure the accuracy -* and reliability of the software and data, the NLM and the U.S. -* Government do not and cannot warrant the performance or results that -* may be obtained by using this software or data. The NLM and the U.S. -* Government disclaim all warranties, express or implied, including -* warranties of performance, merchantability or fitness for any particular -* purpose. -* -* Please cite the author in any work or product based on this material. -* -* =========================================================================== -* -* File Name: ni_lib.h -* -* Author: Beatty, Gish -* -* Version Creation Date: 1/1/92 -* -* $Revision: 6.1 $ -* -* File Description: -* -* -* Modifications: -* -------------------------------------------------------------------------- -* Date Name Description of modification -* ------- ---------- ----------------------------------------------------- -* 5/12/92 Epstein Converted tabs to spaces -* -* -* ========================================================================== -* -* -* RCS Modification History: -* $Log: ni_lib.h,v $ -* Revision 6.1 2005/07/25 18:06:48 lavr -* Remove deprecated ni_ API references -* -* Revision 6.0 1997/08/25 18:38:49 madden -* Revision changed to 6.0 -* -* Revision 5.0 1996/05/28 14:11:55 ostell -* Set to revision 5.0 -* - * Revision 4.0 1995/07/26 13:56:32 ostell - * force revision to 4.0 - * - * Revision 1.4 1995/05/17 17:52:23 epstein - * add RCS log revision history - * -*/ - -#ifndef _NI_LIB_ -#define _NI_LIB_ - -#include "ncbinet.h" -#include "ni_net.h" - -/* DEFINES */ - -#define NI_TIMEOUT_SECS 60 /* timeout for connections, requests, etc. */ -#define NI_SERV_LISTEN_TIMEOUT 1800 /* default: servers timeout after 30 minutes */ -#define MAX_ALT_DISP_TRIES 2 /* number of times to try alternate dispatchers */ - - -#endif diff --git a/network/nsclilib/ni_lib_.h b/network/nsclilib/ni_lib_.h index 5c2ec46a..da9aebc0 100644 --- a/network/nsclilib/ni_lib_.h +++ b/network/nsclilib/ni_lib_.h @@ -1,7 +1,7 @@ #ifndef NI_LIB___H #define NI_LIB___H -/* $Id: ni_lib_.h,v 4.9 2004/11/18 15:18:36 lavr Exp $ +/* $Id: ni_lib_.h,v 4.10 2012/02/19 03:45:25 lavr Exp $ * ========================================================================== * * PUBLIC DOMAIN NOTICE @@ -35,6 +35,9 @@ * * -------------------------------------------------------------------------- * $Log: ni_lib_.h,v $ +* Revision 4.10 2012/02/19 03:45:25 lavr +* Cleanup of obsolete features +* * Revision 4.9 2004/11/18 15:18:36 lavr * Retire obsoleted g_NII_ vtables * @@ -91,20 +94,6 @@ NLM_EXTERN Boolean NI_IsInterfaceSupported(ENIInterface ni_interface); NLM_EXTERN ENIInterface NI_SetInterface(ENIInterface ni_interface); -/* Setup the client host address to be used in the next call to - * NI_GenericGetService() - * NOTE: the address will be valid for this thread only and for - * the only one call to NI_GenericGetService() - */ -NLM_EXTERN void NI_SetAddress(const Char *address); - -/* WWW/LB-specific; set port of the NCBID to connect (for this thread only). - * Return previously set port. - * HINT: call it with zero "port" to get current port, without changing it. - */ -NLM_EXTERN Uint2 NI_WWW_SetNcbidPort(Uint2 port); - - /* The set of functions that are capable to work with different * network interfaces(according to NI_SetInterface) */ diff --git a/network/nsclilib/ni_macdv.c b/network/nsclilib/ni_macdv.c deleted file mode 100644 index 2ad8a5e5..00000000 --- a/network/nsclilib/ni_macdv.c +++ /dev/null @@ -1,434 +0,0 @@ -/* -* =========================================================================== -* -* PUBLIC DOMAIN NOTICE -* National Center for Biotechnology Information -* -* This software/database is a "United States Government Work" under the -* terms of the United States Copyright Act. It was written as part of -* the author's official duties as a United States Government employee and -* thus cannot be copyrighted. This software/database is freely available -* to the public for use. The National Library of Medicine and the U.S. -* Government have not placed any restriction on its use or reproduction. -* -* Although all reasonable efforts have been taken to ensure the accuracy -* and reliability of the software and data, the NLM and the U.S. -* Government do not and cannot warrant the performance or results that -* may be obtained by using this software or data. The NLM and the U.S. -* Government disclaim all warranties, express or implied, including -* warranties of performance, merchantability or fitness for any particular -* purpose. -* -* Please cite the author in any work or product based on this material. -* -* =========================================================================== -* -* File Name: ni_macdv.c -* -* Author: epstein -* -* Version Creation Date: 1/13/95 -* -* $Revision: 6.4 $ -* -* File Description: -* Determine which Macintosh MacTCP device is in-use (e.g., "Ethernet", "PPP") -* -* Note: This file is almost entirely based upon source code kindly provided -* by Robert S. Mah (rmah@panix.com). This in turn is based upon -* the Apple technical document "MacTCP 2.0 LAP Tech Note". -* -* This file is to be used for Macintosh computers only. -* -* -* Modifications: -* -------------------------------------------------------------------------- -* Date Name Description of modification -* ------- ---------- ----------------------------------------------------- -*01/17/95 Kans Add CodeWarrior-compatibility -* ========================================================================== -* -* -* RCS Modification History: -* $Log: ni_macdv.c,v $ -* Revision 6.4 2003/05/05 12:27:37 rsmith -* add Mac OS guards so we can cross compile this project to Windows w/o changing files in the project. -* -* Revision 6.3 2001/04/20 18:31:58 juran -* Bring obsolete preprocessor symbol up to date. -* -* Revision 6.2 2001/04/20 17:49:53 kans -* check for Carbon before using obsolete symbol -* -* Revision 6.1 2001/04/05 02:38:33 juran -* Carbon fix, and also plug a leaked Handle lock. -* -* Revision 6.0 1997/08/25 18:38:55 madden -* Revision changed to 6.0 -* -* Revision 5.2 1997/01/29 00:20:48 kans -* uses <MacTCP.h> instead of obsolete <MacTCPCommonTypes.h> -* - * Revision 5.1 1997/01/28 22:36:06 kans - * changed <GestaltEqu.h> to <Gestalt.h> - * - * Revision 5.0 1996/05/28 14:11:55 ostell - * Set to revision 5.0 - * - * Revision 4.3 1996/04/30 21:17:40 epstein - * add back safety variables to avoid risk of stack corruption - * - * Revision 4.1 1996/04/30 16:06:54 kans - * UsingOpenTransport checks gestalt (JAE) - * - * Revision 4.0 1995/07/26 13:56:32 ostell - * force revision to 4.0 - * - * Revision 1.3 1995/05/17 17:52:34 epstein - * add RCS log revision history - * -*/ - -#if defined(OS_MAC) || defined(OS_UNIX_DARWIN) - -#include <ncbi.h> -#include <ncbiwin.h> - -#include <MacTCP.h> -#include <Files.h> -#include <Errors.h> -#include <Resources.h> -#include <Memory.h> -#include <Gestalt.h> -#include <Folders.h> - -#ifdef COMP_METRO -typedef OSErr (*OSErrProcPtr)(); -typedef Ptr (*PtrProcPtr)(); -typedef Boolean (*BooleanProcPtr)(); -typedef void (*voidProcPtr)(); - -#endif - -typedef unsigned char uchar; - -extern Boolean ResLoad; - -#if TARGET_CPU_PPC -#pragma options align=mac68k -#endif - - -/* - * Holds IP and LAP-specific configuration information. This is held in the - * 'ipln' configuration resource in either the MacTCP driver or the "MacTCP - * Prep" files. - */ -typedef struct IPConfig { - long version; - long flags; - long dfl_ip_addr; - long dfl_net_mask; - long dfl_broadcast_mask; - long dfl_gateway_addr; - b_8 server_lap_address[8]; - long configIPAddr; - long configNetMask; - long dfl_dyn_low; - long dfl_dyn_high; - char dfl_zone[34]; /* ### */ - Boolean load; - Boolean admin; - Boolean netLock; - Boolean subnetLock; - Boolean nodeLock; - Boolean filler1; - long activeLap; - long slot; - char filename[33]; /* ### */ -} IPConfig; - - -/* - * LAPInfo is allocated during system start-up and holds all of the -LAP-specific information. - */ -struct LAPInfo { - b_32 our_ip_addr; /* LAP's IP address = -*/ - b_32 our_net_mask; /* LAP's IP net-mask= - */ - b_32 ip_broadcast_addr; /* IP's broadcast -address */ - IPConfig lc; /* copy of -IP LAP configuration resource */ - OSErrProcPtr lapInit; /* pointer to -once-only LAP init routine */ - OSErrProcPtr lapOpen; /* LAP open routine = -*/ - OSErrProcPtr lapClose; /* LAP close routine= - */ - voidProcPtr lapUnload; /* LAP -unload routine, undoes LapInit */ - OSErrProcPtr lapAttach; /* LAP attach PH -routine */ - OSErrProcPtr lapDetach; /* LAP detach= - routine */ - OSErrProcPtr lapOutput; /* LAP output= - routine */ - OSErrProcPtr lapControl; /* LAP control -routine */ - voidProcPtr lapFault; /* LAP -fault isolation routine */ - OSErrProcPtr lapStatistics; /* LAP statistic reading -routine */ - voidProcPtr lapConfigure; /* LAP-specific -configuration routines */ - BooleanProcPtr lapProbe; /* send a -LAP-specific address probe packet */ - BooleanProcPtr lapRegister; /* register our IP address -on the network */ - voidProcPtr lapFindGateway; /* LAP-specific -means of finding a gateway */ - BooleanProcPtr lapGwyCheck; /* LAP-specific means of -verifying gateway up */ - /* IP parameters */ - ip_addr dfl_dns_addr; /* address of DNS -from config protocol */ - Handle dnslHndl; /* handle -to DNS configuration resource */ - Ptr dnsCache; /* -pointer to space allocated for dns cache */ - long dnsCacheSize; /* size of cache -allocated, in bytes */ - /* LAP parameters */ - long headerSize; /* LAP -header space requirements */ - long trailerSize; /* LAP trailer -space requirements */ - long outMaxPacketSize; /* size of maximum -output packet */ - long inMaxPacketSize; /* size of maximum -input packet */ - long maxDataSize; /* size of maximum -data packet */ - long numConnections; /* number of -separate network connections */ - unsigned long versionFlags; /* version number flags */ - voidProcPtr ip_ph; /* pointer -to IP's protocol handler */ - Ptr ipGlobals; /* -pointer to IP's A5 */ - short link_unit; /* unit -number of link driver */ - Boolean addressConflict; /* TRUE if address -conflict discovered */ - long lapType; /* IP LAP -hardware type number */ - long lapAddrLength; /* size of LAP -address field */ - unsigned char *lapAddrPtr; /* pointer to LAP address -field */ - unsigned long reserved; /* MacTCP reserved -field */ -}; - - - - -#if TARGET_CPU_PPC -#pragma options align=reset -#endif - - - - -char * GetLAPType( void ); -static char * ParseLAPType(IPConfig **configH ); -static OSErr SearchFolderForRsrc( FSSpec *target, short vRefNum, long dirID, - OSType ftype, OSType fcrea, OSType rsrcType ); - - -//-------------------------------------------------------------------------- -// Returns the current LAP driver type -// Note: We should fix this to search the control panels folder for any file -// of the correct type containing a 'ipln' resource. -//-------------------------------------------------------------------------- - -Boolean UsingOpenTransport (void) - -{ - OSErr err; - long gval; - - /* gestaltOpenTpt is defined in OpenTransport.h, which is only - available in CodeWarrior at present. - */ - /* - err = Gestalt (gestaltOpenTpt, &gval); - */ - err = Gestalt ('otan', &gval); - if (err == noErr && gval != 0) { - return TRUE; - } - return FALSE; -} - -char * GetLAPType( void ) -{ - IPConfig **configH; - long responce; - char safety1[100]; - FSSpec fspec; - char safety2[100]; - short refNum = -1; - char *lapType = NULL; - - if( Gestalt( 'mtcp', &responce ) != noErr ) - return (UsingOpenTransport() ? "OpenTransport" : NULL); - - // First check the MacTCP Prep file - if( FindFolder( kOnSystemDisk, kPreferencesFolderType, false, - &fspec.vRefNum, &fspec.parID ) != noErr ) - goto try_mactcp_drvr; - - if( SearchFolderForRsrc( &fspec, fspec.vRefNum, fspec.parID, - 'mtpp', 'mtcp', 'ipln' ) != noErr ) - goto try_mactcp_drvr; - - if( (refNum = FSpOpenResFile( &fspec, fsRdPerm )) == -1 ) - goto try_mactcp_drvr; - - configH = (IPConfig**) Get1IndResource( 'ipln', 1 ); - if( configH != NULL && *configH != NULL ){ - lapType = ParseLAPType( configH ); - } - CloseResFile( refNum ); - - if( lapType != NULL ) - return lapType; - - // Otherwise check the MacTCP driver/control panel - -try_mactcp_drvr: - if( FindFolder( kOnSystemDisk, 'cntl', false, - &fspec.vRefNum, &fspec.parID ) != noErr ) - goto exit; - - if( SearchFolderForRsrc( &fspec, fspec.vRefNum, fspec.parID, - 'cdev', 'ztcp', 'ipln' ) != noErr ) - goto exit; - - if( (refNum = FSpOpenResFile( &fspec, fsRdPerm )) == -1 ) - goto exit; - - configH = (IPConfig**) Get1IndResource( 'ipln', 1 ); - if( configH != NULL && *configH != NULL ){ - lapType = ParseLAPType( configH ); - } - CloseResFile( refNum ); - -exit: - if(lapType == NULL) - return (UsingOpenTransport() ? "OpenTransport" : NULL); - - return lapType; -} - - - -//-------------------------------------------------------------------------- -// Takes a 'ipln' resource and tries to figure out which LAP driver we are -// using. -//-------------------------------------------------------------------------- - -static char * ParseLAPType(IPConfig **configH ) -{ - const IPConfig *ipc; - static char laptypebuf[256]; - char *laptype = laptypebuf; // Added to allow having a single exit point - uchar hs; - - hs = HGetState( (Handle) configH ); - HLock( (Handle) configH ); // Don't forget to HSetState()! - ipc = *configH; - - // Check if MacTCP is using LocalTalk or Ethernet - if( ipc->activeLap == 128 || ipc->activeLap == 129 ){ - if (ipc->activeLap == 128) - laptype = "LocalTalk"; - else - laptype = "Ethernet"; - } else { - p2cstrcpy(laptype, (const unsigned char *)ipc->filename); - } - HSetState((Handle)configH, hs); - return laptype; -} - - - -//-------------------------------------------------------------------------- -// Search a folder for a file of a specific type and creator (specify 0L for -// any) that contains a resource of a given type. -// Returns a FSpec to that file. -//-------------------------------------------------------------------------- - -static OSErr -SearchFolderForRsrc( FSSpec *target, short vRefNum, long dirID, - OSType ftype, OSType fcrea, OSType rsrcType ) -{ - FSSpec fspec; - HParamBlockRec fi; - Handle rsrcH; - short refNum; - OSErr err; - Boolean oldResLoad; - - err = fnfErr; -#ifdef NEW_UNIVERSAL_HEADERS /* JAE */ - oldResLoad = LMGetResLoad(); -#else - oldResLoad = /* ResLoad */ true; -#endif /* NEW_UNIVERSAL_HEADERS */ - SetResLoad( false ); - - fspec.vRefNum = vRefNum; - fspec.parID = dirID; - - fi.fileParam.ioCompletion = NULL; - fi.fileParam.ioNamePtr = fspec.name; - fi.fileParam.ioVRefNum = vRefNum; - fi.fileParam.ioDirID = dirID; - fi.fileParam.ioFDirIndex = 1; - - while( PBHGetFInfoSync( &fi ) == noErr ) - { - // scan folder for resource files of specific type & creator - if( (fcrea == 0L || fi.fileParam.ioFlFndrInfo.fdCreator == fcrea) - && (ftype == 0L || fi.fileParam.ioFlFndrInfo.fdType == ftype) ) - { - // found the conforming file, try to open it - if( (refNum=FSpOpenResFile(&fspec,fsRdPerm)) != -1 ) - { - // see if a resource is there - rsrcH = GetIndResource( rsrcType, 1 ); - CloseResFile( refNum ); - - // if there, return noErr - if( rsrcH != NULL ){ - err = noErr; - *target = fspec; - break; - } - } - } - // check next file in folder - fi.fileParam.ioFDirIndex++; - fi.fileParam.ioDirID = dirID; // PBHGetFInfo() clobbers ioDirID - } - SetResLoad( oldResLoad ); - return err; -} - -#endif /* defined(OS_MAC) || defined(OS_UNIX_DARWIN) */ diff --git a/network/nsclilib/ni_net.h b/network/nsclilib/ni_net.h deleted file mode 100644 index 122ca6ec..00000000 --- a/network/nsclilib/ni_net.h +++ /dev/null @@ -1,222 +0,0 @@ -/* -* =========================================================================== -* -* PUBLIC DOMAIN NOTICE -* National Center for Biotechnology Information -* -* This software/database is a "United States Government Work" under the -* terms of the United States Copyright Act. It was written as part of -* the author's official duties as a United States Government employee and -* thus cannot be copyrighted. This software/database is freely available -* to the public for use. The National Library of Medicine and the U.S. -* Government have not placed any restriction on its use or reproduction. -* -* Although all reasonable efforts have been taken to ensure the accuracy -* and reliability of the software and data, the NLM and the U.S. -* Government do not and cannot warrant the performance or results that -* may be obtained by using this software or data. The NLM and the U.S. -* Government disclaim all warranties, express or implied, including -* warranties of performance, merchantability or fitness for any particular -* purpose. -* -* Please cite the author in any work or product based on this material. -* -* =========================================================================== -* -* File Name: ni_net.h -* -* Author: Beatty, Gish -* -* Version Creation Date: 1/1/92 -* -* $Revision: 6.3 $ -* -* File Description: -* -* -* Modifications: -* -------------------------------------------------------------------------- -* Date Name Description of modification -* ------- ---------- ----------------------------------------------------- -* 05-12-92 Epstein Converted tabs to spaces -* 01-21-94 Schuler Added NETP_INET_MACTCP symbol -* -* ========================================================================== -* -* -* RCS Modification History: -* $Log: ni_net.h,v $ -* Revision 6.3 2002/06/17 15:11:33 ivanov -* #include <arpa/inet.h> is absent on BeOS platform -* -* Revision 6.2 2001/04/05 02:36:22 juran -* Removed obsolete includes. -* -* Revision 6.1 1999/11/23 21:43:30 vakatov -* [WIN32] Always #define NETP_INET_WSOCK for Win32 -* -* Revision 6.0 1997/08/25 18:39:09 madden -* Revision changed to 6.0 -* -* Revision 5.0 1996/05/28 14:11:55 ostell -* Set to revision 5.0 -* - * Revision 4.0 1995/07/26 13:56:32 ostell - * force revision to 4.0 - * - * Revision 1.18 1995/07/05 14:23:58 kans - * move #include <sys/select.h> to ncbilcl.r6k - * - * Revision 1.17 1995/05/17 17:52:48 epstein - * add RCS log revision history - * -*/ - -#ifndef _NI_NET_ - -#if !defined(COMP_MPW) && !defined(OS_VMS) && !defined(COMP_METRO) -#include <fcntl.h> -#endif /* skip for COMP_MPW or OS_VMS or COMP_METRO */ - -#if defined(OS_MAC) && !defined(NETP_defined) -#define NETP_INET_MACTCP -#endif - -#ifdef NETP_INET_MACTCP -#include <netdb.h> -#include <s_types.h> -#include <s_socket.h> -#include <neti_in.h> -#include <a_inet.h> -#define _NI_NET_ -#endif /* NETP_INET_MACTCP */ - -#ifdef NETP_INET_NEWT -#undef TRUE -#undef FALSE -#undef NULL -#include <nmpcip.h> -#define _NI_NET_ -#endif /* NETP_INET_NEWT */ - -#ifdef NETP_INET_PCNFS -#include <netdb.h> -#include <sys/socket.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <netinet/in.h> -#include <windows.h> -#include <in_addr.h> -#include <sys/nfs_time.h> -#include <tk_errno.h> -#define _NI_NET_ -#endif /* NETP_INET_PCNFS */ - -/* TGV, Inc. Multinet TCP/IP suite */ -#ifdef NETP_INET_TGV -#include "Multinet_root:[multinet.include]netdb.h" -#include "Multinet_root:[multinet.include.sys]types.h" -#include "Multinet_root:[multinet.include.sys]socket.h" -#include "Multinet_root:[multinet.include.sys]ioctl.h" -#include "Multinet_root:[multinet.include.netinet]in.h" -#include "Multinet_root:[multinet.include.arpa]inet.h" -/*#include "Multinet_root:[multinet.include.sys]time.h"*/ -#include "Multinet_root:[multinet.include]errno.h" -#define _NI_NET_ -#endif /* NETP_INET_TGV */ - -/* The Wollongong Group, Inc. TCP/IP suite */ -#ifdef NETP_INET_TWG -#include <netdb.h> -#include <types.h> -#include <socket.h> -/*#include <ioctl.h>*/ -#include <in.h> -#include <inet.h> -#include <time.h> -#include <errno.h> -#define _NI_NET_ -#endif /* NETP_INET_TWG */ - -/* The Wollongong PathWay API 1.0 suite for OpenVMS */ -#ifdef NETP_INET_WPW -#include <netdb.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ioctl.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <sys/time.h> -#include <errno.h> -#define _NI_NET_ -#endif /* NETP_INET_TWG */ - -/* DEC TCP/IP for OpenVMS */ -#ifdef NETP_INET_UCX -#include <netdb.h> -#include <types.h> -#include <socket.h> -#include <in.h> -#include <inet.h> -#include <time.h> -#include <ucx$inetdef.h> -#include <iodef.h> -#define _NI_NET_ -#endif /* NETP_INET_UCX */ - - -#if defined(WIN32) && !defined(_NI_NET_) && !defined(NETP_INET_WSOCK) -# define NETP_INET_WSOCK -#endif -#ifdef NETP_INET_WSOCK -# undef NEAR -# undef FAR -# undef Beep -# undef PASCAL -# undef CDECL -# undef TRUE -# undef FALSE -# define STRICT -# include <windows.h> -# include <winsock.h> -# define _NI_NET_ -#endif /* NETP_INET_WSOCK */ - -/* default */ -#ifndef _NI_NET_ -#include <netdb.h> -#include <sys/socket.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <netinet/in.h> -#ifndef OS_UNIX_BEOS -#include <arpa/inet.h> -#endif -#include <sys/time.h> -#define _NI_NET_ -#endif /* _NI_NET_ */ - - /*** included from ni_lib.c *****/ - -#ifdef OS_UNIX -#include <signal.h> -#endif /* OS_UNIX */ -#ifdef NETP_INET_MACTCP -#include <neterrno.h> /* include missing error numbers */ -#endif /* NETP_INET_MACTCP */ -#ifdef OS_VMS -#include <perror.h> -#endif /* OS_VMS */ - -#ifdef NETP_SOCKS -#include <socks.h> -#endif - - /*** included from ni_msg.c *****/ - -#ifdef OS_VMS -#include <perror.h> -#endif /* OS_VMS */ - -#endif - diff --git a/network/nsclilib/ni_service.c b/network/nsclilib/ni_service.c index 90df41f9..10f9c94c 100644 --- a/network/nsclilib/ni_service.c +++ b/network/nsclilib/ni_service.c @@ -1,4 +1,4 @@ -/* $RCSfile: ni_service.c,v $ $Revision: 6.27 $ $Date: 2010/10/16 21:43:10 $ +/* $RCSfile: ni_service.c,v $ $Revision: 6.28 $ $Date: 2012/02/19 03:45:25 $ * ========================================================================== * * PUBLIC DOMAIN NOTICE @@ -30,6 +30,9 @@ * * -------------------------------------------------------------------------- * $Log: ni_service.c,v $ + * Revision 6.28 2012/02/19 03:45:25 lavr + * Cleanup of obsolete features + * * Revision 6.27 2010/10/16 21:43:10 lavr * Adjust timeout set sequence * @@ -118,6 +121,7 @@ #include <ncbi.h> #include <ncbinet.h> +#include <ctools/asn_connection.h> #include <connect/ncbi_connection.h> #include <connect/ncbi_service_connector.h> @@ -149,22 +153,6 @@ /* Static functions */ -static Int2 LIBCALLBACK s_AsnRead(Pointer p, CharPtr buf, Uint2 len) -{ - size_t n_read; - CONN_Read((CONN) p, buf, len, &n_read, eIO_ReadPlain); - return (Int2) n_read; -} - - -static Int2 LIBCALLBACK s_AsnWrite(Pointer p, CharPtr buf, Uint2 len) -{ - size_t n_written; - CONN_Write((CONN) p, buf, len, &n_written, eIO_WritePersist); - return (Int2) n_written; -} - - static void LIBCALLBACK s_AsnErrorFunc(Int2 type, CharPtr message) { ErrPostEx(SEV_ERROR, 88, type, message); @@ -207,18 +195,17 @@ static NI_HandPtr s_GenericGetService Char str[64]; NI_HandPtr result; double valf; - CONN conn; int val; CONNECTOR c; if (!(net_info = ConnNetInfo_Create(defService))) { - ErrPostEx(SEV_ERROR, 0, 1, "[Service NI Client] " - " Cannot set parameters for service \"%s\"", defService); + ErrPostEx(SEV_ERROR, 0, 1, "[%s] " + " Cannot create service parameters", defService); return 0; } if (!(def_info = ConnNetInfo_Clone(net_info))) { - ErrPostEx(SEV_ERROR, 0, 1, "[Service NI Client] " - " Cannot create reserve copy of network info"); + ErrPostEx(SEV_ERROR, 0, 1, "[%s] " + " Cannot reserve a copy of service parameters", defService); ConnNetInfo_Destroy(net_info); return 0; } @@ -308,8 +295,8 @@ static NI_HandPtr s_GenericGetService {{ /* alternate service name */ static const Char ENV_PREFIX[] = "NI_SERVICE_NAME_"; - CharPtr envName = (CharPtr)MemNew(sizeof(ENV_PREFIX) + - StringLen(configSection)); + CharPtr envName = (CharPtr) MemNew(sizeof(ENV_PREFIX) + + StringLen(configSection)); StringCpy(envName, ENV_PREFIX); StringCat(envName, configSection); StringUpper(envName); @@ -320,34 +307,32 @@ static NI_HandPtr s_GenericGetService ConnNetInfo_Destroy(def_info); - /* establish connection to the server */ - if (!(c = SERVICE_CreateConnectorEx(str, fSERV_Any, net_info, 0)) || - CONN_Create(c, &conn) != eIO_Success) { - ErrPostEx(SEV_ERROR, 0, 1, "[Service NI Client] " - " Service \"%s\" %s", str, c ? "unusable" : "not found"); - ConnNetInfo_Destroy(net_info); - return 0; + if ((result = (NI_HandPtr) MemNew(sizeof(NI_Handle))) != 0) { + /* establish connection to the server */ + CONN conn; + if (!(conn = CreateAsnConn_ServiceEx(str, + eAsnConn_Binary, &result->raip, + eAsnConn_Binary, &result->waip, + fSERV_Any, net_info, 0))) { + ErrPostEx(SEV_ERROR, 0, 1, "[%s] Cannot connect to service", str); + MemFree(result); + result = 0; + } else { + CONN_SetTimeout(conn, eIO_Open, net_info->timeout); + CONN_SetTimeout(conn, eIO_ReadWrite, net_info->timeout); + CONN_SetTimeout(conn, eIO_Close, net_info->timeout); + + AsnIoSetErrorMsg(result->raip, s_AsnErrorFunc); + AsnIoSetErrorMsg(result->waip, s_AsnErrorFunc); + + result->hostname = StringSave(net_info->client_host); + result->extra_proc_info = conn; + result->disp = disp; + disp->referenceCount++; + } } - CONN_SetTimeout(conn, eIO_Open, net_info->timeout); - CONN_SetTimeout(conn, eIO_ReadWrite, net_info->timeout); - CONN_SetTimeout(conn, eIO_Close, net_info->timeout); - /* open ASN i/o, etc. */ - if ((result = (NI_HandPtr) MemNew(sizeof(NI_Handle))) != 0) { - result->extra_proc_info = conn; - result->raip = AsnIoNew(ASNIO_BIN | ASNIO_IN, (FILE*) 0, - (void*) conn, s_AsnRead, (IoFuncType) 0); - result->waip = AsnIoNew(ASNIO_BIN | ASNIO_OUT, (FILE*) 0, - (void*) conn, (IoFuncType) 0, s_AsnWrite); - AsnIoSetErrorMsg(result->raip, s_AsnErrorFunc); - AsnIoSetErrorMsg(result->waip, s_AsnErrorFunc); - result->hostname = StringSave(net_info->client_host); - result->disp = disp; - disp->referenceCount++; - } else - CONN_Close(conn); ConnNetInfo_Destroy(net_info); - return result; } @@ -367,9 +352,8 @@ static Int2 s_EndServices(NI_DispatcherPtr disp) static Int2 s_ServiceDisconnect(NI_HandPtr mhp) { s_EndServices(mhp->disp); - CONN_Close((CONN)mhp->extra_proc_info); - AsnIoClose(mhp->raip); - AsnIoClose(mhp->waip); + /* Close callback takes care of aip's */ + CONN_Close((CONN) mhp->extra_proc_info); MemFree(mhp->hostname); MemFree(mhp); return 0; diff --git a/network/nsclilib/ni_types.h b/network/nsclilib/ni_types.h index 16dbc943..34d7e8bb 100644 --- a/network/nsclilib/ni_types.h +++ b/network/nsclilib/ni_types.h @@ -29,7 +29,7 @@ * * Version Creation Date: 1/1/92 * -* $Revision: 6.7 $ +* $Revision: 6.8 $ * * File Description: * @@ -37,6 +37,9 @@ * Modifications: * -------------------------------------------------------------------------- * $Log: ni_types.h,v $ +* Revision 6.8 2012/02/19 03:45:25 lavr +* Cleanup of obsolete features +* * Revision 6.7 2004/11/19 14:11:03 lavr * Reinstate OBSOLETED eNII_ constants which still may be in use in some DEAD code in the toolkit * @@ -83,146 +86,16 @@ #define NI_Handle MHandle /* for API use */ #define NI_HandPtr MHandPtr /* for API use */ -#define NI_Request Request /* for API use */ -#define NI_ReqPtr ReqPtr /* for API use */ - -#define INETADDR_SIZ 16 /* of the form 255.255.255.255 */ - -#define NI_ConnState enum NIConState -NI_ConnState { - NI_ERROR_COND = 0, - NI_CREATED, - NI_BOUND, - NI_CONNECTED, - NI_DISCARD, /* disconnect pending (requested) */ - NI_DISCONNECTED -}; - -typedef Int4 (LIBCALLBACK *NI_ReadFilt) PROTO((VoidPtr mh, CharPtr buf, int bytesread, int len, CharPtr PNTR extra_buf, Int4Ptr extra_buf_len)); -typedef Int4 (LIBCALLBACK *NI_WriteFilt) PROTO((VoidPtr mh, CharPtr buf, int len, CharPtr tmpbuf)); -typedef void (LIBCALLBACK *NI_TimeoutHook) PROTO((Pointer p)); - -typedef struct encr { - VoidPtr desWriteContext; /* really a DES_CBC_CTX structure */ - VoidPtr desReadContext; /* really a DES_CBC_CTX structure */ - Uint1 encrType; - Int1 state; - Int2 numDeferredBytes; - Int2 realDataLeft; - Int2 bytesToRead; - Uchar deferredData[15]; - NI_WriteFilt write_filter; /* output filter routine */ - NI_ReadFilt read_filter; /* input filter routine */ -} NI_EncrData, PNTR NI_EncrDataPtr; typedef struct MHandle { CharPtr hostname; /* name of peer machine */ - Uint4 conid; /* unique connection id number */ - Uint4 seqno; /* unique message number */ - NI_ConnState state; /* of connection - bound, connected, etc. */ - int sok; /* the socket or file descriptor */ - int r_timeout; /* read timeout value in seconds */ - int w_timeout; /* write timeout value in seconds */ - Uint4 peer; /* Internet address of peer */ AsnIoPtr raip; /* ASNtool IO read pointer */ AsnIoPtr waip; /* ASNtool IO write pointer */ - Boolean longjump; /* TRUE if OK to use longjump (servers) */ - time_t access_time; /* time stamp of last access */ - Boolean unblocked_mode; /* is this interface "unblocked" ? */ - Boolean have_blocked; /* have we blocked reading this msg? */ - int num_queued_bytes; /* amt of queued data for this msg */ - int cur_index; /* current index for reading queue */ - NodePtr queued_data_list; /* queued data for this msg */ VoidPtr extra_proc_info; /* extra processing info, used externally */ - NI_WriteFilt write_filter; /* output filter routine */ - NI_ReadFilt read_filter; /* input filter routine */ - Boolean write_filt_pass_thru; /* write filter is pass-thru */ - Boolean read_filt_pass_thru; /* read filter is pass-thru */ - NI_TimeoutHook readTimeoutHook; /* hook for read timeout expiration */ - NI_TimeoutHook writeTimeoutHook; /* hook for write tmout expiration */ - NodePtr readTimer; - NodePtr writeTimer; - Boolean isBrokered; - Uint2 brokeredPort; - NI_EncrDataPtr encryption; - Uint2 connectDelay; struct NI_Dispatcher PNTR disp; } MHandle, PNTR MHandPtr; -typedef enum _NetServHookCode_ { - NetServHook_dispconn = 1, - NetServHook_svcreq, - NetServHook_svcdisconn, - NetServHook_dispdisconn, - NetServHook_read, - NetServHook_write -} NI_NetServHookCode; - -typedef void (LIBCALLBACK *NI_NetServHook) PROTO((NI_HandPtr, NI_NetServHookCode, int)); - - -typedef struct NICatalog { - Uint4 seqno; - CharPtr motd; - NodePtr toolsetL; -} NICatalog, PNTR NICatalogPtr; - -typedef struct NIStatus { - FloatHi load; - FloatHi power; - FloatHi lightThresh; - FloatHi heavyThresh; - FloatHi jobPenalty; -} NIStatus, PNTR NIStatusPtr; - -typedef struct NIRegion { - CharPtr regionName; - Uint2 priorityDelta; /* incentive to clients in that region */ -} NIRegion, PNTR NIRegionPtr; - -typedef struct NIToolset { - CharPtr host; - CharPtr motd; - NodePtr services; - NodePtr resources; - NodePtr regions; -} NIToolset, PNTR NIToolsetPtr; - -typedef struct NIService { - CharPtr name; /* name of service */ - Uint2 minVersion; - Uint2 maxVersion; /* NULL if infinite */ - Uint2 id; /* ID that is unique on host */ - Uint2 priority; /* priority of service */ - CharPtr group; /* group with access to resource */ - CharPtr descrip; /* description of service */ - NodePtr typeL; /* list of res types supported by svc */ - NodePtr subSetList; /* svcs of which this supports a subset */ - NodePtr superSetList; /* svcs of which this supports a superset */ - Uint2 priorityTimeout; /* timeout by which dispd must hear */ - Uint2 priorityPenalty; /* resp from ncbid or impose penalty */ - Boolean encryptionSupported; /* does this service support encryption? */ - Uint2 trackingPeriod; /* time over which Dispatcher track(s/ed) this service */ - Uint4 trackingCount; /* # service requests for this service&IP during tracking-period */ -} NIService, PNTR NISvcPtr; - -typedef struct NIResource { - CharPtr name; - CharPtr type; /* same as a service name ? */ - Uint2 minVersion; - Uint2 maxVersion; - Uint2 id; /* ID that is unique on host */ - CharPtr group; /* group with access to resource */ - CharPtr descrip; /* description of resource */ -} NIResource, PNTR NIResPtr; - -typedef struct NI_Uid { - CharPtr username; /* kerberos principle */ - CharPtr group; /* kerberos instance */ - CharPtr domain; /* kerberos realm */ -} NI_Uid, PNTR NI_UidPtr; - /* The available connection interfaces */ @@ -248,50 +121,10 @@ typedef enum { typedef struct NI_Dispatcher { ENIInterface interface; - struct Request PNTR reqResponse; /* ptr to request struct with actual services/resources used */ - CharPtr dispHostName; - CharPtr dispServiceName; - Int4 dispSerialNo; - Char localHostAddr[INETADDR_SIZ]; /* Internet address of client */ - NI_HandPtr dispHP; /* handle for dispatcher */ - NI_HandPtr svcsHP; /* handle for incoming services */ - Uint2 clientPort; - NI_UidPtr identity; /* client identity struct */ - int dispTimeout; /* timeout when communicating w/dispatcher */ - Int2 loport; /* range of client ports to bind */ - Int2 hiport; /* range of client ports to bind */ Int2 referenceCount; /* # of services connected via this dispatcher */ - Boolean someBrokered; /* some services are brokered */ - Boolean brokeredDummy; /* indicates that this is a dummy */ - ValNodePtr encryptInfo; /* encryption information, or NULL */ - Boolean useSocks; /* client should use SOCKS */ CharPtr adminInfo; /* info. regarding administrator */ CharPtr motd; /* message of the day for user */ - Boolean useOutServ; /* indicates that client will use direct connection */ } NI_Dispatcher, PNTR NI_DispatcherPtr; -typedef struct Request { - CharPtr clientAddr; - Uint2 clientPort; - NISvcPtr service; /* ptr to a service (NOT a node) */ - NodePtr resourceL; /* ptr to list of resources */ - NI_DispatcherPtr dispatcher; /* dispatcher on which req is made */ -} Request, PNTR ReqPtr; - -typedef struct NI_PubKey { - Int2 bits; /* bits used in modulus */ - ByteStorePtr modulus; - ByteStorePtr exponent; -} NI_PubKey, PNTR NI_PubKeyPtr; - - -typedef struct NI_DispInfo { - Int4 serialno; /* unique dispatcher serial # */ - Boolean isalternatelist;/* is this an alternate disp-list ? */ - int numdispatchers; /* number of dispachers in disp-list */ - CharPtr PNTR displist; /* list of dispatchers */ - NI_PubKeyPtr pubKey; -} NI_DispInfo, PNTR NI_DispInfoPtr; - #endif diff --git a/network/pcnfs/README b/network/pcnfs/README deleted file mode 100644 index 74ae243a..00000000 --- a/network/pcnfs/README +++ /dev/null @@ -1,21 +0,0 @@ -In order to use the NCBI network services in conjunction with the PC-NFS 4.0 -development tools, it is necessary to copy and create the following directories -into this directory after you have installed PC-NFS development software -version 4.0a: - -include (including all its associated subdirectories) -borlib -msclib - -These files are copyrighted by Sun Microsystems, so it is not possible for -NCBI to distribute them in its software tree. - -Note that you may, e.g., refrain from copying the msclib directory if -you are only using the Borland compiler, and conversely. - -Note that applications developed in this environment must (according to -the PC-NFS documentation) only be run with PC-NFS version 4.0 or 4.0a. - -Note that for PC-NFS version 5.0 and up, you should ignore this -directory and instead use the instructions which appear in the winsock -directory of this source tree, since PC-NFS 5.0 is WinSock-compliant. diff --git a/network/socks/socks.cstc.4.2.pre1.tar.Z b/network/socks/socks.cstc.4.2.pre1.tar.Z Binary files differdeleted file mode 100644 index cc4c38c7..00000000 --- a/network/socks/socks.cstc.4.2.pre1.tar.Z +++ /dev/null diff --git a/network/wwwblast/Src/wwwblast.c b/network/wwwblast/Src/wwwblast.c index 458858e9..c3bbe233 100644 --- a/network/wwwblast/Src/wwwblast.c +++ b/network/wwwblast/Src/wwwblast.c @@ -1,4 +1,4 @@ -/* $Id: wwwblast.c,v 1.15 2004/05/03 15:11:46 dondosha Exp $ +/* $Id: wwwblast.c,v 1.16 2011/12/19 18:41:34 gouriano Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE @@ -29,12 +29,15 @@ * * Initial Creation Date: 03/15/2000 * -* $Revision: 1.15 $ +* $Revision: 1.16 $ * * File Description: * Standalone WWW Blast CGI program. * * $Log: wwwblast.c,v $ +* Revision 1.16 2011/12/19 18:41:34 gouriano +* Corrected printf formatting. NOJIRA +* * Revision 1.15 2004/05/03 15:11:46 dondosha * Added support for masking query in XML output * @@ -1073,7 +1076,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) /* Open HTML form */ - sprintf(form_name, "BLASTFORM%ld", query_number); + sprintf(form_name, "BLASTFORM%d", query_number); fprintf(stdout, "<FORM NAME=\"%s\">\n", form_name); fflush(stdout); |