MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / GetIPAddress

Method GetIPAddress

src/tw/twutil.cpp:1151–1165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149}
1150
1151TSTRING cTWUtil::GetIPAddress()
1152{
1153 uint32 ipaddress;
1154 if (iFSServices::GetInstance()->GetIPAddress(ipaddress) == false)
1155 return TSS_GetString(cTW, tw::STR_IP_UNKNOWN);
1156
1157 // convert to host byte-order
1158 ipaddress = tw_ntohl(ipaddress);
1159
1160 TOSTRINGSTREAM ret;
1161 ret << (int)(ipaddress >> 24) << _T(".") << (int)((ipaddress >> 16) & 0xff) << _T(".")
1162 << (int)((ipaddress >> 8) & 0xff) << _T(".") << (int)(ipaddress & 0xff);
1163
1164 return ret.str();
1165}
1166
1167TSTRING cTWUtil::GetCurrentUser()
1168{

Callers 3

OutputDatabaseHeaderFunction · 0.45
OutputReportHeaderMethod · 0.45
TestGetIPAddressFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestGetIPAddressFunction · 0.36