Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Nel codice di esempio seguente, il monitoraggio imposta un filtro di acquisizione che specifica ip solo e i dati del protocollo richiesti.
STDMETHODIMP CTestMon::OnFrames(UPDATE_EVENT Event)
{
DWORD i;
LPFRAMETABLE lpFrameTable = Event.lpFrameTable;
// The frame table can wrap the indexes.
for (
i = lpFrameTable->StartIndex;
i != lpFrameTable->EndIndex;
(i == lpFrameTable->FrameTableLength ) ? i=0: i ++ )
{
LPFRAME_DESCRIPTOR lpFrameDesc = &lpFrameTable->Frames[i];
// Cast the frame data to an unaligned pointer to an IP
// structure. A try/catch block could be a workaround, but
// if the capture filter is set correctly, this is the
// verifiable IP.
ULPIP ulpIP = (ULPIP)(&lpFrameDesc->FramePointer[lpFrameDesc->LowProtocolOffset]);
// Now examine the IP frame.
}
return NOERROR;
}