<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, packet):
 """Add the given Packet to this PacketHistory."""

        for name in self._names:
            value = getattr(packet, name)
            if value is not None:
                self._dict[name] = value