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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27