Tool to (re)configure the sysmoUSIM and sysmoISIM cards
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9 KiB

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Commandline interface for sysmoUSIM-SJS1
  5. (C) 2017 by Sysmocom s.f.m.c. GmbH
  6. All Rights Reserved
  7. Author: Philipp Maier
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. """
  19. import sys, getopt
  20. from utils import *
  21. from simcard import *
  22. from sysmo_isim_sja2 import *
  23. from common import *
  24. class Application(Common):
  25. getopt_dump = False
  26. # Automatically executed by superclass
  27. def _banner(self):
  28. print("sysmoISIM-SJA2 parameterization tool")
  29. print("Copyright (c)2019 Sysmocom s.f.m.c. GmbH")
  30. print("")
  31. # Automatically executed by superclass
  32. def _options(self, opts):
  33. for opt, arg in opts:
  34. if opt in ("-d", "--dump"):
  35. self.getopt_dump = True
  36. # Automatically executed by superclass when -h or --help is supplied as option
  37. def _helptext(self):
  38. print(" -d, --dump ..................... Dump propritary file contents")
  39. print("")
  40. print(" For Option -T, the following algorithms are valid:")
  41. print('\n'.join([' %d %s' % entry for entry in sysmo_isimsja2_algorithms]))
  42. print("")
  43. # Automatically executed by superclass before _execute() is called
  44. def _init(self):
  45. self.sim = Sysmo_isim_sja2()
  46. # Automatically executed by superclass
  47. def _execute(self):
  48. if self.getopt_dump:
  49. self.sim.dump()
  50. def main(argv):
  51. Application(argv, "d", ["dump"])
  52. if __name__ == "__main__":
  53. main(sys.argv[1:])