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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef _QUAGGA_BGP_RFAPI_H
23 #define _QUAGGA_BGP_RFAPI_H
28 #include <netinet/in.h>
29 #include "lib/zebra.h"
31 #include "lib/prefix.h"
32 #include "bgpd/bgpd.h"
33 #include "bgpd/bgp_encap_types.h"
35 /* probably ought to have a field-specific define in config.h */
36 #ifndef s6_addr32 /* for solaris/bsd */
38 # define s6_addr32 _S6_un._S6_u32
40 # define s6_addr32 __u6_addr.__u6_addr32
44 #define RFAPI_V4_ADDR 0x04
45 #define RFAPI_V6_ADDR 0x06
46 #define RFAPI_SHOW_STR "VNC information\n"
48 struct rfapi_ip_addr
{
49 uint8_t addr_family
; /* AF_INET | AF_INET6 */
51 struct in_addr v4
; /* in network order */
52 struct in6_addr v6
; /* in network order */
56 struct rfapi_ip_prefix
{
58 uint8_t cost
; /* bgp local pref = 255 - cost */
59 struct rfapi_ip_addr prefix
;
62 struct rfapi_nexthop
{
67 struct rfapi_next_hop_entry
{
68 struct rfapi_next_hop_entry
*next
;
69 struct rfapi_ip_prefix prefix
;
71 struct rfapi_ip_addr un_address
;
72 struct rfapi_ip_addr vn_address
;
73 struct rfapi_vn_option
*vn_options
;
74 struct rfapi_un_option
*un_options
;
77 #define RFAPI_REMOVE_RESPONSE_LIFETIME 0
78 #define RFAPI_INFINITE_LIFETIME 0xFFFFFFFF
80 struct rfapi_l2address_option
{
81 struct ethaddr macaddr
; /* use 0 to assign label to IP prefix */
82 uint32_t label
; /* 20bit label in low bits, no TC, S, or TTL */
83 uint32_t logical_net_id
; /* ~= EVPN Ethernet Segment Id,
84 must not be zero for mac regis. */
86 uint16_t tag_id
; /* EVPN Ethernet Tag ID, 0 = none */
90 RFAPI_UN_OPTION_TYPE_PROVISIONAL
, /* internal use only */
91 RFAPI_UN_OPTION_TYPE_TUNNELTYPE
,
92 } rfapi_un_option_type
;
94 struct rfapi_tunneltype_option
{
97 struct bgp_encap_type_reserved reserved
;
98 struct bgp_encap_type_l2tpv3_over_ip l2tpv3_ip
;
99 struct bgp_encap_type_gre gre
;
100 struct bgp_encap_type_transmit_tunnel_endpoint
101 transmit_tunnel_endpoint
;
102 struct bgp_encap_type_ipsec_in_tunnel_mode ipsec_tunnel
;
103 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
105 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
107 struct bgp_encap_type_ip_in_ip ip_ip
;
108 struct bgp_encap_type_vxlan vxlan
;
109 struct bgp_encap_type_nvgre nvgre
;
110 struct bgp_encap_type_mpls mpls
;
111 struct bgp_encap_type_mpls_in_gre mpls_gre
;
112 struct bgp_encap_type_vxlan_gpe vxlan_gpe
;
113 struct bgp_encap_type_mpls_in_udp mpls_udp
;
114 struct bgp_encap_type_pbb pbb
;
118 struct rfapi_un_option
{
119 struct rfapi_un_option
*next
;
120 rfapi_un_option_type type
;
122 struct rfapi_tunneltype_option tunnel
;
127 RFAPI_VN_OPTION_TYPE_L2ADDR
=
128 3, /* Layer 2 address, 3 for legacy compatibility */
129 RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP
, /* for static routes */
130 RFAPI_VN_OPTION_TYPE_INTERNAL_RD
, /* internal use only */
131 } rfapi_vn_option_type
;
133 struct rfapi_vn_option
{
134 struct rfapi_vn_option
*next
;
136 rfapi_vn_option_type type
;
139 struct rfapi_l2address_option l2addr
;
142 * If this option is present, the next hop is local to the
143 * client NVE (i.e., not via a tunnel).
145 struct rfapi_nexthop local_nexthop
;
148 * For rfapi internal use only
150 struct prefix_rd internal_rd
;
154 struct rfapi_l2address_option_match
{
155 struct rfapi_l2address_option o
;
158 #define RFAPI_L2O_MACADDR 0x00000001
159 #define RFAPI_L2O_LABEL 0x00000002
160 #define RFAPI_L2O_LNI 0x00000004
161 #define RFAPI_L2O_LHI 0x00000008
164 #define VNC_CONFIG_STR "VNC/RFP related configuration\n"
166 typedef void *rfapi_handle
;
168 /***********************************************************************
170 ***********************************************************************/
171 /*------------------------------------------
172 * rfapi_response_cb_t (callback typedef)
174 * Callbacks of this type are used to provide asynchronous
175 * route updates from RFAPI to the RFP client.
178 * called to notify the rfp client that a next hop list
179 * that has previously been provided in response to an
180 * rfapi_query call has been updated. Deleted routes are indicated
181 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
183 * By default, the routes an NVE receives via this callback include
184 * its own routes (that it has registered). However, these may be
185 * filtered out if the global BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP
189 * called to notify the rfp client that a local route
190 * has been added or deleted. Deleted routes are indicated
191 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
194 * next_hops a list of possible next hops.
195 * This is a linked list allocated within the
196 * rfapi. The response_cb callback function is responsible
197 * for freeing this memory via rfapi_free_next_hop_list()
198 * in order to avoid memory leaks.
200 * userdata value (cookie) originally specified in call to
203 *------------------------------------------*/
204 typedef void(rfapi_response_cb_t
)(struct rfapi_next_hop_entry
*next_hops
,
207 /*------------------------------------------
208 * rfapi_nve_close_cb_t (callback typedef)
210 * Callbacks of this type are used to provide asynchronous
211 * notification that an rfapi_handle was invalidated
214 * pHandle Firmerly valid rfapi_handle returned to
215 * client via rfapi_open().
217 * reason EIDRM handle administratively closed (clear nve ...)
218 * ESTALE handle invalidated by configuration change
220 *------------------------------------------*/
221 typedef void(rfapi_nve_close_cb_t
)(rfapi_handle pHandle
, int reason
);
223 /*------------------------------------------
224 * rfp_cfg_write_cb_t (callback typedef)
226 * This callback is used to generate output for any config parameters
227 * that may supported by RFP via RFP defined vty commands at the bgp
228 * level. See loglevel as an example.
231 * vty -- quagga vty context
232 * rfp_start_val -- value returned by rfp_start
235 * to vty, rfp related configuration
239 --------------------------------------------*/
240 typedef int(rfp_cfg_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
);
242 /*------------------------------------------
243 * rfp_cfg_group_write_cb_t (callback typedef)
245 * This callback is used to generate output for any config parameters
246 * that may supported by RFP via RFP defined vty commands at the
247 * L2 or NVE level. See loglevel as an example.
250 * vty quagga vty context
251 * rfp_start_val value returned by rfp_start
254 * rfp_cfg_group Pointer to configuration structure
257 * to vty, rfp related configuration
261 --------------------------------------------*/
263 RFAPI_RFP_CFG_GROUP_DEFAULT
,
264 RFAPI_RFP_CFG_GROUP_NVE
,
265 RFAPI_RFP_CFG_GROUP_L2
266 } rfapi_rfp_cfg_group_type
;
268 typedef int(rfp_cfg_group_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
,
269 rfapi_rfp_cfg_group_type type
,
270 const char *name
, void *rfp_cfg_group
);
272 /***********************************************************************
273 * Configuration related defines and structures
274 ***********************************************************************/
276 struct rfapi_rfp_cb_methods
{
277 rfp_cfg_write_cb_t
*cfg_cb
; /* show top level config */
278 rfp_cfg_group_write_cb_t
*cfg_group_cb
; /* show group level config */
279 rfapi_response_cb_t
*response_cb
; /* unsolicited responses */
280 rfapi_response_cb_t
*local_cb
; /* local route add/delete */
281 rfapi_nve_close_cb_t
*close_cb
; /* handle closed */
285 * If a route with infinite lifetime is withdrawn, this is
286 * how long (in seconds) to wait before expiring it (because
287 * RFAPI_LIFETIME_MULTIPLIER_PCT * infinity is too long to wait)
289 #define RFAPI_LIFETIME_INFINITE_WITHDRAW_DELAY (60*120)
292 * the factor that should be applied to a prefix's <lifetime> value
293 * before using it to expire a withdrawn prefix, expressed as a percent.
294 * Thus, a value of 100 means to use the exact value of <lifetime>,
295 * a value of 200 means to use twice the value of <lifetime>, etc.
297 #define RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR 150
300 * This is used by rfapi to determine if RFP is using/supports
301 * a partial (i.e., cache) or full table download approach for
302 * mapping information. When full table download approach is
303 * used all information is passed to RFP after an initial
304 * rfapi_query. When partial table download is used, only
305 * information matching a query is passed.
308 RFAPI_RFP_DOWNLOAD_PARTIAL
= 0,
309 RFAPI_RFP_DOWNLOAD_FULL
310 } rfapi_rfp_download_type
;
312 #define RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL 1
314 struct rfapi_rfp_cfg
{
315 /* partial or full table download */
316 rfapi_rfp_download_type download_type
; /* default=partial */
318 * When full-table-download is enabled, this is the minimum
319 * number of seconds between times a non-queried prefix will
320 * be updated to a particular NVE.
321 * default: RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL
323 uint32_t ftd_advertisement_interval
;
325 * percentage of registration lifetime to continue to use information
326 * post soft-state refresh timeout
327 default: RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR
329 uint32_t holddown_factor
;
330 /* Control generation of updated RFP responses */
331 uint8_t use_updated_response
; /* default=0/no */
332 /* when use_updated_response, also generate remove responses */
333 uint8_t use_removes
; /* default=0/no */
336 /***********************************************************************
337 * Process related functions -- MUST be provided by the RFAPI user <<===
338 ***********************************************************************/
340 /*------------------------------------------
343 * This function will start the RFP code
346 * master quagga thread_master to tie into bgpd threads
349 * cfgp Pointer to rfapi_rfp_cfg (null = use defaults),
350 * copied by caller, updated via rfp_set_configuration
351 * cbmp Pointer to rfapi_rfp_cb_methods, may be null
352 * copied by caller, updated via rfapi_rfp_set_cb_methods
354 * rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
355 --------------------------------------------*/
356 extern void *rfp_start(struct thread_master
*master
,
357 struct rfapi_rfp_cfg
**cfgp
,
358 struct rfapi_rfp_cb_methods
**cbmp
);
360 /*------------------------------------------
363 * This function is called on shutdown to trigger RFP cleanup
372 --------------------------------------------*/
373 extern void rfp_stop(void *rfp_start_val
);
375 /***********************************************************************
376 * RFP processing behavior configuration
377 ***********************************************************************/
379 /*------------------------------------------
380 * rfapi_rfp_set_configuration
382 * This is used to change rfapi's processing behavior based on
386 * rfp_start_val value returned by rfp_start
387 * rfapi_rfp_cfg Pointer to configuration structure
394 * ENXIO Unabled to locate configured BGP/VNC
395 --------------------------------------------*/
396 extern int rfapi_rfp_set_configuration(void *rfp_start_val
,
397 struct rfapi_rfp_cfg
*rfp_cfg
);
399 /*------------------------------------------
400 * rfapi_rfp_set_cb_methods
402 * Change registered callback functions for asynchronous notifications
403 * from RFAPI to the RFP client.
406 * rfp_start_val value by rfp_start
407 * methods Pointer to struct rfapi_rfp_cb_methods containing
408 * pointers to callback methods as described above
412 * ENXIO BGP or VNC not configured
413 *------------------------------------------*/
414 extern int rfapi_rfp_set_cb_methods(void *rfp_start_val
,
415 struct rfapi_rfp_cb_methods
*methods
);
417 /***********************************************************************
418 * RFP group specific configuration
419 ***********************************************************************/
421 /*------------------------------------------
422 * rfapi_rfp_init_group_config_ptr_vty
424 * This is used to init or return a previously init'ed group specific
425 * configuration pointer. Group is identified by vty context.
426 * NOTE: size is ignored when a previously init'ed value is returned.
427 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
428 * bgp restart or shutdown.
431 * rfp_start_val value returned by rfp_start
433 * vty quagga vty context
434 * size number of bytes to allocation
440 * rfp_cfg_group NULL or Pointer to configuration structure
441 --------------------------------------------*/
442 extern void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val
,
443 rfapi_rfp_cfg_group_type type
,
447 /*------------------------------------------
448 * rfapi_rfp_get_group_config_ptr_vty
450 * This is used to get group specific configuration pointer.
451 * Group is identified by type and vty context.
452 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
453 * bgp restart or shutdown.
456 * rfp_start_val value returned by rfp_start
458 * vty quagga vty context
464 * rfp_cfg_group Pointer to configuration structure
465 --------------------------------------------*/
466 extern void *rfapi_rfp_get_group_config_ptr_vty(void *rfp_start_val
,
467 rfapi_rfp_cfg_group_type type
,
470 /*------------------------------------------
471 * rfp_group_config_search_cb_t (callback typedef)
473 * This callback is used to called from within a
474 * rfapi_rfp_get_group_config_ptr to check if the rfp_cfg_group
475 * matches the search criteria
478 * criteria RFAPI caller provided serach criteria
479 * rfp_cfg_group Pointer to configuration structure | NULL
486 --------------------------------------------*/
487 typedef int(rfp_group_config_search_cb_t
)(void *criteria
, void *rfp_cfg_group
);
489 /*------------------------------------------
490 * rfapi_rfp_get_group_config_ptr_name
492 * This is used to get group specific configuration pointer.
493 * Group is identified by type and name context.
494 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
495 * bgp restart or shutdown.
498 * rfp_start_val value returned by rfp_start
501 * criteria RFAPI caller provided serach criteria
502 * search_cb optional rfp_group_config_search_cb_t
508 * rfp_cfg_group Pointer to configuration structure
509 --------------------------------------------*/
510 extern void *rfapi_rfp_get_group_config_ptr_name(
511 void *rfp_start_val
, rfapi_rfp_cfg_group_type type
, const char *name
,
512 void *criteria
, rfp_group_config_search_cb_t
*search_cb
);
514 /*------------------------------------------
515 * rfapi_rfp_get_l2_group_config_ptr_lni
517 * This is used to get group specific configuration pointer.
518 * Group is identified by type and logical network identifier.
519 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
520 * bgp restart or shutdown.
523 * rfp_start_val value returned by rfp_start
524 * logical_net_id group logical network identifier
525 * criteria RFAPI caller provided serach criteria
526 * search_cb optional rfp_group_config_search_cb_t
532 * rfp_cfg_group Pointer to configuration structure
533 --------------------------------------------*/
535 rfapi_rfp_get_l2_group_config_ptr_lni(void *rfp_start_val
,
536 uint32_t logical_net_id
, void *criteria
,
537 rfp_group_config_search_cb_t
*search_cb
);
539 /***********************************************************************
541 ***********************************************************************/
543 /*------------------------------------------
546 * This function initializes a NVE record and associates it with
547 * the specified VN and underlay network addresses
550 * rfp_start_val value returned by rfp_start
551 * vn NVE virtual network address
553 * un NVE underlay network address
555 * default_options Default options to use on registrations.
556 * For now only tunnel type is supported.
557 * May be overridden per-prefix in rfapi_register().
558 * Caller owns (rfapi_open() does not free)
560 * response_cb Pointer to next hop list update callback function or
561 * NULL when no callbacks are desired.
563 * userdata Passed to subsequent response_cb invocations.
566 * response_lifetime The length of time that responses sent to this
569 * pHandle pointer to location to store rfapi handle. The
570 * handle must be passed on subsequent rfapi_ calls.
575 * EEXIST NVE with this {vn,un} already open
576 * ENOENT No matching nve group config
577 * ENOMSG Matched nve group config was incomplete
578 * ENXIO BGP or VNC not configured
579 * EAFNOSUPPORT Matched nve group specifies auto-assignment of RD,
580 * but underlay network address is not IPv4
581 * EDEADLK Called from within a callback procedure
582 *------------------------------------------*/
583 extern int rfapi_open(void *rfp_start_val
, struct rfapi_ip_addr
*vn
,
584 struct rfapi_ip_addr
*un
,
585 struct rfapi_un_option
*default_options
,
586 uint32_t *response_lifetime
, void *userdata
,
587 rfapi_handle
*pHandle
);
590 /*------------------------------------------
593 * Shut down NVE session and release associated data. Calling
594 * from within a rfapi callback procedure is permitted (the close
595 * will be completed asynchronously after the callback finishes).
598 * rfd: rfapi descriptor returned by rfapi_open
604 * EBADF invalid handle
605 * ENXIO BGP or VNC not configured
606 *------------------------------------------*/
607 extern int rfapi_close(rfapi_handle rfd
);
609 /*------------------------------------------
612 * Test rfapi descriptor
615 * rfd: rfapi descriptor returned by rfapi_open
620 * 0 Success: handle is valid and usable
621 * EINVAL null argument
622 * ESTALE formerly valid handle invalidated by config, needs close
623 * EBADF invalid handle
624 * ENXIO BGP or VNC not configured
625 * EAFNOSUPPORT Internal addressing error
626 *------------------------------------------*/
627 extern int rfapi_check(rfapi_handle rfd
);
629 /***********************************************************************
631 ***********************************************************************/
633 /*------------------------------------------
636 * This function queries the RIB for a
637 * particular route. Note that this call may result in subsequent
638 * callbacks to response_cb. Response callbacks can be cancelled
639 * by calling rfapi_query_done. A duplicate query using the same target
640 * will result in only one callback per change in next_hops. (i.e.,
641 * cancel/replace the prior query results.)
644 * rfd: rfapi descriptor returned by rfapi_open
645 * target: the destination address
646 * l2o ptr to L2 Options struct, NULL if not present in query
649 * ppNextHopEntry pointer to a location to store a pointer
650 * to the returned list of nexthops. It is the
651 * caller's responsibility to free this list
652 * via rfapi_free_next_hop_list().
657 * EBADF invalid handle
658 * ENOENT no valid route
659 * ENXIO BGP or VNC not configured
660 * ESTALE descriptor is no longer usable; should be closed
661 * EDEADLK Called from within a callback procedure
662 --------------------------------------------*/
663 extern int rfapi_query(rfapi_handle rfd
, struct rfapi_ip_addr
*target
,
664 struct rfapi_l2address_option
*l2o
,
665 struct rfapi_next_hop_entry
**ppNextHopEntry
);
667 /*------------------------------------------
670 * Notifies the rfapi that the user is no longer interested
671 * in the specified target.
674 * rfd: rfapi descriptor returned by rfapi_open
675 * target: the destination address
681 * EBADF invalid handle
682 * ENOENT no match found for target
683 * ENXIO BGP or VNC not configured
684 * ESTALE descriptor is no longer usable; should be closed
685 * EDEADLK Called from within a callback procedure
686 --------------------------------------------*/
687 extern int rfapi_query_done(rfapi_handle rfd
, struct rfapi_ip_addr
*target
);
689 /*------------------------------------------
690 * rfapi_query_done_all
692 * Notifies the rfapi that the user is no longer interested
696 * rfd: rfapi descriptor returned by rfapi_open
699 * count: number of queries cleared
703 * EBADF invalid handle
704 * ENXIO BGP or VNC not configured
705 * ESTALE descriptor is no longer usable; should be closed
706 * EDEADLK Called from within a callback procedure
707 --------------------------------------------*/
708 extern int rfapi_query_done_all(rfapi_handle rfd
, int *count
);
710 /*------------------------------------------
713 * Requests that reachability to the indicated prefix via this NVE
714 * be advertised by BGP. If <unregister> is non-zero, then the previously-
715 * advertised prefix should be withdrawn.
717 * (This function should NOT be called if the rfapi_open() function
721 * rfd: rfapi descriptor returned by rfapi_open
722 * prefix: A prefix to be registered or deregistered
723 * lifetime Prefix lifetime in seconds, host byte order
724 * options_un underlay netowrk options, may include tunnel-type
725 * Caller owns (rfapi_register() does not free).
726 * options_vn virtual network options, may include layer 2 address
727 * option and local-nexthop option
728 * Caller owns (rfapi_register() does not free).
730 * action: RFAPI_REGISTER_ADD add the route
731 * RFAPI_REGISTER_WITHDRAW withdraw route
732 * RFAPI_REGISTER_KILL withdraw without holddown
736 * EBADF invalid handle
737 * ENXIO BGP or VNC not configured
738 * ESTALE descriptor is no longer usable; should be closed
739 * EDEADLK Called from within a callback procedure
740 --------------------------------------------*/
744 RFAPI_REGISTER_WITHDRAW
,
746 } rfapi_register_action
;
748 extern int rfapi_register(rfapi_handle rfd
, struct rfapi_ip_prefix
*prefix
,
749 uint32_t lifetime
, struct rfapi_un_option
*options_un
,
750 struct rfapi_vn_option
*options_vn
,
751 rfapi_register_action action
);
753 /***********************************************************************
754 * Helper / Utility functions
755 ***********************************************************************/
757 /*------------------------------------------
760 * Get the virtual network address used by an NVE based on it's RFD
763 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
768 * vn NVE virtual network address
769 *------------------------------------------*/
770 extern struct rfapi_ip_addr
*rfapi_get_vn_addr(void *);
772 /*------------------------------------------
775 * Get the underlay network address used by an NVE based on it's RFD
778 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
783 * un NVE underlay network address
784 *------------------------------------------*/
785 extern struct rfapi_ip_addr
*rfapi_get_un_addr(void *);
787 /*------------------------------------------
790 * Returns a string describing the rfapi error code.
794 * code Error code returned by rfapi function
798 * const char * String
799 *------------------------------------------*/
800 extern const char *rfapi_error_str(int code
);
802 /*------------------------------------------
803 * rfapi_get_rfp_start_val
805 * Returns value passed to rfapi on rfp_start
808 * void * bgp structure
812 *------------------------------------------*/
813 extern void *rfapi_get_rfp_start_val(void *bgpv
);
815 /*------------------------------------------
818 * Compare two generic rfapi descriptors.
821 * rfd1: rfapi descriptor returned by rfapi_open or rfapi_create_generic
822 * rfd2: rfapi descriptor returned by rfapi_open or rfapi_create_generic
829 *------------------------------------------*/
830 extern int rfapi_compare_rfds(void *rfd1
, void *rfd2
);
832 /*------------------------------------------
833 * rfapi_free_next_hop_list
835 * Frees a next_hop_list returned by a rfapi_query invocation
838 * list: a pointer to a response list (as a
839 * struct rfapi_next_hop_entry) to free.
844 --------------------------------------------*/
845 extern void rfapi_free_next_hop_list(struct rfapi_next_hop_entry
*list
);
847 /*------------------------------------------
848 * rfapi_get_response_lifetime_default
850 * Returns the default lifetime for a response.
851 * rfp_start_val value returned by rfp_start or
852 * NULL (=use default instance)
859 * return value: The bgp instance default lifetime for a response.
860 --------------------------------------------*/
861 extern int rfapi_get_response_lifetime_default(void *rfp_start_val
);
863 /*------------------------------------------
864 * rfapi_is_vnc_configured
866 * Returns if VNC (BGP VPN messaging /VPN & encap SAFIs) are configured
869 * rfp_start_val value returned by rfp_start or
870 * NULL (=use default instance)
874 * return value: If VNC is configured for the bgpd instance
876 * ENXIO VNC not configured
877 --------------------------------------------*/
878 extern int rfapi_is_vnc_configured(void *rfp_start_val
);
880 /*------------------------------------------
881 * rfapi_bgp_lookup_by_rfp
883 * Find bgp instance pointer based on value returned by rfp_start
886 * rfp_start_val value returned by rfp_startor
887 * NULL (=get default instance)
893 * bgp bgp instance pointer
896 --------------------------------------------*/
897 extern struct bgp
*rfapi_bgp_lookup_by_rfp(void *rfp_start_val
);
899 /*------------------------------------------
900 * rfapi_get_rfp_start_val_by_bgp
902 * Find bgp instance pointer based on value returned by rfp_start
905 * bgp bgp instance pointer
914 --------------------------------------------*/
915 extern void *rfapi_get_rfp_start_val_by_bgp(struct bgp
*bgp
);
917 #endif /* ENABLE_BGP_VNC */
919 #endif /* _QUAGGA_BGP_RFAPI_H */