xrootd
XrdFrmMonitor.hh
Go to the documentation of this file.
00001 #ifndef __XRDFRMMONITOR__
00002 #define __XRDFRMMONITOR__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                      X r d F r m M o n i t o r . h h                       */
00006 /*                                                                            */
00007 /* (c) 2010 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /*                                                                            */
00012 /* This file is part of the XRootD software suite.                            */
00013 /*                                                                            */
00014 /* XRootD is free software: you can redistribute it and/or modify it under    */
00015 /* the terms of the GNU Lesser General Public License as published by the     */
00016 /* Free Software Foundation, either version 3 of the License, or (at your     */
00017 /* option) any later version.                                                 */
00018 /*                                                                            */
00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00021 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00022 /* License for more details.                                                  */
00023 /*                                                                            */
00024 /* You should have received a copy of the GNU Lesser General Public License   */
00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00026 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00027 /*                                                                            */
00028 /* The copyright holder's institutional names and contributor's names may not */
00029 /* be used to endorse or promote products derived from this software without  */
00030 /* specific prior written permission of the institution or contributor.       */
00031 /******************************************************************************/
00032 
00033 #include <inttypes.h>
00034 #include <time.h>
00035 #include <netinet/in.h>
00036 #include <sys/types.h>
00037 
00038 #include "XrdNet/XrdNetPeer.hh"
00039 #include "XrdXrootd/XrdXrootdMonData.hh"
00040 #include "XProtocol/XPtypes.hh"
00041 
00042 #define XROOTD_MON_INFO     1
00043 #define XROOTD_MON_STAGE    2
00044 #define XROOTD_MON_MIGR     4
00045 #define XROOTD_MON_PURGE    8
00046 
00047 class XrdFrmMonitor
00048 {
00049 public:
00050 
00051 static void              Defaults(char *dest1, int m1, char *dest2, int m2,
00052                                   int   iTime);
00053 
00054 static void              Ident();
00055 
00056 static int               Init(const char *iHost, const char *iProg,
00057                               const char *iName);
00058 
00059 static kXR_unt32         Map(char code, const char *uname, const char *path);
00060 
00061 static char              monMIGR;
00062 static char              monPURGE;
00063 static char              monSTAGE;
00064 
00065                          XrdFrmMonitor();
00066                         ~XrdFrmMonitor(); 
00067 
00068 private:
00069 static void              fillHeader(XrdXrootdMonHeader *hdr,
00070                                     const char id, int size);
00071 static int               Send(int mmode, void *buff, int size);
00072 
00073 static char              *Dest1;
00074 static int                monMode1;
00075 static int                monFD1;
00076 static struct sockaddr    InetAddr1;
00077 static char              *Dest2;
00078 static int                monFD2;
00079 static int                monMode2;
00080 static struct sockaddr    InetAddr2;
00081 static kXR_int32          startTime;
00082 static int                isEnabled;
00083 static char              *idRec;
00084 static int                idLen;
00085 static int                sidSize;
00086 static char              *sidName;
00087 static int                idTime;
00088 };
00089 #endif