3 * Copyright 2009-2016, LabN Consulting, L.L.C.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 SHOW_NVE_SUMMARY_ACTIVE_NVES
,
28 SHOW_NVE_SUMMARY_UNKNOWN_NVES
, /* legacy */
29 SHOW_NVE_SUMMARY_REGISTERED
,
30 SHOW_NVE_SUMMARY_QUERIES
,
31 SHOW_NVE_SUMMARY_RESPONSES
,
35 #define VNC_SHOW_STR "VNC information\n"
37 extern char *rfapiFormatSeconds(uint32_t seconds
, char *buf
, size_t len
);
39 extern char *rfapiFormatAge(time_t age
, char *buf
, size_t len
);
41 extern void rfapiRprefixApplyMask(struct rfapi_ip_prefix
*rprefix
);
43 extern int rfapiQprefix2Raddr(struct prefix
*qprefix
,
44 struct rfapi_ip_addr
*raddr
);
46 extern void rfapiQprefix2Rprefix(struct prefix
*qprefix
,
47 struct rfapi_ip_prefix
*rprefix
);
49 extern int rfapiRprefix2Qprefix(struct rfapi_ip_prefix
*rprefix
,
50 struct prefix
*qprefix
);
52 extern int rfapiRaddr2Qprefix(struct rfapi_ip_addr
*hia
, struct prefix
*pfx
);
54 extern int rfapiRprefixSame(struct rfapi_ip_prefix
*hp1
,
55 struct rfapi_ip_prefix
*hp2
);
57 extern void rfapiL2o2Qprefix(struct rfapi_l2address_option
*l2o
,
60 extern int rfapiStr2EthAddr(const char *str
, struct ethaddr
*ea
);
62 extern const char *rfapi_ntop(int af
, const void *src
, char *buf
,
65 extern int rfapiDebugPrintf(void *dummy
, const char *format
, ...);
67 extern int rfapiStream2Vty(void *stream
, /* input */
68 int (**fp
)(void *, const char *, ...), /* output */
69 struct vty
**vty
, /* output */
70 void **outstream
, /* output */
71 const char **vty_newline
); /* output */
73 /*------------------------------------------
74 * rfapiRfapiIpAddr2Str
76 * UI helper: generate string from rfapi_ip_addr
83 * bufsize max space to write
86 * NULL conversion failed
87 * non-NULL pointer to buf
88 --------------------------------------------*/
89 extern const char *rfapiRfapiIpAddr2Str(struct rfapi_ip_addr
*a
, char *buf
,
92 extern void rfapiPrintRfapiIpAddr(void *stream
, struct rfapi_ip_addr
*a
);
94 extern void rfapiPrintRfapiIpPrefix(void *stream
, struct rfapi_ip_prefix
*p
);
96 void rfapiPrintRd(struct vty
*vty
, struct prefix_rd
*prd
);
98 extern void rfapiPrintAdvertisedInfo(struct vty
*vty
,
99 struct rfapi_descriptor
*rfd
, safi_t safi
,
102 extern void rfapiPrintDescriptor(struct vty
*vty
, struct rfapi_descriptor
*rfd
);
104 extern void rfapiPrintMatchingDescriptors(struct vty
*vty
,
105 struct prefix
*vn_prefix
,
106 struct prefix
*un_prefix
);
108 extern void rfapiPrintAttrPtrs(void *stream
, struct attr
*attr
);
111 * Parse an address and put into a struct prefix
113 extern int rfapiCliGetPrefixAddr(struct vty
*vty
, const char *str
,
116 extern int rfapiCliGetRfapiIpAddr(struct vty
*vty
, const char *str
,
117 struct rfapi_ip_addr
*hai
);
119 extern void rfapiPrintNhl(void *stream
, struct rfapi_next_hop_entry
*next_hops
);
121 extern char *rfapiMonitorVpn2Str(struct rfapi_monitor_vpn
*m
, char *buf
,
124 extern const char *rfapiRfapiIpPrefix2Str(struct rfapi_ip_prefix
*p
, char *buf
,
127 extern void rfapiShowItNode(void *stream
, struct route_node
*rn
);
129 extern char *rfapiEthAddr2Str(const struct ethaddr
*ea
, char *buf
, int bufsize
);
131 /* install vty commands */
132 extern void rfapi_vty_init(void);
134 /*------------------------------------------
135 * rfapiShowRemoteRegistrations
137 * UI helper: produces the "remote" portion of the output
138 * of "show vnc registrations".
141 * stream pointer to output stream
142 * prefix_only pointer to prefix. If non-NULL, print only registrations
143 * matching the specified prefix
144 * show_expiring if non-zero, show expiring registrations
145 * show_local if non-zero, show local registrations
146 * show_imported if non-zero, show imported registrations
150 * >0 something printed
151 --------------------------------------------*/
152 extern int rfapiShowRemoteRegistrations(void *stream
,
153 struct prefix
*prefix_only
,
154 int show_expiring
, int show_local
,
155 int show_remote
, int show_imported
);
157 /*------------------------------------------
158 * rfapi_monitor_count
160 * UI helper: count number of active monitors
163 * handle rfapi handle (NULL to count across
170 --------------------------------------------*/
171 extern uint32_t rfapi_monitor_count(rfapi_handle
);
173 extern int rfapiShowVncQueries(void *stream
, struct prefix
*pfx_match
);