mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
lookuplocal
This commit is contained in:
parent
616f0b2a21
commit
2d972752ff
@ -645,6 +645,22 @@ namespace client
|
|||||||
localDestination->RequestDestinationWithEncryptedLeaseSet (addr->blindedPublicKey, requstCallback);
|
localDestination->RequestDestinationWithEncryptedLeaseSet (addr->blindedPublicKey, requstCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BOBCommandSession::LookupLocalCommandHandler (const char * operand, size_t len)
|
||||||
|
{
|
||||||
|
LogPrint (eLogDebug, "BOB: lookup local ", operand);
|
||||||
|
auto addr = context.GetAddressBook ().GetAddress (operand);
|
||||||
|
if (!addr)
|
||||||
|
{
|
||||||
|
SendReplyError ("Address Not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto ls = i2p::data::netdb.FindLeaseSet (addr->identHash);
|
||||||
|
if (ls)
|
||||||
|
SendReplyOK (ls->GetIdentity ()->ToBase64 ().c_str ());
|
||||||
|
else
|
||||||
|
SendReplyError ("Local LeaseSet Not found");
|
||||||
|
}
|
||||||
|
|
||||||
void BOBCommandSession::ClearCommandHandler (const char * operand, size_t len)
|
void BOBCommandSession::ClearCommandHandler (const char * operand, size_t len)
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "BOB: clear");
|
LogPrint (eLogDebug, "BOB: clear");
|
||||||
@ -770,6 +786,7 @@ namespace client
|
|||||||
m_CommandHandlers[BOB_COMMAND_INPORT] = &BOBCommandSession::InportCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_INPORT] = &BOBCommandSession::InportCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_QUIET] = &BOBCommandSession::QuietCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_QUIET] = &BOBCommandSession::QuietCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_LOOKUP] = &BOBCommandSession::LookupCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_LOOKUP] = &BOBCommandSession::LookupCommandHandler;
|
||||||
|
m_CommandHandlers[BOB_COMMAND_LOOKUP_LOCAL] = &BOBCommandSession::LookupLocalCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_CLEAR] = &BOBCommandSession::ClearCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_CLEAR] = &BOBCommandSession::ClearCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_LIST] = &BOBCommandSession::ListCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_LIST] = &BOBCommandSession::ListCommandHandler;
|
||||||
m_CommandHandlers[BOB_COMMAND_OPTION] = &BOBCommandSession::OptionCommandHandler;
|
m_CommandHandlers[BOB_COMMAND_OPTION] = &BOBCommandSession::OptionCommandHandler;
|
||||||
|
@ -42,6 +42,7 @@ namespace client
|
|||||||
const char BOB_COMMAND_INPORT[] = "inport";
|
const char BOB_COMMAND_INPORT[] = "inport";
|
||||||
const char BOB_COMMAND_QUIET[] = "quiet";
|
const char BOB_COMMAND_QUIET[] = "quiet";
|
||||||
const char BOB_COMMAND_LOOKUP[] = "lookup";
|
const char BOB_COMMAND_LOOKUP[] = "lookup";
|
||||||
|
const char BOB_COMMAND_LOOKUP_LOCAL[] = "lookuplocal";
|
||||||
const char BOB_COMMAND_CLEAR[] = "clear";
|
const char BOB_COMMAND_CLEAR[] = "clear";
|
||||||
const char BOB_COMMAND_LIST[] = "list";
|
const char BOB_COMMAND_LIST[] = "list";
|
||||||
const char BOB_COMMAND_OPTION[] = "option";
|
const char BOB_COMMAND_OPTION[] = "option";
|
||||||
@ -206,6 +207,7 @@ namespace client
|
|||||||
void InportCommandHandler (const char * operand, size_t len);
|
void InportCommandHandler (const char * operand, size_t len);
|
||||||
void QuietCommandHandler (const char * operand, size_t len);
|
void QuietCommandHandler (const char * operand, size_t len);
|
||||||
void LookupCommandHandler (const char * operand, size_t len);
|
void LookupCommandHandler (const char * operand, size_t len);
|
||||||
|
void LookupLocalCommandHandler (const char * operand, size_t len);
|
||||||
void ClearCommandHandler (const char * operand, size_t len);
|
void ClearCommandHandler (const char * operand, size_t len);
|
||||||
void ListCommandHandler (const char * operand, size_t len);
|
void ListCommandHandler (const char * operand, size_t len);
|
||||||
void OptionCommandHandler (const char * operand, size_t len);
|
void OptionCommandHandler (const char * operand, size_t len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user