Skip to content

Commit

Permalink
better merge of max's work, reenable security group config
Browse files Browse the repository at this point in the history
  • Loading branch information
javierguerragiraldez committed Oct 22, 2014
1 parent 563ddd0 commit 2ecb4ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
30 changes: 10 additions & 20 deletions src/designs/neutron/neutron2snabb
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,24 @@ function create_config (input_dir, output_dir, hostname)
if port.admin_state_up ~= '0' then
local vlan = segments[port.network_id].segmentation_id
local mac = port.mac_address
-- Skipping filter for now.
print("Warning: Ignoring security group configuration.")
local ingressfilter = nil --filter(port, secbindings, secrules)
local ingressfilter = filter(port, secbindings, secrules, 'ingress')
local egressfilter = filter(port, secbindings, secrules, 'egress')
local gbps = vif_details.zone_gbps
local tunnel = tunnel(port, vif_details)
outputs[port_id]:write((' { vlan = %d,\n mac_address = %q,\n port_id = %q,\n ingress_filter = %s,\n gbps = %s,\n tunnel = %s\n },\n')
:format(vlan, mac, port.id, ingressfilter, gbps, tunnel))
end
port_count = port_count + 1
end
end
if port.admin_state_up ~= '0' then
local vlan = segment.segmentation_id
local mac = port.mac_address
local ingressfilter = filter(port, secbindings, secrules, 'ingress')
local egressfilter = filter(port, secbindings, secrules, 'egress')
local gbps, tunnel = qos(port, qoses, qos_policies, portqosmappings)
outputs[physical]:write((
outputs[port_id]:write((
[[ { vlan = %d,
mac_address = "%s",
port_id = "%s",
mac_address = %q,
port_id = %q,
ingress_filter = %s,
egress_filter = %s,
gbps = %s,
tunnel = %s
},]]):format(vlan, mac, port.id, ingressfilter, egressfilter, gbps, tunnel))
},
]]):format(vlan, mac, port.id, ingressfilter, egressfilter, gbps, tunnel))
end
port_count = port_count + 1
end
end
port_count = port_count + 1
end
for _, file in pairs(outputs) do
file:write("}\n")
Expand Down
3 changes: 2 additions & 1 deletion src/test_fixtures/nfvconfig/reference/port0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ return {
{ vlan = 43,
mac_address = "fa:16:3e:1e:b0:20",
port_id = "523276c7-73e3-4154-8b67-9c7199bdbb8c",
ingress_filter = nil,
ingress_filter = [[{ { ethertype='ipv4', },{ ethertype='ipv6', }, }]],
egress_filter = [[{ { ethertype='ipv6', },{ ethertype='ipv4', }, }]],
gbps = 8,
tunnel = {type = "L2TPv3",
remote_ip = "1:2:3:4:5:6:7:8",
Expand Down
3 changes: 2 additions & 1 deletion src/test_fixtures/nfvconfig/reference/port2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ return {
{ vlan = 42,
mac_address = "fa:16:3e:5d:ed:a3",
port_id = "9745ff46-986f-4f74-bc37-a35f481c0b9b",
ingress_filter = nil,
ingress_filter = [[{ { ethertype='ipv4', },{ ethertype='ipv6', }, }]],
egress_filter = [[{ { ethertype='ipv6', },{ ethertype='ipv4', }, }]],
gbps = 8,
tunnel = nil
},
Expand Down

0 comments on commit 2ecb4ae

Please sign in to comment.