bool GetNodeInfoMsgEx::processIncoming(struct sockaddr_in* fromAddr, Socket* sock, char* respBuf, size_t bufLen, HighResolutionStats* stats) { LogContext log("GetNodeInfoMsg incoming"); std::string peer = fromAddr ? Socket::ipaddrToStr(&fromAddr->sin_addr) : sock->getPeername(); LOG_DEBUG_CONTEXT(log, 4, std::string("Received a GetNodeInfoMsg") + peer); GeneralNodeInfo info; App *app = Program::getApp(); getCPUInfo(&(info.cpuName), &(info.cpuSpeed), &(info.cpuCount)); getMemInfo(&(info.memTotal), &(info.memFree)); info.logFilePath = app->getConfig()->getLogStdFile(); Node *localNode = app->getLocalNode(); std::string nodeID = localNode->getID(); uint16_t nodeNumID = localNode->getNumID(); GetNodeInfoRespMsg getNodeInfoRespMsg(nodeID.c_str(), nodeNumID, info); getNodeInfoRespMsg.serialize(respBuf, bufLen); sock->sendto(respBuf, getNodeInfoRespMsg.getMsgLength(), 0, (struct sockaddr*) fromAddr, sizeof(struct sockaddr_in)); LOG_DEBUG_CONTEXT(log, 5, std::string("Sent a message with type: " ) + StringTk::uintToStr( getNodeInfoRespMsg.getMsgType() ) + std::string(" to admon")); app->getClientOpStats()->updateNodeOp(sock->getPeerIP(), MetaOpCounter_GETNODEINFO); return true; }
PlanarFrame::PlanarFrame() { ypitch = uvpitch = 0; ywidth = uvwidth = 0; yheight = uvheight = 0; y = u = v = NULL; useSIMD = true; cpu = getCPUInfo(); }
PlanarFrame::PlanarFrame(VideoInfo &viInfo) { ypitch = uvpitch = 0; ywidth = uvwidth = 0; yheight = uvheight = 0; planar_1 = planar_2 = planar_3 = planar_4 = NULL; useSIMD = true; cpu = getCPUInfo(); alloc_ok=allocSpace(viInfo); }
PlanarFrame::PlanarFrame(VideoInfo &viInfo) { ypitch = uvpitch = 0; ywidth = uvwidth = 0; yheight = uvheight = 0; y = u = v = NULL; useSIMD = true; cpu = getCPUInfo(); allocSpace(viInfo); }
PlanarFrame::PlanarFrame(void) { alloc_ok=false; ypitch = uvpitch = 0; ywidth = uvwidth = 0; yheight = uvheight = 0; planar_1 = planar_2 = planar_3 = planar_4 = NULL; useSIMD = true; cpu = getCPUInfo(); isRGBPfamily = false; isAlphaChannel = false; grey = false; pixelsize=1; bits_per_pixel=8; }
int calcHWID( char *out ) { char globalIDString[4096] = {0}; char based[4096] = {0}; char volumeSN[256] = {0}, hwSN[256] = {0}, fsName[256] = {0}; char biosInfo[1024] = {0}; char os_info[1024] = {0}; char cpu_info[1024] = {0}; getHDDInfo( volumeSN, hwSN, fsName ); getBIOSInfo( biosInfo ); getOSInfo( os_info ); getCPUInfo( cpu_info ); sprintf( globalIDString, "%s|%s|%s|%s|%s|%s", volumeSN, hwSN, fsName, biosInfo, os_info, cpu_info ); base64_encode_string( globalIDString, strlen(globalIDString), based ); strcpy( out, based ); return 1; }