Skip to content

Commit edd2fbb

Browse files
committed
CLOUDSTACK-760:Allow ACL on all layer 4 protocols
1 parent dfad178 commit edd2fbb

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

‎ui/scripts/vpc.js‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@
4848
return name != 'icmptype' && name != 'icmpcode' && name != 'cidrlist';
4949
});
5050

51+
var $protocolinput = args.$form.find('th,td');
52+
var $protocolFields = $protocolinput.filter(function(){
53+
var name = $(this).attr('rel');
54+
55+
return $.inArray(name,['protocolnumber']) > -1;
56+
});
57+
58+
if($(this).val() == 'protocolnumber' ){
59+
60+
$protocolFields.show();
61+
}
62+
else{
63+
$protocolFields.hide();
64+
}
65+
66+
5167
if ($(this).val() == 'icmp') {
5268
$icmpFields.show();
5369
$icmpFields.attr('disabled', false);
@@ -68,11 +84,16 @@
6884
data: [
6985
{ name: 'tcp', description: 'TCP' },
7086
{ name: 'udp', description: 'UDP' },
71-
{ name: 'icmp', description: 'ICMP' }
87+
{ name: 'icmp', description: 'ICMP' },
88+
{ name: 'all', description: 'ALL'},
89+
{ name: 'protocolnumber', description: 'Protocol Number'}
90+
7291
]
7392
});
7493
}
7594
},
95+
96+
'protocolnumber': {label:'Protocol Number',isDisabled:true,isHidden:true,edit:true},
7697
'startport': { edit: true, label: 'label.start.port' },
7798
'endport': { edit: true, label: 'label.end.port' },
7899
'networkid': {
@@ -136,7 +157,15 @@
136157
label: 'label.add',
137158
action: function(args) {
138159
var $multi = args.$multi;
139-
160+
//Support for Protocol Number between 0 to 255
161+
if(args.data.protocol == 'protocolnumber'){
162+
$.extend(args.data,{protocol:args.data.protocolnumber});
163+
delete args.data.protocolnumber;
164+
}
165+
else
166+
delete args.data.protocolnumber;
167+
168+
140169
$.ajax({
141170
url: createURL('createNetworkACL'),
142171
data: $.extend(args.data, {

0 commit comments

Comments
 (0)