diff options
| author | Chirag Shah <chirag@cumulusnetworks.com> | 2018-11-04 09:36:47 -0800 |
|---|---|---|
| committer | Chirag Shah <chirag@cumulusnetworks.com> | 2018-11-17 19:22:17 -0800 |
| commit | 87454e6bd148c321176233984fb79bab5ccc59e2 (patch) | |
| tree | dc0960d31e9093d84b8b2365f9366bf7ec5095fa /lib | |
| parent | c80a972c9a09b8740e4edaae60fb8ebed938b73d (diff) | |
lib, zebra: dup addr detect display detection fields
Display following Per MAC and Neigh's output:
If duplicate address detection is under process,
display detection start time and detection count.
If duplicate address detection detected an address
as duplicate, display detection time and duplicate
status.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/monotime.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/monotime.h b/lib/monotime.h index 8e50c1874a..00b9400462 100644 --- a/lib/monotime.h +++ b/lib/monotime.h @@ -80,4 +80,15 @@ static inline int64_t monotime_until(const struct timeval *ref, return (int64_t)tv.tv_sec * 1000000LL + tv.tv_usec; } +static inline char *time_to_string(time_t ts) +{ + struct timeval tv; + time_t tbuf; + + monotime(&tv); + tbuf = time(NULL) - (tv.tv_sec - ts); + + return ctime(&tbuf); +} + #endif /* _FRR_MONOTIME_H */ |
