1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright 2009-2016, LabN Consulting, L.L.C.
14 SHOW_NVE_SUMMARY_ACTIVE_NVES
,
15 SHOW_NVE_SUMMARY_UNKNOWN_NVES
, /* legacy */
16 SHOW_NVE_SUMMARY_REGISTERED
,
17 SHOW_NVE_SUMMARY_QUERIES
,
18 SHOW_NVE_SUMMARY_RESPONSES
,
22 #define VNC_SHOW_STR "VNC information\n"
24 extern char *rfapiFormatSeconds(uint32_t seconds
, char *buf
, size_t len
);
26 extern char *rfapiFormatAge(time_t age
, char *buf
, size_t len
);
28 extern void rfapiRprefixApplyMask(struct rfapi_ip_prefix
*rprefix
);
30 extern int rfapiQprefix2Raddr(struct prefix
*qprefix
,
31 struct rfapi_ip_addr
*raddr
);
33 extern void rfapiQprefix2Rprefix(const struct prefix
*qprefix
,
34 struct rfapi_ip_prefix
*rprefix
);
36 extern int rfapiRprefix2Qprefix(struct rfapi_ip_prefix
*rprefix
,
37 struct prefix
*qprefix
);
39 extern int rfapiRaddr2Qprefix(struct rfapi_ip_addr
*hia
, struct prefix
*pfx
);
41 extern int rfapiRprefixSame(struct rfapi_ip_prefix
*hp1
,
42 struct rfapi_ip_prefix
*hp2
);
44 extern void rfapiL2o2Qprefix(struct rfapi_l2address_option
*l2o
,
47 extern int rfapiStr2EthAddr(const char *str
, struct ethaddr
*ea
);
49 extern const char *rfapi_ntop(int af
, const void *src
, char *buf
,
52 extern int rfapiDebugPrintf(void *dummy
, const char *format
, ...)
55 extern int rfapiStream2Vty(void *stream
, /* input */
56 int (**fp
)(void *, const char *, ...), /* output */
57 struct vty
**vty
, /* output */
58 void **outstream
, /* output */
59 const char **vty_newline
); /* output */
61 /*------------------------------------------
62 * rfapiRfapiIpAddr2Str
64 * UI helper: generate string from rfapi_ip_addr
71 * bufsize max space to write
74 * NULL conversion failed
75 * non-NULL pointer to buf
76 --------------------------------------------*/
77 extern const char *rfapiRfapiIpAddr2Str(struct rfapi_ip_addr
*a
, char *buf
,
80 extern void rfapiPrintRfapiIpAddr(void *stream
, struct rfapi_ip_addr
*a
);
82 extern void rfapiPrintRfapiIpPrefix(void *stream
, struct rfapi_ip_prefix
*p
);
84 extern void rfapiPrintAdvertisedInfo(struct vty
*vty
,
85 struct rfapi_descriptor
*rfd
, safi_t safi
,
88 extern void rfapiPrintDescriptor(struct vty
*vty
, struct rfapi_descriptor
*rfd
);
90 extern void rfapiPrintMatchingDescriptors(struct vty
*vty
,
91 struct prefix
*vn_prefix
,
92 struct prefix
*un_prefix
);
94 extern void rfapiPrintAttrPtrs(void *stream
, struct attr
*attr
);
97 * Parse an address and put into a struct prefix
99 extern int rfapiCliGetPrefixAddr(struct vty
*vty
, const char *str
,
102 extern int rfapiCliGetRfapiIpAddr(struct vty
*vty
, const char *str
,
103 struct rfapi_ip_addr
*hai
);
105 extern void rfapiPrintNhl(void *stream
, struct rfapi_next_hop_entry
*next_hops
);
107 extern char *rfapiMonitorVpn2Str(struct rfapi_monitor_vpn
*m
, char *buf
,
110 extern const char *rfapiRfapiIpPrefix2Str(struct rfapi_ip_prefix
*p
, char *buf
,
113 extern void rfapiShowItNode(void *stream
, struct agg_node
*rn
);
115 extern char *rfapiEthAddr2Str(const struct ethaddr
*ea
, char *buf
, int bufsize
);
117 /* install vty commands */
118 extern void rfapi_vty_init(void);
120 /*------------------------------------------
121 * rfapiShowRemoteRegistrations
123 * UI helper: produces the "remote" portion of the output
124 * of "show vnc registrations".
127 * stream pointer to output stream
128 * prefix_only pointer to prefix. If non-NULL, print only registrations
129 * matching the specified prefix
130 * show_expiring if non-zero, show expiring registrations
131 * show_local if non-zero, show local registrations
132 * show_imported if non-zero, show imported registrations
136 * >0 something printed
137 --------------------------------------------*/
138 extern int rfapiShowRemoteRegistrations(void *stream
,
139 struct prefix
*prefix_only
,
140 int show_expiring
, int show_local
,
141 int show_remote
, int show_imported
);
143 /*------------------------------------------
144 * rfapi_monitor_count
146 * UI helper: count number of active monitors
149 * handle rfapi handle (NULL to count across
156 --------------------------------------------*/
157 extern uint32_t rfapi_monitor_count(rfapi_handle
);
159 extern int rfapiShowVncQueries(void *stream
, struct prefix
*pfx_match
);