xrootd
XrdNetSecurity.hh
Go to the documentation of this file.
1 #ifndef __NETSECURITY__
2 #define __NETSECURITY__
3 /******************************************************************************/
4 /* */
5 /* X r d N e t S e c u r i t y . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <ctype.h>
16 #include <stdlib.h>
17 
18 #include "XrdOuc/XrdOucHash.hh"
19 #include "XrdOuc/XrdOucNList.hh"
20 #include "XrdSys/XrdSysPthread.hh"
21 
22 class XrdNetTextList;
23 class XrdOucTrace;
24 struct sockaddr;
25 
27 {
28 public:
29 
30 void AddHost(char *hname);
31 
32 void AddNetGroup(char *hname);
33 
34 char *Authorize(struct sockaddr *addr);
35 
36 void Merge(XrdNetSecurity *srcp); // Deletes srcp
37 
38 void Trace(XrdOucTrace *et=0) {eTrace = et;}
39 
40  XrdNetSecurity() {NetGroups = 0; eTrace = 0; lifetime = 8*60*60;}
42 
43 private:
44 
45 char *hostOK(char *hname, const char *ipname, const char *why);
46 
48 
50 
54 
56 static const char *TraceID;
57 };
58 #endif