# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
from nepi.execution.attribute import Attribute, Flags, Types
-from nepi.execution.resource import clsinit_copy, failtrap
+from nepi.execution.resource import clsinit_copy
from nepi.resources.linux.application import LinuxApplication
from nepi.util.timefuncs import tnow
@clsinit_copy
class LinuxTcpdump(LinuxApplication):
- _rtype = "LinuxTcpdump"
+ _rtype = "linux::Tcpdump"
@classmethod
def _register_attributes(cls):
"Prints each packet (minus its link level header) in ASCII.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
b = Attribute("b",
"Sets tcpdump -b option. "
"Prints the AS number in BGP packets in ASDOT notation. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
B = Attribute("B",
"Sets tcpdump -B option. "
"Sets the operaing system capture buffer size in untils of "
"KiB (1024 bytes).",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
c = Attribute("c",
"Sets tcpdump -c option. "
"Exists after receiving count packets.",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
C = Attribute("C",
"Sets tcpdump -C option. "
"Savefiles after the first savefile will have the name specified "
"with the -w with a number after it, starting at 1 and continuing "
"upward. ",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
d = Attribute("d",
"Sets tcpdump -d option. "
"to standard output and stop.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
dd = Attribute("dd",
"Sets tcpdump -dd option. "
"Dump packet-matching code as a C program fragment. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
ddd = Attribute("ddd",
"Sets tcpdump -ddd option. "
"(preceded with a count).",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
D = Attribute("D",
"Sets tcpdump -D option. "
"and on which tcpdump can capture packets. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
e = Attribute("e",
"Sets tcpdump -e option. "
"Print the link-level header on each dump line.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
F = Attribute("F",
"Sets tcpdump -F option. "
"Use file as input for the filter expression.",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
G = Attribute("G",
"Sets tcpdump -G option. "
"option every rotate_seconds seconds. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
i = Attribute("i",
"Sets tcpdump -i option. "
"Listen on interface. If unspecified, tcpdump searches the "
"system interface list for the lowest numbered, configured "
"up interface (excluding loopback). ",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
I = Attribute("I",
"Sets tcpdump -I option. "
"operating systems. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
j = Attribute("j",
"Sets tcpdump -j option. "
"The names to use for the time stamp types are given in "
"pcap-tstamp-type(7); not all the types listed there will "
"necessarily be valid for any given interface.",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
K = Attribute("K",
"Sets tcpdump -K option. "
"Don't attempt to verify IP, TCP, or UDP checksums. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
l = Attribute("l",
"Sets tcpdump -l option. "
"Make stdout line buffered. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
U = Attribute("U",
"Sets tcpdump -U option. "
"at the end of each packet. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
n = Attribute("n",
"Sets tcpdump -n option. "
"etc.) to names.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
N = Attribute("N",
"Sets tcpdump -N option. "
"instead of ``nic.ddn.mil''.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
S = Attribute("S",
"Sets tcpdump -S option. "
"Print absolute, rather than relative, TCP sequence numbers.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
s = Attribute("s",
"Sets tcpdump -s option. "
"Snarf snaplen bytes of data from each packet rather than "
"the default of 65535 bytes. ",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
T = Attribute("T",
"Sets tcpdump -T option. "
"protocol), snmp (Simple Network Management Protocol), tftp "
"(Trivial File Transfer Protocol), vat (Visual Audio Tool), "
"and wb (distributed White Board).",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
t = Attribute("t",
"Sets tcpdump -t option. "
"Don't print a timestamp on each dump line.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
tt = Attribute("tt",
"Sets tcpdump -tt option. "
"Print an unformatted timestamp on each dump line. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
ttt = Attribute("ttt",
"Sets tcpdump -ttt option. "
"and previous line on each dump line.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
tttt = Attribute("tttt",
"Sets tcpdump -tttt option. "
"each dump line. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
ttttt = Attribute("ttttt",
"Sets tcpdump -ttttt option. "
"first line on each dump line.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
v = Attribute("v",
"Sets tcpdump -v option. "
"verbose output. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
vv = Attribute("vv",
"Sets tcpdump -vv option. "
"Even more verbose output. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
vvv = Attribute("vvv",
"Sets tcpdump -vv option. "
"Even more verbose output. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
w = Attribute("w",
"Sets tcpdump -w option. "
"and printing them out.",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
expression = Attribute("expression",
"selects which packets will be dumped.",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
cls._register_attribute(A)
cls._register_attribute(b)
self._home = "tcpdump-%s" % self.guid
self._sudo_kill = True
- @failtrap
- def deploy(self):
+ def do_deploy(self):
if not self.get("command"):
self.set("command", self._start_command)
if not self.get("depends"):
self.set("depends", "tcpdump")
- super(LinuxTcpdump, self).deploy()
+ super(LinuxTcpdump, self).do_deploy()
@property
def _start_command(self):