Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider b977c901 rédigé par Tom Barbette's avatar Tom Barbette Validation de GitHub
Parcourir les fichiers

Documentation for replay.hh

parent ce305b12
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -71,15 +71,52 @@ replay an input of packets at a given speed ...@@ -71,15 +71,52 @@ replay an input of packets at a given speed
=d =d
Preload packets in RAM, then replays them a certain number of time. This is a pull elements, see ReplayUnqueue for a pull-to-push version.
Keyword arguments are: Keyword arguments are:
=over 8 =over 8
=item STOP =item STOP
Integer. Number of loop to replay. Integer. Number of loop to replay.
=item STOP_TIME
Integer. If > 0, also bound the number of replay loops using a time limit, in seconds.
=item QUICK_CLONE
Boolean. If true, the packets will be cloned using an internal DPDK reference counter, so this will avoid
the packets being duplicated by Click if they are modified and replayed more than once.
The downside is if the replay loop is too fast, the NIC might send corrupted packets.
=item BURST
Integer. Number of packets to send at once.
=item VERBOSE
Integer. Verbosity level.
=item FREEONTERMINATE
Boolean. Free packets on the last run.
=item LIMIT
Integer. Max number of packets to preload.
=item ACTIVE
Boolean. Wether this element should start in active mode. To be used with the active handler.
=item USE_SIGNAL
Boolean. If true, use an upstream empty signal to know wether the element should stop polling for packets when
preloading. Else, stops preloading packets when the pulling returns no packets. Default true.
=back
=e
FromDump(file.pcap, ) -> ReplayUnqueue(3, QUEUE 1) -> ...
=h device read-only
=a ReplayUnqueue, MultiReplayUnqueue
*/ */
class Replay : public ReplayBase { public: class Replay : public ReplayBase { public:
...@@ -117,6 +154,39 @@ class Replay : public ReplayBase { public: ...@@ -117,6 +154,39 @@ class Replay : public ReplayBase { public:
struct s_output _output; struct s_output _output;
}; };
/*
=c
ReplayUnqueue([, I<KEYWORDS>])
=s traces
replay an input of packets at a given speed, pull to push
=d
Technically equivalent to Replay->Unqueue-> it is more efficient.
Keyword arguments are the same than @Replay, with the addition of:
=over 8
=item TIMING
Integer. If 0, replays packets as fast as possible. If >0, give an acceleration speed of the
original timing of the packet.
=item TIMING_FNT
String. A function that can be used to change the TIMING according to
the current time. The parsing uses TinyFNT and therefore follows the format.
The variable containing the time is x. E.g. "10 + min(90,10*x)" will have an
acceleration from 10 to 100% in 9 seconds. Note that if the function goes to 0, the element stops.
See the Metron (NSDI'18) paper for examples. Supports @1 and @2 for the predifined functions for that paper.
@1 is equivalent to "100 * ((sin(-pi/2 + (x/10)^2.5) * (-x/"+time+" + 1) + 1) * (("+max+" - 1) / 2) + 1)"
where TIME is STOP_TIME argument and MAX is the value of TIMING given above.
@2 is equivalent to "100 * ((-squarewave(((x + 40) * 1/50) ^ 5) * (-x / "+time+" + 1) + 1) * (("+max+" - 1) / 2) + 1)"
Ineffective if TIMING is not true. Defaults to an empty string (inactive).
*/
class ReplayUnqueue : public ReplayBase { public: class ReplayUnqueue : public ReplayBase { public:
ReplayUnqueue() CLICK_COLD; ReplayUnqueue() CLICK_COLD;
~ReplayUnqueue() CLICK_COLD; ~ReplayUnqueue() CLICK_COLD;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter