Skip to content

Commit

Permalink
Merge pull request #265 from satyauppalapati/master
Browse files Browse the repository at this point in the history
taboo addition, negative flows generation and support for l2tp traffic type
  • Loading branch information
michsmit99 committed Dec 13, 2016
2 parents fffa325 + 9b970d3 commit e868597
Show file tree
Hide file tree
Showing 3 changed files with 316 additions and 56 deletions.
17 changes: 11 additions & 6 deletions acitoolkit/acitoolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3934,26 +3934,31 @@ def _get_parent_class():

def get_json(self):
"""
Returns json representation of the ContractSubject
Returns json representation of the ContractSubject or TabooContractSubject
:returns: json dictionary of the ContractSubject
:returns: json dictionary of the ContractSubject or TabooContractSubject
"""
subject = 'vzSubj'
subjectFilter = 'vzRsSubjFiltAtt'
if isinstance(self._parent, Taboo):
subject = Taboo._get_subject_code()
subjectFilter = Taboo._get_subject_relation_code()
attr = self._generate_attributes()
resp_json = super(ContractSubject, self).get_json('vzSubj',
resp_json = super(ContractSubject, self).get_json(subject,
attributes=attr,
get_children=False)
filters = []
for entry in self.get_filters():
filt = {'vzRsSubjFiltAtt': {'attributes': {'tnVzFilterName': entry.name}}}
filt = {subjectFilter: {'attributes': {'tnVzFilterName': entry.name}}}
filters.append(filt)
resp_json['vzSubj']['children'] = filters
resp_json[subject]['children'] = filters

terminals = []
for entry in self.get_children():
if isinstance(entry, BaseTerminal):
terminal = entry.get_json()
terminals.append(terminal)
resp_json['vzSubj']['children'].extend(terminals)
resp_json[subject]['children'].extend(terminals)

return resp_json

Expand Down
43 changes: 43 additions & 0 deletions tests/aci_configuration_randomizer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[GlobalDefaults]
MaximumStringLength: 40
# MaximumStringLength: 64
TenantPrefix: acitoolkitrandomized-

[Tenants]
Minimum: 3
Expand All @@ -20,6 +21,13 @@ AllowArpFlood: True
AllowDisableUnicastRoute: True
AllowNonDefaultMultiDstPkt: True

[BridgeDomainSettings]
UnknownMacUnicast: ["proxy", "flood"]
UnknownMulticast: ["flood", "opt-flood"]
ArpFlood: ["yes", "no"]
UnicastRoute: ["yes", "no"]
Multidestination: ["drop", "bd-flood", "encap-flood"]

[Contexts]
Minimum: 0
Maximum: 5
Expand Down Expand Up @@ -52,6 +60,10 @@ GlobalMaximum: 1000
Minimum: 0
Maximum: 10

[TabooContractSubjects]
Minimum: 0
Maximum: 10

[Filters]
Minimum: 10
Maximum: 15
Expand All @@ -69,3 +81,34 @@ Interfaces: ["eth 1/101/1/17", "eth 1/102/1/17"]
[VLANs]
Minimum: 1
Maximum: 4095

# Ethertypes and protocols used
[Ethertypes]
Choice20PC: ["arp"]
Choice16PC: ["trill", "mpls_ucast", "mac_security", "fcoe"]
Choice74PC: ["ip"]

[IPProtocols]
Choice20PC: ["igmp", "egp", "igp", "eigrp", "ospfigp", "pim", "l2tp"]
Choice80PC: ["icmp", "tcp", "udp", "icmpv6"]

# Options to be used in filters for different traffic types
[FilterEntryOptions]
Fragmentation: ["0", "1"]
ARPCode: ["req", "reply"]
TCPRules: ["est", "syn", "ack", "fin", "rst"]
ICMP4Types: ["echo-rep", "dst-unreach", "src-quench", "echo", "time-exceeded", "unspecified", "not-given"]
ICMP6Types: ["unspecified", "dst-unreach", "time-exceeded", "echo-req", "echo-rep", "nbr-solicit", "nbr-advert", "redirect", "not-given"]
PortRangeMin: 0
PortRangeMax: 65535

[NegativeFlowOptions]
Ethertypes: ["ip", "arp"]
IPProtocols: ["icmp", "tcp", "udp", "l2tp"]
ARPCode: ["req", "reply"]
TCPRules: ["est", "syn", "ack", "fin", "rst"]
ICMP4Types: ["echo-rep", "dst-unreach", "src-quench", "echo", "time-exceeded", "unspecified"]
ICMP6Types: ["unspecified", "dst-unreach", "time-exceeded", "echo-req", "echo-rep", "nbr-solicit", "nbr-advert", "redirect"]
PortRangeMin: 1
PortRangeMax: 65535
MaxNegativeFlows: 5

0 comments on commit e868597

Please sign in to comment.