+++ /dev/null
-# The software in this package is distributed under the GNU General
-# Public License version 2 (with a special exception described below).
-#
-# A copy of GNU General Public License (GPL) is included in this distribution,
-# in the file COPYING.GPL.
-#
-# As a special exception, if other files instantiate templates or use macros
-# or inline functions from this file, or you compile this file and link it
-# with other works to produce a work based on this file, this file
-# does not by itself cause the resulting work to be covered
-# by the GNU General Public License.
-#
-# However the source code for this file must still be made available
-# in accordance with section (3) of the GNU General Public License.
-#
-# This exception does not invalidate any other reasons why a work based
-# on this file might be covered by the GNU General Public License.
-#
-# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-
-"""
-Create provider profiles.
-
-.. note:: DEPRECATED! Please do not extend this or add new uses of this module,
- use :py:mod:`pyi2ncommon.arnied_api` or :py:mod:`pyi2ncommon.cnfvar`
- instead!
-"""
-
-from . import build_cnfvar
-
-# Defaults are extracted from data/shared_arnied/provider.cnf.
-default_provider_name = "sample_provider"
-default_provider_instance = 1
-default_cnfvars = {
- "PROVIDER_PROXY_SERVER": "",
- "PROVIDER_PROXY_PORT": "",
- "PROVIDER_PROXY_PASSWORD": "",
- "PROVIDER_PROXY_LOGIN": "",
- "PROVIDER_NIC_REF": "1",
- "PROVIDER_NETMASK": "255.255.0.0",
- "PROVIDER_MTU_SIZE": "1500",
- "PROVIDER_MODE": "ROUTER",
- "PROVIDER_MAILTRANSFER_MODE": "IMMEDIATE",
- "PROVIDER_LOCALIP": "",
- "PROVIDER_IP": "",
- "PROVIDER_FIREWALL_RULESET_REF": "7",
- "PROVIDER_FALLBACK_TIMEOUT": "60",
- "PROVIDER_FALLBACK_PROVIDER_REF": "-1",
- "PROVIDER_EMAIL_RELAY_REF": "-1",
- "PROVIDER_DYNDNS_WEBCHECKIP": "0",
- "PROVIDER_DYNDNS_ENABLE": "1",
- "PROVIDER_DNS_MODE": "IP",
- "PROVIDER_DNS": "",
- "PROVIDER_BWIDTH_MANAGEMENT_UPSTREAM_SPEED": "",
- "PROVIDER_BWIDTH_MANAGEMENT_ENABLE": "0",
- "PROVIDER_BWIDTH_MANAGEMENT_DOWNSTREAM_SPEED": "",
- "PROVIDER_PINGCHECK_SERVERLIST_REF": "-2",
-}
-
-
-class BuildProvider(build_cnfvar.BuildCnfVar):
-
- def __init__(self,
- data=default_provider_name,
- instance=default_provider_instance,
- line_no=1,
- mode="ROUTER",
- dns=None,
- ip=None,
- localip=None):
- build_cnfvar.BuildCnfVar.__init__(self,
- "PROVIDER",
- instance,
- data,
- line_no)
- self.add_defaults(default_cnfvars)
- self.update_cnf("PROVIDER_MODE", 0, mode)
-
- if dns is not None:
- self.update_cnf("PROVIDER_DNS", 0, dns)
- if ip is not None:
- self.update_cnf("PROVIDER_IP", 0, ip)
- if localip is not None:
- self.update_cnf("PROVIDER_LOCALIP", 0, localip)