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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3323 - (hide annotations) (download)
Tue Sep 14 19:51:14 2004 UTC (15 years, 3 months ago) by sgodin
Original Path: main/sip/resiprocate/dum/Profile.hxx
File size: 5795 byte(s)
Corrected comments
1 fluffy 2502 #if !defined(RESIP_PROFILE_HXX)
2     #define RESIP_PROFILE_HXX
3 fluffy 2490
4 jason 2941 #include <iosfwd>
5 jason 2727 #include <set>
6 davidb 2595 #include "resiprocate/Headers.hxx"
7 jason 2727 #include "resiprocate/MethodTypes.hxx"
8 davidb 2595
9 fluffy 2502 namespace resip
10     {
11 fluffy 2490
12 jason 2514 class Data;
13    
14 jason 2727 // !jf! will want to provide a default subclass of Profile that provides some
15     // good defaults for the Profile
16 fluffy 2486 class Profile
17     {
18 fluffy 2876 public:
19    
20 derek 2910 struct DigestCredential
21     {
22     DigestCredential();
23 jason 3150 DigestCredential(const Data& aor, const Data& realm, const Data& username, const Data& password);
24     Data aor;
25 derek 2910 Data realm;
26     Data user;
27     Data password;
28    
29     bool operator<(const DigestCredential& rhs) const;
30     };
31    
32 jason 2727 Profile();
33    
34 jason 3150 void setDefaultFrom(const NameAddr& from);
35 jason 2727 void setDefaultRegistrationTime(int secs);
36 derek 3308
37     //overrides the value used to populate the contact
38     //?dcm? -- also change via entries? Also, dum currently uses(as a uas)
39     //the request uri of the dialog constructing request for the local contact
40     //within that dialog. A transport paramter here could also be used to
41     //force tcp vs udp vs tls?
42     void setOverrideHostAndPort(const Uri& hostPort);
43     bool hasOverrideHostAndPort() const;
44     const Uri& getOverideHostAndPort() const;
45 jason 2727
46 sgodin 3319 NameAddr& getDefaultFrom();
47     int getDefaultRegistrationTime();
48     int getDefaultSubscriptionTime();
49    
50 jason 2727 void addSupportedScheme(const Data& scheme);
51     void addSupportedMethod(const MethodTypes& method);
52     void addSupportedOptionTags(const Token& tag);
53     void addSupportedMimeType(const Mime& mimeType);
54     void addSupportedEncoding(const Token& encoding);
55     void addSupportedLanguage(const Token& lang);
56    
57 jason 2514 bool isSchemeSupported(const Data& scheme);
58     bool isMethodSupported(MethodTypes method);
59     bool isMimeTypeSupported(const Mime& mimeType);
60 jason 2526 bool isContentEncodingSupported(const Token& contentEncoding);
61     bool isLanguageSupported(const Tokens& lang);
62 jason 2514
63     // return the list of unsupported tokens from set of requires tokens
64 davidb 2595 Tokens isSupported(const Tokens& requires);
65 jason 2553 Tokens getSupportedOptionTags();
66 jason 2514 Tokens getAllowedMethods();
67     Mimes getSupportedMimeTypes();
68 jason 2526 Tokens getSupportedEncodings();
69     Tokens getSupportedLanguages();
70 sgodin 3319
71     //enable/disable sending of Allow/Supported/Accept/Accept-Language/Accept-Encoding headers
72 sgodin 3323 //on initial outbound requests (ie. Initial INVITE, REGISTER, etc.) and Invite 200 responses
73     //Note: Default is to advertise Headers::Accept and Headers::Supported, use clearAdvertisedCapabilities to remove these
74     // Currently implemented header values are: Headers::Accept, Headers::Allow,
75     // Headers::AcceptEncoding, Headers::AcceptLanguage, Headers::Supported
76 sgodin 3319 void addAdvertisedCapability(const Headers::Type header);
77     bool isAdvertisedCapability(const Headers::Type header);
78     void clearAdvertisedCapabilities();
79    
80 jason 2621 void addGruu(const Data& aor, const NameAddr& contact);
81 jason 2611 bool hasGruu(const Data& aor);
82 jason 2621 bool hasGruu(const Data& aor, const Data& instance);
83 jason 2611 NameAddr& getGruu(const Data& aor);
84     NameAddr& getGruu(const Data& aor, const NameAddr& contact);
85    
86 jason 2871 void setOutboundProxy( const Uri& uri );
87     const NameAddr& getOutboundProxy() const;
88     bool hasOutboundProxy() const;
89    
90 jason 2558 void disableGruu();
91 fluffy 2501
92     /// The following functions deal with getting digest credentals
93     //@{
94 jason 3242 void setDigestCredential( const Data& aor, const Data& realm, const Data& user, const Data& password);
95 fluffy 2490
96 fluffy 2501 /** This class is used as a callback to get digest crednetials. The
97     * derived class must define one of computeA1 or getPaswword. computeA1 is
98     * tried first and it it returns an empty string, then getPassword is
99     * tried. */
100 fluffy 2490 class DigestCredentialHandler
101     {
102     public:
103 fluffy 2501 virtual Data computeA1( const Data& realm, const Data& users );
104     virtual Data getPassword( const Data& realm, const Data& users );
105 fluffy 2490 };
106    
107     void setDigestHandler( DigestCredentialHandler* handler );
108 fluffy 2501 //@}
109 jason 2611
110 fluffy 2870 DigestCredentialHandler* getDigestHandler();
111 fluffy 2876 const DigestCredential& getDigestCredential( const Data& realm );
112 derek 2983 const DigestCredential& getDigestCredential( const SipMessage& challenge );
113    
114 derek 3155 //defaults to false, turn on for VONAGE
115     bool& looseToTagMatching();
116     const bool looseToTagMatching() const;
117    
118 sgodin 3319 //enable/disable rport for requests. rport is enabled by default
119 derek 3233 bool& rportEnabled();
120     const bool rportEnabled() const;
121    
122 sgodin 3319 //if set then UserAgent header is added to outbound messages
123 derek 3289 void setUserAgent( const Data& userAgent );
124     const Data& getUserAgent() const;
125     bool hasUserAgent() const;
126    
127 fluffy 2490 private:
128 jason 3150 NameAddr mDefaultFrom;
129 jason 2727 int mDefaultRegistrationExpires;
130 jason 2871
131     bool mHasOutboundProxy;
132     NameAddr mOutboundProxy;
133 jason 2727
134     std::set<Data> mSupportedSchemes;
135     std::set<MethodTypes> mSupportedMethodTypes;
136     Tokens mSupportedMethods;
137     Tokens mSupportedOptionTags;
138     Mimes mSupportedMimeTypes;
139     Tokens mSupportedEncodings;
140     Tokens mSupportedLanguages;
141 sgodin 3319 std::set<Headers::Type> mAdvertisedCapabilities;
142 fluffy 2870
143     DigestCredentialHandler* mDigestCredentialHandler;
144 derek 3155
145     bool mLooseToTagMatching;
146 derek 3233 bool mRportEnabled;
147 derek 3289 bool mHasUserAgent;
148 fluffy 2870
149 derek 3308 Data mUserAgent;
150     Uri mOverrideHostPort;
151     bool mHasOverrideHostPort;
152 derek 3233
153 fluffy 2870 typedef std::set<DigestCredential> DigestCredentials;
154     DigestCredentials mDigestCredentials;
155 fluffy 2486 };
156 derek 3308
157 jason 3164 std::ostream&
158     operator<<(std::ostream&, const Profile::DigestCredential& cred);
159 fluffy 2502
160     }
161    
162     #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27