00001 /* SCPMAgent.h 00002 * 00003 * SCPM agent implementation 00004 * 00005 * Authors: Jiri Suchomel <jsuchome@suse.cz> 00006 * 00007 * $Id: SCPMAgent.h 26456 2005-12-07 16:11:23Z jsuchome $ 00008 */ 00009 00010 #ifndef _SCPMAgent_h 00011 #define _SCPMAgent_h 00012 00013 #include <Y2.h> 00014 #include <scr/SCRAgent.h> 00015 00016 using namespace std; 00017 00018 #include <iostream> 00019 #include <scpm.h> 00020 00021 #include <string> 00022 #include <vector> 00023 00024 #include <unistd.h> 00025 #include <sys/types.h> 00026 #include <sys/wait.h> 00027 #include <libintl.h> 00028 #include <fstream> 00029 #include <pthread.h> 00030 00031 00035 class SCPMAgent : public SCRAgent 00036 { 00037 private: 00038 SCPM *scpm; 00039 00040 int options; 00041 ofstream output, hash; 00042 string changesfile, tmpfile, hashfile; 00043 00044 pthread_t pt; 00045 00049 bool initialized; 00050 00054 static void *call_enable( SCPMAgent *); 00055 00059 static void *call_recover (SCPMAgent *); 00060 00064 static void *call_rollback (SCPMAgent *); 00065 // ---------------------- 00066 00070 resource_group_t frommap_rg(YCPMap map); 00071 00075 YCPMap tomap_rg(resource_group_t rgroup); 00076 00080 vector<resource_entry_t> fromlist_re(YCPList list); 00081 00085 resource_entry_t frommap_re(YCPMap map); 00086 00090 YCPMap tomap_re(resource_entry_t rentry); 00091 00092 public: 00096 SCPMAgent(); 00097 00101 virtual ~SCPMAgent(); 00102 00108 virtual YCPValue Read(const YCPPath &path, 00109 const YCPValue& arg = YCPNull(), 00110 const YCPValue& opt = YCPNull()); 00111 00115 virtual YCPBoolean Write(const YCPPath &path, 00116 const YCPValue& value, 00117 const YCPValue& arg = YCPNull()); 00118 00122 virtual YCPValue Execute(const YCPPath &path, 00123 const YCPValue& value = YCPNull(), 00124 const YCPValue& arg = YCPNull()); 00125 00129 virtual YCPList Dir(const YCPPath& path); 00130 00134 virtual YCPValue otherCommand(const YCPTerm& term); 00135 }; 00136 00137 #endif /* _SCPMAgent_h */