def METHOD_NAME(self, type_=None):
    """Reverse looks up a packet type id and returns a name string.
    If the type is not known, the supplied integer is returned as a string
    instead.
    """
    if type_ is None:
        type_ = self.type
    attrs = vars(self.__class__)
    type_map = dict((v, k) for k, v in attrs.items() if k.startswith('ICMP_'))
    return type_map.get(type_, str(type_))