mpExperience: added snaplenPcap param to specify snaplen to tcpdump

Avoid storing huge pcap files with lot of useless payloads
This commit is contained in:
Quentin De Coninck 2016-04-13 09:38:17 +02:00
parent a7af377776
commit b5ae4673a9
2 changed files with 5 additions and 2 deletions

View File

@ -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")

View File

@ -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"