scapy.contrib.openflow

class scapy.contrib.openflow.OFPAT

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(s)
class scapy.contrib.openflow.OFPATEnqueue

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATEnqueue fields

type

ShortEnumField

11

len

ShortField

16

port

ShortEnumField

0

pad

XBitField (48 bits)

0

queue_id

IntField

0

class scapy.contrib.openflow.OFPATOutput

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATOutput fields

type

ShortEnumField

0

len

ShortField

8

port

ShortEnumField

0

max_len

ShortEnumField

65535

class scapy.contrib.openflow.OFPATSetDlDst

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetDlDst fields

type

ShortEnumField

5

len

ShortField

16

dl_addr

MACField

'0'

pad

XBitField (48 bits)

0

class scapy.contrib.openflow.OFPATSetDlSrc

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetDlSrc fields

type

ShortEnumField

4

len

ShortField

16

dl_addr

MACField

'0'

pad

XBitField (48 bits)

0

class scapy.contrib.openflow.OFPATSetNwDst

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetNwDst fields

type

ShortEnumField

7

len

ShortField

8

nw_addr

IPField

'0'

class scapy.contrib.openflow.OFPATSetNwSrc

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetNwSrc fields

type

ShortEnumField

6

len

ShortField

8

nw_addr

IPField

'0'

class scapy.contrib.openflow.OFPATSetNwToS

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetNwToS fields

type

ShortEnumField

8

len

ShortField

8

nw_tos

ByteField

0

pad

X3BytesField

0

class scapy.contrib.openflow.OFPATSetTpDst

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetTpDst fields

type

ShortEnumField

10

len

ShortField

8

tp_port

ShortField

0

pad

XShortField

0

class scapy.contrib.openflow.OFPATSetTpSrc

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetTpSrc fields

type

ShortEnumField

9

len

ShortField

8

tp_port

ShortField

0

pad

XShortField

0

class scapy.contrib.openflow.OFPATSetVLANPCP

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetVLANPCP fields

type

ShortEnumField

2

len

ShortField

8

vlan_pcp

ByteField

0

pad

X3BytesField

0

class scapy.contrib.openflow.OFPATSetVLANVID

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATSetVLANVID fields

type

ShortEnumField

1

len

ShortField

8

vlan_vid

ShortField

0

pad

XShortField

0

class scapy.contrib.openflow.OFPATStripVLAN

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATStripVLAN fields

type

ShortEnumField

3

len

ShortField

8

pad

XIntField

0

class scapy.contrib.openflow.OFPATVendor

Bases: scapy.contrib.openflow.OpenFlow

aliastypes
fields_desc
OFPATVendor fields

type

ShortEnumField

65535

len

ShortField

8

vendor

IntField

0

class scapy.contrib.openflow.OFPETBadAction

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETBadAction fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

2

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPETBadRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETBadRequest fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

1

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPETFlowModFailed

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETFlowModFailed fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

3

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPETHelloFailed

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETHelloFailed fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

0

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPETPortModFailed

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETPortModFailed fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

4

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPETQueueOpFailed

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPETQueueOpFailed fields

version

ByteEnumField

1

type

ByteEnumField

1

len

ShortField

None

xid

IntField

0

errtype

ShortEnumField

5

errcode

ShortEnumField

0

data

OFPacketField

b''

class scapy.contrib.openflow.OFPFlowStats

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPFlowStats fields

length

ShortField

None

table_id

ByteField

0

pad1

XByteField

0

match

PacketField

<OFPMatch  |>

duration_sec

IntField

0

duration_nsec

IntField

0

priority

ShortField

0

idle_timeout

ShortField

0

hard_timeout

ShortField

0

pad2

XBitField (48 bits)

0

cookie

LongField

0

packet_count

LongField

0

byte_count

LongField

0

actions

PacketListField

[]

post_build(p, pay)
class scapy.contrib.openflow.OFPMatch

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPMatch fields

wildcards1

FlagsField (12 bits)

None

nw_dst_mask

BitField (6 bits)

None

nw_src_mask

BitField (6 bits)

None

wildcards2

FlagsField (8 bits)

None

in_port

ShortEnumField

None

dl_src

MACField

None

dl_dst

MACField

None

dl_vlan

ShortField

None

dl_vlan_pcp

ByteField

None

pad1

XByteField

None

dl_type

ShortField

None

nw_tos

ByteField

None

nw_proto

ByteField

None

pad2

XShortField

None

nw_src

IPField

'0'

nw_dst

IPField

'0'

tp_src

ShortField

None

tp_dst

ShortField

None

post_build(p, pay)
class scapy.contrib.openflow.OFPPacketQueue

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPPacketQueue fields

queue_id

IntField

0

len

ShortField

None

pad

XShortField

0

properties

PacketListField

[]

post_build(p, pay)
class scapy.contrib.openflow.OFPPhyPort

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPPhyPort fields

port_no

ShortEnumField

0

hw_addr

MACField

'0'

port_name

StrFixedLenField

b''

config

FlagsField (32 bits)

<Flag 0 ()>

stp_state

BitEnumField (24 bits)

0

state

FlagsField (8 bits)

<Flag 0 ()>

curr

FlagsField (32 bits)

<Flag 0 ()>

advertised

FlagsField (32 bits)

<Flag 0 ()>

supported

FlagsField (32 bits)

<Flag 0 ()>

peer

FlagsField (32 bits)

<Flag 0 ()>

class scapy.contrib.openflow.OFPPortStats

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPPortStats fields

port_no

ShortEnumField

0

pad

XBitField (48 bits)

0

rx_packets

LongField

0

tx_packets

LongField

0

rx_bytes

LongField

0

tx_bytes

LongField

0

rx_dropped

LongField

0

tx_dropped

LongField

0

rx_errors

LongField

0

tx_errors

LongField

0

rx_frame_err

LongField

0

rx_over_err

LongField

0

rx_crc_err

LongField

0

collisions

LongField

0

class scapy.contrib.openflow.OFPQT

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(s)
class scapy.contrib.openflow.OFPQTMinRate

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPQTMinRate fields

type

ShortEnumField

1

len

ShortField

16

pad

XIntField

0

rate

ShortField

0

pad2

XBitField (48 bits)

0

class scapy.contrib.openflow.OFPQTNone

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPQTNone fields

type

ShortEnumField

0

len

ShortField

8

pad

XIntField

0

class scapy.contrib.openflow.OFPTBarrierReply

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTBarrierReply fields

version

ByteEnumField

1

type

ByteEnumField

19

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTBarrierRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTBarrierRequest fields

version

ByteEnumField

1

type

ByteEnumField

18

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTEchoReply

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTEchoReply fields

version

ByteEnumField

1

type

ByteEnumField

3

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTEchoRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTEchoRequest fields

version

ByteEnumField

1

type

ByteEnumField

2

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTFeaturesReply

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTFeaturesReply fields

version

ByteEnumField

1

type

ByteEnumField

6

len

ShortField

None

xid

IntField

0

datapath_id

LongField

0

n_buffers

IntField

0

n_tables

ByteField

1

pad

X3BytesField

0

capabilities

FlagsField (32 bits)

<Flag 0 ()>

actions

FlagsField (32 bits)

<Flag 0 ()>

ports

PacketListField

[]

class scapy.contrib.openflow.OFPTFeaturesRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTFeaturesRequest fields

version

ByteEnumField

1

type

ByteEnumField

5

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTFlowMod

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTFlowMod fields

version

ByteEnumField

1

type

ByteEnumField

14

len

ShortField

None

xid

IntField

0

match

PacketField

<OFPMatch  |>

cookie

LongField

0

cmd

ShortEnumField

0

idle_timeout

ShortField

0

hard_timeout

ShortField

0

priority

ShortField

0

buffer_id

IntEnumField

4294967295

out_port

ShortEnumField

65535

flags

FlagsField (16 bits)

<Flag 0 ()>

actions

PacketListField

[]

class scapy.contrib.openflow.OFPTFlowRemoved

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTFlowRemoved fields

version

ByteEnumField

1

type

ByteEnumField

11

len

ShortField

None

xid

IntField

0

match

PacketField

<OFPMatch  |>

cookie

LongField

0

priority

ShortField

0

reason

ByteEnumField

0

pad1

XByteField

0

duration_sec

IntField

0

duration_nsec

IntField

0

idle_timeout

ShortField

0

pad2

XShortField

0

packet_count

LongField

0

byte_count

LongField

0

class scapy.contrib.openflow.OFPTGetConfigReply

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTGetConfigReply fields

version

ByteEnumField

1

type

ByteEnumField

8

len

ShortField

None

xid

IntField

0

flags

ShortEnumField

0

miss_send_len

ShortField

0

class scapy.contrib.openflow.OFPTGetConfigRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTGetConfigRequest fields

version

ByteEnumField

1

type

ByteEnumField

7

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTHello

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTHello fields

version

ByteEnumField

1

type

ByteEnumField

0

len

ShortField

None

xid

IntField

0

class scapy.contrib.openflow.OFPTPacketIn

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTPacketIn fields

version

ByteEnumField

1

type

ByteEnumField

10

len

ShortField

None

xid

IntField

0

buffer_id

IntEnumField

4294967295

total_len

ShortField

0

in_port

ShortEnumField

0

reason

ByteEnumField

0

pad

XByteField

0

data

PacketField

None

class scapy.contrib.openflow.OFPTPacketOut

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTPacketOut fields

version

ByteEnumField

1

type

ByteEnumField

13

len

ShortField

None

xid

IntField

0

buffer_id

IntEnumField

4294967295

in_port

ShortEnumField

65535

actions_len

FieldLenField

None

actions

PacketListField

[]

data

PacketField

None

class scapy.contrib.openflow.OFPTPortMod

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTPortMod fields

version

ByteEnumField

1

type

ByteEnumField

15

len

ShortField

None

xid

IntField

0

port_no

ShortEnumField

0

hw_addr

MACField

'0'

config

FlagsField (32 bits)

<Flag 0 ()>

mask

FlagsField (32 bits)

<Flag 0 ()>

advertise

FlagsField (32 bits)

<Flag 0 ()>

pad

IntField

0

class scapy.contrib.openflow.OFPTPortStatus

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTPortStatus fields

version

ByteEnumField

1

type

ByteEnumField

12

len

ShortField

None

xid

IntField

0

reason

ByteEnumField

0

pad

XBitField (56 bits)

0

desc

PacketField

<OFPPhyPort  |>

class scapy.contrib.openflow.OFPTQueueGetConfigReply

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTQueueGetConfigReply fields

version

ByteEnumField

1

type

ByteEnumField

21

len

ShortField

None

xid

IntField

0

port

ShortEnumField

0

pad

XBitField (48 bits)

0

queues

PacketListField

[]

class scapy.contrib.openflow.OFPTQueueGetConfigRequest

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTQueueGetConfigRequest fields

version

ByteEnumField

1

type

ByteEnumField

20

len

ShortField

None

xid

IntField

0

port

ShortEnumField

0

pad

XShortField

0

class scapy.contrib.openflow.OFPTSetConfig

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTSetConfig fields

version

ByteEnumField

1

type

ByteEnumField

9

len

ShortField

None

xid

IntField

0

flags

ShortEnumField

0

miss_send_len

ShortField

128

class scapy.contrib.openflow.OFPTStatsReplyAggregate

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyAggregate fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

2

flags

FlagsField (16 bits)

<Flag 0 ()>

packet_count

LongField

0

byte_count

LongField

0

flow_count

IntField

0

pad

XIntField

0

class scapy.contrib.openflow.OFPTStatsReplyDesc

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyDesc fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

0

flags

FlagsField (16 bits)

<Flag 0 ()>

mfr_desc

StrFixedLenField

b''

hw_desc

StrFixedLenField

b''

sw_desc

StrFixedLenField

b''

serial_num

StrFixedLenField

b''

dp_desc

StrFixedLenField

b''

class scapy.contrib.openflow.OFPTStatsReplyFlow

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyFlow fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

1

flags

FlagsField (16 bits)

<Flag 0 ()>

flow_stats

PacketListField

[]

class scapy.contrib.openflow.OFPTStatsReplyPort

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyPort fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

4

flags

FlagsField (16 bits)

<Flag 0 ()>

port_stats

PacketListField

[]

class scapy.contrib.openflow.OFPTStatsReplyQueue

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyQueue fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

5

flags

FlagsField (16 bits)

<Flag 0 ()>

port_no

ShortEnumField

65535

pad

XShortField

0

queue_id

IntEnumField

4294967295

tx_bytes

LongField

0

tx_packets

LongField

0

tx_errors

LongField

0

class scapy.contrib.openflow.OFPTStatsReplyTable

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyTable fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

3

flags

FlagsField (16 bits)

<Flag 0 ()>

table_stats

PacketListField

[]

class scapy.contrib.openflow.OFPTStatsReplyVendor

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsReplyVendor fields

version

ByteEnumField

1

type

ByteEnumField

17

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

6

flags

FlagsField (16 bits)

<Flag 0 ()>

vendor

IntField

0

class scapy.contrib.openflow.OFPTStatsRequestAggregate

Bases: scapy.contrib.openflow.OFPTStatsRequestFlow

aliastypes
fields_desc
OFPTStatsRequestAggregate fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

2

flags

FlagsField (16 bits)

<Flag 0 ()>

match

PacketField

<OFPMatch  |>

table_id

ByteEnumField

255

pad

ByteField

0

out_port

ShortEnumField

65535

class scapy.contrib.openflow.OFPTStatsRequestDesc

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestDesc fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

0

flags

FlagsField (16 bits)

<Flag 0 ()>

class scapy.contrib.openflow.OFPTStatsRequestFlow

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestFlow fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

1

flags

FlagsField (16 bits)

<Flag 0 ()>

match

PacketField

<OFPMatch  |>

table_id

ByteEnumField

255

pad

ByteField

0

out_port

ShortEnumField

65535

class scapy.contrib.openflow.OFPTStatsRequestPort

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestPort fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

4

flags

FlagsField (16 bits)

<Flag 0 ()>

port_no

ShortEnumField

65535

pad

XBitField (48 bits)

0

class scapy.contrib.openflow.OFPTStatsRequestQueue

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestQueue fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

5

flags

FlagsField (16 bits)

<Flag 0 ()>

port_no

ShortEnumField

65535

pad

XShortField

0

queue_id

IntEnumField

4294967295

class scapy.contrib.openflow.OFPTStatsRequestTable

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestTable fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

3

flags

FlagsField (16 bits)

<Flag 0 ()>

class scapy.contrib.openflow.OFPTStatsRequestVendor

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTStatsRequestVendor fields

version

ByteEnumField

1

type

ByteEnumField

16

len

ShortField

None

xid

IntField

0

stats_type

ShortEnumField

6

flags

FlagsField (16 bits)

<Flag 0 ()>

vendor

IntField

0

class scapy.contrib.openflow.OFPTVendor

Bases: scapy.contrib.openflow._ofp_header

aliastypes
fields_desc
OFPTVendor fields

version

ByteEnumField

1

type

ByteEnumField

4

len

ShortField

None

xid

IntField

0

vendor

IntField

0

class scapy.contrib.openflow.OFPTableStats

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
OFPTableStats fields

table_id

ByteField

0

pad

X3BytesField

0

name

StrFixedLenField

'OFP_TABLE_STATS'

wildcards1

FlagsField (12 bits)

<Flag 3 (DL_VLAN_PCP+NW_TOS)>

nw_dst_mask

BitField (6 bits)

63

nw_src_mask

BitField (6 bits)

63

wildcards2

FlagsField (8 bits)

<Flag 255 (IN_PORT+DL_VLAN+DL_SRC+DL_DST+DL_TYPE+NW_PROTO+TP_SRC+TP_DST)>

max_entries

IntField

0

active_count

IntField

0

lookup_count

LongField

0

matched_count

LongField

0

class scapy.contrib.openflow.OFPacketField(name, default, cls, remain=0)

Bases: scapy.fields.PacketField

getfield(pkt, s)
class scapy.contrib.openflow.OpenFlow

Bases: scapy.contrib.openflow._ofp_header

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)