From b5ae4673a9be43353ec0f5ba4f1425fc69a78c25 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Wed, 13 Apr 2016 09:38:17 +0200 Subject: [PATCH] mpExperience: added snaplenPcap param to specify snaplen to tcpdump Avoid storing huge pcap files with lot of useless payloads --- src/mpExperience.py | 5 +++-- src/mpParamXp.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mpExperience.py b/src/mpExperience.py index 4687908..d1c7771 100644 --- a/src/mpExperience.py +++ b/src/mpExperience.py @@ -178,11 +178,12 @@ class MpExperience: #todo : replace filename by cst cpcap = self.xpParam.getParam(MpParamXp.CLIENTPCAP) spcap = self.xpParam.getParam(MpParamXp.SERVERPCAP) + snaplenpcap = self.xpParam.getParam(MpParamXp.SNAPLENPCAP) if cpcap == "yes" : self.mpTopo.commandTo(self.mpConfig.client, - "tcpdump -i any -w client.pcap &") + "tcpdump -i any -s " + snaplenpcap + " -w client.pcap &") if spcap == "yes" : self.mpTopo.commandTo(self.mpConfig.server, - "tcpdump -i any -w server.pcap &") + "tcpdump -i any -s " + snaplenpcap + " -w server.pcap &") if spcap == "yes" or cpcap == "yes": self.mpTopo.commandTo(self.mpConfig.client,"sleep 5") diff --git a/src/mpParamXp.py b/src/mpParamXp.py index 0876126..a20c47f 100644 --- a/src/mpParamXp.py +++ b/src/mpParamXp.py @@ -15,6 +15,7 @@ class MpParamXp(MpParam): USERPMSARGS = "upms_args" CLIENTPCAP = "clientPcap" SERVERPCAP = "serverPcap" + SNAPLENPCAP = "snaplenPcap" XPTYPE = "xpType" PINGCOUNT = "pingCount" DDIBS = "ddIBS" @@ -68,6 +69,7 @@ class MpParamXp(MpParam): defaultValue[CLIENTPCAP] = "no" defaultValue[SERVERPCAP] = "no" + defaultValue[SNAPLENPCAP] = "65535" # Default snapping value of tcpdump defaultValue[XPTYPE] = "none" defaultValue[PINGCOUNT] = "5" defaultValue[DDIBS] = "1k"