diff options
| -rw-r--r-- | ospfd/.gitignore | 2 | ||||
| -rw-r--r-- | ospfd/ospf_vty_clippy.c | 92 |
2 files changed, 1 insertions, 93 deletions
diff --git a/ospfd/.gitignore b/ospfd/.gitignore index 018a363a93..f0d800efb4 100644 --- a/ospfd/.gitignore +++ b/ospfd/.gitignore @@ -15,4 +15,4 @@ TAGS *~ *.loT *.a -*.clippy.c +*clippy.c diff --git a/ospfd/ospf_vty_clippy.c b/ospfd/ospf_vty_clippy.c deleted file mode 100644 index bf75dd4236..0000000000 --- a/ospfd/ospf_vty_clippy.c +++ /dev/null @@ -1,92 +0,0 @@ -/* ospf_router_id => "ospf router-id A.B.C.D" */ -DEFUN_CMD_FUNC_DECL(ospf_router_id) -#define funcdecl_ospf_router_id static int ospf_router_id_magic(\ - const struct cmd_element *self __attribute__ ((unused)),\ - struct vty *vty __attribute__ ((unused)),\ - int argc __attribute__ ((unused)),\ - struct cmd_token *argv[] __attribute__ ((unused)),\ - struct in_addr router_id,\ - const char * router_id_str __attribute__ ((unused))) -funcdecl_ospf_router_id; -DEFUN_CMD_FUNC_TEXT(ospf_router_id) -{ -#if 1 /* anything to parse? */ - int _i; -#if 1 /* anything that can fail? */ - unsigned _fail = 0, _failcnt = 0; -#endif - struct in_addr router_id = { INADDR_ANY }; - const char *router_id_str = NULL; - - for (_i = 0; _i < argc; _i++) { - if (!argv[_i]->varname) - continue; -#if 1 /* anything that can fail? */ - _fail = 0; -#endif - - if (!strcmp(argv[_i]->varname, "router_id")) { - router_id_str = argv[_i]->arg; - _fail = !inet_aton(argv[_i]->arg, &router_id); - } -#if 1 /* anything that can fail? */ - if (_fail) - vty_out (vty, "%% invalid input for %s: %s\n", - argv[_i]->varname, argv[_i]->arg); - _failcnt += _fail; -#endif - } -#if 1 /* anything that can fail? */ - if (_failcnt) - return CMD_WARNING; -#endif -#endif - return ospf_router_id_magic(self, vty, argc, argv, router_id, router_id_str); -} - -/* no_ospf_router_id => "no ospf router-id [A.B.C.D]" */ -DEFUN_CMD_FUNC_DECL(no_ospf_router_id) -#define funcdecl_no_ospf_router_id static int no_ospf_router_id_magic(\ - const struct cmd_element *self __attribute__ ((unused)),\ - struct vty *vty __attribute__ ((unused)),\ - int argc __attribute__ ((unused)),\ - struct cmd_token *argv[] __attribute__ ((unused)),\ - struct in_addr router_id,\ - const char * router_id_str __attribute__ ((unused))) -funcdecl_no_ospf_router_id; -DEFUN_CMD_FUNC_TEXT(no_ospf_router_id) -{ -#if 1 /* anything to parse? */ - int _i; -#if 1 /* anything that can fail? */ - unsigned _fail = 0, _failcnt = 0; -#endif - struct in_addr router_id = { INADDR_ANY }; - const char *router_id_str = NULL; - - for (_i = 0; _i < argc; _i++) { - if (!argv[_i]->varname) - continue; -#if 1 /* anything that can fail? */ - _fail = 0; -#endif - - if (!strcmp(argv[_i]->varname, "router_id")) { - router_id_str = argv[_i]->arg; - _fail = !inet_aton(argv[_i]->arg, &router_id); - } -#if 1 /* anything that can fail? */ - if (_fail) - vty_out (vty, "%% invalid input for %s: %s\n", - argv[_i]->varname, argv[_i]->arg); - _failcnt += _fail; -#endif - } -#if 1 /* anything that can fail? */ - if (_failcnt) - return CMD_WARNING; -#endif -#endif - return no_ospf_router_id_magic(self, vty, argc, argv, router_id, router_id_str); -} - |
