
    >OOft                         d Z d Zd Zy)zC Some helper functions for validation of ports and lists of ports. c                 D    t        | t              r| t        dd      vryyy)zh Check if a port is valid. Return an error message indicating what is invalid if something isn't valid.       )Source port must in range from 0 to 65535Source port must be an integerN)
isinstanceintrange)ports    \/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/ldap3/utils/port_validators.py
check_portr      s'    $uQ&>  0    c                     | |y| !t        | t              r| t        dd      vryyy|$	 t        |      }|D ]  }t        |      }|s|c S  y# t        $ r dj                  |      cY S w xY w)z Take in a port and a port list and check that at most one is non-null. Additionally check that if either
    is non-null, it is valid.
    Return an error message indicating what is invalid if something isn't valid.
    Nz8Cannot specify both a source port and a source port listr   r   r   r   z'Source port list must be an iterable {})r   r   r	   iter	TypeErrorformatr   )r
   	port_list_candidate_porterrs        r   check_port_and_port_listr      s    
 I1I		dC 5E?*B3  
		OYA ( 	N^,C
	   	O<CCINN	Os   A A-,A-N)__doc__r   r    r   r   <module>r      s    Ir   