blob: cdb6e23f0245c9d6e96959685747ef92286caee8 [file] [log] [blame]
Paul Jakma457eb9a2006-07-27 19:59:58 +00001/* NULL kernel methods for testing. */
2
3#include <zebra.h>
Paul Jakmad9d00a62007-04-10 19:28:04 +00004#include <log.h>
Paul Jakma457eb9a2006-07-27 19:59:58 +00005
6#include "zebra/zserv.h"
7#include "zebra/rt.h"
8#include "zebra/redistribute.h"
Paul Jakmad9d00a62007-04-10 19:28:04 +00009#include "zebra/connected.h"
Paul Jakma457eb9a2006-07-27 19:59:58 +000010
11int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020012#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000013#pragma weak kernel_delete_ipv4 = kernel_add_ipv4
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020014#else
15int kernel_delete_ipv4 (struct prefix *a, struct rib *b) { return 0; }
16#endif
17
Paul Jakma457eb9a2006-07-27 19:59:58 +000018int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; }
David Lamparterb2baffe2013-01-27 04:46:02 +010019#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000020#pragma weak kernel_delete_ipv6 = kernel_add_ipv6
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020021#else
22int kernel_delete_ipv6 (struct prefix *a, struct rib *b) { return 0; }
23#endif
24
Paul Jakma457eb9a2006-07-27 19:59:58 +000025int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
26 unsigned int index, int flags, int table)
27{ return 0; }
28
29int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
30{ return 0; }
31
32int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
Paul Jakmad9d00a62007-04-10 19:28:04 +000033{
34 zlog_debug ("%s", __func__);
Paul Jakmacb9e0ce2008-04-20 00:31:57 +010035 SET_FLAG (b->conf, ZEBRA_IFC_REAL);
Paul Jakmad9d00a62007-04-10 19:28:04 +000036 connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
37 (b->destination ? &b->destination->u.prefix4 : NULL),
38 NULL);
39 return 0;
40}
41
42int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
43{
44 zlog_debug ("%s", __func__);
45 connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
46 (b->destination ? &b->destination->u.prefix4 : NULL));
47 return 0;
48}
Paul Jakma457eb9a2006-07-27 19:59:58 +000049
50void kernel_init (void) { return; }
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020051#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000052#pragma weak route_read = kernel_init
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020053#else
54void route_read (void) { return; }
55#endif