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

Contents of /main/resip/dum/Profile.hxx

Parent Directory Parent Directory | Revision Log Revision Log


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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27