diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst')
-rw-r--r-- | scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst b/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst new file mode 100644 index 00000000..5544df63 --- /dev/null +++ b/scripts/automation/trex_control_plane/doc_stl/api/scapy_builder.rst @@ -0,0 +1,44 @@ + +Packet builder modules +======================= + +The packet builder module objective is to build a template packet for a stream and to create a Field engine program to change fields in the packet. + +**Some examples for what can be done:** + +* Build a IP/UDP/DNS packet and create a range of src_ip = 10.0.0.1-10.0.0.255 +* Build a IP/UDP packets in IMIX sizes + + +for example this snippet will create SYN Attack:: + + # create attack from random src_ip from 16.0.0.0-18.0.0.254 and random src_port 1025-65000 + # attack 48.0.0.1 server + + def create_stream (self): + + + # TCP SYN + base_pkt = Ether()/IP(dst="48.0.0.1")/TCP(dport=80,flags="S") + + pkt = STLPktBuilder(pkt = base_pkt) + + return STLStream(packet = pkt, #<<<<< set packet builder inside the stream + mode = STLTXCont()) + + + + +STLPktBuilder class +-------------------- + +Aggregate a raw instructions objects + +.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLPktBuilder + :members: + :member-order: bysource + + + + + |