]>
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(const char *xpath
, const struct list
*input
,
35 struct zebra_vrf
*zvrf
;
37 struct yang_data
*yang_dup_choice
= NULL
, *yang_dup_vni
= NULL
,
38 *yang_dup_ip
= NULL
, *yang_dup_mac
= NULL
;
40 yang_dup_choice
= yang_data_list_find(input
, "%s/%s", xpath
,
41 "input/clear-dup-choice");
43 zvrf
= zebra_vrf_get_evpn();
46 && strcmp(yang_dup_choice
->value
, "all-case") == 0) {
47 zebra_vxlan_clear_dup_detect_vni_all(zvrf
);
50 struct ipaddr host_ip
= {.ipa_type
= IPADDR_NONE
};
53 yang_dup_vni
= yang_data_list_find(
54 input
, "%s/%s", xpath
,
55 "input/clear-dup-choice/single-case/vni-id");
57 vni
= yang_str2uint32(yang_dup_vni
->value
);
59 yang_dup_mac
= yang_data_list_find(
60 input
, "%s/%s", xpath
,
61 "input/clear-dup-choice/single-case/vni-id/mac-addr");
62 yang_dup_ip
= yang_data_list_find(
63 input
, "%s/%s", xpath
,
64 "input/clear-dup-choice/single-case/vni-id/vni-ipaddr");
67 yang_str2mac(yang_dup_mac
->value
, &mac
);
68 ret
= zebra_vxlan_clear_dup_detect_vni_mac(
70 } else if (yang_dup_ip
) {
71 yang_str2ip(yang_dup_ip
->value
, &host_ip
);
72 ret
= zebra_vxlan_clear_dup_detect_vni_ip(
75 ret
= zebra_vxlan_clear_dup_detect_vni(zvrf
,
79 ret
= (ret
!= CMD_SUCCESS
) ? NB_ERR
: NB_OK
;
85 * XPath: /frr-zebra:get-route-information
87 int get_route_information_rpc(const char *xpath
, const struct list
*input
,
90 /* TODO: implement me. */
91 return NB_ERR_NOT_FOUND
;
95 * XPath: /frr-zebra:get-v6-mroute-info
97 int get_v6_mroute_info_rpc(const char *xpath
, const struct list
*input
,
100 /* TODO: implement me. */
101 return NB_ERR_NOT_FOUND
;
105 * XPath: /frr-zebra:get-vrf-info
107 int get_vrf_info_rpc(const char *xpath
, const struct list
*input
,
110 /* TODO: implement me. */
111 return NB_ERR_NOT_FOUND
;
115 * XPath: /frr-zebra:get-vrf-vni-info
117 int get_vrf_vni_info_rpc(const char *xpath
, const struct list
*input
,
120 /* TODO: implement me. */
121 return NB_ERR_NOT_FOUND
;
125 * XPath: /frr-zebra:get-evpn-info
127 int get_evpn_info_rpc(const char *xpath
, const struct list
*input
,
130 /* TODO: implement me. */
131 return NB_ERR_NOT_FOUND
;
135 * XPath: /frr-zebra:get-vni-info
137 int get_vni_info_rpc(const char *xpath
, const struct list
*input
,
140 /* TODO: implement me. */
141 return NB_ERR_NOT_FOUND
;
145 * XPath: /frr-zebra:get-evpn-vni-rmac
147 int get_evpn_vni_rmac_rpc(const char *xpath
, const struct list
*input
,
150 /* TODO: implement me. */
151 return NB_ERR_NOT_FOUND
;
155 * XPath: /frr-zebra:get-evpn-vni-nexthops
157 int get_evpn_vni_nexthops_rpc(const char *xpath
, const struct list
*input
,
160 /* TODO: implement me. */
161 return NB_ERR_NOT_FOUND
;
165 * XPath: /frr-zebra:get-evpn-macs
167 int get_evpn_macs_rpc(const char *xpath
, const struct list
*input
,
170 /* TODO: implement me. */
171 return NB_ERR_NOT_FOUND
;
175 * XPath: /frr-zebra:get-evpn-arp-cache
177 int get_evpn_arp_cache_rpc(const char *xpath
, const struct list
*input
,
180 /* TODO: implement me. */
181 return NB_ERR_NOT_FOUND
;
185 * XPath: /frr-zebra:get-pbr-ipset
187 int get_pbr_ipset_rpc(const char *xpath
, const struct list
*input
,
190 /* TODO: implement me. */
191 return NB_ERR_NOT_FOUND
;
195 * XPath: /frr-zebra:get-pbr-iptable
197 int get_pbr_iptable_rpc(const char *xpath
, const struct list
*input
,
200 /* TODO: implement me. */
201 return NB_ERR_NOT_FOUND
;
205 * XPath: /frr-zebra:get-debugs
207 int get_debugs_rpc(const char *xpath
, const struct list
*input
,
210 /* TODO: implement me. */
211 return NB_ERR_NOT_FOUND
;