blob: 6b96c6df1ee39bf533368e91d7add74059a4a427 [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; }
12#pragma weak kernel_delete_ipv4 = kernel_add_ipv4
13int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; }
14#pragma weak kernel_delete_ipv6 = kernel_add_ipv6
15int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
16 unsigned int index, int flags, int table)
17{ return 0; }
18
19int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
20{ return 0; }
21
22int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
Paul Jakmad9d00a62007-04-10 19:28:04 +000023{
24 zlog_debug ("%s", __func__);
Paul Jakmacb9e0ce2008-04-20 00:31:57 +010025 SET_FLAG (b->conf, ZEBRA_IFC_REAL);
Paul Jakmad9d00a62007-04-10 19:28:04 +000026 connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
27 (b->destination ? &b->destination->u.prefix4 : NULL),
28 NULL);
29 return 0;
30}
31
32int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
33{
34 zlog_debug ("%s", __func__);
35 connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
36 (b->destination ? &b->destination->u.prefix4 : NULL));
37 return 0;
38}
Paul Jakma457eb9a2006-07-27 19:59:58 +000039
40void kernel_init (void) { return; }
41#pragma weak route_read = kernel_init