Commit ebb9ae8c authored by Pavel Tvrdik's avatar Pavel Tvrdik
Browse files

BGPsec: small refactoring of code

1) Move configuration global 'rpki dir' command to proto/rpki/config.Y
2) rpki_state_dir -> rpki_dir
parent e0dc3daa
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -108,7 +108,7 @@ $(objdir)/sysdep/paths.h: Makefile
	echo  >$@ "/* Generated by Makefile, don't edit manually! */"
	echo  >$@ "/* Generated by Makefile, don't edit manually! */"
	echo >>$@ "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
	echo >>$@ "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
	echo >>$@ "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
	echo >>$@ "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
	echo >>$@ "#define PATH_RPKI_STATE_DIR \"@RPKI_STATE_DIR@\""
	echo >>$@ "#define PATH_RPKI_DIR \"@RPKI_DIR@\""
	if test -n "@iproutedir@" ; then echo >>$@ "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
	if test -n "@iproutedir@" ; then echo >>$@ "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi


# Finally include the computed dependencies
# Finally include the computed dependencies
+1 −1
Original line number Original line Diff line number Diff line
@@ -104,7 +104,7 @@ config_alloc(byte *name)
  c->tf_route = c->tf_proto = (struct timeformat){"%T", "%F", 20*3600};
  c->tf_route = c->tf_proto = (struct timeformat){"%T", "%F", 20*3600};
  c->tf_base = c->tf_log = (struct timeformat){"%F %T", NULL, 0};
  c->tf_base = c->tf_log = (struct timeformat){"%F %T", NULL, 0};
  c->gr_wait = DEFAULT_GR_WAIT;
  c->gr_wait = DEFAULT_GR_WAIT;
  c->rpki_state_dir = PATH_RPKI_STATE_DIR;
  c->rpki_dir = PATH_RPKI_DIR;


  return c;
  return c;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ struct config {
  ip_addr listen_bgp_addr;		/* Listening BGP socket should use this address */
  ip_addr listen_bgp_addr;		/* Listening BGP socket should use this address */
  unsigned listen_bgp_port;		/* Listening BGP socket should use this port (0 is default) */
  unsigned listen_bgp_port;		/* Listening BGP socket should use this port (0 is default) */
  u32 listen_bgp_flags;			/* Listening BGP socket should use these flags */
  u32 listen_bgp_flags;			/* Listening BGP socket should use these flags */
  const char *rpki_state_dir;		/* File path to save Router Keys for RPKI */
  const char *rpki_dir;			/* File path to save Router Keys for RPKI */
  unsigned proto_default_debug;		/* Default protocol debug mask */
  unsigned proto_default_debug;		/* Default protocol debug mask */
  unsigned proto_default_mrtdump;	/* Default protocol mrtdump mask */
  unsigned proto_default_mrtdump;	/* Default protocol mrtdump mask */
  struct timeformat tf_route;		/* Time format for 'show route' */
  struct timeformat tf_route;		/* Time format for 'show route' */
+3 −3
Original line number Original line Diff line number Diff line
@@ -39,15 +39,15 @@ AC_SUBST(runtimedir)
if test "$enable_debug" = yes ; then
if test "$enable_debug" = yes ; then
	CONFIG_FILE="bird.conf"
	CONFIG_FILE="bird.conf"
	CONTROL_SOCKET="bird.ctl"
	CONTROL_SOCKET="bird.ctl"
	RPKI_STATE_DIR="rpki"
	RPKI_DIR="rpki"
else
else
	CONFIG_FILE="\$(sysconfdir)/bird.conf"
	CONFIG_FILE="\$(sysconfdir)/bird.conf"
	CONTROL_SOCKET="$runtimedir/bird.ctl"
	CONTROL_SOCKET="$runtimedir/bird.ctl"
	RPKI_STATE_DIR="\$(localstatedir)/rpki"
	RPKI_DIR="\$(localstatedir)/rpki"
fi
fi
AC_SUBST(CONFIG_FILE)
AC_SUBST(CONFIG_FILE)
AC_SUBST(CONTROL_SOCKET)
AC_SUBST(CONTROL_SOCKET)
AC_SUBST(RPKI_STATE_DIR)
AC_SUBST(RPKI_DIR)


AC_SEARCH_LIBS(clock_gettime, [c rt posix4], ,
AC_SEARCH_LIBS(clock_gettime, [c rt posix4], ,
	AC_MSG_ERROR([[Function clock_gettime not available.]]))
	AC_MSG_ERROR([[Function clock_gettime not available.]]))
+0 −5
Original line number Original line Diff line number Diff line
@@ -457,11 +457,6 @@ password_item_params:
 | ID expr ';' password_item_params { this_p_item->id = $2; if ($2 <= 0) cf_error("Password ID has to be greated than zero."); }
 | ID expr ';' password_item_params { this_p_item->id = $2; if ($2 <= 0) cf_error("Password ID has to be greated than zero."); }
 ;
 ;


/* Overwrite RPKI State Dir for BGPSEC Router Keys */

CF_ADDTO(conf, rpki_state_dir)
rpki_state_dir: RPKI STATE DIR text ';' { new_config->rpki_state_dir = $4; }

/* Core commands */
/* Core commands */
CF_CLI_HELP(SHOW, ..., [[Show status information]])
CF_CLI_HELP(SHOW, ..., [[Show status information]])


Loading