Split EF.UST handling from EF.IST and EF.SST

The existing code had the following serious problems:
* when trying to update EF.SST or EF.IST, it would write to EF.UST !
* shell commands were called ust_* even for the EST/IST files

Let's introduce the proper separation between what is shared and what
is file-specific.

Change-Id: Ie55669ca37a4762fac9f71b1db528ca67056e8dd
diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index 7d32409..f04f480 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -104,6 +104,31 @@
         super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
         self._tlv = EF_IMPU.impu
 
+# TS 31.103 Section 4.2.7
+class EF_IST(EF_UServiceTable):
+    def __init__(self, **kwargs):
+        super().__init__('6f07', 0x07, 'EF.IST', 'ISIM Service Table', {1, None}, EF_IST_map)
+        # add those commands to the general commands of a TransparentEF
+        self.shell_commands += [self.AddlShellCommands()]
+
+    @with_default_category('File-Specific Commands')
+    class AddlShellCommands(CommandSet):
+        def __init__(self):
+            super().__init__()
+
+        def do_ist_service_activate(self, arg):
+            """Activate a service within EF.IST"""
+            self._cmd.card.update_ist(int(arg), 1)
+
+        def do_ist_service_deactivate(self, arg):
+            """Deactivate a service within EF.IST"""
+            self._cmd.card.update_ist(int(arg), 0)
+
+        def do_ist_service_check(self, arg):
+            """Check consistency between services of this file and files present/activated"""
+            selected_file = self._cmd.rs.selected_file
+            selected_file.ust_service_check(self._cmd)
+
 # TS 31.103 Section 4.2.8
 class EF_PCSCF(LinFixedEF):
     def __init__(self, fid='6f09', sfid=None, name='EF.P-CSCF', desc='P-CSCF Address', **kwargs):
@@ -179,8 +204,7 @@
             EF_IMPU(),
             EF_AD(),
             EF_ARR('6f06', 0x06),
-            EF_UServiceTable('6f07', 0x07, 'EF.IST',
-                             'ISIM Service Table', {1, None}, EF_IST_map),
+            EF_IST(),
             EF_PCSCF(service=5),
             EF_GBABP(service=2),
             EF_GBANL(service=2),