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
28 SHOW_NVE_SUMMARY_ACTIVE_NVES
,
29 SHOW_NVE_SUMMARY_UNKNOWN_NVES
, /* legacy */
30 SHOW_NVE_SUMMARY_REGISTERED
,
31 SHOW_NVE_SUMMARY_QUERIES
,
32 SHOW_NVE_SUMMARY_RESPONSES
,
36 #define VNC_SHOW_STR "VNC information\n"
39 rfapiFormatSeconds (uint32_t seconds
, char *buf
, size_t len
);
42 rfapiFormatAge (time_t age
, char *buf
, size_t len
);
45 rfapiRprefixApplyMask (struct rfapi_ip_prefix
*rprefix
);
48 rfapiQprefix2Raddr (struct prefix
*qprefix
, struct rfapi_ip_addr
*raddr
);
51 rfapiQprefix2Rprefix (struct prefix
*qprefix
,
52 struct rfapi_ip_prefix
*rprefix
);
55 rfapiRprefix2Qprefix (struct rfapi_ip_prefix
*rprefix
,
56 struct prefix
*qprefix
);
59 rfapiRaddr2Qprefix (struct rfapi_ip_addr
*hia
, struct prefix
*pfx
);
62 rfapiRprefixSame (struct rfapi_ip_prefix
*hp1
, struct rfapi_ip_prefix
*hp2
);
65 rfapiL2o2Qprefix (struct rfapi_l2address_option
*l2o
, struct prefix
*pfx
);
68 rfapiStr2EthAddr (const char *str
, struct ethaddr
*ea
);
78 rfapiDebugPrintf (void *dummy
, const char *format
, ...);
82 void *stream
, /* input */
83 int (**fp
) (void *, const char *, ...), /* output */
84 struct vty
**vty
, /* output */
85 void **outstream
, /* output */
86 const char **vty_newline
); /* output */
88 /*------------------------------------------
89 * rfapiRfapiIpAddr2Str
91 * UI helper: generate string from rfapi_ip_addr
98 * bufsize max space to write
101 * NULL conversion failed
102 * non-NULL pointer to buf
103 --------------------------------------------*/
105 rfapiRfapiIpAddr2Str (struct rfapi_ip_addr
*a
, char *buf
, int bufsize
);
108 rfapiPrintRfapiIpAddr (void *stream
, struct rfapi_ip_addr
*a
);
111 rfapiPrintRfapiIpPrefix (void *stream
, struct rfapi_ip_prefix
*p
);
114 rfapiPrintRd (struct vty
*vty
, struct prefix_rd
*prd
);
117 rfapiPrintAdvertisedInfo (
119 struct rfapi_descriptor
*rfd
,
124 rfapiPrintDescriptor (struct vty
*vty
, struct rfapi_descriptor
*rfd
);
127 rfapiPrintMatchingDescriptors (struct vty
*vty
,
128 struct prefix
*vn_prefix
,
129 struct prefix
*un_prefix
);
132 rfapiPrintAttrPtrs (void *stream
, struct attr
*attr
);
135 * Parse an address and put into a struct prefix
138 rfapiCliGetPrefixAddr (struct vty
*vty
, const char *str
, struct prefix
*p
);
141 rfapiCliGetRfapiIpAddr (
144 struct rfapi_ip_addr
*hai
);
147 rfapiPrintNhl (void *stream
, struct rfapi_next_hop_entry
*next_hops
);
150 rfapiMonitorVpn2Str (
151 struct rfapi_monitor_vpn
*m
,
156 rfapiRfapiIpPrefix2Str (
157 struct rfapi_ip_prefix
*p
,
162 rfapiShowItNode (void *stream
, struct route_node
*rn
);
166 const struct ethaddr
*ea
,
170 /* install vty commands */
172 rfapi_vty_init (void);
174 /*------------------------------------------
175 * rfapiShowRemoteRegistrations
177 * UI helper: produces the "remote" portion of the output
178 * of "show vnc registrations".
181 * stream pointer to output stream
182 * prefix_only pointer to prefix. If non-NULL, print only registrations
183 * matching the specified prefix
184 * show_expiring if non-zero, show expiring registrations
185 * show_local if non-zero, show local registrations
186 * show_imported if non-zero, show imported registrations
190 * >0 something printed
191 --------------------------------------------*/
193 rfapiShowRemoteRegistrations (
195 struct prefix
*prefix_only
,
201 /*------------------------------------------
202 * rfapi_monitor_count
204 * UI helper: count number of active monitors
207 * handle rfapi handle (NULL to count across
214 --------------------------------------------*/
216 rfapi_monitor_count (rfapi_handle
);
219 rfapiShowVncQueries (void *stream
, struct prefix
*pfx_match
);