]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_nb_rpcs.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2020 Cumulus Networks, Inc.
8 #include "northbound.h"
11 #include "zebra/zebra_nb.h"
12 #include "zebra/zebra_router.h"
13 #include "zebra/zebra_vrf.h"
14 #include "zebra/zebra_vxlan.h"
17 * XPath: /frr-zebra:clear-evpn-dup-addr
19 int clear_evpn_dup_addr_rpc(struct nb_cb_rpc_args
*args
)
21 struct zebra_vrf
*zvrf
;
23 struct yang_data
*yang_dup_choice
= NULL
, *yang_dup_vni
= NULL
,
24 *yang_dup_ip
= NULL
, *yang_dup_mac
= NULL
;
26 yang_dup_choice
= yang_data_list_find(args
->input
, "%s/%s", args
->xpath
,
27 "input/clear-dup-choice");
29 zvrf
= zebra_vrf_get_evpn();
32 && strcmp(yang_dup_choice
->value
, "all-case") == 0) {
33 zebra_vxlan_clear_dup_detect_vni_all(zvrf
);
36 struct ipaddr host_ip
= {.ipa_type
= IPADDR_NONE
};
39 yang_dup_vni
= yang_data_list_find(
40 args
->input
, "%s/%s", args
->xpath
,
41 "input/clear-dup-choice/single-case/vni-id");
43 vni
= yang_str2uint32(yang_dup_vni
->value
);
45 yang_dup_mac
= yang_data_list_find(
46 args
->input
, "%s/%s", args
->xpath
,
47 "input/clear-dup-choice/single-case/vni-id/mac-addr");
48 yang_dup_ip
= yang_data_list_find(
49 args
->input
, "%s/%s", args
->xpath
,
50 "input/clear-dup-choice/single-case/vni-id/vni-ipaddr");
53 yang_str2mac(yang_dup_mac
->value
, &mac
);
54 ret
= zebra_vxlan_clear_dup_detect_vni_mac(
55 zvrf
, vni
, &mac
, args
->errmsg
,
57 } else if (yang_dup_ip
) {
58 yang_str2ip(yang_dup_ip
->value
, &host_ip
);
59 ret
= zebra_vxlan_clear_dup_detect_vni_ip(
60 zvrf
, vni
, &host_ip
, args
->errmsg
,
63 ret
= zebra_vxlan_clear_dup_detect_vni(zvrf
,
74 * XPath: /frr-zebra:get-route-information
76 int get_route_information_rpc(struct nb_cb_rpc_args
*args
)
78 /* TODO: implement me. */
79 return NB_ERR_NOT_FOUND
;
83 * XPath: /frr-zebra:get-v6-mroute-info
85 int get_v6_mroute_info_rpc(struct nb_cb_rpc_args
*args
)
87 /* TODO: implement me. */
88 return NB_ERR_NOT_FOUND
;
92 * XPath: /frr-zebra:get-vrf-info
94 int get_vrf_info_rpc(struct nb_cb_rpc_args
*args
)
96 /* TODO: implement me. */
97 return NB_ERR_NOT_FOUND
;
101 * XPath: /frr-zebra:get-vrf-vni-info
103 int get_vrf_vni_info_rpc(struct nb_cb_rpc_args
*args
)
105 /* TODO: implement me. */
106 return NB_ERR_NOT_FOUND
;
110 * XPath: /frr-zebra:get-evpn-info
112 int get_evpn_info_rpc(struct nb_cb_rpc_args
*args
)
114 /* TODO: implement me. */
115 return NB_ERR_NOT_FOUND
;
119 * XPath: /frr-zebra:get-vni-info
121 int get_vni_info_rpc(struct nb_cb_rpc_args
*args
)
123 /* TODO: implement me. */
124 return NB_ERR_NOT_FOUND
;
128 * XPath: /frr-zebra:get-evpn-vni-rmac
130 int get_evpn_vni_rmac_rpc(struct nb_cb_rpc_args
*args
)
132 /* TODO: implement me. */
133 return NB_ERR_NOT_FOUND
;
137 * XPath: /frr-zebra:get-evpn-vni-nexthops
139 int get_evpn_vni_nexthops_rpc(struct nb_cb_rpc_args
*args
)
141 /* TODO: implement me. */
142 return NB_ERR_NOT_FOUND
;
146 * XPath: /frr-zebra:get-evpn-macs
148 int get_evpn_macs_rpc(struct nb_cb_rpc_args
*args
)
150 /* TODO: implement me. */
151 return NB_ERR_NOT_FOUND
;
155 * XPath: /frr-zebra:get-evpn-arp-cache
157 int get_evpn_arp_cache_rpc(struct nb_cb_rpc_args
*args
)
159 /* TODO: implement me. */
160 return NB_ERR_NOT_FOUND
;
164 * XPath: /frr-zebra:get-pbr-ipset
166 int get_pbr_ipset_rpc(struct nb_cb_rpc_args
*args
)
168 /* TODO: implement me. */
169 return NB_ERR_NOT_FOUND
;
173 * XPath: /frr-zebra:get-pbr-iptable
175 int get_pbr_iptable_rpc(struct nb_cb_rpc_args
*args
)
177 /* TODO: implement me. */
178 return NB_ERR_NOT_FOUND
;
182 * XPath: /frr-zebra:get-debugs
184 int get_debugs_rpc(struct nb_cb_rpc_args
*args
)
186 /* TODO: implement me. */
187 return NB_ERR_NOT_FOUND
;