def read_udp(self, length):
if length is None:<EOL><INDENT>length = len(self)<EOL><DEDENT>_srcp = self._read_unpack(<NUM_LIT:2>)<EOL>_dstp = self._read_unpack(<NUM_LIT:2>)<EOL>_tlen = self._read_unpack(<NUM_LIT:2>)<EOL>_csum = self._read_fileng(<NUM_LIT:2>)<EOL>udp = dict(<EOL>srcport=_srcp,<EOL>dstport=_dstp,<EOL>len=_tlen,<EOL>checksum=_csum,<EOL>)<EOL>length = udp['<STR_LIT>'] - <NUM_LIT:8><EOL>udp['<STR_LIT>'] = self._read_packet(header=<NUM_LIT:8>, payload=length)<EOL>return self._decode_next_layer(udp, None, length)<EOL>
Read User Datagram Protocol (UDP).

        Structure of UDP header [RFC 768]:
             0      7 8     15 16    23 24    31
            +--------+--------+--------+--------+
            |     Source      |   Destination   |
            |      Port       |      Port       |
            +--------+--------+--------+--------+
            |                 |                 |
            |     Length      |    Checksum     |
            +--------+--------+--------+--------+
            |
            |          data octets ...
            +---------------- ...

            Octets      Bits        Name                    Description
              0           0     udp.srcport             Source Port
              2          16     udp.dstport             Destination Port
              4          32     udp.len                 Length (header includes)
              6          48     udp.checksum            Checksum