/[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 2871 - (hide annotations) (download)
Sun May 30 17:38:17 2004 UTC (15 years, 7 months ago) by jason
File size: 3622 byte(s)
outbound proxy support


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 2490 public:
18 jason 2727 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 fluffy 2840 int getDefaultSubscriptionTime();
33 jason 2727
34 jason 2514 bool isSchemeSupported(const Data& scheme);
35     bool isMethodSupported(MethodTypes method);
36     bool isMimeTypeSupported(const Mime& mimeType);
37 jason 2526 bool isContentEncodingSupported(const Token& contentEncoding);
38     bool isLanguageSupported(const Tokens& lang);
39 jason 2514
40     // return the list of unsupported tokens from set of requires tokens
41 davidb 2595 Tokens isSupported(const Tokens& requires);
42 jason 2553 Tokens getSupportedOptionTags();
43 jason 2514 Tokens getAllowedMethods();
44     Mimes getSupportedMimeTypes();
45 jason 2526 Tokens getSupportedEncodings();
46     Tokens getSupportedLanguages();
47 jason 2514
48 jason 2621 void addGruu(const Data& aor, const NameAddr& contact);
49 jason 2611 bool hasGruu(const Data& aor);
50 jason 2621 bool hasGruu(const Data& aor, const Data& instance);
51 jason 2611 NameAddr& getGruu(const Data& aor);
52     NameAddr& getGruu(const Data& aor, const NameAddr& contact);
53    
54 jason 2592 const NameAddr& getDefaultAor() const;
55    
56 jason 2871 void setOutboundProxy( const Uri& uri );
57     const NameAddr& getOutboundProxy() const;
58     bool hasOutboundProxy() const;
59    
60 jason 2558 void disableGruu();
61 fluffy 2501
62     /// The following functions deal with getting digest credentals
63     //@{
64    
65 fluffy 2870 void addDigestCredential( const Data& realm, const Data& user, const Data& password);
66 fluffy 2490
67 fluffy 2501 /** This class is used as a callback to get digest crednetials. The
68     * derived class must define one of computeA1 or getPaswword. computeA1 is
69     * tried first and it it returns an empty string, then getPassword is
70     * tried. */
71 fluffy 2490 class DigestCredentialHandler
72     {
73     public:
74 fluffy 2501 virtual Data computeA1( const Data& realm, const Data& users );
75     virtual Data getPassword( const Data& realm, const Data& users );
76 fluffy 2490 };
77    
78     void setDigestHandler( DigestCredentialHandler* handler );
79 fluffy 2501 //@}
80 jason 2611
81 fluffy 2870 DigestCredentialHandler* getDigestHandler();
82     const Data& getDigestPassword( const Data& realm, const Data& user );
83    
84 fluffy 2490 private:
85 jason 2727 NameAddr mAor;
86     int mDefaultRegistrationExpires;
87 jason 2871
88     bool mHasOutboundProxy;
89     NameAddr mOutboundProxy;
90 jason 2727
91     std::set<Data> mSupportedSchemes;
92     std::set<MethodTypes> mSupportedMethodTypes;
93     Tokens mSupportedMethods;
94     Tokens mSupportedOptionTags;
95     Mimes mSupportedMimeTypes;
96     Tokens mSupportedEncodings;
97     Tokens mSupportedLanguages;
98 fluffy 2870
99     DigestCredentialHandler* mDigestCredentialHandler;
100    
101     struct DigestCredential
102     {
103     Data realm;
104     Data user;
105     Data password;
106    
107     bool operator<(const DigestCredential& rhs) const;
108     };
109     typedef std::set<DigestCredential> DigestCredentials;
110     DigestCredentials mDigestCredentials;
111 fluffy 2486 };
112    
113    
114 fluffy 2502
115     }
116    
117     #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27