00001 #ifndef __LINK_MATCH__ 00002 #define __LINK_MATCH__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d L i n k M a t c h . h h */ 00006 /* */ 00007 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdLinkMatch.hh 22437 2008-03-04 14:35:16Z rdm $ 00014 00015 #include <strings.h> 00016 #include <stdlib.h> 00017 00018 class XrdLinkMatch 00019 { 00020 public: 00021 00022 00023 int Match(const char *uname, int unlen, 00024 const char *hname, int hnlen); 00025 inline int Match(const char *uname, int unlen, 00026 const char *hname) 00027 {return Match(uname, unlen, hname, strlen(hname));} 00028 00029 // Target: [<user>][*][@[<hostpfx>][*][<hostsfx>]] 00030 // 00031 void Set(const char *target); 00032 00033 XrdLinkMatch(const char *target=0) 00034 {Uname = HnameL = HnameR = 0; 00035 Unamelen = Hnamelen = 0; 00036 if (target) Set(target); 00037 } 00038 00039 ~XrdLinkMatch() {} 00040 00041 private: 00042 00043 char Buff[256]; 00044 int Unamelen; 00045 char *Uname; 00046 int HnamelenL; 00047 char *HnameL; 00048 int HnamelenR; 00049 char *HnameR; 00050 int Hnamelen; 00051 }; 00052 #endif