std::string ModuleList; /* Module list of other server from CAPAB */
std::map<std::string,std::string> CapKeys; /* CAPAB keys from other server */
Module* Hook; /* I/O hooking module that we're attached to for this socket */
+ std::string ourchallenge; /* Challenge sent for challenge/response */
+ std::string theirchallenge; /* Challenge recv for challenge/response */
public:
*/
ServerState GetLinkState();
+ /** Get challenge set in our CAPAB for challenge/response
+ */
+ const std::string& GetOurChallenge();
+
+ /** Get challenge set in our CAPAB for challenge/response
+ */
+ void SetOurChallenge(const std::string &c);
+
+ /** Get challenge set in their CAPAB for challenge/response
+ */
+ const std::string& GetTheirChallenge();
+
+ /** Get challenge set in their CAPAB for challenge/response
+ */
+ void SetTheirChallenge(const std::string &c);
+
/** Return the module which we are hooking to for I/O encapsulation
*/
Module* GetHook();
{
myhost = host;
this->LinkState = LISTENER;
+ theirchallenge = ourchallenge = "";
if (listening && Hook)
InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
}
: InspSocket(SI, host, port, listening, maxtime, bindto), Utils(Util), Hook(HookMod)
{
myhost = ServerName;
+ theirchallenge = ourchallenge = "";
this->LinkState = CONNECTING;
if (Hook)
InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
: InspSocket(SI, newfd, ip), Utils(Util), Hook(HookMod)
{
this->LinkState = WAIT_AUTH_1;
+ theirchallenge = ourchallenge = "";
/* If we have a transport module hooked to the parent, hook the same module to this
* socket, and set a timer waiting for handshake before we send CAPAB etc.
*/
InspSocketUnhookRequest(this, (Module*)Utils->Creator, Hook).Send();
}
+const std::string& TreeSocket::GetOurChallenge()
+{
+ return this->ourchallenge;
+}
+
+void TreeSocket::SetOurChallenge(const std::string &c)
+{
+ this->ourchallenge = c;
+}
+
+const std::string& TreeSocket::GetTheirChallenge()
+{
+ return this->theirchallenge;
+}
+
+void TreeSocket::SetTheirChallenge(const std::string &c)
+{
+ this->theirchallenge = c;
+}
+
/** When an outbound connection finishes connecting, we receive
* this event, and must send our SERVER string to the other
* side. If the other side is happy, as outlined in the server