|
|
|
@ -237,35 +237,47 @@ namespace data
@@ -237,35 +237,47 @@ namespace data
|
|
|
|
|
{ |
|
|
|
|
switch (*cap) |
|
|
|
|
{ |
|
|
|
|
case 'f': |
|
|
|
|
case CAPS_FLAG_FLOODFILL: |
|
|
|
|
m_Caps |= Caps::eFloodfill; |
|
|
|
|
break; |
|
|
|
|
case 'M': |
|
|
|
|
case 'N': |
|
|
|
|
case 'O': |
|
|
|
|
case CAPS_FLAG_HIGH_BANDWIDTH1: |
|
|
|
|
case CAPS_FLAG_HIGH_BANDWIDTH2: |
|
|
|
|
case CAPS_FLAG_HIGH_BANDWIDTH3: |
|
|
|
|
m_Caps |= Caps::eHighBandwidth; |
|
|
|
|
break; |
|
|
|
|
case 'R': |
|
|
|
|
case CAPS_FLAG_HIDDEN: |
|
|
|
|
m_Caps |= Caps::eHidden; |
|
|
|
|
break; |
|
|
|
|
case CAPS_FLAG_REACHABLE: |
|
|
|
|
m_Caps |= Caps::eReachable; |
|
|
|
|
break; |
|
|
|
|
case 'B': |
|
|
|
|
case CAPS_FLAG_UNREACHABLE: |
|
|
|
|
m_Caps |= Caps::eUnreachable; |
|
|
|
|
break; |
|
|
|
|
case CAPS_FLAG_SSU_TESTING: |
|
|
|
|
m_Caps |= Caps::eSSUTesting; |
|
|
|
|
break; |
|
|
|
|
case 'C': |
|
|
|
|
case CAPS_FLAG_SSU_INTRODUCER: |
|
|
|
|
m_Caps |= Caps::eSSUIntroducer; |
|
|
|
|
break; |
|
|
|
|
case 'H': |
|
|
|
|
m_Caps |= Caps::eHidden; |
|
|
|
|
break; |
|
|
|
|
case 'U': |
|
|
|
|
m_Caps |= Caps::eUnreachable; |
|
|
|
|
break; |
|
|
|
|
default: ; |
|
|
|
|
} |
|
|
|
|
cap++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RouterInfo::UpdateCapsProperty () |
|
|
|
|
{ |
|
|
|
|
std::string caps; |
|
|
|
|
caps += (m_Caps & eHighBandwidth) ? CAPS_FLAG_HIGH_BANDWIDTH1 : CAPS_FLAG_LOW_BANDWIDTH2; // bandwidth
|
|
|
|
|
if (m_Caps & eFloodfill) caps += CAPS_FLAG_FLOODFILL; // floodfill
|
|
|
|
|
if (m_Caps & eHidden) caps += CAPS_FLAG_HIDDEN; // hidden
|
|
|
|
|
if (m_Caps & eReachable) caps += CAPS_FLAG_REACHABLE; // reachable
|
|
|
|
|
if (m_Caps & eUnreachable) caps += CAPS_FLAG_UNREACHABLE; // unreachable
|
|
|
|
|
|
|
|
|
|
SetProperty ("caps", caps.c_str ()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RouterInfo::UpdateIdentHashBase64 () |
|
|
|
|
{ |
|
|
|
|
size_t l = i2p::data::ByteStreamToBase64 (m_IdentHash, 32, m_IdentHashBase64, 48); |
|
|
|
@ -302,8 +314,8 @@ namespace data
@@ -302,8 +314,8 @@ namespace data
|
|
|
|
|
WriteString ("caps", properties); |
|
|
|
|
properties << '='; |
|
|
|
|
std::string caps; |
|
|
|
|
if (IsPeerTesting ()) caps += 'B'; |
|
|
|
|
if (IsIntroducer ()) caps += 'C'; |
|
|
|
|
if (IsPeerTesting ()) caps += CAPS_FLAG_SSU_TESTING; |
|
|
|
|
if (IsIntroducer ()) caps += CAPS_FLAG_SSU_INTRODUCER; |
|
|
|
|
WriteString (caps, properties); |
|
|
|
|
properties << ';'; |
|
|
|
|
} |
|
|
|
@ -512,6 +524,12 @@ namespace data
@@ -512,6 +524,12 @@ namespace data
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RouterInfo::SetCaps (uint8_t caps) |
|
|
|
|
{ |
|
|
|
|
m_Caps = caps; |
|
|
|
|
UpdateCapsProperty (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RouterInfo::SetCaps (const char * caps) |
|
|
|
|
{ |
|
|
|
|
SetProperty ("caps", caps); |
|
|
|
|