]> git.proxmox.com Git - mirror_frr.git/blame - staticd/static_nb.h
Merge pull request #6738 from deastoe/frr-reload-log-level
[mirror_frr.git] / staticd / static_nb.h
CommitLineData
88fa5104 1/*
2 * Copyright (C) 2018 Vmware
3 * Vishal Dhingra
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef _FRR_STATIC_NB_H_
19#define _FRR_STATIC_NB_H_
20
21extern const struct frr_yang_module_info frr_staticd_info;
22
23/* Mandatory callbacks. */
24int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
25 struct nb_cb_create_args *args);
26int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
27 struct nb_cb_destroy_args *args);
28int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
29 struct nb_cb_create_args *args);
30int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
31 struct nb_cb_destroy_args *args);
32int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
33 struct nb_cb_modify_args *args);
34int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_table_id_modify(
35 struct nb_cb_modify_args *args);
36int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
37 struct nb_cb_create_args *args);
38int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
39 struct nb_cb_destroy_args *args);
40int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify(
41 struct nb_cb_modify_args *args);
42int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
43 struct nb_cb_destroy_args *args);
44int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
45 struct nb_cb_modify_args *args);
46int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_destroy(
47 struct nb_cb_destroy_args *args);
065276ae
SM
48int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
49 struct nb_cb_modify_args *args);
50int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
51 struct nb_cb_destroy_args *args);
88fa5104 52int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
53 struct nb_cb_create_args *args);
54int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
55 struct nb_cb_destroy_args *args);
56int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
57 struct nb_cb_modify_args *args);
58int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
59 struct nb_cb_destroy_args *args);
60int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
61 struct nb_cb_modify_args *args);
62int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
63 struct nb_cb_destroy_args *args);
64int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
65 struct nb_cb_modify_args *args);
66int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
67 struct nb_cb_destroy_args *args);
68int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
69 struct nb_cb_create_args *args);
70int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
71 struct nb_cb_destroy_args *args);
72int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
73 struct nb_cb_create_args *args);
74int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
75 struct nb_cb_destroy_args *args);
76int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
77 struct nb_cb_modify_args *args);
78int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_table_id_modify(
79 struct nb_cb_modify_args *args);
80int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create(
81 struct nb_cb_create_args *args);
82int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy(
83 struct nb_cb_destroy_args *args);
84int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify(
85 struct nb_cb_modify_args *args);
86int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_destroy(
87 struct nb_cb_destroy_args *args);
88int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify(
89 struct nb_cb_modify_args *args);
90int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_destroy(
91 struct nb_cb_destroy_args *args);
065276ae
SM
92int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify(
93 struct nb_cb_modify_args *args);
94int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy(
95 struct nb_cb_destroy_args *args);
88fa5104 96int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create(
97 struct nb_cb_create_args *args);
98int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy(
99 struct nb_cb_destroy_args *args);
100int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify(
101 struct nb_cb_modify_args *args);
102int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy(
103 struct nb_cb_destroy_args *args);
104int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify(
105 struct nb_cb_modify_args *args);
106int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy(
107 struct nb_cb_destroy_args *args);
108int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify(
109 struct nb_cb_modify_args *args);
110int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy(
111 struct nb_cb_destroy_args *args);
112
113/* Optional 'apply_finish' callbacks. */
114
115void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish(
116 struct nb_cb_apply_finish_args *args);
117void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish(
118 struct nb_cb_apply_finish_args *args);
119
120/* Optional 'pre_validate' callbacks. */
121int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate(
122 struct nb_cb_pre_validate_args *args);
123
124/*
125 * Callback registered with routing_nb lib to validate only
126 * one instance of staticd is allowed
127 */
128int routing_control_plane_protocols_name_validate(
129 struct nb_cb_create_args *args);
130
131/* xpath macros */
132/* route-list */
133#define FRR_STATIC_ROUTE_INFO_KEY_XPATH \
134 "/frr-routing:routing/control-plane-protocols/" \
135 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
314825ff 136 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
88fa5104 137 "path-list[distance='%u']"
138
139
140#define FRR_STATIC_ROUTE_PATH_TAG_XPATH "/tag"
141
142#define FRR_STATIC_ROUTE_PATH_TABLEID_XPATH "/table-id"
143
144/* route-list/frr-nexthops */
145#define FRR_STATIC_ROUTE_NH_KEY_XPATH \
146 "/frr-nexthops/" \
147 "nexthop[nh-type='%s'][vrf='%s'][gateway='%s'][interface='%s']"
148
149#define FRR_STATIC_ROUTE_NH_ONLINK_XPATH "/onlink"
150
065276ae
SM
151#define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color"
152
88fa5104 153#define FRR_STATIC_ROUTE_NH_BH_XPATH "/bh-type"
154
155#define FRR_STATIC_ROUTE_NH_LABEL_XPATH "/mpls-label-stack"
156
157#define FRR_STATIC_ROUTE_NHLB_KEY_XPATH "/entry[id='%u']/label"
158
159/* route-list/srclist */
160#define FRR_S_ROUTE_SRC_INFO_KEY_XPATH \
161 "/frr-routing:routing/control-plane-protocols/" \
162 "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \
314825ff 163 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
88fa5104 164 "src-list[src-prefix='%s']/path-list[distance='%u']"
165
166/* route-list/frr-nexthops */
167#define FRR_DEL_S_ROUTE_NH_KEY_XPATH \
168 FRR_STATIC_ROUTE_INFO_KEY_XPATH \
169 FRR_STATIC_ROUTE_NH_KEY_XPATH
170
171/* route-list/src/src-list/frr-nexthops*/
172#define FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH \
173 FRR_S_ROUTE_SRC_INFO_KEY_XPATH \
174 FRR_STATIC_ROUTE_NH_KEY_XPATH
175
176#endif