]> git.proxmox.com Git - mirror_frr.git/blob - staticd/static_nb.h
Merge pull request #6738 from deastoe/frr-reload-log-level
[mirror_frr.git] / staticd / static_nb.h
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
21 extern const struct frr_yang_module_info frr_staticd_info;
22
23 /* Mandatory callbacks. */
24 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_create(
25 struct nb_cb_create_args *args);
26 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_destroy(
27 struct nb_cb_destroy_args *args);
28 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_create(
29 struct nb_cb_create_args *args);
30 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_destroy(
31 struct nb_cb_destroy_args *args);
32 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_tag_modify(
33 struct nb_cb_modify_args *args);
34 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_table_id_modify(
35 struct nb_cb_modify_args *args);
36 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create(
37 struct nb_cb_create_args *args);
38 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy(
39 struct nb_cb_destroy_args *args);
40 int 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);
42 int 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);
44 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify(
45 struct nb_cb_modify_args *args);
46 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_destroy(
47 struct nb_cb_destroy_args *args);
48 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify(
49 struct nb_cb_modify_args *args);
50 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy(
51 struct nb_cb_destroy_args *args);
52 int 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);
54 int 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);
56 int 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);
58 int 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);
60 int 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);
62 int 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);
64 int 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);
66 int 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);
68 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create(
69 struct nb_cb_create_args *args);
70 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy(
71 struct nb_cb_destroy_args *args);
72 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create(
73 struct nb_cb_create_args *args);
74 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy(
75 struct nb_cb_destroy_args *args);
76 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify(
77 struct nb_cb_modify_args *args);
78 int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_table_id_modify(
79 struct nb_cb_modify_args *args);
80 int 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);
82 int 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);
84 int 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);
86 int 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);
88 int 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);
90 int 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);
92 int 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);
94 int 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);
96 int 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);
98 int 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);
100 int 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);
102 int 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);
104 int 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);
106 int 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);
108 int 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);
110 int 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
115 void 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);
117 void 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. */
121 int 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 */
128 int 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']/" \
136 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
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
151 #define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color"
152
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']/" \
163 "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \
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