Changeset 1766

Show
Ignore:
Timestamp:
08/25/08 17:12:22 (3 months ago)
Author:
xkovah
Message:

Added handlers to the soap code for the other event types. Now they just need to shove the data into ns_*Event_t structs in individual vectors, and it will be ready for simple send back to a soap client like Manager

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • capture-mod/trunk/Analyzer.cpp

    r1765 r1766  
    11#include "Analyzer.h" 
    22 
    3 Analyzer::Analyzer(Visitor* v, Server* s, ProcessMonitor * p, RegistryMonitor * r, FileMonitor * f
     3Analyzer::Analyzer(Visitor* v, Server* s, RegistryMonitor * r, FileMonitor * f, ProcessMonitor * p
    44{ 
    55    processMonitor = p; 
  • capture-mod/trunk/Analyzer.h

    r1765 r1766  
    5656{ 
    5757public: 
    58     Analyzer(Visitor* v, Server* s, ProcessMonitor * p, RegistryMonitor * r, FileMonitor * f); 
     58    Analyzer(Visitor* v, Server* s, RegistryMonitor * r, FileMonitor * f, ProcessMonitor * p); 
    5959    ~Analyzer(void); 
    6060 
  • capture-mod/trunk/CaptureClient.cpp

    r1765 r1766  
    6666        FileMonitor * f = new FileMonitor(); 
    6767        //Set up the standalone SOAP server 
    68         soapSrv = new CaptureSoapServer(visitor, r); 
    69         analyzer = new Analyzer(visitor, server, p, r, f); 
     68        soapSrv = new CaptureSoapServer(visitor, r, f, p); 
     69        analyzer = new Analyzer(visitor, server, r, f, p); 
    7070        Thread* captureClientThread = new Thread(this); 
    7171        captureClientThread->start("CaptureClient"); 
  • capture-mod/trunk/CaptureSoapServer.cpp

    r1765 r1766  
    1111struct soap soap; 
    1212 
    13 CaptureSoapServer::CaptureSoapServer(Visitor* v, RegistryMonitor *r){ 
     13CaptureSoapServer::CaptureSoapServer(Visitor* v, RegistryMonitor * r, FileMonitor * f, ProcessMonitor * p){ 
    1414    registryMonitor = r; 
     15    fileMonitor = f; 
     16    processMonitor = p; 
    1517    CaptureSoapServerThread = new Thread(this); 
    1618    CaptureSoapServerThread->start("CaptureSoapServer"); 
     
    1820 
    1921CaptureSoapServer::~CaptureSoapServer(){ 
    20     //FIXME: I have no idea if these are appropriate here 
     22    //FIXME: I have no idea if these are appropriate here. Also need to find the correct way to cleanly shut down 
     23    //so that it doesn't output a connection error at the end. 
    2124    soap_destroy(&soap); 
    2225    soap_end(&soap); 
     
    3033   SOCKET m, s; // master and slave sockets 
    3134 
    32    onRegistryEventConnection = registryMonitor->connect_onRegistryEvent(boost::bind(&CaptureSoapServer::onRegistryEvent, this, _1, _2, _3, _4, _5)); 
     35    onProcessEventConnection = processMonitor->connect_onProcessEvent(boost::bind(&CaptureSoapServer::onProcessEvent, this, _1, _2, _3, _4, _5, _6)); 
     36    onRegistryEventConnection = registryMonitor->connect_onRegistryEvent(boost::bind(&CaptureSoapServer::onRegistryEvent, this, _1, _2, _3, _4, _5)); 
     37    onFileEventConnection = fileMonitor->connect_onFileEvent(boost::bind(&CaptureSoapServer::onFileEvent, this, _1, _2, _3, _4, _5)); 
    3338 
    3439   //The below code is taken mostly from the gsoap standalone server example page 
     
    6166} 
    6267 
     68void CaptureSoapServer::onProcessEvent(BOOLEAN created, wstring time,  
     69                                        DWORD parentProcessId, wstring parentProcess,  
     70                                        DWORD processId, wstring process) 
     71{ 
     72    printf("CaptureSoapServer::onProcessEvent got an event for time = %ls\n", time.c_str()); 
     73} 
     74 
    6375void CaptureSoapServer::onRegistryEvent (wstring registryEventType, wstring time,  
    6476                                        wstring processPath, wstring registryEventPath,  
    6577                                        vector<wstring> extra) 
    6678{ 
    67     wprintf(L"CaptureSoapServer::onRegistryEvent got an event for time = %hs\n", time); 
    68 
    69  
     79    printf("CaptureSoapServer::onRegistryEvent got an event for time = %ls\n", time.c_str()); 
     80
     81 
     82void CaptureSoapServer::onFileEvent(wstring fileEventType, wstring time,  
     83                                    wstring processPath, wstring fileEventPath,  
     84                                    vector<wstring> extra) 
     85
     86    printf("CaptureSoapServer::onFileEvent got an event for time = %ls\n", time.c_str()); 
     87
    7088 
    7189int ns__ping(struct soap *soap, char * a, char ** result)  
  • capture-mod/trunk/CaptureSoapServer.h

    r1765 r1766  
    77#include "Visitor.h" 
    88#include "RegistryMonitor.h" 
     9#include "FileMonitor.h" 
     10#include "ProcessMonitor.h" 
    911 
    1012using namespace std; 
     
    1618    typedef boost::signal<void (DWORD, DWORD, wstring, wstring)> signal_visitEvent; 
    1719    boost::signals::connection onRegistryEventConnection; 
     20    boost::signals::connection onFileEventConnection; 
     21    boost::signals::connection onProcessEventConnection; 
    1822 
    19     CaptureSoapServer(Visitor *, RegistryMonitor *); 
     23    CaptureSoapServer(Visitor *, RegistryMonitor * r, FileMonitor * f, ProcessMonitor * p); 
    2024    ~CaptureSoapServer(); 
    2125    void run(); 
    22     void onRegistryEvent (wstring registryEventType, wstring time, wstring processPath,  
     26    void onRegistryEvent(wstring registryEventType, wstring time, wstring processPath,  
    2327                        wstring registryEventPath, vector<wstring> extra); 
     28    void onFileEvent(wstring fileEventType, wstring time, wstring processPath, wstring fileEventPath,  
     29                        vector<wstring> extra); 
     30    void onProcessEvent(BOOLEAN created, wstring time, DWORD parentProcessId, wstring parentProcess,  
     31                        DWORD processId, wstring process); 
    2432 
    2533    Thread * CaptureSoapServerThread; 
    2634    static Visitor * myVisitor; 
    2735    RegistryMonitor* registryMonitor; 
     36    FileMonitor * fileMonitor; 
     37    ProcessMonitor * processMonitor; 
    2838};