1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright 2009-2016, LabN Consulting, L.L.C.
8 #ifndef _QUAGGA_BGP_RFAPI_H
9 #define _QUAGGA_BGP_RFAPI_H
14 #include <netinet/in.h>
15 #include "lib/zebra.h"
17 #include "lib/prefix.h"
18 #include "bgpd/bgpd.h"
19 #include "bgpd/bgp_encap_types.h"
21 /* probably ought to have a field-specific define in config.h */
22 #ifndef s6_addr32 /* for solaris/bsd */
23 # define s6_addr32 __u6_addr.__u6_addr32
26 #define RFAPI_V4_ADDR 0x04
27 #define RFAPI_V6_ADDR 0x06
28 #define RFAPI_SHOW_STR "VNC information\n"
30 struct rfapi_ip_addr
{
31 uint8_t addr_family
; /* AF_INET | AF_INET6 */
33 struct in_addr v4
; /* in network order */
34 struct in6_addr v6
; /* in network order */
38 struct rfapi_ip_prefix
{
40 uint8_t cost
; /* bgp local pref = 255 - cost */
41 struct rfapi_ip_addr prefix
;
44 struct rfapi_nexthop
{
49 struct rfapi_next_hop_entry
{
50 struct rfapi_next_hop_entry
*next
;
51 struct rfapi_ip_prefix prefix
;
53 struct rfapi_ip_addr un_address
;
54 struct rfapi_ip_addr vn_address
;
55 struct rfapi_vn_option
*vn_options
;
56 struct rfapi_un_option
*un_options
;
59 #define RFAPI_REMOVE_RESPONSE_LIFETIME 0
60 #define RFAPI_INFINITE_LIFETIME 0xFFFFFFFF
62 struct rfapi_l2address_option
{
63 struct ethaddr macaddr
; /* use 0 to assign label to IP prefix */
64 uint32_t label
; /* 20bit label in low bits, no TC, S, or TTL */
65 uint32_t logical_net_id
; /* ~= EVPN Ethernet Segment Id,
66 must not be zero for mac regis. */
68 uint16_t tag_id
; /* EVPN Ethernet Tag ID, 0 = none */
72 RFAPI_UN_OPTION_TYPE_PROVISIONAL
, /* internal use only */
73 RFAPI_UN_OPTION_TYPE_TUNNELTYPE
,
74 } rfapi_un_option_type
;
76 struct rfapi_tunneltype_option
{
79 struct bgp_encap_type_reserved reserved
;
80 struct bgp_encap_type_l2tpv3_over_ip l2tpv3_ip
;
81 struct bgp_encap_type_gre gre
;
82 struct bgp_encap_type_transmit_tunnel_endpoint
83 transmit_tunnel_endpoint
;
84 struct bgp_encap_type_ipsec_in_tunnel_mode ipsec_tunnel
;
85 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
87 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
89 struct bgp_encap_type_ip_in_ip ip_ip
;
90 struct bgp_encap_type_vxlan vxlan
;
91 struct bgp_encap_type_nvgre nvgre
;
92 struct bgp_encap_type_mpls mpls
;
93 struct bgp_encap_type_mpls_in_gre mpls_gre
;
94 struct bgp_encap_type_vxlan_gpe vxlan_gpe
;
95 struct bgp_encap_type_mpls_in_udp mpls_udp
;
96 struct bgp_encap_type_pbb pbb
;
100 struct rfapi_un_option
{
101 struct rfapi_un_option
*next
;
102 rfapi_un_option_type type
;
104 struct rfapi_tunneltype_option tunnel
;
109 RFAPI_VN_OPTION_TYPE_L2ADDR
=
110 3, /* Layer 2 address, 3 for legacy compatibility */
111 RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP
, /* for static routes */
112 RFAPI_VN_OPTION_TYPE_INTERNAL_RD
, /* internal use only */
113 } rfapi_vn_option_type
;
115 struct rfapi_vn_option
{
116 struct rfapi_vn_option
*next
;
118 rfapi_vn_option_type type
;
121 struct rfapi_l2address_option l2addr
;
124 * If this option is present, the next hop is local to the
125 * client NVE (i.e., not via a tunnel).
127 struct rfapi_nexthop local_nexthop
;
130 * For rfapi internal use only
132 struct prefix_rd internal_rd
;
136 struct rfapi_l2address_option_match
{
137 struct rfapi_l2address_option o
;
140 #define RFAPI_L2O_MACADDR 0x00000001
141 #define RFAPI_L2O_LABEL 0x00000002
142 #define RFAPI_L2O_LNI 0x00000004
143 #define RFAPI_L2O_LHI 0x00000008
146 #define VNC_CONFIG_STR "VNC/RFP related configuration\n"
148 typedef void *rfapi_handle
;
150 /***********************************************************************
152 ***********************************************************************/
153 /*------------------------------------------
154 * rfapi_response_cb_t (callback typedef)
156 * Callbacks of this type are used to provide asynchronous
157 * route updates from RFAPI to the RFP client.
160 * called to notify the rfp client that a next hop list
161 * that has previously been provided in response to an
162 * rfapi_query call has been updated. Deleted routes are indicated
163 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
165 * By default, the routes an NVE receives via this callback include
166 * its own routes (that it has registered). However, these may be
167 * filtered out if the global BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP
171 * called to notify the rfp client that a local route
172 * has been added or deleted. Deleted routes are indicated
173 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
176 * next_hops a list of possible next hops.
177 * This is a linked list allocated within the
178 * rfapi. The response_cb callback function is responsible
179 * for freeing this memory via rfapi_free_next_hop_list()
180 * in order to avoid memory leaks.
182 * userdata value (cookie) originally specified in call to
185 *------------------------------------------*/
186 typedef void(rfapi_response_cb_t
)(struct rfapi_next_hop_entry
*next_hops
,
189 /*------------------------------------------
190 * rfapi_nve_close_cb_t (callback typedef)
192 * Callbacks of this type are used to provide asynchronous
193 * notification that an rfapi_handle was invalidated
196 * pHandle Firmerly valid rfapi_handle returned to
197 * client via rfapi_open().
199 * reason EIDRM handle administratively closed (clear nve ...)
200 * ESTALE handle invalidated by configuration change
202 *------------------------------------------*/
203 typedef void(rfapi_nve_close_cb_t
)(rfapi_handle pHandle
, int reason
);
205 /*------------------------------------------
206 * rfp_cfg_write_cb_t (callback typedef)
208 * This callback is used to generate output for any config parameters
209 * that may supported by RFP via RFP defined vty commands at the bgp
210 * level. See loglevel as an example.
213 * vty -- quagga vty context
214 * rfp_start_val -- value returned by rfp_start
217 * to vty, rfp related configuration
221 --------------------------------------------*/
222 typedef int(rfp_cfg_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
);
224 /*------------------------------------------
225 * rfp_cfg_group_write_cb_t (callback typedef)
227 * This callback is used to generate output for any config parameters
228 * that may supported by RFP via RFP defined vty commands at the
229 * L2 or NVE level. See loglevel as an example.
232 * vty quagga vty context
233 * rfp_start_val value returned by rfp_start
236 * rfp_cfg_group Pointer to configuration structure
239 * to vty, rfp related configuration
243 --------------------------------------------*/
245 RFAPI_RFP_CFG_GROUP_DEFAULT
,
246 RFAPI_RFP_CFG_GROUP_NVE
,
247 RFAPI_RFP_CFG_GROUP_L2
248 } rfapi_rfp_cfg_group_type
;
250 typedef int(rfp_cfg_group_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
,
251 rfapi_rfp_cfg_group_type type
,
252 const char *name
, void *rfp_cfg_group
);
254 /***********************************************************************
255 * Configuration related defines and structures
256 ***********************************************************************/
258 struct rfapi_rfp_cb_methods
{
259 rfp_cfg_write_cb_t
*cfg_cb
; /* show top level config */
260 rfp_cfg_group_write_cb_t
*cfg_group_cb
; /* show group level config */
261 rfapi_response_cb_t
*response_cb
; /* unsolicited responses */
262 rfapi_response_cb_t
*local_cb
; /* local route add/delete */
263 rfapi_nve_close_cb_t
*close_cb
; /* handle closed */
267 * If a route with infinite lifetime is withdrawn, this is
268 * how long (in seconds) to wait before expiring it (because
269 * RFAPI_LIFETIME_MULTIPLIER_PCT * infinity is too long to wait)
271 #define RFAPI_LIFETIME_INFINITE_WITHDRAW_DELAY (60*120)
274 * the factor that should be applied to a prefix's <lifetime> value
275 * before using it to expire a withdrawn prefix, expressed as a percent.
276 * Thus, a value of 100 means to use the exact value of <lifetime>,
277 * a value of 200 means to use twice the value of <lifetime>, etc.
279 #define RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR 150
282 * This is used by rfapi to determine if RFP is using/supports
283 * a partial (i.e., cache) or full table download approach for
284 * mapping information. When full table download approach is
285 * used all information is passed to RFP after an initial
286 * rfapi_query. When partial table download is used, only
287 * information matching a query is passed.
290 RFAPI_RFP_DOWNLOAD_PARTIAL
= 0,
291 RFAPI_RFP_DOWNLOAD_FULL
292 } rfapi_rfp_download_type
;
294 #define RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL 1
296 struct rfapi_rfp_cfg
{
297 /* partial or full table download */
298 rfapi_rfp_download_type download_type
; /* default=partial */
300 * When full-table-download is enabled, this is the minimum
301 * number of seconds between times a non-queried prefix will
302 * be updated to a particular NVE.
303 * default: RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL
305 uint32_t ftd_advertisement_interval
;
307 * percentage of registration lifetime to continue to use information
308 * post soft-state refresh timeout
309 default: RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR
311 uint32_t holddown_factor
;
312 /* Control generation of updated RFP responses */
313 uint8_t use_updated_response
; /* default=0/no */
314 /* when use_updated_response, also generate remove responses */
315 uint8_t use_removes
; /* default=0/no */
318 /***********************************************************************
319 * Process related functions -- MUST be provided by the RFAPI user <<===
320 ***********************************************************************/
322 /*------------------------------------------
325 * This function will start the RFP code
328 * master quagga thread_master to tie into bgpd threads
331 * cfgp Pointer to rfapi_rfp_cfg (null = use defaults),
332 * copied by caller, updated via rfp_set_configuration
333 * cbmp Pointer to rfapi_rfp_cb_methods, may be null
334 * copied by caller, updated via rfapi_rfp_set_cb_methods
336 * rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
337 --------------------------------------------*/
338 extern void *rfp_start(struct thread_master
*master
,
339 struct rfapi_rfp_cfg
**cfgp
,
340 struct rfapi_rfp_cb_methods
**cbmp
);
342 /*------------------------------------------
345 * This function is called on shutdown to trigger RFP cleanup
354 --------------------------------------------*/
355 extern void rfp_stop(void *rfp_start_val
);
357 /***********************************************************************
358 * RFP processing behavior configuration
359 ***********************************************************************/
361 /*------------------------------------------
362 * rfapi_rfp_set_configuration
364 * This is used to change rfapi's processing behavior based on
368 * rfp_start_val value returned by rfp_start
369 * rfapi_rfp_cfg Pointer to configuration structure
376 * ENXIO Unabled to locate configured BGP/VNC
377 --------------------------------------------*/
378 extern int rfapi_rfp_set_configuration(void *rfp_start_val
,
379 struct rfapi_rfp_cfg
*rfp_cfg
);
381 /*------------------------------------------
382 * rfapi_rfp_set_cb_methods
384 * Change registered callback functions for asynchronous notifications
385 * from RFAPI to the RFP client.
388 * rfp_start_val value by rfp_start
389 * methods Pointer to struct rfapi_rfp_cb_methods containing
390 * pointers to callback methods as described above
394 * ENXIO BGP or VNC not configured
395 *------------------------------------------*/
396 extern int rfapi_rfp_set_cb_methods(void *rfp_start_val
,
397 struct rfapi_rfp_cb_methods
*methods
);
399 /***********************************************************************
400 * RFP group specific configuration
401 ***********************************************************************/
403 /*------------------------------------------
404 * rfapi_rfp_init_group_config_ptr_vty
406 * This is used to init or return a previously init'ed group specific
407 * configuration pointer. Group is identified by vty context.
408 * NOTE: size is ignored when a previously init'ed value is returned.
409 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
410 * bgp restart or shutdown.
413 * rfp_start_val value returned by rfp_start
415 * vty quagga vty context
416 * size number of bytes to allocation
422 * rfp_cfg_group NULL or Pointer to configuration structure
423 --------------------------------------------*/
424 extern void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val
,
425 rfapi_rfp_cfg_group_type type
,
429 /*------------------------------------------
430 * rfapi_rfp_get_group_config_ptr_vty
432 * This is used to get group specific configuration pointer.
433 * Group is identified by type and vty context.
434 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
435 * bgp restart or shutdown.
438 * rfp_start_val value returned by rfp_start
440 * vty quagga vty context
446 * rfp_cfg_group Pointer to configuration structure
447 --------------------------------------------*/
448 extern void *rfapi_rfp_get_group_config_ptr_vty(void *rfp_start_val
,
449 rfapi_rfp_cfg_group_type type
,
452 /*------------------------------------------
453 * rfp_group_config_search_cb_t (callback typedef)
455 * This callback is used to called from within a
456 * rfapi_rfp_get_group_config_ptr to check if the rfp_cfg_group
457 * matches the search criteria
460 * criteria RFAPI caller provided serach criteria
461 * rfp_cfg_group Pointer to configuration structure | NULL
468 --------------------------------------------*/
469 typedef int(rfp_group_config_search_cb_t
)(void *criteria
, void *rfp_cfg_group
);
471 /*------------------------------------------
472 * rfapi_rfp_get_group_config_ptr_name
474 * This is used to get group specific configuration pointer.
475 * Group is identified by type and name context.
476 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
477 * bgp restart or shutdown.
480 * rfp_start_val value returned by rfp_start
483 * criteria RFAPI caller provided serach criteria
484 * search_cb optional rfp_group_config_search_cb_t
490 * rfp_cfg_group Pointer to configuration structure
491 --------------------------------------------*/
492 extern void *rfapi_rfp_get_group_config_ptr_name(
493 void *rfp_start_val
, rfapi_rfp_cfg_group_type type
, const char *name
,
494 void *criteria
, rfp_group_config_search_cb_t
*search_cb
);
496 /*------------------------------------------
497 * rfapi_rfp_get_l2_group_config_ptr_lni
499 * This is used to get group specific configuration pointer.
500 * Group is identified by type and logical network identifier.
501 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
502 * bgp restart or shutdown.
505 * rfp_start_val value returned by rfp_start
506 * logical_net_id group logical network identifier
507 * criteria RFAPI caller provided serach criteria
508 * search_cb optional rfp_group_config_search_cb_t
514 * rfp_cfg_group Pointer to configuration structure
515 --------------------------------------------*/
517 rfapi_rfp_get_l2_group_config_ptr_lni(void *rfp_start_val
,
518 uint32_t logical_net_id
, void *criteria
,
519 rfp_group_config_search_cb_t
*search_cb
);
521 /***********************************************************************
523 ***********************************************************************/
525 /*------------------------------------------
528 * This function initializes a NVE record and associates it with
529 * the specified VN and underlay network addresses
532 * rfp_start_val value returned by rfp_start
533 * vn NVE virtual network address
535 * un NVE underlay network address
537 * default_options Default options to use on registrations.
538 * For now only tunnel type is supported.
539 * May be overridden per-prefix in rfapi_register().
540 * Caller owns (rfapi_open() does not free)
542 * response_cb Pointer to next hop list update callback function or
543 * NULL when no callbacks are desired.
545 * userdata Passed to subsequent response_cb invocations.
548 * response_lifetime The length of time that responses sent to this
551 * pHandle pointer to location to store rfapi handle. The
552 * handle must be passed on subsequent rfapi_ calls.
557 * EEXIST NVE with this {vn,un} already open
558 * ENOENT No matching nve group config
559 * ENOMSG Matched nve group config was incomplete
560 * ENXIO BGP or VNC not configured
561 * EAFNOSUPPORT Matched nve group specifies auto-assignment of RD,
562 * but underlay network address is not IPv4
563 * EDEADLK Called from within a callback procedure
564 *------------------------------------------*/
565 extern int rfapi_open(void *rfp_start_val
, struct rfapi_ip_addr
*vn
,
566 struct rfapi_ip_addr
*un
,
567 struct rfapi_un_option
*default_options
,
568 uint32_t *response_lifetime
, void *userdata
,
569 rfapi_handle
*pHandle
);
572 /*------------------------------------------
575 * Shut down NVE session and release associated data. Calling
576 * from within a rfapi callback procedure is permitted (the close
577 * will be completed asynchronously after the callback finishes).
580 * rfd: rfapi descriptor returned by rfapi_open
586 * EBADF invalid handle
587 * ENXIO BGP or VNC not configured
588 *------------------------------------------*/
589 extern int rfapi_close(rfapi_handle rfd
);
591 /*------------------------------------------
594 * Test rfapi descriptor
597 * rfd: rfapi descriptor returned by rfapi_open
602 * 0 Success: handle is valid and usable
603 * EINVAL null argument
604 * ESTALE formerly valid handle invalidated by config, needs close
605 * EBADF invalid handle
606 * ENXIO BGP or VNC not configured
607 * EAFNOSUPPORT Internal addressing error
608 *------------------------------------------*/
609 extern int rfapi_check(rfapi_handle rfd
);
611 /***********************************************************************
613 ***********************************************************************/
615 /*------------------------------------------
618 * This function queries the RIB for a
619 * particular route. Note that this call may result in subsequent
620 * callbacks to response_cb. Response callbacks can be cancelled
621 * by calling rfapi_query_done. A duplicate query using the same target
622 * will result in only one callback per change in next_hops. (i.e.,
623 * cancel/replace the prior query results.)
626 * rfd: rfapi descriptor returned by rfapi_open
627 * target: the destination address
628 * l2o ptr to L2 Options struct, NULL if not present in query
631 * ppNextHopEntry pointer to a location to store a pointer
632 * to the returned list of nexthops. It is the
633 * caller's responsibility to free this list
634 * via rfapi_free_next_hop_list().
639 * EBADF invalid handle
640 * ENOENT no valid route
641 * ENXIO BGP or VNC not configured
642 * ESTALE descriptor is no longer usable; should be closed
643 * EDEADLK Called from within a callback procedure
644 --------------------------------------------*/
645 extern int rfapi_query(rfapi_handle rfd
, struct rfapi_ip_addr
*target
,
646 struct rfapi_l2address_option
*l2o
,
647 struct rfapi_next_hop_entry
**ppNextHopEntry
);
649 /*------------------------------------------
652 * Notifies the rfapi that the user is no longer interested
653 * in the specified target.
656 * rfd: rfapi descriptor returned by rfapi_open
657 * target: the destination address
663 * EBADF invalid handle
664 * ENOENT no match found for target
665 * ENXIO BGP or VNC not configured
666 * ESTALE descriptor is no longer usable; should be closed
667 * EDEADLK Called from within a callback procedure
668 --------------------------------------------*/
669 extern int rfapi_query_done(rfapi_handle rfd
, struct rfapi_ip_addr
*target
);
671 /*------------------------------------------
672 * rfapi_query_done_all
674 * Notifies the rfapi that the user is no longer interested
678 * rfd: rfapi descriptor returned by rfapi_open
681 * count: number of queries cleared
685 * EBADF invalid handle
686 * ENXIO BGP or VNC not configured
687 * ESTALE descriptor is no longer usable; should be closed
688 * EDEADLK Called from within a callback procedure
689 --------------------------------------------*/
690 extern int rfapi_query_done_all(rfapi_handle rfd
, int *count
);
692 /*------------------------------------------
695 * Requests that reachability to the indicated prefix via this NVE
696 * be advertised by BGP. If <unregister> is non-zero, then the previously-
697 * advertised prefix should be withdrawn.
699 * (This function should NOT be called if the rfapi_open() function
703 * rfd: rfapi descriptor returned by rfapi_open
704 * prefix: A prefix to be registered or deregistered
705 * lifetime Prefix lifetime in seconds, host byte order
706 * options_un underlay netowrk options, may include tunnel-type
707 * Caller owns (rfapi_register() does not free).
708 * options_vn virtual network options, may include layer 2 address
709 * option and local-nexthop option
710 * Caller owns (rfapi_register() does not free).
712 * action: RFAPI_REGISTER_ADD add the route
713 * RFAPI_REGISTER_WITHDRAW withdraw route
714 * RFAPI_REGISTER_KILL withdraw without holddown
718 * EBADF invalid handle
719 * ENXIO BGP or VNC not configured
720 * ESTALE descriptor is no longer usable; should be closed
721 * EDEADLK Called from within a callback procedure
722 --------------------------------------------*/
726 RFAPI_REGISTER_WITHDRAW
,
728 } rfapi_register_action
;
730 extern int rfapi_register(rfapi_handle rfd
, struct rfapi_ip_prefix
*prefix
,
731 uint32_t lifetime
, struct rfapi_un_option
*options_un
,
732 struct rfapi_vn_option
*options_vn
,
733 rfapi_register_action action
);
735 /***********************************************************************
736 * Helper / Utility functions
737 ***********************************************************************/
739 /*------------------------------------------
742 * Get the virtual network address used by an NVE based on it's RFD
745 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
750 * vn NVE virtual network address
751 *------------------------------------------*/
752 extern struct rfapi_ip_addr
*rfapi_get_vn_addr(void *);
754 /*------------------------------------------
757 * Get the underlay network address used by an NVE based on it's RFD
760 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
765 * un NVE underlay network address
766 *------------------------------------------*/
767 extern struct rfapi_ip_addr
*rfapi_get_un_addr(void *);
769 /*------------------------------------------
772 * Returns a string describing the rfapi error code.
776 * code Error code returned by rfapi function
780 * const char * String
781 *------------------------------------------*/
782 extern const char *rfapi_error_str(int code
);
784 /*------------------------------------------
785 * rfapi_get_rfp_start_val
787 * Returns value passed to rfapi on rfp_start
790 * void * bgp structure
794 *------------------------------------------*/
795 extern void *rfapi_get_rfp_start_val(void *bgpv
);
797 /*------------------------------------------
800 * Compare two generic rfapi descriptors.
803 * rfd1: rfapi descriptor returned by rfapi_open or rfapi_create_generic
804 * rfd2: rfapi descriptor returned by rfapi_open or rfapi_create_generic
811 *------------------------------------------*/
812 extern int rfapi_compare_rfds(void *rfd1
, void *rfd2
);
814 /*------------------------------------------
815 * rfapi_free_next_hop_list
817 * Frees a next_hop_list returned by a rfapi_query invocation
820 * list: a pointer to a response list (as a
821 * struct rfapi_next_hop_entry) to free.
826 --------------------------------------------*/
827 extern void rfapi_free_next_hop_list(struct rfapi_next_hop_entry
*list
);
829 /*------------------------------------------
830 * rfapi_get_response_lifetime_default
832 * Returns the default lifetime for a response.
833 * rfp_start_val value returned by rfp_start or
834 * NULL (=use default instance)
841 * return value: The bgp instance default lifetime for a response.
842 --------------------------------------------*/
843 extern int rfapi_get_response_lifetime_default(void *rfp_start_val
);
845 /*------------------------------------------
846 * rfapi_is_vnc_configured
848 * Returns if VNC is configured
851 * rfp_start_val value returned by rfp_start or
852 * NULL (=use default instance)
856 * return value: If VNC is configured for the bgpd instance
858 * ENXIO VNC not configured
859 --------------------------------------------*/
860 extern int rfapi_is_vnc_configured(void *rfp_start_val
);
862 /*------------------------------------------
863 * rfapi_bgp_lookup_by_rfp
865 * Find bgp instance pointer based on value returned by rfp_start
868 * rfp_start_val value returned by rfp_startor
869 * NULL (=get default instance)
875 * bgp bgp instance pointer
878 --------------------------------------------*/
879 extern struct bgp
*rfapi_bgp_lookup_by_rfp(void *rfp_start_val
);
881 /*------------------------------------------
882 * rfapi_get_rfp_start_val_by_bgp
884 * Find bgp instance pointer based on value returned by rfp_start
887 * bgp bgp instance pointer
896 --------------------------------------------*/
897 extern void *rfapi_get_rfp_start_val_by_bgp(struct bgp
*bgp
);
899 #endif /* ENABLE_BGP_VNC */
901 #endif /* _QUAGGA_BGP_RFAPI_H */