def candidate_priority(candidate_component: int, candidate_type: str,
    local_pref: int=65535) ->int:
    """
    See RFC 5245 - 4.1.2.1. Recommended Formula
    """
    if candidate_type == 'host':
        type_pref = 126
    elif candidate_type == 'prflx':
        type_pref = 110
    elif candidate_type == 'srflx':
        type_pref = 100
    else:
        type_pref = 0
    return (1 << 24) * type_pref + (1 << 8) * local_pref + (256 -
        candidate_component)
