diff --git a/capirca/lib/aclgenerator.py b/capirca/lib/aclgenerator.py index 8366fd7c..75474081 100644 --- a/capirca/lib/aclgenerator.py +++ b/capirca/lib/aclgenerator.py @@ -99,7 +99,8 @@ class Term: } AF_MAP = {'inet': 4, 'inet6': 6, - 'bridge': 4 # if this doesn't exist, output includes v4 & v6 + 'bridge': 4, # if this doesn't exist, output includes v4 & v6 + 'ethernet-switching': 4 } # These protos are always expressed as numbers instead of name # due to inconsistencies on the end platform's name-to-number diff --git a/capirca/lib/juniper.py b/capirca/lib/juniper.py index 8bc66670..d79569e4 100644 --- a/capirca/lib/juniper.py +++ b/capirca/lib/juniper.py @@ -169,7 +169,13 @@ class Term(aclgenerator.Term): 'daddr': 'ip-destination-address', 'protocol': 'ip-protocol', 'protocol-except': 'ip-protocol-except', - 'tcp-est': 'tcp-flags "(ack|rst)"'} + 'tcp-est': 'tcp-flags "(ack|rst)"'}, + 'ethernet-switching': {'addr': 'ip-address', + 'saddr': 'ip-source-address', + 'daddr': 'ip-destination-address', + 'protocol': 'ip-protocol', + 'protocol-except': 'ip-protocol-except', + 'tcp-est': 'tcp-established'} } def __init__(self, term, term_type, enable_dsmo, noverbose, filter_direction=None, interface_type=None): @@ -278,7 +284,8 @@ def __str__(self): from_str.append('tcp-initial;') elif opt.startswith('first-fragment'): from_str.append('first-fragment;') - + elif opt.startswith('no-syn-ack'): + from_str.append('tcp-flags "!(syn&ack)";') # we don't have a special way of dealing with this, so we output it and # hope the user knows what they're doing. else: @@ -895,7 +902,7 @@ class Juniper(aclgenerator.ACLGenerator): _PLATFORM = 'juniper' _DEFAULT_PROTOCOL = 'ip' - _SUPPORTED_AF = frozenset(('inet', 'inet6', 'bridge', 'mixed')) + _SUPPORTED_AF = frozenset(('inet', 'inet6', 'bridge', 'ethernet-switching', 'mixed')) _TERM = Term SUFFIX = '.jcl'