]> git.proxmox.com Git - mirror_frr.git/blame - staticd/static_nb.h
Merge pull request #13517 from Keelan10/ospf_ti_lfa-memory-leak
[mirror_frr.git] / staticd / static_nb.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
88fa5104 2/*
3 * Copyright (C) 2018 Vmware
4 * Vishal Dhingra
88fa5104 5 */
6#ifndef _FRR_STATIC_NB_H_
7#define _FRR_STATIC_NB_H_
8
deca28a3
CH
9#ifdef __cplusplus
10extern "C" {
11#endif
12
88fa5104 13extern const struct frr_yang_module_info frr_staticd_info;
14
15/* Mandatory callbacks. */
16int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
17 struct nb_cb_create_args *args);
18int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
19 struct nb_cb_destroy_args *args);
20int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
21 struct nb_cb_create_args *args);
22int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
23 struct nb_cb_destroy_args *args);
24int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
25 struct nb_cb_modify_args *args);
88fa5104 26int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
27 struct nb_cb_create_args *args);
28int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
29 struct nb_cb_destroy_args *args);
30int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
31 struct nb_cb_modify_args *args);
88fa5104 32int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
33 struct nb_cb_modify_args *args);
065276ae
SM
34int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
35 struct nb_cb_modify_args *args);
36int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
37 struct nb_cb_destroy_args *args);
88fa5104 38int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
39 struct nb_cb_create_args *args);
40int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
41 struct nb_cb_destroy_args *args);
42int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
43 struct nb_cb_modify_args *args);
44int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
45 struct nb_cb_destroy_args *args);
46int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
47 struct nb_cb_modify_args *args);
48int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
49 struct nb_cb_destroy_args *args);
50int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
51 struct nb_cb_modify_args *args);
52int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
53 struct nb_cb_destroy_args *args);
351ad684
RZ
54int route_next_hop_bfd_create(struct nb_cb_create_args *args);
55int route_next_hop_bfd_destroy(struct nb_cb_destroy_args *args);
56int route_next_hop_bfd_source_modify(struct nb_cb_modify_args *args);
57int route_next_hop_bfd_source_destroy(struct nb_cb_destroy_args *args);
58int route_next_hop_bfd_profile_modify(struct nb_cb_modify_args *args);
59int route_next_hop_bfd_profile_destroy(struct nb_cb_destroy_args *args);
60int route_next_hop_bfd_multi_hop_modify(struct nb_cb_modify_args *args);
88fa5104 61int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
62 struct nb_cb_create_args *args);
63int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
64 struct nb_cb_destroy_args *args);
65int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
66 struct nb_cb_create_args *args);
67int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
68 struct nb_cb_destroy_args *args);
69int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
70 struct nb_cb_modify_args *args);
88fa5104 71int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
72 struct nb_cb_create_args *args);
73int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
74 struct nb_cb_destroy_args *args);
75int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
76 struct nb_cb_modify_args *args);
88fa5104 77int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
78 struct nb_cb_modify_args *args);
065276ae
SM
79int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
80 struct nb_cb_modify_args *args);
81int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
82 struct nb_cb_destroy_args *args);
88fa5104 83int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
84 struct nb_cb_create_args *args);
85int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
86 struct nb_cb_destroy_args *args);
87int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
88 struct nb_cb_modify_args *args);
89int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
90 struct nb_cb_destroy_args *args);
91int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
92 struct nb_cb_modify_args *args);
93int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
94 struct nb_cb_destroy_args *args);
95int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
96 struct nb_cb_modify_args *args);
97int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
98 struct nb_cb_destroy_args *args);
99
100/* Optional 'apply_finish' callbacks. */
101
102void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
103 struct nb_cb_apply_finish_args *args);
104void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
105 struct nb_cb_apply_finish_args *args);
106
107/* Optional 'pre_validate' callbacks. */
108int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
109 struct nb_cb_pre_validate_args *args);
110
111/*
112 * Callback registered with routing_nb lib to validate only
113 * one instance of staticd is allowed
114 */
115int routing_control_plane_protocols_name_validate(
116 struct nb_cb_create_args *args);
117
118/* xpath macros */
119/* route-list */
120#define FRR_STATIC_ROUTE_INFO_KEY_XPATH \
121 "/frr-routing:routing/control-plane-protocols/" \
122 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
314825ff 123 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
ef4b6b22 124 "path-list[table-id='%u'][distance='%u']"
88fa5104 125
e1ea6b20
IR
126#define FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \
127 "/frr-routing:routing/control-plane-protocols/" \
128 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
129 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
130 "path-list[table-id='%u']"
131
88fa5104 132
133#define FRR_STATIC_ROUTE_PATH_TAG_XPATH "/tag"
134
88fa5104 135/* route-list/frr-nexthops */
136#define FRR_STATIC_ROUTE_NH_KEY_XPATH \
137 "/frr-nexthops/" \
138 "nexthop[nh-type='%s'][vrf='%s'][gateway='%s'][interface='%s']"
139
140#define FRR_STATIC_ROUTE_NH_ONLINK_XPATH "/onlink"
141
065276ae
SM
142#define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color"
143
88fa5104 144#define FRR_STATIC_ROUTE_NH_BH_XPATH "/bh-type"
145
146#define FRR_STATIC_ROUTE_NH_LABEL_XPATH "/mpls-label-stack"
147
148#define FRR_STATIC_ROUTE_NHLB_KEY_XPATH "/entry[id='%u']/label"
149
150/* route-list/srclist */
151#define FRR_S_ROUTE_SRC_INFO_KEY_XPATH \
152 "/frr-routing:routing/control-plane-protocols/" \
153 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
314825ff 154 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
ef4b6b22 155 "src-list[src-prefix='%s']/path-list[table-id='%u'][distance='%u']"
88fa5104 156
e1ea6b20
IR
157#define FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \
158 "/frr-routing:routing/control-plane-protocols/" \
159 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
160 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
161 "src-list[src-prefix='%s']/path-list[table-id='%u']"
162
88fa5104 163/* route-list/frr-nexthops */
164#define FRR_DEL_S_ROUTE_NH_KEY_XPATH \
165 FRR_STATIC_ROUTE_INFO_KEY_XPATH \
166 FRR_STATIC_ROUTE_NH_KEY_XPATH
167
e1ea6b20
IR
168/* route-list/frr-nexthops */
169#define FRR_DEL_S_ROUTE_NH_KEY_NO_DISTANCE_XPATH \
170 FRR_STATIC_ROUTE_INFO_KEY_NO_DISTANCE_XPATH \
171 FRR_STATIC_ROUTE_NH_KEY_XPATH
172
88fa5104 173/* route-list/src/src-list/frr-nexthops*/
174#define FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH \
175 FRR_S_ROUTE_SRC_INFO_KEY_XPATH \
176 FRR_STATIC_ROUTE_NH_KEY_XPATH
177
e1ea6b20
IR
178/* route-list/src/src-list/frr-nexthops*/
179#define FRR_DEL_S_ROUTE_SRC_NH_KEY_NO_DISTANCE_XPATH \
180 FRR_S_ROUTE_SRC_INFO_KEY_NO_DISTANCE_XPATH \
181 FRR_STATIC_ROUTE_NH_KEY_XPATH
182
deca28a3
CH
183#ifdef __cplusplus
184}
185#endif
186
88fa5104 187#endif