scapy.contrib.geneve module

Geneve: Generic Network Virtualization Encapsulation

draft-ietf-nvo3-geneve-06

class scapy.contrib.geneve.GENEVE

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.geneve.GENEVE'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (GENEVE).version>, <Field (GENEVE).optionlen>, <Field (GENEVE).oam>, <Field (GENEVE).critical>, <Field (GENEVE).reserved>, <Field (GENEVE).proto>, <Field (GENEVE).vni>, <Field (GENEVE).reserved2>, <Field (GENEVE).options>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

payload_guess = [({'proto': 25944}, <class 'scapy.layers.l2.Ether'>), ({'proto': 2048}, <class 'scapy.layers.inet.IP'>), ({'proto': 34525}, <class 'scapy.layers.inet6.IPv6'>)]
post_build(p, 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

class scapy.contrib.geneve.GENEVEOptionsField(name, default, fmt='H', remain=0)

Bases: scapy.fields.XStrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

islist = 1