(1)ipsec协议修改

(2)ipv6掩码范围修改
(3)全部协议放开端口限制
This commit is contained in:
wangxin
2018-10-15 15:26:43 +08:00
parent fd2a4cf28e
commit b6276cdc8c
14 changed files with 107 additions and 50 deletions

View File

@@ -136,7 +136,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
ipCfgDao.saveCfgIndex(entity);
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg);
}
}
@@ -172,7 +176,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
if(Constants.IPSEC_PROTOCOL.intValue()==cfg.getProtocol().intValue()) {
BeanUtils.copyProperties(entity, cfg,new String[]{"userRegion1","cfgRegionCode","cfgType"});
}else {
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
}
ipCfgDao.saveIpPortCfg(cfg);
}
}
@@ -551,24 +559,23 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
}
}
IpPortCfg cfg = new IpPortCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(IpPortCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
for(IpPortCfg cfg:entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
cfg.setTableName(IpPortCfg.getTablename());
ipCfgDao.auditCfg(cfg);
}
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
for(IpPortCfg cfg:entity.getIpPortList()) {
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
cfg.setProtocol(Integer.parseInt(cfg.getUserRegion1()));
}
}
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
groupRelationList=map.get("groupList");
ipRegionList=map.get("dstList");
if(map.get("numRegionList")!=null){
numRegionList.addAll(map.get("numRegionList"));
}
if(Constants.SERVICE_IP_MULITIPLEX==cfg.getServiceId().intValue()){
String region=Constants.USERREGION_IR_STRATEGY+"="+cfg.getDnsStrategyId()+Constants.USER_REGION_SPLIT
+Constants.USERREGION_IR_TYPE+"="+cfg.getIrType();
maatCfg.setUserRegion(region);
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
@@ -576,7 +583,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
@@ -589,7 +596,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1){
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
@@ -600,8 +607,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip);
}
//调用服务接口下发配置数据
@@ -660,8 +674,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) {
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
Integer ipsecProtocol=null;
if(Constants.IPSEC_PROTOCOL==cfg.getProtocol().intValue()) {
ipsecProtocol=Integer.parseInt(cfg.getUserRegion1());
}
BeanUtils.copyProperties(entity, cfg, new String[]{"userRegion1","cfgId"});
InlineIp ip=convertCallBackIp(cfg,null);
if(ipsecProtocol!=null) {
ip.setProtocol(ipsecProtocol);
}
ipList.add(ip);
}
//调用服务接口下发配置数据