]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_misc.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / isisd / isis_misc.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
eb5d44eb 2/*
3 * IS-IS Rout(e)ing protocol - isis_misc.h
4 * Miscellanous routines
5 *
6 * Copyright (C) 2001,2002 Sampo Saaristo
d62a17ae 7 * Tampere University of Technology
eb5d44eb 8 * Institute of Communications Engineering
eb5d44eb 9 */
10
11#ifndef _ZEBRA_ISIS_MISC_H
12#define _ZEBRA_ISIS_MISC_H
13
d62a17ae 14int string2circuit_t(const char *);
15const char *circuit_t2string(int);
16const char *circuit_state2string(int state);
17const char *circuit_type2string(int type);
18const char *syst2string(int);
d7c0a89a 19struct in_addr newprefix2inaddr(uint8_t *prefix_start, uint8_t prefix_masklen);
eb5d44eb 20/*
21 * Converting input to memory stored format
22 * return value of 0 indicates wrong input
23 */
d7c0a89a
QY
24int dotformat2buff(uint8_t *, const char *);
25int sysid2buff(uint8_t *, const char *);
eb5d44eb 26
27/*
28 * Printing functions
29 */
d7c0a89a
QY
30const char *isonet_print(const uint8_t *, int len);
31const char *sysid_print(const uint8_t *);
32const char *snpa_print(const uint8_t *);
33const char *rawlspid_print(const uint8_t *);
9879e291 34const char *isis_format_id(const uint8_t *id, size_t len);
d7c0a89a 35const char *time2string(uint32_t);
9879e291 36const char *nlpid2str(uint8_t nlpid);
eb5d44eb 37/* typedef struct nlpids nlpids; */
d62a17ae 38char *nlpid2string(struct nlpids *);
36944791 39const char *print_sys_hostname(const uint8_t *sysid);
d62a17ae 40void zlog_dump_data(void *data, int len);
eb5d44eb 41
eb5d44eb 42/*
43 * misc functions
44 */
d62a17ae 45unsigned long isis_jitter(unsigned long timer, unsigned long jitter);
eb5d44eb 46
47/*
48 * macros
49 */
d62a17ae 50#define GETSYSID(A) \
51 (A->area_addr + (A->addr_len - (ISIS_SYS_ID_LEN + ISIS_NSEL_LEN)))
eb5d44eb 52
eb5d44eb 53/* used for calculating nice string representation instead of plain seconds */
54
55#define SECS_PER_MINUTE 60
56#define SECS_PER_HOUR 3600
57#define SECS_PER_DAY 86400
58#define SECS_PER_WEEK 604800
59#define SECS_PER_MONTH 2628000
60#define SECS_PER_YEAR 31536000
61
d62a17ae 62enum { ISIS_UI_LEVEL_BRIEF,
63 ISIS_UI_LEVEL_DETAIL,
64 ISIS_UI_LEVEL_EXTENSIVE,
eb5d44eb 65};
66
9879e291
CF
67#include "lib/log.h"
68void log_multiline(int priority, const char *prefix, const char *format, ...)
afb35622 69 PRINTFRR(3, 4);
9cd06cd7 70char *log_uptime(time_t uptime, char *buf, size_t nbuf);
9879e291
CF
71struct vty;
72void vty_multiline(struct vty *vty, const char *prefix, const char *format, ...)
afb35622 73 PRINTFRR(3, 4);
02cd317e 74void vty_out_timestr(struct vty *vty, time_t uptime);
f390d2c7 75#endif