1 # vim: set encoding=utf-8 et sw=4 sts=4 :
3 from formencode import validators as V
4 from pymin.config import Option
5 from handler import PppHandler
7 def setup_service(options, config):
8 options.add_group('ppp', 'PPP network interfaces', [
9 Option('pickle_dir', V.String, metavar='DIR',
10 help='store persistent data in DIR directory'),
11 Option('config_options_dir', V.String, metavar='DIR',
12 help='write options config files in DIR directory'),
13 Option('config_pap_dir', V.String, metavar='DIR',
14 help='write pap-secrets config file in DIR directory'),
15 Option('config_chap_dir', V.String, metavar='DIR',
16 help='write chap-secrets config file in DIR directory'),
17 Option('config_peers_dir', V.String, metavar='DIR',
18 help='write peer config files in DIR directory'),
21 def get_service(config):
22 return PppHandler(config.ppp.pickle_dir, {
23 'options.X': config.ppp.config_options_dir,
24 'pap-secrets': config.ppp.config_pap_dir,
25 'chap-secrets': config.ppp.config_chap_dir,
26 'nameX': config.ppp.config_peers_dir,