def _route_flags(rflags):
    '''
    https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h
    https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h
    '''
    flags = ''
    fmap = {
        0x0001: 'U',  # RTF_UP, route is up
        0x0002: 'G',  # RTF_GATEWAY, use gateway
        0x0004: 'H',  # RTF_HOST, target is a host
        0x0008: 'R',  # RET_REINSTATE, reinstate route for dynamic routing
        0x0010: 'D',  # RTF_DYNAMIC, dynamically installed by daemon or redirect
        0x0020: 'M',  # RTF_MODIFIED, modified from routing daemon or redirect
        0x00040000: 'A',  # RTF_ADDRCONF, installed by addrconf
        0x01000000: 'C',  # RTF_CACHE, cache entry
        0x0200: '!',  # RTF_REJECT, reject route
    }
    for item in fmap:
        if rflags & item:
            flags += fmap[item]
    return flags