Exemple #1
0
func (c *cmdReplay) ParsingFinished() (err error) {
	if !c.shouldExecute {
		return
	}
	conf := packet.ReplayConfig{
		IfaceName: c.OutputInterface,
		DumpName:  c.InputFileName,
		Limit:     c.Limit,
		Pps:       c.Pps,
		Loop:      c.Loop,
	}
	r := packet.NewReplay(&conf)
	errs.CheckE(r.Run())
	return
}
Exemple #2
0
func (e *efhReplay) startDumpReplay() (err error) {
	conf := packet.ReplayConfig{
		IfaceName: e.OutputInterface,
		DumpName:  e.InputFileName,
		Limit:     e.Limit,
		Pps:       e.Pps,
		Loop:      e.Loop,
	}
	e.replay = packet.NewReplay(&conf)
	log.Printf("starting replay %v", e.replay)
	e.replayDoneCh = make(chan struct{})
	go func() {
		errs.CheckE(e.replay.Run())
		close(e.replayDoneCh)
	}()
	return
}