IPMonitor Class

Properties   Methods   Events   Configuration Settings   Errors  

The IPMonitor class is used to listen to network traffic.

Syntax

class ipworks.IPMonitor

Remarks

The IPMonitor class will bind to a specific local host address and listen for network traffic received by the interface. The interface must support promiscuous mode (may not work in many wireless cards because of security considerations), and must be installed on Windows 2000 or greater.

NOTE: If your computer connects to a switch, the switch will only forward packets addressed to your computer. If your computer is on a hub, then you will receive everything.

The use of this component requires administrative permissions.

The first step in using the IPMonitor class is to set local_host to the IP address whose traffic you wish to monitor, then set active to True. For each packet that crosses the interface, the class will parse the header and fire an on_ip_packet event.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

accept_dataEnables or disables data reception (the IPPacket event).
activeEnables or disables network monitoring.
ip_packetThe contents of the current packet.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting.
do_eventsProcesses events from the internal message queue.
list_ip_addressesLists the valid IP addresses for this host.
parse_pcap_fileParses the specified pcap file.
resetReset the class.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_errorInformation about errors during data delivery.
on_ip_addressFired for each valid IP address on this host.
on_ip_packetFired whenever a packet is received.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

ListInterfaceLists the interfaces visible to the WinPCap or NPCap driver.
ReceiveAllModeEnables a socket to receive all IPv4 or IPv6 packets on the network.
SelectedInterfaceUsed to select the interface the WinPCap or NPCap driver will listen on.
UseWinPCapWhether to use the WinPCap or NPCap driver.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]