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 */
37 # define s6_addr32 _S6_un._S6_u32
39 # define s6_addr32 __u6_addr.__u6_addr32
43 #define RFAPI_V4_ADDR 0x04
44 #define RFAPI_V6_ADDR 0x06
45 #define RFAPI_SHOW_STR "VNC information\n"
47 struct rfapi_ip_addr
{
48 uint8_t addr_family
; /* AF_INET | AF_INET6 */
50 struct in_addr v4
; /* in network order */
51 struct in6_addr v6
; /* in network order */
55 struct rfapi_ip_prefix
{
57 uint8_t cost
; /* bgp local pref = 255 - cost */
58 struct rfapi_ip_addr prefix
;
61 struct rfapi_nexthop
{
66 struct rfapi_next_hop_entry
{
67 struct rfapi_next_hop_entry
*next
;
68 struct rfapi_ip_prefix prefix
;
70 struct rfapi_ip_addr un_address
;
71 struct rfapi_ip_addr vn_address
;
72 struct rfapi_vn_option
*vn_options
;
73 struct rfapi_un_option
*un_options
;
76 #define RFAPI_REMOVE_RESPONSE_LIFETIME 0
77 #define RFAPI_INFINITE_LIFETIME 0xFFFFFFFF
79 struct rfapi_l2address_option
{
80 struct ethaddr macaddr
; /* use 0 to assign label to IP prefix */
81 uint32_t label
; /* 20bit label in low bits, no TC, S, or TTL */
82 uint32_t logical_net_id
; /* ~= EVPN Ethernet Segment Id,
83 must not be zero for mac regis. */
85 uint16_t tag_id
; /* EVPN Ethernet Tag ID, 0 = none */
89 RFAPI_UN_OPTION_TYPE_PROVISIONAL
, /* internal use only */
90 RFAPI_UN_OPTION_TYPE_TUNNELTYPE
,
91 } rfapi_un_option_type
;
93 struct rfapi_tunneltype_option
{
96 struct bgp_encap_type_reserved reserved
;
97 struct bgp_encap_type_l2tpv3_over_ip l2tpv3_ip
;
98 struct bgp_encap_type_gre gre
;
99 struct bgp_encap_type_transmit_tunnel_endpoint
100 transmit_tunnel_endpoint
;
101 struct bgp_encap_type_ipsec_in_tunnel_mode ipsec_tunnel
;
102 struct bgp_encap_type_ip_in_ip_tunnel_with_ipsec_transport_mode
104 struct bgp_encap_type_mpls_in_ip_tunnel_with_ipsec_transport_mode
106 struct bgp_encap_type_ip_in_ip ip_ip
;
107 struct bgp_encap_type_vxlan vxlan
;
108 struct bgp_encap_type_nvgre nvgre
;
109 struct bgp_encap_type_mpls mpls
;
110 struct bgp_encap_type_mpls_in_gre mpls_gre
;
111 struct bgp_encap_type_vxlan_gpe vxlan_gpe
;
112 struct bgp_encap_type_mpls_in_udp mpls_udp
;
113 struct bgp_encap_type_pbb pbb
;
117 struct rfapi_un_option
{
118 struct rfapi_un_option
*next
;
119 rfapi_un_option_type type
;
121 struct rfapi_tunneltype_option tunnel
;
126 RFAPI_VN_OPTION_TYPE_L2ADDR
=
127 3, /* Layer 2 address, 3 for legacy compatibility */
128 RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP
, /* for static routes */
129 RFAPI_VN_OPTION_TYPE_INTERNAL_RD
, /* internal use only */
130 } rfapi_vn_option_type
;
132 struct rfapi_vn_option
{
133 struct rfapi_vn_option
*next
;
135 rfapi_vn_option_type type
;
138 struct rfapi_l2address_option l2addr
;
141 * If this option is present, the next hop is local to the
142 * client NVE (i.e., not via a tunnel).
144 struct rfapi_nexthop local_nexthop
;
147 * For rfapi internal use only
149 struct prefix_rd internal_rd
;
153 struct rfapi_l2address_option_match
{
154 struct rfapi_l2address_option o
;
157 #define RFAPI_L2O_MACADDR 0x00000001
158 #define RFAPI_L2O_LABEL 0x00000002
159 #define RFAPI_L2O_LNI 0x00000004
160 #define RFAPI_L2O_LHI 0x00000008
163 #define VNC_CONFIG_STR "VNC/RFP related configuration\n"
165 typedef void *rfapi_handle
;
167 /***********************************************************************
169 ***********************************************************************/
170 /*------------------------------------------
171 * rfapi_response_cb_t (callback typedef)
173 * Callbacks of this type are used to provide asynchronous
174 * route updates from RFAPI to the RFP client.
177 * called to notify the rfp client that a next hop list
178 * that has previously been provided in response to an
179 * rfapi_query call has been updated. Deleted routes are indicated
180 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
182 * By default, the routes an NVE receives via this callback include
183 * its own routes (that it has registered). However, these may be
184 * filtered out if the global BGP_VNC_CONFIG_FILTER_SELF_FROM_RSP
188 * called to notify the rfp client that a local route
189 * has been added or deleted. Deleted routes are indicated
190 * with lifetime==RFAPI_REMOVE_RESPONSE_LIFETIME.
193 * next_hops a list of possible next hops.
194 * This is a linked list allocated within the
195 * rfapi. The response_cb callback function is responsible
196 * for freeing this memory via rfapi_free_next_hop_list()
197 * in order to avoid memory leaks.
199 * userdata value (cookie) originally specified in call to
202 *------------------------------------------*/
203 typedef void(rfapi_response_cb_t
)(struct rfapi_next_hop_entry
*next_hops
,
206 /*------------------------------------------
207 * rfapi_nve_close_cb_t (callback typedef)
209 * Callbacks of this type are used to provide asynchronous
210 * notification that an rfapi_handle was invalidated
213 * pHandle Firmerly valid rfapi_handle returned to
214 * client via rfapi_open().
216 * reason EIDRM handle administratively closed (clear nve ...)
217 * ESTALE handle invalidated by configuration change
219 *------------------------------------------*/
220 typedef void(rfapi_nve_close_cb_t
)(rfapi_handle pHandle
, int reason
);
222 /*------------------------------------------
223 * rfp_cfg_write_cb_t (callback typedef)
225 * This callback is used to generate output for any config parameters
226 * that may supported by RFP via RFP defined vty commands at the bgp
227 * level. See loglevel as an example.
230 * vty -- quagga vty context
231 * rfp_start_val -- value returned by rfp_start
234 * to vty, rfp related configuration
238 --------------------------------------------*/
239 typedef int(rfp_cfg_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
);
241 /*------------------------------------------
242 * rfp_cfg_group_write_cb_t (callback typedef)
244 * This callback is used to generate output for any config parameters
245 * that may supported by RFP via RFP defined vty commands at the
246 * L2 or NVE level. See loglevel as an example.
249 * vty quagga vty context
250 * rfp_start_val value returned by rfp_start
253 * rfp_cfg_group Pointer to configuration structure
256 * to vty, rfp related configuration
260 --------------------------------------------*/
262 RFAPI_RFP_CFG_GROUP_DEFAULT
,
263 RFAPI_RFP_CFG_GROUP_NVE
,
264 RFAPI_RFP_CFG_GROUP_L2
265 } rfapi_rfp_cfg_group_type
;
267 typedef int(rfp_cfg_group_write_cb_t
)(struct vty
*vty
, void *rfp_start_val
,
268 rfapi_rfp_cfg_group_type type
,
269 const char *name
, void *rfp_cfg_group
);
271 /***********************************************************************
272 * Configuration related defines and structures
273 ***********************************************************************/
275 struct rfapi_rfp_cb_methods
{
276 rfp_cfg_write_cb_t
*cfg_cb
; /* show top level config */
277 rfp_cfg_group_write_cb_t
*cfg_group_cb
; /* show group level config */
278 rfapi_response_cb_t
*response_cb
; /* unsolicited responses */
279 rfapi_response_cb_t
*local_cb
; /* local route add/delete */
280 rfapi_nve_close_cb_t
*close_cb
; /* handle closed */
284 * If a route with infinite lifetime is withdrawn, this is
285 * how long (in seconds) to wait before expiring it (because
286 * RFAPI_LIFETIME_MULTIPLIER_PCT * infinity is too long to wait)
288 #define RFAPI_LIFETIME_INFINITE_WITHDRAW_DELAY (60*120)
291 * the factor that should be applied to a prefix's <lifetime> value
292 * before using it to expire a withdrawn prefix, expressed as a percent.
293 * Thus, a value of 100 means to use the exact value of <lifetime>,
294 * a value of 200 means to use twice the value of <lifetime>, etc.
296 #define RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR 150
299 * This is used by rfapi to determine if RFP is using/supports
300 * a partial (i.e., cache) or full table download approach for
301 * mapping information. When full table download approach is
302 * used all information is passed to RFP after an initial
303 * rfapi_query. When partial table download is used, only
304 * information matching a query is passed.
307 RFAPI_RFP_DOWNLOAD_PARTIAL
= 0,
308 RFAPI_RFP_DOWNLOAD_FULL
309 } rfapi_rfp_download_type
;
311 #define RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL 1
313 struct rfapi_rfp_cfg
{
314 /* partial or full table download */
315 rfapi_rfp_download_type download_type
; /* default=partial */
317 * When full-table-download is enabled, this is the minimum
318 * number of seconds between times a non-queried prefix will
319 * be updated to a particular NVE.
320 * default: RFAPI_RFP_CFG_DEFAULT_FTD_ADVERTISEMENT_INTERVAL
322 uint32_t ftd_advertisement_interval
;
324 * percentage of registration lifetime to continue to use information
325 * post soft-state refresh timeout
326 default: RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR
328 uint32_t holddown_factor
;
329 /* Control generation of updated RFP responses */
330 uint8_t use_updated_response
; /* default=0/no */
331 /* when use_updated_response, also generate remove responses */
332 uint8_t use_removes
; /* default=0/no */
335 /***********************************************************************
336 * Process related functions -- MUST be provided by the RFAPI user <<===
337 ***********************************************************************/
339 /*------------------------------------------
342 * This function will start the RFP code
345 * master quagga thread_master to tie into bgpd threads
348 * cfgp Pointer to rfapi_rfp_cfg (null = use defaults),
349 * copied by caller, updated via rfp_set_configuration
350 * cbmp Pointer to rfapi_rfp_cb_methods, may be null
351 * copied by caller, updated via rfapi_rfp_set_cb_methods
353 * rfp_start_val rfp returned value passed on rfp_stop and other rfapi calls
354 --------------------------------------------*/
355 extern void *rfp_start(struct thread_master
*master
,
356 struct rfapi_rfp_cfg
**cfgp
,
357 struct rfapi_rfp_cb_methods
**cbmp
);
359 /*------------------------------------------
362 * This function is called on shutdown to trigger RFP cleanup
371 --------------------------------------------*/
372 extern void rfp_stop(void *rfp_start_val
);
374 /***********************************************************************
375 * RFP processing behavior configuration
376 ***********************************************************************/
378 /*------------------------------------------
379 * rfapi_rfp_set_configuration
381 * This is used to change rfapi's processing behavior based on
385 * rfp_start_val value returned by rfp_start
386 * rfapi_rfp_cfg Pointer to configuration structure
393 * ENXIO Unabled to locate configured BGP/VNC
394 --------------------------------------------*/
395 extern int rfapi_rfp_set_configuration(void *rfp_start_val
,
396 struct rfapi_rfp_cfg
*rfp_cfg
);
398 /*------------------------------------------
399 * rfapi_rfp_set_cb_methods
401 * Change registered callback functions for asynchronous notifications
402 * from RFAPI to the RFP client.
405 * rfp_start_val value by rfp_start
406 * methods Pointer to struct rfapi_rfp_cb_methods containing
407 * pointers to callback methods as described above
411 * ENXIO BGP or VNC not configured
412 *------------------------------------------*/
413 extern int rfapi_rfp_set_cb_methods(void *rfp_start_val
,
414 struct rfapi_rfp_cb_methods
*methods
);
416 /***********************************************************************
417 * RFP group specific configuration
418 ***********************************************************************/
420 /*------------------------------------------
421 * rfapi_rfp_init_group_config_ptr_vty
423 * This is used to init or return a previously init'ed group specific
424 * configuration pointer. Group is identified by vty context.
425 * NOTE: size is ignored when a previously init'ed value is returned.
426 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
427 * bgp restart or shutdown.
430 * rfp_start_val value returned by rfp_start
432 * vty quagga vty context
433 * size number of bytes to allocation
439 * rfp_cfg_group NULL or Pointer to configuration structure
440 --------------------------------------------*/
441 extern void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val
,
442 rfapi_rfp_cfg_group_type type
,
446 /*------------------------------------------
447 * rfapi_rfp_get_group_config_ptr_vty
449 * This is used to get group specific configuration pointer.
450 * Group is identified by type and vty context.
451 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
452 * bgp restart or shutdown.
455 * rfp_start_val value returned by rfp_start
457 * vty quagga vty context
463 * rfp_cfg_group Pointer to configuration structure
464 --------------------------------------------*/
465 extern void *rfapi_rfp_get_group_config_ptr_vty(void *rfp_start_val
,
466 rfapi_rfp_cfg_group_type type
,
469 /*------------------------------------------
470 * rfp_group_config_search_cb_t (callback typedef)
472 * This callback is used to called from within a
473 * rfapi_rfp_get_group_config_ptr to check if the rfp_cfg_group
474 * matches the search criteria
477 * criteria RFAPI caller provided serach criteria
478 * rfp_cfg_group Pointer to configuration structure | NULL
485 --------------------------------------------*/
486 typedef int(rfp_group_config_search_cb_t
)(void *criteria
, void *rfp_cfg_group
);
488 /*------------------------------------------
489 * rfapi_rfp_get_group_config_ptr_name
491 * This is used to get group specific configuration pointer.
492 * Group is identified by type and name context.
493 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
494 * bgp restart or shutdown.
497 * rfp_start_val value returned by rfp_start
500 * criteria RFAPI caller provided serach criteria
501 * search_cb optional rfp_group_config_search_cb_t
507 * rfp_cfg_group Pointer to configuration structure
508 --------------------------------------------*/
509 extern void *rfapi_rfp_get_group_config_ptr_name(
510 void *rfp_start_val
, rfapi_rfp_cfg_group_type type
, const char *name
,
511 void *criteria
, rfp_group_config_search_cb_t
*search_cb
);
513 /*------------------------------------------
514 * rfapi_rfp_get_l2_group_config_ptr_lni
516 * This is used to get group specific configuration pointer.
517 * Group is identified by type and logical network identifier.
518 * RFAPI frees rfp_cfg_group when group is deleted during reconfig,
519 * bgp restart or shutdown.
522 * rfp_start_val value returned by rfp_start
523 * logical_net_id group logical network identifier
524 * criteria RFAPI caller provided serach criteria
525 * search_cb optional rfp_group_config_search_cb_t
531 * rfp_cfg_group Pointer to configuration structure
532 --------------------------------------------*/
534 rfapi_rfp_get_l2_group_config_ptr_lni(void *rfp_start_val
,
535 uint32_t logical_net_id
, void *criteria
,
536 rfp_group_config_search_cb_t
*search_cb
);
538 /***********************************************************************
540 ***********************************************************************/
542 /*------------------------------------------
545 * This function initializes a NVE record and associates it with
546 * the specified VN and underlay network addresses
549 * rfp_start_val value returned by rfp_start
550 * vn NVE virtual network address
552 * un NVE underlay network address
554 * default_options Default options to use on registrations.
555 * For now only tunnel type is supported.
556 * May be overridden per-prefix in rfapi_register().
557 * Caller owns (rfapi_open() does not free)
559 * response_cb Pointer to next hop list update callback function or
560 * NULL when no callbacks are desired.
562 * userdata Passed to subsequent response_cb invocations.
565 * response_lifetime The length of time that responses sent to this
568 * pHandle pointer to location to store rfapi handle. The
569 * handle must be passed on subsequent rfapi_ calls.
574 * EEXIST NVE with this {vn,un} already open
575 * ENOENT No matching nve group config
576 * ENOMSG Matched nve group config was incomplete
577 * ENXIO BGP or VNC not configured
578 * EAFNOSUPPORT Matched nve group specifies auto-assignment of RD,
579 * but underlay network address is not IPv4
580 * EDEADLK Called from within a callback procedure
581 *------------------------------------------*/
582 extern int rfapi_open(void *rfp_start_val
, struct rfapi_ip_addr
*vn
,
583 struct rfapi_ip_addr
*un
,
584 struct rfapi_un_option
*default_options
,
585 uint32_t *response_lifetime
, void *userdata
,
586 rfapi_handle
*pHandle
);
589 /*------------------------------------------
592 * Shut down NVE session and release associated data. Calling
593 * from within a rfapi callback procedure is permitted (the close
594 * will be completed asynchronously after the callback finishes).
597 * rfd: rfapi descriptor returned by rfapi_open
603 * EBADF invalid handle
604 * ENXIO BGP or VNC not configured
605 *------------------------------------------*/
606 extern int rfapi_close(rfapi_handle rfd
);
608 /*------------------------------------------
611 * Test rfapi descriptor
614 * rfd: rfapi descriptor returned by rfapi_open
619 * 0 Success: handle is valid and usable
620 * EINVAL null argument
621 * ESTALE formerly valid handle invalidated by config, needs close
622 * EBADF invalid handle
623 * ENXIO BGP or VNC not configured
624 * EAFNOSUPPORT Internal addressing error
625 *------------------------------------------*/
626 extern int rfapi_check(rfapi_handle rfd
);
628 /***********************************************************************
630 ***********************************************************************/
632 /*------------------------------------------
635 * This function queries the RIB for a
636 * particular route. Note that this call may result in subsequent
637 * callbacks to response_cb. Response callbacks can be cancelled
638 * by calling rfapi_query_done. A duplicate query using the same target
639 * will result in only one callback per change in next_hops. (i.e.,
640 * cancel/replace the prior query results.)
643 * rfd: rfapi descriptor returned by rfapi_open
644 * target: the destination address
645 * l2o ptr to L2 Options struct, NULL if not present in query
648 * ppNextHopEntry pointer to a location to store a pointer
649 * to the returned list of nexthops. It is the
650 * caller's responsibility to free this list
651 * via rfapi_free_next_hop_list().
656 * EBADF invalid handle
657 * ENOENT no valid route
658 * ENXIO BGP or VNC not configured
659 * ESTALE descriptor is no longer usable; should be closed
660 * EDEADLK Called from within a callback procedure
661 --------------------------------------------*/
662 extern int rfapi_query(rfapi_handle rfd
, struct rfapi_ip_addr
*target
,
663 struct rfapi_l2address_option
*l2o
,
664 struct rfapi_next_hop_entry
**ppNextHopEntry
);
666 /*------------------------------------------
669 * Notifies the rfapi that the user is no longer interested
670 * in the specified target.
673 * rfd: rfapi descriptor returned by rfapi_open
674 * target: the destination address
680 * EBADF invalid handle
681 * ENOENT no match found for target
682 * ENXIO BGP or VNC not configured
683 * ESTALE descriptor is no longer usable; should be closed
684 * EDEADLK Called from within a callback procedure
685 --------------------------------------------*/
686 extern int rfapi_query_done(rfapi_handle rfd
, struct rfapi_ip_addr
*target
);
688 /*------------------------------------------
689 * rfapi_query_done_all
691 * Notifies the rfapi that the user is no longer interested
695 * rfd: rfapi descriptor returned by rfapi_open
698 * count: number of queries cleared
702 * EBADF invalid handle
703 * ENXIO BGP or VNC not configured
704 * ESTALE descriptor is no longer usable; should be closed
705 * EDEADLK Called from within a callback procedure
706 --------------------------------------------*/
707 extern int rfapi_query_done_all(rfapi_handle rfd
, int *count
);
709 /*------------------------------------------
712 * Requests that reachability to the indicated prefix via this NVE
713 * be advertised by BGP. If <unregister> is non-zero, then the previously-
714 * advertised prefix should be withdrawn.
716 * (This function should NOT be called if the rfapi_open() function
720 * rfd: rfapi descriptor returned by rfapi_open
721 * prefix: A prefix to be registered or deregistered
722 * lifetime Prefix lifetime in seconds, host byte order
723 * options_un underlay netowrk options, may include tunnel-type
724 * Caller owns (rfapi_register() does not free).
725 * options_vn virtual network options, may include layer 2 address
726 * option and local-nexthop option
727 * Caller owns (rfapi_register() does not free).
729 * action: RFAPI_REGISTER_ADD add the route
730 * RFAPI_REGISTER_WITHDRAW withdraw route
731 * RFAPI_REGISTER_KILL withdraw without holddown
735 * EBADF invalid handle
736 * ENXIO BGP or VNC not configured
737 * ESTALE descriptor is no longer usable; should be closed
738 * EDEADLK Called from within a callback procedure
739 --------------------------------------------*/
743 RFAPI_REGISTER_WITHDRAW
,
745 } rfapi_register_action
;
747 extern int rfapi_register(rfapi_handle rfd
, struct rfapi_ip_prefix
*prefix
,
748 uint32_t lifetime
, struct rfapi_un_option
*options_un
,
749 struct rfapi_vn_option
*options_vn
,
750 rfapi_register_action action
);
752 /***********************************************************************
753 * Helper / Utility functions
754 ***********************************************************************/
756 /*------------------------------------------
759 * Get the virtual network address used by an NVE based on it's RFD
762 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
767 * vn NVE virtual network address
768 *------------------------------------------*/
769 extern struct rfapi_ip_addr
*rfapi_get_vn_addr(void *);
771 /*------------------------------------------
774 * Get the underlay network address used by an NVE based on it's RFD
777 * rfd: rfapi descriptor returned by rfapi_open or rfapi_create_generic
782 * un NVE underlay network address
783 *------------------------------------------*/
784 extern struct rfapi_ip_addr
*rfapi_get_un_addr(void *);
786 /*------------------------------------------
789 * Returns a string describing the rfapi error code.
793 * code Error code returned by rfapi function
797 * const char * String
798 *------------------------------------------*/
799 extern const char *rfapi_error_str(int code
);
801 /*------------------------------------------
802 * rfapi_get_rfp_start_val
804 * Returns value passed to rfapi on rfp_start
807 * void * bgp structure
811 *------------------------------------------*/
812 extern void *rfapi_get_rfp_start_val(void *bgpv
);
814 /*------------------------------------------
817 * Compare two generic rfapi descriptors.
820 * rfd1: rfapi descriptor returned by rfapi_open or rfapi_create_generic
821 * rfd2: rfapi descriptor returned by rfapi_open or rfapi_create_generic
828 *------------------------------------------*/
829 extern int rfapi_compare_rfds(void *rfd1
, void *rfd2
);
831 /*------------------------------------------
832 * rfapi_free_next_hop_list
834 * Frees a next_hop_list returned by a rfapi_query invocation
837 * list: a pointer to a response list (as a
838 * struct rfapi_next_hop_entry) to free.
843 --------------------------------------------*/
844 extern void rfapi_free_next_hop_list(struct rfapi_next_hop_entry
*list
);
846 /*------------------------------------------
847 * rfapi_get_response_lifetime_default
849 * Returns the default lifetime for a response.
850 * rfp_start_val value returned by rfp_start or
851 * NULL (=use default instance)
858 * return value: The bgp instance default lifetime for a response.
859 --------------------------------------------*/
860 extern int rfapi_get_response_lifetime_default(void *rfp_start_val
);
862 /*------------------------------------------
863 * rfapi_is_vnc_configured
865 * Returns if VNC is configured
868 * rfp_start_val value returned by rfp_start or
869 * NULL (=use default instance)
873 * return value: If VNC is configured for the bgpd instance
875 * ENXIO VNC not configured
876 --------------------------------------------*/
877 extern int rfapi_is_vnc_configured(void *rfp_start_val
);
879 /*------------------------------------------
880 * rfapi_bgp_lookup_by_rfp
882 * Find bgp instance pointer based on value returned by rfp_start
885 * rfp_start_val value returned by rfp_startor
886 * NULL (=get default instance)
892 * bgp bgp instance pointer
895 --------------------------------------------*/
896 extern struct bgp
*rfapi_bgp_lookup_by_rfp(void *rfp_start_val
);
898 /*------------------------------------------
899 * rfapi_get_rfp_start_val_by_bgp
901 * Find bgp instance pointer based on value returned by rfp_start
904 * bgp bgp instance pointer
913 --------------------------------------------*/
914 extern void *rfapi_get_rfp_start_val_by_bgp(struct bgp
*bgp
);
916 #endif /* ENABLE_BGP_VNC */
918 #endif /* _QUAGGA_BGP_RFAPI_H */