1 # The software in this package is distributed under the GNU General
2 # Public License version 2 (with a special exception described below).
4 # A copy of GNU General Public License (GPL) is included in this distribution,
5 # in the file COPYING.GPL.
7 # As a special exception, if other files instantiate templates or use macros
8 # or inline functions from this file, or you compile this file and link it
9 # with other works to produce a work based on this file, this file
10 # does not by itself cause the resulting work to be covered
11 # by the GNU General Public License.
13 # However the source code for this file must still be made available
14 # in accordance with section (3) of the GNU General Public License.
16 # This exception does not invalidate any other reasons why a work based
17 # on this file might be covered by the GNU General Public License.
19 # Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
22 Create provider profiles.
24 .. note:: DEPRECATED! Please do not extend this or add new uses of this module,
25 use :py:mod:`pyi2ncommon.arnied_api` or :py:mod:`pyi2ncommon.cnfvar`
29 from . import build_cnfvar
31 # Defaults are extracted from data/shared_arnied/provider.cnf.
32 default_provider_name = "sample_provider"
33 default_provider_instance = 1
35 "PROVIDER_PROXY_SERVER": "",
36 "PROVIDER_PROXY_PORT": "",
37 "PROVIDER_PROXY_PASSWORD": "",
38 "PROVIDER_PROXY_LOGIN": "",
39 "PROVIDER_NIC_REF": "1",
40 "PROVIDER_NETMASK": "255.255.0.0",
41 "PROVIDER_MTU_SIZE": "1500",
42 "PROVIDER_MODE": "ROUTER",
43 "PROVIDER_MAILTRANSFER_MODE": "IMMEDIATE",
44 "PROVIDER_LOCALIP": "",
46 "PROVIDER_FIREWALL_RULESET_REF": "7",
47 "PROVIDER_FALLBACK_TIMEOUT": "60",
48 "PROVIDER_FALLBACK_PROVIDER_REF": "-1",
49 "PROVIDER_EMAIL_RELAY_REF": "-1",
50 "PROVIDER_DYNDNS_WEBCHECKIP": "0",
51 "PROVIDER_DYNDNS_ENABLE": "1",
52 "PROVIDER_DNS_MODE": "IP",
54 "PROVIDER_BWIDTH_MANAGEMENT_UPSTREAM_SPEED": "",
55 "PROVIDER_BWIDTH_MANAGEMENT_ENABLE": "0",
56 "PROVIDER_BWIDTH_MANAGEMENT_DOWNSTREAM_SPEED": "",
57 "PROVIDER_PINGCHECK_SERVERLIST_REF": "-2",
61 class BuildProvider(build_cnfvar.BuildCnfVar):
64 data=default_provider_name,
65 instance=default_provider_instance,
71 build_cnfvar.BuildCnfVar.__init__(self,
76 self.add_defaults(default_cnfvars)
77 self.update_cnf("PROVIDER_MODE", 0, mode)
80 self.update_cnf("PROVIDER_DNS", 0, dns)
82 self.update_cnf("PROVIDER_IP", 0, ip)
83 if localip is not None:
84 self.update_cnf("PROVIDER_LOCALIP", 0, localip)