srvip.h File Reference

#include "project.def"
#include "servdef.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <stddef.h>
#include "unixcmd.h"

Include dependency graph for srvip.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tcpIdleConnectionStruct
struct  tcpbckt

Defines

#define UDP_PORT   9003
#define TCP_LEGACYPORT   8003
#define TCP_PORT   8503
#define GCAST_PORT   8004
#define NETSRV_PORT   9002
#define MCAST_PORT   9503
#define UDP_CLN_PORT   8050
#define UDP_CLN_RANGE   (UDP_CLN_PORT+1000)
#define NETBCST_ADDR   "0.0.0.0"
#define NETSRV_ADDR   "238.1.1.2"
#define MCAST_ADDR   "238.1.1.1"
#define GCAST_ADDR   "238.1.1.0"
#define MCAST_TTL   16
#define CLN_PATH   "/var/tmp/"
#define CLN_PERM   S_IRWXU
#define IPC_PATH   "/tmp/"
#define IPC_PERM   S_IRWXU
#define MAX_TCPCONNECTIONS   32
#define MIN_FDSETS   16
#define DEFAULT_TCP_CONNECTION_TIMEOUT   200
#define TIME_SERVER_HOST   NULL
#define LOOPBACKADDR   "127.0.0.1"
#define IPPORT_ECHO   7
#define NETSRV_SOCKET   6565
#define soerr(s)   {cc = udp_socket_error; strcat(txt,s); goto err;}
#define writeto(fd, bf, sz, fg, ad, ln)
#define readfrom(fd, bf, sz, fg, ad, ln)
#define ProcessData(sck, bf)
#define recvIncomingIPData(sck)
#define setupGlobalsSocket(sck, p)

Typedefs

typedef tcpIdleConnectionStruct IDLE_CONNECTION
typedef tcpbckt TCPBCKT

Functions

IDLE_CONNECTIONgetIdleConnection (int idx)
IDLE_CONNECTIONAddIdleConnection (int sck, int idx)
IDLE_CONNECTIONRemoveIdleConnection (IDLE_CONNECTION *ic)
TCPBCKTfindBucket (int sck)
TCPBCKTgetBucket (int sck)
void freeBucket (int sck)
void FD_MERGE (fd_set fdsrc, fd_set *fddst)
void CloseConnectionSocket (int sck)
void closeIPConnectionToFec (int index)
int ListenForIPMulticasts (void)
int ListenForIPNetGlobals (void)
UINT32 getmyipaddr (void)
int getIPControlNets (char *fn, int *nr, struct sockaddr_in **list)
int appendRegisteredNetsList (char *fn, int *nr, struct sockaddr_in **list, char *ipaddr)
int isUnixSocket (int sck)

Variables

int BroadcastServer
char gIpcTinePipe [64]
int nipcconsumers
int gUseLoopback
int gtUDPPort
int gtTCPPort
int gtGCastPort
int gtNetSrvPort
int gtMCastPort
int gtUDPClnPort
char * gtNetLclBcast
char * gtNetSrvAddr
char * gtMCastAddr
char * gtGCastAddr
int gtMCastTTL
IDLE_CONNECTIONtcpIdleConnectionList
TCPBCKTbcktList
int * TCPsck
int nTCPsck
int maxFdSets
int maxTCPConnections
int IPXProducerSocket
int IPXConsumerSocket
int IPXMCastConsumerSocket
int ipcProducerSocket
in_addr tMCastAddr
in_addr tGCastAddr
in_addr tNetSrvAddr
sockaddr_in tMCastAddrSck
sockaddr_in tGCastAddrSck
sockaddr_in tNetSrvAddrSck
fd_set ext_set
int externalFdSets
sockaddr_in * IPNetList
int NrOfIPNets
sockaddr_in * IPBcastList
int NrOfIPBcastNets
void(*) socketAcceptEntryFcn (void)
int ListenForGlobals


Detailed Description

server-side (and client-side) structs, macros, prototypes, etc.

Definition in file srvip.h.


Define Documentation

#define CLN_PATH   "/var/tmp/"

Definition at line 87 of file srvip.h.

Referenced by CMDconnect().

#define CLN_PERM   S_IRWXU

Definition at line 89 of file srvip.h.

Referenced by CMDconnect().

#define DEFAULT_TCP_CONNECTION_TIMEOUT   200

Definition at line 102 of file srvip.h.

Referenced by connectTCP().

#define GCAST_ADDR   "238.1.1.0"

Definition at line 79 of file srvip.h.

#define GCAST_PORT   8004

Definition at line 48 of file srvip.h.

#define IPC_PATH   "/tmp/"

Definition at line 91 of file srvip.h.

Referenced by initTCP().

#define IPC_PERM   S_IRWXU

Definition at line 93 of file srvip.h.

#define IPPORT_ECHO   7

Definition at line 112 of file srvip.h.

Referenced by getmyipaddr().

#define LOOPBACKADDR   "127.0.0.1"

Definition at line 109 of file srvip.h.

Referenced by fixFecProtocol().

#define MAX_TCPCONNECTIONS   32

Definition at line 96 of file srvip.h.

#define MCAST_ADDR   "238.1.1.1"

Definition at line 75 of file srvip.h.

#define MCAST_PORT   9503

Definition at line 56 of file srvip.h.

#define MCAST_TTL   16

Definition at line 83 of file srvip.h.

#define MIN_FDSETS   16

Definition at line 99 of file srvip.h.

Referenced by initTCP().

#define NETBCST_ADDR   "0.0.0.0"

Definition at line 67 of file srvip.h.

#define NETSRV_ADDR   "238.1.1.2"

Definition at line 71 of file srvip.h.

#define NETSRV_PORT   9002

Definition at line 52 of file srvip.h.

#define NETSRV_SOCKET   6565

Definition at line 115 of file srvip.h.

Referenced by SendSubBuffer().

#define ProcessData ( sck,
bf   ) 

Value:

{\
  if (IncomingNetworkProtocol == TCP || IncomingNetworkProtocol == PIPE) {\
    if ((bckt=findBucket(sck)) != NULL) {\
      nleft = nread;\
      while (nleft > 0) {\
        if (bckt->ptr == 0) bckt->siz = PeekWord(*(short *)(bf));\
        n = bckt->siz - bckt->ptr;\
        if (nleft >= n) {\
          memcpy(&bckt->buf[bckt->ptr],bf,n);\
          consumeData(bckt->buf);\
          bf += n;\
          nleft -= n;\
          bckt->ptr = 0;\
        } else {\
          memcpy(&bckt->buf[bckt->ptr],bf,nleft);\
          bckt->ptr += nleft;\
          nleft = 0;\
        }\
      }\
    }\
  } else {\
    consumeData(bf);\
  }\
}

Definition at line 194 of file srvip.h.

#define readfrom ( fd,
bf,
sz,
fg,
ad,
ln   ) 

Value:

(\
  !isUnixSocket(fd) ? recvfrom(fd,bf,sz,fg,ad,(int *)ln) : read(fd,bf,sz)\
)

Definition at line 186 of file srvip.h.

Referenced by getConsumerIPAddress().

#define recvIncomingIPData ( sck   ) 

Value:

{\
  if (FD_ISSET(sck,&conset)) {\
    if ((nread=readfrom(sck,(char *)clnWorkArea,MIN_WORK_SIZE,0,(struct sockaddr *)&IncomingIPfec,&len)) > 0 &&\
        (n=PeekWord(*(short *)clnWorkArea)) > 0)\
    {\
      if (IncomingNetworkProtocol == TCP) {\
        len = sizeof(IncomingIPfec);\
        getpeername(sck,(struct sockaddr *)&IncomingIPfec,(int *)&len);\
        inet_ntoa_b(IncomingIPfec.sin_addr,fecaddr);\
      } else if (IncomingNetworkProtocol == PIPE) {\
        strncpy(fecaddr,"local pipe",16);\
      } else if (nread == n) {\
        inet_ntoa_b(IncomingIPfec.sin_addr,fecaddr);\
      }\
      bufptr = clnWorkArea; ProcessData(sck,bufptr);\
    } else {\
      if (IncomingNetworkProtocol == PIPE) {\
        close(sck); freeBucket(sck); sck = 0;\
      }\
    }\
    if (NGdebug > 3) {\
      if (nread <= 0) dbglog("%s: read error",fecprot);\
      else dbglog("%s: %d bytes read from %d",fecprot,nread,n);\
    }\
  }\
}

Definition at line 219 of file srvip.h.

Referenced by doUDPConsumer().

#define setupGlobalsSocket ( sck,
 ) 

Value:

{\
  if (listenUDP(&(sck),p)) {\
    sck = 0;\
    feclog("cannot open %s socket",p == GCAST_PORT ? "GLOBALS" : "MCAST");\
  }\
  if (sck) FD_SET(sck,&conset);\
}

Definition at line 251 of file srvip.h.

Referenced by initIPClient(), ListenForIPMulticasts(), and ListenForIPNetGlobals().

#define soerr (  )     {cc = udp_socket_error; strcat(txt,s); goto err;}

Definition at line 153 of file srvip.h.

Referenced by initTCP(), listenUDP(), and setupTCPServerSocket().

#define TCP_LEGACYPORT   8003

Definition at line 42 of file srvip.h.

Referenced by initTCP().

#define TCP_PORT   8503

Definition at line 44 of file srvip.h.

#define TIME_SERVER_HOST   NULL

Definition at line 106 of file srvip.h.

Referenced by getTimeServerHost().

#define UDP_CLN_PORT   8050

Definition at line 60 of file srvip.h.

#define UDP_CLN_RANGE   (UDP_CLN_PORT+1000)

Definition at line 64 of file srvip.h.

Referenced by listenUDP().

#define UDP_PORT   9003

Definition at line 39 of file srvip.h.

#define writeto ( fd,
bf,
sz,
fg,
ad,
ln   ) 

Value:

(\
  !isUnixSocket(fd) ? sendto(fd,bf,sz,fg,ad,ln) : write(fd,bf,sz)\
)

Definition at line 183 of file srvip.h.

Referenced by SendIPData().


Typedef Documentation

typedef struct tcpIdleConnectionStruct IDLE_CONNECTION

typedef struct tcpbckt TCPBCKT


Function Documentation

IDLE_CONNECTION* AddIdleConnection ( int  sck,
int  idx 
)

Definition at line 374 of file clnip.c.

References dbglog(), getIdleConnection(), tcpIdleConnectionStruct::idx, NGdebug, tcpIdleConnectionStruct::nxt, tcpIdleConnectionStruct::prv, RPCFec, tcpIdleConnectionStruct::sck, SystemCalloc, tcpIdleConnectionList, and tcpIdleConnectionStruct::ttl.

Referenced by markTCPConnectionAsIdle().

00375 {
00376   IDLE_CONNECTION *ic=NULL;
00377 
00378   if ((ic=getIdleConnection(idx)) != NULL) return ic;
00379   if ((ic=(IDLE_CONNECTION *)SystemCalloc(1,sizeof(IDLE_CONNECTION))) == NULL) return NULL;
00380   ic->sck = sck;
00381   ic->idx = idx;
00382   ic->ttl = 300000;
00383   ic->nxt = tcpIdleConnectionList;
00384   if (tcpIdleConnectionList != NULL) tcpIdleConnectionList->prv = ic;
00385   tcpIdleConnectionList = ic;
00386   if (NGdebug) dbglog("mark TCP connection to %s (sck %d) as idle",RPCFec[idx].Name,ic->sck);
00387   return ic;
00388 }

Here is the call graph for this function:

Here is the caller graph for this function:

int appendRegisteredNetsList ( char *  fn,
int *  nr,
struct sockaddr_in **  list,
char *  ipaddr 
)

Definition at line 88 of file srvip.c.

References argument_list_error, ccerr, DWORD, FecDBpath, getIPControlNets(), gtGCastPort, MaxNumAllowedIPNets, no_such_file, out_of_server_memory, resources_exhausted, SystemCalloc, and UINT16.

Referenced by appendRegisteredBCastNetsList(), and appendRegisteredIPNetsList().

00089 {
00090   int cc=0, i, nlist = *nr;
00091   DWORD haddr;
00092   struct sockaddr_in *lst = *list;
00093 # ifndef FS_NONE /* normal case: there is a file system */
00094   FILE *fp = NULL;
00095   char netsfilename[128],ip[32];
00096   if (ipaddr == NULL || strlen(ipaddr) == 0) ccerr(argument_list_error);
00097   for (i=0; i<nlist; i++) 
00098   {
00099     haddr = inet_addr(ipaddr);
00100     if (!memcmp(&lst[i].sin_addr,&haddr,4)) break;
00101   }
00102   if (i < nlist) return 0; /* already in list */
00103   sprintf(netsfilename,"%s%s",FecDBpath,fn);
00104   if ((fp=fopen(netsfilename,"a")) == NULL) ccerr(no_such_file);
00105   fseek(fp,0,SEEK_END);
00106   if (ftell(fp) == 0)
00107   {
00108     fprintf(fp,"SUBNET\n");  /* file did not exist before */
00109   }
00110   strncpy(ip,ipaddr,16); ip[16] = 0;
00111   fprintf(fp,"%s\n",ip);
00112   fclose(fp);
00113   getIPControlNets(fn,nr,list);
00114 # else
00115   if (lst == NULL)
00116   {
00117     if ((lst=(struct sockaddr_in *)SystemCalloc(MaxNumAllowedIPNets,sizeof(struct sockaddr_in))) == NULL)
00118       ccerr(out_of_server_memory);
00119     *list = lst;
00120     nlist = 0;
00121   }
00122   if (ipaddr == NULL || strlen(ipaddr) == 0) ccerr(argument_list_error);
00123   for (i=0; i<nlist; i++) 
00124   {
00125     haddr = inet_addr(ipaddr);
00126     if (!memcmp(lst[i].sin_addr,&haddr,4)) break;
00127   }
00128   if (i < nlist) return 0; /* already in list */
00129   if (nlist == MaxNumAllowedIPNets) ccerr(resources_exhausted);
00130   haddr = inet_addr(scratch);
00131   lst[i].sin_family = AF_INET;
00132   lst[i].sin_port = htons((UINT16)gtGCastPort); /* potential broadcasting */
00133   memcpy(&lst[i].sin_addr,&haddr,4);
00134   nlist++;
00135   *nr = nlist;
00136 # endif
00137 err:
00138   return cc;
00139 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CloseConnectionSocket ( int  sck  ) 

Definition at line 197 of file iplib.c.

References closeIPConnectionToFec(), connTable, conset, Consumers, freeBucket(), nConnectionTableEntries, nconsumer, nTCPsck, rwset, soclose, TCPsck, and TCPsocket.

Referenced by getConsumerIPAddress(), and SendIPData().

00198 {
00199   int i;
00200   unsigned int usck = (unsigned int)sck;
00201 
00202   FD_CLR(usck,&rwset); FD_CLR(usck,&conset);
00203   freeBucket(sck);
00204 
00205   for (i=0; i<nTCPsck; i++)              /* socket on the server side ? */
00206   {
00207     if (sck == TCPsck[i])
00208     {
00209       if (sck != 0) soclose(sck);
00210       TCPsck[i] = 0;
00211       nTCPsck--;
00212       break;
00213     }
00214   }
00215   for (; i<nTCPsck; i++) TCPsck[i] = TCPsck[i+1];
00216   for (i=0; i<nconsumer; i++) if (Consumers[i]->sck == sck) Consumers[i]->sck = 0;
00217   for (i=0; i<nConnectionTableEntries; i++)
00218   {
00219     if (connTable[i]->TCPsocket == sck) /* socket on the client side ? */
00220     {
00221       closeIPConnectionToFec(connTable[i]->FECindex);
00222       return;
00223     }
00224   }
00225 }

Here is the call graph for this function:

Here is the caller graph for this function:

void closeIPConnectionToFec ( int  index  ) 

Definition at line 182 of file clnip.c.

References connTable, feclog(), nConnectionTableEntries, RPCFecStruct::Prot, RPCFec, soclose, TCP, TCPloaded, ConnTableEntry::TCPsocket, TCPsocket, and UDP.

Referenced by CloseConnectionSocket().

00183 {
00184   int i,done = 0;
00185   if (!TCPloaded) return;
00186   if (RPCFec[index].Prot != TCP) return;
00187   RPCFec[index].Prot = UDP;
00188   for (i=0; i<nConnectionTableEntries; i++)
00189   {
00190     if (index != connTable[i]->FECindex) continue;
00191     if (!done)
00192     {
00193       done = -1;
00194       shutdown(connTable[i]->TCPsocket,2);
00195       soclose(connTable[i]->TCPsocket);
00196     }
00197     connTable[i]->TCPsocket = 0;         /* signal for new connection */
00198     feclog("TCP link to %s %s terminated",connTable[i]->name, connTable[i]->prop);
00199   }
00200   return;
00201 }

Here is the call graph for this function:

Here is the caller graph for this function:

void FD_MERGE ( fd_set  fdsrc,
fd_set *  fddst 
)

Definition at line 96 of file iplib.c.

References BYTE.

Referenced by AcceptIP(), and doUDPConsumer().

00097 {
00098   int i;
00099   for (i=0; i<(int)sizeof(fd_set); i++)
00100     ((BYTE *)fddst)[i] |= ((BYTE *)&fdsrc)[i];
00101 }

Here is the caller graph for this function:

TCPBCKT* findBucket ( int  sck  ) 

Definition at line 165 of file iplib.c.

References bcktList, tcpbckt::nxt, and tcpbckt::sck.

Referenced by freeBucket(), and getConsumerIPAddress().

00166 {
00167   TCPBCKT *bckt=NULL;
00168   for (bckt=bcktList; bckt != NULL && bckt->sck != sck; bckt=bckt->nxt);
00169   return bckt;
00170 }

Here is the caller graph for this function:

void freeBucket ( int  sck  ) 

Definition at line 184 of file iplib.c.

References bcktList, findBucket(), tcpbckt::nxt, and SystemFree.

Referenced by CheckConnections(), CloseConnectionSocket(), and SendSubBuffer().

00185 {
00186   TCPBCKT *bckt,*b;
00187   if ((bckt=findBucket(sck)) == NULL) return;
00188   if (bckt == bcktList) bcktList = bckt->nxt;
00189   else
00190   {
00191     for (b=bcktList; b != NULL && b->nxt != bckt; b = b->nxt);
00192     if (b == NULL || b->nxt == NULL) return;
00193     b->nxt = bckt->nxt;
00194   }
00195   SystemFree(bckt);
00196 }

Here is the call graph for this function:

Here is the caller graph for this function:

TCPBCKT* getBucket ( int  sck  ) 

Definition at line 171 of file iplib.c.

References bcktList, tcpbckt::nxt, tcpbckt::sck, and SystemCalloc.

Referenced by AcceptIPC(), and AssignConnectionSocket().

00172 {
00173   TCPBCKT *bckt=NULL;
00174   for (bckt=bcktList; bckt != NULL; bckt=bckt->nxt)
00175   if (bckt->sck == sck) return bckt;
00176   if ((bckt=(TCPBCKT *)SystemCalloc(1,sizeof(TCPBCKT))) != NULL)
00177   {
00178     bckt->sck = sck;
00179     bckt->nxt = bcktList;
00180     bcktList = bckt;
00181   }
00182   return bckt;
00183 }

Here is the caller graph for this function:

IDLE_CONNECTION* getIdleConnection ( int  idx  ) 

Definition at line 389 of file clnip.c.

References tcpIdleConnectionStruct::idx, tcpIdleConnectionStruct::nxt, and tcpIdleConnectionList.

Referenced by AddIdleConnection().

00390 {
00391   IDLE_CONNECTION *ic=NULL;
00392 
00393   for (ic=tcpIdleConnectionList; ic != NULL; ic=ic->nxt)
00394   {
00395     if (ic->idx == idx) return ic;
00396   }
00397   return NULL;
00398 }

Here is the caller graph for this function:

int getIPControlNets ( char *  fn,
int *  nr,
struct sockaddr_in **  list 
)

Definition at line 140 of file srvip.c.

References ccerr, database_not_loaded, DWORD, FecDBpath, feclog(), findcol(), getColumnStr(), GetDataBaseSize(), gtGCastPort, no_such_file, no_such_line, out_of_server_memory, StartupDebug, strtrm(), SystemCalloc, SystemFree, and UINT16.

Referenced by appendRegisteredNetsList(), and initTCP().

00141 {
00142   int size,n;
00143   FILE *fp = NULL;
00144   DWORD haddr;
00145   int cc=0,done=0,col=-1;
00146   char str[256],hdr[256],scratch[32],ipnetsfilename[128];
00147   struct sockaddr_in *lst;
00148 
00149   n = 0;
00150   if ((lst=*list) != NULL) SystemFree((char *)lst);
00151 
00152   /* look for registerd properties: (must be a local file) */
00153   sprintf(ipnetsfilename,"%s%s",FecDBpath,fn);
00154   if ((size=GetDataBaseSize(ipnetsfilename)) <= 0)
00155   {
00156     if (StartupDebug) printf("No registered IP nets!\n>");
00157   }
00158   else
00159   {
00160     lst = (struct sockaddr_in *)SystemCalloc(sizeof(struct sockaddr_in),size);
00161     if (lst == NULL) return out_of_server_memory;
00162     if ((fp=fopen(ipnetsfilename,"r")) == NULL) ccerr(no_such_file);
00163     for (done=0; fgets(str,255,fp) != NULL;)   /* scan file       */
00164     {
00165       strtrm(str);
00166       if (strchr("%;#\n",str[0])) continue;    /* comment line(s) */
00167       if (!done)
00168       {
00169         strcpy(hdr,str);
00170         if ((col=findcol(hdr,"SUBNET")) < 0) ccerr(no_such_line);
00171         done = 1;
00172         continue;
00173       }
00174       getColumnStr(col,str,scratch,16); 
00175       haddr = inet_addr(scratch);
00176       lst[n].sin_family = AF_INET;
00177       lst[n].sin_port = htons((UINT16)gtGCastPort); /* potential broadcasting */
00178       memcpy(&lst[n].sin_addr,&haddr,4);
00179       n++;
00180     }
00181     if (n != size)
00182     {
00183       feclog("Illegal Number of IP nets!");
00184       n = 0;
00185       ccerr(database_not_loaded);
00186     }
00187   }
00188 err:
00189   if (fp) fclose(fp);
00190   *nr = n;
00191   *list = lst;
00192   return cc;
00193 }

Here is the call graph for this function:

Here is the caller graph for this function:

UINT32 getmyipaddr ( void   ) 

Definition at line 472 of file iplib.c.

References IPPORT_ECHO, soclose, TRUE, and UINT32.

Referenced by AcceptIPC(), fixFecProtocol(), listenUDP(), and SendSubBuffer().

00473 {
00474   static char hname[30];
00475   static struct hostent *hent;
00476   static struct sockaddr_in stlclAddr;
00477   static struct sockaddr_in strmtAddr;
00478   static int done = 0;
00479   static UINT32 myip = 0;
00480   int sck;
00481   unsigned int nRet=sizeof(struct sockaddr);
00482 
00483   if (done) return myip;
00484 # if defined(WINNT)
00485   /* do this here, just in case this is called prior to SystemInit() ! */
00486   if (!WinsockLoaded()) return -1;
00487 # endif
00488   stlclAddr.sin_addr.s_addr = INADDR_ANY;
00489 # if !defined(MSDOS) 
00490   if (gethostname(hname,30) != -1)
00491   {
00492     if ((hent=gethostbyname(hname)) != NULL)
00493     {
00494       stlclAddr.sin_addr.s_addr = *((UINT32 *)(hent->h_addr));
00495     }
00496   }
00497 # endif
00498   if (stlclAddr.sin_addr.s_addr == INADDR_ANY)
00499   {
00500     if ((sck=(int)socket(AF_INET, SOCK_DGRAM, 0)) > 0)
00501     {
00502       strmtAddr.sin_family = AF_INET;
00503       strmtAddr.sin_port = htons(IPPORT_ECHO);
00504       strmtAddr.sin_addr.s_addr = inet_addr("128.127.50.1");
00505       if (connect(sck,(struct sockaddr *)&strmtAddr,sizeof(struct sockaddr)) != -1)
00506       {
00507         getsockname(sck,(struct sockaddr *)&stlclAddr,(int *)&nRet);
00508       }
00509       soclose(sck);
00510     }
00511   }
00512   myip = stlclAddr.sin_addr.s_addr;
00513   done = TRUE;
00514   return stlclAddr.sin_addr.s_addr;  
00515 }

Here is the caller graph for this function:

int isUnixSocket ( int  sck  ) 

Definition at line 508 of file srvip.c.

References Consumers, FALSE, ipcProducerSocket, nconsumer, nipcconsumers, PIPE, RPCFec, RPCNumFecsRead, and TRUE.

Referenced by SendIPData().

00509 {
00510   int i;
00511   if (sck == ipcProducerSocket) return TRUE;
00512   for (i=0; nipcconsumers > 0 && i<nconsumer; i++)
00513   {
00514     if (Consumers[i]->sck == sck &&
00515         Consumers[i]->IPaddress.sin_family == AF_UNIX) return TRUE;       
00516   }
00517   for (i=0; i<RPCNumFecsRead; i++) if (RPCFec[i].Prot == PIPE) 
00518   {
00519     if (!memcmp(RPCFec[i].Network,&sck,4)) return TRUE;
00520   }
00521   return FALSE;
00522 }

Here is the caller graph for this function:

int ListenForIPMulticasts ( void   ) 

Definition at line 125 of file clnip.c.

References ccerr, FALSE, gtMCastPort, gUseLoopback, ListenForMCasts, MCastConsumerSocket, setupGlobalsSocket, tcp_not_supported, tcp_socket_error, TCPloaded, TRUE, and UINT16.

00126 {
00127   int cc = 0;
00128   if (ListenForMCasts) ccerr(0);
00129   if (!TCPloaded) ccerr(tcp_not_supported);
00130   setupGlobalsSocket(MCastConsumerSocket,(UINT16)gtMCastPort);
00131   if (MCastConsumerSocket == 0) ccerr(tcp_socket_error);
00132 # if defined(UNIX)
00133   gUseLoopback = TRUE;
00134 # endif
00135   ListenForMCasts = TRUE;
00136 err:
00137   if (cc) ListenForMCasts = FALSE;
00138   return cc;
00139 }

int ListenForIPNetGlobals ( void   ) 

Definition at line 141 of file clnip.c.

References ccerr, FALSE, GlobalSocket, gtGCastPort, ListenForGlobals, setupGlobalsSocket, tcp_not_supported, tcp_socket_error, TCPloaded, TRUE, and UINT16.

00142 {
00143   int cc = 0;
00144   if (ListenForGlobals) ccerr(0)
00145   if (!TCPloaded) ccerr(tcp_not_supported);
00146   setupGlobalsSocket(GlobalSocket,(UINT16)gtGCastPort);
00147   if (GlobalSocket == 0) ccerr(tcp_socket_error);
00148   ListenForGlobals = TRUE;
00149 err:
00150   if (cc) ListenForGlobals = FALSE;
00151   return cc;
00152 }

IDLE_CONNECTION* RemoveIdleConnection ( IDLE_CONNECTION ic  ) 

Definition at line 363 of file clnip.c.

References dbglog(), tcpIdleConnectionStruct::idx, NGdebug, tcpIdleConnectionStruct::nxt, tcpIdleConnectionStruct::prv, RPCFec, tcpIdleConnectionStruct::sck, SystemFree, and tcpIdleConnectionList.

00364 {
00365   IDLE_CONNECTION *nxt=NULL;
00366   if (ic == NULL) return ic;
00367   nxt = ic->nxt;
00368   if (ic->prv != NULL) ic->prv->nxt = ic->nxt;
00369   else if (ic == tcpIdleConnectionList) tcpIdleConnectionList = ic->nxt;
00370   if (NGdebug) dbglog("TCP connection to %s (sck %d) no longer idle",RPCFec[ic->idx].Name,ic->sck);
00371   SystemFree(ic);
00372   return nxt;
00373 }

Here is the call graph for this function:


Variable Documentation

TCPBCKT* bcktList

Definition at line 163 of file iplib.c.

Referenced by findBucket(), freeBucket(), and getBucket().

int BroadcastServer

Definition at line 28 of file server.c.

fd_set ext_set

Definition at line 89 of file iplib.c.

Referenced by AcceptIP(), doUDPConsumer(), initIPClient(), and initTCP().

int externalFdSets

Definition at line 93 of file iplib.c.

Referenced by AcceptIP(), and doUDPConsumer().

char gIpcTinePipe[64]

Definition at line 24 of file srvip.c.

Referenced by initTCP().

char* gtGCastAddr

Definition at line 75 of file iplib.c.

Referenced by listenUDP().

int gtGCastPort

Definition at line 36 of file iplib.c.

Referenced by appendRegisteredNetsList(), getIPControlNets(), initIPClient(), ListenForIPNetGlobals(), and listenUDP().

char* gtMCastAddr

Definition at line 69 of file iplib.c.

Referenced by listenUDP().

int gtMCastPort

Definition at line 42 of file iplib.c.

Referenced by getNetworkClientFromList(), initIPClient(), ListenForIPMulticasts(), and listenUDP().

int gtMCastTTL

Definition at line 81 of file iplib.c.

Referenced by initTCP().

char* gtNetLclBcast

Definition at line 63 of file iplib.c.

char* gtNetSrvAddr

Definition at line 56 of file iplib.c.

Referenced by GetAddressFromNameServer(), and listenUDP().

int gtNetSrvPort

Definition at line 30 of file iplib.c.

Referenced by initTCP(), listenUDP(), and SendSubBuffer().

int gtTCPPort

Definition at line 24 of file iplib.c.

Referenced by initTCP(), and SendSubBuffer().

int gtUDPClnPort

Definition at line 50 of file iplib.c.

Referenced by listenUDP().

int gtUDPPort

Definition at line 18 of file iplib.c.

Referenced by getIncomingFecIndex(), initTCP(), SendSubBuffer(), and tUDPCall().

int gUseLoopback

Definition at line 154 of file database.c.

Referenced by fixFecProtocol(), and ListenForIPMulticasts().

struct sockaddr_in* IPBcastList

Definition at line 76 of file srvip.c.

Referenced by appendRegisteredBCastNetsList(), freeServerMemory(), initTCP(), and SendIPBroadcast().

int ipcProducerSocket

Definition at line 22 of file srvip.c.

Referenced by AcceptIP(), AcceptIPC(), initTCP(), and isUnixSocket().

struct sockaddr_in* IPNetList

Definition at line 74 of file srvip.c.

Referenced by appendRegisteredIPNetsList(), dumpIPNets(), freeServerMemory(), getRegisteredIPNetList(), and initTCP().

int IPXConsumerSocket

Referenced by doUDPConsumer(), and SendSubBuffer().

int IPXMCastConsumerSocket

Referenced by doUDPConsumer().

int IPXProducerSocket

Referenced by AcceptIP().

int ListenForGlobals

Definition at line 32 of file clnip.c.

Referenced by initIPClient(), ListenForIPNetGlobals(), and recvNetGlobalEx().

int maxFdSets

Definition at line 95 of file iplib.c.

Referenced by AcceptIP(), doUDPConsumer(), getConsumerIPAddress(), initTCP(), IPDataReady(), IsInForeground(), SendIPBroadcast(), SendIPData(), and tUDPCall().

int maxTCPConnections

Definition at line 47 of file srvip.c.

Referenced by AssignConnectionSocket(), and initTCP().

int nipcconsumers

Definition at line 23 of file srvip.c.

Referenced by AcceptIP(), isUnixSocket(), LocateConsumerInList(), and RemoveConsumer().

int NrOfIPBcastNets

Definition at line 77 of file srvip.c.

Referenced by appendRegisteredBCastNetsList(), initTCP(), and SendIPBroadcast().

int NrOfIPNets

Definition at line 75 of file srvip.c.

Referenced by addRegisteredIPNet(), appendRegisteredIPNetsList(), dumpIPNets(), getNumRegisteredIPNets(), getRegisteredIPNetList(), and initTCP().

int nTCPsck

Definition at line 46 of file srvip.c.

Referenced by AcceptIP(), AssignConnectionSocket(), and CloseConnectionSocket().

void(*) socketAcceptEntryFcn(void)

Definition at line 51 of file srvip.c.

Referenced by AcceptIP().

IDLE_CONNECTION* tcpIdleConnectionList

Definition at line 44 of file clnip.c.

Referenced by AddIdleConnection(), getIdleConnection(), and RemoveIdleConnection().

int* TCPsck

Definition at line 45 of file srvip.c.

Referenced by AcceptIP(), AssignConnectionSocket(), CloseConnectionSocket(), freeServerMemory(), and initTCP().

struct in_addr tGCastAddr

Definition at line 315 of file iplib.c.

struct sockaddr_in tGCastAddrSck

Definition at line 318 of file iplib.c.

Referenced by SendIPBroadcast().

struct in_addr tMCastAddr

Definition at line 314 of file iplib.c.

struct sockaddr_in tMCastAddrSck

Definition at line 317 of file iplib.c.

struct in_addr tNetSrvAddr

Definition at line 316 of file iplib.c.

Referenced by GetAddressFromNameServer(), and SendSubBuffer().

struct sockaddr_in tNetSrvAddrSck

Definition at line 319 of file iplib.c.


Generated on Sat May 26 11:37:31 2007 for clientlib by  doxygen 1.4.7