Changeset 2188
- Timestamp:
- 05/27/08 12:22:47
(6 months ago)
- Author:
- dsugar
- Message:
some cleanup
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2172 |
r2188 |
|
| 69 | 69 | public void Visit (NetworkResource i_resource) |
|---|
| 70 | 70 | { |
|---|
| 71 | | Rdef rdef = i_resource.getRdef (); |
|---|
| | 71 | Rdef rdef = i_resource.GetRdef (); |
|---|
| 72 | 72 | |
|---|
| 73 | 73 | m_dataBuff.append (i_resource.getName ()); |
|---|
| r2180 |
r2188 |
|
| 42 | 42 | // we only care about ipsec network connections |
|---|
| 43 | 43 | Rdef rdef = m_sysPolicy.getDictionary ().GetRdef (rdefName); |
|---|
| | 44 | if (rdef == null) |
|---|
| | 45 | return; |
|---|
| | 46 | |
|---|
| 44 | 47 | if (rdef.GetSysResourceState (SystemResourceTypes.ipsec) == SysResourceState.No) |
|---|
| 45 | 48 | return; |
|---|
| r2180 |
r2188 |
|
| 192 | 192 | NetworkResource netResource = (NetworkResource) i_access.getResource (); |
|---|
| 193 | 193 | |
|---|
| 194 | | Rdef rdef = netResource.getRdef (); |
|---|
| | 194 | Rdef rdef = netResource.GetRdef (); |
|---|
| 195 | 195 | SystemResource sysRes = netResource.getSystemResource (rdef); |
|---|
| 196 | 196 | if (!(sysRes instanceof LabeledNetworkResource)) |
|---|
| … | … | |
| 278 | 278 | NetworkResource netResource = (NetworkResource) i_access.getResource (); |
|---|
| 279 | 279 | |
|---|
| 280 | | Rdef rdef = netResource.getRdef (); |
|---|
| | 280 | Rdef rdef = netResource.GetRdef (); |
|---|
| 281 | 281 | SystemResource sysRes = netResource.getSystemResource (rdef); |
|---|
| 282 | 282 | if (!(sysRes instanceof LabeledNetworkResource)) |
|---|
| r2173 |
r2188 |
|
| 52 | 52 | * @see #GetRdefs() |
|---|
| 53 | 53 | */ |
|---|
| 54 | | public Rdef getRdef () |
|---|
| | 54 | public Rdef GetRdef () |
|---|
| 55 | 55 | { |
|---|
| 56 | 56 | if (GetRdefs () != null && !GetRdefs ().isEmpty () |
|---|
| … | … | |
| 62 | 62 | public boolean Add (Rdef rdef, AbstractToken i_token) |
|---|
| 63 | 63 | { |
|---|
| 64 | | if (getRdef () != null) |
|---|
| | 64 | if (GetRdef () != null) |
|---|
| 65 | 65 | { |
|---|
| 66 | 66 | if (!GetRdefs ().isEmpty ()) |
|---|
| r2143 |
r2188 |
|
| 822 | 822 | return; |
|---|
| 823 | 823 | } |
|---|
| 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 | | |
|---|
| 852 | 824 | |
|---|
| 853 | 825 | if (rdef != null) |
|---|
| 854 | 826 | { |
|---|
| | 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 | |
|---|
| 855 | 854 | // check constraint (parent associated w/ same rdef) then add |
|---|
| 856 | 855 | if (resource.Add(rdef, addHandlerToToken(tokObjName))) |
|---|
| r2172 |
r2188 |
|
| 384 | 384 | aports[i] = Integer.parseInt (itr.next ().toString ()); |
|---|
| 385 | 385 | } |
|---|
| 386 | | } |
|---|
| | 386 | } |
|---|
| | 387 | |
|---|
| | 388 | if (dobj == null) |
|---|
| | 389 | return; |
|---|
| | 390 | |
|---|
| 387 | 391 | localInfo = new NetworkInfo (null, ipAddr, null, aports); |
|---|
| 388 | 392 | NetworkResource network = new LabeledNetworkResource (localInfo, dobj); |
|---|
| … | … | |
| 503 | 507 | } |
|---|
| 504 | 508 | <NR_RBRACE> |
|---|
| 505 | | { |
|---|
| | 509 | { |
|---|
| | 510 | if (dobj == null) |
|---|
| | 511 | return; |
|---|
| | 512 | |
|---|
| 506 | 513 | NetworkResource network = new IPTablesNetworkResource (localInfo, remoteInfo, protocol.image, dobj); |
|---|
| 507 | 514 | if (!policy.Add (comp, dobj, network)) |
|---|
| r2187 |
r2188 |
|
| 801 | 801 | NetworkResource i_resource = (NetworkResource) i_access.getResource (); |
|---|
| 802 | 802 | |
|---|
| 803 | | Rdef rdef = i_resource.getRdef (); |
|---|
| | 803 | Rdef rdef = i_resource.GetRdef (); |
|---|
| 804 | 804 | |
|---|
| 805 | 805 | // ipsec resource don't get a type - uses remote type from connection(s) |
|---|
| r2181 |
r2188 |
|
| 136 | 136 | { |
|---|
| 137 | 137 | NetworkResource res = (NetworkResource)((NetworkResourceShape)m_child).getComponent (); |
|---|
| 138 | | SystemResource sysres = res.getSystemResource (res.getRdef ()); |
|---|
| | 138 | SystemResource sysres = res.getSystemResource (res.GetRdef ()); |
|---|
| 139 | 139 | if( sysres instanceof LabeledNetworkResource ) |
|---|
| 140 | 140 | { |
|---|
| r2180 |
r2188 |
|
| 122 | 122 | super (i_system, i_Resource); |
|---|
| 123 | 123 | |
|---|
| 124 | | m_rdef = i_Resource.getRdef (); |
|---|
| | 124 | m_rdef = i_Resource.GetRdef (); |
|---|
| 125 | 125 | } |
|---|
| 126 | 126 | |
|---|
| … | … | |
| 251 | 251 | if (m_rdef == null) |
|---|
| 252 | 252 | { |
|---|
| 253 | | m_rdef = ((NetworkResource) getComponent ()).getRdef (); |
|---|
| | 253 | m_rdef = ((NetworkResource) getComponent ()).GetRdef (); |
|---|
| 254 | 254 | if (m_rdef == null) |
|---|
| 255 | 255 | return new IPropertyDescriptor[] {}; |
|---|
Download in other formats:
* Generating other formats may take time.