* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define FUZZING 1
#include <zebra.h>
structure. */
void bgp_timer_set(struct peer *peer)
{
+#ifdef FUZZING
+ return;
+#endif
switch (peer->status) {
case Idle:
/* First entry point of peer's finite state machine. In Idle
frr_preinit(&bgpd_di, argc, argv);
#ifdef FUZZING
- bgp_master_init(frr_init(), buffer_size);
+ bgp_master_init(frr_init_fast(), buffer_size);
bm->port = bgp_port;
if (bgp_port == 0)
bgp_option_set(BGP_OPT_NO_LISTEN);
bgp_option_set(BGP_OPT_NO_ZEBRA);
bgp_error_init();
/* Initializations. */
- bgp_vrf_init();
+ //bgp_vrf_init();
/* BGP related initialization. */
bgp_init((unsigned short)instance);
union sockunion su;
sockunion_init(&su);
- inet_pton(AF_INET, "192.168.0.1", &su.sin.sin_addr);
+ inet_pton(AF_INET, "10.1.1.1", &su.sin.sin_addr);
su.sin.sin_family = AF_INET;
su.sin.sin_port = 2001;
struct peer *p = peer_create(&su, NULL, bgp_get_default(), 65000, 65001, 0, AFI_IP,
SAFI_UNICAST, NULL);
p->bgp->rpkt_quanta = 1;
p->status = Established;
+ p->as_type = AS_EXTERNAL;
+ SET_FLAG(p->cap, PEER_CAP_AS4_RCV);
+ SET_FLAG(p->cap, PEER_CAP_ADDPATH_AF_RX_RCV);
+ SET_FLAG(p->cap, PEER_CAP_ADDPATH_AF_TX_RCV);
+ SET_FLAG(p->cap, PEER_CAP_REFRESH_OLD_RCV);
+ SET_FLAG(p->cap, PEER_CAP_REFRESH_NEW_RCV);
struct thread t = {};
t.arg = p;
return BGP_Stop;
/* Get sockname. */
+#ifndef FUZZING
if (bgp_getsockname(peer) < 0) {
flog_err_sys(EC_LIB_SOCKET,
"%s: bgp_getsockname() failed for peer: %s",
__func__, peer->host);
return BGP_Stop;
}
+#endif
/* Set remote router-id */
peer->remote_id = remote_id;
#endif
}
}
+#ifndef FUZZING
peer->rtt = sockopt_tcp_rtt(peer->fd);
+#endif
return Receive_OPEN_message;
}
/* allocates some vital data structures used by peer commands in
* vty_init */
+#ifndef FUZZING
/* pre-init pthreads */
bgp_pthreads_init();
/* Init zebra. */
bgp_zebra_init(bm->master, instance);
+#endif
#ifdef ENABLE_BGP_VNC
vnc_zebra_init(bm->master);
#endif
/* BGP VTY commands installation. */
+#ifndef FUZZING
bgp_vty_init();
+#endif
/* BGP inits. */
bgp_attr_init();
+#ifndef FUZZING
bgp_debug_init();
bgp_community_alias_init();
bgp_dump_init();
+#endif
bgp_route_init();
bgp_route_map_init();
+#ifndef FUZZING
bgp_scan_vty_init();
+#endif
bgp_mplsvpn_init();
+#ifndef FUZZING
#ifdef ENABLE_BGP_VNC
rfapi_init();
#endif
bgp_ethernetvpn_init();
bgp_flowspec_vty_init();
+#endif
/* Access list initialize. */
access_list_init();
/* Community list initialize. */
bgp_clist = community_list_init();
+#ifndef FUZZING
/* BFD init */
bgp_bfd_init(bm->master);
bgp_lp_vty_init();
cmd_variable_handler_register(bgp_viewvrf_var_handlers);
+#endif
}
void bgp_terminate(void)
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define FUZZING 1
#include <zebra.h>
#include <lib/version.h>
/* Install a command into a node. */
void _install_element(enum node_type ntype, const struct cmd_element *cmd)
{
+#ifdef FUZZING
+ return;
+#endif
struct cmd_node *cnode;
/* cmd_init hasn't been called */
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define FUZZING 1
#ifndef _ZEBRA_H
#define _ZEBRA_H