--- quagga-0.99.9/bgpd/bgp_open.h 2007-08-06 08:17:45.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/bgpd/bgp_open.h 2008-04-16 11:55:47.000000000 -0700 @@ -44,7 +44,12 @@ struct capability_orf_entry struct { u_char type; u_char mode; +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + } orfs[0]; +#else } orfs[]; +#endif } __attribute__ ((packed)); #pragma pack() @@ -58,7 +63,12 @@ struct graceful_restart_af struct capability_gr { u_int16_t restart_flag_time; +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + struct graceful_restart_af gr[0]; +#else struct graceful_restart_af gr[]; +#endif }; /* Capability Code */ --- quagga-0.99.9/bgpd/bgp_route.c 2007-08-26 15:44:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/bgpd/bgp_route.c 2008-04-16 11:55:47.000000000 -0700 @@ -5802,9 +5803,16 @@ route_vty_out_tag (struct vty *vty, stru #ifdef HAVE_IPV6 else if (p->family == AF_INET6) { +/* gcc-2.95 won't let asserts before array declarations */ +#if ( __GNUC__ > 2) assert (attr->extra); +#endif char buf[BUFSIZ]; char buf1[BUFSIZ]; +/* Move it here */ +#if ( __GNUC__ == 2) + assert (attr->extra); +#endif if (attr->extra->mp_nexthop_len == 16) vty_out (vty, "%s", inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global, --- quagga-0.99.9/configure 2007-09-07 09:54:55.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/configure 2008-04-16 11:55:47.000000000 -0700 @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Quagga' PACKAGE_TARNAME='quagga' -PACKAGE_VERSION='0.99.9' -PACKAGE_STRING='Quagga 0.99.9' +PACKAGE_VERSION='0.99.9-ospfv3-extensions-2008-04-16' +PACKAGE_STRING='Quagga 0.99.9-ospfv3-extensions-2008-04-16' PACKAGE_BUGREPORT='http://bugzilla.quagga.net' ac_unique_file="lib/zebra.h" @@ -21323,6 +21323,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #include <$ac_header> @@ -21415,6 +21418,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif @@ -22871,6 +22877,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -22996,6 +23005,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -27698,6 +27710,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -27803,6 +27818,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -28397,6 +28415,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29338,6 +29359,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29481,6 +29505,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29624,6 +29651,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29767,6 +29797,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29910,6 +29943,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30053,6 +30089,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30196,6 +30235,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30339,6 +30381,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30482,6 +30527,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30625,6 +30673,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30768,6 +30819,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30911,6 +30965,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31054,6 +31111,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31199,6 +31259,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31320,6 +31383,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31464,6 +31530,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31585,6 +31654,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31729,6 +31801,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31850,6 +31925,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31994,6 +32072,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32115,6 +32196,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32259,6 +32343,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32380,6 +32467,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32524,6 +32614,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32645,6 +32738,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32791,6 +32887,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32932,6 +33031,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -33866,6 +33968,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -34178,6 +34283,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include --- quagga-0.99.9/configure.ac 2007-09-07 09:54:01.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/configure.ac 2008-04-16 11:55:47.000000000 -0700 @@ -8,7 +8,7 @@ ## $Id: configure.ac,v 1.139 2007/09/07 16:54:01 paul Exp $ AC_PREREQ(2.53) -AC_INIT(Quagga, 0.99.9, [http://bugzilla.quagga.net]) +AC_INIT(Quagga, 0.99.9-ospfv3-extensions-2008-04-16, [http://bugzilla.quagga.net]) AC_CONFIG_SRCDIR(lib/zebra.h) dnl ----------------------------------- @@ -416,6 +416,9 @@ m4_define([QUAGGA_INCLUDES], #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif ])dnl AC_CHECK_HEADERS([sys/un.h net/if.h netinet/in_systm.h netinet/in_var.h \ --- quagga-0.99.9/lib/buffer.c 2005-12-02 03:02:17.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/buffer.c 2008-04-16 11:55:47.000000000 -0700 @@ -53,7 +53,12 @@ struct buffer_data size_t sp; /* Actual data stream (variable length). */ +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + unsigned char data[0]; /* real dimension is buffer->size */ +#else unsigned char data[]; /* real dimension is buffer->size */ +#endif }; /* It should always be true that: 0 <= sp <= cp <= size */ @@ -148,7 +153,8 @@ buffer_add (struct buffer *b) { struct buffer_data *d; - d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data[b->size])); + d = + XMALLOC (MTYPE_BUFFER_DATA, offsetof (struct buffer_data, data[b->size])); d->cp = d->sp = 0; d->next = NULL; @@ -237,7 +243,8 @@ buffer_flush_window (struct buffer *b, i char more[] = " --More-- "; char erase[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + }; struct buffer_data *data; int column; @@ -314,7 +321,8 @@ buffer_flush_window (struct buffer *b, i { zlog_warn("%s: growing iov array to %d; " "width %d, height %d, size %lu", - __func__, iov_alloc, width, height, (u_long)b->size); + __func__, iov_alloc, width, height, + (u_long) b->size); iov = XREALLOC(MTYPE_TMP, iov, iov_alloc*sizeof(*iov)); } else --- quagga-0.99.9/lib/buffer.h 2005-05-03 12:05:50.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/buffer.h 2008-04-16 11:55:47.000000000 -0700 @@ -96,7 +96,8 @@ extern buffer_status_t buffer_flush_all to return -1 (because the logic for handling the erase and more features is too complicated to retry the write later). */ -extern buffer_status_t buffer_flush_window (struct buffer *, int fd, int width, - int height, int erase, int no_more); +extern buffer_status_t buffer_flush_window (struct buffer *, int fd, + int width, int height, int erase, + int no_more); #endif /* _ZEBRA_BUFFER_H */ --- quagga-0.99.9/lib/checksum.c 2005-11-03 03:52:14.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/checksum.c 2008-04-16 11:55:47.000000000 -0700 @@ -24,13 +24,15 @@ in_cksum(void *parg, int nbytes) */ sum = 0; - while (nbytes > 1) { + while (nbytes > 1) + { sum += *ptr++; nbytes -= 2; } /* mop up an odd byte, if necessary */ - if (nbytes == 1) { + if (nbytes == 1) + { oddbyte = 0; /* make sure top half is zero */ *((u_char *) &oddbyte) = *(u_char *)ptr; /* one byte only */ sum += oddbyte; --- quagga-0.99.9/lib/command.c 2007-04-29 05:40:39.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/command.c 2008-04-16 11:55:47.000000000 -0700 @@ -41,74 +41,88 @@ vector cmdvec = NULL; struct host host; /* Standard command node structures. */ -struct cmd_node auth_node = -{ +struct cmd_node auth_node = { AUTH_NODE, "Password: ", }; -struct cmd_node view_node = -{ +struct cmd_node view_node = { VIEW_NODE, "%s> ", }; -struct cmd_node auth_enable_node = -{ +struct cmd_node auth_enable_node = { AUTH_ENABLE_NODE, "Password: ", }; -struct cmd_node enable_node = -{ +struct cmd_node enable_node = { ENABLE_NODE, "%s# ", }; -struct cmd_node config_node = -{ +struct cmd_node config_node = { CONFIG_NODE, "%s(config)# ", 1 }; /* Default motd string. */ -const char *default_motd = -"\r\n\ +const char *default_motd = "\r\n\ Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ " QUAGGA_COPYRIGHT "\r\n\ \r\n"; -static struct facility_map { +static struct facility_map +{ int facility; const char *name; size_t match; } syslog_facilities[] = { - { LOG_KERN, "kern", 1 }, - { LOG_USER, "user", 2 }, - { LOG_MAIL, "mail", 1 }, - { LOG_DAEMON, "daemon", 1 }, - { LOG_AUTH, "auth", 1 }, - { LOG_SYSLOG, "syslog", 1 }, - { LOG_LPR, "lpr", 2 }, - { LOG_NEWS, "news", 1 }, - { LOG_UUCP, "uucp", 2 }, - { LOG_CRON, "cron", 1 }, + { + LOG_KERN, "kern", 1}, + { + LOG_USER, "user", 2}, + { + LOG_MAIL, "mail", 1}, + { + LOG_DAEMON, "daemon", 1}, + { + LOG_AUTH, "auth", 1}, + { + LOG_SYSLOG, "syslog", 1}, + { + LOG_LPR, "lpr", 2}, + { + LOG_NEWS, "news", 1}, + { + LOG_UUCP, "uucp", 2}, + { + LOG_CRON, "cron", 1}, #ifdef LOG_FTP - { LOG_FTP, "ftp", 1 }, + { + LOG_FTP, "ftp", 1}, #endif - { LOG_LOCAL0, "local0", 6 }, - { LOG_LOCAL1, "local1", 6 }, - { LOG_LOCAL2, "local2", 6 }, - { LOG_LOCAL3, "local3", 6 }, - { LOG_LOCAL4, "local4", 6 }, - { LOG_LOCAL5, "local5", 6 }, - { LOG_LOCAL6, "local6", 6 }, - { LOG_LOCAL7, "local7", 6 }, - { 0, NULL, 0 }, - }; + { + LOG_LOCAL0, "local0", 6}, + { + LOG_LOCAL1, "local1", 6}, + { + LOG_LOCAL2, "local2", 6}, + { + LOG_LOCAL3, "local3", 6}, + { + LOG_LOCAL4, "local4", 6}, + { + LOG_LOCAL5, "local5", 6}, + { + LOG_LOCAL6, "local6", 6}, + { + LOG_LOCAL7, "local7", 6}, + { +0, NULL, 0},}; static const char * facility_name(int facility) @@ -181,8 +195,7 @@ argv_concat (const char **argv, int argc /* Install top node of command vector. */ void -install_node (struct cmd_node *node, - int (*func) (struct vty *)) +install_node (struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index (cmdvec, node->node, node); node->func = func; @@ -402,7 +415,9 @@ cmd_make_descvec (const char *string, co sp = cp; - while (! (isspace ((int) *cp) || *cp == '\r' || *cp == '\n' || *cp == ')' || *cp == '|') && *cp != '\0') + while (! + (isspace ((int) *cp) || *cp == '\r' || *cp == '\n' || *cp == ')' + || *cp == '|') && *cp != '\0') cp++; len = cp - sp; @@ -536,7 +551,8 @@ config_write_host (struct vty *vty) if (host.password_encrypt) vty_out (vty, "password 8 %s%s", host.password_encrypt, VTY_NEWLINE); if (host.enable_encrypt) - vty_out (vty, "enable password 8 %s%s", host.enable_encrypt, VTY_NEWLINE); + vty_out (vty, "enable password 8 %s%s", host.enable_encrypt, + VTY_NEWLINE); } else { @@ -574,9 +590,11 @@ config_write_host (struct vty *vty) if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) vty_out(vty,"no log monitor%s",VTY_NEWLINE); - else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != zlog_default->default_lvl) + else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != + zlog_default->default_lvl) vty_out(vty,"log monitor %s%s", - zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]],VTY_NEWLINE); + zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]], + VTY_NEWLINE); if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != ZLOG_DISABLED) { @@ -605,8 +623,7 @@ config_write_host (struct vty *vty) vty_out (vty, "service password-encryption%s", VTY_NEWLINE); if (host.lines >= 0) - vty_out (vty, "service terminal-length %d%s", host.lines, - VTY_NEWLINE); + vty_out (vty, "service terminal-length %d%s", host.lines, VTY_NEWLINE); if (host.motdfile) vty_out (vty, "banner motd file %s%s", host.motdfile, VTY_NEWLINE); @@ -638,7 +655,9 @@ cmd_filter_by_symbol (char *command, cha lim = strlen (command); while (i < lim) { - if (! (isdigit ((int) command[i]) || command[i] == '.' || command[i] == '/')) + if (! + (isdigit ((int) command[i]) || command[i] == '.' + || command[i] == '/')) return 1; i++; } @@ -650,7 +669,9 @@ cmd_filter_by_symbol (char *command, cha lim = strlen (command); while (i < lim) { - if (! (isalpha ((int) command[i]) || command[i] == '_' || command[i] == '-')) + if (! + (isalpha ((int) command[i]) || command[i] == '_' + || command[i] == '-')) return 1; i++; } @@ -1557,13 +1578,13 @@ desc_unique_string (vector v, const char } static int -cmd_try_do_shortcut (enum node_type node, char* first_word) { +cmd_try_do_shortcut (enum node_type node, char *first_word) +{ if ( first_word != NULL && node != AUTH_NODE && node != VIEW_NODE && node != AUTH_ENABLE_NODE && - node != ENABLE_NODE && - 0 == strcmp( "do", first_word ) ) + node != ENABLE_NODE && 0 == strcmp ("do", first_word)) return 1; return 0; } @@ -1616,7 +1637,8 @@ cmd_describe_command_real (vector vline, && (vector_active (cmd_element->strvec))) { descvec = vector_slot (cmd_element->strvec, - vector_active (cmd_element->strvec) - 1); + vector_active (cmd_element->strvec) - + 1); for (k = 0; k < vector_active (descvec); k++) { struct desc *desc = vector_slot (descvec, k); @@ -1725,7 +1747,8 @@ cmd_describe_command (vector vline, stru /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_describe_command_real (shifted_vline, vty, status); @@ -1948,7 +1971,8 @@ cmd_complete_command (vector vline, stru /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_complete_command_real (shifted_vline, vty, status); @@ -2090,7 +2114,8 @@ cmd_execute_command_real (vector vline, if (CMD_VARARG (desc->cmd)) varflag = 1; - if (varflag || CMD_VARIABLE (desc->cmd) || CMD_OPTION (desc->cmd)) + if (varflag || CMD_VARIABLE (desc->cmd) + || CMD_OPTION (desc->cmd)) argv[argc++] = vector_slot (vline, i); } else @@ -2114,7 +2139,8 @@ cmd_execute_command_real (vector vline, int cmd_execute_command (vector vline, struct vty *vty, struct cmd_element **cmd, - int vtysh) { + int vtysh) +{ int ret, saved_ret, tried = 0; enum node_type onode, try_node; @@ -2132,7 +2158,8 @@ cmd_execute_command (vector vline, struc /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_execute_command_real (shifted_vline, vty, cmd); @@ -2149,8 +2176,7 @@ cmd_execute_command (vector vline, struc return saved_ret; /* This assumes all nodes above CONFIG_NODE are childs of CONFIG_NODE */ - while ( ret != CMD_SUCCESS && ret != CMD_WARNING - && vty->node > CONFIG_NODE ) + while (ret != CMD_SUCCESS && ret != CMD_WARNING && vty->node > CONFIG_NODE) { try_node = node_parent(try_node); vty->node = try_node; @@ -2266,7 +2292,8 @@ cmd_execute_command_strict (vector vline if (CMD_VARARG (desc->cmd)) varflag = 1; - if (varflag || CMD_VARIABLE (desc->cmd) || CMD_OPTION (desc->cmd)) + if (varflag || CMD_VARIABLE (desc->cmd) + || CMD_OPTION (desc->cmd)) argv[argc++] = vector_slot (vline, i); } else @@ -2326,14 +2353,14 @@ config_from_file (struct vty *vty, FILE DEFUN (config_terminal, config_terminal_cmd, "configure terminal", - "Configuration from vty interface\n" - "Configuration terminal\n") + "Configuration from vty interface\n" "Configuration terminal\n") { if (vty_config_lock (vty)) vty->node = CONFIG_NODE; else { - vty_out (vty, "VTY configuration is locked by other VTY%s", VTY_NEWLINE); + vty_out (vty, "VTY configuration is locked by other VTY%s", + VTY_NEWLINE); return CMD_WARNING; } return CMD_SUCCESS; @@ -2341,9 +2368,7 @@ DEFUN (config_terminal, /* Enable command */ DEFUN (enable, - config_enable_cmd, - "enable", - "Turn on privileged mode command\n") + config_enable_cmd, "enable", "Turn on privileged mode command\n") { /* If enable password is NULL, change to ENABLE_NODE */ if ((host.enable == NULL && host.enable_encrypt == NULL) || @@ -2357,9 +2382,7 @@ DEFUN (enable, /* Disable command */ DEFUN (disable, - config_disable_cmd, - "disable", - "Turn off privileged mode command\n") + config_disable_cmd, "disable", "Turn off privileged mode command\n") { if (vty->node == ENABLE_NODE) vty->node = VIEW_NODE; @@ -2369,8 +2392,7 @@ DEFUN (disable, /* Down vty node level. */ DEFUN (config_exit, config_exit_cmd, - "exit", - "Exit current mode and down to previous mode\n") + "exit", "Exit current mode and down to previous mode\n") { switch (vty->node) { @@ -2418,14 +2440,10 @@ DEFUN (config_exit, /* quit is alias of exit. */ ALIAS (config_exit, config_quit_cmd, - "quit", - "Exit current mode and down to previous mode\n") - + "quit", "Exit current mode and down to previous mode\n") /* End of configuration. */ DEFUN (config_end, - config_end_cmd, - "end", - "End current mode and change to enable mode.") + config_end_cmd, "end", "End current mode and change to enable mode.") { switch (vty->node) { @@ -2463,13 +2481,10 @@ DEFUN (config_end, /* Show version. */ DEFUN (show_version, - show_version_cmd, - "show version", - SHOW_STR - "Displays zebra version\n") + show_version_cmd, "show version", SHOW_STR "Displays zebra version\n") { - vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, host.name?host.name:"", - VTY_NEWLINE); + vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, + host.name ? host.name : "", VTY_NEWLINE); vty_out (vty, "%s%s", QUAGGA_COPYRIGHT, VTY_NEWLINE); return CMD_SUCCESS; @@ -2478,8 +2493,7 @@ DEFUN (show_version, /* Help display function for all node. */ DEFUN (config_help, config_help_cmd, - "help", - "Description of the interactive help system\n") + "help", "Description of the interactive help system\n") { vty_out (vty, "Quagga VTY provides advanced help feature. When you need help,%s\ @@ -2493,17 +2507,12 @@ command argument (e.g. 'show ?') and des argument.%s\ 2. Partial help is provided when an abbreviated argument is entered%s\ and you want to know what arguments match the input%s\ - (e.g. 'show me?'.)%s%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + (e.g. 'show me?'.)%s%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); return CMD_SUCCESS; } /* Help display function for all node. */ -DEFUN (config_list, - config_list_cmd, - "list", - "Print command list\n") +DEFUN (config_list, config_list_cmd, "list", "Print command list\n") { unsigned int i; struct cmd_node *cnode = vector_slot (cmdvec, vty->node); @@ -2513,8 +2522,7 @@ DEFUN (config_list, if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL && !(cmd->attr == CMD_ATTR_DEPRECATED || cmd->attr == CMD_ATTR_HIDDEN)) - vty_out (vty, " %s%s", cmd->string, - VTY_NEWLINE); + vty_out (vty, " %s%s", cmd->string, VTY_NEWLINE); return CMD_SUCCESS; } @@ -2584,14 +2592,14 @@ DEFUN (config_write_file, if (unlink (config_file_sav) != 0) if (errno != ENOENT) { - vty_out (vty, "Can't unlink backup configuration file %s.%s", config_file_sav, - VTY_NEWLINE); + vty_out (vty, "Can't unlink backup configuration file %s.%s", + config_file_sav, VTY_NEWLINE); goto finished; } if (link (config_file, config_file_sav) != 0) { - vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, - VTY_NEWLINE); + vty_out (vty, "Can't backup old configuration file %s.%s", + config_file_sav, VTY_NEWLINE); goto finished; } sync (); @@ -2616,8 +2624,7 @@ DEFUN (config_write_file, goto finished; } - vty_out (vty, "Configuration saved to %s%s", config_file, - VTY_NEWLINE); + vty_out (vty, "Configuration saved to %s%s", config_file, VTY_NEWLINE); ret = CMD_SUCCESS; finished: @@ -2666,8 +2670,7 @@ DEFUN (config_write_terminal, } else { - vty_out (vty, "%sCurrent configuration:%s", VTY_NEWLINE, - VTY_NEWLINE); + vty_out (vty, "%sCurrent configuration:%s", VTY_NEWLINE, VTY_NEWLINE); vty_out (vty, "!%s", VTY_NEWLINE); for (i = 0; i < vector_active (cmdvec); i++) @@ -2684,16 +2687,11 @@ DEFUN (config_write_terminal, /* Write current configuration into the terminal. */ ALIAS (config_write_terminal, show_running_config_cmd, - "show running-config", - SHOW_STR - "running configuration\n") - + "show running-config", SHOW_STR "running configuration\n") /* Write startup configuration into the terminal. */ DEFUN (show_startup_config, show_startup_config_cmd, - "show startup-config", - SHOW_STR - "Contentes of startup configuration\n") + "show startup-config", SHOW_STR "Contentes of startup configuration\n") { char buf[BUFSIZ]; FILE *confp; @@ -2726,12 +2724,12 @@ DEFUN (show_startup_config, DEFUN (config_hostname, hostname_cmd, "hostname WORD", - "Set system's network name\n" - "This system's network name\n") + "Set system's network name\n" "This system's network name\n") { if (!isalpha((int) *argv[0])) { - vty_out (vty, "Please specify string starting with alphabet%s", VTY_NEWLINE); + vty_out (vty, "Please specify string starting with alphabet%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2745,9 +2743,7 @@ DEFUN (config_hostname, DEFUN (config_no_hostname, no_hostname_cmd, "no hostname [HOSTNAME]", - NO_STR - "Reset system's network name\n" - "Host name of this router\n") + NO_STR "Reset system's network name\n" "Host name of this router\n") { if (host.name) XFREE (MTYPE_HOST, host.name); @@ -2760,8 +2756,7 @@ DEFUN (config_password, password_cmd, "password (8|) WORD", "Assign the terminal connection password\n" "Specifies a HIDDEN password will follow\n" - "dummy string \n" - "The HIDDEN line password string\n") + "dummy string \n" "The HIDDEN line password string\n") { /* Argument check. */ if (argc == 0) @@ -2792,7 +2787,8 @@ DEFUN (config_password, password_cmd, if (!isalnum ((int) *argv[0])) { vty_out (vty, - "Please specify string starting with alphanumeric%s", VTY_NEWLINE); + "Please specify string starting with alphanumeric%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2823,8 +2818,7 @@ DEFUN (config_enable_password, enable_pa "Modify enable password parameters\n" "Assign the privileged level password\n" "Specifies a HIDDEN password will follow\n" - "dummy string \n" - "The HIDDEN 'enable' password string\n") + "dummy string \n" "The HIDDEN 'enable' password string\n") { /* Argument check. */ if (argc == 0) @@ -2858,7 +2852,8 @@ DEFUN (config_enable_password, enable_pa if (!isalnum ((int) *argv[0])) { vty_out (vty, - "Please specify string starting with alphanumeric%s", VTY_NEWLINE); + "Please specify string starting with alphanumeric%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2907,8 +2901,7 @@ DEFUN (no_config_enable_password, no_ena DEFUN (service_password_encrypt, service_password_encrypt_cmd, "service password-encryption", - "Set up miscellaneous service\n" - "Enable encrypted passwords\n") + "Set up miscellaneous service\n" "Enable encrypted passwords\n") { if (host.encrypt) return CMD_SUCCESS; @@ -2934,9 +2927,7 @@ DEFUN (service_password_encrypt, DEFUN (no_service_password_encrypt, no_service_password_encrypt_cmd, "no service password-encryption", - NO_STR - "Set up miscellaneous service\n" - "Enable encrypted passwords\n") + NO_STR "Set up miscellaneous service\n" "Enable encrypted passwords\n") { if (! host.encrypt) return CMD_SUCCESS; @@ -2977,8 +2968,7 @@ DEFUN (config_terminal_length, config_te DEFUN (config_terminal_no_length, config_terminal_no_length_cmd, "terminal no length", "Set terminal line parameters\n" - NO_STR - "Set number of lines on a screen\n") + NO_STR "Set number of lines on a screen\n") { vty->lines = -1; return CMD_SUCCESS; @@ -3018,13 +3008,13 @@ DEFUN (no_service_terminal_length, no_se DEFUN_HIDDEN (do_echo, echo_cmd, "echo .MESSAGE", - "Echo a message back to the vty\n" - "The message to echo\n") + "Echo a message back to the vty\n" "The message to echo\n") { char *message; - vty_out (vty, "%s%s", ((message = argv_concat(argv, argc, 0)) ? message : ""), - VTY_NEWLINE); + vty_out (vty, "%s%s", + ((message = + argv_concat (argv, argc, 0)) ? message : ""), VTY_NEWLINE); if (message) XFREE(MTYPE_TMP, message); return CMD_SUCCESS; @@ -3034,8 +3024,7 @@ DEFUN (config_logmsg, config_logmsg_cmd, "logmsg "LOG_LEVELS" .MESSAGE", "Send a message to enabled logging destinations\n" - LOG_LEVEL_DESC - "The message to send\n") + LOG_LEVEL_DESC "The message to send\n") { int level; char *message; @@ -3043,7 +3032,8 @@ DEFUN (config_logmsg, if ((level = level_match(argv[0])) == ZLOG_DISABLED) return CMD_ERR_NO_MATCH; - zlog(NULL, level, ((message = argv_concat(argv, argc, 1)) ? message : "")); + zlog (NULL, level, + ((message = argv_concat (argv, argc, 1)) ? message : "")); if (message) XFREE(MTYPE_TMP, message); return CMD_SUCCESS; @@ -3051,9 +3041,7 @@ DEFUN (config_logmsg, DEFUN (show_logging, show_logging_cmd, - "show logging", - SHOW_STR - "Show current logging configuration\n") + "show logging", SHOW_STR "Show current logging configuration\n") { struct zlog *zl = zlog_default; @@ -3070,26 +3058,22 @@ DEFUN (show_logging, if (zl->maxlvl[ZLOG_DEST_STDOUT] == ZLOG_DISABLED) vty_out (vty, "disabled"); else - vty_out (vty, "level %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); + vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "Monitor logging: "); if (zl->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) vty_out (vty, "disabled"); else - vty_out (vty, "level %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); + vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "File logging: "); - if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || - !zl->fp) + if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || !zl->fp) vty_out (vty, "disabled"); else vty_out (vty, "level %s, filename %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], - zl->filename); + zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], zl->filename); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "Protocol name: %s%s", @@ -3104,9 +3088,7 @@ DEFUN (show_logging, DEFUN (config_log_stdout, config_log_stdout_cmd, - "log stdout", - "Logging control\n" - "Set stdout logging level\n") + "log stdout", "Logging control\n" "Set stdout logging level\n") { zlog_set_level (NULL, ZLOG_DEST_STDOUT, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3115,9 +3097,7 @@ DEFUN (config_log_stdout, DEFUN (config_log_stdout_level, config_log_stdout_level_cmd, "log stdout "LOG_LEVELS, - "Logging control\n" - "Set stdout logging level\n" - LOG_LEVEL_DESC) + "Logging control\n" "Set stdout logging level\n" LOG_LEVEL_DESC) { int level; @@ -3131,9 +3111,7 @@ DEFUN (no_config_log_stdout, no_config_log_stdout_cmd, "no log stdout [LEVEL]", NO_STR - "Logging control\n" - "Cancel logging to stdout\n" - "Logging level\n") + "Logging control\n" "Cancel logging to stdout\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_STDOUT, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3142,8 +3120,7 @@ DEFUN (no_config_log_stdout, DEFUN (config_log_monitor, config_log_monitor_cmd, "log monitor", - "Logging control\n" - "Set terminal line (monitor) logging level\n") + "Logging control\n" "Set terminal line (monitor) logging level\n") { zlog_set_level (NULL, ZLOG_DEST_MONITOR, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3153,8 +3130,7 @@ DEFUN (config_log_monitor_level, config_log_monitor_level_cmd, "log monitor "LOG_LEVELS, "Logging control\n" - "Set terminal line (monitor) logging level\n" - LOG_LEVEL_DESC) + "Set terminal line (monitor) logging level\n" LOG_LEVEL_DESC) { int level; @@ -3169,8 +3145,7 @@ DEFUN (no_config_log_monitor, "no log monitor [LEVEL]", NO_STR "Logging control\n" - "Disable terminal line (monitor) logging\n" - "Logging level\n") + "Disable terminal line (monitor) logging\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_MONITOR, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3229,9 +3204,7 @@ set_log_file(struct vty *vty, const char DEFUN (config_log_file, config_log_file_cmd, "log file FILENAME", - "Logging control\n" - "Logging to file\n" - "Logging filename\n") + "Logging control\n" "Logging to file\n" "Logging filename\n") { return set_log_file(vty, argv[0], zlog_default->default_lvl); } @@ -3240,9 +3213,7 @@ DEFUN (config_log_file_level, config_log_file_level_cmd, "log file FILENAME "LOG_LEVELS, "Logging control\n" - "Logging to file\n" - "Logging filename\n" - LOG_LEVEL_DESC) + "Logging to file\n" "Logging filename\n" LOG_LEVEL_DESC) { int level; @@ -3255,9 +3226,7 @@ DEFUN (no_config_log_file, no_config_log_file_cmd, "no log file [FILENAME]", NO_STR - "Logging control\n" - "Cancel logging to file\n" - "Logging file name\n") + "Logging control\n" "Cancel logging to file\n" "Logging file name\n") { zlog_reset_file (NULL); @@ -3277,12 +3246,9 @@ ALIAS (no_config_log_file, "Cancel logging to file\n" "Logging file name\n" "Logging level\n") - DEFUN (config_log_syslog, config_log_syslog_cmd, - "log syslog", - "Logging control\n" - "Set syslog logging level\n") + "log syslog", "Logging control\n" "Set syslog logging level\n") { zlog_set_level (NULL, ZLOG_DEST_SYSLOG, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3291,9 +3257,7 @@ DEFUN (config_log_syslog, DEFUN (config_log_syslog_level, config_log_syslog_level_cmd, "log syslog "LOG_LEVELS, - "Logging control\n" - "Set syslog logging level\n" - LOG_LEVEL_DESC) + "Logging control\n" "Set syslog logging level\n" LOG_LEVEL_DESC) { int level; @@ -3325,9 +3289,7 @@ DEFUN (no_config_log_syslog, no_config_log_syslog_cmd, "no log syslog [LEVEL]", NO_STR - "Logging control\n" - "Cancel logging to syslog\n" - "Logging level\n") + "Logging control\n" "Cancel logging to syslog\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_SYSLOG, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3346,8 +3307,7 @@ DEFUN (config_log_facility, config_log_facility_cmd, "log facility "LOG_FACILITIES, "Logging control\n" - "Facility parameter for syslog messages\n" - LOG_FACILITY_DESC) + "Facility parameter for syslog messages\n" LOG_FACILITY_DESC) { int facility; @@ -3362,8 +3322,7 @@ DEFUN (no_config_log_facility, "no log facility [FACILITY]", NO_STR "Logging control\n" - "Reset syslog facility to default (daemon)\n" - "Syslog facility\n") + "Reset syslog facility to default (daemon)\n" "Syslog facility\n") { zlog_default->facility = LOG_DAEMON; return CMD_SUCCESS; @@ -3394,8 +3353,7 @@ DEFUN_DEPRECATED (no_config_log_trap, "no log trap [LEVEL]", NO_STR "Logging control\n" - "Permit all logging information\n" - "Logging level\n") + "Permit all logging information\n" "Logging level\n") { zlog_default->default_lvl = LOG_DEBUG; return CMD_SUCCESS; @@ -3427,8 +3385,7 @@ DEFUN (config_log_timestamp_precision, "log timestamp precision <0-6>", "Logging control\n" "Timestamp configuration\n" - "Set the timestamp precision\n" - "Number of subsecond digits\n") + "Set the timestamp precision\n" "Number of subsecond digits\n") { if (argc != 1) { @@ -3456,10 +3413,7 @@ DEFUN (no_config_log_timestamp_precision DEFUN (banner_motd_file, banner_motd_file_cmd, "banner motd file [FILE]", - "Set banner\n" - "Banner for motd\n" - "Banner from a file\n" - "Filename\n") + "Set banner\n" "Banner for motd\n" "Banner from a file\n" "Filename\n") { if (host.motdfile) XFREE (MTYPE_HOST, host.motdfile); @@ -3471,9 +3425,7 @@ DEFUN (banner_motd_file, DEFUN (banner_motd_default, banner_motd_default_cmd, "banner motd default", - "Set banner string\n" - "Strings for motd\n" - "Default string\n") + "Set banner string\n" "Strings for motd\n" "Default string\n") { host.motd = default_motd; return CMD_SUCCESS; @@ -3481,10 +3433,7 @@ DEFUN (banner_motd_default, DEFUN (no_banner_motd, no_banner_motd_cmd, - "no banner motd", - NO_STR - "Set banner string\n" - "Strings for motd\n") + "no banner motd", NO_STR "Set banner string\n" "Strings for motd\n") { host.motd = NULL; if (host.motdfile) --- quagga-0.99.9/lib/command.h 2007-05-02 08:28:32.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/command.h 2008-04-16 11:55:47.000000000 -0700 @@ -342,8 +343,10 @@ extern char **cmd_complete_command (vect extern const char *cmd_prompt (enum node_type); extern int config_from_file (struct vty *, FILE *); extern enum node_type node_parent (enum node_type); -extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, int); -extern int cmd_execute_command_strict (vector, struct vty *, struct cmd_element **); +extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, + int); +extern int cmd_execute_command_strict (vector, struct vty *, + struct cmd_element **); extern void config_replace_string (struct cmd_element *, char *, ...); extern void cmd_init (int); --- quagga-0.99.9/lib/distribute.c 2005-05-06 07:43:13.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/distribute.c 2008-04-16 11:55:47.000000000 -0700 @@ -385,8 +383,7 @@ DEFUN (distribute_list, "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { enum distribute_type type; struct distribute *dist; @@ -398,7 +395,8 @@ DEFUN (distribute_list, type = DISTRIBUTE_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -423,8 +420,7 @@ DEFUN (no_districute_list, no_distribute "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { int ret; enum distribute_type type; @@ -436,7 +432,8 @@ DEFUN (no_districute_list, no_distribute type = DISTRIBUTE_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -547,8 +541,7 @@ DEFUN (districute_list_prefix, distribut "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { enum distribute_type type; struct distribute *dist; @@ -587,8 +579,7 @@ DEFUN (no_districute_list_prefix, no_dis "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { int ret; enum distribute_type type; @@ -621,11 +612,8 @@ ALIAS (no_districute_list_prefix, no_ipv "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") - -int -config_show_distribute (struct vty *vty) + "Filter outgoing routing updates\n" "Interface name\n") + int config_show_distribute (struct vty *vty) { unsigned int i; struct hash_backet *mp; @@ -645,7 +633,9 @@ config_show_distribute (struct vty *vty) vty_out (vty, "%s", VTY_NEWLINE); } else - vty_out (vty, " Outgoing update filter list for all interface is not set%s", VTY_NEWLINE); + vty_out (vty, + " Outgoing update filter list for all interface is not set%s", + VTY_NEWLINE); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -680,7 +670,9 @@ config_show_distribute (struct vty *vty) vty_out (vty, "%s", VTY_NEWLINE); } else - vty_out (vty, " Incoming update filter list for all interface is not set%s", VTY_NEWLINE); + vty_out (vty, + " Incoming update filter list for all interface is not set%s", + VTY_NEWLINE); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -721,8 +713,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list %s in %s%s", dist->list[DISTRIBUTE_IN], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -729,10 +720,8 @@ config_write_distribute (struct vty *vty if (dist->list[DISTRIBUTE_OUT]) { vty_out (vty, " distribute-list %s out %s%s", - dist->list[DISTRIBUTE_OUT], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -740,8 +729,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list prefix %s in %s%s", dist->prefix[DISTRIBUTE_IN], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -749,8 +737,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list prefix %s out %s%s", dist->prefix[DISTRIBUTE_OUT], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } } @@ -771,7 +758,8 @@ distribute_list_init (int node) disthash = hash_create ((unsigned int (*) (void *)) distribute_hash_make, (int (*) (void *, void *)) distribute_cmp); - if(node==RIP_NODE) { + if (node == RIP_NODE) + { install_element (RIP_NODE, &distribute_list_all_cmd); install_element (RIP_NODE, &no_distribute_list_all_cmd); install_element (RIP_NODE, &distribute_list_cmd); @@ -780,7 +768,9 @@ distribute_list_init (int node) install_element (RIP_NODE, &no_distribute_list_prefix_all_cmd); install_element (RIP_NODE, &distribute_list_prefix_cmd); install_element (RIP_NODE, &no_distribute_list_prefix_cmd); - } else { + } + else + { install_element (RIPNG_NODE, &ipv6_distribute_list_all_cmd); install_element (RIPNG_NODE, &no_ipv6_distribute_list_all_cmd); install_element (RIPNG_NODE, &ipv6_distribute_list_cmd); --- quagga-0.99.9/lib/distribute.h 2005-05-03 10:26:11.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/distribute.h 2008-04-16 11:55:47.000000000 -0700 @@ -51,7 +51,9 @@ extern struct distribute *distribute_loo extern int config_write_distribute (struct vty *); extern int config_show_distribute (struct vty *); -extern enum filter_type distribute_apply_in (struct interface *, struct prefix *); -extern enum filter_type distribute_apply_out (struct interface *, struct prefix *); +extern enum filter_type distribute_apply_in (struct interface *, + struct prefix *); +extern enum filter_type distribute_apply_out (struct interface *, + struct prefix *); #endif /* _ZEBRA_DISTRIBUTE_H */ --- quagga-0.99.9/lib/filter.c 2005-09-29 07:41:06.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/filter.c 2008-04-16 11:55:47.000000000 -0700 @@ -92,8 +92,7 @@ struct access_master }; /* Static structure for IPv4 access_list's master. */ -static struct access_master access_master_ipv4 = -{ +static struct access_master access_master_ipv4 = { {NULL, NULL}, {NULL, NULL}, NULL, @@ -102,8 +101,7 @@ static struct access_master access_maste #ifdef HAVE_IPV6 /* Static structure for IPv6 access_list's master. */ -static struct access_master access_master_ipv6 = -{ +static struct access_master access_master_ipv6 = { {NULL, NULL}, {NULL, NULL}, NULL, @@ -577,8 +575,7 @@ vty_access_list_remark_unset (struct vty access = access_list_lookup (afi, name); if (! access) { - vty_out (vty, "%% access-list %s doesn't exist%s", name, - VTY_NEWLINE); + vty_out (vty, "%% access-list %s doesn't exist%s", name, VTY_NEWLINE); return CMD_WARNING; } @@ -624,16 +621,14 @@ filter_set_cisco (struct vty *vty, const ret = inet_aton (addr_str, &addr); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } ret = inet_aton (addr_mask_str, &addr_mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } @@ -642,16 +637,14 @@ filter_set_cisco (struct vty *vty, const ret = inet_aton (mask_str, &mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } ret = inet_aton (mask_mask_str, &mask_mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } } @@ -702,9 +695,7 @@ DEFUN (access_list_standard, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n" - "Wildcard bits\n") + "Specify packets to forward\n" "Address to match\n" "Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], NULL, NULL, 0, 1); @@ -717,8 +708,7 @@ DEFUN (access_list_standard_nomask, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n") + "Specify packets to forward\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 1); @@ -732,8 +722,7 @@ DEFUN (access_list_standard_host, "IP standard access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "A single host address\n" - "Address to match\n") + "A single host address\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 1); @@ -746,8 +735,7 @@ DEFUN (access_list_standard_any, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any source host\n") + "Specify packets to forward\n" "Any source host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", NULL, NULL, 0, 1); @@ -761,9 +749,7 @@ DEFUN (no_access_list_standard, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n" - "Wildcard bits\n") + "Specify packets to forward\n" "Address to match\n" "Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], NULL, NULL, 0, 0); @@ -777,8 +763,7 @@ DEFUN (no_access_list_standard_nomask, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n") + "Specify packets to forward\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 0); @@ -793,8 +778,7 @@ DEFUN (no_access_list_standard_host, "IP standard access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "A single host address\n" - "Address to match\n") + "A single host address\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 0); @@ -808,8 +792,7 @@ DEFUN (no_access_list_standard_any, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any source host\n") + "Specify packets to forward\n" "Any source host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", NULL, NULL, 0, 0); @@ -827,8 +810,7 @@ DEFUN (access_list_extended, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], 1 ,1); @@ -843,13 +825,10 @@ DEFUN (access_list_extended_mask_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "Source address\n" - "Source wildcard bits\n" - "Any destination host\n") + "Source address\n" "Source wildcard bits\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], "0.0.0.0", - "255.255.255.255", 1, 1); + argv[3], "0.0.0.0", "255.255.255.255", 1, 1); } DEFUN (access_list_extended_any_mask, @@ -862,12 +841,10 @@ DEFUN (access_list_extended_any_mask, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - argv[3], 1, 1); + "255.255.255.255", argv[2], argv[3], 1, 1); } DEFUN (access_list_extended_any_any, @@ -878,9 +855,7 @@ DEFUN (access_list_extended_any_any, "IP extended access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Any Internet Protocol\n" - "Any source host\n" - "Any destination host\n") + "Any Internet Protocol\n" "Any source host\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", "0.0.0.0", @@ -898,12 +873,10 @@ DEFUN (access_list_extended_mask_host, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], argv[4], - "0.0.0.0", 1, 1); + argv[3], argv[4], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_host_mask, @@ -917,12 +890,10 @@ DEFUN (access_list_extended_host_mask, "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - argv[4], 1, 1); + "0.0.0.0", argv[3], argv[4], 1, 1); } DEFUN (access_list_extended_host_host, @@ -936,12 +907,10 @@ DEFUN (access_list_extended_host_host, "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - "0.0.0.0", 1, 1); + "0.0.0.0", argv[3], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_any_host, @@ -954,12 +923,10 @@ DEFUN (access_list_extended_any_host, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - "0.0.0.0", 1, 1); + "255.255.255.255", argv[2], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_host_any, @@ -971,13 +938,10 @@ DEFUN (access_list_extended_host_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "A single source host\n" - "Source address\n" - "Any destination host\n") + "A single source host\n" "Source address\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", "0.0.0.0", - "255.255.255.255", 1, 1); + "0.0.0.0", "0.0.0.0", "255.255.255.255", 1, 1); } DEFUN (no_access_list_extended, @@ -992,8 +956,7 @@ DEFUN (no_access_list_extended, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], 1, 0); @@ -1009,13 +972,10 @@ DEFUN (no_access_list_extended_mask_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "Source address\n" - "Source wildcard bits\n" - "Any destination host\n") + "Source address\n" "Source wildcard bits\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], "0.0.0.0", - "255.255.255.255", 1, 0); + argv[3], "0.0.0.0", "255.255.255.255", 1, 0); } DEFUN (no_access_list_extended_any_mask, @@ -1029,12 +989,10 @@ DEFUN (no_access_list_extended_any_mask, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - argv[3], 1, 0); + "255.255.255.255", argv[2], argv[3], 1, 0); } DEFUN (no_access_list_extended_any_any, @@ -1046,9 +1004,7 @@ DEFUN (no_access_list_extended_any_any, "IP extended access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Any Internet Protocol\n" - "Any source host\n" - "Any destination host\n") + "Any Internet Protocol\n" "Any source host\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", "0.0.0.0", @@ -1067,12 +1023,10 @@ DEFUN (no_access_list_extended_mask_host "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], argv[4], - "0.0.0.0", 1, 0); + argv[3], argv[4], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_host_mask, @@ -1087,12 +1041,10 @@ DEFUN (no_access_list_extended_host_mask "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - argv[4], 1, 0); + "0.0.0.0", argv[3], argv[4], 1, 0); } DEFUN (no_access_list_extended_host_host, @@ -1107,12 +1059,10 @@ DEFUN (no_access_list_extended_host_host "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - "0.0.0.0", 1, 0); + "0.0.0.0", argv[3], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_any_host, @@ -1126,12 +1076,10 @@ DEFUN (no_access_list_extended_any_host, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - "0.0.0.0", 1, 0); + "255.255.255.255", argv[2], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_host_any, @@ -1144,13 +1092,10 @@ DEFUN (no_access_list_extended_host_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "A single source host\n" - "Source address\n" - "Any destination host\n") + "A single source host\n" "Source address\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", "0.0.0.0", - "255.255.255.255", 1, 0); + "0.0.0.0", "0.0.0.0", "255.255.255.255", 1, 0); } static int @@ -1241,8 +1186,7 @@ DEFUN (access_list, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 0, 1); } @@ -1254,8 +1198,7 @@ DEFUN (access_list_exact, "IP zebra access-list name\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n" - "Exact match of the prefixes\n") + "Prefix to match. e.g. 10.0.0.0/8\n" "Exact match of the prefixes\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 1, 1); } @@ -1266,8 +1209,7 @@ DEFUN (access_list_any, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, "0.0.0.0/0", 0, 1); } @@ -1279,8 +1221,7 @@ DEFUN (no_access_list, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 0, 0); } @@ -1293,8 +1234,7 @@ DEFUN (no_access_list_exact, "IP zebra access-list name\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n" - "Exact match of the prefixes\n") + "Prefix to match. e.g. 10.0.0.0/8\n" "Exact match of the prefixes\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 1, 0); } @@ -1306,8 +1246,7 @@ DEFUN (no_access_list_any, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, "0.0.0.0/0", 0, 0); } @@ -1356,8 +1295,7 @@ DEFUN (access_list_remark, "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" "IP zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") { struct access_list *access; @@ -1382,8 +1320,7 @@ DEFUN (no_access_list_remark, "IP extended access list\n" "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" - "IP zebra access-list\n" - "Access list entry comment\n") + "IP zebra access-list\n" "Access list entry comment\n") { return vty_access_list_remark_unset (vty, AFI_IP, argv[0]); } @@ -1398,9 +1335,7 @@ ALIAS (no_access_list_remark, "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" "IP zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") - + "Access list entry comment\n" "Comment up to 100 characters\n") #ifdef HAVE_IPV6 DEFUN (ipv6_access_list, ipv6_access_list_cmd, @@ -1409,8 +1344,7 @@ DEFUN (ipv6_access_list, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 3ffe:506::/32\n") + "Specify packets to forward\n" "Prefix to match. e.g. 3ffe:506::/32\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, argv[2], 0, 1); } @@ -1436,8 +1370,7 @@ DEFUN (ipv6_access_list_any, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any prefixi to match\n") + "Specify packets to forward\n" "Any prefixi to match\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, "::/0", 0, 1); } @@ -1450,8 +1383,7 @@ DEFUN (no_ipv6_access_list, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 3ffe:506::/32\n") + "Specify packets to forward\n" "Prefix to match. e.g. 3ffe:506::/32\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, argv[2], 0, 0); } @@ -1479,8 +1411,7 @@ DEFUN (no_ipv6_access_list_any, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any prefixi to match\n") + "Specify packets to forward\n" "Any prefixi to match\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, "::/0", 0, 0); } @@ -1490,9 +1421,7 @@ DEFUN (no_ipv6_access_list_all, no_ipv6_access_list_all_cmd, "no ipv6 access-list WORD", NO_STR - IPV6_STR - "Add an access list entry\n" - "IPv6 zebra access-list\n") + IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n") { struct access_list *access; struct access_master *master; @@ -1524,8 +1453,7 @@ DEFUN (ipv6_access_list_remark, IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") { struct access_list *access; @@ -1547,8 +1475,7 @@ DEFUN (no_ipv6_access_list_remark, NO_STR IPV6_STR "Add an access list entry\n" - "IPv6 zebra access-list\n" - "Access list entry comment\n") + "IPv6 zebra access-list\n" "Access list entry comment\n") { return vty_access_list_remark_unset (vty, AFI_IP6, argv[0]); } @@ -1560,10 +1487,8 @@ ALIAS (no_ipv6_access_list_remark, IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") #endif /* HAVE_IPV6 */ - void config_write_access_zebra (struct vty *, struct filter *); void config_write_access_cisco (struct vty *, struct filter *); @@ -1568,8 +1493,7 @@ void config_write_access_zebra (struct v void config_write_access_cisco (struct vty *, struct filter *); /* show access-list command. */ -static int -filter_show (struct vty *vty, const char *name, afi_t afi) + static int filter_show (struct vty *vty, const char *name, afi_t afi) { struct access_list *access; struct access_master *master; @@ -1602,8 +1526,7 @@ filter_show (struct vty *vty, const char vty_out (vty, "%s IP%s access list %s%s", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", - afi == AFI_IP6 ? "v6" : "", - access->name, VTY_NEWLINE); + afi == AFI_IP6 ? "v6" : "", access->name, VTY_NEWLINE); write = 0; } @@ -1622,7 +1545,8 @@ filter_show (struct vty *vty, const char { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) - vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); + vty_out (vty, ", wildcard bits %s", + inet_ntoa (filter->addr_mask)); vty_out (vty, "%s", VTY_NEWLINE); } } @@ -1645,8 +1569,7 @@ filter_show (struct vty *vty, const char vty_out (vty, "%s IP%s access list %s%s", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", - afi == AFI_IP6 ? "v6" : "", - access->name, VTY_NEWLINE); + afi == AFI_IP6 ? "v6" : "", access->name, VTY_NEWLINE); write = 0; } @@ -1665,7 +1588,8 @@ filter_show (struct vty *vty, const char { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) - vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); + vty_out (vty, ", wildcard bits %s", + inet_ntoa (filter->addr_mask)); vty_out (vty, "%s", VTY_NEWLINE); } } @@ -1676,10 +1600,7 @@ filter_show (struct vty *vty, const char DEFUN (show_ip_access_list, show_ip_access_list_cmd, - "show ip access-list", - SHOW_STR - IP_STR - "List IP access lists\n") + "show ip access-list", SHOW_STR IP_STR "List IP access lists\n") { return filter_show (vty, NULL, AFI_IP); } @@ -1693,8 +1614,7 @@ DEFUN (show_ip_access_list_name, "IP standard access list\n" "IP extended access list\n" "IP standard access list (expanded range)\n" - "IP extended access list (expanded range)\n" - "IP zebra access-list\n") + "IP extended access list (expanded range)\n" "IP zebra access-list\n") { return filter_show (vty, argv[0], AFI_IP); } @@ -1702,10 +1622,7 @@ DEFUN (show_ip_access_list_name, #ifdef HAVE_IPV6 DEFUN (show_ipv6_access_list, show_ipv6_access_list_cmd, - "show ipv6 access-list", - SHOW_STR - IPV6_STR - "List IPv6 access lists\n") + "show ipv6 access-list", SHOW_STR IPV6_STR "List IPv6 access lists\n") { return filter_show (vty, NULL, AFI_IP6); } @@ -1714,9 +1631,7 @@ DEFUN (show_ipv6_access_list_name, show_ipv6_access_list_name_cmd, "show ipv6 access-list WORD", SHOW_STR - IPV6_STR - "List IPv6 access lists\n" - "IPv6 zebra access-list\n") + IPV6_STR "List IPv6 access lists\n" "IPv6 zebra access-list\n") { return filter_show (vty, argv[0], AFI_IP6); } @@ -1782,8 +1697,7 @@ config_write_access_zebra (struct vty *v else vty_out (vty, " %s/%d%s", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), - p->prefixlen, - filter->exact ? " exact-match" : ""); + p->prefixlen, filter->exact ? " exact-match" : ""); vty_out (vty, "%s", VTY_NEWLINE); } @@ -1806,8 +1720,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s remark %s%s", afi == AFI_IP ? "" : "ipv6 ", - access->name, access->remark, - VTY_NEWLINE); + access->name, access->remark, VTY_NEWLINE); write++; } @@ -1815,8 +1728,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s %s", afi == AFI_IP ? "" : "ipv6 ", - access->name, - filter_type_str (mfilter)); + access->name, filter_type_str (mfilter)); if (mfilter->cisco) config_write_access_cisco (vty, mfilter); @@ -1833,8 +1745,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s remark %s%s", afi == AFI_IP ? "" : "ipv6 ", - access->name, access->remark, - VTY_NEWLINE); + access->name, access->remark, VTY_NEWLINE); write++; } @@ -1842,8 +1753,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s %s", afi == AFI_IP ? "" : "ipv6 ", - access->name, - filter_type_str (mfilter)); + access->name, filter_type_str (mfilter)); if (mfilter->cisco) config_write_access_cisco (vty, mfilter); @@ -1857,8 +1767,7 @@ config_write_access (struct vty *vty, af } /* Access-list node. */ -struct cmd_node access_node = -{ +struct cmd_node access_node = { ACCESS_NODE, "", /* Access list has no interface. */ 1 @@ -1953,8 +1862,7 @@ access_list_init_ipv4 (void) } #ifdef HAVE_IPV6 -struct cmd_node access_ipv6_node = -{ +struct cmd_node access_ipv6_node = { ACCESS_IPV6_NODE, "", 1 --- quagga-0.99.9/lib/getopt1.c 2005-05-15 07:32:03.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/getopt1.c 2008-04-16 11:55:47.000000000 -0700 @@ -112,8 +112,7 @@ main (argc, argv) { int this_option_optind = optind ? optind : 1; int option_index = 0; - static struct option long_options[] = - { + static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, --- quagga-0.99.9/lib/getopt.c 2005-08-13 03:55:48.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/getopt.c 2008-04-16 11:55:47.000000000 -0700 @@ -270,8 +270,7 @@ static char *const *original_argv; is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) + __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ @@ -638,7 +638,9 @@ _getopt_internal (argc, argv, optstring, if (longopts != NULL && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + || (long_only + && (argv[optind][2] + || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; @@ -704,12 +706,14 @@ _getopt_internal (argc, argv, optstring, if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), + _ + ("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), + _ + ("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } @@ -786,11 +790,9 @@ _getopt_internal (argc, argv, optstring, { if (posixly_correct) /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; @@ -837,7 +839,8 @@ _getopt_internal (argc, argv, optstring, /* optarg is now the argument, see if it's in the table of longopts. */ - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + for (nextchar = nameend = optarg; *nameend && *nameend != '='; + nameend++) /* Do nothing. */ ; /* Test all long options for either exact match @@ -885,8 +888,7 @@ _getopt_internal (argc, argv, optstring, { if (opterr) fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); +%s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; @@ -978,9 +980,7 @@ getopt (argc, argv, optstring) const char *optstring; { return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); + (const struct option *) 0, (int *) 0, 0); } #endif /* REALLY_NEED_PLAIN_GETOPT */ --- quagga-0.99.9/lib/getopt.h 2005-08-13 03:55:48.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/getopt.h 2008-04-16 11:55:47.000000000 -0700 @@ -35,7 +35,8 @@ */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* For communication from `getopt' to the caller. --- quagga-0.99.9/lib/if.c 2006-12-12 14:12:06.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/if.c 2008-04-16 11:55:47.000000000 -0700 @@ -36,6 +35,8 @@ #include "str.h" #include "log.h" + + /* Master list of interfaces. */ struct list *iflist; @@ -65,7 +66,8 @@ if_cmp_func (struct interface *ifp1, str p1 = ifp1->name; p2 = ifp2->name; - while (*p1 && *p2) { + while (*p1 && *p2) + { /* look up to any number */ l1 = strcspn(p1, "0123456789"); l2 = strcspn(p2, "0123456789"); @@ -164,7 +167,8 @@ if_delete (struct interface *ifp) void if_add_hook (int type, int (*func)(struct interface *ifp)) { - switch (type) { + switch (type) + { case IF_NEW_HOOK: if_master.if_new_hook = func; break; @@ -196,8 +200,7 @@ ifindex2ifname (unsigned int index) { struct interface *ifp; - return ((ifp = if_lookup_by_index(index)) != NULL) ? - ifp->name : "unknown"; + return ((ifp = if_lookup_by_index (index)) != NULL) ? ifp->name : "unknown"; } unsigned int @@ -266,6 +269,33 @@ if_lookup_exact_address (struct in_addr return NULL; } +/* Lookup interface by IPv6 address. */ +struct interface * +if_lookup_exact_address_ipv6 (struct in6_addr src) +{ + struct listnode *node; + struct listnode *cnode; + struct interface *ifp; + struct prefix *p; + struct connected *c; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) + { + p = c->address; + + if (p && p->family == AF_INET6) + { + if (IPV6_ADDR_SAME (&p->u.prefix6, &src)) + return ifp; + } + } + } + return NULL; +} + + /* Lookup interface by IPv4 address. */ struct interface * if_lookup_address (struct in_addr src) @@ -340,7 +370,8 @@ int if_is_operative (struct interface *ifp) { return ((ifp->flags & IFF_UP) && - (ifp->flags & IFF_RUNNING || !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION))); + (ifp->flags & IFF_RUNNING + || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_LINKDETECTION))); } /* Is this loopback interface ? */ @@ -431,8 +462,7 @@ if_dump (struct interface *ifp) #ifdef HAVE_IPV6 "mtu6 %d " #endif /* HAVE_IPV6 */ - "%s", - ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, + "%s", ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, #ifdef HAVE_IPV6 ifp->mtu6, #endif /* HAVE_IPV6 */ @@ -474,9 +504,7 @@ DEFUN (interface_desc, DEFUN (no_interface_desc, no_interface_desc_cmd, - "no description", - NO_STR - "Interface specific description\n") + "no description", NO_STR "Interface specific description\n") { struct interface *ifp; @@ -533,8 +561,7 @@ if_sunwzebra_get (const char *name, size DEFUN (interface, interface_cmd, "interface IFNAME", - "Select an interface to configure\n" - "Interface's name\n") + "Select an interface to configure\n" "Interface's name\n") { struct interface *ifp; size_t sl; @@ -542,8 +569,7 @@ DEFUN (interface, if ((sl = strlen(argv[0])) > INTERFACE_NAMSIZ) { vty_out (vty, "%% Interface name %s is invalid: length exceeds " - "%d characters%s", - argv[0], INTERFACE_NAMSIZ, VTY_NEWLINE); + "%d characters%s", argv[0], INTERFACE_NAMSIZ, VTY_NEWLINE); return CMD_WARNING; } @@ -590,11 +616,7 @@ DEFUN_NOSH (no_interface, } /* For debug purpose. */ -DEFUN (show_address, - show_address_cmd, - "show address", - SHOW_STR - "address\n") +DEFUN (show_address, show_address_cmd, "show address", SHOW_STR "address\n") { struct listnode *node; struct listnode *node2; @@ -620,7 +642,8 @@ DEFUN (show_address, struct connected * connected_new (void) { - struct connected *new = XMALLOC (MTYPE_CONNECTED, sizeof (struct connected)); + struct connected *new = + XMALLOC (MTYPE_CONNECTED, sizeof (struct connected)); memset (new, 0, sizeof (struct connected)); return new; } @@ -655,8 +678,7 @@ connected_log (struct connected *connect snprintf (logbuf, BUFSIZ, "%s interface %s %s %s/%d ", str, ifp->name, prefix_family_str (p), - inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), - p->prefixlen); + inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); p = connected->destination; if (p) @@ -765,8 +787,11 @@ if_nametoindex (const char *name) { struct interface *ifp; - return ((ifp = if_lookup_by_name_len(name, strnlen(name, IFNAMSIZ))) != NULL) - ? ifp->ifindex : 0; + return ((ifp = + if_lookup_by_name_len (name, + strnlen (name, + IFNAMSIZ))) != + NULL) ? ifp->ifindex : 0; } #endif @@ -871,7 +896,8 @@ if_init (void) ifaddr_ipv4_table = route_table_init (); #endif /* ifaddr_ipv4_table */ - if (iflist) { + if (iflist) + { iflist->cmp = (int (*)(void *, void *))if_cmp_func; return; } --- quagga-0.99.9/lib/if.h 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/if.h 2008-04-16 11:55:47.000000000 -0700 @@ -233,6 +235,7 @@ extern int if_cmp_func (struct interface extern struct interface *if_create (const char *name, int namelen); extern struct interface *if_lookup_by_index (unsigned int); extern struct interface *if_lookup_exact_address (struct in_addr); +extern struct interface *if_lookup_exact_address_ipv6 (struct in6_addr); extern struct interface *if_lookup_address (struct in_addr); /* These 2 functions are to be used when the ifname argument is terminated @@ -245,7 +248,8 @@ extern struct interface *if_get_by_name In most cases, strnlen should be used to calculate the namelen value. */ extern struct interface *if_lookup_by_name_len(const char *ifname, size_t namelen); -extern struct interface *if_get_by_name_len(const char *ifname, size_t namelen); +extern struct interface *if_get_by_name_len (const char *ifname, + size_t namelen); /* Delete the interface, but do not free the structure, and leave it in the --- quagga-0.99.9/lib/if_rmap.c 2005-10-25 22:05:45.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/if_rmap.c 2008-04-16 11:55:47.000000000 -0700 @@ -209,8 +209,7 @@ DEFUN (if_rmap, "Route map set\n" "Route map name\n" "Route map set for input filtering\n" - "Route map set for output filtering\n" - "Route map interface name\n") + "Route map set for output filtering\n" "Route map interface name\n") { enum if_rmap_type type; struct if_rmap *if_rmap; @@ -246,8 +244,7 @@ DEFUN (no_if_rmap, "Route map unset\n" "Route map name\n" "Route map for input filtering\n" - "Route map for output filtering\n" - "Route map interface name\n") + "Route map for output filtering\n" "Route map interface name\n") { int ret; enum if_rmap_type type; @@ -271,19 +268,15 @@ DEFUN (no_if_rmap, return CMD_SUCCESS; } -ALIAS (no_if_rmap, - no_if_ipv6_rmap_cmd, +ALIAS (no_if_rmap, no_if_ipv6_rmap_cmd, "no route-map ROUTEMAP_NAME (in|out) IFNAME", NO_STR "Route map unset\n" "Route map name\n" "Route map for input filtering\n" - "Route map for output filtering\n" - "Route map interface name\n") - + "Route map for output filtering\n" "Route map interface name\n") /* Configuration write function. */ -int -config_write_if_rmap (struct vty *vty) + int config_write_if_rmap (struct vty *vty) { unsigned int i; struct hash_backet *mp; @@ -300,8 +293,7 @@ config_write_if_rmap (struct vty *vty) { vty_out (vty, " route-map %s in %s%s", if_rmap->routemap[IF_RMAP_IN], - if_rmap->ifname, - VTY_NEWLINE); + if_rmap->ifname, VTY_NEWLINE); write++; } @@ -309,8 +301,7 @@ config_write_if_rmap (struct vty *vty) { vty_out (vty, " route-map %s out %s%s", if_rmap->routemap[IF_RMAP_OUT], - if_rmap->ifname, - VTY_NEWLINE); + if_rmap->ifname, VTY_NEWLINE); write++; } } @@ -327,10 +318,13 @@ void if_rmap_init (int node) { ifrmaphash = hash_create (if_rmap_hash_make, if_rmap_hash_cmp); - if (node == RIPNG_NODE) { + if (node == RIPNG_NODE) + { install_element (RIPNG_NODE, &if_ipv6_rmap_cmd); install_element (RIPNG_NODE, &no_if_ipv6_rmap_cmd); - } else if (node == RIP_NODE) { + } + else if (node == RIP_NODE) + { install_element (RIP_NODE, &if_rmap_cmd); install_element (RIP_NODE, &no_if_rmap_cmd); } --- quagga-0.99.9/lib/jhash.h 2005-05-03 12:06:44.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/jhash.h 2008-04-16 11:55:47.000000000 -0700 @@ -37,7 +37,8 @@ extern u_int32_t jhash2(u_int32_t *k, u_ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally * done at the end is not done here. */ -extern u_int32_t jhash_3words(u_int32_t a, u_int32_t b, u_int32_t c, u_int32_t initval); +extern u_int32_t jhash_3words (u_int32_t a, u_int32_t b, u_int32_t c, + u_int32_t initval); extern u_int32_t jhash_2words(u_int32_t a, u_int32_t b, u_int32_t initval); extern u_int32_t jhash_1word(u_int32_t a, u_int32_t initval); --- quagga-0.99.9/lib/keychain.c 2005-05-03 11:13:23.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/keychain.c 2008-04-16 11:55:47.000000000 -0700 @@ -237,8 +237,7 @@ DEFUN (key_chain, key_chain_cmd, "key chain WORD", "Authentication key management\n" - "Key-chain management\n" - "Key-chain name\n") + "Key-chain management\n" "Key-chain name\n") { struct keychain *keychain; @@ -254,8 +253,7 @@ DEFUN (no_key_chain, "no key chain WORD", NO_STR "Authentication key management\n" - "Key-chain management\n" - "Key-chain name\n") + "Key-chain management\n" "Key-chain name\n") { struct keychain *keychain; @@ -274,9 +272,7 @@ DEFUN (no_key_chain, DEFUN (key, key_cmd, - "key <0-2147483647>", - "Configure a key\n" - "Key identifier number\n") + "key <0-2147483647>", "Configure a key\n" "Key identifier number\n") { struct keychain *keychain; struct key *key; @@ -295,9 +291,7 @@ DEFUN (key, DEFUN (no_key, no_key_cmd, "no key <0-2147483647>", - NO_STR - "Delete a key\n" - "Key identifier number\n") + NO_STR "Delete a key\n" "Key identifier number\n") { struct keychain *keychain; struct key *key; @@ -321,10 +315,7 @@ DEFUN (no_key, } DEFUN (key_string, - key_string_cmd, - "key-string LINE", - "Set key string\n" - "The key\n") + key_string_cmd, "key-string LINE", "Set key string\n" "The key\n") { struct key *key; @@ -339,10 +330,7 @@ DEFUN (key_string, DEFUN (no_key_string, no_key_string_cmd, - "no key-string [LINE]", - NO_STR - "Unset key string\n" - "The key\n") + "no key-string [LINE]", NO_STR "Unset key string\n" "The key\n") { struct key *key; @@ -360,8 +348,8 @@ DEFUN (no_key_string, /* Convert HH:MM:SS MON DAY YEAR to time_t value. -1 is returned when given string is malformed. */ static time_t -key_str2time (const char *time_str, const char *day_str, const char *month_str, - const char *year_str) +key_str2time (const char *time_str, const char *day_str, + const char *month_str, const char *year_str) { int i = 0; char *colon; @@ -370,8 +358,7 @@ key_str2time (const char *time_str, cons unsigned int sec, min, hour; unsigned int day, month, year; - const char *month_name[] = - { + const char *month_name[] = { "January", "February", "March", @@ -484,7 +471,8 @@ key_lifetime_set (struct vty *vty, struc if (time_end <= time_start) { - vty_out (vty, "Expire time is not later than start time%s", VTY_NEWLINE); + vty_out (vty, "Expire time is not later than start time%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -548,8 +536,7 @@ DEFUN (accept_lifetime_day_month_day_mon "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; @@ -569,8 +556,7 @@ DEFUN (accept_lifetime_day_month_month_d "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; @@ -590,8 +576,7 @@ DEFUN (accept_lifetime_month_day_day_mon "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; @@ -611,8 +596,7 @@ DEFUN (accept_lifetime_month_day_month_d "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; @@ -628,9 +612,7 @@ DEFUN (accept_lifetime_infinite_day_mont "Set accept lifetime of the key\n" "Time to start\n" "Day of th month to start\n" - "Month of the year to start\n" - "Year to start\n" - "Never expires") + "Month of the year to start\n" "Year to start\n" "Never expires") { struct key *key; @@ -646,9 +628,7 @@ DEFUN (accept_lifetime_infinite_month_da "Set accept lifetime of the key\n" "Time to start\n" "Month of the year to start\n" - "Day of th month to start\n" - "Year to start\n" - "Never expires") + "Day of th month to start\n" "Year to start\n" "Never expires") { struct key *key; @@ -665,9 +645,7 @@ DEFUN (accept_lifetime_duration_day_mont "Time to start\n" "Day of th month to start\n" "Month of the year to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; @@ -684,9 +662,7 @@ DEFUN (accept_lifetime_duration_month_da "Time to start\n" "Month of the year to start\n" "Day of th month to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; @@ -706,15 +682,14 @@ DEFUN (send_lifetime_day_month_day_month "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], argv[3], - argv[4], argv[5], argv[6], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], + argv[3], argv[4], argv[5], argv[6], argv[7]); } DEFUN (send_lifetime_day_month_month_day, @@ -727,15 +702,14 @@ DEFUN (send_lifetime_day_month_month_day "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], argv[3], - argv[4], argv[6], argv[5], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], + argv[3], argv[4], argv[6], argv[5], argv[7]); } DEFUN (send_lifetime_month_day_day_month, @@ -748,15 +722,14 @@ DEFUN (send_lifetime_month_day_day_month "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], argv[3], - argv[4], argv[5], argv[6], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], + argv[3], argv[4], argv[5], argv[6], argv[7]); } DEFUN (send_lifetime_month_day_month_day, @@ -769,15 +742,14 @@ DEFUN (send_lifetime_month_day_month_day "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], argv[3], - argv[4], argv[6], argv[5], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], + argv[3], argv[4], argv[6], argv[5], argv[7]); } DEFUN (send_lifetime_infinite_day_month, @@ -786,16 +758,14 @@ DEFUN (send_lifetime_infinite_day_month, "Set send lifetime of the key\n" "Time to start\n" "Day of th month to start\n" - "Month of the year to start\n" - "Year to start\n" - "Never expires") + "Month of the year to start\n" "Year to start\n" "Never expires") { struct key *key; key = vty->index_sub; - return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[1], argv[2], - argv[3]); + return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[1], + argv[2], argv[3]); } DEFUN (send_lifetime_infinite_month_day, @@ -804,16 +774,14 @@ DEFUN (send_lifetime_infinite_month_day, "Set send lifetime of the key\n" "Time to start\n" "Month of the year to start\n" - "Day of th month to start\n" - "Year to start\n" - "Never expires") + "Day of th month to start\n" "Year to start\n" "Never expires") { struct key *key; key = vty->index_sub; - return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[2], argv[1], - argv[3]); + return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[2], + argv[1], argv[3]); } DEFUN (send_lifetime_duration_day_month, @@ -823,16 +791,14 @@ DEFUN (send_lifetime_duration_day_month, "Time to start\n" "Day of th month to start\n" "Month of the year to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; key = vty->index_sub; - return key_lifetime_duration_set (vty, &key->send, argv[0], argv[1], argv[2], - argv[3], argv[4]); + return key_lifetime_duration_set (vty, &key->send, argv[0], argv[1], + argv[2], argv[3], argv[4]); } DEFUN (send_lifetime_duration_month_day, @@ -842,27 +808,23 @@ DEFUN (send_lifetime_duration_month_day, "Time to start\n" "Month of the year to start\n" "Day of th month to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; key = vty->index_sub; - return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], argv[1], - argv[3], argv[4]); + return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], + argv[1], argv[3], argv[4]); } -struct cmd_node keychain_node = -{ +struct cmd_node keychain_node = { KEYCHAIN_NODE, "%s(config-keychain)# ", 1 }; -struct cmd_node keychain_key_node = -{ +struct cmd_node keychain_key_node = { KEYCHAIN_KEY_NODE, "%s(config-keychain-key)# ", 1 @@ -927,7 +889,8 @@ keychain_config_write (struct vty *vty) if (key->send.end == -1) vty_out (vty, " infinite"); else if (key->send.duration) - vty_out (vty, " duration %ld", (long)(key->send.end - key->send.start)); + vty_out (vty, " duration %ld", + (long) (key->send.end - key->send.start)); else { keychain_strftime (buf, BUFSIZ, &key->send.end); @@ -970,14 +933,22 @@ keychain_init () install_element (KEYCHAIN_KEY_NODE, &key_cmd); install_element (KEYCHAIN_KEY_NODE, &no_key_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_day_month_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_day_month_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_month_day_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_month_day_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_infinite_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_infinite_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_duration_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_duration_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_day_month_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_day_month_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_month_day_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_month_day_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_infinite_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_infinite_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_duration_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_duration_month_day_cmd); install_element (KEYCHAIN_KEY_NODE, &send_lifetime_day_month_day_month_cmd); install_element (KEYCHAIN_KEY_NODE, &send_lifetime_day_month_month_day_cmd); --- quagga-0.99.9/lib/keychain.h 2005-05-03 10:51:36.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/keychain.h 2008-04-16 11:55:47.000000000 -0700 @@ -50,7 +50,8 @@ struct key extern void keychain_init (void); extern struct keychain *keychain_lookup (const char *); extern struct key *key_lookup_for_accept (const struct keychain *, u_int32_t); -extern struct key *key_match_for_accept (const struct keychain *, const char *); +extern struct key *key_match_for_accept (const struct keychain *, + const char *); extern struct key *key_lookup_for_send (const struct keychain *); #endif /* _ZEBRA_KEYCHAIN_H */ --- quagga-0.99.9/lib/linklist.h 2005-05-03 12:07:24.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/linklist.h 2008-04-16 11:55:47.000000000 -0700 @@ -100,9 +101,9 @@ extern void list_add_list (struct list * * of previous macro. */ #define ALL_LIST_ELEMENTS_RO(list,node,data) \ - (node) = listhead(list); \ - (node) != NULL && ((data) = listgetdata(node), 1); \ - (node) = listnextnode(node) + (node) = (typeof(node))listhead(list); \ + (node) != NULL && ((data) = (typeof(data))listgetdata(node), 1); \ + (node) = (typeof(node))listnextnode(node) /* these *do not* cleanup list nodes and referenced data, as the functions * do - these macros simply {de,at}tach a listnode from/to a list. --- quagga-0.99.9/lib/log.h 2007-04-29 05:40:40.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/log.h 2008-04-16 11:55:47.000000000 -0700 @@ -111,13 +111,16 @@ extern void closezlog (struct zlog *zl); #endif /* __GNUC__ */ /* Generic function for zlog. */ -extern void zlog (struct zlog *zl, int priority, const char *format, ...) PRINTF_ATTRIBUTE(3, 4); +extern void +zlog (struct zlog *zl, int priority, const char *format, ...) +PRINTF_ATTRIBUTE (3, 4); /* Handy zlog functions. */ extern void zlog_err (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); extern void zlog_warn (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); extern void zlog_info (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); -extern void zlog_notice (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); + extern void zlog_notice (const char *format, ...) PRINTF_ATTRIBUTE (1, + 2); extern void zlog_debug (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); /* For bgpd's peer oriented log. */ @@ -134,7 +137,8 @@ extern void plog_debug (struct zlog *, c extern void zlog_set_level (struct zlog *zl, zlog_dest_t, int log_level); /* Set logging to the given filename at the specified level. */ -extern int zlog_set_file (struct zlog *zl, const char *filename, int log_level); + extern int zlog_set_file (struct zlog *zl, const char *filename, + int log_level); /* Disable file logging. */ extern int zlog_reset_file (struct zlog *zl); @@ -145,7 +149,8 @@ extern int zlog_rotate (struct zlog *); #define LOOKUP(x, y) mes_lookup(x, x ## _max, y) extern const char *lookup (struct message *, int); -extern const char *mes_lookup (struct message *meslist, int max, int index); + extern const char *mes_lookup (struct message *meslist, int max, + int index); extern const char *zlog_priority[]; extern const char *zlog_proto_names[]; @@ -175,11 +180,13 @@ extern void zlog_backtrace_sigsafe(int p It caches the most recent localtime result and can therefore avoid multiple calls within the same second. If buflen is too small, *buf will be set to '\0', and 0 will be returned. */ -extern size_t quagga_timestamp(int timestamp_precision /* # subsecond digits */, + extern size_t quagga_timestamp (int timestamp_precision + /* # subsecond digits */ , char *buf, size_t buflen); /* structure useful for avoiding repeated rendering of the same timestamp */ -struct timestamp_control { + struct timestamp_control + { size_t len; /* length of rendered timestamp */ int precision; /* configuration parameter */ int already_rendered; /* should be initialized to 0 */ --- quagga-0.99.9/lib/md5.c 2006-01-31 12:55:52.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/md5.c 2008-04-16 11:55:47.000000000 -0700 @@ -135,7 +135,8 @@ static const uint8_t md5_paddat[MD5_BUFL static void md5_calc (const uint8_t *, md5_ctxt *); -void md5_init(md5_ctxt *ctxt) +void +md5_init (md5_ctxt * ctxt) { ctxt->md5_n = 0; ctxt->md5_i = 0; @@ -146,7 +147,8 @@ void md5_init(md5_ctxt *ctxt) memset (ctxt->md5_buf, 0, sizeof(ctxt->md5_buf)); } -void md5_loop(md5_ctxt *ctxt, const void *vinput, uint len) +void +md5_loop (md5_ctxt * ctxt, const void *vinput, uint len) { uint gap, i; const uint8_t *input = vinput; @@ -154,32 +156,40 @@ void md5_loop(md5_ctxt *ctxt, const void ctxt->md5_n += len * 8; /* byte to bit */ gap = MD5_BUFLEN - ctxt->md5_i; - if (len >= gap) { + if (len >= gap) + { memcpy (ctxt->md5_buf + ctxt->md5_i, input, gap); md5_calc(ctxt->md5_buf, ctxt); - for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) { + for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) + { md5_calc((input + i), ctxt); } ctxt->md5_i = len - i; memcpy (ctxt->md5_buf, (input + i), ctxt->md5_i); - } else { + } + else + { memcpy (ctxt->md5_buf + ctxt->md5_i, input, len); ctxt->md5_i += len; } } -void md5_pad(md5_ctxt *ctxt) +void +md5_pad (md5_ctxt * ctxt) { uint gap; /* Don't count up padding. Keep md5_n. */ gap = MD5_BUFLEN - ctxt->md5_i; - if (gap > 8) { + if (gap > 8) + { memcpy (ctxt->md5_buf + ctxt->md5_i, md5_paddat, gap - sizeof(ctxt->md5_n)); - } else { + } + else + { /* including gap == 8 */ memcpy (ctxt->md5_buf + ctxt->md5_i, md5_paddat, gap); md5_calc (ctxt->md5_buf, ctxt); @@ -204,25 +214,35 @@ void md5_pad(md5_ctxt *ctxt) md5_calc(ctxt->md5_buf, ctxt); } -void md5_result(uint8_t *digest, md5_ctxt *ctxt) +void +md5_result (uint8_t * digest, md5_ctxt * ctxt) { /* 4 byte words */ if (BYTE_ORDER == LITTLE_ENDIAN) memcpy (digest, &ctxt->md5_st8[0], 16); else if (BYTE_ORDER == BIG_ENDIAN) { - digest[ 0] = ctxt->md5_st8[ 3]; digest[ 1] = ctxt->md5_st8[ 2]; - digest[ 2] = ctxt->md5_st8[ 1]; digest[ 3] = ctxt->md5_st8[ 0]; - digest[ 4] = ctxt->md5_st8[ 7]; digest[ 5] = ctxt->md5_st8[ 6]; - digest[ 6] = ctxt->md5_st8[ 5]; digest[ 7] = ctxt->md5_st8[ 4]; - digest[ 8] = ctxt->md5_st8[11]; digest[ 9] = ctxt->md5_st8[10]; - digest[10] = ctxt->md5_st8[ 9]; digest[11] = ctxt->md5_st8[ 8]; - digest[12] = ctxt->md5_st8[15]; digest[13] = ctxt->md5_st8[14]; - digest[14] = ctxt->md5_st8[13]; digest[15] = ctxt->md5_st8[12]; + digest[0] = ctxt->md5_st8[3]; + digest[1] = ctxt->md5_st8[2]; + digest[2] = ctxt->md5_st8[1]; + digest[3] = ctxt->md5_st8[0]; + digest[4] = ctxt->md5_st8[7]; + digest[5] = ctxt->md5_st8[6]; + digest[6] = ctxt->md5_st8[5]; + digest[7] = ctxt->md5_st8[4]; + digest[8] = ctxt->md5_st8[11]; + digest[9] = ctxt->md5_st8[10]; + digest[10] = ctxt->md5_st8[9]; + digest[11] = ctxt->md5_st8[8]; + digest[12] = ctxt->md5_st8[15]; + digest[13] = ctxt->md5_st8[14]; + digest[14] = ctxt->md5_st8[13]; + digest[15] = ctxt->md5_st8[12]; } } -static void md5_calc(const uint8_t *b64, md5_ctxt * ctxt) +static void +md5_calc (const uint8_t * b64, md5_ctxt * ctxt) { uint32_t A = ctxt->md5_sta; uint32_t B = ctxt->md5_stb; @@ -238,59 +258,139 @@ static void md5_calc(const uint8_t *b64, /* 4 byte words */ /* what a brute force but fast! */ uint8_t *y = (uint8_t *)X; - y[ 0] = b64[ 3]; y[ 1] = b64[ 2]; y[ 2] = b64[ 1]; y[ 3] = b64[ 0]; - y[ 4] = b64[ 7]; y[ 5] = b64[ 6]; y[ 6] = b64[ 5]; y[ 7] = b64[ 4]; - y[ 8] = b64[11]; y[ 9] = b64[10]; y[10] = b64[ 9]; y[11] = b64[ 8]; - y[12] = b64[15]; y[13] = b64[14]; y[14] = b64[13]; y[15] = b64[12]; - y[16] = b64[19]; y[17] = b64[18]; y[18] = b64[17]; y[19] = b64[16]; - y[20] = b64[23]; y[21] = b64[22]; y[22] = b64[21]; y[23] = b64[20]; - y[24] = b64[27]; y[25] = b64[26]; y[26] = b64[25]; y[27] = b64[24]; - y[28] = b64[31]; y[29] = b64[30]; y[30] = b64[29]; y[31] = b64[28]; - y[32] = b64[35]; y[33] = b64[34]; y[34] = b64[33]; y[35] = b64[32]; - y[36] = b64[39]; y[37] = b64[38]; y[38] = b64[37]; y[39] = b64[36]; - y[40] = b64[43]; y[41] = b64[42]; y[42] = b64[41]; y[43] = b64[40]; - y[44] = b64[47]; y[45] = b64[46]; y[46] = b64[45]; y[47] = b64[44]; - y[48] = b64[51]; y[49] = b64[50]; y[50] = b64[49]; y[51] = b64[48]; - y[52] = b64[55]; y[53] = b64[54]; y[54] = b64[53]; y[55] = b64[52]; - y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56]; - y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60]; - } - - ROUND1(A, B, C, D, 0, Sa, 1); ROUND1(D, A, B, C, 1, Sb, 2); - ROUND1(C, D, A, B, 2, Sc, 3); ROUND1(B, C, D, A, 3, Sd, 4); - ROUND1(A, B, C, D, 4, Sa, 5); ROUND1(D, A, B, C, 5, Sb, 6); - ROUND1(C, D, A, B, 6, Sc, 7); ROUND1(B, C, D, A, 7, Sd, 8); - ROUND1(A, B, C, D, 8, Sa, 9); ROUND1(D, A, B, C, 9, Sb, 10); - ROUND1(C, D, A, B, 10, Sc, 11); ROUND1(B, C, D, A, 11, Sd, 12); - ROUND1(A, B, C, D, 12, Sa, 13); ROUND1(D, A, B, C, 13, Sb, 14); - ROUND1(C, D, A, B, 14, Sc, 15); ROUND1(B, C, D, A, 15, Sd, 16); - - ROUND2(A, B, C, D, 1, Se, 17); ROUND2(D, A, B, C, 6, Sf, 18); - ROUND2(C, D, A, B, 11, Sg, 19); ROUND2(B, C, D, A, 0, Sh, 20); - ROUND2(A, B, C, D, 5, Se, 21); ROUND2(D, A, B, C, 10, Sf, 22); - ROUND2(C, D, A, B, 15, Sg, 23); ROUND2(B, C, D, A, 4, Sh, 24); - ROUND2(A, B, C, D, 9, Se, 25); ROUND2(D, A, B, C, 14, Sf, 26); - ROUND2(C, D, A, B, 3, Sg, 27); ROUND2(B, C, D, A, 8, Sh, 28); - ROUND2(A, B, C, D, 13, Se, 29); ROUND2(D, A, B, C, 2, Sf, 30); - ROUND2(C, D, A, B, 7, Sg, 31); ROUND2(B, C, D, A, 12, Sh, 32); - - ROUND3(A, B, C, D, 5, Si, 33); ROUND3(D, A, B, C, 8, Sj, 34); - ROUND3(C, D, A, B, 11, Sk, 35); ROUND3(B, C, D, A, 14, Sl, 36); - ROUND3(A, B, C, D, 1, Si, 37); ROUND3(D, A, B, C, 4, Sj, 38); - ROUND3(C, D, A, B, 7, Sk, 39); ROUND3(B, C, D, A, 10, Sl, 40); - ROUND3(A, B, C, D, 13, Si, 41); ROUND3(D, A, B, C, 0, Sj, 42); - ROUND3(C, D, A, B, 3, Sk, 43); ROUND3(B, C, D, A, 6, Sl, 44); - ROUND3(A, B, C, D, 9, Si, 45); ROUND3(D, A, B, C, 12, Sj, 46); - ROUND3(C, D, A, B, 15, Sk, 47); ROUND3(B, C, D, A, 2, Sl, 48); - - ROUND4(A, B, C, D, 0, Sm, 49); ROUND4(D, A, B, C, 7, Sn, 50); - ROUND4(C, D, A, B, 14, So, 51); ROUND4(B, C, D, A, 5, Sp, 52); - ROUND4(A, B, C, D, 12, Sm, 53); ROUND4(D, A, B, C, 3, Sn, 54); - ROUND4(C, D, A, B, 10, So, 55); ROUND4(B, C, D, A, 1, Sp, 56); - ROUND4(A, B, C, D, 8, Sm, 57); ROUND4(D, A, B, C, 15, Sn, 58); - ROUND4(C, D, A, B, 6, So, 59); ROUND4(B, C, D, A, 13, Sp, 60); - ROUND4(A, B, C, D, 4, Sm, 61); ROUND4(D, A, B, C, 11, Sn, 62); - ROUND4(C, D, A, B, 2, So, 63); ROUND4(B, C, D, A, 9, Sp, 64); + y[0] = b64[3]; + y[1] = b64[2]; + y[2] = b64[1]; + y[3] = b64[0]; + y[4] = b64[7]; + y[5] = b64[6]; + y[6] = b64[5]; + y[7] = b64[4]; + y[8] = b64[11]; + y[9] = b64[10]; + y[10] = b64[9]; + y[11] = b64[8]; + y[12] = b64[15]; + y[13] = b64[14]; + y[14] = b64[13]; + y[15] = b64[12]; + y[16] = b64[19]; + y[17] = b64[18]; + y[18] = b64[17]; + y[19] = b64[16]; + y[20] = b64[23]; + y[21] = b64[22]; + y[22] = b64[21]; + y[23] = b64[20]; + y[24] = b64[27]; + y[25] = b64[26]; + y[26] = b64[25]; + y[27] = b64[24]; + y[28] = b64[31]; + y[29] = b64[30]; + y[30] = b64[29]; + y[31] = b64[28]; + y[32] = b64[35]; + y[33] = b64[34]; + y[34] = b64[33]; + y[35] = b64[32]; + y[36] = b64[39]; + y[37] = b64[38]; + y[38] = b64[37]; + y[39] = b64[36]; + y[40] = b64[43]; + y[41] = b64[42]; + y[42] = b64[41]; + y[43] = b64[40]; + y[44] = b64[47]; + y[45] = b64[46]; + y[46] = b64[45]; + y[47] = b64[44]; + y[48] = b64[51]; + y[49] = b64[50]; + y[50] = b64[49]; + y[51] = b64[48]; + y[52] = b64[55]; + y[53] = b64[54]; + y[54] = b64[53]; + y[55] = b64[52]; + y[56] = b64[59]; + y[57] = b64[58]; + y[58] = b64[57]; + y[59] = b64[56]; + y[60] = b64[63]; + y[61] = b64[62]; + y[62] = b64[61]; + y[63] = b64[60]; + } + + ROUND1 (A, B, C, D, 0, Sa, 1); + ROUND1 (D, A, B, C, 1, Sb, 2); + ROUND1 (C, D, A, B, 2, Sc, 3); + ROUND1 (B, C, D, A, 3, Sd, 4); + ROUND1 (A, B, C, D, 4, Sa, 5); + ROUND1 (D, A, B, C, 5, Sb, 6); + ROUND1 (C, D, A, B, 6, Sc, 7); + ROUND1 (B, C, D, A, 7, Sd, 8); + ROUND1 (A, B, C, D, 8, Sa, 9); + ROUND1 (D, A, B, C, 9, Sb, 10); + ROUND1 (C, D, A, B, 10, Sc, 11); + ROUND1 (B, C, D, A, 11, Sd, 12); + ROUND1 (A, B, C, D, 12, Sa, 13); + ROUND1 (D, A, B, C, 13, Sb, 14); + ROUND1 (C, D, A, B, 14, Sc, 15); + ROUND1 (B, C, D, A, 15, Sd, 16); + + ROUND2 (A, B, C, D, 1, Se, 17); + ROUND2 (D, A, B, C, 6, Sf, 18); + ROUND2 (C, D, A, B, 11, Sg, 19); + ROUND2 (B, C, D, A, 0, Sh, 20); + ROUND2 (A, B, C, D, 5, Se, 21); + ROUND2 (D, A, B, C, 10, Sf, 22); + ROUND2 (C, D, A, B, 15, Sg, 23); + ROUND2 (B, C, D, A, 4, Sh, 24); + ROUND2 (A, B, C, D, 9, Se, 25); + ROUND2 (D, A, B, C, 14, Sf, 26); + ROUND2 (C, D, A, B, 3, Sg, 27); + ROUND2 (B, C, D, A, 8, Sh, 28); + ROUND2 (A, B, C, D, 13, Se, 29); + ROUND2 (D, A, B, C, 2, Sf, 30); + ROUND2 (C, D, A, B, 7, Sg, 31); + ROUND2 (B, C, D, A, 12, Sh, 32); + + ROUND3 (A, B, C, D, 5, Si, 33); + ROUND3 (D, A, B, C, 8, Sj, 34); + ROUND3 (C, D, A, B, 11, Sk, 35); + ROUND3 (B, C, D, A, 14, Sl, 36); + ROUND3 (A, B, C, D, 1, Si, 37); + ROUND3 (D, A, B, C, 4, Sj, 38); + ROUND3 (C, D, A, B, 7, Sk, 39); + ROUND3 (B, C, D, A, 10, Sl, 40); + ROUND3 (A, B, C, D, 13, Si, 41); + ROUND3 (D, A, B, C, 0, Sj, 42); + ROUND3 (C, D, A, B, 3, Sk, 43); + ROUND3 (B, C, D, A, 6, Sl, 44); + ROUND3 (A, B, C, D, 9, Si, 45); + ROUND3 (D, A, B, C, 12, Sj, 46); + ROUND3 (C, D, A, B, 15, Sk, 47); + ROUND3 (B, C, D, A, 2, Sl, 48); + + ROUND4 (A, B, C, D, 0, Sm, 49); + ROUND4 (D, A, B, C, 7, Sn, 50); + ROUND4 (C, D, A, B, 14, So, 51); + ROUND4 (B, C, D, A, 5, Sp, 52); + ROUND4 (A, B, C, D, 12, Sm, 53); + ROUND4 (D, A, B, C, 3, Sn, 54); + ROUND4 (C, D, A, B, 10, So, 55); + ROUND4 (B, C, D, A, 1, Sp, 56); + ROUND4 (A, B, C, D, 8, Sm, 57); + ROUND4 (D, A, B, C, 15, Sn, 58); + ROUND4 (C, D, A, B, 6, So, 59); + ROUND4 (B, C, D, A, 13, Sp, 60); + ROUND4 (A, B, C, D, 4, Sm, 61); + ROUND4 (D, A, B, C, 11, Sn, 62); + ROUND4 (C, D, A, B, 2, So, 63); + ROUND4 (B, C, D, A, 9, Sp, 64); ctxt->md5_sta += A; ctxt->md5_stb += B; --- quagga-0.99.9/lib/md5.h 2006-01-31 12:55:52.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/md5.h 2008-04-16 11:55:47.000000000 -0700 @@ -44,8 +44,10 @@ #define MD5_BUFLEN 64 -typedef struct { - union { +typedef struct +{ + union + { uint32_t md5_state32[4]; uint8_t md5_state8[16]; } md5_st; @@ -56,7 +58,8 @@ typedef struct { #define md5_std md5_st.md5_state32[3] #define md5_st8 md5_st.md5_state8 - union { + union + { uint64_t md5_count64; uint8_t md5_count8[8]; } md5_count; --- quagga-0.99.9/lib/memory.c 2007-03-20 11:23:00.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/memory.c 2008-04-16 11:55:47.000000000 -0700 @@ -33,8 +33,7 @@ static void alloc_inc (int); static void alloc_dec (int); static void log_memstats(int log_priority); -static struct message mstr [] = -{ +static struct message mstr[] = { { MTYPE_THREAD, "thread" }, { MTYPE_THREAD_MASTER, "thread_master" }, { MTYPE_VECTOR, "vector" }, @@ -140,7 +139,8 @@ static struct static void mtype_log (char *func, void *memory, const char *file, int line, int type) { - zlog_debug ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, line); + zlog_debug ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, + line); } void * @@ -249,7 +249,8 @@ log_memstats(int pri) zlog (NULL, pri, "Memory utilization in module %s:", ml->name); for (m = ml->list; m->index >= 0; m++) if (m->index && mstat[m->index].alloc) - zlog (NULL, pri, " %-30s: %10ld", m->format, mstat[m->index].alloc); + zlog (NULL, pri, " %-30s: %10ld", m->format, + mstat[m->index].alloc); } } @@ -291,32 +292,23 @@ show_memory_mallinfo (struct vty *vty) vty_out (vty, "System allocator statistics:%s", VTY_NEWLINE); vty_out (vty, " Total heap allocated: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.arena), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.arena), VTY_NEWLINE); vty_out (vty, " Holding block headers: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.hblkhd), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.hblkhd), VTY_NEWLINE); vty_out (vty, " Used small blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.usmblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.usmblks), VTY_NEWLINE); vty_out (vty, " Used ordinary blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.uordblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.uordblks), VTY_NEWLINE); vty_out (vty, " Free small blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fsmblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fsmblks), VTY_NEWLINE); vty_out (vty, " Free ordinary blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fordblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fordblks), VTY_NEWLINE); vty_out (vty, " Ordinary blocks: %ld%s", - (unsigned long)minfo.ordblks, - VTY_NEWLINE); + (unsigned long) minfo.ordblks, VTY_NEWLINE); vty_out (vty, " Small blocks: %ld%s", - (unsigned long)minfo.smblks, - VTY_NEWLINE); + (unsigned long) minfo.smblks, VTY_NEWLINE); vty_out (vty, " Holding blocks: %ld%s", - (unsigned long)minfo.hblks, - VTY_NEWLINE); + (unsigned long) minfo.hblks, VTY_NEWLINE); vty_out (vty, "(see system documentation for 'mallinfo' for meaning)%s", VTY_NEWLINE); return 1; @@ -327,8 +319,7 @@ DEFUN (show_memory_all, show_memory_all_cmd, "show memory all", "Show running system information\n" - "Memory statistics\n" - "All memory statistics\n") + "Memory statistics\n" "All memory statistics\n") { struct mlist *ml; int needsep = 0; @@ -352,13 +343,9 @@ ALIAS (show_memory_all, "show memory", "Show running system information\n" "Memory statistics\n") - DEFUN (show_memory_lib, show_memory_lib_cmd, - "show memory lib", - SHOW_STR - "Memory statistics\n" - "Library memory\n") + "show memory lib", SHOW_STR "Memory statistics\n" "Library memory\n") { show_memory_vty (vty, memory_list_lib); return CMD_SUCCESS; @@ -366,10 +353,7 @@ DEFUN (show_memory_lib, DEFUN (show_memory_zebra, show_memory_zebra_cmd, - "show memory zebra", - SHOW_STR - "Memory statistics\n" - "Zebra memory\n") + "show memory zebra", SHOW_STR "Memory statistics\n" "Zebra memory\n") { show_memory_vty (vty, memory_list_zebra); return CMD_SUCCESS; @@ -377,10 +361,7 @@ DEFUN (show_memory_zebra, DEFUN (show_memory_rip, show_memory_rip_cmd, - "show memory rip", - SHOW_STR - "Memory statistics\n" - "RIP memory\n") + "show memory rip", SHOW_STR "Memory statistics\n" "RIP memory\n") { show_memory_vty (vty, memory_list_rip); return CMD_SUCCESS; @@ -388,10 +369,7 @@ DEFUN (show_memory_rip, DEFUN (show_memory_ripng, show_memory_ripng_cmd, - "show memory ripng", - SHOW_STR - "Memory statistics\n" - "RIPng memory\n") + "show memory ripng", SHOW_STR "Memory statistics\n" "RIPng memory\n") { show_memory_vty (vty, memory_list_ripng); return CMD_SUCCESS; @@ -399,10 +377,7 @@ DEFUN (show_memory_ripng, DEFUN (show_memory_bgp, show_memory_bgp_cmd, - "show memory bgp", - SHOW_STR - "Memory statistics\n" - "BGP memory\n") + "show memory bgp", SHOW_STR "Memory statistics\n" "BGP memory\n") { show_memory_vty (vty, memory_list_bgp); return CMD_SUCCESS; @@ -410,10 +385,7 @@ DEFUN (show_memory_bgp, DEFUN (show_memory_ospf, show_memory_ospf_cmd, - "show memory ospf", - SHOW_STR - "Memory statistics\n" - "OSPF memory\n") + "show memory ospf", SHOW_STR "Memory statistics\n" "OSPF memory\n") { show_memory_vty (vty, memory_list_ospf); return CMD_SUCCESS; @@ -421,10 +393,7 @@ DEFUN (show_memory_ospf, DEFUN (show_memory_ospf6, show_memory_ospf6_cmd, - "show memory ospf6", - SHOW_STR - "Memory statistics\n" - "OSPF6 memory\n") + "show memory ospf6", SHOW_STR "Memory statistics\n" "OSPF6 memory\n") { show_memory_vty (vty, memory_list_ospf6); return CMD_SUCCESS; @@ -432,10 +401,7 @@ DEFUN (show_memory_ospf6, DEFUN (show_memory_isis, show_memory_isis_cmd, - "show memory isis", - SHOW_STR - "Memory statistics\n" - "ISIS memory\n") + "show memory isis", SHOW_STR "Memory statistics\n" "ISIS memory\n") { show_memory_vty (vty, memory_list_isis); return CMD_SUCCESS; --- quagga-0.99.9/lib/memory.h 2006-06-15 05:28:59.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/memory.h 2008-04-16 11:55:47.000000000 -0700 @@ -28,7 +28,8 @@ struct memory_list const char *format; }; -struct mlist { +struct mlist +{ struct memory_list *list; const char *name; }; @@ -67,7 +68,8 @@ extern void *zrealloc (int type, void *p extern void zfree (int type, void *ptr); extern char *zstrdup (int type, const char *str); -extern void *mtype_zmalloc (const char *file, int line, int type, size_t size); +extern void *mtype_zmalloc (const char *file, int line, int type, + size_t size); extern void *mtype_zcalloc (const char *file, int line, int type, size_t num, size_t size); @@ -75,8 +77,7 @@ extern void *mtype_zcalloc (const char * extern void *mtype_zrealloc (const char *file, int line, int type, void *ptr, size_t size); -extern void mtype_zfree (const char *file, int line, int type, - void *ptr); +extern void mtype_zfree (const char *file, int line, int type, void *ptr); extern char *mtype_zstrdup (const char *file, int line, int type, const char *str); --- quagga-0.99.9/lib/memtypes.c 2007-05-04 13:15:47.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/memtypes.c 2008-04-16 11:55:47.000000000 -0700 @@ -12,8 +12,7 @@ #include "zebra.h" #include "memory.h" -struct memory_list memory_list_lib[] = -{ +struct memory_list memory_list_lib[] = { { MTYPE_TMP, "Temporary memory" }, { MTYPE_STRVEC, "String vector" }, { MTYPE_VECTOR, "Vector" }, @@ -75,8 +74,7 @@ struct memory_list memory_list_lib[] = { -1, NULL }, }; -struct memory_list memory_list_zebra[] = -{ +struct memory_list memory_list_zebra[] = { { MTYPE_RTADV_PREFIX, "Router Advertisement Prefix" }, { MTYPE_VRF, "VRF" }, { MTYPE_VRF_NAME, "VRF name" }, @@ -88,8 +86,7 @@ struct memory_list memory_list_zebra[] = { -1, NULL }, }; -struct memory_list memory_list_bgp[] = -{ +struct memory_list memory_list_bgp[] = { { MTYPE_BGP, "BGP instance" }, { MTYPE_BGP_PEER, "BGP peer" }, { MTYPE_BGP_PEER_HOST, "BGP peer hostname" }, @@ -151,8 +148,7 @@ struct memory_list memory_list_bgp[] = { -1, NULL } }; -struct memory_list memory_list_rip[] = -{ +struct memory_list memory_list_rip[] = { { MTYPE_RIP, "RIP structure" }, { MTYPE_RIP_INFO, "RIP route info" }, { MTYPE_RIP_INTERFACE, "RIP interface" }, @@ -162,8 +158,7 @@ struct memory_list memory_list_rip[] = { -1, NULL } }; -struct memory_list memory_list_ripng[] = -{ +struct memory_list memory_list_ripng[] = { { MTYPE_RIPNG, "RIPng structure" }, { MTYPE_RIPNG_ROUTE, "RIPng route info" }, { MTYPE_RIPNG_AGGREGATE, "RIPng aggregate" }, @@ -173,8 +168,7 @@ struct memory_list memory_list_ripng[] = { -1, NULL } }; -struct memory_list memory_list_ospf[] = -{ +struct memory_list memory_list_ospf[] = { { MTYPE_OSPF_TOP, "OSPF top" }, { MTYPE_OSPF_AREA, "OSPF area" }, { MTYPE_OSPF_AREA_RANGE, "OSPF area range" }, @@ -203,8 +197,7 @@ struct memory_list memory_list_ospf[] = { -1, NULL }, }; -struct memory_list memory_list_ospf6[] = -{ +struct memory_list memory_list_ospf6[] = { { MTYPE_OSPF6_TOP, "OSPF6 top" }, { MTYPE_OSPF6_AREA, "OSPF6 area" }, { MTYPE_OSPF6_IF, "OSPF6 interface" }, @@ -223,8 +216,7 @@ struct memory_list memory_list_ospf6[] = { -1, NULL }, }; -struct memory_list memory_list_isis[] = -{ +struct memory_list memory_list_isis[] = { { MTYPE_ISIS, "ISIS" }, { MTYPE_ISIS_TMP, "ISIS TMP" }, { MTYPE_ISIS_CIRCUIT, "ISIS circuit" }, @@ -242,21 +234,29 @@ struct memory_list memory_list_isis[] = { -1, NULL }, }; -struct memory_list memory_list_vtysh[] = -{ +struct memory_list memory_list_vtysh[] = { { MTYPE_VTYSH_CONFIG, "Vtysh configuration", }, { MTYPE_VTYSH_CONFIG_LINE, "Vtysh configuration line" }, { -1, NULL }, }; -struct mlist mlists[] __attribute__ ((unused)) = { - { memory_list_lib, "LIB" }, - { memory_list_zebra, "ZEBRA" }, - { memory_list_rip, "RIP" }, - { memory_list_ripng, "RIPNG" }, - { memory_list_ospf, "OSPF" }, - { memory_list_ospf6, "OSPF6" }, - { memory_list_isis, "ISIS" }, - { memory_list_bgp, "BGP" }, - { NULL, NULL}, -}; +struct mlist mlists[] __attribute__ ((unused)) = +{ + { + memory_list_lib, "LIB"}, + { + memory_list_zebra, "ZEBRA"}, + { + memory_list_rip, "RIP"}, + { + memory_list_ripng, "RIPNG"}, + { + memory_list_ospf, "OSPF"}, + { + memory_list_ospf6, "OSPF6"}, + { + memory_list_isis, "ISIS"}, + { + memory_list_bgp, "BGP"}, + { +NULL, NULL},}; --- quagga-0.99.9/lib/network.c 2005-02-16 10:27:08.000000000 -0800 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/network.c 2008-04-16 11:55:47.000000000 -0700 @@ -39,8 +39,7 @@ readn (int fd, u_char *ptr, int nbytes) if (nread < 0) return (nread); - else - if (nread == 0) + else if (nread == 0) break; nleft -= nread; --- quagga-0.99.9/lib/plist.c 2006-05-12 16:16:00.000000000 -0700 +++ quagga-0.99.9.ospfv3-extensions.tmp/lib/plist.c 2008-04-16 11:55:47.000000000 -0700 @@ -80,8 +80,7 @@ struct prefix_master }; /* Static structure of IPv4 prefix_list's master. */ -static struct prefix_master prefix_master_ipv4 = -{ +static struct prefix_master prefix_master_ipv4 = { {NULL, NULL}, {NULL, NULL}, 1, @@ -91,8 +90,7 @@ static struct prefix_master prefix_maste #ifdef HAVE_IPV6 /* Static structure of IPv6 prefix-list's master. */ -static struct prefix_master prefix_master_ipv6 = -{ +static struct prefix_master prefix_master_ipv6 = { {NULL, NULL}, {NULL, NULL}, 1, @@ -102,8 +100,7 @@ static struct prefix_master prefix_maste #endif /* HAVE_IPV6*/ /* Static structure of BGP ORF prefix_list's master. */ -static struct prefix_master prefix_master_orf = -{ +static struct prefix_master prefix_master_orf = { {NULL, NULL}, {NULL, NULL}, 1, @@ -432,8 +429,7 @@ prefix_list_entry_lookup (struct prefix_ static void prefix_list_entry_delete (struct prefix_list *plist, - struct prefix_list_entry *pentry, - int update_list) + struct prefix_list_entry *pentry, int update_list) { if (plist == NULL || pentry == NULL) return; @@ -640,8 +636,7 @@ prefix_entry_dup_check (struct prefix_li if (prefix_same (&pentry->prefix, &new->prefix) && pentry->type