]> git.proxmox.com Git - mirror_frr.git/blob - ripd/rip_nb_notifications.c
Merge pull request #5192 from donaldsharp/zebra_rejection
[mirror_frr.git] / ripd / rip_nb_notifications.c
1 /*
2 * Copyright (C) 2018 NetDEF, Inc.
3 * Renato Westphal
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 *
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
18 */
19
20 #include <zebra.h>
21
22 #include "if.h"
23 #include "vrf.h"
24 #include "log.h"
25 #include "prefix.h"
26 #include "table.h"
27 #include "command.h"
28 #include "routemap.h"
29 #include "northbound.h"
30 #include "libfrr.h"
31
32 #include "ripd/ripd.h"
33 #include "ripd/rip_nb.h"
34 #include "ripd/rip_debug.h"
35 #include "ripd/rip_interface.h"
36
37 /*
38 * XPath: /frr-ripd:authentication-type-failure
39 */
40 void ripd_notif_send_auth_type_failure(const char *ifname)
41 {
42 const char *xpath = "/frr-ripd:authentication-type-failure";
43 struct list *arguments;
44 char xpath_arg[XPATH_MAXLEN];
45 struct yang_data *data;
46
47 arguments = yang_data_list_new();
48
49 snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath);
50 data = yang_data_new_string(xpath_arg, ifname);
51 listnode_add(arguments, data);
52
53 nb_notification_send(xpath, arguments);
54 }
55
56 /*
57 * XPath: /frr-ripd:authentication-failure
58 */
59 void ripd_notif_send_auth_failure(const char *ifname)
60 {
61 const char *xpath = "/frr-ripd:authentication-failure";
62 struct list *arguments;
63 char xpath_arg[XPATH_MAXLEN];
64 struct yang_data *data;
65
66 arguments = yang_data_list_new();
67
68 snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath);
69 data = yang_data_new_string(xpath_arg, ifname);
70 listnode_add(arguments, data);
71
72 nb_notification_send(xpath, arguments);
73 }