]>
git.proxmox.com Git - mirror_frr.git/blob - sharpd/sharp_zebra.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Zebra connect library for SHARP
4 * Copyright (C) Cumulus Networks, Inc.
7 #ifndef __SHARP_ZEBRA_H__
8 #define __SHARP_ZEBRA_H__
10 extern void sharp_zebra_init(void);
12 /* Add and delete extra zapi client sessions, for testing */
13 int sharp_zclient_create(uint32_t session_id
);
14 int sharp_zclient_delete(uint32_t session_id
);
16 extern void vrf_label_add(vrf_id_t vrf_id
, afi_t afi
, mpls_label_t label
);
17 extern void nhg_add(uint32_t id
, const struct nexthop_group
*nhg
,
18 const struct nexthop_group
*backup_nhg
);
19 extern void nhg_del(uint32_t id
);
20 extern void sharp_zebra_nexthop_watch(struct prefix
*p
, vrf_id_t vrf_id
,
21 bool import
, bool watch
, bool connected
);
23 extern void sharp_install_routes_helper(struct prefix
*p
, vrf_id_t vrf_id
,
24 uint8_t instance
, uint32_t nhgid
,
25 const struct nexthop_group
*nhg
,
26 const struct nexthop_group
*backup_nhg
,
27 uint32_t routes
, uint32_t flags
,
29 extern void sharp_remove_routes_helper(struct prefix
*p
, vrf_id_t vrf_id
,
30 uint8_t instance
, uint32_t routes
);
32 int sharp_install_lsps_helper(bool install_p
, bool update_p
,
33 const struct prefix
*p
, uint8_t type
,
34 int instance
, uint32_t in_label
,
35 const struct nexthop_group
*nhg
,
36 const struct nexthop_group
*backup_nhg
);
38 /* Send OPAQUE messages, using subtype 'type'. */
39 void sharp_opaque_send(uint32_t type
, uint32_t proto
, uint32_t instance
,
40 uint32_t session_id
, uint32_t count
);
42 /* Send OPAQUE registration messages, using subtype 'type'. */
43 void sharp_opaque_reg_send(bool is_reg
, uint32_t proto
, uint32_t instance
,
44 uint32_t session_id
, uint32_t type
);
46 extern void sharp_zebra_send_arp(const struct interface
*ifp
,
47 const struct prefix
*p
);
49 /* Register Link State Opaque messages */
50 extern void sharp_zebra_register_te(void);
52 extern void sharp_redistribute_vrf(struct vrf
*vrf
, int source
);
54 extern int sharp_zebra_srv6_manager_get_locator_chunk(const char *lname
);
55 extern int sharp_zebra_srv6_manager_release_locator_chunk(const char *lname
);
56 extern void sharp_install_seg6local_route_helper(struct prefix
*p
,
58 enum seg6local_action_t act
,
59 struct seg6local_context
*ctx
);
61 extern int sharp_zebra_send_interface_protodown(struct interface
*ifp
,
63 extern int sharp_zebra_send_tc_filter_rate(struct interface
*ifp
,
64 const struct prefix
*source
,
65 const struct prefix
*destination
,
66 uint8_t ip_proto
, uint16_t src_port
,
67 uint16_t dst_port
, uint64_t rate
);