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
21 #ifndef _QUAGGA_BGP_RFAPI_H
22 #define _QUAGGA_BGP_RFAPI_H
27 #include <netinet/in.h>
28 #include "lib/zebra.h"
30 #include "lib/prefix.h"
31 #include "bgpd/bgpd.h"
32 #include "bgpd/bgp_encap_types.h"
34 /* probably ought to have a field-specific define in config.h */
35 #ifndef s6_addr32 /* for solaris/bsd */
36 # define s6_addr32 __u6_addr.__u6_addr32
39 #define RFAPI_V4_ADDR 0x04
40 #define RFAPI_V6_ADDR 0x06
41 #define RFAPI_SHOW_STR "VNC information\n"
43 struct rfapi_ip_addr
{
44 uint8_t addr_family
; /* AF_INET | AF_INET6 */
46 struct in_addr v4
; /* in network order */
47 struct in6_addr v6
; /* in network order */
51 struct rfapi_ip_prefix
{
53 uint8_t cost
; /* bgp local pref = 255 - cost */
54 struct rfapi_ip_addr prefix
;
57 struct rfapi_nexthop
{
62 struct rfapi_next_hop_entry
{
63 struct rfapi_next_hop_entry
*next
;
64 struct rfapi_ip_prefix prefix
;
66 struct rfapi_ip_addr un_address
;
67 struct rfapi_ip_addr vn_address
;
68 struct rfapi_vn_option
*vn_options
;
69 struct rfapi_un_option
*un_options
;
72 #define RFAPI_REMOVE_RESPONSE_LIFETIME 0
73 #define RFAPI_INFINITE_LIFETIME 0xFFFFFFFF
75 struct rfapi_l2address_option
{
76 struct ethaddr macaddr
; /* use 0 to assign label to IP prefix */
77 uint32_t label
; /* 20bit label in low bits, no TC, S, or TTL */
78 uint32_t logical_net_id
; /* ~= EVPN Ethernet Segment Id,
79 must not be zero for mac regis. */
81 uint16_t tag_id
; /* EVPN Ethernet Tag ID, 0 = none */
85 RFAPI_UN_OPTION_TYPE_PROVISIONAL
, /* internal use only */
86 RFAPI_UN_OPTION_TYPE_TUNNELTYPE
,
87 } rfapi_un_option_type
;
89 struct rfapi_tunneltype_option
{
92 struct bgp_encap_type_reserved reserved
;
93 struct bgp_encap_type_l2tpv3_over_ip l2tpv3_ip
;
94 struct bgp_encap_type_gre gre
;
95 struct bgp_encap_type_transmit_tunnel_endpoint
96 transmit_tunnel_endpoint
;
97 struct bgp_encap_type_ipsec_in_tunnel_mode ipsec_tunnel
;
98 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
100 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
102 struct bgp_encap_type_ip_in_ip ip_ip
;
103 struct bgp_encap_type_vxlan vxlan
;
104 struct bgp_encap_type_nvgre nvgre
;
105 struct bgp_encap_type_mpls mpls
;
106 struct bgp_encap_type_mpls_in_gre mpls_gre
;
107 struct bgp_encap_type_vxlan_gpe vxlan_gpe
;
108 struct bgp_encap_type_mpls_in_udp mpls_udp
;
109 struct bgp_encap_type_pbb pbb
;
113 struct rfapi_un_option
{
114 struct rfapi_un_option
*next
;
115 rfapi_un_option_type type
;
117 struct rfapi_tunneltype_option tunnel
;
122 RFAPI_VN_OPTION_TYPE_L2ADDR
=
123 3, /* Layer 2 address, 3 for legacy compatibility */
124 RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP
, /* for static routes */
125 RFAPI_VN_OPTION_TYPE_INTERNAL_RD
, /* internal use only */
126 } rfapi_vn_option_type
;
128 struct rfapi_vn_option
{
129 struct rfapi_vn_option
*next
;
131 rfapi_vn_option_type type
;
134 struct rfapi_l2address_option l2addr
;
137 * If this option is present, the next hop is local to the
138 * client NVE (i.e., not via a tunnel).
140 struct rfapi_nexthop local_nexthop
;
143 * For rfapi internal use only
145 struct prefix_rd internal_rd
;
149 struct rfapi_l2address_option_match
{
150 struct rfapi_l2address_option o
;
153 #define RFAPI_L2O_MACADDR 0x00000001
154 #define RFAPI_L2O_LABEL 0x00000002
155 #define RFAPI_L2O_LNI 0x00000004
156 #define RFAPI_L2O_LHI 0x00000008
159 #define VNC_CONFIG_STR "VNC/RFP related configuration\n"
161 typedef void *rfapi_handle
;
163 /***********************************************************************
165 ***********************************************************************/
166 /*------------------------------------------
167 * rfapi_response_cb_t (callback typedef)
169 * Callbacks of this type are used to provide asynchronous
170 * route updates from RFAPI to the RFP client.
173 * called to notify the rfp client that a next hop list
174 * that has previously been provided in response to an
175 * rfapi_query call has been updated. Deleted routes are indicated
176 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
178 * By default, the routes an NVE receives via this callback include
179 * its own routes (that it has registered). However, these may be
180 * filtered out if the global BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP
184 * called to notify the rfp client that a local route
185 * has been added or deleted. Deleted routes are indicated
186 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
189 * next_hops a list of possible next hops.
190 * This is a linked list allocated within the
191 * rfapi. The response_cb callback function is responsible
192 * for freeing this memory via rfapi_free_next_hop_list()
193 * in order to avoid memory leaks.
195 * userdata value (cookie) originally specified in call to
198 *------------------------------------------*/
199 typedef void(rfapi_response_cb_t
)(struct rfapi_next_hop_entry
*next_hops
,
202 /*------------------------------------------
203 * rfapi_nve_close_cb_t (callback typedef)
205 * Callbacks of this type are used to provide asynchronous
206 * notification that an rfapi_handle was invalidated
209 * pHandle Firmerly valid rfapi_handle returned to
210 * client via rfapi_open().
212 * reason EIDRM handle administratively closed (clear nve ...)
213 * ESTALE handle invalidated by configuration change
215 *------------------------------------------*/
216 typedef void(rfapi_nve_close_cb_t
)(rfapi_handle pHandle
, int reason
);
218 /*------------------------------------------
219 * rfp_cfg_write_cb_t (callback typedef)
221 * This callback is used to generate output for any config parameters
222 * that may supported by RFP via RFP defined vty commands at the bgp
223 * level. See loglevel as an example.
226 * vty -- quagga vty context
227 * rfp_start_val -- value returned by rfp_start
230 * to vty, rfp related configuration
234 --------------------------------------------*/
235 typedef int(rfp_cfg_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
);
237 /*------------------------------------------
238 * rfp_cfg_group_write_cb_t (callback typedef)
240 * This callback is used to generate output for any config parameters
241 * that may supported by RFP via RFP defined vty commands at the
242 * L2 or NVE level. See loglevel as an example.
245 * vty quagga vty context
246 * rfp_start_val value returned by rfp_start
249 * rfp_cfg_group Pointer to configuration structure
252 * to vty, rfp related configuration
256 --------------------------------------------*/
258 RFAPI_RFP_CFG_GROUP_DEFAULT
,
259 RFAPI_RFP_CFG_GROUP_NVE
,
260 RFAPI_RFP_CFG_GROUP_L2
261 } rfapi_rfp_cfg_group_type
;
263 typedef int(rfp_cfg_group_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
,
264 rfapi_rfp_cfg_group_type type
,
265 const char *name
, void *rfp_cfg_group
);
267 /***********************************************************************
268 * Configuration related defines and structures
269 ***********************************************************************/
271 struct rfapi_rfp_cb_methods
{
272 rfp_cfg_write_cb_t
*cfg_cb
; /* show top level config */
273 rfp_cfg_group_write_cb_t
*cfg_group_cb
; /* show group level config */
274 rfapi_response_cb_t
*response_cb
; /* unsolicited responses */
275 rfapi_response_cb_t
*local_cb
; /* local route add/delete */
276 rfapi_nve_close_cb_t
*close_cb
; /* handle closed */
280 * If a route with infinite lifetime is withdrawn, this is
281 * how long (in seconds) to wait before expiring it (because
282 * RFAPI_LIFETIME_MULTIPLIER_PCT * infinity is too long to wait)
284 #define RFAPI_LIFETIME_INFINITE_WITHDRAW_DELAY (60*120)
287 * the factor that should be applied to a prefix's <lifetime> value
288 * before using it to expire a withdrawn prefix, expressed as a percent.
289 * Thus, a value of 100 means to use the exact value of <lifetime>,
290 * a value of 200 means to use twice the value of <lifetime>, etc.
292 #define RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR 150
295 * This is used by rfapi to determine if RFP is using/supports
296 * a partial (i.e., cache) or full table download approach for
297 * mapping information. When full table download approach is
298 * used all information is passed to RFP after an initial
299 * rfapi_query. When partial table download is used, only
300 * information matching a query is passed.
303 RFAPI_RFP_DOWNLOAD_PARTIAL
= 0,
304 RFAPI_RFP_DOWNLOAD_FULL
305 } rfapi_rfp_download_type
;
307 #define RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL 1
309 struct rfapi_rfp_cfg
{
310 /* partial or full table download */
311 rfapi_rfp_download_type download_type
; /* default=partial */
313 * When full-table-download is enabled, this is the minimum
314 * number of seconds between times a non-queried prefix will
315 * be updated to a particular NVE.
316 * default: RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL
318 uint32_t ftd_advertisement_interval
;
320 * percentage of registration lifetime to continue to use information
321 * post soft-state refresh timeout
322 default: RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR
324 uint32_t holddown_factor
;
325 /* Control generation of updated RFP responses */
326 uint8_t use_updated_response
; /* default=0/no */
327 /* when use_updated_response, also generate remove responses */
328 uint8_t use_removes
; /* default=0/no */
331 /***********************************************************************
332 * Process related functions -- MUST be provided by the RFAPI user <<===
333 ***********************************************************************/
335 /*------------------------------------------
338 * This function will start the RFP code
341 * master quagga thread_master to tie into bgpd threads
344 * cfgp Pointer to rfapi_rfp_cfg (null = use defaults),
345 * copied by caller, updated via rfp_set_configuration
346 * cbmp Pointer to rfapi_rfp_cb_methods, may be null
347 * copied by caller, updated via rfapi_rfp_set_cb_methods
349 * rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
350 --------------------------------------------*/
351 extern void *rfp_start(struct thread_master
*master
,
352 struct rfapi_rfp_cfg
**cfgp
,
353 struct rfapi_rfp_cb_methods
**cbmp
);
355 /*------------------------------------------
358 * This function is called on shutdown to trigger RFP cleanup
367 --------------------------------------------*/
368 extern void rfp_stop(void *rfp_start_val
);
370 /***********************************************************************
371 * RFP processing behavior configuration
372 ***********************************************************************/
374 /*------------------------------------------
375 * rfapi_rfp_set_configuration
377 * This is used to change rfapi's processing behavior based on
381 * rfp_start_val value returned by rfp_start
382 * rfapi_rfp_cfg Pointer to configuration structure
389 * ENXIO Unabled to locate configured BGP/VNC
390 --------------------------------------------*/
391 extern int rfapi_rfp_set_configuration(void *rfp_start_val
,
392 struct rfapi_rfp_cfg
*rfp_cfg
);
394 /*------------------------------------------
395 * rfapi_rfp_set_cb_methods
397 * Change registered callback functions for asynchronous notifications
398 * from RFAPI to the RFP client.
401 * rfp_start_val value by rfp_start
402 * methods Pointer to struct rfapi_rfp_cb_methods containing
403 * pointers to callback methods as described above
407 * ENXIO BGP or VNC not configured
408 *------------------------------------------*/
409 extern int rfapi_rfp_set_cb_methods(void *rfp_start_val
,
410 struct rfapi_rfp_cb_methods
*methods
);
412 /***********************************************************************
413 * RFP group specific configuration
414 ***********************************************************************/
416 /*------------------------------------------
417 * rfapi_rfp_init_group_config_ptr_vty
419 * This is used to init or return a previously init'ed group specific
420 * configuration pointer. Group is identified by vty context.
421 * NOTE: size is ignored when a previously init'ed value is returned.
422 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
423 * bgp restart or shutdown.
426 * rfp_start_val value returned by rfp_start
428 * vty quagga vty context
429 * size number of bytes to allocation
435 * rfp_cfg_group NULL or Pointer to configuration structure
436 --------------------------------------------*/
437 extern void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val
,
438 rfapi_rfp_cfg_group_type type
,
442 /*------------------------------------------
443 * rfapi_rfp_get_group_config_ptr_vty
445 * This is used to get group specific configuration pointer.
446 * Group is identified by type and vty context.
447 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
448 * bgp restart or shutdown.
451 * rfp_start_val value returned by rfp_start
453 * vty quagga vty context
459 * rfp_cfg_group Pointer to configuration structure
460 --------------------------------------------*/
461 extern void *rfapi_rfp_get_group_config_ptr_vty(void *rfp_start_val
,
462 rfapi_rfp_cfg_group_type type
,
465 /*------------------------------------------
466 * rfp_group_config_search_cb_t (callback typedef)
468 * This callback is used to called from within a
469 * rfapi_rfp_get_group_config_ptr to check if the rfp_cfg_group
470 * matches the search criteria
473 * criteria RFAPI caller provided serach criteria
474 * rfp_cfg_group Pointer to configuration structure | NULL
481 --------------------------------------------*/
482 typedef int(rfp_group_config_search_cb_t
)(void *criteria
, void *rfp_cfg_group
);
484 /*------------------------------------------
485 * rfapi_rfp_get_group_config_ptr_name
487 * This is used to get group specific configuration pointer.
488 * Group is identified by type and name context.
489 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
490 * bgp restart or shutdown.
493 * rfp_start_val value returned by rfp_start
496 * criteria RFAPI caller provided serach criteria
497 * search_cb optional rfp_group_config_search_cb_t
503 * rfp_cfg_group Pointer to configuration structure
504 --------------------------------------------*/
505 extern void *rfapi_rfp_get_group_config_ptr_name(
506 void *rfp_start_val
, rfapi_rfp_cfg_group_type type
, const char *name
,
507 void *criteria
, rfp_group_config_search_cb_t
*search_cb
);
509 /*------------------------------------------
510 * rfapi_rfp_get_l2_group_config_ptr_lni
512 * This is used to get group specific configuration pointer.
513 * Group is identified by type and logical network identifier.
514 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
515 * bgp restart or shutdown.
518 * rfp_start_val value returned by rfp_start
519 * logical_net_id group logical network identifier
520 * criteria RFAPI caller provided serach criteria
521 * search_cb optional rfp_group_config_search_cb_t
527 * rfp_cfg_group Pointer to configuration structure
528 --------------------------------------------*/
530 rfapi_rfp_get_l2_group_config_ptr_lni(void *rfp_start_val
,
531 uint32_t logical_net_id
, void *criteria
,
532 rfp_group_config_search_cb_t
*search_cb
);
534 /***********************************************************************
536 ***********************************************************************/
538 /*------------------------------------------
541 * This function initializes a NVE record and associates it with
542 * the specified VN and underlay network addresses
545 * rfp_start_val value returned by rfp_start
546 * vn NVE virtual network address
548 * un NVE underlay network address
550 * default_options Default options to use on registrations.
551 * For now only tunnel type is supported.
552 * May be overridden per-prefix in rfapi_register().
553 * Caller owns (rfapi_open() does not free)
555 * response_cb Pointer to next hop list update callback function or
556 * NULL when no callbacks are desired.
558 * userdata Passed to subsequent response_cb invocations.
561 * response_lifetime The length of time that responses sent to this
564 * pHandle pointer to location to store rfapi handle. The
565 * handle must be passed on subsequent rfapi_ calls.
570 * EEXIST NVE with this {vn,un} already open
571 * ENOENT No matching nve group config
572 * ENOMSG Matched nve group config was incomplete
573 * ENXIO BGP or VNC not configured
574 * EAFNOSUPPORT Matched nve group specifies auto-assignment of RD,
575 * but underlay network address is not IPv4
576 * EDEADLK Called from within a callback procedure
577 *------------------------------------------*/
578 extern int rfapi_open(void *rfp_start_val
, struct rfapi_ip_addr
*vn
,
579 struct rfapi_ip_addr
*un
,
580 struct rfapi_un_option
*default_options
,
581 uint32_t *response_lifetime
, void *userdata
,
582 rfapi_handle
*pHandle
);
585 /*------------------------------------------
588 * Shut down NVE session and release associated data. Calling
589 * from within a rfapi callback procedure is permitted (the close
590 * will be completed asynchronously after the callback finishes).
593 * rfd: rfapi descriptor returned by rfapi_open
599 * EBADF invalid handle
600 * ENXIO BGP or VNC not configured
601 *------------------------------------------*/
602 extern int rfapi_close(rfapi_handle rfd
);
604 /*------------------------------------------
607 * Test rfapi descriptor
610 * rfd: rfapi descriptor returned by rfapi_open
615 * 0 Success: handle is valid and usable
616 * EINVAL null argument
617 * ESTALE formerly valid handle invalidated by config, needs close
618 * EBADF invalid handle
619 * ENXIO BGP or VNC not configured
620 * EAFNOSUPPORT Internal addressing error
621 *------------------------------------------*/
622 extern int rfapi_check(rfapi_handle rfd
);
624 /***********************************************************************
626 ***********************************************************************/
628 /*------------------------------------------
631 * This function queries the RIB for a
632 * particular route. Note that this call may result in subsequent
633 * callbacks to response_cb. Response callbacks can be cancelled
634 * by calling rfapi_query_done. A duplicate query using the same target
635 * will result in only one callback per change in next_hops. (i.e.,
636 * cancel/replace the prior query results.)
639 * rfd: rfapi descriptor returned by rfapi_open
640 * target: the destination address
641 * l2o ptr to L2 Options struct, NULL if not present in query
644 * ppNextHopEntry pointer to a location to store a pointer
645 * to the returned list of nexthops. It is the
646 * caller's responsibility to free this list
647 * via rfapi_free_next_hop_list().
652 * EBADF invalid handle
653 * ENOENT no valid route
654 * ENXIO BGP or VNC not configured
655 * ESTALE descriptor is no longer usable; should be closed
656 * EDEADLK Called from within a callback procedure
657 --------------------------------------------*/
658 extern int rfapi_query(rfapi_handle rfd
, struct rfapi_ip_addr
*target
,
659 struct rfapi_l2address_option
*l2o
,
660 struct rfapi_next_hop_entry
**ppNextHopEntry
);
662 /*------------------------------------------
665 * Notifies the rfapi that the user is no longer interested
666 * in the specified target.
669 * rfd: rfapi descriptor returned by rfapi_open
670 * target: the destination address
676 * EBADF invalid handle
677 * ENOENT no match found for target
678 * ENXIO BGP or VNC not configured
679 * ESTALE descriptor is no longer usable; should be closed
680 * EDEADLK Called from within a callback procedure
681 --------------------------------------------*/
682 extern int rfapi_query_done(rfapi_handle rfd
, struct rfapi_ip_addr
*target
);
684 /*------------------------------------------
685 * rfapi_query_done_all
687 * Notifies the rfapi that the user is no longer interested
691 * rfd: rfapi descriptor returned by rfapi_open
694 * count: number of queries cleared
698 * EBADF invalid handle
699 * ENXIO BGP or VNC not configured
700 * ESTALE descriptor is no longer usable; should be closed
701 * EDEADLK Called from within a callback procedure
702 --------------------------------------------*/
703 extern int rfapi_query_done_all(rfapi_handle rfd
, int *count
);
705 /*------------------------------------------
708 * Requests that reachability to the indicated prefix via this NVE
709 * be advertised by BGP. If <unregister> is non-zero, then the previously-
710 * advertised prefix should be withdrawn.
712 * (This function should NOT be called if the rfapi_open() function
716 * rfd: rfapi descriptor returned by rfapi_open
717 * prefix: A prefix to be registered or deregistered
718 * lifetime Prefix lifetime in seconds, host byte order
719 * options_un underlay netowrk options, may include tunnel-type
720 * Caller owns (rfapi_register() does not free).
721 * options_vn virtual network options, may include layer 2 address
722 * option and local-nexthop option
723 * Caller owns (rfapi_register() does not free).
725 * action: RFAPI_REGISTER_ADD add the route
726 * RFAPI_REGISTER_WITHDRAW withdraw route
727 * RFAPI_REGISTER_KILL withdraw without holddown
731 * EBADF invalid handle
732 * ENXIO BGP or VNC not configured
733 * ESTALE descriptor is no longer usable; should be closed
734 * EDEADLK Called from within a callback procedure
735 --------------------------------------------*/
739 RFAPI_REGISTER_WITHDRAW
,
741 } rfapi_register_action
;
743 extern int rfapi_register(rfapi_handle rfd
, struct rfapi_ip_prefix
*prefix
,
744 uint32_t lifetime
, struct rfapi_un_option
*options_un
,
745 struct rfapi_vn_option
*options_vn
,
746 rfapi_register_action action
);
748 /***********************************************************************
749 * Helper / Utility functions
750 ***********************************************************************/
752 /*------------------------------------------
755 * Get the virtual network address used by an NVE based on it's RFD
758 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
763 * vn NVE virtual network address
764 *------------------------------------------*/
765 extern struct rfapi_ip_addr
*rfapi_get_vn_addr(void *);
767 /*------------------------------------------
770 * Get the underlay network address used by an NVE based on it's RFD
773 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
778 * un NVE underlay network address
779 *------------------------------------------*/
780 extern struct rfapi_ip_addr
*rfapi_get_un_addr(void *);
782 /*------------------------------------------
785 * Returns a string describing the rfapi error code.
789 * code Error code returned by rfapi function
793 * const char * String
794 *------------------------------------------*/
795 extern const char *rfapi_error_str(int code
);
797 /*------------------------------------------
798 * rfapi_get_rfp_start_val
800 * Returns value passed to rfapi on rfp_start
803 * void * bgp structure
807 *------------------------------------------*/
808 extern void *rfapi_get_rfp_start_val(void *bgpv
);
810 /*------------------------------------------
813 * Compare two generic rfapi descriptors.
816 * rfd1: rfapi descriptor returned by rfapi_open or rfapi_create_generic
817 * rfd2: rfapi descriptor returned by rfapi_open or rfapi_create_generic
824 *------------------------------------------*/
825 extern int rfapi_compare_rfds(void *rfd1
, void *rfd2
);
827 /*------------------------------------------
828 * rfapi_free_next_hop_list
830 * Frees a next_hop_list returned by a rfapi_query invocation
833 * list: a pointer to a response list (as a
834 * struct rfapi_next_hop_entry) to free.
839 --------------------------------------------*/
840 extern void rfapi_free_next_hop_list(struct rfapi_next_hop_entry
*list
);
842 /*------------------------------------------
843 * rfapi_get_response_lifetime_default
845 * Returns the default lifetime for a response.
846 * rfp_start_val value returned by rfp_start or
847 * NULL (=use default instance)
854 * return value: The bgp instance default lifetime for a response.
855 --------------------------------------------*/
856 extern int rfapi_get_response_lifetime_default(void *rfp_start_val
);
858 /*------------------------------------------
859 * rfapi_is_vnc_configured
861 * Returns if VNC is configured
864 * rfp_start_val value returned by rfp_start or
865 * NULL (=use default instance)
869 * return value: If VNC is configured for the bgpd instance
871 * ENXIO VNC not configured
872 --------------------------------------------*/
873 extern int rfapi_is_vnc_configured(void *rfp_start_val
);
875 /*------------------------------------------
876 * rfapi_bgp_lookup_by_rfp
878 * Find bgp instance pointer based on value returned by rfp_start
881 * rfp_start_val value returned by rfp_startor
882 * NULL (=get default instance)
888 * bgp bgp instance pointer
891 --------------------------------------------*/
892 extern struct bgp
*rfapi_bgp_lookup_by_rfp(void *rfp_start_val
);
894 /*------------------------------------------
895 * rfapi_get_rfp_start_val_by_bgp
897 * Find bgp instance pointer based on value returned by rfp_start
900 * bgp bgp instance pointer
909 --------------------------------------------*/
910 extern void *rfapi_get_rfp_start_val_by_bgp(struct bgp
*bgp
);
912 #endif /* ENABLE_BGP_VNC */
914 #endif /* _QUAGGA_BGP_RFAPI_H */