/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD "remote-as (" CMD_AS_RANGE "|internal|external)",
+ * "no neighbor <A.B.C.D|X:X::X:X> remote-as ((1-4294967295)|internal|external)",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE,
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295)",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Specify a local-as number\n"
* "AS number used as local AS\n"
*
- * NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "AS number used as local AS\n"
* "Do not prepend local-as to updates from ebgp peers\n"
*
- * NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend replace-as",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "password LINE",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> password LINE",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med next-hop as-path",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
* "Nexthop attribute\n"
* "As-path attribute\n"
*
- * NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med as-path next-hop",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
* "As-path attribute\n"
* "Nexthop attribute\n"
*
- * NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path next-hop med",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
* "Nexthop attribute\n"
* "Med attribute\n"
*
- * NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop as-path med",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
* "As-path attribute\n"
* "Med attribute\n"
*
- * NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path med next-hop",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
* "Med attribute\n"
* "Nexthop attribute\n"
*
- * NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop med as-path",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "BGP attribute is propagated unchanged to this neighbor\n"
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop med as-path",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Med attribute\n"
* "As-path attribute\n"
*
- * NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path med next-hop",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Med attribute\n"
* "Nexthop attribute\n"
*
- * NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med as-path next-hop",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "As-path attribute\n"
* "Nexthop attribute\n"
*
- * NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop as-path med",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "As-path attribute\n"
* "Med attribute\n"
*
- * NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path next-hop med",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Nexthop attribute\n"
* "Med attribute\n"
*
- * NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med next-hop as-path",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MAXTTL),
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> ebgp-multihop (1-255)",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/* disable-connected-check */
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NEIGHBOR_CMD2 "enforce-multihop",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> enforce-multihop",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Enforce EBGP neighbors perform multihop\n"
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "enforce-multihop",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> enforce-multihop",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "description .LINE",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> description .LINE",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "default-originate route-map WORD",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> default-originate route-map WORD",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295>",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Maximum number of prefix accept from this peer\n"
* "maximum no. of prefix limit\n"
*
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Restart bgp connection after limit is exceeded\n"
* "Restart interval in minutes"
*
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> warning-only",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "maximum no. of prefix limit\n"
* "Only give warning message when limit is exceeded\n"
*
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> restart <1-65535>",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Restart bgp connection after limit is exceeded\n"
* "Restart interval in minutes"
*
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100> warning-only",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Threshold value (%) at which to generate a warning msg\n"
* "Only give warning message when limit is exceeded\n"
*
- * NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>",
+ * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100>",
* NO_STR
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
/* "neighbor allowas-in" */
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * NEIGHBOR_CMD2 "allowas-in <1-10>",
+ * "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in <1-10>",
* NEIGHBOR_STR
* NEIGHBOR_ADDR_STR2
* "Accept as-path with my AS present in it\n"
line = line.replace('" QUAGGA_REDIST_STR_OSPF6D "', '<kernel|connected|static|ripng|isis|bgp|table>')
line = line.replace('" QUAGGA_REDIST_STR_ISISD "', '<kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table>')
line = line.replace('" LOG_FACILITIES "', '<kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>')
+ line = line.replace('" LOG_LEVELS "', ' (emergencies|alerts|critical|errors|warnings|notifications|informational|debugging)')
# endswith
line = line.replace('" CMD_AS_RANGE,', ' (1-4294967295)",')
line = line.replace('" QUAGGA_REDIST_STR_OSPF6D,', ' <kernel|connected|static|ripng|isis|bgp|table>",')
line = line.replace('" QUAGGA_REDIST_STR_ISISD,', ' <kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table>",')
line = line.replace('" LOG_FACILITIES,', ' <kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>",')
+ line = line.replace('" LOG_LEVELS,', ' (emergencies|alerts|critical|errors|warnings|notifications|informational|debugging)",')
# startswith
line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range <A.B.C.D/M|X:X::X:X/M> ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_INTERVAL "', '"ip igmp query-interval ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME "', '"ip igmp query-max-response-time ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC "', '"ip igmp query-max-response-time-dsec ')
+ line = line.replace('LOG_LEVELS "', '"(emergencies|alerts|critical|errors|warnings|notifications|informational|debugging) ')
# solo
line = line.replace('NO_NEIGHBOR_CMD2,', '"no neighbor <A.B.C.D|X:X::X:X|WORD>",')
new_command_string_expanded = expand_command_string(new_command_string)
lines = []
- # dwalton
lines.append("DEFUN (%s,\n" % self.name)
lines.append(" %s,\n" % self.name_cmd)
# lines.append(new_command_string)
if line.strip() == '*/':
state = None
fh.write(line)
- elif line.strip().startswith('* "'):
+ elif line.strip().startswith('* ') and not line.strip().startswith('* '):
# dwalton
new_line = expand_command_string(line[3:]) # chop the leading " * "
fh.write(" * %s" % new_line)