/* Print an unsigned relative number of seconds (e.g. hold time, prune timer) in the form 5m1s. This does no truncation, so 32230861 seconds is represented as 1y1w1d1h1m1s.  */
void unsigned_relts_print(netdissect_options *ndo, uint32_t secs)
/* Print an unsigned relative number of seconds (e.g. hold time, prune timer) in the form 5m1s. This does no truncation, so 32230861 seconds is represented as 1y1w1d1h1m1s.  */
void unsigned_relts_print(netdissect_options *ndo, uint32_t secs)
{
	static const char *lengths[] = {"y", "w", "d", "h", "m", "s"};
	static const u_int seconds[] = {31536000, 604800, 86400, 3600, 60, 1};
	const char **l = lengths;
	const u_int *s = seconds;
	if (secs == 0) {
		ND_PRINT((ndo, "0s"));
		return;
	}
	while (secs > 0) {
		if (secs >= *s) {
			ND_PRINT((ndo, "%d%s", secs / *s, *l));
			secs -= (secs / *s) * *s;
		}
		s++;
		l++;
	}
}