<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getfield(self, pkt, buf):
 """retrieve the field with endianness"""

        self.set_endianess(pkt)
        return self.fld.getfield(pkt, buf)