diff --git a/interface-definitions/interfaces-wirelessmodem.xml.in b/interface-definitions/interfaces-wirelessmodem.xml.in new file mode 100644 index 00000000000..0c7aea7b40d --- /dev/null +++ b/interface-definitions/interfaces-wirelessmodem.xml.in @@ -0,0 +1,73 @@ + + + + + + + Wireless Modem (WWAN) Interface + 350 + + wlm[0-9]+$ + + Wireless Modem interface must be named wlmN + + wlmN + Wireless modem interface name + + + + + + Insert backup default route + + + + + Distance backup default route + + 1-255 + Distance of the backup route (default: 10) + + + + + Must be between (1-255) + + + + + #include + + + System device name (default: ttyUSB0) + + >ttyXXX%lt; + System TTY device name + + + + #include + #include + + + Carrier network to define dial strings + + + + + + + + Do not use peer supplied DNS server information + + + + + Only dial when traffic is available + + + + + + + diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py new file mode 100755 index 00000000000..1e937681364 --- /dev/null +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os + +from sys import exit +from copy import deepcopy + +from vyos.config import Config +from vyos import ConfigError + +default_config_data = { + 'address': [], + 'deleted': False, + 'description': '', + 'disable': False +} + +def get_config(): + wwan = deepcopy(default_config_data) + conf = Config() + + # determine tagNode instance + try: + wwan['intf'] = os.environ['VYOS_TAGNODE_VALUE'] + except KeyError as E: + print("Interface not specified") + + # Check if interface has been removed + if not conf.exists('interfaces wirelessmodem ' + wwan['intf']): + vxlan['deleted'] = True + return vxlan + + # set new configuration level + conf.set_level('interfaces wirelessmodem ' + wwan['intf']) + + tmp = conf.get_config_dict() + + import pprint + pprint.pprint(tmp) + + return wwan + +def verify(wwan): + if wwan is None: + return None + + return None + +def generate(wwan): + if wwan is None: + return None + + return None + +def apply(wwan): + if wwan is None: + return None + + return None + +if __name__ == '__main__': + try: + c = get_config() + verify(c) + generate(c) + apply(c) + except ConfigError as e: + print(e) + exit(1)