scapy.contrib.coap

RFC 7252 - Constrained Application Protocol (CoAP) layer for Scapy

class scapy.contrib.coap.CoAP(_pkt, /, *, ver=1, type=0, tkl=None, code=0, msg_id=0, token=b'', options=[], paymark=b'')[源代码]

基类:Packet

aliastypes
content_format
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|VER|TYP|  TKL  |      CODE     |             MSG ID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             TOKEN             |            OPTIONS            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            PAYMARK            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. CoAP                             
CoAP fields

ver

BitField (2 bits)

1

type

BitEnumField

0

tkl

BitFieldLenField (4 bits)

None

code

ByteEnumField

0

msg_id

ShortField

0

token

StrLenField

b''

options

_CoAPOptsField

[]

paymark

_CoAPPaymark

b''

getfieldval(attr)[源代码]
post_dissect(pay)[源代码]