@staticmethod
def _slices(layer, offset):
    """Get the slice of the fields in the packet."""
    slices = []
    for fname in layer.field_names:
        field = layer.get_field(fname)
        if field.size is not None and int(field.size) > 0 and field.name != '':
            slices.append([field.name, slice(int(field.pos) - offset, int(
                field.pos) + int(field.size) - offset)])
    return slices
