1 /* BLURB lgpl
2 
3                            Coda File System
4                               Release 5
5 
6           Copyright (c) 1987-1999 Carnegie Mellon University
7                   Additional copyrights listed below
8 
9 This  code  is  distributed "AS IS" without warranty of any kind under
10 the  terms of the  GNU  Library General Public Licence  Version 2,  as
11 shown in the file LICENSE. The technical and financial contributors to
12 Coda are listed in the file CREDITS.
13 
14                         Additional copyrights
15 
16 #*/
17 
18 /*
19                          IBM COPYRIGHT NOTICE
20 
21                           Copyright (C) 1986
22              International Business Machines Corporation
23                          All Rights Reserved
24 
25 This  file  contains  some  code identical to or derived from the 1986
26 version of the Andrew File System ("AFS"), which is owned by  the  IBM
27 Corporation.   This  code is provided "AS IS" and IBM does not warrant
28 that it is free of infringement of  any  intellectual  rights  of  any
29 third  party.    IBM  disclaims  liability of any kind for any damages
30 whatsoever resulting directly or indirectly from use of this  software
31 or  of  any  derivative work.  Carnegie Mellon University has obtained
32 permission to  modify,  distribute and sublicense this code,  which is
33 based on Version 2  of  AFS  and  does  not  contain  the features and
34 enhancements that are part of  Version 3 of  AFS.  Version 3 of AFS is
35 commercially   available   and  supported  by   Transarc  Corporation,
36 Pittsburgh, PA.
37 
38 */
39 
40 
41 #include <stdio.h>
42 #include <sys/types.h>
43 #include <sys/socket.h>
44 #include <netinet/in.h>
45 #include <netdb.h>
46 #include <sys/time.h>
47 #include <errno.h>
48 #include "rpc2.private.h"
49 #include <rpc2/se.h>
50 
51 
52 /* Contains the storage for all globals used in rpc2; see
53    rpc2.private.h for descriptions */
54 
55 long RPC2_Perror=1, RPC2_DebugLevel=0, RPC2_Trace = 0; /* see rpc2.h */
56 
57 /* whether the client can handle RPC2_HOSTBYADDRINFO and IPv6 connections */
58 int rpc2_ipv6ready;
59 
60 int rpc2_v4RequestSocket = -1;
61 int rpc2_v6RequestSocket = -1;
62 RPC2_PortIdent rpc2_LocalPort;
63 
64 struct TM_Elem *rpc2_TimerQueue;
65 struct CBUF_Header *rpc2_TraceBuffHeader = NULL;
66 PROCESS rpc2_SocketListenerPID=NULL;
67 
68 long Retry_N;			/* total number of retries -- see packet.c */
69 struct timeval KeepAlive;	/* keepalive timeout */
70 uint32_t *rpc2_RTTvals;		/* precomputed retry timeout values */
71 long rpc2_Bandwidth = 10485760; /* bandwidth hint supplied externally */
72 
73 /* Doubly-linked lists and counts */
74 long rpc2_ConnFreeCount, rpc2_ConnCount = -1, rpc2_ConnCreationCount;
75 
76 struct MEntry *rpc2_MgrpFreeList;
77 long rpc2_MgrpFreeCount, rpc2_MgrpCreationCount;
78 
79 struct SL_Entry *rpc2_SLFreeList, *rpc2_SLReqList, *rpc2_SLList;
80 long rpc2_SLFreeCount, rpc2_SLReqCount, rpc2_SLCount, rpc2_SLCreationCount;
81 
82 RPC2_PacketBuffer *rpc2_PBSmallFreeList, *rpc2_PBMediumFreeList,
83                 *rpc2_PBLargeFreeList, *rpc2_PBList, *rpc2_PBHoldList;
84 long rpc2_PBSmallFreeCount, rpc2_PBSmallCreationCount, rpc2_PBMediumFreeCount,
85 	rpc2_PBMediumCreationCount, rpc2_PBLargeFreeCount, rpc2_PBLargeCreationCount;
86 long  rpc2_PBCount, rpc2_PBHoldCount, rpc2_PBFreezeCount;
87 
88 
89 struct SubsysEntry *rpc2_SSFreeList, *rpc2_SSList;
90 long rpc2_SSFreeCount, rpc2_SSCount, rpc2_SSCreationCount;
91 
92 struct HEntry *rpc2_HostFreeList, *rpc2_HostList;
93 long rpc2_HostFreeCount, rpc2_HostCount, rpc2_HostCreationCount;
94 
95 
96 /* Packet transmission statistics */
97 struct SStats rpc2_Sent;
98 struct RStats rpc2_Recvd;
99 struct SStats rpc2_MSent;
100 struct RStats rpc2_MRecvd;
101 
102 unsigned long rpc2_LamportClock;
103 
104 
105 /* Other miscellaneous globals */
106 long rpc2_BindLimit = -1;   /* At most how many can be in the request queue; -1 ==> infinite */
107 long rpc2_BindsInQueue;
108 
109 long rpc2_Unbinds, rpc2_FreeConns, rpc2_AllocConns, rpc2_GCConns;
110 
111 long rpc2_AllocMgrps, rpc2_FreeMgrps;
112 
113 long rpc2_HoldHWMark, rpc2_FreezeHWMark;
114 
115 char *rpc2_LastEdit = "$Header: /afs/cs/project/coda-src/cvs/rpc2/rpc2-src/globals.c,v 4.60 2010-03-22 19:18:41 jaharkes Exp $";
116 
117 long rpc2_errno;
118 
119 
120 /* Obsolete: purely for compatibility with /vice/file */
121 long rpc2_TimeCount, rpc2_CallCount, rpc2_ReqCount, rpc2_AckCount, rpc2_MaxConn;
122 
123