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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2910 - (show annotations) (download)
Tue Jun 1 22:51:44 2004 UTC (15 years, 8 months ago) by derek
File size: 3819 byte(s)
Resolved conflict.

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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27