def packsize(*properties):
    '''
    Revert to sizefromlen, store the struct size (len(struct)) to specified property path. The size includes
    padding. To store the size without padding, use packrealsize() instead. Often used in nstruct "prepack"
    parameter.
    
    :param properties: specified field name, same as sizefromlen.
    
    :returns: a function which takes a NamedStruct as parameter, and pack the size to specified field.
    
    '''
    def func(namedstruct):
        v = namedstruct._target
        for p in properties[:-1]:
            v = getattr(v, p)
        setattr(v, properties[-1], len(namedstruct))
    return func
Revert to sizefromlen, store the struct size (len(struct)) to specified property path. The size includes
    padding. To store the size without padding, use packrealsize() instead. Often used in nstruct "prepack"
    parameter.
    
    :param properties: specified field name, same as sizefromlen.
    
    :returns: a function which takes a NamedStruct as parameter, and pack the size to specified field.