/[resiprocate]/main/resip/dum/test/certServer.cxx
ViewVC logotype

Diff of /main/resip/dum/test/certServer.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3593 by jason, Tue Nov 23 06:13:16 2004 UTC revision 4599 by derek, Wed May 11 23:10:19 2005 UTC
# Line 2  Line 2 
2  #  define usleep(t) Sleep(t)  #  define usleep(t) Sleep(t)
3  #endif  #endif
4    
 #define HAVE_POPT_H  
   
5  #if defined (HAVE_POPT_H)  #if defined (HAVE_POPT_H)
6  #include <popt.h>  #include <popt.h>
7  #endif  #endif
# Line 21  Line 19 
19  #include "resiprocate/dum/DialogUsageManager.hxx"  #include "resiprocate/dum/DialogUsageManager.hxx"
20  #include "resiprocate/dum/DumShutdownHandler.hxx"  #include "resiprocate/dum/DumShutdownHandler.hxx"
21  #include "resiprocate/dum/OutOfDialogHandler.hxx"  #include "resiprocate/dum/OutOfDialogHandler.hxx"
22  #include "resiprocate/dum/Profile.hxx"  #include "resiprocate/dum/MasterProfile.hxx"
23  #include "resiprocate/dum/PublicationHandler.hxx"  #include "resiprocate/dum/PublicationHandler.hxx"
24  #include "resiprocate/dum/RegistrationHandler.hxx"  #include "resiprocate/dum/RegistrationHandler.hxx"
25  #include "resiprocate/dum/ServerPublication.hxx"  #include "resiprocate/dum/ServerPublication.hxx"
# Line 193  Line 191 
191           {           {
192              // !jf! really need to do this async. send neutral state in the meantime,              // !jf! really need to do this async. send neutral state in the meantime,
193              // blah blah blah              // blah blah blah
194              mSecurity.generateUserCert(h->getDocumentKey(), Data::Empty);              mSecurity.generateUserCert(h->getDocumentKey());
195           }           }
196    
197           if (mSecurity.hasUserCert(h->getDocumentKey()))           if (mSecurity.hasUserCert(h->getDocumentKey()))
# Line 277  Line 275 
275  class CertServer : public OutOfDialogHandler,  public DialogUsageManager  class CertServer : public OutOfDialogHandler,  public DialogUsageManager
276  {  {
277     public:     public:
278        CertServer(const resip::NameAddr& me) :        CertServer(const resip::NameAddr& me, SipStack& stack) :
279           DialogUsageManager(),           DialogUsageManager(stack),
280           mCertServer(getSecurity()),           mCertServer(*getSecurity()),
281           mPrivateKeyServer(getSecurity()),           mPrivateKeyServer(*getSecurity()),
282           mCertUpdater(getSecurity()),           mCertUpdater(*getSecurity()),
283           mPrivateKeyUpdater(getSecurity())           mPrivateKeyUpdater(*getSecurity()),
284             mDone(false)
285        {        {
286           addTransport(UDP, 5100);           addTransport(UDP, 5100);
287           addTransport(TCP, 5100);           addTransport(TCP, 5100);
# Line 293  Line 292 
292           mProfile.addSupportedMethod(SUBSCRIBE);           mProfile.addSupportedMethod(SUBSCRIBE);
293           mProfile.validateAcceptEnabled() = true;           mProfile.validateAcceptEnabled() = true;
294           mProfile.validateContentEnabled() = true;           mProfile.validateContentEnabled() = true;
295           mProfile.addSupportedMimeType(Pkcs8Contents::getStaticType());           mProfile.addSupportedMimeType(PUBLISH, Pkcs8Contents::getStaticType());
296           mProfile.addSupportedMimeType(X509Contents::getStaticType());           mProfile.addSupportedMimeType(SUBSCRIBE, Pkcs8Contents::getStaticType());
297             mProfile.addSupportedMimeType(PUBLISH, X509Contents::getStaticType());
298             mProfile.addSupportedMimeType(SUBSCRIBE, X509Contents::getStaticType());
299                    
300           mProfile.setDefaultFrom(me);           mProfile.setDefaultFrom(me);
301           setProfile(&mProfile);           setMasterProfile(&mProfile);
302    
303           addServerSubscriptionHandler(Symbols::Credential, &mPrivateKeyServer);           addServerSubscriptionHandler(Symbols::Credential, &mPrivateKeyServer);
304           addServerSubscriptionHandler(Symbols::Certificate, &mCertServer);           addServerSubscriptionHandler(Symbols::Certificate, &mCertServer);
# Line 342  Line 343 
343        }        }
344    
345     private:     private:
346        Profile mProfile;        MasterProfile mProfile;
347        CertSubscriptionHandler mCertServer;        CertSubscriptionHandler mCertServer;
348        PrivateKeySubscriptionHandler mPrivateKeyServer;        PrivateKeySubscriptionHandler mPrivateKeyServer;
349        CertPublicationHandler mCertUpdater;        CertPublicationHandler mCertUpdater;
# Line 395  Line 396 
396  #endif  #endif
397    
398     NameAddr domain(myUrl);     NameAddr domain(myUrl);
399     CertServer server(domain);     SipStack stack;
400       CertServer server(domain, stack);
401     server.run();     server.run();
402     return 0;     return 0;
403  }  }

Legend:
Removed from v.3593  
changed lines
  Added in v.4599

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27