package documentation
Library for common VPN functions.
From __init__.py
:
Function | generate |
Generate a random network. |
Function | generate |
Generate a random port. |
Function | get |
Return a list of local networks. |
Function | get |
Return a list of public addresses. |
Function | is |
Check if a network is already used by another OpenVPN. |
Function | is |
Check if a port is already used by another OpenVPN. |
Function | list |
Return a list of OpenVPN ciphers. |
Function | list |
List connected clients. |
Function | list |
Return a list of OpenVPN digests. |
Function | opt2cidr |
Convert an OpenVPN option to CIDR notation. |
Function | random |
Generate a random private network address. |
Function | to |
Convert a netmask to CIDR notation. |
Function | to |
Convert a CIDR notation to netmask. |
Generate a random port.
- Arguments:
- uci -- EUci instance
- limit_min -- minimum port number
- limit_max -- maximum port number
- Returns:
- a random port number
Return a list of public addresses.
- Arguments:
- u -- EUci instance
- Returns:
- a list of public addresses
Check if a network is already used by another OpenVPN.
- Arguments:
- u -- EUci instance
- network -- network to check
- Returns:
- True if the network is already used, False otherwise
Check if a port is already used by another OpenVPN.
- Arguments:
- uci -- EUci instance
- port -- port to check
- Returns:
- True if the port is already used, False otherwise
Return a list of OpenVPN ciphers.
- Returns:
- a list of OpenVPN ciphers, each element is a dicttionary with the following keys:
- name: cipher name
- description: cipher description (weak or strong)
List connected clients.
- Arguments:
- openvpninstance -- OpenVPN instance name
- type -- type of list (subnet or p2p)
- Returns:
- a list of connected clients
Return a list of OpenVPN digests.
- Returns:
- a list of OpenVPN digests, each element is a dicttionary with the following keys: - name: digest name - description: digest description (weak or strong)