diff --git a/src/pyshark/capture/file_capture.py b/src/pyshark/capture/file_capture.py index 600439c..ca50707 100644 --- a/src/pyshark/capture/file_capture.py +++ b/src/pyshark/capture/file_capture.py @@ -45,8 +45,8 @@ def __init__(self, input_file=None, keep_packets=True, display_filter=None, only self.input_filepath = pathlib.Path(input_file) if not self.input_filepath.exists(): raise FileNotFoundError(f"[Errno 2] No such file or directory: {self.input_filepath}") - if not self.input_filepath.is_file(): - raise FileNotFoundError(f"{self.input_filepath} is a directory") + if not self.input_filepath.is_file() and not self.input_filepath.is_fifo(): + raise FileNotFoundError(f"{self.input_filepath} is not a file or fifo") self.keep_packets = keep_packets self._packet_generator = self._packets_from_tshark_sync() diff --git a/src/pyshark/capture/live_capture.py b/src/pyshark/capture/live_capture.py index 3731bd6..325c9a1 100644 --- a/src/pyshark/capture/live_capture.py +++ b/src/pyshark/capture/live_capture.py @@ -65,9 +65,11 @@ def __init__(self, interface=None, bpf_filter=None, display_filter=None, only_su def get_parameters(self, packet_count=None): """Returns the special tshark parameters to be used according to the configuration of this class.""" - params = super(LiveCapture, self).get_parameters(packet_count=packet_count) - # Read from STDIN - params += ["-i", "-"] + params = super(LiveCapture, self).get_parameters( + packet_count=packet_count) + # Read directly from interfaces + for interface in self.interfaces: + params += ["-i", interface] return params def _verify_capture_parameters(self): diff --git a/src/pyshark/packet/packet.py b/src/pyshark/packet/packet.py index b0a823d..c706f4e 100644 --- a/src/pyshark/packet/packet.py +++ b/src/pyshark/packet/packet.py @@ -122,7 +122,11 @@ def __getattr__(self, item): Allows layers to be retrieved via get attr. For instance: pkt.ip """ for layer in self.layers: +<<<<<<< HEAD + if layer.layer_name.lower() == item: +======= if layer.layer_name.lower() == item.lower(): +>>>>>>> upstream/master return layer raise AttributeError(f"No attribute named {item}")