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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2876 - (show annotations) (download)
Sun May 30 18:58:40 2004 UTC (15 years, 6 months ago) by fluffy
Original Path: main/sip/resiprocate/dum/Profile.hxx
File size: 3658 byte(s)
first cut at auth stuff
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 struct DigestCredential;
19
20 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 int getDefaultSubscriptionTime();
35
36 bool isSchemeSupported(const Data& scheme);
37 bool isMethodSupported(MethodTypes method);
38 bool isMimeTypeSupported(const Mime& mimeType);
39 bool isContentEncodingSupported(const Token& contentEncoding);
40 bool isLanguageSupported(const Tokens& lang);
41
42 // return the list of unsupported tokens from set of requires tokens
43 Tokens isSupported(const Tokens& requires);
44 Tokens getSupportedOptionTags();
45 Tokens getAllowedMethods();
46 Mimes getSupportedMimeTypes();
47 Tokens getSupportedEncodings();
48 Tokens getSupportedLanguages();
49
50 void addGruu(const Data& aor, const NameAddr& contact);
51 bool hasGruu(const Data& aor);
52 bool hasGruu(const Data& aor, const Data& instance);
53 NameAddr& getGruu(const Data& aor);
54 NameAddr& getGruu(const Data& aor, const NameAddr& contact);
55
56 const NameAddr& getDefaultAor() const;
57
58 void setOutboundProxy( const Uri& uri );
59 const NameAddr& getOutboundProxy() const;
60 bool hasOutboundProxy() const;
61
62 void disableGruu();
63
64 /// The following functions deal with getting digest credentals
65 //@{
66
67 void addDigestCredential( const Data& realm, const Data& user, const Data& password);
68
69 /** 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 class DigestCredentialHandler
74 {
75 public:
76 virtual Data computeA1( const Data& realm, const Data& users );
77 virtual Data getPassword( const Data& realm, const Data& users );
78 };
79
80 void setDigestHandler( DigestCredentialHandler* handler );
81 //@}
82
83 DigestCredentialHandler* getDigestHandler();
84 const DigestCredential& getDigestCredential( const Data& realm );
85
86 private:
87 NameAddr mAor;
88 int mDefaultRegistrationExpires;
89
90 bool mHasOutboundProxy;
91 NameAddr mOutboundProxy;
92
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
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 };
114
115
116
117 }
118
119 #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27