Changeset 2188

Show
Ignore:
Timestamp:
05/27/08 12:22:47 (6 months ago)
Author:
dsugar
Message:

some cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/framework-plugin/src/com/tresys/framework/compiler/FSysGenerator.java

    r2172 r2188  
    6969        public void Visit (NetworkResource i_resource) 
    7070        { 
    71                 Rdef rdef = i_resource.getRdef (); 
     71                Rdef rdef = i_resource.GetRdef (); 
    7272 
    7373                m_dataBuff.append (i_resource.getName ()); 
  • trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/NetworkAdder.java

    r2180 r2188  
    4242                // we only care about ipsec network connections 
    4343                Rdef rdef = m_sysPolicy.getDictionary ().GetRdef (rdefName); 
     44                if (rdef == null) 
     45                        return; 
     46                 
    4447                if (rdef.GetSysResourceState (SystemResourceTypes.ipsec) == SysResourceState.No) 
    4548                        return; 
  • trunk/framework-plugin/src/com/tresys/framework/compiler/linkage/net/NetworkConfig.java

    r2180 r2188  
    192192                NetworkResource netResource = (NetworkResource) i_access.getResource (); 
    193193 
    194                 Rdef rdef = netResource.getRdef (); 
     194                Rdef rdef = netResource.GetRdef (); 
    195195                SystemResource sysRes = netResource.getSystemResource (rdef); 
    196196                if (!(sysRes instanceof LabeledNetworkResource)) 
     
    278278                NetworkResource netResource = (NetworkResource) i_access.getResource (); 
    279279 
    280                 Rdef rdef = netResource.getRdef (); 
     280                Rdef rdef = netResource.GetRdef (); 
    281281                SystemResource sysRes = netResource.getSystemResource (rdef); 
    282282                if (!(sysRes instanceof LabeledNetworkResource)) 
  • trunk/framework-plugin/src/com/tresys/framework/compiler/policy/NetworkResource.java

    r2173 r2188  
    5252         * @see #GetRdefs() 
    5353         */ 
    54         public Rdef getRdef () 
     54        public Rdef GetRdef () 
    5555        { 
    5656                if (GetRdefs () != null && !GetRdefs ().isEmpty () 
     
    6262        public boolean Add (Rdef rdef, AbstractToken i_token) 
    6363        { 
    64                 if (getRdef () != null) 
     64                if (GetRdef () != null) 
    6565                { 
    6666                        if (!GetRdefs ().isEmpty ()) 
  • trunk/framework-plugin/src/com/tresys/framework/compiler/policy/PolicyParser.jj

    r2143 r2188  
    822822                        return; 
    823823                } 
    824  
    825         if (resource instanceof NetworkResource) 
    826         { 
    827                 if (rdef.GetSysResourceState (SystemResourceTypes.dir) != SysResourceState.No) 
    828                 { 
    829                         errorGenerate (tokObjName, "Network Resoruces are not allowed directory based rdefs use 'resource' instead"); 
    830                         return; 
    831                 } 
    832                 if (rdef.GetSysResourceState (SystemResourceTypes.file) != SysResourceState.No) 
    833                 { 
    834                         errorGenerate (tokObjName, "Network Resoruces are not allowed file based rdefs use 'resource' instead"); 
    835                         return; 
    836                 } 
    837         } 
    838         else 
    839         { 
    840                 if (rdef.GetSysResourceState (SystemResourceTypes.secmark) != SysResourceState.No) 
    841                 { 
    842                         errorGenerate (tokObjName, "Resoruces are not allowed network based rdefs use 'networkresource' instead"); 
    843                         return; 
    844                 } 
    845                 if (rdef.GetSysResourceState (SystemResourceTypes.ipsec) != SysResourceState.No) 
    846                 { 
    847                         errorGenerate (tokObjName, "Resoruces are not allowed network based rdefs use 'networkresource' instead"); 
    848                         return; 
    849                 } 
    850         } 
    851  
    852824                 
    853825                if (rdef != null)  
    854826                { 
     827                if (resource instanceof NetworkResource) 
     828                { 
     829                        if (rdef.GetSysResourceState (SystemResourceTypes.dir) != SysResourceState.No) 
     830                        { 
     831                                errorGenerate (tokObjName, "Network Resoruces are not allowed directory based rdefs use 'resource' instead"); 
     832                                return; 
     833                        } 
     834                        if (rdef.GetSysResourceState (SystemResourceTypes.file) != SysResourceState.No) 
     835                        { 
     836                                errorGenerate (tokObjName, "Network Resoruces are not allowed file based rdefs use 'resource' instead"); 
     837                                return; 
     838                        } 
     839                } 
     840                else 
     841                { 
     842                        if (rdef.GetSysResourceState (SystemResourceTypes.secmark) != SysResourceState.No) 
     843                        { 
     844                                errorGenerate (tokObjName, "Resoruces are not allowed network based rdefs use 'networkresource' instead"); 
     845                                return; 
     846                        } 
     847                        if (rdef.GetSysResourceState (SystemResourceTypes.ipsec) != SysResourceState.No) 
     848                        { 
     849                                errorGenerate (tokObjName, "Resoruces are not allowed network based rdefs use 'networkresource' instead"); 
     850                                return; 
     851                        } 
     852                } 
     853 
    855854                        // check constraint (parent associated w/ same rdef) then add 
    856855                        if (resource.Add(rdef, addHandlerToToken(tokObjName)))  
  • trunk/framework-plugin/src/com/tresys/framework/compiler/systemResources/SystemResourcesParser.jj

    r2172 r2188  
    384384                                        aports[i] = Integer.parseInt (itr.next ().toString ());                          
    385385                                } 
    386                         }                        
     386                        } 
     387                         
     388                        if (dobj == null) 
     389                                return; 
     390                         
    387391                        localInfo = new NetworkInfo (null, ipAddr, null, aports);  
    388392                        NetworkResource network = new LabeledNetworkResource (localInfo, dobj); 
     
    503507                        } 
    504508                <NR_RBRACE> 
    505                 {                 
     509                { 
     510                        if (dobj == null) 
     511                                return; 
     512                         
    506513                        NetworkResource network = new IPTablesNetworkResource (localInfo, remoteInfo, protocol.image, dobj); 
    507514                        if (!policy.Add (comp, dobj, network))  
  • trunk/framework-plugin/src/com/tresys/framework/compiler/translator/SELinuxPolicy.java

    r2187 r2188  
    801801                NetworkResource i_resource = (NetworkResource) i_access.getResource (); 
    802802                 
    803                 Rdef rdef = i_resource.getRdef (); 
     803                Rdef rdef = i_resource.GetRdef (); 
    804804                 
    805805                // ipsec resource don't get a type - uses remote type from connection(s) 
  • trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/commands/ShapeDeleteCommand.java

    r2181 r2188  
    136136                { 
    137137                        NetworkResource res = (NetworkResource)((NetworkResourceShape)m_child).getComponent (); 
    138                         SystemResource sysres = res.getSystemResource (res.getRdef ()); 
     138                        SystemResource sysres = res.getSystemResource (res.GetRdef ()); 
    139139                        if( sysres instanceof LabeledNetworkResource ) 
    140140                        { 
  • trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/NetworkResourceShape.java

    r2180 r2188  
    122122                super (i_system, i_Resource); 
    123123 
    124                 m_rdef = i_Resource.getRdef (); 
     124                m_rdef = i_Resource.GetRdef (); 
    125125        } 
    126126 
     
    251251                if (m_rdef == null) 
    252252                { 
    253                         m_rdef = ((NetworkResource) getComponent ()).getRdef (); 
     253                        m_rdef = ((NetworkResource) getComponent ()).GetRdef (); 
    254254                        if (m_rdef == null) 
    255255                                return new IPropertyDescriptor[] {};