* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
"Use null authentication\n" \
"Use message-digest authentication\n"
-#define VLINK_HELPSTR_TIME_PARAM_NOSECS \
+#define VLINK_HELPSTR_TIME_PARAM \
"Time between HELLO packets\n" \
+ "Seconds\n" \
"Time between retransmitting lost link state advertisements\n" \
+ "Seconds\n" \
"Link state transmit delay\n" \
- "Interval time after which a neighbor is declared down\n"
-
-#define VLINK_HELPSTR_TIME_PARAM \
- VLINK_HELPSTR_TIME_PARAM_NOSECS \
- "Seconds\n"
+ "Seconds\n" \
+ "Interval time after which a neighbor is declared down\n" \
+ "Seconds\n" \
#define VLINK_HELPSTR_AUTH_SIMPLE \
"Authentication password (key)\n" \
}
-DEFUN (ospf_area_vlink_intervals,
- ospf_area_vlink_intervals_cmd,
- "area <A.B.C.D|(0-4294967295)> virtual-link A.B.C.D"
- "<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "]]]",
- VLINK_HELPSTR_IPADDR
- VLINK_HELPSTR_TIME_PARAM
- VLINK_HELPSTR_TIME_PARAM
- VLINK_HELPSTR_TIME_PARAM
- VLINK_HELPSTR_TIME_PARAM)
-{
- VTY_DECLVAR_CONTEXT(ospf, ospf);
- struct ospf_vl_config_data vl_config;
- int ret = 0;
-
- ospf_vl_config_data_init(&vl_config, vty);
-
- char *area_id = argv[1]->arg;
- char *router_id = argv[3]->arg;
-
- ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt);
- if (ret < 0)
- {
- vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ret = inet_aton (router_id, &vl_config.vl_peer);
- if (! ret)
- {
- vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- for (unsigned int i = 0; i < 4; i++)
- {
- int idx = 0;
- if (argv_find (argv, argc, "hello-interval", &idx))
- vl_config.hello_interval = strtol(argv[idx+1]->arg, NULL, 10);
- else if (argv_find (argv, argc, "retransmit-interval", &idx))
- vl_config.retransmit_interval = strtol(argv[idx+1]->arg, NULL, 10);
- else if (argv_find (argv, argc, "transmit-delay", &idx))
- vl_config.transmit_delay = strtol(argv[idx+1]->arg, NULL, 10);
- else if (argv_find (argv, argc, "dead-interval", &idx))
- vl_config.dead_interval = strtol(argv[idx+1]->arg, NULL, 10);
- }
-
- /* Action configuration */
- return ospf_vl_set (ospf, &vl_config);
-}
-
DEFUN (no_ospf_area_vlink,
no_ospf_area_vlink_cmd,
"no area <A.B.C.D|(0-4294967295)> virtual-link A.B.C.D [authentication] [<message-digest|null>] [<message-digest-key (1-255) md5 KEY|authentication-key AUTH_KEY>]",
return ospf_vl_set (ospf, &vl_config);
}
+DEFUN (ospf_area_vlink_intervals,
+ ospf_area_vlink_intervals_cmd,
+ "area <A.B.C.D|(0-4294967295)> virtual-link A.B.C.D {hello-interval (1-65535)|retransmit-interval (1-65535)|transmit-delay (1-65535)|dead-interval (1-65535)}",
+ VLINK_HELPSTR_IPADDR
+ VLINK_HELPSTR_TIME_PARAM)
+{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
+ struct ospf_vl_config_data vl_config;
+ int ret = 0;
+
+ ospf_vl_config_data_init(&vl_config, vty);
+
+ char *area_id = argv[1]->arg;
+ char *router_id = argv[3]->arg;
+
+ ret = str2area_id (area_id, &vl_config.area_id, &vl_config.area_id_fmt);
+ if (ret < 0)
+ {
+ vty_out (vty, "OSPF area ID is invalid%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ ret = inet_aton (router_id, &vl_config.vl_peer);
+ if (! ret)
+ {
+ vty_out (vty, "Please specify valid Router ID as a.b.c.d%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ for (int idx = 4; idx < argc; idx++)
+ {
+ if (strmatch (argv[idx]->text, "hello-interval"))
+ vl_config.hello_interval = strtol(argv[++idx]->arg, NULL, 10);
+ else if (strmatch (argv[idx]->text, "retransmit-interval"))
+ vl_config.retransmit_interval = strtol(argv[++idx]->arg, NULL, 10);
+ else if (strmatch (argv[idx]->text, "transmit-delay"))
+ vl_config.transmit_delay = strtol(argv[++idx]->arg, NULL, 10);
+ else if (strmatch (argv[idx]->text, "dead-interval"))
+ vl_config.dead_interval = strtol(argv[++idx]->arg, NULL, 10);
+ }
+
+ /* Action configuration */
+ return ospf_vl_set (ospf, &vl_config);
+}
+
DEFUN (no_ospf_area_vlink_intervals,
no_ospf_area_vlink_intervals_cmd,
- "no area <A.B.C.D|(0-4294967295)> virtual-link A.B.C.D"
- "<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "[<hello-interval|retransmit-interval|transmit-delay|dead-interval> (1-65535)"
- "]]]",
+ "no area <A.B.C.D|(0-4294967295)> virtual-link A.B.C.D {hello-interval (1-65535)|retransmit-interval (1-65535)|transmit-delay (1-65535)|dead-interval (1-65535)}",
NO_STR
VLINK_HELPSTR_IPADDR
- VLINK_HELPSTR_TIME_PARAM
- VLINK_HELPSTR_TIME_PARAM
- VLINK_HELPSTR_TIME_PARAM
VLINK_HELPSTR_TIME_PARAM)
{
VTY_DECLVAR_CONTEXT(ospf, ospf);
return CMD_WARNING;
}
- for (unsigned int i = 0; i < 4; i++)
+ for (int idx = 5; idx < argc; idx++)
{
- int idx = 0;
- if (argv_find (argv, argc, "hello-interval", &idx))
+ if (strmatch (argv[idx]->text, "hello-interval"))
vl_config.hello_interval = OSPF_HELLO_INTERVAL_DEFAULT;
- else if (argv_find (argv, argc, "retransmit-interval", &idx))
+ else if (strmatch (argv[idx]->text, "retransmit-interval"))
vl_config.retransmit_interval = OSPF_RETRANSMIT_INTERVAL_DEFAULT;
- else if (argv_find (argv, argc, "transmit-delay", &idx))
+ else if (strmatch (argv[idx]->text, "transmit-delay"))
vl_config.transmit_delay = OSPF_TRANSMIT_DELAY_DEFAULT;
- else if (argv_find (argv, argc, "dead-interval", &idx))
+ else if (strmatch (argv[idx]->text, "dead-interval"))
vl_config.dead_interval = OSPF_ROUTER_DEAD_INTERVAL_DEFAULT;
}
int idx_number = 4;
unsigned int interval;
- if (argc != 1)
+ if (argc < 5)
{
vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
return CMD_WARNING;
int idx_number = 3;
unsigned int arrival;
- if (argc != 1)
+ if (argc < 4)
{
vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
return CMD_WARNING;
int idx_number_3 = 5;
unsigned int delay, hold, max;
- if (argc != 3)
+ if (argc < 6)
{
vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
return CMD_WARNING;
int idx_number = 3;
unsigned int minarrival;
- if (argc != 1)
+ if (argc < 4)
{
vty_out (vty, "Insufficient number of arguments%s", VTY_NEWLINE);
return CMD_WARNING;
if (use_json)
{
json = json_object_new_object();
- json_interface_sub = json_object_new_object();
}
if (ospf->instance)
{
if (ospf_oi_count(ifp))
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json);
+
if (use_json)
json_object_object_add (json, ifp->name, json_interface_sub);
}
}
else
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json);
+
if (use_json)
json_object_object_add(json, ifp->name, json_interface_sub);
}
int idx = 0;
struct in_addr addr;
struct ospf_if_params *params;
+
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
}
else /* Interface name is specified. */
{
- if ((ifp = if_lookup_by_name (argv[idx_ifname]->text, VRF_DEFAULT)) == NULL)
+ if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL)
vty_out (vty, "No such interface name%s", VTY_NEWLINE);
else
ospf_interface_clear(ifp);