package documentation
Library for common VPN functions.
From __init__.py:
| Function | generate |
Regenerate the CRL of an Easy-RSA PKI. |
| 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 | revoke |
Revoke all valid certificates not saved inside the issued directory. |
| Function | to |
Convert a netmask to CIDR notation. |
| Function | to |
Convert a CIDR notation to netmask. |
Regenerate the CRL of an Easy-RSA PKI.
- Arguments:
- pki_dir -- Easy-RSA PKI directory, like /etc/openvpn/ns_roadwarrior1/pki
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, or [""] if no public address can be retrieved
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)
Revoke all valid certificates not saved inside the issued directory.
Call generate_crl() afterwards to update the CRL.
- Arguments:
- pki_dir -- Easy-RSA PKI directory, like /etc/openvpn/ns_roadwarrior1/pki
- Returns:
- the list of revoked serial numbers
- Raises:
- RuntimeError if an issued certificate can't be read