]> git.proxmox.com Git - mirror_frr.git/blob - ripngd/ripng_northbound.c
yang, ripngd: add 'frr-ripngd.yang' and associated stub callbacks
[mirror_frr.git] / ripngd / ripng_northbound.c
1 /*
2 * Copyright (C) 1998 Kunihiro Ishiguro
3 * Copyright (C) 2018 NetDEF, Inc.
4 * Renato Westphal
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <zebra.h>
22
23 #include "if.h"
24 #include "vrf.h"
25 #include "log.h"
26 #include "prefix.h"
27 #include "table.h"
28 #include "command.h"
29 #include "routemap.h"
30 #include "northbound.h"
31 #include "libfrr.h"
32
33 #include "ripngd/ripngd.h"
34 #include "ripngd/ripng_cli.h"
35
36 /*
37 * XPath: /frr-ripngd:ripngd/instance
38 */
39 static int ripngd_instance_create(enum nb_event event,
40 const struct lyd_node *dnode,
41 union nb_resource *resource)
42 {
43 /* TODO: implement me. */
44 return NB_OK;
45 }
46
47 static int ripngd_instance_delete(enum nb_event event,
48 const struct lyd_node *dnode)
49 {
50 /* TODO: implement me. */
51 return NB_OK;
52 }
53
54 /*
55 * XPath: /frr-ripngd:ripngd/instance/allow-ecmp
56 */
57 static int ripngd_instance_allow_ecmp_modify(enum nb_event event,
58 const struct lyd_node *dnode,
59 union nb_resource *resource)
60 {
61 /* TODO: implement me. */
62 return NB_OK;
63 }
64
65 /*
66 * XPath: /frr-ripngd:ripngd/instance/default-information-originate
67 */
68 static int ripngd_instance_default_information_originate_modify(
69 enum nb_event event, const struct lyd_node *dnode,
70 union nb_resource *resource)
71 {
72 /* TODO: implement me. */
73 return NB_OK;
74 }
75
76 /*
77 * XPath: /frr-ripngd:ripngd/instance/default-metric
78 */
79 static int ripngd_instance_default_metric_modify(enum nb_event event,
80 const struct lyd_node *dnode,
81 union nb_resource *resource)
82 {
83 /* TODO: implement me. */
84 return NB_OK;
85 }
86
87 /*
88 * XPath: /frr-ripngd:ripngd/instance/network
89 */
90 static int ripngd_instance_network_create(enum nb_event event,
91 const struct lyd_node *dnode,
92 union nb_resource *resource)
93 {
94 /* TODO: implement me. */
95 return NB_OK;
96 }
97
98 static int ripngd_instance_network_delete(enum nb_event event,
99 const struct lyd_node *dnode)
100 {
101 /* TODO: implement me. */
102 return NB_OK;
103 }
104
105 /*
106 * XPath: /frr-ripngd:ripngd/instance/interface
107 */
108 static int ripngd_instance_interface_create(enum nb_event event,
109 const struct lyd_node *dnode,
110 union nb_resource *resource)
111 {
112 /* TODO: implement me. */
113 return NB_OK;
114 }
115
116 static int ripngd_instance_interface_delete(enum nb_event event,
117 const struct lyd_node *dnode)
118 {
119 /* TODO: implement me. */
120 return NB_OK;
121 }
122
123 /*
124 * XPath: /frr-ripngd:ripngd/instance/offset-list
125 */
126 static int ripngd_instance_offset_list_create(enum nb_event event,
127 const struct lyd_node *dnode,
128 union nb_resource *resource)
129 {
130 /* TODO: implement me. */
131 return NB_OK;
132 }
133
134 static int ripngd_instance_offset_list_delete(enum nb_event event,
135 const struct lyd_node *dnode)
136 {
137 /* TODO: implement me. */
138 return NB_OK;
139 }
140
141 /*
142 * XPath: /frr-ripngd:ripngd/instance/offset-list/access-list
143 */
144 static int
145 ripngd_instance_offset_list_access_list_modify(enum nb_event event,
146 const struct lyd_node *dnode,
147 union nb_resource *resource)
148 {
149 /* TODO: implement me. */
150 return NB_OK;
151 }
152
153 /*
154 * XPath: /frr-ripngd:ripngd/instance/offset-list/metric
155 */
156 static int
157 ripngd_instance_offset_list_metric_modify(enum nb_event event,
158 const struct lyd_node *dnode,
159 union nb_resource *resource)
160 {
161 /* TODO: implement me. */
162 return NB_OK;
163 }
164
165 /*
166 * XPath: /frr-ripngd:ripngd/instance/passive-interface
167 */
168 static int
169 ripngd_instance_passive_interface_create(enum nb_event event,
170 const struct lyd_node *dnode,
171 union nb_resource *resource)
172 {
173 /* TODO: implement me. */
174 return NB_OK;
175 }
176
177 static int
178 ripngd_instance_passive_interface_delete(enum nb_event event,
179 const struct lyd_node *dnode)
180 {
181 /* TODO: implement me. */
182 return NB_OK;
183 }
184
185 /*
186 * XPath: /frr-ripngd:ripngd/instance/redistribute
187 */
188 static int ripngd_instance_redistribute_create(enum nb_event event,
189 const struct lyd_node *dnode,
190 union nb_resource *resource)
191 {
192 /* TODO: implement me. */
193 return NB_OK;
194 }
195
196 static int ripngd_instance_redistribute_delete(enum nb_event event,
197 const struct lyd_node *dnode)
198 {
199 /* TODO: implement me. */
200 return NB_OK;
201 }
202
203 /*
204 * XPath: /frr-ripngd:ripngd/instance/redistribute/route-map
205 */
206 static int
207 ripngd_instance_redistribute_route_map_modify(enum nb_event event,
208 const struct lyd_node *dnode,
209 union nb_resource *resource)
210 {
211 /* TODO: implement me. */
212 return NB_OK;
213 }
214
215 static int
216 ripngd_instance_redistribute_route_map_delete(enum nb_event event,
217 const struct lyd_node *dnode)
218 {
219 /* TODO: implement me. */
220 return NB_OK;
221 }
222
223 /*
224 * XPath: /frr-ripngd:ripngd/instance/redistribute/metric
225 */
226 static int
227 ripngd_instance_redistribute_metric_modify(enum nb_event event,
228 const struct lyd_node *dnode,
229 union nb_resource *resource)
230 {
231 /* TODO: implement me. */
232 return NB_OK;
233 }
234
235 static int
236 ripngd_instance_redistribute_metric_delete(enum nb_event event,
237 const struct lyd_node *dnode)
238 {
239 /* TODO: implement me. */
240 return NB_OK;
241 }
242
243 /*
244 * XPath: /frr-ripngd:ripngd/instance/static-route
245 */
246 static int ripngd_instance_static_route_create(enum nb_event event,
247 const struct lyd_node *dnode,
248 union nb_resource *resource)
249 {
250 /* TODO: implement me. */
251 return NB_OK;
252 }
253
254 static int ripngd_instance_static_route_delete(enum nb_event event,
255 const struct lyd_node *dnode)
256 {
257 /* TODO: implement me. */
258 return NB_OK;
259 }
260
261 /*
262 * XPath: /frr-ripngd:ripngd/instance/aggregate-address
263 */
264 static int
265 ripngd_instance_aggregate_address_create(enum nb_event event,
266 const struct lyd_node *dnode,
267 union nb_resource *resource)
268 {
269 /* TODO: implement me. */
270 return NB_OK;
271 }
272
273 static int
274 ripngd_instance_aggregate_address_delete(enum nb_event event,
275 const struct lyd_node *dnode)
276 {
277 /* TODO: implement me. */
278 return NB_OK;
279 }
280
281 /*
282 * XPath: /frr-ripngd:ripngd/instance/timers/flush-interval
283 */
284 static int
285 ripngd_instance_timers_flush_interval_modify(enum nb_event event,
286 const struct lyd_node *dnode,
287 union nb_resource *resource)
288 {
289 /* TODO: implement me. */
290 return NB_OK;
291 }
292
293 /*
294 * XPath: /frr-ripngd:ripngd/instance/timers/holddown-interval
295 */
296 static int
297 ripngd_instance_timers_holddown_interval_modify(enum nb_event event,
298 const struct lyd_node *dnode,
299 union nb_resource *resource)
300 {
301 /* TODO: implement me. */
302 return NB_OK;
303 }
304
305 /*
306 * XPath: /frr-ripngd:ripngd/instance/timers/update-interval
307 */
308 static int
309 ripngd_instance_timers_update_interval_modify(enum nb_event event,
310 const struct lyd_node *dnode,
311 union nb_resource *resource)
312 {
313 /* TODO: implement me. */
314 return NB_OK;
315 }
316
317 /*
318 * XPath: /frr-ripngd:ripngd/state/neighbors/neighbor
319 */
320 static const void *
321 ripngd_state_neighbors_neighbor_get_next(const void *parent_list_entry,
322 const void *list_entry)
323 {
324 /* TODO: implement me. */
325 return NULL;
326 }
327
328 static int ripngd_state_neighbors_neighbor_get_keys(const void *list_entry,
329 struct yang_list_keys *keys)
330 {
331 /* TODO: implement me. */
332 return NB_OK;
333 }
334
335 static const void *
336 ripngd_state_neighbors_neighbor_lookup_entry(const void *parent_list_entry,
337 const struct yang_list_keys *keys)
338 {
339 /* TODO: implement me. */
340 return NULL;
341 }
342
343 /*
344 * XPath: /frr-ripngd:ripngd/state/neighbors/neighbor/address
345 */
346 static struct yang_data *
347 ripngd_state_neighbors_neighbor_address_get_elem(const char *xpath,
348 const void *list_entry)
349 {
350 /* TODO: implement me. */
351 return NULL;
352 }
353
354 /*
355 * XPath: /frr-ripngd:ripngd/state/neighbors/neighbor/last-update
356 */
357 static struct yang_data *
358 ripngd_state_neighbors_neighbor_last_update_get_elem(const char *xpath,
359 const void *list_entry)
360 {
361 /* TODO: implement me. */
362 return NULL;
363 }
364
365 /*
366 * XPath: /frr-ripngd:ripngd/state/neighbors/neighbor/bad-packets-rcvd
367 */
368 static struct yang_data *
369 ripngd_state_neighbors_neighbor_bad_packets_rcvd_get_elem(
370 const char *xpath, const void *list_entry)
371 {
372 /* TODO: implement me. */
373 return NULL;
374 }
375
376 /*
377 * XPath: /frr-ripngd:ripngd/state/neighbors/neighbor/bad-routes-rcvd
378 */
379 static struct yang_data *
380 ripngd_state_neighbors_neighbor_bad_routes_rcvd_get_elem(const char *xpath,
381 const void *list_entry)
382 {
383 /* TODO: implement me. */
384 return NULL;
385 }
386
387 /*
388 * XPath: /frr-ripngd:ripngd/state/routes/route
389 */
390 static const void *
391 ripngd_state_routes_route_get_next(const void *parent_list_entry,
392 const void *list_entry)
393 {
394 /* TODO: implement me. */
395 return NULL;
396 }
397
398 static int ripngd_state_routes_route_get_keys(const void *list_entry,
399 struct yang_list_keys *keys)
400 {
401 /* TODO: implement me. */
402 return NB_OK;
403 }
404
405 static const void *
406 ripngd_state_routes_route_lookup_entry(const void *parent_list_entry,
407 const struct yang_list_keys *keys)
408 {
409 /* TODO: implement me. */
410 return NULL;
411 }
412
413 /*
414 * XPath: /frr-ripngd:ripngd/state/routes/route/prefix
415 */
416 static struct yang_data *
417 ripngd_state_routes_route_prefix_get_elem(const char *xpath,
418 const void *list_entry)
419 {
420 /* TODO: implement me. */
421 return NULL;
422 }
423
424 /*
425 * XPath: /frr-ripngd:ripngd/state/routes/route/next-hop
426 */
427 static struct yang_data *
428 ripngd_state_routes_route_next_hop_get_elem(const char *xpath,
429 const void *list_entry)
430 {
431 /* TODO: implement me. */
432 return NULL;
433 }
434
435 /*
436 * XPath: /frr-ripngd:ripngd/state/routes/route/interface
437 */
438 static struct yang_data *
439 ripngd_state_routes_route_interface_get_elem(const char *xpath,
440 const void *list_entry)
441 {
442 /* TODO: implement me. */
443 return NULL;
444 }
445
446 /*
447 * XPath: /frr-ripngd:ripngd/state/routes/route/metric
448 */
449 static struct yang_data *
450 ripngd_state_routes_route_metric_get_elem(const char *xpath,
451 const void *list_entry)
452 {
453 /* TODO: implement me. */
454 return NULL;
455 }
456
457 /*
458 * XPath: /frr-ripngd:clear-ripng-route
459 */
460 static int clear_ripng_route_rpc(const char *xpath, const struct list *input,
461 struct list *output)
462 {
463 /* TODO: implement me. */
464 return NB_OK;
465 }
466
467 /*
468 * XPath: /frr-interface:lib/interface/frr-ripngd:ripng/split-horizon
469 */
470 static int
471 lib_interface_ripng_split_horizon_modify(enum nb_event event,
472 const struct lyd_node *dnode,
473 union nb_resource *resource)
474 {
475 /* TODO: implement me. */
476 return NB_OK;
477 }
478
479 /* clang-format off */
480 const struct frr_yang_module_info frr_ripngd_info = {
481 .name = "frr-ripngd",
482 .nodes = {
483 {
484 .xpath = "/frr-ripngd:ripngd/instance",
485 .cbs.create = ripngd_instance_create,
486 .cbs.delete = ripngd_instance_delete,
487 },
488 {
489 .xpath = "/frr-ripngd:ripngd/instance/allow-ecmp",
490 .cbs.modify = ripngd_instance_allow_ecmp_modify,
491 },
492 {
493 .xpath = "/frr-ripngd:ripngd/instance/default-information-originate",
494 .cbs.modify = ripngd_instance_default_information_originate_modify,
495 },
496 {
497 .xpath = "/frr-ripngd:ripngd/instance/default-metric",
498 .cbs.modify = ripngd_instance_default_metric_modify,
499 },
500 {
501 .xpath = "/frr-ripngd:ripngd/instance/network",
502 .cbs.create = ripngd_instance_network_create,
503 .cbs.delete = ripngd_instance_network_delete,
504 },
505 {
506 .xpath = "/frr-ripngd:ripngd/instance/interface",
507 .cbs.create = ripngd_instance_interface_create,
508 .cbs.delete = ripngd_instance_interface_delete,
509 },
510 {
511 .xpath = "/frr-ripngd:ripngd/instance/offset-list",
512 .cbs.create = ripngd_instance_offset_list_create,
513 .cbs.delete = ripngd_instance_offset_list_delete,
514 },
515 {
516 .xpath = "/frr-ripngd:ripngd/instance/offset-list/access-list",
517 .cbs.modify = ripngd_instance_offset_list_access_list_modify,
518 },
519 {
520 .xpath = "/frr-ripngd:ripngd/instance/offset-list/metric",
521 .cbs.modify = ripngd_instance_offset_list_metric_modify,
522 },
523 {
524 .xpath = "/frr-ripngd:ripngd/instance/passive-interface",
525 .cbs.create = ripngd_instance_passive_interface_create,
526 .cbs.delete = ripngd_instance_passive_interface_delete,
527 },
528 {
529 .xpath = "/frr-ripngd:ripngd/instance/redistribute",
530 .cbs.create = ripngd_instance_redistribute_create,
531 .cbs.delete = ripngd_instance_redistribute_delete,
532 },
533 {
534 .xpath = "/frr-ripngd:ripngd/instance/redistribute/route-map",
535 .cbs.modify = ripngd_instance_redistribute_route_map_modify,
536 .cbs.delete = ripngd_instance_redistribute_route_map_delete,
537 },
538 {
539 .xpath = "/frr-ripngd:ripngd/instance/redistribute/metric",
540 .cbs.modify = ripngd_instance_redistribute_metric_modify,
541 .cbs.delete = ripngd_instance_redistribute_metric_delete,
542 },
543 {
544 .xpath = "/frr-ripngd:ripngd/instance/static-route",
545 .cbs.create = ripngd_instance_static_route_create,
546 .cbs.delete = ripngd_instance_static_route_delete,
547 },
548 {
549 .xpath = "/frr-ripngd:ripngd/instance/aggregate-address",
550 .cbs.create = ripngd_instance_aggregate_address_create,
551 .cbs.delete = ripngd_instance_aggregate_address_delete,
552 },
553 {
554 .xpath = "/frr-ripngd:ripngd/instance/timers/flush-interval",
555 .cbs.modify = ripngd_instance_timers_flush_interval_modify,
556 },
557 {
558 .xpath = "/frr-ripngd:ripngd/instance/timers/holddown-interval",
559 .cbs.modify = ripngd_instance_timers_holddown_interval_modify,
560 },
561 {
562 .xpath = "/frr-ripngd:ripngd/instance/timers/update-interval",
563 .cbs.modify = ripngd_instance_timers_update_interval_modify,
564 },
565 {
566 .xpath = "/frr-ripngd:ripngd/state/neighbors/neighbor",
567 .cbs.get_next = ripngd_state_neighbors_neighbor_get_next,
568 .cbs.get_keys = ripngd_state_neighbors_neighbor_get_keys,
569 .cbs.lookup_entry = ripngd_state_neighbors_neighbor_lookup_entry,
570 },
571 {
572 .xpath = "/frr-ripngd:ripngd/state/neighbors/neighbor/address",
573 .cbs.get_elem = ripngd_state_neighbors_neighbor_address_get_elem,
574 },
575 {
576 .xpath = "/frr-ripngd:ripngd/state/neighbors/neighbor/last-update",
577 .cbs.get_elem = ripngd_state_neighbors_neighbor_last_update_get_elem,
578 },
579 {
580 .xpath = "/frr-ripngd:ripngd/state/neighbors/neighbor/bad-packets-rcvd",
581 .cbs.get_elem = ripngd_state_neighbors_neighbor_bad_packets_rcvd_get_elem,
582 },
583 {
584 .xpath = "/frr-ripngd:ripngd/state/neighbors/neighbor/bad-routes-rcvd",
585 .cbs.get_elem = ripngd_state_neighbors_neighbor_bad_routes_rcvd_get_elem,
586 },
587 {
588 .xpath = "/frr-ripngd:ripngd/state/routes/route",
589 .cbs.get_next = ripngd_state_routes_route_get_next,
590 .cbs.get_keys = ripngd_state_routes_route_get_keys,
591 .cbs.lookup_entry = ripngd_state_routes_route_lookup_entry,
592 },
593 {
594 .xpath = "/frr-ripngd:ripngd/state/routes/route/prefix",
595 .cbs.get_elem = ripngd_state_routes_route_prefix_get_elem,
596 },
597 {
598 .xpath = "/frr-ripngd:ripngd/state/routes/route/next-hop",
599 .cbs.get_elem = ripngd_state_routes_route_next_hop_get_elem,
600 },
601 {
602 .xpath = "/frr-ripngd:ripngd/state/routes/route/interface",
603 .cbs.get_elem = ripngd_state_routes_route_interface_get_elem,
604 },
605 {
606 .xpath = "/frr-ripngd:ripngd/state/routes/route/metric",
607 .cbs.get_elem = ripngd_state_routes_route_metric_get_elem,
608 },
609 {
610 .xpath = "/frr-ripngd:clear-ripng-route",
611 .cbs.rpc = clear_ripng_route_rpc,
612 },
613 {
614 .xpath = "/frr-interface:lib/interface/frr-ripngd:ripng/split-horizon",
615 .cbs.modify = lib_interface_ripng_split_horizon_modify,
616 },
617 {
618 .xpath = NULL,
619 },
620 }
621 };