/[resiprocate]/main/sip/resiprocate/dum/Profile.hxx
ViewVC logotype

Annotation of /main/sip/resiprocate/dum/Profile.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2896 - (hide annotations) (download)
Mon May 31 15:22:26 2004 UTC (15 years, 7 months ago) by jason
File size: 3736 byte(s)
added some debug

1 fluffy 2502 #if !defined(RESIP_PROFILE_HXX)
2     #define RESIP_PROFILE_HXX
3 fluffy 2490
4 jason 2896 #include <ostream>
5 jason 2727 #include <set>
6 davidb 2595 #include "resiprocate/Headers.hxx"
7 jason 2727 #include "resiprocate/MethodTypes.hxx"
8 davidb 2595
9 fluffy 2502 namespace resip
10     {
11 fluffy 2490
12 jason 2514 class Data;
13    
14 jason 2727 // !jf! will want to provide a default subclass of Profile that provides some
15     // good defaults for the Profile
16 fluffy 2486 class Profile
17     {
18 fluffy 2876 public:
19     struct DigestCredential;
20    
21 jason 2727 Profile();
22    
23     void setDefaultAor(const NameAddr& from);
24     void setDefaultRegistrationTime(int secs);
25    
26     void addSupportedScheme(const Data& scheme);
27     void addSupportedMethod(const MethodTypes& method);
28     void addSupportedOptionTags(const Token& tag);
29     void addSupportedMimeType(const Mime& mimeType);
30     void addSupportedEncoding(const Token& encoding);
31     void addSupportedLanguage(const Token& lang);
32    
33     NameAddr& getDefaultAor();
34     int getDefaultRegistrationTime();
35 fluffy 2840 int getDefaultSubscriptionTime();
36 jason 2727
37 jason 2514 bool isSchemeSupported(const Data& scheme);
38     bool isMethodSupported(MethodTypes method);
39     bool isMimeTypeSupported(const Mime& mimeType);
40 jason 2526 bool isContentEncodingSupported(const Token& contentEncoding);
41     bool isLanguageSupported(const Tokens& lang);
42 jason 2514
43     // return the list of unsupported tokens from set of requires tokens
44 davidb 2595 Tokens isSupported(const Tokens& requires);
45 jason 2553 Tokens getSupportedOptionTags();
46 jason 2514 Tokens getAllowedMethods();
47     Mimes getSupportedMimeTypes();
48 jason 2526 Tokens getSupportedEncodings();
49     Tokens getSupportedLanguages();
50 jason 2514
51 jason 2621 void addGruu(const Data& aor, const NameAddr& contact);
52 jason 2611 bool hasGruu(const Data& aor);
53 jason 2621 bool hasGruu(const Data& aor, const Data& instance);
54 jason 2611 NameAddr& getGruu(const Data& aor);
55     NameAddr& getGruu(const Data& aor, const NameAddr& contact);
56    
57 jason 2592 const NameAddr& getDefaultAor() const;
58    
59 jason 2871 void setOutboundProxy( const Uri& uri );
60     const NameAddr& getOutboundProxy() const;
61     bool hasOutboundProxy() const;
62    
63 jason 2558 void disableGruu();
64 fluffy 2501
65     /// The following functions deal with getting digest credentals
66     //@{
67    
68 fluffy 2870 void addDigestCredential( const Data& realm, const Data& user, const Data& password);
69 fluffy 2490
70 fluffy 2501 /** This class is used as a callback to get digest crednetials. The
71     * derived class must define one of computeA1 or getPaswword. computeA1 is
72     * tried first and it it returns an empty string, then getPassword is
73     * tried. */
74 fluffy 2490 class DigestCredentialHandler
75     {
76     public:
77 fluffy 2501 virtual Data computeA1( const Data& realm, const Data& users );
78     virtual Data getPassword( const Data& realm, const Data& users );
79 fluffy 2490 };
80    
81     void setDigestHandler( DigestCredentialHandler* handler );
82 fluffy 2501 //@}
83 jason 2611
84 fluffy 2870 DigestCredentialHandler* getDigestHandler();
85 fluffy 2876 const DigestCredential& getDigestCredential( const Data& realm );
86 fluffy 2870
87 fluffy 2490 private:
88 jason 2727 NameAddr mAor;
89     int mDefaultRegistrationExpires;
90 jason 2871
91     bool mHasOutboundProxy;
92     NameAddr mOutboundProxy;
93 jason 2727
94     std::set<Data> mSupportedSchemes;
95     std::set<MethodTypes> mSupportedMethodTypes;
96     Tokens mSupportedMethods;
97     Tokens mSupportedOptionTags;
98     Mimes mSupportedMimeTypes;
99     Tokens mSupportedEncodings;
100     Tokens mSupportedLanguages;
101 fluffy 2870
102     DigestCredentialHandler* mDigestCredentialHandler;
103    
104     struct DigestCredential
105     {
106     Data realm;
107     Data user;
108     Data password;
109    
110     bool operator<(const DigestCredential& rhs) const;
111 jason 2896 std::ostream& operator<<(std::ostream&) const;
112 fluffy 2870 };
113     typedef std::set<DigestCredential> DigestCredentials;
114     DigestCredentials mDigestCredentials;
115 fluffy 2486 };
116    
117    
118 fluffy 2502
119     }
120    
121     #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27