scapy.layers.l2tp module

L2TP (Layer 2 Tunneling Protocol) for VPNs.

[RFC 2661]

class scapy.layers.l2tp.L2TP

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.l2tp.L2TP'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (L2TP).hdr>, <Field (L2TP).version>, <scapy.fields.ConditionalField object>, <Field (L2TP).tunnel_id>, <Field (L2TP).session_id>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
payload_guess = [({}, <class 'scapy.layers.ppp.PPP'>)]
post_build(pkt, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload