var searchIndex = {}; searchIndex["pcap"] = {"doc":"pcap is a packet capture library available on Linux, Windows and Mac. This\ncrate supports creating and configuring capture contexts, sniffing packets,\nsending packets to interfaces, listing devices, and recording packet captures\nto pcap-format dump files.","items":[[3,"PacketHeader","pcap","Represents a packet header provided by pcap, including the timeval, caplen and len.",null,null],[12,"ts","","",0,null],[12,"caplen","","",0,null],[12,"len","","",0,null],[3,"Device","","A network device name and (potentially) pcap's description of it.",null,null],[12,"name","","",1,null],[12,"desc","","",1,null],[3,"Linktype","","This is a datalink link type.",null,null],[12,"0","","",2,null],[3,"Packet","","Represents a packet returned from pcap.",null,null],[12,"header","","",3,null],[12,"data","","",3,null],[3,"Stat","","",null,null],[3,"Capture","","This is a pcap capture handle which is an abstraction over the `pcap_t` provided by pcap.\nThere are many ways to instantiate and interact with a pcap handle, so phantom types are\nused to express these behaviors.",null,null],[3,"Savefile","","Abstraction for writing pcap savefiles, which can be read afterwards via `Capture::from_file()`.",null,null],[4,"Error","","An error received from pcap",null,null],[13,"MalformedError","","",4,null],[13,"InvalidString","","",4,null],[13,"PcapError","","",4,null],[13,"InvalidLinktype","","",4,null],[13,"TimeoutExpired","","",4,null],[13,"NoMorePackets","","",4,null],[4,"Inactive","","Phantom type representing an inactive capture handle.",null,null],[4,"Active","","Phantom type representing an active capture handle.",null,null],[4,"Offline","","Phantom type representing an offline capture handle, from a pcap dump file.\nImplements `Activated` because it behaves nearly the same as a live handle.",null,null],[11,"clone","","",0,null],[11,"fmt","","",0,null],[8,"Activated","","",null,null],[8,"State","","`Capture`s can be in different states at different times, and in these states they\nmay or may not have particular capabilities. This trait is implemented by phantom\ntypes which allows us to punt these invariants to the type system to avoid runtime\nerrors.",null,null],[11,"fmt","","",4,null],[11,"fmt","","",4,null],[11,"description","","",4,null],[11,"cause","","",4,null],[11,"from","","",4,{"inputs":[{"name":"utf8error"}],"output":{"name":"error"}}],[11,"fmt","","",1,null],[11,"open","","Opens a `Capture<Active>` on this device.",1,null],[11,"lookup","","Returns the default Device suitable for captures according to pcap_lookupdev,\nor an error from pcap.",1,{"inputs":[],"output":{"name":"result"}}],[11,"list","","Returns a vector of `Device`s known by pcap via pcap_findalldevs.",1,{"inputs":[],"output":{"name":"result"}}],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"fmt","","",2,null],[11,"get_name","","Gets the name of the link type, such as EN10MB",2,null],[11,"get_description","","Gets the description of a link type.",2,null],[11,"fmt","","",3,null],[11,"deref","","",3,null],[11,"clone","","",5,null],[11,"fmt","","",5,null],[11,"from_file","","Opens an offline capture handle from a pcap dump file, given a path.",6,{"inputs":[{"name":"p"}],"output":{"name":"result"}}],[11,"from_device","","Opens a capture handle for a device. You can pass a `Device` or an `&str` device\nname here. The handle is inactive, but can be activated via `.open()`.",6,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"open","","Activates an inactive capture created from `Capture::from_device()` or returns\nan error.",6,null],[11,"timeout","","Set the read timeout for the Capture. By default, this is 0, so it will block\nindefinitely.",6,null],[11,"promisc","","Set promiscuous mode on or off. By default, this is off.",6,null],[11,"rfmon","","Set rfmon mode on or off. The default is maintained by pcap.",6,null],[11,"buffer_size","","Set the buffer size for incoming packet data.",6,null],[11,"snaplen","","Set the snaplen size (the maximum length of a packet captured into the buffer).\nUseful if you only want certain headers, but not the entire packet.",6,null],[11,"list_datalinks","","List the datalink types that this captured device supports.",6,null],[11,"set_datalink","","Set the datalink type for the current capture handle.",6,null],[11,"get_datalink","","Get the current datalink type for this capture handle.",6,null],[11,"savefile","","Create a `Savefile` context for recording captured packets using this `Capture`'s\nconfigurations.",6,null],[11,"next","","Blocks until a packet is returned from the capture handle or an error occurs.",6,null],[11,"filter","","Adds a filter to the capture using the given BPF program string. Internally\nthis is compiled using `pcap_compile()`.",6,null],[11,"stats","","",6,null],[11,"sendpacket","","Sends a packet over this capture handle's interface.",6,null],[11,"drop","","",6,null],[11,"from","","",6,{"inputs":[{"name":"capture"}],"output":{"name":"capture"}}],[11,"write","","",7,null],[11,"drop","","",7,null]],"paths":[[3,"PacketHeader"],[3,"Device"],[3,"Linktype"],[3,"Packet"],[4,"Error"],[3,"Stat"],[3,"Capture"],[3,"Savefile"]]}; initSearch(searchIndex);