]>
Commit | Line | Data |
---|---|---|
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 | ||
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); | |
88fa5104 | 34 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_create( |
35 | struct nb_cb_create_args *args); | |
36 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_destroy( | |
37 | struct nb_cb_destroy_args *args); | |
38 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_bh_type_modify( | |
39 | struct nb_cb_modify_args *args); | |
88fa5104 | 40 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_onlink_modify( |
41 | struct nb_cb_modify_args *args); | |
065276ae SM |
42 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_modify( |
43 | struct nb_cb_modify_args *args); | |
44 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_color_destroy( | |
45 | struct nb_cb_destroy_args *args); | |
88fa5104 | 46 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
47 | struct nb_cb_create_args *args); | |
48 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_destroy( | |
49 | struct nb_cb_destroy_args *args); | |
50 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_modify( | |
51 | struct nb_cb_modify_args *args); | |
52 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_label_destroy( | |
53 | struct nb_cb_destroy_args *args); | |
54 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_modify( | |
55 | struct nb_cb_modify_args *args); | |
56 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_ttl_destroy( | |
57 | struct nb_cb_destroy_args *args); | |
58 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_modify( | |
59 | struct nb_cb_modify_args *args); | |
60 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_traffic_class_destroy( | |
61 | struct nb_cb_destroy_args *args); | |
62 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_create( | |
63 | struct nb_cb_create_args *args); | |
64 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_destroy( | |
65 | struct nb_cb_destroy_args *args); | |
66 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_create( | |
67 | struct nb_cb_create_args *args); | |
68 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_destroy( | |
69 | struct nb_cb_destroy_args *args); | |
70 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_tag_modify( | |
71 | struct nb_cb_modify_args *args); | |
88fa5104 | 72 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_create( |
73 | struct nb_cb_create_args *args); | |
74 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_destroy( | |
75 | struct nb_cb_destroy_args *args); | |
76 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_bh_type_modify( | |
77 | struct nb_cb_modify_args *args); | |
88fa5104 | 78 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_onlink_modify( |
79 | struct nb_cb_modify_args *args); | |
065276ae SM |
80 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_modify( |
81 | struct nb_cb_modify_args *args); | |
82 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_color_destroy( | |
83 | struct nb_cb_destroy_args *args); | |
88fa5104 | 84 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_create( |
85 | struct nb_cb_create_args *args); | |
86 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_mpls_label_stack_entry_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_mpls_label_stack_entry_label_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_mpls_label_stack_entry_label_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_mpls_label_stack_entry_ttl_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_mpls_label_stack_entry_ttl_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_traffic_class_modify( | |
97 | struct nb_cb_modify_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_traffic_class_destroy( | |
99 | struct nb_cb_destroy_args *args); | |
100 | ||
101 | /* Optional 'apply_finish' callbacks. */ | |
102 | ||
103 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_apply_finish( | |
104 | struct nb_cb_apply_finish_args *args); | |
105 | void routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_list_path_list_frr_nexthops_nexthop_apply_finish( | |
106 | struct nb_cb_apply_finish_args *args); | |
107 | ||
108 | /* Optional 'pre_validate' callbacks. */ | |
109 | int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_path_list_frr_nexthops_nexthop_pre_validate( | |
110 | struct nb_cb_pre_validate_args *args); | |
111 | ||
112 | /* | |
113 | * Callback registered with routing_nb lib to validate only | |
114 | * one instance of staticd is allowed | |
115 | */ | |
116 | int routing_control_plane_protocols_name_validate( | |
117 | struct nb_cb_create_args *args); | |
118 | ||
119 | /* xpath macros */ | |
120 | /* route-list */ | |
121 | #define FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
122 | "/frr-routing:routing/control-plane-protocols/" \ | |
123 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 124 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 125 | "path-list[table-id='%u'][distance='%u']" |
88fa5104 | 126 | |
127 | ||
128 | #define FRR_STATIC_ROUTE_PATH_TAG_XPATH "/tag" | |
129 | ||
88fa5104 | 130 | /* route-list/frr-nexthops */ |
131 | #define FRR_STATIC_ROUTE_NH_KEY_XPATH \ | |
132 | "/frr-nexthops/" \ | |
133 | "nexthop[nh-type='%s'][vrf='%s'][gateway='%s'][interface='%s']" | |
134 | ||
135 | #define FRR_STATIC_ROUTE_NH_ONLINK_XPATH "/onlink" | |
136 | ||
065276ae SM |
137 | #define FRR_STATIC_ROUTE_NH_COLOR_XPATH "/srte-color" |
138 | ||
88fa5104 | 139 | #define FRR_STATIC_ROUTE_NH_BH_XPATH "/bh-type" |
140 | ||
141 | #define FRR_STATIC_ROUTE_NH_LABEL_XPATH "/mpls-label-stack" | |
142 | ||
143 | #define FRR_STATIC_ROUTE_NHLB_KEY_XPATH "/entry[id='%u']/label" | |
144 | ||
145 | /* route-list/srclist */ | |
146 | #define FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
147 | "/frr-routing:routing/control-plane-protocols/" \ | |
148 | "control-plane-protocol[type='%s'][name='%s'][vrf='%s']/" \ | |
314825ff | 149 | "frr-staticd:staticd/route-list[prefix='%s'][afi-safi='%s']/" \ |
ef4b6b22 | 150 | "src-list[src-prefix='%s']/path-list[table-id='%u'][distance='%u']" |
88fa5104 | 151 | |
152 | /* route-list/frr-nexthops */ | |
153 | #define FRR_DEL_S_ROUTE_NH_KEY_XPATH \ | |
154 | FRR_STATIC_ROUTE_INFO_KEY_XPATH \ | |
155 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
156 | ||
157 | /* route-list/src/src-list/frr-nexthops*/ | |
158 | #define FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH \ | |
159 | FRR_S_ROUTE_SRC_INFO_KEY_XPATH \ | |
160 | FRR_STATIC_ROUTE_NH_KEY_XPATH | |
161 | ||
162 | #endif |