1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Vincent Perot - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.pcap
.core
.filter
;
15 import org
.eclipse
.linuxtools
.pcap
.core
.packet
.Packet
;
16 import org
.eclipse
.linuxtools
.pcap
.core
.protocol
.Protocol
;
19 * Class used to filter the packets by protocol. This is used, for instance, to
20 * build the packet streams.
22 * @author Vincent Perot
24 public class PacketFilterByProtocol
implements IPacketFilter
{
26 private final Protocol fProtocol
;
29 * Constructor of the PacketFilterByProtocol class.
32 * The protocol that the incoming packets must contain.
34 public PacketFilterByProtocol(Protocol protocol
) {
39 public boolean accepts(Packet packet
) {
40 return packet
.hasProtocol(fProtocol
);
44 * Getter method for the protocol of this filter.
46 * @return The protocol of this filter.
48 public Protocol
getProtocol() {
This page took 0.031421 seconds and 5 git commands to generate.