]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_nb_rpcs.c
2 * Copyright (C) 2020 Cumulus Networks, Inc.
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)
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
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "northbound.h"
24 #include "zebra/zebra_nb.h"
25 #include "zebra/zebra_router.h"
26 #include "zebra/zebra_vrf.h"
27 #include "zebra/zebra_vxlan.h"
30 * XPath: /frr-zebra:clear-evpn-dup-addr
32 int clear_evpn_dup_addr_rpc(struct nb_cb_rpc_args
*args
)
34 struct zebra_vrf
*zvrf
;
36 struct yang_data
*yang_dup_choice
= NULL
, *yang_dup_vni
= NULL
,
37 *yang_dup_ip
= NULL
, *yang_dup_mac
= NULL
;
39 yang_dup_choice
= yang_data_list_find(args
->input
, "%s/%s", args
->xpath
,
40 "input/clear-dup-choice");
42 zvrf
= zebra_vrf_get_evpn();
45 && strcmp(yang_dup_choice
->value
, "all-case") == 0) {
46 zebra_vxlan_clear_dup_detect_vni_all(zvrf
);
49 struct ipaddr host_ip
= {.ipa_type
= IPADDR_NONE
};
52 yang_dup_vni
= yang_data_list_find(
53 args
->input
, "%s/%s", args
->xpath
,
54 "input/clear-dup-choice/single-case/vni-id");
56 vni
= yang_str2uint32(yang_dup_vni
->value
);
58 yang_dup_mac
= yang_data_list_find(
59 args
->input
, "%s/%s", args
->xpath
,
60 "input/clear-dup-choice/single-case/vni-id/mac-addr");
61 yang_dup_ip
= yang_data_list_find(
62 args
->input
, "%s/%s", args
->xpath
,
63 "input/clear-dup-choice/single-case/vni-id/vni-ipaddr");
66 yang_str2mac(yang_dup_mac
->value
, &mac
);
67 ret
= zebra_vxlan_clear_dup_detect_vni_mac(
69 } else if (yang_dup_ip
) {
70 yang_str2ip(yang_dup_ip
->value
, &host_ip
);
71 ret
= zebra_vxlan_clear_dup_detect_vni_ip(
74 ret
= zebra_vxlan_clear_dup_detect_vni(zvrf
,
78 ret
= (ret
!= CMD_SUCCESS
) ? NB_ERR
: NB_OK
;
84 * XPath: /frr-zebra:get-route-information
86 int get_route_information_rpc(struct nb_cb_rpc_args
*args
)
88 /* TODO: implement me. */
89 return NB_ERR_NOT_FOUND
;
93 * XPath: /frr-zebra:get-v6-mroute-info
95 int get_v6_mroute_info_rpc(struct nb_cb_rpc_args
*args
)
97 /* TODO: implement me. */
98 return NB_ERR_NOT_FOUND
;
102 * XPath: /frr-zebra:get-vrf-info
104 int get_vrf_info_rpc(struct nb_cb_rpc_args
*args
)
106 /* TODO: implement me. */
107 return NB_ERR_NOT_FOUND
;
111 * XPath: /frr-zebra:get-vrf-vni-info
113 int get_vrf_vni_info_rpc(struct nb_cb_rpc_args
*args
)
115 /* TODO: implement me. */
116 return NB_ERR_NOT_FOUND
;
120 * XPath: /frr-zebra:get-evpn-info
122 int get_evpn_info_rpc(struct nb_cb_rpc_args
*args
)
124 /* TODO: implement me. */
125 return NB_ERR_NOT_FOUND
;
129 * XPath: /frr-zebra:get-vni-info
131 int get_vni_info_rpc(struct nb_cb_rpc_args
*args
)
133 /* TODO: implement me. */
134 return NB_ERR_NOT_FOUND
;
138 * XPath: /frr-zebra:get-evpn-vni-rmac
140 int get_evpn_vni_rmac_rpc(struct nb_cb_rpc_args
*args
)
142 /* TODO: implement me. */
143 return NB_ERR_NOT_FOUND
;
147 * XPath: /frr-zebra:get-evpn-vni-nexthops
149 int get_evpn_vni_nexthops_rpc(struct nb_cb_rpc_args
*args
)
151 /* TODO: implement me. */
152 return NB_ERR_NOT_FOUND
;
156 * XPath: /frr-zebra:get-evpn-macs
158 int get_evpn_macs_rpc(struct nb_cb_rpc_args
*args
)
160 /* TODO: implement me. */
161 return NB_ERR_NOT_FOUND
;
165 * XPath: /frr-zebra:get-evpn-arp-cache
167 int get_evpn_arp_cache_rpc(struct nb_cb_rpc_args
*args
)
169 /* TODO: implement me. */
170 return NB_ERR_NOT_FOUND
;
174 * XPath: /frr-zebra:get-pbr-ipset
176 int get_pbr_ipset_rpc(struct nb_cb_rpc_args
*args
)
178 /* TODO: implement me. */
179 return NB_ERR_NOT_FOUND
;
183 * XPath: /frr-zebra:get-pbr-iptable
185 int get_pbr_iptable_rpc(struct nb_cb_rpc_args
*args
)
187 /* TODO: implement me. */
188 return NB_ERR_NOT_FOUND
;
192 * XPath: /frr-zebra:get-debugs
194 int get_debugs_rpc(struct nb_cb_rpc_args
*args
)
196 /* TODO: implement me. */
197 return NB_ERR_NOT_FOUND
;