json_object *json_string = NULL;
if (!com)
- return NULL;
+ return;
com->json = json_object_new_object();
json_community_list = json_object_new_array();
struct listnode *node, *nnode, *mnode;
struct bgp *bgp;
struct peer *peer;
- u_int32_t saddr;
addr = ifc->address;
extern int
update_group_clear_update_dbg (struct update_group *updgrp, void *arg);
+extern void update_bgp_group_free(struct bgp *bgp);
+
/*
* Inline functions
*/
stream_put_in_addr_at (s, vec->offset + 1, mod_v4nh);
if (bgp_debug_update(peer, NULL, NULL, 0))
- zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
+ zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
peer->host, inet_ntoa (*mod_v4nh));
if (bgp_debug_update(peer, NULL, NULL, 0))
{
if (nhlen == 32)
- zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
+ zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id,
peer->host,
inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ),
inet_ntop (AF_INET6, mod_v6nhl, buf2, BUFSIZ));
else
- zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
+ zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id,
peer->host,
extern struct in_addr router_id_zebra;
-/* Intentional re-definition of the auto-generated macros, without table */
-#define QUAGGA_REDIST_STR_BGPD \
- "(kernel|connected|static|rip|ripng|ospf|ospf6|isis|babel)"
-#define QUAGGA_REDIST_HELP_STR_BGPD \
- "Kernel routes (not installed via the zebra RIB)\n" \
- "Connected routes (directly attached subnet or host)\n" \
- "Statically configured routes\n" \
- "Routing Information Protocol (RIP)\n" \
- "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
- "Open Shortest Path First (OSPFv2)\n" \
- "Open Shortest Path First (IPv6) (OSPFv3)\n" \
- "Intermediate System to Intermediate System (IS-IS)\n" \
- "Babel routing protocol (Babel)\n"
-#define QUAGGA_IP_REDIST_STR_BGPD \
- "(kernel|connected|static|rip|ospf|isis|babel)"
-#define QUAGGA_IP_REDIST_HELP_STR_BGPD \
- "Kernel routes (not installed via the zebra RIB)\n" \
- "Connected routes (directly attached subnet or host)\n" \
- "Statically configured routes\n" \
- "Routing Information Protocol (RIP)\n" \
- "Open Shortest Path First (OSPFv2)\n" \
- "Intermediate System to Intermediate System (IS-IS)\n" \
- "Babel routing protocol (Babel)\n"
-#define QUAGGA_IP6_REDIST_STR_BGPD \
- "(kernel|connected|static|ripng|ospf6|isis|babel)"
-#define QUAGGA_IP6_REDIST_HELP_STR_BGPD \
- "Kernel routes (not installed via the zebra RIB)\n" \
- "Connected routes (directly attached subnet or host)\n" \
- "Statically configured routes\n" \
- "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \
- "Open Shortest Path First (IPv6) (OSPFv3)\n" \
- "Intermediate System to Intermediate System (IS-IS)\n" \
- "Babel routing protocol (Babel)\n"
-
-
/* Utility function to get address family from current node. */
afi_t
bgp_node_afi (struct vty *vty)
if (valid_nh_count)
zapi_ipv4_route_ipv6_nexthop (ZEBRA_IPV4_ROUTE_IPV6_NEXTHOP_ADD,
- zclient, (struct prefix_ipv4 *) p, &api);
+ zclient, (struct prefix_ipv4 *) p,
+ (struct zapi_ipv6 *)&api);
else
zapi_ipv4_route (ZEBRA_IPV4_ROUTE_DELETE,
- zclient, (struct prefix_ipv4 *) p, &api);
+ zclient, (struct prefix_ipv4 *) p, (struct zapi_ipv4 *)&api);
}
else
{
#include "linklist.h"
#include "workqueue.h"
#include "queue.h"
+#include "zclient.h"
#include "bfd.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_updgrp.h"
#include "bgpd/bgp_bfd.h"
-
/* BGP process wide configuration. */
static struct bgp_master bgp_master;
if (!peer->conf_if)
return;
- if (ifp = if_lookup_by_name(peer->conf_if))
+ if ((ifp = if_lookup_by_name(peer->conf_if)))
{
/* if multiple IP addresses assigned to link, we pick the first */
if (!CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))
struct peer_group *group, afi_t afi, safi_t safi)
{
struct peer *other;
- int v6only;
if (! peer->af_group[afi][safi])
return 0;
}
}
- return 0;
+ return ret;
}
/*
#define PEER_FLAG_LONESOUL (1 << 11)
#define PEER_FLAG_DYNAMIC_NEIGHBOR (1 << 12) /* dynamic neighbor */
#define PEER_FLAG_CAPABILITY_ENHE (1 << 13) /* Extended next-hop (rfc 5549)*/
-#define PEER_FLAG_IFPEER_V6ONLY (1 << 14) /* if-based peer is v6 only *
+#define PEER_FLAG_IFPEER_V6ONLY (1 << 14) /* if-based peer is v6 only */
/* NSF mode (graceful restart) */
u_char nsf[AFI_MAX][SAFI_MAX];
#define PEER_RMAP_TYPE_EXPORT (1 << 7) /* neighbor route-map export */
/* peer specific BFD information */
- void *bfd_info;
+ struct bfd_info *bfd_info;
};
#define PEER_PASSWORD_MINLEN (1)
bfd_info_create(void);
extern void
-bfd_info_free(void **bfd_info);
+bfd_info_free(struct bfd_info **bfd_info);
extern int
bfd_validate_param(struct vty *vty, const char *dm_str, const char *rx_str,
int
ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt,
- const char *key, char *val)
+ const char *key, const char *val)
{
ptm_lib_msg_ctxt_t *p_ctxt = ctxt;
csv_t *csv;
void ptm_lib_deregister(ptm_lib_handle_t *);
int ptm_lib_find_key_in_msg(void *, const char *, char *);
int ptm_lib_init_msg(ptm_lib_handle_t *, int, int, void *, void **);
-int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, char *);
+int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, const char *);
int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *);
#include "thread.h"
#include "prefix.h"
#include "plist.h"
+#include "zclient.h"
#include "bfd.h"
#include "ospf6_lsa.h"
char *plist_name;
/* BFD information */
- void *bfd_info;
+ struct bfd_info *bfd_info;
};
/* interface state */
#include "ospfd/ospf_dump.h"
#include "ospfd/ospf_bfd.h"
-#define QUAGGA_REDIST_STR_OSPFD \
- "(kernel|connected|static|rip|isis|bgp|babel)"
-#define QUAGGA_REDIST_HELP_STR_OSPFD \
- "Kernel routes (not installed via the zebra RIB)\n" \
- "Connected routes (directly attached subnet or host)\n" \
- "Statically configured routes\n" \
- "Routing Information Protocol (RIP)\n" \
- "Intermediate System to Intermediate System (IS-IS)\n" \
- "Border Gateway Protocol (BGP)\n" \
- "Babel routing protocol (Babel)\n"
-
-
static const char *ospf_network_type_str[] =
{
"Null",
static int
write_config_integrated(void)
{
- int ret;
u_int i;
char line[] = "write terminal\n";
FILE *fp, *fp1;
#include "memory.h"
#include "vtysh/vtysh.h"
+#include "vtysh/vtysh_user.h"
/*
* Compiler is warning about prototypes not being declared.
#include "memory.h"
#include "linklist.h"
#include "command.h"
+#include "vtysh/vtysh_user.h"
/*
* Compiler is warning about prototypes not being declared.
struct vtysh_user *user_new(void);
void user_free(struct vtysh_user *);
struct vtysh_user *user_lookup(const char *);
-void user_config_write(void);
struct vtysh_user *user_get(const char *);
int vtysh_auth(void);
void vtysh_user_init(void);
#define _VTYSH_USER_H
int vtysh_auth ();
+void user_config_write(void);
#endif /* _VTYSH_USER_H */
}
static pid_t
-run_background(const char *shell_cmd)
+run_background(char *shell_cmd)
{
pid_t child;
if (setpgid(0,0) < 0)
zlog_warn("warning: setpgid(0,0) failed: %s",safe_strerror(errno));
{
- const char *argv[4] = { "sh", "-c", shell_cmd, NULL};
- execv("/bin/sh",(char *const *)argv);
+ char shell[] = "sh";
+ char dashc[] = "-c";
+ char * const argv[4] = { shell, dashc, shell_cmd, NULL};
+ execv("/bin/sh", argv);
zlog_err("execv(/bin/sh -c '%s') failed: %s",
shell_cmd,safe_strerror(errno));
_exit(127);
#include "zebra/zebra_ptm.h"
#include "zebra/rt_netlink.h"
#include "zebra/zserv.h"
+#include "zebra/interface.h"
#define ZEBRA_PTM_SUPPORT
ifp->ifindex = IFINDEX_INTERNAL;
}
-void
+static void
ipv6_ll_address_to_mac (struct in6_addr *address, u_char *mac)
{
mac[0] = address->s6_addr[8] ^ 0x02;
{
char buf[16] = "169.254.0.1";
struct in_addr ipv4_ll;
- u_char mac[6];
+ char mac[6];
inet_pton (AF_INET, buf, &ipv4_ll);
- ipv6_ll_address_to_mac(address, mac);
+ ipv6_ll_address_to_mac(address, (u_char *)mac);
netlink_neigh_update (add ? RTM_NEWNEIGH : RTM_DELNEIGH,
ifp->ifindex, ipv4_ll.s_addr, mac, 6);
}
-void
+static void
if_nbr_ipv6ll_to_ipv4ll_neigh_add_all (struct interface *ifp)
{
if (listhead(ifp->nbr_connected))
}
}
-void
+static void
if_down_del_nbr_connected (struct interface *ifp)
{
struct nbr_connected *nbr_connected;
#include "zebra/rt.h"
#include "zebra/redistribute.h"
#include "zebra/connected.h"
+#include "zebra/rt_netlink.h"
int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
int kernel_update_ipv4 (struct prefix *a, struct rib *b) { return 0; }
*/
#include <zebra.h>
#include "prefix.h"
+#include "if.h"
+#include "zebra_ptm_redistribute.h"
void zebra_interface_bfd_update (struct interface *a, struct prefix *dp,
struct prefix *sp)
#include "vty.h"
#include "stream.h"
#include "zebra/zserv.h"
+#include "zebra/zebra_ptm_redistribute.h"
/* master zebra server structure */
extern struct zebra_t zebrad;
-int
+static int
zsend_interface_bfd_update (int cmd, struct zserv *client,
struct interface *ifp, struct prefix *dp,
struct prefix *sp)
}
}
-int
+static int
zsend_bfd_peer_replay (int cmd, struct zserv *client)
{
struct stream *s;
#include "zebra/debug.h"
#include "zebra/zebra_fpm.h"
#include "zebra/zebra_rnh.h"
+#include "zebra/interface.h"
/* Default rtm_table for all clients */
extern struct zebra_t zebrad;
if (!table)
return 0;
/* Make it sure prefixlen is applied to the prefix. */
- apply_mask_ipv4 (p);
+ apply_mask_ipv4 ((struct prefix_ipv4 *)p);
}
else
{
return 0;
/* Make sure mask is applied. */
- apply_mask_ipv6 (p);
+ apply_mask_ipv6 ((struct prefix_ipv6 *)p);
}
#include "zebra/ipforward.h"
#include "zebra/zebra_rnh.h"
#include "zebra/rt_netlink.h"
+#include "zebra/interface.h"
+#include "zebra/zebra_ptm.h"
/* Event list of zebra. */
enum event { ZEBRA_SERV, ZEBRA_READ, ZEBRA_WRITE };
u_char nexthop_type;
unsigned long ifindex;
struct prefix_ipv4 p;
- u_char ifname_len;
safi_t safi;
static struct in6_addr nexthops[MULTIPATH_NUM];
static unsigned int ifindices[MULTIPATH_NUM];