-Update '--tal' and '--slurm' arguments doc.
-Update '-O' level to '2'.
-Remove unnecessary parameter '*serial' on 'vrps_foreach_base_roa'.
## Syntax
-<!-- TODO: Update this -->
-
```
{{ page.command }}
[--help]
[--usage]
[--version]
[--configuration-file=<file>]
- [--tal=<file>]
+ [--tal=<file>|<directory>]
[--local-repository=<directory>]
[--sync-strategy=off|strict|root|root-except-ta]
[--shuffle-uris]
[--server.port=<string>]
[--server.backlog=<unsigned integer>]
[--server.validation-interval=<unsigned integer>]
- [--slurm=<string>]
+ [--slurm=<file>|<directory>]
[--log.color-output]
[--log.file-name-format=global-url|local-path|file-name]
[--output.roa=<file>]
fort_CFLAGS = -Wall
# Feel free to temporarily remove this one if you're not using gcc 7.3.0.
#fort_CFLAGS += $(GCC_WARNS)
-fort_CFLAGS += -std=gnu11 -O0 -g $(CFLAGS_DEBUG) $(FORT_FLAGS)
+fort_CFLAGS += -std=gnu11 -O2 -g $(CFLAGS_DEBUG) $(FORT_FLAGS)
fort_LDFLAGS = $(LDFLAGS_DEBUG)
fort_LDADD = ${JANSSON_LIBS}
.type = >_string,
.offset = offsetof(struct rpki_config, tal),
.doc = "Path to the TAL file or TALs directory",
- .arg_doc = "<file or directory>",
+ .arg_doc = "<file>|<directory>",
}, {
.id = 'r',
.name = "local-repository",
.type = >_string,
.offset = offsetof(struct rpki_config, slurm),
.doc = "Path to the SLURM file or SLURMs directory (files must have the extension .slurm)",
+ .arg_doc = "<file>|<directory>"
}, {
.id = 1004,
.name = "mode",
* important ones are
* 1. 0: No errors.
* 2. -EAGAIN: No data available; database still under construction.
- *
- * TODO (whatever) @serial is a dumb hack.
*/
int
-vrps_foreach_base_roa(vrp_foreach_cb cb, void *arg, serial_t *serial)
+vrps_foreach_base_roa(vrp_foreach_cb cb, void *arg)
{
int error;
if (error)
return error;
- if (state.base != NULL) {
+ if (state.base != NULL)
error = roa_table_foreach_roa(state.base, cb, arg);
- *serial = state.next_serial - 1;
- } else {
+ else
error = -EAGAIN;
- }
rwlock_unlock(&lock);
* been called, or while it's still building the database.
* Handle gracefully.
*/
-int vrps_foreach_base_roa(vrp_foreach_cb, void *, serial_t *);
+int vrps_foreach_base_roa(vrp_foreach_cb, void *);
int vrps_get_deltas_from(serial_t, serial_t *, struct deltas_db *);
int get_last_serial_number(serial_t *);
args.started = false;
args.fd = fd;
+ error = get_last_serial_number(¤t_serial);
+ switch (error) {
+ case 0:
+ break;
+ case -EAGAIN:
+ return err_pdu_send_no_data_available(fd);
+ default:
+ err_pdu_send_internal_error(fd);
+ return error;
+ }
+
/*
* It's probably best not to work on a copy, because the tree is large.
* Unfortunately, this means we'll have to encourage writer stagnation,
* queries than reset queries.
*/
- error = vrps_foreach_base_roa(send_base_roa, &args, ¤t_serial);
+ error = vrps_foreach_base_roa(send_base_roa, &args);
/* See handle_serial_query_pdu() for some comments. */
switch (error) {
array_index i;
memset(actual_base, 0, sizeof(actual_base));
- ck_assert_int_eq(0, vrps_foreach_base_roa(vrp_check, actual_base,
- &actual_serial));
+ ck_assert_int_eq(0, get_last_serial_number(&actual_serial));
+ ck_assert_int_eq(0, vrps_foreach_base_roa(vrp_check, actual_base));
ck_assert_uint_eq(expected_serial, actual_serial);
for (i = 0; i < ARRAY_LEN(actual_base); i++)
ck_assert_uint_eq(expected_base[i], actual_base[i]);
/* First validation not yet performed: Tell routers to wait */
ck_assert_int_eq(-EAGAIN, get_last_serial_number(serial));
ck_assert_int_eq(-EAGAIN, vrps_foreach_base_roa(vrp_fail,
- iterated_entries, serial));
+ iterated_entries));
ck_assert_int_eq(-EAGAIN, vrps_get_deltas_from(0, serial, deltas));
/* First validation: One tree, no deltas */