blob: 29c7881b994efa30ee60e745f87bab7e40d69d3b [file] [log] [blame]
Paul Jakma457eb9a2006-07-27 19:59:58 +00001/* NULL kernel methods for testing. */
2
Paul Jakma010ebbb2014-09-16 11:53:49 +01003/*
4 * Copyright (C) 2006 Sun Microsystems, Inc.
5 *
6 * This file is part of Quagga.
7 *
8 * Quagga is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * Quagga is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with Quagga; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 */
23
Paul Jakma457eb9a2006-07-27 19:59:58 +000024#include <zebra.h>
Paul Jakmad9d00a62007-04-10 19:28:04 +000025#include <log.h>
Paul Jakma457eb9a2006-07-27 19:59:58 +000026
27#include "zebra/zserv.h"
28#include "zebra/rt.h"
29#include "zebra/redistribute.h"
Paul Jakmad9d00a62007-04-10 19:28:04 +000030#include "zebra/connected.h"
Paul Jakma457eb9a2006-07-27 19:59:58 +000031
32int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020033#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000034#pragma weak kernel_delete_ipv4 = kernel_add_ipv4
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020035#else
36int kernel_delete_ipv4 (struct prefix *a, struct rib *b) { return 0; }
37#endif
38
Paul Jakma457eb9a2006-07-27 19:59:58 +000039int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; }
David Lamparterb2baffe2013-01-27 04:46:02 +010040#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000041#pragma weak kernel_delete_ipv6 = kernel_add_ipv6
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020042#else
43int kernel_delete_ipv6 (struct prefix *a, struct rib *b) { return 0; }
44#endif
45
Paul Jakma457eb9a2006-07-27 19:59:58 +000046int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
47 unsigned int index, int flags, int table)
48{ return 0; }
49
50int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
51{ return 0; }
52
53int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
Paul Jakmad9d00a62007-04-10 19:28:04 +000054{
55 zlog_debug ("%s", __func__);
Paul Jakmacb9e0ce2008-04-20 00:31:57 +010056 SET_FLAG (b->conf, ZEBRA_IFC_REAL);
Paul Jakmad9d00a62007-04-10 19:28:04 +000057 connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
58 (b->destination ? &b->destination->u.prefix4 : NULL),
59 NULL);
60 return 0;
61}
62
63int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
64{
65 zlog_debug ("%s", __func__);
66 connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
67 (b->destination ? &b->destination->u.prefix4 : NULL));
68 return 0;
69}
Paul Jakma457eb9a2006-07-27 19:59:58 +000070
71void kernel_init (void) { return; }
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020072#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
Paul Jakma457eb9a2006-07-27 19:59:58 +000073#pragma weak route_read = kernel_init
Doug VanLeuven327c4cd2012-12-14 14:58:30 +020074#else
75void route_read (void) { return; }
76#endif