Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 1 | /* NULL kernel methods for testing. */ |
| 2 | |
| 3 | #include <zebra.h> |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 4 | #include <log.h> |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 5 | |
| 6 | #include "zebra/zserv.h" |
| 7 | #include "zebra/rt.h" |
| 8 | #include "zebra/redistribute.h" |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 9 | #include "zebra/connected.h" |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 10 | |
| 11 | int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 12 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 13 | #pragma weak kernel_delete_ipv4 = kernel_add_ipv4 |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 14 | #else |
| 15 | int kernel_delete_ipv4 (struct prefix *a, struct rib *b) { return 0; } |
| 16 | #endif |
| 17 | |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 18 | int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 19 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA_PRAGMA |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 20 | #pragma weak kernel_delete_ipv6 = kernel_add_ipv6 |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 21 | #else |
| 22 | int kernel_delete_ipv6 (struct prefix *a, struct rib *b) { return 0; } |
| 23 | #endif |
| 24 | |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 25 | int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate, |
| 26 | unsigned int index, int flags, int table) |
| 27 | { return 0; } |
| 28 | |
| 29 | int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d) |
| 30 | { return 0; } |
| 31 | |
| 32 | int kernel_address_add_ipv4 (struct interface *a, struct connected *b) |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 33 | { |
| 34 | zlog_debug ("%s", __func__); |
Paul Jakma | cb9e0ce | 2008-04-20 00:31:57 +0100 | [diff] [blame] | 35 | SET_FLAG (b->conf, ZEBRA_IFC_REAL); |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 36 | 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 | |
| 42 | int 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 Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 49 | |
| 50 | void kernel_init (void) { return; } |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 51 | #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 52 | #pragma weak route_read = kernel_init |
Doug VanLeuven | 327c4cd | 2012-12-14 14:58:30 +0200 | [diff] [blame^] | 53 | #else |
| 54 | void route_read (void) { return; } |
| 55 | #endif |