Exemple #1
0
def __ifaceAttributes___port_sec_parse(port, dct):
    parse_aging_time = Suppress('aging time ') + restOfLine
    parse_aging_type = Suppress('aging type ') + restOfLine
    parse_violat = Suppress('violation ') + restOfLine
    parse_max = Suppress('maximum ') + restOfLine
    parse_mac = Suppress('mac-address ') + Optional('sticky') + restOfLine
    try:
        return util.int_dict_parse(parse_aging_time, port, 'aging time', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_aging_type, port, 'aging type', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_violat, port, 'violation', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_mac, port, 'mac-address', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_max, port, 'maximum', dct)
    except ParseException:
        pass
Exemple #2
0
def __ifaceAttributes___ip_parse(value, dct):
    parse_mode = Word(alphas)
    parse_rate = Suppress('limit rate ') + restOfLine
    try:
        return util.int_dict_parse(parse_rate, value, 'limit', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_mode, value, 'mode', dct)
    except ParseException:
        pass
Exemple #3
0
def _globalParse___vtp_attributes(vtp, dct):
    parse_domain = Suppress('domain ') + restOfLine
    parse_mode = Suppress('mode ') + restOfLine
    try:
        return util.int_dict_parse(parse_domain, vtp, 'domain', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_mode, vtp, 'mode', dct)
    except ParseException:
        pass
    return 0
Exemple #4
0
def _globalParse___stp_attributes(stp, dct):
    parse_portfast = Suppress('portfast ') + restOfLine
    parse_bpdu = Suppress('portfast bpduguard ') + restOfLine
    parse_loop = Suppress('loopguard ') + restOfLine
    try:
        return util.int_dict_parse(parse_bpdu, stp, 'bpduguard', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_loop, stp, 'loopguard', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_portfast, stp, 'portfast', dct)
    except ParseException:
        pass
    return 0
Exemple #5
0
def __ifaceAttributes___storm_check(storm, dct):

    parse_level = Word(alphas) + Suppress('level ') + restOfLine
    parse_action = Suppress('action ') + Word(alphas)
    parse_type = Word(alphas) + Suppress(Optional("include")) + Word(alphas)
    try:
        value = parse_level.parseString(storm).asList()
        if 'level' in dct:
            dct['level'].append(value)
        else:
            dct['level'] = [value]
        return dct
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_action, storm, 'action', dct)
    except ParseException:
        pass
    try:
        return util.int_dict_parse(parse_type, storm, 'type', dct)
    except ParseException:
        pass
Exemple #6
0
def ___ipv6_parse___subparser(parser, ptype, ipv6, dct):
    dct = util.int_dict_parse(parser, ipv6, ptype, dct)
    tmp = dct[ptype][0].split(' ')
    dct[ptype] = {tmp[0]: tmp[1]}
    return dct